0% found this document useful (0 votes)
33 views21 pages

Bode Plots

The document outlines an experiment focused on Bode Plots, aiming to analyze stability, examine the relationship between open loop frequency response and closed loop transient response, and design gain for stability. It explains the Bode Plot as a graphical method for determining the stability of Linear Time Invariant systems, detailing key parameters such as gain and phase crossover frequencies, gain and phase margins, and their implications for system stability. Several examples using MATLAB illustrate the application of Bode Plots in analyzing system stability and response characteristics.

Uploaded by

ali alaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views21 pages

Bode Plots

The document outlines an experiment focused on Bode Plots, aiming to analyze stability, examine the relationship between open loop frequency response and closed loop transient response, and design gain for stability. It explains the Bode Plot as a graphical method for determining the stability of Linear Time Invariant systems, detailing key parameters such as gain and phase crossover frequencies, gain and phase margins, and their implications for system stability. Several examples using MATLAB illustrate the application of Bode Plots in analyzing system stability and response characteristics.

Uploaded by

ali alaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

40

Experiment No. (3)


Bode Plots

 Objectives:
The objectives of this experiment are to:
1. Plot Bode Diagrams and analyze stability.
2. Examine the relationship between open loop frequency
response and closed loop transient response.
3. Use frequency response to design the gain to meet
stability specification.
 Introduction:

The frequency response of the systems is defined as the


response of the system to a sinusoidal input signal, the
output is also sinusoidal signal, The genesis of the
frequency response analysis is to determine the stability of
closed loop systems from the frequency response of the
open loop systems, in the frequency response there are
many ways to determine the stability of a control systems,
such as Bode Plot, Nyquist criterion and Nichols Chart.
 Bode Plot:
Bode Plot is a graphical representation of the transfer
function for determining the stability of a Linear Time
Invariant (LTI) systems.
This technique has different advantages in the following
situations:

Khaled Mustafa Mahmoud Session: Fall 2015/2016


41

1. When it is hard to sketch the Root Locus, Bode Plot is


simple and accurate.
2. The unknown transfer function of a system can be
deduced from the experimentally determined frequency
response of a system.
3. When response of the system subjected to undesired
noises and disturbances.
The main disadvantage of the Bode Plot (all frequency
response methods) for analysis and design is the indirect
link between the frequency and the time domain.
The Bode Plot consists of two graphs:
1. The magnitude curve of G ( jω ¿ plotted in the versusω.
2. The phase curve of G( jω ¿ plotted in degrees as a function
of ω .
Also, you must be know some parameters in this method:

1. Gain crossover frequency (ω c ):is the frequency at which


the magnitude curve of the system cross the 0 dB.
2. Phase crossover frequency ( ω π ) :is the frequency when the
phase curve of the system cross -180° .
3. Gain Margin (GM): is the magnitude in dB at which the
phase curve cross the -180° .

GM =0−|G ( jω)||ω π

4. Phase Margin (PM): is the angle with degree at which the


magnitude curve cross the 0 dB.

PM =∠ G( jω)|ω −(−180 ° ) .
c

Khaled Mustafa Mahmoud Session: Fall 2015/2016


42

5. Bandwidth(ω BW ): the frequency at which the frequency


response has declined -3 dB from its low frequency
value.

Figure 4.1: Gain and phase margins and System bandwidth on the
Bode Diagrams.

 Bode Plot Stability Criterion:

The Bode Plot used to determine the stability of control


systems. For a minimum phase system, both phase and
gain margins should be positive or at least the phase
margin should be positive for the system to be stable. A
negative phase margin means that the system is unstable.

Khaled Mustafa Mahmoud Session: Fall 2015/2016


43

In other words, when the gain crossover frequency is less


than phase cross over frequency, the system is stable. If
the gain crossover frequency is greater than phase
crossover frequency, the system is unstable. If the gain
crossover frequency equals phase crossover frequency
(the gain margin equal to 0 dB and the phase margin is 0° ),
the system is marginally stable.

Figure 4.2: Gain and phase margins of stable and


unstable systems.

Example 4.1: The unity feedback system shown in Figure


4.3:

1000 K
G ( s )=
s (s+5)(s+20)

Using MATLAB. Plot the Bode Diagram (let K=1), then


determine the following:
1. Gain and Phase crossover frequencies (ω c ∧ω π ¿ .
2. Gain and Phase Margins (GM & PM).
3. Range of K for stability from Bode Plots.

Khaled Mustafa Mahmoud Session: Fall 2015/2016


44

Also, determine the peak time, overshoot, settling time,


and steady state error for the closed loop step response if
K = 0.5.

Figure 4.3: Feedback control system of Example 4.1.

Solution:
10
G ( jω )=
jω ( jω5 +1)( 20jω +1)
Since, the system has a pole at the origin.

Hence, the starting point at low frequency (ω=0.1 ¿is given


by:

S . P=20 log ( Kω ) → S . P=20 log ( 0.110 )=40 dB .


The break frequencies are at: 5 and 20 rad/sec.

>> % To plot the Bode diagram of Example 4.1 using MATLAB %

>> s=tf('s');

>> x=1000/(s*(s+5)*(s+20));

>> bode(x)
>> allmargin(x);

Khaled Mustafa Mahmoud Session: Fall 2015/2016


45

B o d e Dia gSr ya smte m: x


50 G a in Ma r g in ( d B ) : 7 .9 6
A t f r e q u e n c y ( r a d /s e c ) : 1 0
Clo s e d L o o p S ta b le ? Y e s
M a g n itu d e ( d B ) 0

-50

-100

S y s te m: x
-150
-90 Ph a s e Ma r g in ( d e g ) : 2 2 .5
De la y Ma r g in ( s e c ) : 0 .0 6 4 7
A t f r e q u e n c y ( r a d /s e c ) : 6 .0 8
-135 Clo s e d L o o p S ta b le ? Y e s
Phas e (deg)

-180

-225

-270
-1 0 1 2 3
10 10 10 10 10
Fr e q u e n c y ( r a d /s e c )

Figure 4.4: Bode Plot diagram of Example 4.1.

From Figure 4.4:

1. The gain crossover frequency ( ω c )equals 6.08 rad/sec, and


the phase crossover frequency ( ω π )equals 10 rad/sec.
2. The Gain Margin (GM) equals 7.96 dB, and the Phase
Margin (PM) equals 22.5° .
Both phase and gain margins are positive, and gain cross
over frequency is less than phase cross over frequency.
Therefore, the system is stable.
3. To determine the range K for stability from Bode Plots:
GM =20 log K → 7.96=20 log K → K=2.5.
K = 2.5×1000=2500 will cause the system to be marginally
stable. Hence, the system is stable if 0< K < 2500.
>> % To determine the peak time, overshoot, settling time, and ess if
K = 0.5 %

Khaled Mustafa Mahmoud Session: Fall 2015/2016


46

>> sys=feedback(0.5*x,1)
>> step(sys)

System: sys
Peak amplitude: 1.28 Step Response
Overshoot
1.4 (%): 27.8
At time (sec): 0.761

1.2
System: sys System: sys
Settling Time (sec): 2.26 Final Value: 1
1

0.8
Amplitude

0.6

0.4

0.2

0
0 0.5 1 1.5 2 2.5 3 3.5
Time (sec)

Figure 4.5: Step response of Example 4.1.

From Figure 4.5: the peak time is 0.761 sec, overshoot is


27.8 %, settling time is 2.26 sec, and the steady state error
equals zero.

Example 4.2: Given a unity feedback system that has the


forward transfer function:
8000 K
G ( s )=
(s+ 2)(s+ 4)(s+10)

Using MATLAB. Plot the Bode diagram (let K=1), then


determine the following from the graph:
1. Gain and Phase crossover frequencies.
2. Gain and phase margins.
3. Stability of the system.

Khaled Mustafa Mahmoud Session: Fall 2015/2016


47

Solution:

100
G ( jω )=
( jω2 +1)( jω
4
+1 )( 10jω +1)
Since, the system doesn’t have a pole nor a zero at the
origin.

Hence, the starting point is given by:


S . P=20 log K=20 log 100=40 dB .

The corner frequencies are at: 2, 4, and 10 rad/sec.

>> % To plot the Bode diagram of Example 4.2 using MATLAB %


>> s=tf('s');
>> x=8000/((s+2)*(s+4)*(s+10));
>> bode(x)
>> allmargin(x);

S y s te m: x
B o d e Dia g r a m G a in Ma r g in ( d B ) : - 1 8
50 A t f r e q u e n c y ( r a d /s e c ) : 8 .2 5
Clo s e d L o o p S ta b le ? No

0
M a g n itu d e ( d B )

-50

-100
0

-90 S y s te m: x
Phas e (deg)

Ph a s e Ma r g in ( d e g ) : - 4 4 .4
De la y Ma r g in ( s e c ) : 0 .2 8 9
A t f r e q u e n c y ( r a d /s e c ) : 1 9
-180
Clo s e d L o o p S ta b le ? No

-270
-2 -1 0 1 2 3
10 10 10 10 10 10
Fr e q u e n c y ( r a d /s e c )

Figure 4.6: Bode Plot diagram (K=8000) of Example 4.2.

Khaled Mustafa Mahmoud Session: Fall 2015/2016


48

From Figure 4.6:

1. The gain crossover frequency equals to 19 rad/sec, and


the phase crossover frequency equals to 8.25 rad/sec.
2. The gain margin equals to -18 dB, and the phase margin
equals to −44 °. So that…
3. The system is unstable. But it can be made stable by
reducing the gain K, where:

GM =20 log K →−18=20 log K → K=0.1258 .

K=0.1258× 8000=1006.4 will cause the system to be marginally

stable. Hence, the system is stable if 0< K < 1006.4 .

>> % Let K=¿800, then plot the Bode diagram %

>> x1=800/((s+2)*(s+4)*(s+10));
>> allmargin(x1);

>> bode(x1)

Khaled Mustafa Mahmoud Session: Fall 2015/2016


49

B o d e Dia g r a m S y s te m : x 1
50 G a in M a r g in ( d B ) : 2 .0 2
A t f r e q u e n c y ( r a d /s e c ) : 8 .2 5
Clo s e d L o o p S ta b le ? Y e s
0
M a g n itu d e ( d B )

-50

-100

-150
0
S y s te m : x 1
Ph a s e M a r g in ( d e g ) : 7 .1 1
-90 De la y M a r g in ( s e c ) : 0 .0 1 6 8
Phas e (deg)

A t f r e q u e n c y ( r a d /s e c ) : 7 .3 9
Clo s e d L o o p S ta b le ? Y e s
-180

-270
-2 -1 0 1 2 3
10 10 10 10 10 10
Fr e q u e n c y ( r a d /s e c )

Figure 4.7: Bode Plot diagram (K=800) of Example 4.2.

From Figure 4.7:

 The gain crossover frequency equals to 7.39 rad/sec, and


the phase crossover frequency equals to 8.25 rad/sec.
 The gain margin equals to 2.02 dB, and 7.11° phase
margin. Hence, the system is stable.

Example 4.3: Use MATLAB LTI Viewer with the Bode Plot
for a unity feedback system with:

50 K ( s+2 )
G ( s )=
( s2 +4 s +16 )

Khaled Mustafa Mahmoud Session: Fall 2015/2016


50

To find the following:


1. Gain and phase crossover frequencies.
2. Gain and phase margins.
3. Stability of the system from Bode Plots.
4. Bandwidth (ω BW ).
Then, obtain the closed loop step response when K =2.

Solution:

G ( jω )=
6.25 ( jω2 +1)
( ( jω )2 4 jω
16
+
16
+1 )
Since, the system doesn’t have a pole nor a zero at the
origin.

Hence, the starting point is given by:


S . P=20 log K → S . P=20 log 6.25=15.91 dB .
2
ω n=16 → ωn =4 rad /sec , ζ =0.5 .

The break frequencies at: 2 and 4 rad/sec.

>> % To plot the Bode diagram of Example 4.3 using MATLAB %


>> s=tf('s');
>> x=50*(s+2)/( s^2+4*s+16);
>> ltiview(x)
>> allmargin(x);

>> bandwidth(x);

Khaled Mustafa Mahmoud Session: Fall 2015/2016


51

Bode Diagram
30
System: x
Frequency (rad/sec): 0.101 System: x
20 Magnitude (dB): 15.9 Frequency (rad/sec): 12.1
Magnitude (dB): 12.9
Magnitude (dB)

10

-10
45

0
Phase (deg)

System: x
Phase Margin (deg): 92.3
-45 Delay Margin (sec): 0.0321
At frequency (rad/sec): 50.2
Closed Loop Stable? Yes
-90
-1 0 1 2
10 10 10 10
Frequency (rad/sec)

Figure 4.8: LTI Viewer with Bode Plot diagram of Example 4.3.

From Figure 4.8:

1. The gain crossover frequency equals 50.2 rad/sec, and


the phase crossover frequency doesn’t exist.
2. The gain margin approaches to infinity, and the phase
margin equals 92.3° .
3. Phase margin is positive and phase cross over frequency
doesn’t exist. Therefore, the system is stable for any
value of K.
4. The system bandwidth (ω BW at 15.9−3=12.9 dB ) is equal to 12.1
rad/sec.

>> % To obtain the closed loop step response when K =2 using LTI
Viewer %
>> sys=feedback(2*x,1);

Khaled Mustafa Mahmoud Session: Fall 2015/2016


52

>> ltiview(sys)

System: sys
Peak amplitude: 0.974
Overshoot (%): 5.21
At time (sec): 0.0675 Step Response System: sys
1
Final Value: 0.926

0.9 System: sys


Settling Time (sec): 0.529
0.8
System: sys
Rise Time (sec): 0.0177
0.7

0.6
Amplitude

0.5

0.4

0.3

0.2

0.1

0
0 0.2 0.4 0.6 0.8 1 1.2
Time (sec)

Figure 4.9: LTI Viewer step response of Example 4.3.

From Figure 4.9: the peak time is 0.0675 sec, overshoot is


5.21%, settling time is 0.529 sec, and the steady state error
(e ss =1−0.926=0.0740).

Example 4.4: The unity feedback (Non-minimum phase)


system shown in Figure 4.10, where:

K ( s−5 ) ( s−15)
G ( s )=
(s+1) ( s +10 ) (s+30)

Using MATLAB. Plot the Bode diagram when K = 10, then


determine the following from the graph:
1. Gain and phase crossover frequencies.
2. Gain and phase margin.
3. Stability of the system.

Khaled Mustafa Mahmoud Session: Fall 2015/2016


53

Also, determine the closed loop step response.

Figure 4.10: Feedback control system of Example 4.4.

Solution:

G ( jω )=
2.5 ( jω
5
−1)( −1 )

15

( jω1 +1)( 10jω +1)( 30jω +1)


Since, the system doesn’t have a pole nor a zero at the
origin.

Hence, the starting point is given by:


S . P=20 log K → S . P=20 log 2.5=7.96 dB .

The break frequencies are at: 1, 5, 10, 15 and 30 rad/sec.

>> % To plot the Bode diagram of Example 4.4 using MATLAB %

>> s=tf('s');

>> x=10*(s-5)*(s-15)/((s+1)*(s+10)*(s+30));

>> bode(x)

>> allmargin(x)

Khaled Mustafa Mahmoud Session: Fall 2015/2016


54

Bode Diagram
10

0
Magnitude (dB)

-10 System: x
Gain Margin (dB): 3.92
At frequency (rad/sec): 5.1
-20
Closed Loop Stable? Yes

-30
System: x
Phase Margin (deg): 55.2
-40
360 Delay Margin (sec): 0.376
At frequency (rad/sec): 2.56
Closed Loop Stable? Yes
270
Phase (deg)

180

90

-90
-1 0 1 2 3
10 10 10 10 10
Frequency (rad/sec)

Figure 4.11: Bode Plot diagram of Example 4.4.

From Figure 4.11:

1. The gain crossover frequency equals to 2.56 rad/sec, and


the phase crossover frequency equals to 5.1 rad/sec.
2. The gain margin equals to 3.92 dB, and the phase
margin equals to 55.2° .
3. In this case, the system is stable.

>> % To determine the closed loop step response %


>> sys=feedback(x,1);
>> step(sys)

Khaled Mustafa Mahmoud Session: Fall 2015/2016


55

System: sys
Peak amplitude: 1.12
Overshoot (%): 57.2 Step Response
At 1.2
time (sec): 0.921

System: sys
0.8 Final Value: 0.714

0.6 System: sys


Settling Time (sec): 3.24
Amplitude

0.4

0.2

-0.2

-0.4
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5

Figure 4.12: Step response of Example 4.4.


Time (sec)

From Figure 4.12: the peak time is 0.921 sec, overshoot is


57.2%, settling time is 3.24 sec, and the steady state error
equals 0.286.

Example 4.5: Given a unity feedback system that has the


forward transfer function:
5 K e−0.3 s
G ( s )=
(s+1) ( s +5 )

Do the following using MATLAB:


1. Plot the Bode diagram (let K =2).
2. Determine the values of gain and phase crossover
frequencies.
3. Find the values of gain and phase Margins.
4. Find the Range of K for stability from Bode Plots.

Khaled Mustafa Mahmoud Session: Fall 2015/2016


56

Then, use SISO Design Tool to determine the closed loop


step response when the gains (K) are: 8, 4.5, and 2.5.

Solution:
−0.3 jω
2e
G ( jω )=
( jω1 +1)( jω5 +1)
Since, the system doesn’t have a pole nor a zero at the
origin.

Hence, the starting point is given by:


S . P=20 log K → S . P=20 log 2=6.02dB .

The corner frequencies at: 1 and 5 rad/sec.

>> % 1. To plot the Bode diagram of Example 4.5 using MATLAB %

>> a=10;

>> b=[1 6 5]; >> s=tf('s');

>> x=tf(a,b,'inputdelay',0.3); >>


x=10*exp(-0.3*s)/((s+1)*(s+5));

>> bode(x)

>> allmargin(x);

Khaled Mustafa Mahmoud Session: Fall 2015/2016


57

Bode Diagram
20

0
Magnitude (dB)
-20 System: x
Gain Margin (dB): 8.08
-40 At frequency (rad/sec): 3.88
Closed Loop Stable? Yes
-60

-80

-100
0
System: x
Phase Margin (deg): 75.9
-5760 Delay Margin (sec): 0.819
Phase (deg)

At frequency (rad/sec): 1.62


Closed Loop Stable? Yes
-11520

-17280
-2 -1 0 1 2 3
10 10 10 10 10 10
Frequency (rad/sec)

Figure 4.13: Bode Plot Diagram of Example 4.5.

From Figure 4.13:

2. The gain crossover frequency equals to 1.62 rad/sec, and


the phase crossover frequency equals to 3.88 rad/sec.
3. The gain margin equals to 8.08 dB, and the phase
margin equals to 75.9° . Therefore, the system is stable.
4. To determine the range K for stability from Bode Plots:

GM =20 log K → 8.08=20 log K → K=2.535 .

K=2.535× 5=12.675 will cause the system to be marginally

stable. Hence, the system is stable if 0< K < 12.675.

To determine the closed loop step response (at K=8, 4.5,


and 2.5) using SISO Design Tool:

1. Write the transfer function of the system in the


command window.

Khaled Mustafa Mahmoud Session: Fall 2015/2016


58

2. Write the command (sisotool) for the defined transfer


function.
3. From the given window, choose the Bode Plot and
closed loop step response only.
4. Move the magnitude curve up or down, until the
desired gains are achieved.
5. Record the system characteristics for each value of
gain.

System performance for each value of gain as shown in the


following table:

System
Performance
K=10 K=8 K=4.5 K=2.5

ω C(rad/sec) 1.62 1.2 --- ---

Gain Margin (dB) 8.08 10 15 20


ω π (rad/sec) 3.88 3.88 3.88 3.88

Phase Margin 75.9° 96° ∞ ∞


Bandwidth
0.9613 0.9613 0.9613 0.9613
(rad/sec)
Overshoot(OS %) 29.7 % 20.2 % 4.89 % ---

Peak Time ( T p) 1.04 sec 1.15 sec 1.59 sec ---

Khaled Mustafa Mahmoud Session: Fall 2015/2016


59

Settling Time ( T s ¿ 3.42 sec 2.75 sec 2.19 sec 1.85 sec

Error(e ss ¿ 0.333 0.384 0.527 0.665

Discuss the effect of the system gain on the system


performance.
-------------------------------------------------------------------------------------------
-
Homework 4.1: Consider the system given in Figure 4.14:
1. If K I = 1, find gain margin using Bode Plot. Also, find
steady state error to a ramp input.
2. Using SISO Design Tool. Find K I so that gain margin is
5.
3. Corresponding to the K I obtained in (2). Find the steady
state error to a ramp input.

Figure 4.14: Speed control system.

Homework 4.2: A unity feedback system has an open loop


transfer function, where:

K (s +1)
G ( s )=
( s−1 ) ( s−6 )
1. Using a Bode diagram for K = 8, determine the system
stability.
2. Using SISO Design Tool. Select a gain K so that the
phase margin is at least 45° .

Khaled Mustafa Mahmoud Session: Fall 2015/2016


60

----------------------------------------------------------------------------------------------------------
--
Homework 4.3: Consider two systems with transfer
function:
4 25
G 1 ( s )= 2
,G 2 ( s )= 2
s + 2 s+ 4 s +5 s +25
Using MATLAB:

1. Draw the Bode Plot of both systems on the same figure.


2. From the Bode Plot of both systems. Find the Bandwidth
(ω BW ).
3. From the closed loop step response. Find percentage
overshoot, rise time, peak time, settling time, and
steady state error.
4. What is the effect of bandwidth on time response?
--------------------------------------------------------------------------------------------------------------
-
Homework 4.4: Consider a unity feedback system with open
loop transfer function, where:
K
G ( s )=
s ( s +1 )( s+10 )

1. If K = 5, draw Bode Plot of G ( s ) and find gain and phase


margins.
2. Determine the closed loop step response of G ( s ).
3. Repeat (1) and (2) if a pure delay with transfer function
−1.2 s
D ( s )=e
is also present in the forward path.
4. Compare and discuss the results of the system with and
without time delay.

Khaled Mustafa Mahmoud Session: Fall 2015/2016

You might also like