
dsPIC30F Quadrature Encoder Interface Module
© 2005 Microchip Technology Inc.
Page 4
© 2005 Microchip Technology Incorporated. All Rights Reserved.
dsPIC30F Quadrature Encoder Interface Module
4
What is a Quadrature Encoder?
Phase A leads Phase B
Phase B leads Phase A
An example of the encoder output waveform is illustrated here.
In the upper plot we see the Phase A and Phase B signals coming in on the
QEA and QEB pins respectively. In this case, Phase A leads Phase B: the shaft
is spinning forward. If we reverse the rotor rotation, like in the lower part of the
figure, Phase B will lead Phase A: so by detecting which rising edge comes
first, we are able to detect the direction of rotation.
The encoder outputs can only have four different states as indicated in the
figure: 01, 00, 10, 11. Note that if we reverse the direction the sequence is
reversed as well.
The index occurs only once per revolution and is used to establish an absolute
position.
The quadrature decoder, which is part of the interface circuitry, will read these
signals and converts them into a numeric count of the position pulses. The
count will increment when the shaft is rotating in one direction and will
decrement when the rotation is reversed.