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:
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?
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
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?
Last edited: