Control of A Servo Motor Write-Up
Control of A Servo Motor Write-Up
This lab was performed with several objectives in mind. These objectives include the use of
LabVIEW to control an RC servo motor, to explore the purpose and properties of pulse trains
and pulse width modulation, and to discover and understand the effect of pulse width in the
operation of RC servo motors. There are several important concepts explained in the paragraphs
below about the theory behind the use of servo motors and pulse trains and pulse width
modulation.
RC servo motors only turn approximately 180° and the angle of rotation is determined by the
pulse sent to the motor. A longer pulse sent by the control module means a larger angle. The
variation of the pulse widths is called pulse-width modulation. In order for the servo motor to
maintain its position, the pulse width must be sent continuously. Therefore, the motor driver
must send a pulse approximately every 20 milliseconds. The repeating of these pulses is
something known as a pulse train. As the pulse width inside the pulse train changes, so does the
angle of the servo. When the signal is stopped, the servo turns off and will remain in the same
position as the last signal.
For this lab, we used a surface temperature sensor to control the pulse width being sent in to the
pulse train. This sensor works through the use of a 20 kΩ thermistor, a device whose resistance
changes with temperature. This change in resistance can be seen by the data acquisition board
and a program on the computer converts the resistance value into a temperature value. The
typical temperature range for a device like that is -25 °C to 125 °C. Thermistors are great ways to
detect temperature changes because of the quick response they have to temperature changes. An
example figure of the response time of a thermistor can be seen at Figure 1 in the Appendix.
Part 1: Some of the preliminary setup steps had been completed upon our arrival to the
experimental area. To begin, we first logged into the computer and opened up the LabVIEW
program that would rotate the RC servo motor. This program can be found at C:\Program
Files\National Instruments\LabVIEW 8.5\SensorDAQ\SDAQExp03_ServoMotor.vi. This
program, which can be seen in Figure 2 of the Appendix, varies the pulse width sent to the servo
motor in order to vary the angle it is positioned at. To confirm the program was written correctly,
we adjusted the pulse width of the pulse train to varying frequencies and watched the angle of
the servo motor.
We then finished the experiment and closed out of the program and cleaned up the experiment
area.
Part 1: The first part of the experiment was designed to allow the user to become more familiar
with the control of a servo with LabVIEW. Table 1 displays the values we recorded for different
pulse widths.
Pulse Width
Angle (°)
(s)
0.0025 0
0.0016 90
0.0008 180
Part 2: The second part of the experiment allowed the user to obtain a calibration curve of the
servo by inputting rotation angles and reading the corresponding pulse width output using the
interface and program shown in Figure 3 of the appendix. Table 2 displays the values as recorded
for different rotation angles.
Table 2: Rotation angles and corresponding pulse width for RC servo motor
0 7.00E-04
30 9.70E-04
60 1.23E-03
90 1.50E-03
120 1.77E-03
150 2.03E-03
180 2.30E-03
From this data we obtained a calibration curve shown below in Figure 1. We obtained a best fit
and a calibration equations relating pulse width to degrees of rotation.
Part 3: The third part of the experiment was designed to output a rotation of the servo motor for a
particular temperature input from the surface temperature sensor. Using the calibration curve
from Part 2, the pulse width can be calculated for each different value. The results are shown
below in Table 3.
Table 3: Temperature from sensor, degrees of rotation of RC servo, and corresponding pulse
width
22.7 58 1.22E-03
26 72 1.35E-03
This experiment was an effective means to show how the modulation of pulse width effects the
position of an RC servo motor. Modulation of the pulse width can come from a variety of
sources, in our case a thermistor temperature sensor. This system could be implemented in the
case of thermostat, with the RC servo opening and closing a throttle and changing the flow rate
of cooling liquid to some system. This experiment was very effective and further improvement
would be unnecessary.
References: