Rotation problem

BeamMEUp123

Member
Join Date
Oct 2009
Location
NB
Posts
11
I don't know if this is a difficult problem or not, because I rarely write programs for PLC's, and when I do they are relatively simple. I need to sense direction on a shaft using two sensors. I am using RSlogix 500 and I seem to be running into a problem. All I really need to do is know if the shaft is going clockwise or counter-clockwise. If clockwise I will enable one output, and if counter-clockwise I will enable a different ouput. Thanks for your time and any help you can give.


Scott
 
You'll need more then two sensors if they are your home switches, you'll need two more and both could be located on either side of your current switches. You can get by with one more and use a timer to catch if its moving the other way but that can be dangerous to your process (the other prox fails for example).

If they aren't home switches then you can just see which one pulses first.

Any details on the application?
 
You'll need to know the rotational speed of the shaft and the amount of time the target takes to move between sensors. If the shaft is turning rapidly then this application may require the use of high speed inputs and interrupts.

More information about the size of the shaft, the angle between the sensors, and the RPM of the shaft is needed. Also depending on what you are trying to do there might be an easier way, so a bit of info on the application could be useful.
 
A tach generator may work well for this. Polarity would change with direction of rotation. The difficulty I see with this is at low RPM and when reversing and crossing zero.
You give no info on RPMs so that is best I can dowithcrystal ball.


dan bentler
 
Sorry for the vague info. The speed is variable from around 20 RPM - around 300 RPM. I do not care about a home position, so I think two sensors should be enough. There is no kind of danger to personal if one of the sensors fail. We are designing everything ourselves, so what ever will work is what I want to do. I have tried to you latches in a program but was unable to make it work.


Thanks for the quick responses.
 
Look up Quadrature Encoder and see the waveforms for a hint. Then fashion 2 'flags' on the shaft and use 2 prx. switches to pick them up.

Each 'flag' covers 180 deg. rotation. They overlap by 90 deg. Both prx. switches are side by side.

Look at the leading (rising) edge of prx. #1 signal, if prx. #2 is on you're going one direction, if it's off you're going the other direction.
 
Can you put a flag on the shaft (optical), protruding screw (prox), or can you put reflective tape on it?
Two sensors about 90 degrees from each other. When you see one, start a timer looking for the other. Timer running + second flag true equals rotation. You need 2 timers, and lock them out from each other so they are mutually-exclusive.
Another way is with a roller and a switch. Switch is center-off. Direction causes switch to flip one way or the other. This may lead to mechanical problems in the future.
Edit: I see theDave2 said the same thing.
 
theDave2's method doesn't require any timers. The other physical arrangement is 1 'flag' which covers 180 degrees of rotation and put the proxes 90 degrees apart sensing the same flag. If neither prox is covered then as the flag comes around it will make one of the proxes. 90 degrees late it will make the other but the first is still on. 90 degrees later it will fall off the first prox. Then after another 90 degrees it will fall off the second. Obviously for the last 90 degrees neither prox is made.
 
Last edited:
At only 300 RPM with sensors 90 degrees apart you have 50 milliseconds between sensors. So as long as your PLC scan time plus your sensor response time is less than 25mS you should have no problem using a couple of prox switches and 180 degree target(s). If however you were turning at 1760 RPM that would be another problem.

So to use the method suggested by Dave or Berine your logic could look something like whats below. Your application may require that you add logic to allow for a startup delay before setting the forward or reverse bits. If using a Mircologix1100, 1200, 1400, or 1500 change the OSR to an ONS. Hope its enough to get you started.

a102909.JPG
 
theDave2's method doesn't require any timers. The other physical arrangement is 1 'flag' which covers 180 degrees of rotation and put the proxes 90 degrees apart sensing the same flag. If neither prox is covered then as the flag comes around it will make one of the proxes. 90 degrees late it will make the other but the first is still on. 90 degrees later it will fall off the first prox. Then after another 90 degrees it will fall off the second. Obviously for the last 90 degrees neither prox is made.

Thanks to everyone who has post to help.

I have opted to use the above advise, however I do not understand the results I am getting


....Sensor B ........Sensor A ....Rev .......For
-----|OSR|-------------| |--------|/|--------( )-----------
....//.I:0/1..... |.....///.. I:0/0..... ,O:0/1..... O:0/0
.... ...............|
...... .....;;......| ...Sensor A ....For .......Rev
....... ....,,,.....|---------|/|--------|/|--------( )-----------
...................,,,,,,,,,,,...I:0/0....... O:0/0 .....O:0/1


I am using a Micrologix1000 and I am getting the outputs 0 and 1 to flash. Shouldn't the One Shot Rising only activate once every 360 degree revolution, and only one of the outputs should come on.

Any advice is welcome

Scott
 
Sensor B should be on an XIC or -| |- and then place your [OSR] right after that with an address of something like B3:0/0. B3:0/0 is only an example, you will need to find one that is not currently being used.

Hope this helps
 
Actually I don't think it does make sense. B3:0/0 is an internal bit, and how does the program know when it transitions from a low to a high.

Please explain
 
Note: your code and Alaric's example will only give you direction output pulses lasting one scan. You'll need some additional logic following it to latch and hold until the shaft changes direction or stops rotating.
 

Similar Topics

Hello everyone. I am trying to figure out what the best way to control three pumps would be. I have searched the forums and cannot seem to find...
Replies
8
Views
1,969
Hello all, I am working on a project in FactoryTalk SE. Suddenly while working on a new screen, the global objects I am copying to it are not...
Replies
0
Views
1,254
Good evening once again everyone, I have a Lenze ESV222..... I would like to set it for use with Local keypad and my concern is the rotation...
Replies
0
Views
953
WARNING 🤷 ELECTRICAL NOT PLC I finally got myself a phase rotation meter cause its so hard to tell a well guarded motor's rotation. I also...
Replies
29
Views
10,563
Easybuilder Pro. Loving it, but I can't figure out how to simply rotate an object. I don't mean with animation, or based on value. Simply put a...
Replies
6
Views
3,121
Back
Top Bottom