control of a servo motor write-up

9
Control of a Servo Motor Lab Performed: 16 November, 2010 Lab Report Due: 23 November, 2010

Upload: ethan-porter

Post on 26-Nov-2014

108 views

Category:

Documents


2 download

TRANSCRIPT

Control of a Servo Motor Lab Performed: 16 November, 2010 Lab Report Due: 23 November, 2010

Lab Performed by: Ethan Porter and Clinton Lauver

Abstract: (insert abstract here)

Introduction: 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. Experimental Method and Procedure: 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. Part 2: Next, we opened up the program SDAQExp03_ServoMotor_Ex02.vi in LabVIEW. A screenshot of the user interface and program for this program can be found in Figure 3 of the Appendix. This program was designed to allow the user to rotate the servo to different angles and would display the pulse width being sent to the servo. We rotated the servo from 0 to 180 in 30 increments and recorded the pulse width being sent at each angle.

Part 3: Finally, we attached the surface temperature sensor to Channel 1 of the data acquisition board and opened the program SDAQExp03_ServoMotor_Ex03.vi in LabVIEW. This program, whose user interface is shown in Figure 4 of the Appendix and program is shown in Figure 5 of the Appendix, reads a temperature reading from the surface temperature sensor and assigns a rotation angle to each temperature. We tested three separate temperatures with the temperature sensor and recorded the temperature seen and the angle of the servo motor. We then finished the experiment and closed out of the program and cleaned up the experiment area. Results and Discussion: 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. Table 1: Pulse width and corresponding angle for RC servo motorPulse Width (s) 0.0025 0.0016 0.0008 Angle () 0 90 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 motorRotation (Degrees 0 30 60 90 120 150 180 Pulse Width (s) 7.00E-04 9.70E-04 1.23E-03 1.50E-03 1.77E-03 2.03E-03 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.

Figure 1: Calibration curve of Pulse Width vs. 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 widthTemperature 22.7 32.7 26 Angle 58 103 72 Pulse Width 1.22E-03 1.63E-03 1.35E-03

Conclusion and Recommendations: 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: Surface Temperature Sensor Troubleshooting and Facts. Vernier.com. 22 November 010, . Celik, Emine. Control of a Servo Motor. 2010.

Appendix:

Figure 2: Model Response of Thermistor to Temperature of several breaths

Figure 3: Screen shot of SDAQEXP03_ServoMotor.vi

Figure 4: User interface and Program for Part 2 of the experiment.

Figure 5: User interface for Part 3 of the experiment.

Figure 6: Program for LabVIEW in Part 3