Example: Solution to the Cruise Control Problem Using Root Locus Method
Proportional Controller
Lag controller
The state equations for this problem are:

The design criteria (for a steady-state speed of 10 m/s) are:
Rise time < 5 sec
Overshoot < 10%
Steady state error < 2%
To see how this problem was originally set up, click
here.
The state space equations are a little deceiving in this problem. Since
the dynamic equations do not depend on x, and we have chosen the
velocity (dx/dt) to be the output, the system can really be reduced
to a first order system with the equations.

Proportional controller
Since this system is first order, the problem can be solved using
proportional control, although a lag controller can be added if the steady
state error becomes too high.
The design criteria of a rise time of less than 5 seconds implies that the
natural frequency must be greater than 0.36 (remember: tr = 1.8/Wn). The
design criteria also states that the overshoot must be less than 10% which
implies that the damping ratio
zeta must be greater than 0.6. We will use this fact to
start the design of the controller (note: the sgrid command can show the
regions of the root locus where these two criteria are satisfied).
Create the following m-file (or
create a '.m' file located in the same directory as Matlab) to implement
the proportional controller.
m = 1000;
b = 50;
u = 500;
A = [0 1; 0 -b/m]
B = [0; 1/m]
C = [0 1]
D = 0
[num,den]=ss2tf(A,B,C,D)
You should get the following output:
A =
0 1.0000
0 -0.0500
B =
1.0e-03 *
0
1.0000
C =
0 1
D =
0
num =
0 0.0010 0
den =
1.0000 0.0500 0
If you look at the transfer function closely, you will notice that there
is a pole-zero cancellation at the
origin (both num and den have a root at zero, as can be easily seen since
they each have a zero constant term). Matlab
does not automatically cancel the pole and zero. As a result, it can
cause confusion in the root locus plot, so it is best to eliminate it
now. This can be done by manually eliminating both the pole and zero. At the
end of your m-file, add the following code:
num = [num(1), num(2)]
den = [den(1), den(2)]
The transfer function is now:
num =
0.0010
den =
1.0000 0.0500
Now, we shall plot the root locus and step response to see the effects of
proportional control on the system. Copy the following code to the end of
you m-file:
figure
hold;
axis([-0.6 0 -0.6 0.6]);
rlocus(num,den)
sgrid(0.6,.36)
[k,poles] = rlocfind(num,den);
figure
t = 0:0.1:20;
[numc,denc] = cloop(k*num,den, -1);
step(10*numc,denc,t)
axis([0 20 0 10])
When prompted to select a point on the root locus, click on the real axis
just to the left of the natural frequency requirement (about -0.4). The
10 in the step response is
multiplied to the numerator so that the desired reference signal will be
10 instead of the default of 1. If you look back to the original cruise control problem, you will see that the steady state
value should be 10. The first plot given by Matlab should be the root
locus. The second plot should be the velocity response to the step change
in the reference. The two plots should look similar to the following:


The rise time criteria has been met as well as the overshoot criteria,
but the steady state error is still over 10%. This is too high for a
cruise control system.
Lag controller
A lag
controller can be added to improve the
steady state error. For this lag controller, we will place the zero at -0.3
and the pole will at -0.03; this will result in an improvement of the
steady-state error by a factor of 10 = 0.3/0.03.
Change your m-file to look like the following to implement this new
controller:
m = 1000;
b = 50;
u = 500;
A = [0 1; 0 -b/m];
B = [0; 1/m];
C = [0 1];
D = 0;
[num,den] = ss2tf(A,B,C,D);
num=[num(1), num(2)];
den=[den(1), den(2)];
numlag = [1 .3];
denlag = [1 .03];
num1 = conv(num,numlag);
den1 = conv(den,denlag);
axis([-0.6 0 -.4 .4]);
hold;
rlocus(num1,den1)
sgrid(.6,.36)
[k,poles] = rlocfind(num1,den1);
figure
t = 0:0.1:20;
[numc,denc] = cloop(k*num1,den1, -1);
step(10*numc,denc,t)
axis([0 20 0 12])
The root locus should look like the following:

When prompted to select a point on the root locus, again click on the real
axis just to the left of the natural frequency requirement to achieve the
desired rise time. Now you should have the following velocity response:

As you can see, the steady state error has been reduced to near zero. We
now have a slight overshoot, which is a result of the zero which was added
in the lag controller. Since the overshoot is within the design criteria, we will
not worry about it. Now all of the design criteria have now been met
and no further iterations are needed.
User Survey
Your anonymous answers to the following questions will help us to
improve future versions of these tutorials.
-
Root Locus Examples
-
Cruise Control |
DC Motor |
Bus Suspension |
Inverted Pendulum
-
Cruise Control Examples
-
Modeling |
PID |
Root Locus |
Frequency Response |
State Space
-
Tutorials
-
Basics |
Modeling |
PID |
Root Locus |
Frequency Response |
State Space |
Examples

8/22/96 JDP