Quadrature Decoder (Q-Decoder)
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
459
21.2.2.3
Rotation Counter Measure
For Rotation device that needs absolute position, using a position counterto indicate the position is not intuitive enough. A Rotation counter is
designed to solve this problem.
If the index pulse signal is enabled (depending on IDX_EN) and the rotation counter mode is 0 (depending on RC_MOD), this rotation counter
increases or decreases (depending on the direction) by 1 on every index pulse. Fig 21-9 to Fig 21-12 give some cases.
If the index pulse signal is disabled (depending on IDX_EN) or the rotation counter mode is 1 (depending on RC_MOD), this rotation counter
increases or decreases by 1 for every position counter overflow (+1) or underflow (-1) occurred. Fig 21-13 illustrates this case.
+1
+1
+1
+1
199
+1
1
+1
+1
+1
+1
+1
+1
+1
+1
-1
-1
-1
-1
-1
-1
-1
2
3
198
199
0
1
2
198
197
196
1
0
199
198
PHA
PHB
PC
Index pulse
detection
RC
5
6
+1
-1
6
Direction
...
...
...
197
196
0
+1
7
...
Fig 21-13 Rotation count when RC_MOD = 1
21.2.3
Velocity Measurement
For some applications, for example, a flow meter, the software needs to use the position information with a time period to calculate the device
rotation speed.
The speed can be calculated with the following equation. The equation is to measure the position difference between the zero time events of
the velocity timer. The position difference can be obtained from the velocity counter or subtract two position counter capture values.
V
≒
△
X / T
≒
V-counter / V- Reload
≒
[P-counter capture(t) - P-counter capture(t-1)] / V- Reload
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03