Lab-DC Motor Control

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

EECE 258 Lab Servo Motor PID Control

Spring 2009
.

OBJECTIVE: Students will learn how to tune a PID controller to achieve various
design specifications.

PRELAB: Servo motor is one of the most commonly used actuating device for
control systems. Investigate the characteristics of the servo motor.

INLAB: Students will use the Quanser Consulting SRV-02 Servo Motor to
experiment with PID (Proportional Integral Derivative) control of a servo motor. REQUIREMENTS: You will be required to run the experiment a few different times and achieve the following design specifications: 1. Marginal Stability 2. Best tracking of a square wave (~0 steady-state error, <4% overshoot, and <.4sec. settling time). Also, observe the effect of a disturbance (load) on the motor when Ki has a very low value 3. Best tracking of a sawtooth wave PROCEDURE: Complete the following steps to perform the lab: 1. Start Windows. 2. Log in as 276labuser (password resubal672). 3. Double-click on the Wincon Server icon on the desktop. 4. In Wincon Server, click File Open and browse to the following file: C:\EE258Exp1\EE258_Exp1. 5. Click on Go to Simulink on the Wincon Server (this button has the simulink logo on it) This will launch Matlab. 6. After Matlab has finished initializing, you may need to click Go to Simulink again This will launch Simulink with the appropriate model.

7. Take the following steps to ensure that your changes to this file do not get overwritten: a. In the Simulink model, click File Save As and save the file with your or your lab partners name. b. In Wincon Server, click Model Close. c. Then, click Model Open and browse to the model you just saved. d. In the Simulink model that you just saved, click on Wincon Build. e. Observe the main Matlab window, it should compile the model and download the code. After this completes, in Wincon Server click File Save As and save the file with your or your lab partners name. 8. Take the following steps to view the output of this model: a. Click the Select Plot button in Wincon Server b. Select the Actual Position1 and Desired Position plots and click OK. c. In the plots that appear, click Update Buffer and set the buffer to 30 (this will scale the viewing window to show more cycles on the screen.). d. In Wincon Server, click the Start button. The plots will show the desired and actual angle of the servo motor, and you can also view the motor itself to see how it moves. 9. Change the PID parameters (the Kp, Ki, and Kd gains) in the simulink model to achieve the various design specifications listed above. To view how your changes affect the system, complete these steps: a. In the Simulink model, click Wincon Build. b. Wait for Matlab to finish compiling, then in Wincon Server, click the Start button 10. Once you achieve each set of design specifications, save your plots for you lab report. To help in writing the report, fill out the information on the following sheets: A) On the square wave plot below sketch how the output of a marginally stable system would look.

Trials 1 7 on the table below should hold some or all attempts (values) made to reach Trial N. The "Effects on the output" column should tell why the values were wrong.

Trial N should hold the values that achieved marginal Stability. HINT: Start with Kp= 0.04, KI= 0.00000001, and KD= 0. A good technique to find the appropriate values is to hold two values constant and vary the other to see the effects.

Kp Trial 1 Trial 2 Trial 3 Trial 4 Trial 5 Trial 6 Trial 7 Trial N

Ki

Kd

Effects on the output

B) Define overshoot and settling time: Overshoot Settling time Fill out the table below in the same manner as the table from the previous section. Trial N should contain the values that achieved the best tracking of a square wave (~0 steady-state error, <4% overshoot, and <.4sec. settling time).

Kp Trial 1

Ki

Kd

Effects on the output

Trial 2 Trial 3 Trial 4 Trial 5 Trial 6 Trial 7 Trial N

C) To change to a sawtooth wave, double-click the Desired Postion block in the Simulink model and choose sawtooth wave. Also, change the frequency to .7Hz. Use the table below as before

Kp Trial 1 Trial 2 Trial 3 Trial 4 Trial 5 Trial 6 Trial 7 Trial N

Ki

Kd

Effects on the output

AFTERLAB Answer the following questions: 1. What are the purposes of the integral limiter block and the output saturation block? 2. For the best tracking, which gain had the most effect and why? 3. What effect did the load have on the square wave tracking? Discuss why this was the effect. How would you change the Kp and KI to eliminate the effect? 4. What is the value of your experiment steady state error for the saw tooth wave tracking? Discuss your observations.

You might also like