Description
823
SPRUH22I – April 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
C28 Enhanced QEP (eQEP) Module
The encoder count (position) is read once during each unit time event. The quantity [x(k) - x(k-1)] is
formed by subtracting the previous reading from the current reading. Then the velocity estimate is
computed by multiplying by the known constant 1/T (where T is the constant time between unit time
events and is known in advance).
Estimation based on
has an inherent accuracy limit directly related to the resolution of the
position sensor and the unit time period T. For example, consider a 500-line per revolution quadrature
encoder with a velocity calculation rate of 400 Hz. When used for position the quadrature encoder gives a
four-fold increase in resolution, in this case, 2000 counts per revolution. The minimum rotation that can be
detected is therefore 0.0005 revolutions, which gives a velocity resolution of 12 rpm when sampled at 400
Hz. While this resolution may be satisfactory at moderate or high speeds, e.g. 1% error at 1200 rpm, it
would clearly prove inadequate at low speeds. In fact, at speeds below 12 rpm, the speed estimate would
erroneously be zero much of the time.
At low speed,
provides a more accurate approach. It requires a position sensor that outputs a
fixed interval pulse train, such as the aforementioned quadrature encoder. The width of each pulse is
defined by motor speed for a given sensor resolution.
can be used to calculate motor speed by
measuring the elapsed time between successive quadrature pulse edges. However, this method suffers
from the opposite limitation, as does
. A combination of relatively large motor speeds and high
sensor resolution makes the time interval
Δ
T small, and thus more greatly influenced by the timer
resolution. This can introduce considerable error into high-speed estimates.
For systems with a large speed range (that is, speed estimation is needed at both low and high speeds),
one approach is to use
at low speed and have the DSP software switch over to
when the motor speed rises above some specified threshold.
9.2
Description
This section provides the eQEP inputs, memory map, and functional description.
9.2.1 EQEP Inputs
The eQEP inputs include two pins for quadrature-clock mode or direction-count mode, an index (or 0
marker), and a strobe input. The eQEP module requires that the QEPA, QEPB, and QEPI inputs are
synchronized to SYSCLK prior to entering the module. The application code should enable the
synchronous GPIO input feature on any eQEP-enabled GPIO pins (see the
System Control and
Interrupts
chapter for more details).
•
QEPA/XCLK and QEPB/XDIR
These two pins can be used in quadrature-clock mode or direction-count mode.
–
Quadrature-clock Mode
The eQEP encoders provide two square wave signals (A and B) 90 electrical degrees out of phase
whose phase relationship is used to determine the direction of rotation of the input shaft and
number of eQEP pulses from the index position to derive the relative position information. For
forward or clockwise rotation, QEPA signal leads QEPB signal and vice versa. The quadrature
decoder uses these two inputs to generate quadrature-clock and direction signals.
–
Direction-count Mode
In direction-count mode, direction and clock signals are provided directly from the external source.
Some position encoders have this type of output instead of quadrature output. The QEPA pin
provides the clock input and the QEPB pin provides the direction input.
•
QEPI: Index or Zero Marker
The eQEP encoder uses an index signal to assign an absolute start position from which position
information is incrementally encoded using quadrature pulses. This pin is connected to the index
output of the eQEP encoder to optionally reset the position counter for each revolution. This signal can
be used to initialize or latch the position counter on the occurrence of a desired event on the index pin.
•
QEPS:
Strobe Input
This general-purpose strobe signal can initialize or latch the position counter on the occurrence of a
desired event on the strobe pin. This signal is typically connected to a sensor or limit switch to notify
that the motor has reached a defined position.