
© 2005 Microchip Technology Inc. Preliminary DS70155C-page 27
dsPIC33F
8.4 Quadrature Encoder Interface
(QEI) Module
Quadrature encoders (also referred to as incremental
encoders or optical encoders) are used in position and
speed detection of rotating motion systems.
Quadrature encoders enable closed-loop control of
many motor control applications, such as Switched
Reluctance (SR) Motor and AC Induction Motor
(ACIM).
Typically, three outputs termed, Phase A, Phase B and
INDEX, provide information that can be decoded to
provide information on the movement of the motor
shaft, including distance and direction.
A quadrature decoder captures the phase signals and
index pulse and converts the information into a numeric
count of the position pulses. Generally, the count will
increment when the shaft is rotating one direction and
decrement when the shaft is rotating in the other
direction.
The QEI module (Figure 8-3) includes:
• Three input pins for two phase signals and index
pulse
• Programmable digital noise filters on inputs
• Quadrature decoder providing counter pulses and
count direction
• 16-bit up/down position counter
• Count direction status
• x2 and x4 count resolution
• Two modes of Position Counter Reset
• General Purpose16-Bit Timer/Counter mode
• Interrupts generated by QEI or counter events
FIGURE 8-3: QUADRATURE ENCODER INTERFACE BLOCK DIAGRAM
16-Bit Up/Down Counter
Comparator/
Max Count Register
Quadrature
Programmable
Digital Filter
QEA
Programmable
Digital Filter
INDX
1
Up/Down
Existing Pin Logic
UPDN
3
Encoder
Programmable
Digital Filter
QEB
Interface Logic
QEIM<2:0>
Mode Select
3
(POSCNT)
(MAXCNT)
PCDOUT
QEIIF
Event
Flag
Reset
Equal
2
T
CY
1
0
TQCS
TQCKPS<1:0>
2
1, 8, 64, 256
Prescaler
Q
QD
CK
TQGATE
QEIM<2:0>
Synchronize
Det
1
0
Sleep Input
0
1
UPDN_SRC
QEICON<11>
Zero Detect
0
Comentarios a estos manuales