Hi all,
I am working with an incremental encoder (ABZ signals, 360 ppr (so 1440 counts per rev)) to replace the existing "manual" encoder wheel I have in my device. This is for a medical device with 2 footplates that cycle through steps via a linkage system, so 1 revolution = 1 stride = 2 steps (1 right and 1 left step)). My goal is to get total steps taken.
The way I was doing this is by taken total counts (EncoderPosition) and dividing by 720 (counts in half rev for one step). But when I do this I count up to 46, then this negates to -46 and counts back down and repeats. I believe this is because the module I am using for this sensor has max count of 32767, so it increments up to this value, negates, and counts back to 0.
I attached my relevant code, does anyone know a way to approach this given my count limit? Thanks in advance!
I am working with an incremental encoder (ABZ signals, 360 ppr (so 1440 counts per rev)) to replace the existing "manual" encoder wheel I have in my device. This is for a medical device with 2 footplates that cycle through steps via a linkage system, so 1 revolution = 1 stride = 2 steps (1 right and 1 left step)). My goal is to get total steps taken.
The way I was doing this is by taken total counts (EncoderPosition) and dividing by 720 (counts in half rev for one step). But when I do this I count up to 46, then this negates to -46 and counts back down and repeats. I believe this is because the module I am using for this sensor has max count of 32767, so it increments up to this value, negates, and counts back to 0.
I attached my relevant code, does anyone know a way to approach this given my count limit? Thanks in advance!