Вы находитесь на странице: 1из 6

EE 4130/6130 Laboratory No VII

MATLAB and SIMULINK


Department of Electrical Engineering
Wright State University
1 Objectives:

The objective of this laboratory is to become familiar with MatLab and Simulink, and their use in the analysis and
design of linear systems in frequency domain such as Bode plot.

2 Introduction:

Straight-Line (Asymptotic, Approximate or Corner) Bode Plot:
Bode plots are fundamental to understanding the design of servo systems. To obtain the frequency specifications of
the closed-loop system such as the gain margin (GM), the phase margin (PM), the gain crossover frequency

,and the phase crossover-frequency (

), the Bode plot of the open-loop transfer function is drawn and not the
closed loop transfer function. Bode plot is a logarithmic plot of the frequency response where the horizontal axis is
the angular frequency () in rad/s plotted on a log scale and the vertical axis is a linear scale that contains both the
gain (magnitude) and phase plots. The magnitude in decibels is plotted on the top and the phase in degrees is plotted
at the bottom of the plot. Therefore, a semi-log paper is needed to draw a Bode plot and a good understanding of the
log scale is needed before using the semi-log paper. The semi-log paper shown in Figure 5 is a 4-cycle plot where
the first cycle goes from 1 to 9 and then the next cycle starts and goes from 10 to 90 and so on. (Note that it is best to
start the frequency at

where n is an interger.) It is also very important to note that the distance from the
frequency 1 to 2 (similarly, from 10 to 20 and so on) is bigger as compared to for frequency from 2 to 3 (20 to 30
and so on) because log(2)-log(1) is greater than log(3)-log(2). In other words, the correct orientation of the semi-log
paper is where the squares become smaller as the frequency is increased from 1 to 9 (10 to 90 and so on). If the
semi-log paper is turned up-side down, the squares becomes bigger as the frequency is increased and this is the
incorrect orientation of the semi-log paper.

The lowest frequency to draw the Bode plot should be selected a decade below the lowest corner frequency rounded
DOWN. Similarly, the highest frequency should be a decade above the highest corner frequency rounded UP. For
example, if the corner frequencies are 2, 5 and 8, the starting frequency should be


= 0.2 rounded DOWN to 0.1
and the highest frequency should be 8*10 = 80 rounded UP to 100. Therefore, for this example, a 3-cycle semi-log
paper is needed to graph the Bode plot. The corner frequencies are the absolute value of the locations of the real
poles and zeros. For example, for an open-loop transfer function G(s) =

, the corner frequencies are 2, 5


and 8. The following information is useful in drawing a straight-line Bode plot.

2.1.1 Constant Term:

The constant term contributes a constant gain (DC gain) to the magnitude plot. The phase contribution is zero if the
constant term is positive and 180if the constant term is negative. The effect of the DC gain is to raise or lower the
entire magnitude plot. The DC gain is found by ignoring the poles at s = 0 (if any) and then evaluating the open-loop
transfer function at s = 0. Therefore, the DC gain of the system considered in Section 2.1 is given by

K =




Since the magnitude of the system is plotted in decibels (dB), the Dc gain in decibels is given by

KdB = 20 *log(20) = 26.02 dB


Figure 1: A 4-cycle semilog paper.

2.1.2 Pure Integrator:

A pure integrator contributes a constant -90 to the phase plots. The magnitude plot of a pure integrator is a straight
line passing through the (1,0) point with a slope of -20 dB/decade, i.e, the straight line has a magnitude of 0 dB at 1
rad/s. Therefore, a pure integrator (s1 term in the denominator) contributes a positive gain if the starting frequency is
less than 1 rad/s (20 dB for each decade below 1 rad/s), 0 gain if the starting frequency is 1 rad/s and a negative gain
if the starting frequency is greater than 1 (-20 dB for each decade above 1 rad/s); and a slope of -20 dB/decade as
shown in Figure 6. Given below is the contribution of the

term to the Bode plot of the open-loop system.



Figure2.Bode plot of a pure integrator



Contribution to the Phase plot: constant - 90 phase
Contribution to the Magnitude plot:
1. A constant gain of -20*log(starting frequency) dB
2. -20 dB/decade to the slope.



2.1.3 Real Pole

Each real pole contributes zero to the magnitude plot until the frequency equals to the corner frequency of the pole.
Above the corner frequency, the gain contribution from each real pole is a straight line with slope of -20 dB/decade.
The contribution to the phase for each pole starts at 0 one decade below the corner frequency and ends at -90 a
decade above the corner frequency. The total contribution to the phase from a real pole is -90 over two decades.
Therefore, the contribution to the phase from a real pole are two straight lines, one starting one decade below the
corner frequency with a slope of -45/decade and the second starting one decade above the corner frequency with a
slope of +45/decade. The magnitude and phase of the real pole at s = -20 (

term) is shown in Figure 7.




Figure 3: Magnitude and Phase plots of

term.


2.1.4 Real Zero:

Each real zero contributes zero to the magnitude plot until the frequency equals to the corner frequency of the zero.
Above the corner frequency, the gain contribution from each real zero is a straight line with slope of +20 dB/decade.
The contribution to the phase for each pole starts at 0one decade below the corner frequency and ends at +90 a
decade above the corner frequency. The total contribution to the phase from a real zero is +90 over two decades.
Therefore, the contribution to phase from a real zero are two straight lines, one starting one decade below the corner
frequency with a slope of +45/decade and the second starting one decade above the corner frequency with a slope
of -45/decade. The magnitude and phase of the real zero at s = -25 (s+25 term) is shown in Figure 8.



2.1.5 Bode Plot of the transfer function G(s) =



The following information about the transfer function will be used to draw the Bode plot of the open-loop transfer
function of the system is Section 2.1






KdB = 20 log(K) = 20 +log(20) = 26.02 dB
Corner frequencies = 20, 25 rad/s


Figure 4:Magnitude and Phase plots of (s+25) term.


Starting frequency = lowest corner frequency/10 =


1 rad/s
Ending frequency = largest corner frequency10 = 2510 = 250 1000 rad/s
Starting Magnitude = KdB + contribution from the poles at s = 0
= 26.0220no of poles at s = 0log (starting frequency)
= 26.0220 1 log(1) = 26.020 = 26.02

Starting slope of magnitude = 20 no of pure integrators = 20*1 = 20 dB/dec
Ending slope of magnitude = 20*no of zeros - 20no of poles = 201 202 = 20 dB/dec
Starting phase = 90 * no of pure integrators =90 1 = 90
Ending phase = 90*no of zeros 90*no of poles = 90*1 902 = 90

The Bode plot of the open-loop system given in Section 2.1 is shown in Figure 9.

2.1.6 Gain and Phase Margin:

Gain margin (G.M.) and phase margins (P.M.) are the frequency domain criteria to measure the relative stability of
control systems. These margins are needed to withstand the change in system parameters such as gain and phase
(time shift). The G.M. gives an indication of the amount of gain that can be increased in the open-loop system before
the closed-loop system becomes unstable. Similarly, the P.M. gives an indication of the change in phase shift before
the closed-loop system becomes unstable. Typically, the control systems are designed to have a G.M. of at least 15
dB and a minimum P.M. of 45.

Gain and phase margins can be found from the Bode plot of the open-loop system shown in Figure 9. The gain
crossover frequency (

) is defined as the frequency at which the magnitude curve of the open-loop Bode plot
crosses the 0 dB line, i.e., the magnitude changes from positive to negative. Once

is known, the P.M. is the


distance from the point on the phase plot at the gain crossover frequency to the -180 line as shown in Figure 9. The
P.M. is positive (stable system) if the -180 line is below the point and negative if the -180 line is above this point. If
the P.M. is negative, the system is unstable. The P.M. can also be found using the formula

P.M. = 180phase of the open-loop system at the gain crossover frequency


Figure 5: Bode plot of



.

Therefore, the gain crossover frequency (

) and the P.M. of the system given in Section 2.1 obtained from the
Bode plot drawn in Figure 9 are given by:

= 20 rad/s and P.M. = 18095 = 85


Similarly, the phase crossover frequency (

) is defined as the frequency at which the phase curve of the open-loop


Bode plot crosses the -180 line. Once

is known, the G.M. is the distance from the point on magnitude at the
gain crossover frequency to the 0 dB magnitude line. The G.M. is positive (stable system) if the 0 dB line is
above the point (negative magnitude at the phase crossover frequency) and negative if the 0 dB line is below this
point (positive magnitude at the phase crossover frequency). If the G.M. is negative, the system is unstable. The
G.M. can also be found using the formula

G.M. = 0magnitude of the open-loop system at the phase crossover frequency

Since the phase plot of the system given in Figure 9 does not cross the -180 line, the

is infinite and therefore,


the G.M. is infinite.

2.1.7 Drawing Bode Plot using MatLab:

The Bode plot of the open-loop system can be drawn using the following MatLab commands.
bode(syso)
or
margin(syso)
Note the margin command draws the Bode plot and gives the G.M., phase crossover frequency, P.M. and gain
crossover frequency.

2.1.8 Bandwidth (BW):

The BW of a system is defined as the frequency at which the magnitude of the closed-loop frequency response is -3
dB and can be obtained by drawing the Bode plot of the closed-loop system. If the design of a controller is carried
out in the frequency domain, the Bode plot of the open-loop system is used for the design. The designers typically
approximate the gain crossover frequency as the bandwidth of the system. This is a good approximation if the P.M.
of the system is approximately equal to 90If the P.M. is less than 90, this approximation is not good. However,
using second-order system approximation [1], the bandwidth of the system can be approximated as the frequency at
which the open-loop magnitude response is between -6.5 and -7.5 dB if the P.M. is less than 45and between -3 and
-6.5 dB if the P.M. is between 45 and 80. For the system given in Section 2.1, the P.M. of the system is 83.7, the
gain crossover frequency is 18.3 rad/s and the bandwidth of the closed-loop system is 20.1 rad/s.

3. lab assignment :

Figure 6: Block diagram of a closed-loop system.




1. Draw the Straight-Line Bode plots of the open-loop system as in Figure 6. Find the gain margin (G.M.), phase
margin (P.M.), gain crossover frequency (

), phase crossover frequency (

). Find the approximate value of the


BW of the closed-loop system from the open-loop Bode plot.

2. Now, draw the Bode plot of the open-loop and closed-loop systems using MatLab and find the frequency domain
specifications of the closed-loop system. Compare the results with those obtained from the Straight-Line Bode plot.
(Note: learn the MatLab commands: bode and margin.)

3. Using sisotool of MatLab, draw the Bode plot of the open-loop and closed-loop systems and find the G.M., P.M.
and BW. Also draw the step response of the system.


References

[1]Erik Cheever, The Asymptotic Bode The Asymptotic Bode Diagram http://www.swarthmore.edu/NatSci/echeever/Ref/LPSA/Bode/BodeHow.html.

Вам также может понравиться