Lab 9
Lab 9
Lab 9
Science
Lab Lab
Log book
Student name Reg. No. completion report Total/15
Marks / 5
Marks / 5 Marks / 5
Muhammad Rehan 333394
Basharat
Muhammad 345660
Hassaan Saeed
2. Root Locus
Root locus is a plot of the closed loop poles of the system that shown in the figure
below. The closed loop poles vary as the values of the gain K is changed. The root locus
shows the plot of the closed loop poles as the gain K is varied between zero and positive
infinity.
+ K G(s)
-
In the lectures, we have learnt how to sketch a root locus and also how to find exact
points of interest e.g. the imaginary axis crossing, the break away/in points, the centroid
of asymptotes. Plotting a rough sketch of the root locus is considerably simple; however,
finding exact points on the root locus requires some mathematical calculations. In this
handout, we will see that MATLAB can make this task easier.
The root locus of the above system can be plotted in MATLAB using the following code:
G=zpk([],[-1,-2,-3],1)
rlocus(G)
Root Locus
5
1
Imaginary Axis
-1
-2
-3
-4
-5
-8 -7 -6 -5 -4 -3 -2 -1 0 1
Real Axis
As you can see, plotting the root locus is very easy in MATLAB.
The overshoot, damping ratio and natural frequency indicated with the data cursor are
only w.r.t. to that specific pole, i.e., if the system only had that pole (or the pole pair in
case of a complex pole). This overshoot is not for the whole closed loop system.
Root Locus
5
4 System: G
Gain: 5.31
Pole: -1.03 + 1.34i
3
Damping: 0.608
Overshoot (%): 9.02
2 Frequency (rad/sec): 1.69
1
Imaginary Axis
-1
-2
-3
-4
-5
-8 -7 -6 -5 -4 -3 -2 -1 0 1
Real Axis
Once a data cursor is inserted, you can move it around by dragging it. If you cannot
move the data cursor in fine steps, then right click on the data cursor, go to
Interpolation and select Linear. Sometimes you get a different right click menu. In that
case, go to Selection Style and select Mouse Position.
-1
System: G
Gain: 106
-2
Pole: 0.401 - 4.04i
Damping: -0.0989
-3 Overshoot (%): 137
Frequency (rad/sec): 4.06
-4
-5
-8 -7 -6 -5 -4 -3 -2 -1 0 1
Real Axis
Move the data cursor for one of the complex poles so that you have an overshoot of40%.
Find the value of K required to get that closed loop pole.
Move the rest of the data cursors such that they are showing the same value of the gain
K. This will allow us to see the location of all the closed loop poles of the system for aspecific
value of the gain.
For the value of gain that is required for 40% overshoot, can we approximate thesystems
to a second order system with no zeros?
Once you have decided a value for the gain K, you can find the closed loop transferfunction with
the following code.
K=30
Gcl = feedback(series(K,G),1)
Plot the root locus for this system in MATLAB. Using the MATLAB root locus:
1. Find the values of the gain K for which the closed loop system will be stable.
Design a controller gain K such that the closed system is stable, and the dominantpoles have an
overshoot of 80%. Is a second order approximation valid for this value of K. Find the transfer
function of the closed loop system.
CODE:
J = 0.01;
b = 0.1;
K = 0.8;
R = 1;
L = 0;
s = tf('s');
P_motor = K/((J*s+b)*(L*s+R)+K^2)
f_b=feedback(P_motor,1)
rlocus(f_b)
stepinfo(P_motor)
1st Function: