Control Tutorials for MATLAB and Simulink - Cruise Control_ Root Locus Controller Design
Control Tutorials for MATLAB and Simulink - Cruise Control_ Root Locus Controller Design
SYSTEM
ROOT LOCUS
Related
FREQUENCY
Tutorial
Links
STATE-SPACE
Intro to
DIGITAL
Root Locus
Lead/Lag
SIMULINK Control
Root Locus
MODELING
Activity
CONTROL
Example
Animation
Related
External
Links
Design in
MATLAB
Root Locus
Video
Contents
System model
System parameters
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=ControlRootLocus 1/9
2/15/2018 Control Tutorials for MATLAB and Simulink - Cruise Control: Root Locus Controller Design
Performance specifications
Proportional control
Lag controller
System model
The transfer function model for the cruise control problem is given below. Please
see the Cruise Control: System Modeling page for the derivation.
(1)
System parameters
For this example, let's assume that the parameters of the system are
and the block diagram of a typical unity feedback system is shown below.
Performance specifications
Proportional control
Recall from the Introduction: Root Locus Controller Design page, the root-locus
plot shows the locations of all possible closed-loop poles when a single gain is
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=ControlRootLocus 2/9
2/15/2018 Control Tutorials for MATLAB and Simulink - Cruise Control: Root Locus Controller Design
(2)
Also, from the Introduction: Root Locus Controller Design page, we know that
the MATLAB command sgrid can be used to display an acceptable region of
the root-locus plot. To use the sgrid, both the damping ratio, , and the natural
frequency, , need to be determined first. The following two equations will be
used to find the damping ratio and the natural frequency:
(3)
(4)
where
= Damping Ratio
= Maximum Overshoot
One of our design criteria is to have a rise time of less than 5 seconds. From the
first equation, we see that the natural frequency must be greater than 0.36. Also
using the second equation, we see that the damping ratio must be greater than
0.6, since the maximum overshoot must be less than 10%.
Now, we are ready to generate a root-locus plot and use the sgrid to find an
acceptable region on the root-locus. Create a new m-file and enter the following
commands.
m = 1000;
b = 50;
r = 10;
s = tf('s');
P_cruise = 1/(m*s+b);
rlocus(P_cruise)
axis([-0.6 0 -0.6 0.6]);
sgrid(0.6, 0.36)
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=ControlRootLocus 3/9
2/15/2018 Control Tutorials for MATLAB and Simulink - Cruise Control: Root Locus Controller Design
The two dotted lines in an angle indicate the locations of constant damping ratio
( =0.6); the damping ratio is greater than 0.6 in between these lines and less
than 0.6 outside the lines. The semi-ellipse indicates the locations of constant
natural frequency ( =0.36); the natural frequency is greater than 0.36 outside
the semi-ellipse, and smaller than 0.36 inside.
We can then find a gain to place the closed-loop poles in the desired region by
employing the rlocfind command. Add the code
[Kp,poles]=rlocfind(P_cruise) onto the end of your m-file to help you
choose a specific loop gain. After running in the command window, you should
see a prompt asking you to pick a point on the root-locus plot. Since you want to
pick a point in between dotted lines ( >0.6) and outside the semi-ellipse (
>0.36), click on the real axis just outside the semi-ellipse (around -0.4) as
indicated by the cross mark in the following figure.
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=ControlRootLocus 4/9
2/15/2018 Control Tutorials for MATLAB and Simulink - Cruise Control: Root Locus Controller Design
After doing this, you should see the following output in the MATLAB command
window.
selected_point =
-0.4002 + 0.0019i
Kp =
350.2419
poles =
-0.4002
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=ControlRootLocus 5/9
2/15/2018 Control Tutorials for MATLAB and Simulink - Cruise Control: Root Locus Controller Design
Note that the value returned from your MATLAB command window may not be
exactly the same, but should at least have the same order of magnitude. This
returned value can be used as the gain for the compensator and the closed-loop
step response can be generated as follows.
Kp = 350.2419;
sys_cl = feedback(Kp*P_cruise,1);
t = 0:0.1:20;
step(r*sys_cl,t)
With the gain Kp you just chose, the rise time and the overshoot criteria have
been met; however, a steady-state error of more than 10% remains.
Lag controller
To reduce the steady-state error, a lag controller will be added to the system.
The transfer function of the lag controller is:
(5)
(6)
Finally, including the loop gain , the closed-loop transfer function becomes:
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=ControlRootLocus 6/9
2/15/2018 Control Tutorials for MATLAB and Simulink - Cruise Control: Root Locus Controller Design
(7)
zo = 0.3;
po = 0.03;
s = tf('s');
C_lag = (s+zo)/(s+po);
rlocus(C_lag*P_cruise);
axis([-0.6 0 -0.4 0.4])
sgrid(0.6,0.36);
Using the rlocfind command again, we can choose a new loop gain . Enter
the code [Kp,poles]=rlocfind(C_lag*P_cruise) into the command window
and click on the real axis around -0.4 as shown in the following figure.
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=ControlRootLocus 7/9
2/15/2018 Control Tutorials for MATLAB and Simulink - Cruise Control: Root Locus Controller Design
After doing this, you should see the following output in the MATLAB command
window.
selected_point =
-0.4002 - 0.0012i
Kp =
1.2936e+03
poles =
-0.9733
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=ControlRootLocus 8/9
2/15/2018 Control Tutorials for MATLAB and Simulink - Cruise Control: Root Locus Controller Design
-0.4003
Kp = 1293.6;
sys_cl = feedback(Kp*C_lag*P_cruise,1);
t = 0:0.1:20;
step(r*sys_cl,t)
axis([0 20 0 12])
As you can see, the steady-state error has been reduced to near zero. The
overshoot is a result of the zero added in the lag controller. For now all of the
design criteria have been met and no further iterations are needed; however,
you should experiment with different and values to see what their effect is
on the closed-loop system response.
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl§ion=ControlRootLocus 9/9