You are on page 1of 6

1

EML 4312, Fall 2009 Instructor: Dr. W. Dixon Homework #5 Bode Plots, Gain and Phase Margin Due Nov 25, 2009

RAMIN SHAMSHIRI UFID#: 9021-3353

Ramin Shamshiri

EML 4312, HW #5

Due 11/25/09

2
Introduction:
Bode plots consists of two graphs, the magnitude of () and the phase angle of (), both plotted as a function of frequency . The db magnitude vs. is called the Bode magnitude plot, or log-modulus plot. The phase angle vs. is called the Bode phase angle plot. Logarithmic scales are used for Bode plots because they considerably simplify their construction, manipulation, and interpolation. Bode plots clearly illustrate the relative stability of a system. Gain and phase margins are often defined in terms of Bode plots. Bode plot rules: Considering the following transfer function, + 1 + 2 ( + ) = + 1 + 2 ( + ) we first write it in the so-called Bode form ( = ) as below: /1 + 1 /2 + 1 (/ + 1) =1 = /1 + 1 /2 + 1 (/ + 1) =1 Where is a nonnegative integer. The Bode gain is defined as =1 = =1 zeros up The Magnitude plot breaks by 20/ at poles . down The Phase plot: zeros up breaks by 45/ one decade before poles . down zeros down breaks by 45/ one decade after poles . up Initial magnitude plot: If = 0 then H j =0 in db, so Initial magnitude= 20log H j0 If 0 then = ( )1/ with an initial slope of 20/. Phase Margin, PM is a measure of relative stability and is defined as 180 plus the phase angle 1 of the open-loop transfer function at unity gain. That is: PM = [180 + argH 1 ] Where H 1 = 1 and 1 is called the gain crossover frequency. [1]. SCHAUMS outlines, Feedback and Control System

----------------------------------------------------------------------------1. Draw the asymptotic bode plot for the following open-loop transfer functions.

Solution: The following Matlab code was written to define a function SemiLog in order to draw semilog paper for Bode plot hand draw.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Function SemiLog to draw Magnitude % % and Phase plot axis for Homework #5 % % EML 4312, Dr. Dixon, Control % % Nov.22.2009, Ramin Shamshiri % % ramin.sh@ufl.edu % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Function SemiLog(wMin,wMax, dbMin,dbMax,PhaseMin,PhaseMax) figure1 = figure; %=====Create Magnitude plot axis=========== dbTick=dbMin:20:dbMax; axes1 = axes(... 'FontSize',8,... 'Position',[0.1 0.55 0.8 0.4],... 'XGrid','on',... 'XMinorGrid','on',... 'XMinorTick','on',... 'XScale','log',... 'YGrid','on',... 'YTick',dbTick,... 'Parent',figure1); axis(axes1,[wMin wMax dbMin dbMax]); ylabel(axes1,'Magnitude (dB)'); %=====Create Phase plot axis=========== PhaseTick=PhaseMin:45:PhaseMax; axes2 = axes(... 'FontSize',8,... 'Position',[0.1 0.1 0.8 0.4],... 'XGrid','on',... 'XMinorGrid','on',... 'XMinorTick','on',... 'XScale','log',... 'YGrid','on',... 'YTick',PhaseTick,... 'Parent',figure1); axis(axes2,[wMin wMax PhaseMin PhaseMax]); ylabel(axes2,'Phase (deg)');

Initial Phase plot: Initial = Final = 90() Where RD is the relative degree of the system= deg[den]-deg[num]. Relative stability, gain margin and phase margin: he basic goal of control system design is meeting performance specifications which can be stated as frequency-domain specifications (frequency response) or time-domain specifications (time response). Frequency-domain specifications for continuous and discrete time systems are often stated in one or more of the seven ways, Gain margin, Phase Margin, Delay Time, Bandwidth, Cutoff Rate, Resonance Peak and Resonance frequency. As a measure of stability, Gain Margin, is defined as the magnitude of the reciprocal of the open-loop transfer function, evaluated at the frequency at which the phase angle is 180. That is: 1 = is called the phase crossover frequency. Since 0 db corresponds to a magnitude of 1, the gain margin is the number of decibels that is below 0 db at the phase

crossover frequency.

Ramin Shamshiri

EML 4312, HW #5

Due 11/25/09

3
a. =
+ +

Writing the given transfer function in bode form: 2 (/2 + 1) = 1 ( + 1)( + 1) = 2 = 1,1 = 2 Magnitude Plot: We have a zero at = 2, so the magnitude plot breaks up by 20/ . We also have a pole with multiplicity of 2 at = 1, so magnitude plot breaks down by 2 20 = 40/. Initial magnitude plot: with = 0, which means we dont have integrator (1/) in the transfer function, thus we begin at: 20 =0 = 20 0 = 20 2 = 6.02 Phase Plot: It first breaks down by 2 45 = 90/ at = 0.1 (one decade before where we have pole) then breaks up at = 10 by 2 45 = 90/ (one decade after where we have pole). Also should breaks up by 45/ at = 0.2 (one decade before where we have zero) and then breaks down 45/ at = 20 (one decade after where we have zero). Initial angle of phase plot: = 0 0 = 0 Final angle of phase plot: 90 = 1 (90) The Bode plot for this problem is drawn and shown in figure.1.

b. = Transfer function in Bode form: ( + 1) = 2


= 1 = 0,0 = 1

Magnitude Plot: Should breaks up at = 1 by 20/. Initial magnitude, = 2, so = (1)1/2 = 1. This is the -intercept. Because the minimum value on the frequency axis is 10 -2, we need the amplitude for (102 ). We are only concerned with the amplitude and not the phase, so we can ignore j and do the following calculation to determine the value of initial magnitude: 20 = 20
=0.01

= 20 102

(102 + 1) 102
2

= 2010100 80

Phase Plot: Should breaks up by 45/dec at = 0.1 and then breaks down by 45/dec at = 10. Initial angle of phase plot: = 0 90 90 = 180 Final angle of phase plot: 90 = 1 (90)

The Bode plot for this problem is drawn and shown in figure.2.

Figure 1. Bode plots asymptotes for 1.a. Axis created using function: SemiLog(0.01,100,-60,20,-180,0)

Figure 2. Bode plots asymptotes for 1.b. Axis created using function: SemiLog(0.01,100,-40,100,-225,0)

Ramin Shamshiri

EML 4312, HW #5

Due 11/25/09

4
c. = +
+ (+)

d. =
1 + 1 (300 + 1) 20

(+) + + (+)

Transfer function in Bode form: 1 = 20 300 + 1 0.5 = = 0,0.5,20,300 1 = 6000

Transfer function in Bode form: 20 10 20(/10 + 1) = 2 100 + 1 + 1 ( + 1) 2 100 = 10 = 1,2,100 = 1 Magnitude Plot: Should breaks down at = 1, 2, 100 each by 20/ and breaks up at = 10 by 20/. Initial magnitude plot: with = 0, we begin at: 20 =0 = 20 0 = 20 1 = 0 Phase Plot: up = 1 breaks by 45/ at . down = 0.1, 0.2, 10 down = 100 breaks by 45/ at . up = 10, 20, 1000 Initial angle of phase plot: = 0 0 + 0 + 0 = 0 Final angle of phase plot: 90 = 2 90 = 180

Magnitude Plot: Should breaks down at = 0.5, 20, 300 each by 20/. 1 Initial magnitude, with = 1, so = (6000 )1/1 = 1.66 104 . This is the -intercept. To determine the value of initial magnitude: (since the minimum value on the is 0.01) 20 = 20
=0.01

= 20 102 1 0.01 20 + 1 0.01 300 + 1

1 20 300 0.01 0.01 + 1 0.5 = 201.66 104 35.7

Phase Plot: Should breaks down by 45/dec at = 0.05, 2, 30 and then breaks up by 45/dec at = 5, 200, 3000 . Initial angle of phase plot: = 0 90 + 0 + 0 + 0 = 90 Final angle of phase plot: 90 = 4 90 = 360 The Bode plot for this problem is drawn and shown in figure.3.

The Bode plot for this problem is drawn and shown in figure.4.

Figure 3. Bode plots asymptotes for 1.c. Axis created using function: SemiLog(0.01,10000,-340,0,-360,0)

Figure 4. Bode plots asymptotes for 1.d. Axis created using function: SemiLog(0.01,10000,-150,0,-180,0)

Ramin Shamshiri

EML 4312, HW #5

Due 11/25/09

5
2. Do the bode plot for the above examples using MATLAB, turn in your plots for each example. Solution:
num1=[1 2];den1=[1 2 1]; num2=[1 1];den2=[1 0 0]; num3=[1];den3=conv(conv(conv([2 1],[1 20]),[1 300]),[1 0]); num4=20*[1 10];den4=conv(conv([1 1],[1 2]),[1 100]); margin(num1,den1); figure; margin(num2,den2); figure; margin(num3,den3); figure; margin(num4,den4);

Figure 7. Bode plot drawn by Matlab for Prob 1.c.

Figure 5. Bode plot drawn by Matlab for Prob 1.a.

Figure 8. Bode plot drawn by Matlab for Prob 1.d.

3. Determine the phase and gain margins for each plant in the above examples. Solution:
= 1 = [180 + 1 ]

Figure 6. Bode plot drawn by Matlab for Prob 1.b.

1.a. = , = (180) + (68) = 112 1.b. = , = 180 + (130) = 50 1.c. = 100 , = 180 + (90) = 90 1.d. = , = 180 + (360) = 180

Ramin Shamshiri

EML 4312, HW #5

Due 11/25/09

6
4. For 1(c), find so that the phase margin is 30 deg. Solution:
Finding the angle that results 30 deg: PM = 180 + x = 30 x = 150 Using magnitude condition: () = 1 20 () = 201 20 + 20 () = 0 20 = 20 () Now, our job is to find the frequency, , corresponding to 150. From Matlab bode plot, we can precisely determine this frequency which is 0.777 and the corresponding magnitude which is: 20 () = -78.7 Therefore 20 = 78.7 Or = 10 20 = 8609.93
78.7

5. For 1(d), find so that the phase margin is 45 deg. Solution:


Finding the angle that results 30 deg: PM = 180 + x = 45 x = 135 Using magnitude condition: 20 = 20 () Now, our job is to find the frequency, , corresponding to 135. From Matlab bode plot, this frequency is approximately 0.642 and the corresponding magnitude which is: 20 () = -1.91 Therefore 20 = 1.91 Or = 10 20 = 1.245
1.91

Ramin Shamshiri

EML 4312, HW #5

Due 11/25/09

You might also like