Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
FREQUENCY DOMAIN
LECTURE NOTES
HEIKKI N. KOIVO
2
SUMMARY
The notes cover classical frequency domain control design. The emphasis is on the design of
simple controllers using Bode diagram.
MATLAB and its Control System Toolbox are used extensively. In fact, although design can be
completed by hand calculations, it is neither recommended nor feasible. Careful control design
requires modern tools and use of computers is unavoidable. On the other hand, the tools mentioned
make design fun, requiring both engineering intuition and skills. Required level of mathematics is
quite modest. Some basic understanding of linear systems and control theory is required.
3
In control design it is important that the reader has a clear understanding of frequency domain
analysis. Because Bode diagram forms central part in the design procedure, drawing Bode diagram
is reviewed. Specia l emphasis is on using appropriate MATLAB commands for it.
ln G ( jω ) = ln G ( jω ) + jϕ (ω ) . (1- 2)
Usually the logarithm applied is Brigg’s logarithm that is logarithm base 10. Multiplying the result by
20, the gain is given in decibels (dB)
The factors of a transfer function can be divided into four classes: constant terms, pure integrators,
first and second order terms. The classification is direct consequence of the roots of polynomials.
Real roots, which are = 0, appear usually in the denominator and are called integrators.
Otherwise real roots result in first order terms either in the numerator or in the denominator.
4
Complex conjugate roots form second order terms. Time delays and distributed parameter syste ms
have to be handled separately.
REMARK: Remember that the order of the numerator polynomial is always smaller or equal than
that of the denominator! Why is this? Note that an ideal differentiator G(s) = s, does not exist in
real world, only in textbooks.
Next we will cover drawing of the Bode diagrams of the basic system classes. Let’s begin by
defining a transfer function model in MATLAB Control System Toolbox.
Example 1.1.
Determine MATLAB representation for transfer functions
3s + 4
a. G1 ( s) = 2
s + 2s + 7
2s 2
b. G2 ( s) = 4
5 s + 6 s 2 + 3 s + 10
10 ( s + 2)
c. G3 ( s) 2
s ( s + 1)( s + 4 )
Convert the representations to zpk or tf forms, depending on the case
SOLUTION.
a. » num=[3 4]; den=[1 2 7]; g1=tf(num,den)
Transfer function:
3s+4
-------------
s^2 + 2 s + 7
» sys1=zpk(g1)
Zero/pole/gain:
3 (s+1.333)
--------------
(s^2 + 2s + 7)
b. » num2=[2 0 0]; den2=[5 0 6 3 10]; g2=tf(num2,den2)
Transfer function:
2 s^2
------------------------
5 s^4 + 6 s^2 + 3 s + 10
» sys2=zpk(g2)
Zero/pole/gain:
0.4 s^2
5
---------------------------------------------
(s^2 + 1.291s + 1.201) (s^2 - 1.291s + 1.666)
c. » z=[-2];p=[0 0 -1 -4];
» sys3=zpk(z,p,10)
Zero/pole/gain:
10 (s+2)
---------------
s^2 (s+1) (s+4)
» g3=tf(sys3)
Transfer function:
10 s + 20
-------------------
s^4 + 5 s^3 + 4 s^2
Set s = j ω , then
Gain in dB
20 log 10 G( jω ) = G( j ω ) dB = 20 log10 K (1- 4)
Phase
ϕ (ω ) = 0 0 . (1- 5)
The Bode diagram of K=50 is shown in Fig 1.1. Use MATLAB-commands to draw it. Here are
two ways to determine the transfer function of a constant
» num0=[50];den0=[1];g0=tf(num0,den0)
Transfer function: 50
Static gain.
or
» g0=tf(50)
Transfer function: 50
Static gain.
6
Fig. 1.1. Bode diagram of a constant K = 50, above gain in dB and below phase. Note the
logarithmic scale of the frequency.
1
Set s = jω, G( jω ) = . Then the gain
jω
1
G dB = 20 log( ) = −20log ω (dB) (1- 6)
ω
and phase
ϕ (ω ) = −90 0 . (1- 7)
Draw the Bode diagram with the same MATLAB commands as above. First define the
appropriate num(s)/den(s) form.
num1=[1];den1=[1 0];g11=tf(num1,den1)
Transfer function: 1/s
» bode(g11)
7
Bode diagram of the integrator is displays in Fig. 1.2. Because the ω -scale is logarithmic, the gain
has a slope of - 20 dB/decade.
REMARK: If G(s) = K/s, the gain graph intersects the 0 dB level at ω = K and its slope is as
before -20 dB/decade. Figure 1.3. shows the case, when K = 50.
.
Set s= jω , then
ϕ (ω ) = − tan −1 ω T . (1- 9)
» num2=[1];den2=[10 1];g2=tf(num2,den2);bode(g2)
Fig.1.5. Bode diagram of a first order system. Note that the corner frequency is ωb = 0.1 rad/s.
For larger frequencies, ω >> ωb the system also acts as a low pass filter
As above, but now the - sign in the slope changes into + sign.
1 (1- 11)
G( s ) =
s + 2ςs + 1
2
SOLUTION:
Use again the same MATLAB commands. Set e.g. ζ = 0, 0.2, 0.4, 0.6, 0.8 and 1.
10
Fig.1.6. Bode diagram of a second order system with ζ = taking values between 0 and 1.
1
G( s) = . (1- 12)
(0.2 s + 1)( s + 1)( s + 0.1)
SOLUTION: Use again the bode command. The only difficulty is that now the transfer function is
not in the usual numerator polynomial/denominator polynomial or num(s)/den(s) form. To force it
to the correct form calculations in the denominator can be done in several ways. Either by hand or
using MATLAB tf , zpk and * commands.
» g14a=tf([1],[0.2 1])
Transfer function: 1/0.2 s + 1
» g14b=zpk([],[-1 -0.1],1)
Zero/pole/gain: 1/(s+1) (s+0.1)
» g14ab=g14a*g14b
Zero/pole/gain: 5/(s+5) (s+1) (s+0.1)
Fig.1.7a. Bode diagram of the example. Observe that at low frequencies gain is 20*log10(5) 14
dB and the phase zero degrees. At high frequencies the phase becomes –270o.
The frequency at which the gain curve crosses the 0 dB line is called the crossover frequency ω c .
Correspondingly the frequency at which the phase crosses -1800 is called phase crossover
frequencyω 'c . The angle PM = ϕ (ω c ) − 180 0 at frequency ω c is defined to phase margin (PM).
In Figure 1.6a ω c ≈ 1 rad / s and PM ≈ 30 . The gain margin (GM) at frequency ω 'c is
0
defined as GM = − G dB .
Figure 1.7b shows the phase and gain margins, when margin command has been used.
Fig. 1.7b. The computed phase and gain margins and the corresponding frequencies of the
example also shown in the Bode diagram.
The gain crossover frequency ωc = 0.77 rad/s and the phase margin PM ≈ 50.8 0 and the phase
crossover frequency ω 'c ≈ 2.4 rad / s and gain margin GM≈ 16.6 dB. The meaning of these
concepts becomes clearer when we move on to control design. Basically they relate to both
damping coefficient and maximum percent overshoot, which are frequently used in system
specifications. The stability of the minimum phase systems is determined from there. If both phase
and gain margins are positive, the system is stable.
Minimum phase systems have only positive terms in their transfer functions. If your system is
nonminimum phase, the sweep in phase area is larger.
Let us compare the unit step responses of minimum and nonminimum phase systems:
Y ( s) s +1 Y ( s) −s + 1
= G min ( s) = 2 and = Gnon min ( s) = 2 (1- 13)
R ( s) s + s +1 R ( s) s +s+1
Let us now compute the unit step responses of the example. First define the corresponding transfer
functions
» gmin=tf([1 1],[1 1 1]);gnonmin=tf([-1 1],[1 1 1]);
Now compute the step response
» step (gmin)
13
» step(gnonmin)
Fig. 1.8b. Unit step response of a nonminimum-phase system. Note the initial dip in the response -
going the wrong way - which is typical to a nonminimum-phase system.
Here are the Bode diagrams, which are exactly the same, although this is not true.
When the gain G dB is drawn as a function of ϕ (ω ) , the diagram is called Nichols diagram. In
Fig.1.8. it is drawn into a Nichols chart. Nichols chart is useful if closed-loop specifications include
resonance peak requirement. Use MATLAB’s nichols command.
» nichols(g14ab)
15
» ngrid
Fig. 1.10. Nichols diagram of the example. Avoimen järjestelmän vahvistus dB:nä
vahvistuksen funktiona.
Fig.1.11. Nichols' chart, which shows the constant curves of the closed-loop system transfer
functionG 1 + G (gain and phase).
Example 1.4. Draw Nichols diagram and chart for the unity negative feedback system with
10
G( s) =
s( s + 1)
gn=zpk([],[0 -1],10)
Zero/pole/gain: 10/s (s+1)
nichols(gn)
grid
Nichols Charts
80
60
40
20
-20
-40
O pen-Loop Gain (dB)
-60
-80
-100
-170 -160 -150 -140 -130 -120 -110 -100
Open-Loop Phase (deg)
Nichols Charts
80
60
40
0 dB
0.25 dB
0.5 dB
20 1 dB -1 dB
3 dB -3 dB
6 dB
0 -6 dB
-12 dB
-20 -20 dB
-40 -40 dB
-80 -80 dB
-100 -100 dB
-120 -120 dB
-350 -300 -250 -200 -150 -100 -50
Open-Loop Phase (deg)
One more way to represent a transfer function is Nyquist diagram. The transfer function is
plotted on complex plane when ω varies. Let us next consider a few examples discussed
above. Now MATLAB command nyquist can be evoked.
1
a. G( s) =
10 s + 1
1
b. G( s) =
(0 .2 s + 1)(s + 1)( s + 0 .1)
s +1
c. G( s) =
s + s +1
2
− s +1
d. G( s) =
s + s +1
2
SOLUTION:
a. g1=tf([1],[10 1])
Transfer function:
1
--------
10 s + 1
» nyquist(g1)
» grid
Nyquist Diagrams
0.5
0.4
0.3
0.2
0.1
-0.1
Imaginary Axis
-0.2
-0.3
-0.4
-0.5
-1 -0.5 0 0.5 1
Real Axis
18
b. g2=zpk([],[-5 -1 -0.1],5)
Zero/pole/gain:
5
-------------------
(s+5) (s+1) (s+0.1)
» nyquist(g2); grid
Nyquist Diagrams
Imaginary Axis
-2
-4
-6
0 2 4 6 8 10
Real Axis
Nyquist Diagrams
1
0.8
0.6
0.4
0.2
-0.2
Imaginary
-0.4Axis
-0.6
-0.8
19
Transfer function:
-s + 1
-----------
s^2 + s + 1
» nyquist(g4), grid
Nyquist Diagrams
1.5
0.5
Imaginary
-0.5Axis
-1
-1.5
-1 -0.5 0 0.5 1
Real Axis
20
SYS = ZPK(SYS) converts an arbitrary LTI model SYS to zero-pole-gain form. The output SYS is a ZPK
object.
SYS = ZPK(SYS,'inv') uses a fast algorithm for state-space SYS, but is typically less accurate for high-
order systems with low gain at s=0.
[Y,X] = STEP(A,B,C,D,IU,T) or [Y.X,T] = STEP(A,B,C,D,IU) returns the output and state time response in the matrices Y
and X respectively. No plot is drawn on the screen. The matrix Y has many columns as there are outputs, and
LENGTH(T) rows. The matrix X has as many columns as there are states. If the time vector is not specified, then the
automatically determined time vector is returned in T.
[Y,X] = STEP(NUM,DEN,T) or [Y,X,T] = STEP(NUM,DEN) calculates the step response from the transfer function
description G(s) = NUM(s)/DEN(s) where NUM and DEN contain the polynomial coefficients in descending powers of s.
» help nichols