You are on page 1of 83

CHAPTER 5

Frequency Response

OBJECTIVE
- Bode and Nyquist plots for control analysis
- Determination of transfer function
- Gain and Phase margins
- Stability in frequency response
Magnitude and Phase Angle
Transfer function is
Y (s) R(s) Y(s)
G ( s) G (s )
R( s)

By replacing s j we can find its magnitude

Y ( s) Y ( j )
G (s)
R( s) R ( j )
and its phase angle
G ( s) Y ( s) R( s)
Higher order transfer function
o (s) ( s z1 )( s z 2 ).....( s z m )
G( s) K
i (s) ( s p1 )( s p2 ).....( s pn )

Can be presented in magnitude-phase form as

G( j ) G( j )
Example
i (s) G (s ) o (s)
A system with transfer function of G(s) is subjected to a sinusoidal input. i (t ) a sin t
Determine the time response of the system.

Solution
The input in phasor form (magnitude-phase form) can be presented as

i ( j ) a0
As the transfer function is
o (s)
G (s)
i (s)
Hence the output is by replacing
s j

o ( j ) G( j ) a0 a G( j )
In time domain which give the time response of the system, the output is

o (t ) a G( j ) sin( t )
First order
Transfer function

K
G (s)
s 1
Frequency response by replacing s j

1
G ( j )
j 1
Its magnitude

1
G ( j )
1 2 2
and phase angle


tan 1 1
tan ( )
1
Second order

Transfer function
Kn2
G( s) 2
s 2n s n2
Frequency response by replacing s j

1 n j 2 n
2
G( j )
1 2
n
2 2
n
2

Its magnitude
1
G ( j )
1
n
2 2
2 n
2

and phase angle


2 n
tan 1 2
1 n
Higher Order

Cascade form
G(s) G1 (s)G2 (s).....Gn (s)
Frequency response by replacing s j
G( j ) G1 ( j )G2 ( j ).....Gn ( j )
Or in phasor form

G ( j ) G1 ( j ) 1 G2 ( j ) 2 ..... Gn ( j ) n
G1 ( j ) G2 ( j ) .... Gn ( j ) ( 1 2 .... n )
Example
Example:

Find the frequency response of the following transfer function


5
G( s)
s 3 6 s 2 33s 50
G(s) G1 (s)G2 (s)

Where

0.2 0.1 25
G1 ( s ) and G2 ( s ) 2
s 2 0.5s 1 s 4s 25
Example
Respective magnitude and phase angle

0.1 0.1
G1 ( j ) and 1 ( j ) tan 1 (0.5 )
1 2 0.5 2 1 0.25 2
1
G2 ( j )
1 5
2 2
2( 0.4 ) 5n
2

1

1 5
2 2
2( 0.4 ) 5n
2

2(0.4) 5
and 2 ( j ) tan 1
1 5 2

G ( j ) G1 ( j ) 1 ( j ). G2 ( j ) 2 ( j )
G1 ( j ) . G2 ( j ) 1 ( j ) 2 ( j )
Bode Plot
Consider higher order system

G( j ) G1 ( j ) 1 ( j ). G2 ( j ) 2 ( j )...... Gn ( j ) n ( j )

Logarithmic form

log G( j) log G1 ( j) log G2 ( j) .... log Gn ( j)


In dB.

LM 20 log G( j ) 20 log G1 ( j ) 20 log G2 ( j ) .... 20 log Gn ( j )


Phase angle

( j ) 1 ( j ) 2 ( j )..... n ( j )
Bode Plot
Bode Diagram
1

0.8
Magnitude (dB)

0.6

0.4

0.2

0
1

0.8
Phase (deg)

0.6

0.4

0.2

0
0 1 2 3
10 10 10 10
Frequency (rad/sec)
Bode Plot for constant gain

G( s) K
Log magnitude in dB

LM 20 log K
Its phase angle

0
Let K=200
>> bode([200],[1]);grid
Bode Plot for constant gain
Bode Plot G(s)=200
47.5

47
Magnitude (dB)

46.5

46

45.5

45
1

0.5
Phase (deg)

-0.5

-1
0 1 2 3 4
10 10 10 10 10
Frequency (rad/sec)
Bode Plot of pole on the origin

G(s) 1 s
G(s j) 1 ( j)
Log magnitude in dB

LM 20 log 1 20 log( )

(rad.s 1 ) LM(dB)
(rad.s 1 ) LM ( dB)
1 0
1 0
10-1 20
10 -20
102 -40 10-2 40
103 -60 10-3 60
Bode Plot of pole on the origin

(rad.s 1 ) LM(dB)
1 0
2 -6
22 -12
23 -18

Slope of 20dB/decade or 6dB/octave.

Its phase angle

tan 1 0 tan 1 () 90
>>bode([1],[1 0]);grid
Bode Plot of pole on the origin
Bode Plot G(s)=1/s
10

0
Magnitude (dB)

-10

-20

-30

-40

-50
-89

-89.5
Phase (deg)

-90

-90.5

-91
0 1 2 3
10 10 10 10
Frequency (rad/sec)
1
G (s)
s 1
Frequency response
1 j 1 1 j
G( j )
j 1 j 1 1 2 2
Logarithmic magnitude in dB


LM 20 log

1
20 log

1
2 2

1
2 2

Phase angle

tan 1 1 tan 1 ( )
The corner frequency is
c 1
For low frequency,
1

LM 20 log 1 0

and 0 Can also be defined as a tenth of the corner frequency i.e. 0.1

For high frequency, 1


Can also be defined as a tenth of the corner frequency i.e. 10

LM 20 log
and

tan 1 () 90
A straight line approximation for a first order system of transfer function
1
G (s)
s 1
The actual Bode plot can be obtained by using the exact equation for the log
magnitude and phase angle. There are small differences between the actual and
approximate as shown by the following table

Using MATLAB we can display the Bode plot of an open-loop transfer function of

And the MATLAB command used is given by

1
G ( s)
s 1
nr=[1];
dr=[1 1];

sys=tf(nr,dr)
bode(sys)
Actual and approximate value of log magnitude for an open-loop transfer function of
1
G ( s)
s 1
for a frequency range between 0.1-20 rad/s
Actual and approximate value of log magnitude for an open-loop transfer function of
1
G ( s)
s 1
for a frequency range between 0.1-20 rad/s
1
LM 20 log

20 log 2 3 dB
1 1

tan 1 1 1 45
K n2
G( s)
s 2 2 n s n2



LM 20 log G( j ) 20 log 1 n
2
2
2
n
2

2 n
1
tan 2
1 n
n Is the corner frequency

For low frequency ,


n 1 LM 20 log 1 0
1
and tan (0 1) 0
n
We define the low frequency as a tenth of the corner frequency i.e. 10
For high frequency n 1

LM 20 log n 2 40 log n
and

tan 1 2
180

While the high frequency as ten time of the corner frequency i.e. 10n
Based on straight line approximation the Bode plots for LM and phase angle are shown
We can observe the Bode plots in MATLAB by considering

1
G (s)
s 2 2 n s n2

for n 1 and 0.25, 0.5 and 0.75

In MATLAB
>>zeta=0.25;wn=1;num=[1];den1=[1 2*zeta*wn wn*wn];
sys1=tf(num,den1);
>>zeta=0.5;wn=1;num=[1];den2=[1 2*zeta*wn wn*wn];
sys2=tf(num,den2);
>>zeta=0.75;wn=1;num=[1];den3=[1 2*zeta*wn*wn*wn];sys3=tf(num,den3);
>> bode(sys1,sys2,sys3);grid
Obtain the bode plot of the following block diagram if

5000( s 4)
G ( s)
s ( s 10)( s 200)
o

+
Go (s)
_
1 1
5000 1/s s+4 s 10 s 200

By replacing with s=j and making the open-loop transform function


into corner frequency form

5000 4 1 j 1 1
G o ( j ) . . 1. .
10 200 j 4 j 1 j 1

10 200
1 j 1 1
10. . 1. .
j 4 j 1 j 1

10 200
The initial LM and phase at start frequency is given by

1
LM (0.1) 20 log 10 40 dB
0.1
(0.1) 90
For the magnitude plot of the Bode plot, we build a table to show the contribution of
gradient/slope by the zero and poles at respective corner frequencies. The pole at origin will
provide a slope of -20db/decade for all range of frequency
- For the phase plot, we need to know the change of gradient of the phase at low and
high frequencies of respective corner frequency
- The pole at the origin does not contribute to gradient of the phase angle as its phase
angle is a constant 90o
The LM vs. freq. plot can be determined using the LM value at the corner
frequency, this can be obtained by simple trigonometry
LM 2 LM 1
LM
log 2 log 1
LM 2 LM1 LM log 2 log 1
LM1 LM (dB/dec)
Eg:
LM 2
LM 2 40 20log 4 log 0.1 8dB

log 1 log 2

Using the trigonometrys formula, we tabulate the values at the initial,


corner frequencies and final value.
As for the LM slope, we apply a trigonometry's formula to obtain the
phase angle slope at the low and high frequency for each corner
frequency as in table below

2 1

(deg/decade)
log 2 log 1
1
2 1 log 2 log 1
2
Eg:
2 90 0log 0.4 log 0.1 90
log 1 log 2
Bode plot for the magnitude and phase using straight line approximations
We can obtain the actual Bode plot using MATLAB as
>>bode([5000 20000],[1 210 2000 0],{10^-1,10^4});
Bode Diagram
50
Magnitude (dB)

-50

-100
-45
Phase (deg)

-90

-135

-180
-1 0 1 2 3 4
10 10 10 10 10 10
Frequency (rad/sec)
Determination of transfer function
Constant gain
Example:

If K y 36 dB, determine the transfer function.

dB

Ky

(rad.s-1)

20 log K K y
K y 36 dB
36
K antilog 63.1
20
Determination of transfer function
Pole/zero at origin
Example:
If 1 10 rad.s-1, K y 10 dB and slope of LM 40 dB/decade.

dB

Ky
LM 40 dB/decade

(rad.s-1)
1
K
s2
K
20 log 2 K y
1
We know 1 10 rad.s-1, K y 10dB

10
K 10 2 antilog 31.6
20
Determination of transfer function
Real pole/zero
Example:

dB
45 LM 1 20 dB/decade

LM 2 40 dB/decade
(rad.s-1)
0.01 40 250
LM 3 20 dB/decade
Example
j
K 1
250
j j 1
40

K
LM (0.01) 20 log 45
0.01
45
K 10 2 antilog 1.78
20
s
1.78 1
250 ( 40)(1.78) ( s 250) 0.28( s 250)
s ( 250) s ( s 40) s ( s 40)
s 1
40
Determination of transfer function
Pair of complex poles
Example:

Assume damping ratio of 0.5.

dB

60

LM 1 40 dB/decade
(rad.s-1)
0.1 50 400
LM 2 60 dB/decade
Example
400
K 2
n

400


1 1 50 j 2 50

2

K' K
400
2
n

LM (0.1) 20 log( K ' ) 60

60
K ' antilog 1000
20


K ' n2 400 1 109

1 109
G (s)

( s 400) s 2 2(50)(0.5) s 50 2
1 109


( s 400) s 2 50 s 2500
Example
>> num=1e09
num =
1.0000e+09
>> den=conv([1 400],[1 50 2500])
den =
Columns 1 through 3
1 450 22500
Column 4
1000000
>> a=tf(num,den)
a=
1e09
------------------------------
s^3 + 450 s^2 + 22500 s + 1e06

Continuous-time transfer function.


>> bode(a)
Nyquist Plot
Nyquist plot is a plot of magnitude, G( j ) and phase angle ( j ) for frequency
0 on s-plane.

(rad.s-1) 0 1
G( j ) G( j 0) G( j1 ) G( j)
( j ) ( j 0) ( j1 ) ( j )

However we can obtain the sketch of the plot by obtaining the following vectors:

(i) at =0
(ii) at =
(iii) at =0 or 180, crossing on the real axis
(iv) at =90 or 180, crossing on the imaginary axis
First order
K
G (s)
s 1
Frequency response
K 1 j
G( j ) K
j 1 1 2 2
Magnitude
K
G ( j )
1 2 2 and

Phase angle

tan 1 ( )
First order
K
(i) At = 0, G ( j ) K and = tan-1(0) = 0
1 0


and tan 1 tan . i.e. tan-1(-) = -90 or -270
1
(ii) At = G( j ) 0
1

(iii) No crossing in the real axis as = , = -90

(iv) No crossing in the imaginary axis as , 90

G ( j ) 2 2 K
2

is a circle.
First order
Example:

Nyquist plot of G ( s )
20
s4
5
G (s)
0.25s 1
Frequency response

5
G ( j ) ,
and tan 1 (0.25,)
1 0.0625 2

.
5
At 0 G( j 0) 5 and tan 1 (0) 0
1 0
5
G( j) 0 and tan 1 tan 90
1
At
1 1

>> nyquist([5],[.25 1])


First order
Plot Nyquist G(s)=5/(0.25s+1)

2.5

2 System: sys
System: sys Real: 3.64
1.5 Real: 0.917 Imag: 2.22
Imag: 1.93 Freq (rad/sec): -2.45
1 System: sys
Freq (rad/sec): -8.46
System: sys
Real: 0.000335 Real: 5
0.5 Imag: 0
Paksi Khayali

Imag: -0.0409
Freq (rad/sec): 489 Freq (rad/sec): 0
0


-0.5 System: sys
Real: 4.52
-1 Imag: -1.47
System: sys Freq (rad/sec): 1.3
-1.5 Real: 1.24
Imag: -2.16
-2 Freq (rad/sec): 6.98

-2.5
-1 0 1 2 3 4 5 6
Paksi Hakiki
Second order
Nyquist Diagram
1

0.8

0.6

0.4

0.2

Imaginary Axis
0

-0.2

-0.4

-0.6
1 G ( j) H ( j)

-0.8

-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Real Axis
Second order
n2
G( s) K 2
s 2 n s n2
Frequency response

1
G ( j )
1 j2
n
2 2
n
2

Rearrange


2

1

j 2



n
n
G( j )
2

2

2

1

2



n
n
Second order
Magnitude
1
G ( j )
2 2 2

1 2
n

n



Phase angle


2

n
tan 1 2
1



n

(i) at 0 , G( j ) 1 and 0

(ii) At , G( j ) 0 and tan 1 1 2 180 .

(iii) No crossing on the real axis. 2

(iv) Crossing of the imaginary axis when 1 0 , n
n
.
1
G ( j n ) and tan 1 2 0 90
2
Second order
Example:

1
G ( s)
(2s 1)( s 2 s 1)
Frequency response
1 1
G ( j )
( j 2 1)(1 2 j ) (1 3 2 ) j (3 2 3 )
(1 3 2 ) j (3 2 3 )

(1 3 2 )2 (3 2 3 )2

Magnitude
1
G ( j )
(1 3 2 ) 2 (3 2 3 ) 2
Phase angle

3 2 3
tan 1

1 3
2

Second order
(i) At , 0 G( j 0) 1 and 0
3
(ii) At , G( j) 0 and tan 1 270
1
2

(iii) Real axis crossing at 3 2 3 0 , 0 and 3 2 1.2 rad.s-1 or 1.2


1
Magnitude G( j1.2) 0.3
(1 31.2 ) 0
2 2

(iv) Imaginary crossing at 1 3 2 0 , 1 3 =0.6 rad.s-1


1
Magnitude G( j 0.6) 0.7
0 ( 3 2 3 3) 2

dr1=[2 1];
dr2=[1 1 1];
dr=conv(dr1,dr2);
nr=1;
nyquist(nr,dr)
Second order

Plot Nyquist G(s)=1/(2s+1)(s 2+s+1)


0.8

0.6

0.4

System: sys System: sys


0.2 Real: -0.297 Real: 0.999
Imag: 0.0104 Imag: 0.00365
Paksi Khayali

Freq (rad/sec): -1.21 Freq (rad/sec): -0.00126


0

-0.2

-0.4
System: sys
Real: -0.00357
-0.6 Imag: -0.74
Freq (rad/sec): 0.579

-0.8
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Paksi Hakiki
Nyquist Path
For Nyquist path
j s-plane

Contour of 1+G(s)H(s) which will give the closed loop poles for = - till = by replacing s = j
to become1+G(s)H(s).

j F(j)-plane


1 G( j )H ( j )
Nyquist Path
However
G ( j ) H ( j ) 1 1 G ( j ) H ( j ) 1 F ( j )
Hence on F(j)-plane, we represent GH(j)-plane to plot 1 G ( j ) H ( j )

GH(j)-plane
j

-1+j0

.
G ( j ) H ( j )

1 G( j ) H ( j )
Nyquist Stability Criterion
The criteria states that the number of closed poles of a system is equal to the number of
open-loop, G(s)H(s), zeros plus the number of encirclements in the clockwise direction by the
Nyquist plot of the open-loop, G(s)H(s).
Or, it can be represented in mathematic form as
Z NP

where
Z = Number of zeros F (s ) on the right-half plane of j-axis, where . F ( s ) 1 G ( s ) H ( s )
N = Number of clockwise encirclement of 1 j0
P = Number of open-loop poles G ( s) H ( s) on the right-half plane of j-axis.
K ( s 2)
ConsiderG ( s ) H ( s ) , applying the Nyquist stability criteria
( s 1) 2
Z=N+P=1+0=1

Hence the system has 1 closed-loop pole on the right of the imaginary axis
s^2 + 10 s + 24
---------------
s^2 - 8 s + 15
The first thing we need to do is find the number of positive real poles in our open-loop
transfer function, P:
>>roots([1 -8 15])
ans = 5
3
The second thing we need to do is find the number of positive real zeros in our open-loop transfer
function, Z:
>>roots([1 10 24])
ans =
-6.0000
-4.0000
Z=N+P
N=Z-P=0-2=-2
The poles of the open-loop transfer function are both positive. Therefore, we need two anti-
clockwise (N = -2) encirclements of the Nyquist diagram in order to have a stable closed-
loop system (Z = P + N).
If the number of encirclements is less than two or the encirclements are not anti-clockwise,
our system will be unstable.
Let's look at our Nyquist diagram for a gain of 1:
nyquist([ 1 10 24], [ 1 -8 15])
Nyquist Diagram
1.5

0.5
Imaginary Axis

-0.5

-1

-1.5
-1.5 -1 -0.5 0 0.5 1 1.5 2
Real Axis
Nyquist Stability Criterion
Stability analysis

There is no encirclement of the -1+j0 point. This implies that the


system is stable if there are no poles of G(s)H(s) in the right-half s
plane; otherwise, the system is unstable.
There are one or more counterclockwise encirclements of the -1+j0
point. In this case the system is stable if the number of
counterclockwise encirclements is the same as the number of poles
of G(s)H(s) in the right-half s plane; otherwise, the system is
unstable.
There are one or more clockwise encirclements of the -1+j0 point. In
this case the system is unstable.
Gain margin,

Is the reciprocal of the magnitude G( j ) at the frequency at which the phase angle is -1800.

Phase crossover frequency, p


j
G ( j ) H ( j ) GH(j)-plane
Frequency where the phase angle of is 180 o

Gain crossover frequency, g 1/GM


p
Frequency where the magnitude of G ( j ) H ( j )
-1+j0

1 GM G ( j ) 180 G ( j g ) 1

g
1 1
Gain margin, GM
G ( j ) 180
G ( j p )

G ( j p )

GM (dB) 20 log G ( j ) 180
20 log G( j )
p
j GH(j)-plane

-1+j0

G ( j g ) 1

Unit circle

G ( j g ) 1 will give phase angle of G ( j g ) hence the phase margin

Phase margin, 180


Negative gain and phase margins in
Nyquist Plot
j
G ( j p ) GH(j)-plane



-1+j0


As G ( j p ) 1 , the gain margin GM (dB) 20 log G ( j p ) negative

As 180 , the phase margin 180 negative



Example:

For K 8 , shows the Nyquist plot and its respective gain and phase margin

+ 5K
s 2 4s 7
-
1
s3

Open loop transfer function

5K
GOL ( s)
( s 3)( s 2 4s 7)

Frequency response

5K 5K
G ( j )
( j 3)(7 2 j 4) (21 7 2 ) j (19 2 )
Magnitude
5K
G( j )
(21 7 2 ) 2 2 (19 2 ) 2

Phase angle
(19 2 )
1
tan
(21 7 )
2

(i) At, 0
1.9 and ( j 0) tan 1 0
5(8) 0
G ( j 0)
21 21
(ii) At,
5(8) 3
G ( j ) 0 and ( j) tan 1 270
90


2
(iii) Real crossing, when . (19 2 ) 0
5(8)
19 rad .s 1
then G( j 19 ) 0.36
(21 7 19) 0
2

(iv) Imaginary crossing, when 21 7 2 0


5(8)
3 rad .s 1 then G( j 3) 1.44
0 3(19 3) 2

nr=40;
dr1=[ 1 3];
dr2=[1 4 7];
dr=conv(dr1,dr2);
nyquist(nr,dr)
Nyquist Diagram
2

1.5

0.5
Imaginary Axis

-0.5

-1

-1.5

-2
-1 -0.5 0 0.5 1 1.5 2
Real Axis
1 GM G( j ) 180
G( j ) 180
G( j 19 ) 0.36

GM 20 log G ( j ) 180

20 log( 0.36) 8.87 dB

At =2.54 G ( j g ) 1

52.83
Positive gain & phase margins
in Bode plot
LM (dB)
g p
(rad.s-1)
0

LM p
GM
Below x-axis

0o
Above 180
g
PM
-180o

g
GM gain margin - Gain crossover frequency
PM phase margin p
- Phase crossover frequency
Negative gain & phase margins
in Bode plot
LM (dB)

g Above x-axis
GM (rad.s-1)
0 p


o
0

o
-180
PM Below 180

Note that, negative gain or phase margin means that the system is NOT STABLE..
Example

Example:
If Gc ( s) 1 and K=96 determine gain and phase crossover frequencies.
Consequently what is the system gain and phase margin.

+ K
Gc s( s 2)( s 40)
-
Example
Frequency response
96
G ( j )
j j
2 40 ( j ) 1 1
2 40
1.2

j j
( j ) 1 1
2 40



1.2
LM ( j ) 20 log
2 2
( ) 1 1
2 40

( j ) 90 tan 1 (0.5 ) tan 1 (0.025 )

1.2
22 dB and ( j 0.1) 90

LM ( j 0.1) 20 log
(0.1)
Example
Table of LM slope for the 3 poles

(rad.s-1) 0.1 2 40
1 -20 -20 -20
s
(dB/decade)
0 -20 -20
1
s2
(dB/decade)
0 0 -20
1
s 40
(dB/decade)
Total slope -20 -40 -60
dB/decade
Example

(rad.s-1) 0.1 0.2 4 20 400


1 0 -45 -45 0 0
s2

slope
(deg/decade)

1
0 0 -45 -45 0
s 40
Slope
(deg/decade)

Total 0 -45 -90 -45 0


slope
(deg/decade))

Table for phase angle slope from the two poles, notes that the pole at
origin does not contribute to the slope as the angle is constant -90o
Example
To obtain the LM vs freq. plot, we determine the LM value at the corner
frequency, this can be obtained by simple trignometry
LM 2 LM 1
LM
LM1 LM (dB/dekad)
log 2 log 1

LM 2 LM1 LM log 2 log 1


LM 2

log 1 log 2

Using the trignometrys formula,

(rad.s-1) 0.1 2 40 400 1000

Total slope -20 -40 -60 -60 -60


(dB/dec)

LM (dB) 22 -4 -56 -116 -140


Example
As for the LM slope, we apply a trignometrys formula to obtain the
phase angle slope at the low and high frequency for each corner
frequency as in table below

2 1

1 (deg/decade) log 2 log 1
2 1 log 2 log 1
2

log 1 log 2

(rad.s-1) 0.1 0.2 4 20 400 1000

Total slope 0 -45 -90 -45 0 0


(deg/dec)

(deg) -90 -90 -149 -212 -271 -271


Example

Gain crossover frequency Phase crossover frequency


Example

g 8.5 rad.s 1
p 1.3 rad.s 1
PM 50
GM 30 dB

>> bode([96],[1 42 80 0])


Example

50

0
GM

-50

-100

-150
-90

-135
PM
-180

-225
Wp
Wg
-270
-1 0 1 2 3
10 10 10 10 10

>>[GM,PM,Wg,Wp] = margin(sys)
Example

>> num=[96];den=[1 42 80 0];


>> sys=tf(num,den);
>> [GM,PM,Wg,Wp] = margin(sys)
Gm = 35.0000
Pm = 60.5601
Wg = 8.9443
Wp = 1.0599

>> Gm_dB = 20*log10(Gm)


Gm_dB = 30.8814

You might also like