[chbot] Fixing bouncing rotary encoder

Volker Kuhlmann list0570 at paradise.net.nz
Sun Nov 6 09:56:16 GMT 2016


On Sun 06 Nov 2016 20:22:10 NZDT +1300, Charles Manning wrote:

> Generally, the worst is to use an edge detect interrupt to do switch
> detection.

Yup. The Internet is full of bad advice. There is one case where you
have to do it though: for shaft encoders going at high revs, and you
have to add propr hardware debouncing. Polling won't be fast enough
(1kHz interrupts for switch reading is polling too).

> Volker: One neat trick might be to disconnect the encoder then use some
> circuit to recondition the signal to pass through to the rest of the
> system.

Yes that had occurred to me too. Let's say I'm using solutions in the
order of how involved things get, i.e. I wanted to try the quick fix
first. It's a cheap mechanical encoder on the front panel of a power
supply, encapsulated, making fluff build-up unlikely. I have a
replacement (from Element14 so must last...) that fits but only trying
will show if it works. They have different switching behaviour. I have a
pile here that produce 4 counts per click, where 1 seems common and 2
not unheard of.

Thanks everyone,

Volker

-- 
Volker Kuhlmann
http://volker.top.geek.nz/	Please do not CC list postings to me.



More information about the Chchrobotics mailing list