Programming Question to sense the stoppage of encoder counts

Rob S.

Member
Join Date
Sep 2008
Location
Maryland
Posts
739
Good Morning,

I am building a machine , and I have a side plate with pneumatic cylinders that have a incremental encoder on it. This side will travel in till it hits the product. The size of the product varies in size , so I really don't know how far the side needs to travel. I want it to squeeze the product tight. I don't want the operator to adjust a sensor all the time, so I am thinking of just looking to see if the incremental encoder stops counting , to verify that the side is against the product. I am thinking what code I can write to determine this stoppage. I am using ControlLogix 1756-HSC ( RS Logix 5000). Do you folks have any ideas ?

Thanks, and have a great day.
 
Rob,

Could you not use a (suitably rated) pressure switch in the pneumatic cylinder line to detect product resistance?

Rob
 
How fast does your encoder input vary? You have to program according to that.For example, just move the encoder value to a memory every second and subtract the live value from this stored value. If the result of that subtraction is 0 for more than a certain time(set according to the normal rate of change of your encoder value) enable a bit to indicate that your piston has stopped moving.
 
You could store the encoder position in a separate register with each program sweep and compare "current encoder value" with "encoder value of previous sweep". If x number of sweeps occur without a change in value, then motion has stopped.
 
The way I would probably approach it would be to first set up a time interval for checking the encoder, dependent on your application but say every 250 ms. At every 250 ms increment, compare the HSC accumulator to a tag which represents the accumulator value from the previous reading. If the difference is greater than some threshold value (close to zero but dependent on your encoder resolution) then you know you're still moving. Transfer the current accumulator reading to the previous-reading tag and start the timer again.
 
How many counts?
You can do that with a free running timer, around 100ms or so.
Make some tags:
HSCE_Count - Actual Counter Value from HSCH
Delta_Timer - TIMER
Last_Scan_Count - DINT
Scan_Delta_Count - DINT
In_Motion - Bool

BST XIO Delta_Timer.DN TON Delta_Tmr 100 0 NXB XIC Delta_Timer.DN BST SUB HSCE_Count Last_Scan_Count Scan_Delta_Count MOV HSCE_Count Last_Scan_Count NXB GRT Scan_Delta_Count 0 OTE In_Motion BND BND

You might have to play around with the compare value for the GRT instruction.
 

Similar Topics

I'm been deciphering a program for a press here. I've gotten most of it deciphered using the manual to understand the instructions (first mitsu...
Replies
11
Views
309
Hello. Was just curious, if it is possible to load an image from an SD card on to a Compactlogix PLC that came straight out of the box brand new...
Replies
4
Views
547
Hi All, Looking for advice on programming MicroLogix 1400 with RSLogix500. Basically, I have a client who requested I make a "simple" program...
Replies
19
Views
3,218
How do you code it to when you push a button attached to X001, it turns on Y001. Then, the next time you push the button attached to X001 it...
Replies
4
Views
1,616
I am just finishing up my project, which was my first experience with PLCs. I thank everyone that has helped me work through the RIO and analog...
Replies
11
Views
2,970
Back
Top Bottom