Page 1 of 1

Rotary encoder: 4 counts per click?

Posted: Wed Dec 20, 2017 7:49 pm
by MJU
Am I missing something? Probably I do :D

I've made a simple Flowchart with a GLCD and a rotary encoder.
The encoder triggers an interrupt and if the "check for change" macro doesn't return 255 the counter is read.

But each click gives me an increace or decrease of 4...
I've tried several changes for the encoder (fast/medium/slow) but this error is persistent.

What am I doing wrong?
Thanks

Re: Rotary encoder: 4 counts per click?

Posted: Wed Dec 20, 2017 8:24 pm
by Benj
Hello,

I've experienced this.

For each click of the encoder it travels through 4 states hence the output count of 4. Not sure why but it's normal.

Simply divide the number by 4 (or right shift the value by 2 for efficiency) to collect the click count.

Re: Rotary encoder: 4 counts per click?

Posted: Wed Dec 20, 2017 9:57 pm
by alanwms
The reason it is called a "quad" encoder, is because it counts the state change of each edge. Since there are 4 edges per cycle, that would equate to 4 counts per "count".
Your encoder is probably mechanically indented creating the sine and cosine signal. For a no indented encoder (such as on a motor) it would be possible to count a single edge.
The advantage of this is that the encoder resolution for a 200 count/rev encoder would be 800 counts per revolution. Creating better resolution

Hope this throws some light on the subject.