gpiozero icon indicating copy to clipboard operation
gpiozero copied to clipboard

RotaryEncoder - Increase resolution feature request

Open KevWal opened this issue 2 years ago • 5 comments

The Rotary Encoder currently increments 'steps' once per full High / Low, on A and B event. The resolution of the encoder could be increased by incrementing (/ decrementing) 'steps' for each and every High / Low event on both encoder A and B - increasing the resolution available by a multiple of 4 for any specific encoder.

Using an encoder to measure motor speed, and measuring it at a rate of 10hz, I don’t get a lot of 'steps' per 1/10th second currently to accurately determine speed.

The feature would quadruple the available resolution.

Thanks very much Kevin

KevWal avatar Aug 03 '23 10:08 KevWal

I've only got a very basic understanding of rotary encoders, but does what you're asking for assume that the rotary encoder is only moving in one direction? :shrug:

lurch avatar Aug 03 '23 12:08 lurch

Hi, no, can still turn both ways, inc'ing or dec'ing the steps as needed. I guess in a change of direction situation you might get a couple of pulses wrong.

See the section "Achieving higher resolution with Quadrature Encoders" here: https://www.dynapar.com/technology/encoder_basics/quadrature_encoder/

Or actually a google brings up quite a few interesting results: https://www.google.com/search?q=quadrature+encoder+resolution+interpolation

Thanks very much Kev

KevWal avatar Aug 03 '23 13:08 KevWal