O'Reilly logo

Microcontroller Programming and Interfacing Texas Instruments MSP430 by Daniel J. Pack, Steven F. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10.3. MOTOR SPEED CONTROL 337
putchar(’W’);
P4OUT = 0x0f; //illuminate LED 15 (F)
}
}
//***********************************************************************
10.3 MOTOR SPEED CONTROL
In this project,we stabilize the speed of a 24 VDC motor using an optical tachometer.The tachometer
provides three channels of information. Two of the channels are quadrature related (90 degrees out
of phase with one another) with a 0.5 V peak sinusoidal output. The third channel provides a single
pulse index signal for every motor revolution as shown in Figure 10.9 [Brother].
Prior to using a motor in an application, it is important to characterize its operational speed
under different applied voltages.This may be done using a variable power supply with suitable current
capability and a frequency counter. The voltage applied to the motor may be slowly incremented
to the maximum specified value while the frequency counter may be used to count pulses from the
optical tachometer.
In this project, we use a Brother 24 VDC, 1500 revolutions per minute [RPM] motor. We
assume the motor has a linear relationship between applied voltage and motor speed. For example,
if the voltage provided to the motor is 12 VDC, the motor will rotate at 750 RPM.
The motor speed will be set with an external potentiometer. When the potentiometer is set
for 0 volts, the desired motor speed will be 750 RPM. When the potentiometer is set for 3.3 VDC
to motor will run at 1500 RPM. Other speeds are achievable by choosing potentiometer settings
between these two values.
To determine motor speed, the input capture feature of the timer system will be used. We use
the index signal from the motor. It provides a pulse for each motor revolution. The input capture
system will be used to determine the time of each index signal event. This information is used to
determine motor speed in RPM as shown in Figure 10.10.
10.4 CIRCUIT DIAGRAM
We employ the pulse width modulation system of the MSP430 to set the motor speed as determined
by the potentiometer setting. We equate a potentiometer setting of 0 VDC to a 50% duty cycle (12
VDC effective voltage applied to motor); whereas, a 3.3 VDC setting corresponds to a 100% duty
cycle (24 VDC effective voltage applied to motor). The motor speed and duty cycle will be displayed
on an LCD as shown in Figure 10.11.
In this application, the PWM baseline frequency may be set to a specific frequency. The duty
cycle will be varied to adjust the effective voltage delivered to the motor. For example, a 50% duty
cycle will deliver an effective value of 50% of the DC motor supply voltage to the motor.
338 10. SYSTEM LEVEL DESIGN
M
DC motor
supply voltage
optical
solid state relay
MOSFET
protection
diode
+
-
V
DD
R
I
SSR
74LVC04
from
micro
G
D
S
I
motor
R
G
+
-
b) 24 VDC, 1500 RPM motor with optical tachometer [Brother]
optical
tachometer
a) motor interface circuit
c) 3-channel optical tachometer output
CH A
CH B
0.5 VDC
Index
200 cycles
per revolution
1 per revolution
0.4V
Index
+3.3 VDC
I
OL
> I
SSR
optical
tach
-
+
LM324
not included within
motor tachometer
0.5 VDC
Timer A1
CCR0
Figure 10.9: 24 VDC equipped witha3channel optical encoder.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required