Skip to content

Files

Latest commit

fbc0f2f · May 12, 2022

History

History
95 lines (59 loc) · 2.06 KB

Bouncing.md

File metadata and controls

95 lines (59 loc) · 2.06 KB

Banner

Quadrature Signals

Manually operated encoders typically generate a
quadrature output consisting of two rectangular
signals which are phase shifted by 90° .



Each edge of the two phases can be used to generate a count pulse.
4 Counts / Period

   The direction of the rotation defines what phase is leading.




Bouncing

The graph shows that at each transition:

Type Observation
    Digital     Only one signal changes its state
 Mechanical  Only one switch is operated



Uses

Counting algorithms take advantage of this fact and can
thus provide absolutely bounce free encoder position, if
implemented correctly.

Libraries like the standard Encoder library do exactly this.


Interpretation

Basically this works as one switch will always bounce
at the transition while the other has a stable state.

Because of this, the counter automatically interprets
the bouncing as rapid up / down counts but after the
bouncing stops it will end up at the correct position.


Clarification

At first glance it may look like it would be necessary to
catch every bounce pulse to determine the correct result.

Despite some libraries using pin change interrupts
to catch them, this is in fact not actually necessary.

Example

Missing a bounce transition is the same as
erasing the transition in the above graph.

Thus if you were to sum up the new ±1 sequence
you'd still end up with the same result as before.