Ece 429 Control Systems Lab Manual
Ece 429 Control Systems Lab Manual
PREREQUISITES:
References
[1] J. DAzzo and C. Houpis, Linear Control System Analysis and Design. New York : McGraw-Hill, 4th
ed., 1995.
[2] R. C. Dorf and R. H. Bishop, Modern Control Systems. Upper Saddle River, NJ : Prentice Hall, 10th
ed., 2005.
[3] G. C. Goodwin, S. F. Graebe and M. E. Salgado, Control System Design. Upper Saddle River, NJ :
Prentice Hall, 2001.
[4] B. C. Kuo, Automatic Control Systems. Englewood Cliffs, NJ : Prentice Hall, 7th ed., 1995.
[5] N. S. Nise, Control Systems Engineering. New York : John Wiley & Sons, 3rd ed., 2000.
[6] K. Ogata, Modern Control Engineering. Upper Saddle River, NJ : Prentice Hall, 4th ed., 2002.
In addition to the list of reference texts listed above, students are referred to the various examples and
design procedures available on Dr. Beales website at:
http://ece.gmu.edu/gbeale/ece 421/examples 421.html.
Name :
Semester :
Date of Experiment :
Date Report submitted :
The lab report for each experiment should contain the sections as mentioned below. In addition to the codes,
simulink diagrams and plots, the report should describe to the reader the experiment and its objective. The
report should explain the methodology as well.
Introduction
The experiment and the motivation behind it should be explained.
Problem Statement
Describe the problem. The system and required specifications should be mentioned.
Methods
Explain the methodology used. The type of compensator design should be described. Also, if there are
any new MATLAB commands used, then a detailed description of the command with the syntax should be
included.
Discussion
Write a summary of the experiment. What were the problems encountered? Mention any MATLAB issues.
K (s + 20)
s (s + 0.4) (s + 5)
(1)
3. Using the gain found in step 2, generate Bode plots for magnitude and phase of the open-loop
system. Find the gain and phase margins. Are your results consistent with your analysis on
system stability? Plot the closed-loop step response.
4. Plot the root locus for this system. Determine the value of the gain K at the point where the
root locus branches cross the imaginary axis, and the frequency value at the crossing.
5. Approximating Gp (s) as the 2nd-order system 4K/[s(s + 0.4)], select K such that the damping
ratio is = 0.707. Determine the closed-loop stability and the gain and phase margins with
the new value of K (applied to the complete Gp (s) transfer function). Plot the step and ramp
responses. What is the steady-state error for a ramp input? Use MATLAB to find the maximum
overshoot.
REPORT:
Write a report including the plots that you made, your procedures for selecting the values of K, your
analyses of system stability and performance, and a discussion of the capabilities and ease of use of
MATLAB in performing this work.
(s + 20)
s (s + 0.4) (s + 5)
(2)
(s + 20)
s (s + 0.4) (s + 5)
(3)
2. Design a compensator such that the closed-loop system satisfies all of the specifications. More
than one section of compensator can be used if necessary. The design of the compensator should
be accomplished by theoretical analysis aided by the frequency domain response capabilities of
MATLAB. Random trial and error will not be acceptable.
3. Verify that the final closed-loop system satisfies all of the requirements. Bode plots of the openloop and closed-loop systems are required, as well as the ramp response in the time domain. Also,
plot the step response, and determine the percent overshoot and settling time.
REPORT:
Write a report containing a description of the design problem and your approach to designing a compensator. Include your reasons for choosing the particular compensator type and how the compensator
parameter values were obtained. Include all plots necessary to verify that the specifications have been
satisfied. Discuss how the frequency domain specifications given influence the time response.
10(s + 5)
s(s + 1)(s + 10)
The plant is used with unity negative feedback. Calculate the closed loop system.
Plot the step response of the closed loop system.
2. Open the simulink Library Browser by clicking on Start Simulink. Open a new model file
(.mdl). Build a model of the above closed loop system by using the following blocks.
You will need to drag and drop each block in your model file. Double-click on the blocks to open
its property editor. This will give you options of changing the parameters of the blocks. Connect
the Scope to the output.
10s+50
den(s)
Step
Transfer Fcn
Scope
The open loop model (without spring) is defined by the following differential equations :
m
y = b(y x)
+u
(4)
m
x = bx + b(y x)
(5)
Feedback is provided by attaching a spring to the first block (as shown in figure). For the closed loop
system, equation (4) changes to
m
y = b(y x)
ky + u
TASKS (by hand) :
1. Compute the open loop transfer function of the model. Use equations (4) and (5). y is the output,
and u is the input. Show that the transfer function is
Gp (s) =
m
b s
m2 3
b s
+2
+ 3ms2 + bs
2. Compute the closed loop transfer function by using the modified equation (4). Verify that the
feedback function, H(s), is equal to k.
TASKS (using MATLAB) :
Use the following data for the tasks : m = 1,
simulations.
10
b = 0.1,
1. Develop a Simulink model (using the differential equations) for the open loop system. Simulate
it for a step input of 1 for 50s. Is the system stable? (OpenLoop.mdl)
2. Develop a Simulink model for the closed loop system. (Again, by using the differential equations
and not the transfer function). Simulate it for 50s. Is the system stable? What is the approximate
steady state error and peak oversoot? (ClosedLoop.mdl )
3. Implement the PD controller with the closed loop model. Adjust the controller gains such that
there is negligible overshoot, and a settling time of about 10s. Will you be able to remove the
steady state error with this controller? If yes, how? If no, why? ( PDcontrol.mdl )
REPORT:
Write a report which documents your design process. Include the tasks to be done by hand in your
report. All steps should be clearly mentioned. Include all plots and results. Discuss the process of
implementing the PD controller, and how you selected the gains. Did the final closed loop step resonse
meet the design specifications? Also upload the 3 simulink model files along with the report.
11
(6)
TASKS:
1. Compensator Design :
The closed-loop response for a unit step input must satisfy the following specifications:
the settling time (2%) must be less than 125 seconds;
the overshoot must be less than 25%; and
the maximum absolute value of the rudder angle must be less than 3.
Design a compensator which accomplishes this. Does the overshoot match exactly the desired
specification? Explain.
2. Results of compensated system :
Develop a SIMULINK model for the closed-loop system (unity negative feedback). The forward path should consist of one transfer function block for your compensator and one transfer
function block for the ship model. The reference input (ordered heading angle) should be a step
of amplitude 10, beginning at time t = 5s.
The simulation should be run for 300 seconds. A variable-step integration time should be used.
Choose a numerical integration method such as the ode23s (stiff/Mod. Rosenbrock) method. The
following variables should plotted (using the scope) and returned to the MATLAB workspace by
the simulation (a time vector tout is automatically returned):
reference input (ordered heading angle);
commanded rudder angle (output of your compensator).
actual heading angle;
3. Testing robustness of compensator - introduce nonlinear effects :
Often, while designing compensators, there are assumptions made about the physical system.
In the above design we have assumed that the output of the compensator is the commanded
12
rudder angle which is used to steer the ship. However, in reality the actual rudder angle is
a nonlinear transformation of the commanded rudder angle (due to effects such as saturation,
deadzone, hysterisis and rate limiting). Using SIMULINK we test the compensator when the
commanded input is transformed to the actual input.
Insert the Nonlinear steering mechanism block between the compensator and the plant transfer
function. The simulation should be run for 1200 seconds. The following variables should plotted
(using the scope) and returned to the MATLAB workspace by the simulation :
Compare the results of this simulation with that of Task 2. How does the change in the steering
mechanism affect the output of the system?
4. Testing robustness of compensator - introduce perturbations in the system
(a) Repeat Task 3 (with the nonlinear steering mechanism) using the system transfer function as
1.4970 102 s + 2.6940 102
Gpmin (s) =
s (s + 1.6938 102 ) (s + 1.2870 101 )
(b) Repeat Task 3 using the system transfer function as
9.3560 104 s + 1.0776 101
Gpmax (s) =
s (s + 4.2344 103 ) (s + 1.2870 101 )
Compare the results of (a) and (b) with that of Task 3. Is the compensator still able to control
the heading angle of the ship. Does the change in the ship parameters affect the overshoot
and settling time?
REPORT:
Write a report which documents your design process as well as your analysis of the designed compensator. Discuss how satisfying the performance specifications is related to the locations of the closed-loop
poles. Include time domain plots, and other plots if appropriate (such as root locus), to illustrate and
justify your work.
Also show the robustness of your compensator. Illustrate (using appropriate plots and arguments) how
the compensator work/does not work after taking the inaccuracies into account.
Discuss the ease or difficulty of developing a SIMULINK model for evaluating the response relative to
writing code directly in MATLAB.
13
5 107
s2 (s + 0.75)
(7)
The reference signal for the closed-loop system is the desired depth rate. The system has unity feedback.
The compensator can be implemented in multiple configurations : as a Proportional-Derivative (PD)
controller or as Proportional-Derivative-on-output-only (PD-DOO) controller.
TASKS:
1. Compensator Design :
The compensated system must satisfy the following specifications.
the compensated phase margin must be in the range of 45 to 50 degrees;
the compensated gain crossover frequency must be in the range of 0.045 to 0.055 rad/sec.
note that there is no steady state error requirement.
2. Results of compensated system :
Verify that the compensator you design satisfies the specifications by producing Bode plots of
the compensated system. Use the margin function in MATLAB to determine the actual values of
phase margin and gain crossover frequency. Also, plot the compensated closed-loop step response,
and determine the overshoot and settling time.
3. Implementation of compensator as a PD controller :
Use the values of compensator gain, pole and zero (from Task 1) to determine the values for
the PD controller gains (Kp , Kd , ). Implement this PD controller in simulink with a unit step
input and unity negative feedback. Compare the output of the closed loop system in this configuration to the output from Task 2.
4. Implementation of compensator as a PD-DOO controller
In simulink, implement the controller from Task 3 in PD-DOO form (discussed in class notes).
Compare the output to the outputs from Tasks 2 and 3.
14
REPORT:
Write a report which documents your design process. Include Bode plots for the compensated and
uncompensated systems, and the compensated step response plot. Discuss why the time-domain performance for the compensated closed-loop system will be better than the closed-loop performance of
the uncompensated system (plant model with unity feedback). Give your opinion on the overshoot in
the step response, taking into consideration what the system model actually represents.
Include the step response of the closed loop system for each implementation of the compensator.
Discuss the differences seen in the different implementations. Which do you think is the better configuration. Why?
15
T (t) = J (t)
(8)
2. The torsional plant is interfaced to the computer through a data board and can be controlled
using the ECP software. The software allows you to implement different types of controllers with
user-defined parameters. The input to the system, in terms of degrees, can be generated. The
position, velocity and acceleration of the discs can be measured and plotted. Ask the instructor
to give a demonstration of the different functionalities of the software. More information about
the hardware and software can be found at http://www.ecpsystems.com/.
TASKS:
1. Derive the open loop plant transfer function, Gp (s), from equation (7). The input is the torque T (t) and the output is the position of the disc, (t).
2. Use closed loop step response measurements to identify the parameters, J and c of the system.
A unity feedback is applied to the plant with a gain, Kp = 0.1. (Fig. 2)
Derive the closed loop transfer function, Gc1 (s).
Assume that from the step response of the closed loop system the time-to-peak, tp = 0.5s,
and overshoot, Mp = 30% is determined.
Compute n and for the closed loop system.
16
3. Design the proportional (Kp ) and derivative (Kd ) coefficients for a controller in PropotionalDerivative with Derivative on Output Only (PD-DOO) form. (Fig. 3)
REPORT:
Solve the problems outlined in tasks 1, 2 and 3. The derivations and equations should be shown clearly.
Also mention what you observed by changing the value of Kp in task 4. Is this what you expected?
Explain with the help of the system defined in task 2. You do not need to include plots in your report.
18
19
20
The time varying parameters - x(t), (t), (t), b (t) are abbreviated as - x, , , b .
21
(s)
X(s)
The servo motor system and the ball/beam system are represented by P (s) and Pbb (s) in the above
figure. In this lab you will have to design 2 controllers - C(s) and Cbb (s) and implement the final closed
loop system in Simulink. For details on designing the controller, please refer to the notes on Ball and
Beam Controller.
K
Kbb
P (s) =
,
Pbb (s) = 2
s( s + 1)
s
The parameters of the systems defined below :
K = 1.53,
= 0.0248,
Kbb = 0.419,
f = 2,
Vmax = 10V,
max = 0.9774rad
TASKS:
1. Design and simulate a PD-DOO position controller for the servo motor.
(a) Find Kp and Kd values for the following specifications (unit-step response) :
Percent overshoot = 1% and time to peak = 0.2s
(b) Build a simulink model for the closed loop system. Implement the derivative controller with
a pole and add a saturation block before the plant transfer function (as shown in the notes).
(c) Report the overshoot and time to peak of the output in your model. They should not
be greater than 2% and 0.4s respectively. If they are, re-design your controller with lower
specifications.
22
2. Design and simulate a PD-DOO (with filtering) controller for the ball balancing model (ignore
servo dynamics).
(a) Find Kp,bb and Kd,bb values for the following specifications (unit-step response) :
i. Percent overshoot = 15% and settling time = 5s
ii. Percent overshoot = 1% and settling time = 3s
(b) Build a simulink model (for both cases) of the closed loop system (without the servo transfer
function). Verify that the output, x(t) satisfies the specifications.
3. Solve the following tasks for both cases (using the appropriate controller as designed earlier).
(a) Build the complete system in Simulink (including the saturation blocks).
(b) Simulate the model to balance the ball at 2 cm.
(c) Include the following plots in your report
Desired and actual ball position.
Desired and actual servo angle position.
Input voltage to the servo motor.
(d) Analyzing the plots, explain why the response (overshoot and settling time) is not the same
as that in Task 2. What can be done to reduce the difference?
REPORT
Write a report indicating the problem that you have solved in this lab. Mention clearly the systems,
and the type of controllers you have designed. Include all the plots generated. Explain the difference
you see in Task 2 and Task 3.
23
Choose a simulation time of 10s. The solver should be a fixed step solver (ODE 8) and the
step size should be 0.002s.
You will first need to build your model, and then Connect to Target. After this, run your
model. You should see the servo motor changing position.
Plot the desired ball position and the actual ball position (in cms). Also plot the desired
servo angle and actual servo angle (in degrees).
Do you see any correlation between your simulated results from D.1 and the results of the
actual system? Are the results identical? Explain.
REPORT:
Submit a report which contains all the details of the design steps and experiments you have performed.
Mention how simulation helped you test the controller, and whether the results of the actual system
were similar. Also, explain the plots in terms the real system and what you actually observed.
25
+ 83.2u(t)
+ 80.1u(t)
The open loop transfer functions needed to design the controller are :
P (s) =
(s)
,
U (s)
26
P (s) =
(s)
U (s)
TASKS:
1. Derive the transfer functions, P (s) and P (s) from the differential equations described above.
Assume all initial conditions to be zero. [15]
2. Design a double PD controller to control keep the inverted pendulum upright ((t) = 0). As
shown in the figure below, one part of the controller will use the pendulum angle, (t) as feedback,
and the other part will use the motor angle, (t). [25]
4. Implement your controller on the real system and measure the duration for which it keeps the
inverted pendulum upright. [20]
Start MATLAB. Run the file InvertedPendulum Parameters.m.
Load and run your code to generate the controller parameters (Kp , Kd , Kp , Kd ).
Open the simulink model ControlPendulum Incomplete.slx. Save the file as ControlPendulum YourName.slx
Complete the model using the PD-DOO controller. The input block and open loop plant are
already built in the model. There wont be any disturbance added to the model.
Build the model and Connect-to-target. Start the simulation and slowly move the pendulum
to the upright position. You will feel the controller turn on as it reaches the zero degree
angle. Leave the pendulum and let the controller maintain it in its upright position. When
the pendulum falls down, stop the simulation.
REPORT:
Submit a report which contains all the details of the design steps and experiments you have performed.
The report should contain steps of the controller design, results of simulation and finally the performance while implementing it on the actual system. The content of the report as well as the results
will be graded. Make sure that your report has the proper plots and discussions.
28