Encoders: background info

The encoders that I use are PEC11R types
with 24 Pulses per 360 ° Rotation.
The spec. can be found at the link below
http://www.bourns.com/data/global/pdfs/PEC11R.pdf

@ Electrical Characteristics you find:
Contact Bounce (15 RPM)…2.0 ms maximum**
RPM (Operating) …60 maximum**

that is 60/60, you may have one revolution per second
that is 24 times the Quadrature Output Table a second
so the Quadrature Output Table minimum time is
1/24 = 42ms !
D is the death point in the Quadrature Output Table.

in reality:

overkill:

Suggested Filter Circuit ( de-bounce )
‘without’ on GPIO inputs in yellow:

‘with’ on MCP23017 inputs:
measured on the encoder in yellow
measured on the MCP23017 input in blue

Great info!
PEC11R is the encoder type i use for my zynthians and for the kits.

Regarding the debounce, zyncoder library implements debouncing by software, but a hardware debouncing filter will be desirable. How did you implement the debouncing filter for the measures? An RC filter? Do you think it could be done with a single capacitor?

Regards!

Hi jofemodo

Debouncing by software: each spike triggers 2 times the ISR !
In the PDF you find on page 2 "Suggested Filter Circuit"
and without internal pull-ups (RPi=50k MCP230xx=100k)

An attentive viewer will have seen on my photos that the 100nF capacitor at the switches is not present.
Discharging the capacitor on the contact without resistor corpse me not conducive for the life of the contact.
The “Suggested Filter Circuit” has an additional advantage:
If by any reason a input becomes a output,the encoder-switch contacts never make a short-circuit.
When that happens, it is the end of the I/O on a RPI
possibly a stop by the disappearance of the supply voltage by the short circuit
and the chance of a crashed OS. I have experience with it.