Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using proximity sensors to detect rotational direction 1

Status
Not open for further replies.

djf816

Electrical
Sep 7, 2010
1
0
0
CA
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
 
Replies continue below

Recommended for you

Physically mount the switches so they switch 90 degrees apart. This will give you a quadrature output. then refer to the card module instructions to configure it.

Ed
 
to detect directional rotation you need a minimum of two sensing devices.
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
 
You will also want a home signal, and end of travel hardwired limits.

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
 
Status
Not open for further replies.
Back
Top