ST7MC1xx/ST7MC2xx
MOTOR CONTROLLER (Cont’d)
10.6.7.5 Speed Measurement Mode
Motor speed can be measured using two methods
depending on sensor type: period measurement or
pulse counting. Typical sensor handling is de-
scribed here.
Incremental encoders allows accurate speed
measurement by providing a large number of puls-
es per revolution (ppr) with ppr rates up to several
thousands; the higher the ppr rate, the higher the
resolution. The proposed method consists of
counting the number of clock cycles issued by the
Incremental Encoder Interface (Encoder Clock)
during a fixed time window (refer to Figure 100).
The tachogenerator has a much lower ppr rate
than the encoder (typically factor 10). In this con-
text, it is more meaningful to measure the period
between Tacho Captures (i.e. relevant transitions
of the incoming signals). Accuracy is imposed by
the reference clock, i.e. the CPU clock (refer to
Figure 99).
Figure 99. Tachogenerator period acquisition using MTIM timer
Decreasing Speed
Comparator
Output
Tacho
Capture
Compare
Value
MTIM Counter
S
Value
Interrupts
CC
C
C
C
C
C
C
To interrupt generator
(Capture Event)
S
To interrupt generator
(Speed Error Event)
Figure 100. Encoder Clock frequency measure using MTIM timer
Decreasing Speed
Encoder
Clock
Capture
(triggered by software
or Real-time Clock)
MTIM Counter
Value
Interrupts
C
C
C
C
C
C
C
C
To interrupt generator
(Capture Event)
180/309
1