Hardware Reference
In-Depth Information
Magnets
Hall-effect
transistor
t
T
/2
T is the time for one revolution
Figure 8.54 The output waveform of the Hall-effect transistor
Assume that a Hall-effect transistor is mounted on the armature (stator) of a DC motor and
two magnets are mounted on the shaft (rotor). As shown in Figure 8.54, every time the mag-
net passes by the Hall-effect transistor, a pulse is generated. The input-capture function of the
HCS12 can capture the passing time of the pulse. The time between two captures is half of a
revolution. Thus the motor speed can be calculated. By storing the value of the capture registers
each time and comparing it with its previous value, the controller can constantly measure and
adjust the speed of the motor. Using this method, a motor can be run at a precise speed or be
synchronized with another event.
V CC
V CC
HCS12
SN754410
16
3
1
8
2
7
15
13
12
PWM3
PP7
6.8 μ F
0.33
μ
F
4
5
9
10
11
M
6
14
NC
V CC
V CC
6.8
μ
F
1
PT0
30137
2
10 k
Ω
3
All diodes are the same and could be any one of the 1N4000 series
Hall-effect
switch
Figure 8.55 Schematic of an HCS12-based motor-control system
The schematic of a motor-control system is illustrated in Figure 8.55. The PWM output
from the PWM3 pin is connected to one end of the motor, and the PP7 pin is connected to the
other end of the motor. The circuit is connected so that the motor will rotate clockwise when
the voltage of the PP7 pin is 0 while the PWM output is nonzero (positive). The direction of
 
Search WWH ::




Custom Search