Encoder Sensor Counts and RPM Logic

afm

Member
Join Date
Aug 2023
Location
Tennessee
Posts
88
Hi all,

I am implementing an incremental encoder sensor (ABZ) to replace the existing "manual" encoder wheel I have in my device. This is a 360 ppr (so 1440 counts per rev). This is for a medical device with 2 footplates that cycle through steps via a linkage system (1 revolution = 1 stride = 2 steps (1 right and 1 left step)). I need the encoder to do the following:
  • count total steps taken
  • live position readout (0-359 degrees)
  • create position "zones" (use one footplate as the reference since right and left foot will be inverse)
    • 0 degrees = "home" position when footplates are together
    • 90 degrees = "right foot front extreme" (right foot at the front extreme of the step)
    • 180 degrees = "feet together" (right and left footplates are passing by each other)
    • 270 degrees = "right foot back extreme" (right foot at the back extreme of the step)
  • Live RPM
I have some of this math done in an ST action file in my ladder program. I have the live total counts (EncoderPosition) and the latched total counts (EncoderCounterLatch), this latched value only updates at the Z signal once per rev. The difference between the EncoderPosition and EncoderCounterLatch should always be between 0-1440, so using this I know the position in degrees:

ActualPosition := EncoderCounterLatch - EncoderPosition;
ActualPosition := ActualPosition / 4;

I also made my "zones" using the above degree locations +/- 10 degrees. When I test this software and monitor it live (both manually turning the encoder and when turning via a motor at 80 rpm), it worked fine several times (degree position and zones were accurate). After testing some more, I found that the step counter would increment up to 45, negate to -46, then increment up to 45 again. I also found that the EndcoderPosition was updating fine, but the EncoderCounterLatch was not updating every revolution... this caused the Actual Position to exceed 360 degrees and the zones to not work properly. I am unsure if the software is acting unusual due to me watching it in monitor mode, perhaps the processing speed to catch the z pulses was bogged down by the monitor mode which resulted in the counter latch not updating appropriately? I will try adding these metrics to my UI in case the system is bogged down by viewing it live. Does anyone see an issue with the logic or see a better way to do this?


1709679348493.png

1709679452514.png
1709679657090.png
1709679683768.png
 
Last edited:

Similar Topics

Hello, I'm wondering if anyone knows of an industrial sensor similar to what is used for positioning the pointer of a mouse (on an optical...
Replies
6
Views
1,999
I've only found documentation on hooking up a simodrive absolute position sensor to PROFIBUS but not SSI. Having a FM 452 which has SSI...
Replies
3
Views
4,397
Sorry in advance for the long post, but this requires a little back story. I work in a facility with a couple hundred VFDs Most are in a web...
Replies
14
Views
220
I have an application using an incremental encoder and then I convert it to degree (0-360) using calculation program. For a while, the calculation...
Replies
8
Views
291
Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
1,020
Back
Top Bottom