Using proximity sensors to detect rotational direction
Using proximity sensors to detect rotational direction
(OP)
Hello,
I am looking for some sample code that can be used on a controllogix processor that will determine the rotation of a gear wheel with two proximity sensors. The proximity sensors are tied to a 1756-HSC card as they are also being used as a crude encoder to give a rough esitmate of travel distance.
Any help is appreciated
I am looking for some sample code that can be used on a controllogix processor that will determine the rotation of a gear wheel with two proximity sensors. The proximity sensors are tied to a 1756-HSC card as they are also being used as a crude encoder to give a rough esitmate of travel distance.
Any help is appreciated





RE: Using proximity sensors to detect rotational direction
RE: Using proximity sensors to detect rotational direction
Ed
RE: Using proximity sensors to detect rotational direction
They should both produce a square wave
You want the square wave to overlap..say by 90 degrees
In the software you want to detect the falling and rising edges
Call it sensor A and B
If sensor A has a rising edge and then 90 degrees on... sensor B has a rising edge...before any falling edges have been detected then the movement is from A to B and visa versa for the other direction.
The falling edges must be used to reset the rising edge flags..........
Not the best explanation but if you draw out the two square waves overlapping..it starts to make sense
The other possible way is to use time to measure the time travelled...if the sensors are displaced by 90 degrees then there is two separate travelling distances i.e. 90 degrees and 270 degrees....but I personally think it's poor design to rely on timers
RE: Using proximity sensors to detect rotational direction
I once had a sevice call to a PLC in a welding shop when the input from the encoder saw a spike and told the PLC code it was a 1m short of the target, unfortunately the machine was only 1.2m long. The 100ton hydralic cylinder sheared off a 150mm x 150mm cast endstop, as it tried to go to the required position. No end of travel limits on machine to of stopped damage.
I also saw the same thing on a robot once- lack of a $15 limit caused 2wks lost production.
regards
stablefordd