You are on page 1of 12

Control Engineering LAB-6

Introduction to some MATLAB’s control functions

Root Locus

6.1: Root Locus:


 The location of closed-loop poles in the s-plane gives an idea about the stability and
transient response of a closed-loop system. With the variation of any system parameter,
these poles move their locations.
 The root locus technique introduced by W.R Evans, provides a simple graphical method
of finding the roots of characteristics equation, with the gain parameter k varying from -∞
to ∞, without solving it.

G(s)

H(s)

Consider a closed loop feedback system as shown in figure

The characteristics equation of this closed loop system is given by

( ) ( )

6.2: Angle and Magnitude Criterion:


( ) ( )

As s is a complex variable so equation can be split into two Evan’s conditions as follows:

(a) Magnitude Condition | ( ) ( )|


(b) Angle Condition ( ) ( ) ( )
6.3: Root Locus using MATLAB:
The syntax of the command is

rlocus(n,d)

where n and d corresponds to numerator and denominator of the open loop transfer function

The gain vector K is automatically taken to be varying from 0 to ∞. The user defined values of
variable parameter K can also be used to obtain the root locus plot using the following command:

rlocus(n,d,k)

where vector K contains all the gain values for which closed-loop poles are to be computed.

6.4: Example:
( )
( ) ( )

Solution:
n=[1 2]

d=[3 5 7]

rlocus(n,d)

The root locus plot obtained is:

Root Locus
2

1.5

0.5
Imaginary Axis

-0.5

-1

-1.5

-2
-8 -7 -6 -5 -4 -3 -2 -1 0 1
Real Axis
Now, by clicking over any point on the root locus, the relevant information like system gain,
damping ratio, overshoot and natural frequency of oscillation about the locus at that point can be
obtained as shown below:

Root Locus
2

1.5

System: sys
1
Gain: 0
Pole: -0.833 + 1.28i
0.5 Damping: 0.546
Overshoot (%): 12.9
Imaginary Axis

Frequency (rad/sec): 1.53


0
System: sys
Gain: 0
-0.5 Pole: -0.833 - 1.28i
Damping: 0.546
Overshoot (%): 12.9
-1
Frequency (rad/sec): 1.53

-1.5

-2
-8 -7 -6 -5 -4 -3 -2 -1 0 1
Real Axis

6.5: Example:
( )
(a)
( )( )( )
( )
(b)
( )( )( )
( )
(c)
( )( )( )
( )
(d) ( )

Solution:

(a) % program to plot the root locus of the system having transfer function ,
( )
( )( )( )
% Define the numerator polynomial

n=[1 3]

% conv will give the multiplication of two polynomials

d = conv(conv([1 0],[1 2]),(conv([1 4],[1 5])));

% plot the root locus of the system

rlocus(n,d);

The root locus plot obtained is:

Root Locus
15

10

5
Imaginary Axis

-5

-10

-15
-25 -20 -15 -10 -5 0 5 10
Real Axis
(b) % program to plot the root locus of the system having transfer function ,
( )
( )( )( )
% Define the numerator polynomial
n=[1 7];
% Define the denominator polynomial

d=conv(conv([1 0],[1 5]), conv([1 15],[1 20]));

% plot the root locus of the system

rlocus(n,d);

% define the range of x and y axis of the graph

axis ([-25 3 – 15 15])

The root locus plot obtained is:

Root Locus
15

10

5
Imaginary Axis

-5

-10

-15
-25 -20 -15 -10 -5 0
Real Axis
(c) % program to plot the root locus of the system having transfer function ,
( )
( )( )( )
% Define the numerator polynomial
n=[1 15]
d=conv([1 5],conv([1 2+6j],[1 2-6j]));
% Define the denominator polynomial
rlocus(n,d);
% To plot the root-locus of the system
The root locus plot is shown below:

Root Locus
80

60

40

20
Imaginary Axis

-20

-40

-60

-80
-16 -14 -12 -10 -8 -6 -4 -2 0 2 4
Real Axis
(d) % program to plot the root locus of the system having transfer function ,
( )
( )
n=[1 1]; % to define the numerator polynomial
d=[1 10 0 0]; % to define the denominator polynomial
rlocus(n,d); % to plot the root-locus of the system

The root locus is shown below:

Root Locus
8

2
Imaginary Axis

-2

-4

-6

-8
-12 -10 -8 -6 -4 -2 0 2
Real Axis
6.6: Example:
Examine the stability of the unity feedback control system shown below for all values of gain K.

R(s) 𝑲𝒔 𝟑 𝟏 C(s)
𝒔 𝒔𝟐 𝟐𝒔 𝟏

Closed loop transfer function of the system is given by:

Characteristics equation of the system is:

Or
( )

Or

( )

The MATLAB program for plotting the root locus of the system is given as:

n=[1 0];

d=[1 2 1 3];

rlocus(n,d)

The root locus plot is given by:


Root Locus
10

2
Imaginary Axis

-2

-4

-6

-8

-10
-2.5 -2 -1.5 -1 -0.5 0 0.5
Real Axis

6.7: ROOT LOCUS USING plot COMMAND:


To obtain the roots of the characteristics equation for values of K specified by the user,
the following commands can be used:

[r,k]=rlocus(n,d)

[r,k]=rlocus(n,d,k)

These commands will return matrix r containing the values of roots of the characteristics
equation for the corresponding values of K.

The root locus plot can also be obtained by using plot command for matrix r obtained as outlined
above and is shown below:

r = rlocus(n,d);

plot (r,’’)

The plot command plots the root locus. Different line styles can be used in these plots. To plot
the root loci with marks ‘o’ and ‘x’, the commands plot(r,’o’)or plot(r,’x’) can be used.
6.8: Example:

Plot the root locus and examine the stability of the following system

( ) ( )

If the gain K is varied over a range of:

(a) K=2,4,6,8
(b) K=2,4,6,8,10

Determine the exact pole locations also in tabular form for part (b)

Solution:

(a) % program to plot root locus of the system given in example:


K=2:2:8; % vector K defined for different values of gain
n=[0.4]; % Define the numerator polynomial
d=[1 2 4 5] % Define the denominator polynomial
[r,k]=rlocus(n,d,k);
% Plot the root-locus of the system for different values of gain K
plot(r,’o’);
grid;
title (‘Root locus plot’);
xlabel(‘Real Axis’);
ylabel(‘Imaginary Axis’);
p=

-0.1615 + 1.8527i -0.1615 - 1.8527i -1.6771


-0.0963 + 1.9085i -0.0963 - 1.9085i -1.8073
-0.0390 + 1.9618i -0.0390 - 1.9618i -1.9220
0.0123 + 2.0124i 0.0123 - 2.0124i -2.0247

k=

2 4 6 8
Root locus plot
2.5

1.5

1
Imaginary Axis

0.5

-0.5

-1

-1.5

-2

-2.5
-2.5 -2 -1.5 -1 -0.5 0 0.5
Real Axis

The roots are plotted in figure. It is seen that the roots do not cross the imaginary axis for
k=2,4,6. Hence system is stable for K=2,4and 6 and unstable for k=8

(b) % program to plot root locus of the system given in example:


K=2:2:10; % vector K defined for different values of gain
n=[0.4]; % Define the numerator polynomial
d=[1 2 4 5] % Define the denominator polynomial
[p,k]=rlocus(n,d,k)
% Plot the root-locus of the system for different values of gain K
plot(p,’x’);
grid;
title (‘Root locus plot’);
xlabel(‘Real Axis’);
ylabel(‘Imaginary Axis’);
Root locus plot
2.5

1.5

1
Imaginary Axis

0.5

-0.5

-1

-1.5

-2

-2.5
-2.5 -2 -1.5 -1 -0.5 0 0.5
Real Axis

p=

-0.1615 + 1.8527i -0.1615 - 1.8527i -1.6771

-0.0963 + 1.9085i -0.0963 - 1.9085i -1.8073

-0.0390 + 1.9618i -0.0390 - 1.9618i -1.9220

0.0123 + 2.0124i 0.0123 - 2.0124i -2.0247

0.0589 + 2.0606i 0.0589 - 2.0606i -2.1179

k=

2 4 6 8 10

The roots are plotted in Figure. It can be seen that the system is unstable for k=8 and 10, because
the roots cross to right half plane for these values of K

You might also like