All of the Abs2Qep translation
calculations are handled by the C28x. Based on the results, the CLB tile is then
configured to generate the specific QEP signals. The CLB configuration is detailed in
Section 4.3.
Note: The parameters used in the
translation equations are configurable in the Abs2Qep library header file. This
includes: absolute encoder resolution, incremental encoder lines per revolution, drive
maximum revolutions per minute.
The Abs2Qep
translation uses the ratio ABS_TO_INCR to map a change in absolute position to a
corresponding number of QEP edges. Any fraction of an edge is tracked. If the fractional
edge accumulation reaches 1, then an additional edge is generated.
Equation 1.
where
- LINES_PER_REV is the incremental
encoder resolution.
- QCLK_PER_LINE is typically 2. One
for QEP-A and one for QEP-B.
- ABS_MAX_POSITION =
2ABS_ENCODER_RESOLUTION. For example 220.
The number of QCLKs, or QEP edges, that
represent a change in position is:
Equation 2.
where:
- DELTA_ABS_POSITION = ABS_POSITION(n)
- ABS_POSITION(n-1) the change in absolute position between the current sample (n)
and the previous sample (n-1).
- QCLK is the total number of QEP-A +
QEP-B edges required to represent the change in position.
Note: This simple translation in
Equation 2 assumes absolute zero was
not crossed. For zero-cross detection, see
Section 4.2.3
For a given position change, the frequency
of QCLK is such that the edges are equally divided across the position sampling period.
This frequency is expressed in terms of CLB clock cycles.