Control System Toolbox (Part-III)
10/17/2018 Dept. of EEE, PUST 1
Outline
• Frequency Domain Analysis of Control Systems
– Bode Plot
– Nyquist Plot
– Gain & Phase Margins
10/17/2018 Dept. of EEE, PUST 2
Bode Plots
10( s 10)
G( s)
s( s 2)( s 5)
To obtain the bode plot use following MATLAB code
num =10*[1 10];
den1= [1 0]; K =10;
den2=[1 2]; zero=-10;
den3=[1 5]; pole=[0 -2 -5];
den12=conv(den1,den2); sys=zpk(k, zero, pole);
den=conv(den12,den3); bode(sys)
bode(num,den) grid on
grid on
10/17/2018 Dept. of EEE, PUST 3
Bode Plots
Bode Diagram
50
Magnitude (dB)
-50
-100
-90
Phase (deg)
-135
-180
-225
-1 0 1 2
10/17/2018 10 Dept. of EEE, PUST
10 10 10 4
Frequency (rad/s)
Bode Plots (for specific Frequency range)
10( s 10)
G( s)
s( s 2)( s 5)
To obtain the bode plot for specific frequency range
w=0.1:0.1:100;
num =10*[1 10];
den1= [1 0];
den2=[1 2];
den3=[1 5];
den12=conv(den1,den2);
den=conv(den12,den3);
bode(num,den,w)
grid on
10/17/2018 Dept. of EEE, PUST 5
Bode Plots (for specific Frequency range)
Bode Diagram
50
Magnitude (dB)
-50
-100
-90
Phase (deg)
-135
-180
-225
-1 0 1 2 3
10/17/2018 10 10 Dept. of EEE,10
PUST 10 10 6
Frequency (rad/s)
Bode Plots (with left hand arguments)
When invoked with left-hand arguments, such as
[mag, pha, w] = bode(num, den, w)
bode returns the magnitude (mag), phase (pha) and
frequency (w) of the system in matrices.
10/17/2018 Dept. of EEE, PUST 7
Bode Plots
Exercise-1: - Obtain the bode plot of the second order system
ωn = 0.1 rad / sec
ζ = 0.1, 0.5, 1, 1.5
0.01
G(S) =
(S2 + 0.02S+0.01)
0.01
G(S) =
(S2 + 0.01S+0.01)
0.01
G(S) = 2
(S + 0.02S+0.01)
0.01
G(S) = 2
10/17/2018
(SDept.+ of0.03S+0.01)
EEE, PUST 8
Bode Plots
Exercise-2: - Calculate the magnitude and phase of the following
system at w (rad/sec)=0.1, 0.5, 1, 10, 100.
s 10 2
G( s) 2
5s 2s 25
10/17/2018 Dept. of EEE, PUST 9
Polar plots or Nyquist plot
2500
G( s)
s( s 5)( s 50)
To obtain the Nyquist plot use the following MATLAB code
num =2500;
den1= [1 0];
den2=[1 5];
den3=[1 50];
den12=conv(den1,den2);
den=conv(den12,den3);
nyquist(num,den)
10/17/2018 Dept. of EEE, PUST 10
Polar plots or Nyquist plot
Nyquist Diagram
40
30
20
-w
10
Imaginary Axis
-10
-20 w
-30
-40
-2.5 -2 -1.5 -1 -0.5 0
Real Axis
10/17/2018 Dept. of EEE, PUST 11
Polar plots or Nyquist plot
2500
G( s)
s( s 5)( s 50)
To adjust the default axes of Nyquist plot use axis command
num =2500;
den1= [1 0];
den2=[1 5];
den3=[1 50];
den12=conv(den1,den2);
den=conv(den12,den3);
nyquist(num,den)
axis([-2.5 0 -2 2])
10/17/2018 Dept. of EEE, PUST 12
grid on
Polar plots or Nyquist plot
Nyquist Diagram
2
2 dB 0 dB
1.5
-2 dB
4 dB
1 -4 dB
6 dB
-6 dB
0.5 10 dB -10 dB
Imaginary Axis
20 dB -20 dB
0
-0.5
-1
-1.5
-2
-2.5 -2 -1.5 -1 -0.5 0
10/17/2018 Dept. of EEE, PUST 13
Real Axis
Nyquist plot (Open-loop & Closed Loop Frequency Response )
Nyquist Diagram
2
2 dB 0 dB
1.5
-2 dB
4 dB
1 -4 dB
6 dB
-6 dB
0.5 10 dB -10 dB
Imaginary Axis
20 dB -20 dB
0
-0.5 System: sys
Real: -0.654
-1 Imag: -0.304
Frequency (rad/s): 7.57
-1.5
-2
10/17/2018 -2.5 -2 Dept.
-1.5 of EEE, PUST
-1 -0.5 0 14
Real Axis
Polar plots or Nyquist plot
Exercise-3: - consider following transfer function
10( s 10)
G( s)
s( s 2)( s 5)
(i) Obtain the Nyquist plot of the following system (when w>0).
(ii) Determine the open-loop & closed-loop magnitude responses
when w=2.5 rad/sec
10/17/2018 Dept. of EEE, PUST 15
Phase & Gain Margins
To obtain the gain margin and phase use the following mat
lab code.
2500
G( s)
s( s 5)( s 50)
num =2500;
den1= [1 0];
den2=[1 5];
den3=[1 50];
den12=conv(den1,den2);
den=conv(den12,den3)
[GM, PM, wp, wg]=margin(num,den)
10/17/2018 Dept. of EEE, PUST 16
Phase & Gain Margins
To obtain the gain margin and phase use the following mat lab code.
2500
G( s)
s( s 5)( s 50)
GM =
5.5000
num =2500;
PM =
den1= [1 0];
31.7124
den2=[1 5];
den3=[1 50];
wp =
den12=conv(den1,den2);
15.8114
den=conv(den12,den3)
[GM, PM, wp, wg]=margin(num,den)
10/17/2018 Dept. of EEE, PUST
wg = 17
6.2184
Phase & Gain Margins
To obtain the gain margin and phase use the following mat
lab code.
2500
G( s)
s( s 5)( s 50)
num =2500;
den1= [1 0];
den2=[1 5];
den3=[1 50];
den12=conv(den1,den2);
den=conv(den12,den3)
margin(num,den)
10/17/2018 Dept. of EEE, PUST 18
Phase & Gain Margins
Bode Diagram
Gm = 14.8 dB (at 15.8 rad/s) , Pm = 31.7 deg (at 6.22 rad/s)
0
Magnitude (dB)
-50
-100
-90
-135
Phase (deg)
-180
-225
-270
-1 0 1 2 3
10/17/2018 10 10 Dept. of EEE,10
PUST 10 10 19
Frequency (rad/s)
System Characteristics (Bode Plot)
10/17/2018 Dept. of EEE, PUST 20
System Characteristics (Nyquist Plot)
10/17/2018 Dept. of EEE, PUST 21
System Characteristics (Nichol’s Chart)
10/17/2018 Dept. of EEE, PUST 22
Exercise#5
• Obtain the phase and gain margins of the system shown in
following figure for the two cases where K=10 and K=100.
• Also obtain the Bode, Nyquist and Nichol's plots for either
cases.
10/17/2018 Dept. of EEE, PUST 23
Exercise#5
Bode Diagram
40
20
Magnitude (dB)
0 k=10
K=100
-20
-40
0
Phase (deg)
-45
-90
-2 -1 0 1 2
10/17/2018
10 10 Dept. of EEE,
10 PUST 10 10 24
Frequency (rad/s)
Exercise#6
• Consider the system shown in following figure. Obtain
Bode diagram for the closed-loop transfer function. Obtain
also the resonant peak, resonant frequency, and bandwidth.
10/17/2018 Dept. of EEE, PUST 25
Root Locus
To obtain root locus use the following mat lab code.
s = tf('s');
G = 1/(s*(s+7)*(s+11));
rlocus(G);
axis equal;
10/17/2018 Dept. of EEE, PUST 26
Root Locus
To obtain root locus use the following mat lab code.
clear all;
close all;
s = tf('s');
G = (s+1)/(s*(0.1*s-1));
rlocus(G);
axis equal;
sgrid;
title('Root locus for (s+1)/s(0.1s-1)');
[K,p]=rlocfind(G)
10/17/2018 Dept. of EEE, PUST 27
Root Locus
To obtain root locus use the following mat lab code.
s = tf('s');
G = (s^2-4*s+20)/((s+2)*(s+4));
rlocus(G);
zeta = 0.45;
wn = 0;
sgrid(zeta,wn);
10/17/2018 Dept. of EEE, PUST 28
State Space Model
>> A = [0 1 0; 0 0 1; 0 -2 -3];
>> b = [0; 0; 1];
>> c = [1 0 0 ];
>> d = 0;
>> stmod = ss(A,b,c,d)
Command
step(stmod) , initial(stmod, x0) , eig(stmod)
and
tfmod = tf(stmod), mineral (tfmod), eig(A),
pole(tfmod), pzmap(tfmod)
10/17/2018 Dept. of EEE, PUST 29
END OF TUTORIAL
10/17/2018 Dept. of EEE, PUST 30