Control Part 3 - Frequency Response
Control Part 3 - Frequency Response
Handout Part 3:
Frequency Domain Analysis
Contents
1 Introduction.................................................................................................................. 2
2 Frequency Response .................................................................................................. 2
2.1 Principles and Mathematics..................................................................................... 2
2.2 Obtaining the Steady State Frequency Response of a Linear System By
Experiment ........................................................................................................................ 5
2.3 Calculating the Steady State Frequency Response of a Linear System .................. 6
2.4 Graphical Presentation of the Steady-State Frequency Response .......................... 8
3 Stability Analysis ....................................................................................................... 14
3.1 The s-plane ........................................................................................................... 14
3.2 Nyquist & Stability Criterion ................................................................................... 15
3.3 Stability Margins on Bode Diagram and Nichols Chart .......................................... 19
4 Stability Margin Examples ........................................................................................ 21
4.1 DC motor – armature inductance zero (as analysed in Part 1) .............................. 21
4.2 DC motor – armature inductance non-zero............................................................ 23
4.3 Practice sketching ................................................................................................. 25
Summary
This part of the course material focusses on the frequency domain response and the way in
which the open-loop frequency response (plotted on Bode Diagrams or Nichols Charts) can
be used to analyse the relative stability of the closed-loop system in terms of Gain and Phase
Margins. We will see how the frequency response is calculated, how it can be obtained
experimentally, and how (with practice) it is possible to sketch the Bode diagram of common
transfer function elements.
R Dixon 1 of 26
1 Introduction
1. It underpins systems analysis and control design methodologies that allow requirements
to do with relative stability and system bandwidth to be assessed.
3. Frequency based design is used quite commonly for control design in industry.
2 Frequency Response
2.1 Principles and Mathematics
Sinusoidal signals are the only type of periodic waveform that is unchanged in shape as it
passes through a linear network or system. However, the amplitude of the output and its
“phase” relationship to the input will usually be changed - which is important.
Another point to note is that (as Fourier observed) any time varying signal can be thought of
as comprising a sum of sinusoidal functions of different frequencies, amplitudes and phases.
For example, the figure below shows how we can begin to approximate a square wave using
sinewaves.
4
y (t ) = sin(t )
Π
4 1
y (t ) = sin(t ) + sin(3t )
Π 3
4 1 1
y (t ) = sin(t ) + sin(3t ) + sin(5t )
Π 3 5
It follows that, if we can understand how a system will respond to sinusoids of various
frequencies, this gives us information about that system’s response to many possible input
signals.
So with these two points in mind – sinewaves and the resultant frequency domain analysis is
very useful to engineers in general (and control engineers in particular).
R Dixon 2 of 26
2.1.1 Amplitude and Phase
In maths, we should have learnt that any sinusoidal waveform can be expressed as the sum
of sine and cosine functions: 𝑎𝑎 𝑠𝑠𝑠𝑠𝑠𝑠(ω𝑡𝑡) + 𝑏𝑏 𝑐𝑐𝑐𝑐𝑐𝑐(ω𝑡𝑡)
But it is often convenient to express this in terms of amplitude R and phase φ. I.e, that
1.5
-0.5
-1 φ
-1.5
0 0.2 0.4 0.6 0.8 1 1.2 Time
1.4 1.6 1.8 2
Fig 1. Showing two sinewaves of frequency 𝜔𝜔 with the second one shifted by angle 𝜑𝜑
a = R Cos 𝜑𝜑
b = R Sin 𝜑𝜑
R2 = a2 + b2
𝜑𝜑 = Tan-1 b/a
The output (dotted) waveform on the graph above is said to be “leading” the reference
waveform because its amplitude values are ahead of the input. Notice that because of the
periodic nature of the waveform, 60° “leading” phase angle is the same as 300° “lagging”
phase angle.
By comparing the input and output, the response of the linear system can then be described
in terms of gain and phase shift (generally shortened to phase).
Rout
Gain, R = and Phase, φ = φout-φin
Rin
Note: We often set the input amplitude Rin = 1 and assume the input phase, φin , to be zero
because phase is relative (this is how both are shown in Fig 1 above).
Units: In the above Gain is dimensionless (no units). Phase is in radians (rad) but will
usually be converted to degrees (π radians = 180 degrees). The frequency is in rad/s.
R Dixon 3 of 26
Example:
Frequency =
Gain =
Phase =
R,φ
sin (ωt) R sin(ωt + φ)
R1,φ1 R2,φ2
Sin (ωt) R1Sin(ωt + φ1) R1R2Sin(ωt + φ1 + φ2)
So you can see that the gains (R1 and R2) multiply and the phases add. The importance of
this in plotting and analysis should become clear later.
R Dixon 4 of 26
2.2 Obtaining the Steady State Frequency Response of a Linear System By
Experiment
In practice we could take a system (e.g., a dc motor) and test its frequency response at
different frequencies by applying sine-wave inputs at a number of frequencies and
measuring the gain and phase at each frequency. This is one of the ways that frequency
analysers work.
Frequency = 4 rad/s
= 4/(2π) Hz
Input amp. = 1 V
Rin Output amp. = 0.7V
Rout
Gain = Rout / Rin = 0.7
Lag = 0.3 s
1 period (360o)
= 2π/4 s
So Phase
= 360o x 0.3s / (2π/4) s
= - 68 deg
Period Phase lag
Fig 2. Example frequency response test result & calculation of Gain and Phase
Example: For the second test at frequency, ω, = 1rad/s work out the gain and phase of the
system response:
R Dixon 5 of 26
2.3 Calculating the Steady State Frequency Response of a Linear System
Alternatively, if we have already derived the model (linear transfer function) of the system we
could calculate the frequency response. There are two methods that will be discussed in
these notes for doing this. The first is used to aid understanding. The second will be used
most often in practice (and is what you need to be able to do).
3
Assume that our model, G (s) = , we can analyse how the plant responds to a
s+2
sinusoidal input (i.e. x(t) = sin ωt ) as follows. From the LT tables we should recognise that:
𝜔𝜔
U(𝑠𝑠) =
𝑠𝑠 2 + 𝜔𝜔 2
3 ω
∴ Y(s) = ⋅ 2
s + 2 s +ω2
A Bs + C A Bs C
By partial fractions Y(s) = + 2 = + +
s + 2 s +ω2 s+2 s +ω
2 2
s + ω2
2
C
∴ Y( t ) = Ae − 2 t + B cos ω t + sin ω t
ω
The steady-state frequency response is defined as the ‘residual response’, or ‘a.c. steady
state’: it is the response to a sinewave of unity magnitude as time tends to infinity. Thus the
frequency response of the plant at the values of ω given above can be listed as:
1 1.34 -27o
4 0.67 -63o
Noting that the exponential terms are simply discarded as they die away to zero with time
(provided the system is stable).
R Dixon 6 of 26
2.3.2 Method 2: By Substituting s=jω in G(s):
There is a much simpler way to determine the frequency response:
The result is a complex number G(jω) that depends on the value of ω. Its magnitude and
angle (phase) equal the gain and phase of the steady state response at that frequency.
So the real and imaginary parts of G(jω) are the coefficients a and b of the system’s
response to an input sin(ωt) after the initial transient has died out.
The function G(jω) is known as the steady state frequency response of the system, and may
be expressed in Cartesian or polar form.
a = Re (G(jω))
b = Im (G(jω))
R = G(jω)
φ = ∠G(jω)
3 3
G ( s) = ⇒ G ( jω ) =
s+2 2 + jω
3
= ω
2 2 + ω 2 ∠ tan −1 (ω / 2)
=
3
(
∠ − tan −1 (ω / 2) ) 2
2 +ω
2 2
Evaluating this expression for ω = 1 rad / sec and ω = 4 rad / sec gives the same results as
those tabulated above.
Fig. 3 Showing the decaying transient response and the sustained response to a sinewave
input. The output is a sinewave with modified amplitude (gain) and phase.
R Dixon 7 of 26
2.4 Graphical Presentation of the Steady-State Frequency Response
The gain and phase information is often presented graphically, in one of three forms. The
Bode diagram will be used initially. Nyquist and Nichols will be dealt with later in Part C:
input
6 2 1.0
1.3
0.6
20log gain
2.5
log
-
phase
log
-27
-63
20 log gain
2.5
-3.5
R Dixon 8 of 26
2.4.1 Bode Diagrams
One way of plotting the frequency response is to use Cartesian coordinates and plot the
magnitude, R, against the frequency, ω. Then on a second graph plot the phase (φ) against
frequency, ω. The main problem with this is that the frequency range can be large (e.g., 0 to
1kHz) whereas the area of interest for the plot is a narrow range (say for example 0 to
10Hz). To overcome the problem logarithmic scales are used. These are called Bode
diagrams (named after their inventor) and are plotted as follows.
Magnitude (gain) plot: In plotting the magnitude (or gain, R) units of decibels are used (dB).
Obtained by multiplying the log magnitude by 20 to give:- Log gain = 20 log 10 |𝐺𝐺(𝑗𝑗𝑗𝑗)| dB.
The Log Gain is then plotted against the log frequency, log10ω , to give the first plot.
Phase plot: The phase φ in degrees is plotted against the log frequency, log10ω to give the
second plot.
1. The logarithmic axes convert responses that are integer powers of frequency into
straight lines. For example, (Fig 5) the magnitude of 1/s has a slope of –
20dB/decade passing through 0dB at ω = 1; (1/s2) has a slope of –40dB/decade
passing through the same point, etc.
2. A pure gain is simply a horizontal line on the gain axis (and a horizontal line with
phase 0).
3. We can sketch the frequency response of 1/(s+a) – see Fig 6
a. Gain: by means of two intersecting straight lines: a horizontal line from zero
frequency having a value 20 log10(1/a), and a line with a slope of –20dB/dec
at higher frequencies, meeting the horizontal gain line at the “break
frequency” ω = a (where the gain is 1/a). The exact response is asymptotic to
those two lines, passing through a point 3dB below the intersection at the
break frequency.
b. Phase: Similarly, a straight line approximation is possible for the phase
response. At low frequency the gain will be a straight line at 0° until frequency
a/10. At high frequency (from 10.a rad/s) a straight line at -90º extends to the
right. The two points (a/10 and 10.a) are connected by a straight line which
passes in the middle through 0º at a rad/s. Again, the exact response is
asymptotic to those three lines as shown on the figure.
Of course Matlab/Simulink can be used to calculate the response exactly, but sketching
helps to provide a “feel” for what is happening, and is also invaluable for doing quick “back of
the envelope” calculations.
The figures (Fig 4 to 7) that follow provide the sketch & diagrams for frequently used
elements.
R Dixon 9 of 26
Fig 4. Bode diagram for derivative. The phase is +90º at all frequencies. The gain R=1 (0dB)
at 𝜔𝜔 = 1𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠 (or 100) and slopes at +20dB per decade (I.e., every factor of 10).
Fig 5. . Bode diagram for integrator. The phase is -90º at all frequencies. The gain R=1 (0dB)
at 𝜔𝜔 = 1𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠 (or 100) and slopes at -20dB per decade (I.e., every factor of 10).
R Dixon 10 of 26
Fig 6. Bode diagram for lead TF. The phase is 0º at low freqencies and +90º at high. Gain
R=1 (0dB) until 𝜔𝜔 = 𝑎𝑎 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠 and then slopes up at 20dB per decade (I.e., every factor of 10).
Fig 7. Bode diagram for lag TF. The phase is 0º at low freqencies and -90º at high. Gain R=1
(0dB) until 𝜔𝜔 = 𝑎𝑎 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠 and then slopes down at -20dB per decade (I.e., every factor of 10).
R Dixon 11 of 26
2.4.3 Sketching Bode Practice
Bode Diagram
40
20
Magnitude (dB)
-20
-40
180
90
Phase (deg)
-90
-180
-2 -1 0 1 2
10 10 10 10 10
Frequency (rad/sec)
R Dixon 12 of 26
Bode Diagram
40
20
Magnitude (dB)
-20
-40
180
90
Phase (deg)
-90
-180
-2 -1 0 1 2
10 10 10 10 10
Frequency (rad/sec)
R Dixon 13 of 26
3 Stability Analysis
3.1 The s-plane
Although the principles embodied in Laplace transforms, and their extensions into functions
where s is a complex number, appear to be mathematically abstract, in fact they provide an
important scientific basis which has great practical significance for control engineering.
So, if plotted on the complex plane they must all lie to the left of the imaginary axis or in the
Left Hand Plane 1.
By way of demonstration, we look at the time domain response when a first order system
has poles at various different locations on the s-plane.
constant.
The pole location is the value of s when the denominator is equal to zero:
We can see that provided τ is positive the system will be stable. The figure below shows
the response (generated from Matlab/Simulink) for three different locations of this single
pole. (Note the results will be similar for higher order systems with multiple poles – as you
will see in part B).
Fig 8. s-plane showing stable (Left Hand Side) and unstable (Right Hand Side) poles
1 What this means mathematically is that the time domain solution of the differential equation
(obtained via inverse Laplace transform) must contain only e-at terms and no terms of the form e+at,
assuming a is positive.
R Dixon 14 of 26
3.2 Nyquist & Stability Criterion
We can work out (by block diagram manipulation) that the characteristic equation for a
closed loop system is (1 + GP(s)). Using what we know from above (section 3.1.1), the
dynamic properties of the system can be identified by the roots of (1 + GP(s)). These are the
poles that of the closed loop transfer function and hence dictate whether stable or unstable
terms appear in the time response. We already know that their values (which will often be
complex) must have negative real parts if the system is to be stable. This corresponds to
decaying exponential terms in the time response.
Fig 9. Showing plant, P, controller G in closed loop feedback (left) as a closed-loop transfer
function (middle) and the open-loop transfer function GP(s).
From a practical point of view it is extremely useful if we can understand the characteristics
of the open loop response which will give a stable response when the loop is closed. Of
course, the transfer function of the open-loop response is GP(s).
The values of s for which GP(s) = -1 must have negative real parts.
This condition can be converted into an alternative stability criterion using the “mapping”
from the complex s-plane to the GP(s) plane (also complex). In general we can define a
locus enclosing a region on the s-plane and determine a corresponding locus enclosing a
region on the GP(s) plane.
Consequently, if we define a locus shown in the diagram below that encloses the whole of
the right hand half of the s-plane (including the imaginary axis), the corresponding locus on
the GP(s) plane must not enclose the point (-1 + j0) otherwise the closed loop system will be
unstable (or oscillatory).
R Dixon 15 of 26
Fig 10. The mapping of locus covering the entire right hand side (unstable region) of the s-
plane to the GP(s)-plane
2. The straight line portions OX and OY correspond to s = jω for positive and negative ω
values (respectively). The GP(s) locus for OX is therefore the steady-state frequency
response GP(jω), and OY is simply its complex conjugate.
3. It is very common for the open-loop transfer function GP(s) to have a pole at zero, i.e.
it has a factor of s, which means the open-loop system includes an integrator. Since
the s-plane locus passes through s = 0 there is a singularity (i.e. infinite response) in
GP(s) at this point. This cannot pass through (-1 + j0) and so the locus is modified 3
to avoid the singularity using an infinitesimally small semicircular radius around the
point s = 0
2 It is possible theoretically to create a system for which this is not the case, but the statement holds
for all real physical systems. It simply means that an input does not instantaneously appear at the
output – there is always some kind of thermal, inertial, inductive or other physical effect that
introduces a delay.
3 This must also be applied to any poles of GP(s) on the imaginary axis, but it’s only s = 0 that applies
to normal physical systems and so other pole positions can usually be ignored.
R Dixon 16 of 26
Fig 11. The mapping of to cope with a pole at the origin (essential for frequency response
calculation by computer as avoids dividing by zero).
The result: is basically the open-loop frequency response plotted on the GP(s) plane (or
Nyquist Diagram).
The key outcome is that we can plot the open-loop frequency response GP(jω) and its
complex conjugate (both of which will go to the origin as ω → ∞), if required considering the
small semicircular radius around s = 0 to join up the low frequency ends of the two
responses. As long as the region produced does not enclose the (-1 + j0) point, the
closed-loop system will be stable.
Im
Re The stability criterion makes use of the
mapping above and observes that for most
systems, if the locus of G P(jω) for increasing
positive values of ω passes to the right of (-1 +
(-1, 0)
Re
Im j0), the closed-loop system will be stable. This
is of profound practical significance, because
the frequency response can be measured
experimentally, including the effects of anything
GP(jω) not represented within the theoretically-derived
GP(s)-plane transfer function model.
Note for info: having mapped from the s-plane to form a locus on the GP(s) plane, it is
strictly necessary to determine whether the mapping is to the inside or outside of the region.
A simple method is to select a test point (e.g. a small positive value of s) – the corresponding
value of GP(s) will quickly answer the question. Alternatively, the full Nyquist stability
criterion deals with this more rigorously (see recommended text further details if you’re
curious). Remember also that the roots of the closed-loop system can in any case be
checked directly. However this does not apply in an experimental sense: whereas the
steady-state frequency responses are directly measurable, the roots are an abstract
mathematical concept that can only be inferred from time or frequency domain
measurements.
R Dixon 17 of 26
The closeness with which the open-loop frequency response passes to the (-1,0) point is a
measure of how far away from instability the
system is, and this is quantified by means of
gain and phase margins. These are shown
on the diagram, and can also be defined
formally as follows:
The phase margin indicates the additional phase lag that would cause the response to pass
through (-1,0) and thereby create an unstable system. It is usual to design to a minimum
phase margin of around 40°.
R Dixon 18 of 26
3.3 Stability Margins on Bode Diagram and Nichols Chart
Although the full Nyquist stability criterion is usually presented on the Nyquist diagram
(essentially an Argand diagram with the (-1,0) point marked), it is more usual to assess the
simplified criterion on a Bode diagram or Nichols chart. The diagrams below illustrate how
the gain and phase margins are deduced from these charts.
Bode Diagrams
30
Magnitude (dB)
20
10
0
-10 GM
-20
-30
-45
Phase (degs)
-90
-135
PM
-180
-225
-270
-2 -1 0 1 2
10 10 10 10 10
Frequency
20
(dB)
(dB)
PM
Gain
Open-Loopgain
0
Open-loop
GM
-20
-40
-360 -270 -180 -90 0
To find the Gain Margin (GM) simply find the frequency point where the phase is -180º then
the GM 0dB minus the gain magnitude at this frequency point.
To find the Phase Margin (PM) find the point where the gain is 0dB. Now note the phase at
this frequency. The PM is the phase (angle) at this point plus 180º; or the amount of
additional phase lag (negative phase) needed to push the phase to -180º.
R Dixon 19 of 26
3.3.1 Nichols Chart Contours
An important characteristic of the Nichols chart is that each point on the open-loop axes
corresponds uniquely to a closed-loop gain and phase – it is a simple transformation. It is
therefore possible to generate contours of a constant closed-loop gain and phase on the
Nichols chart, a feature which is greatly facilitated by the logarithmic representation of gain.
(It’s also possible on the Nyquist diagram although not often done, but NOT possible on
Bode.)
40
0 dB
0.25 dB
0.5 dB
20 1 dB -1 dB
(dB)
(dB)
3 dB
-3 dB
Gain
6 dB
Open-Loopgain
0 -6 dB
Open-loop
-12 dB
-20 -20 dB
-40 -40 dB
-360 -270 -180 -90 0
Open-Loop P has e (deg)
R Dixon 20 of 26
4 Stability Margin Examples
To analyse the stability, we want the frequency response of GP(s) - that is: GP(jω). We can
either calculate or sketch it based on a model, or we can measure it experimentally. Here we
will calculate it….
Open-loop system
𝐺𝐺.𝐾𝐾
Clearly, 𝐺𝐺𝐺𝐺(𝑠𝑠) = 𝑅𝑅𝑅𝑅𝑅𝑅+𝐾𝐾𝑡𝑡 𝐾𝐾
𝑣𝑣 𝑡𝑡
where 𝐾𝐾𝑡𝑡 = 0.38Nm/A; 𝐾𝐾𝑣𝑣 = 0.4V/rad. s −1 ; 𝐽𝐽 = 0.15kg𝑚𝑚2; 𝑅𝑅 = 0.1𝛺𝛺 and we know G=1.
0.38
𝐺𝐺𝐺𝐺(𝑠𝑠) =
0.15𝑠𝑠 + 0.152
2.5
=
0.0987𝑠𝑠 + 1
25
=
𝑠𝑠 + 10
We can now sketch the Bode diagram (we’ll practice this later). Or substitute in jω for s and
evaluate (with matlab) the gain and phase across a range of frequencies, ω. Then we can
plot these on the Bode diagram, Nichols Chat or Nyquist diagram and we can obtain from
any one of those charts the gain and phase margins.
R Dixon 21 of 26
Fig 12. Bode diagram showing open-loop frequency response of DC motor and proportional
controller with gain G=1 V/rads-1
Fig 13. Nichols Chart showing open-loop frequency response of DC motor and proportional
controller with gain G=1 V/rads-1
R Dixon 22 of 26
Nichols Chart
40
0 dB G =10
30 0.25 dB
Phase Margin = 90deg 0.5 dB
20 When G=10 1 dB -1 dB G =1
Open-Loop Gain (dB)
10 3 dB
-3 dB
6 dB
0 -6 dB
-10 -12 dB
-20 -20 dB
Gain Margin = Inf
-30
-40 dB
-40
-360 -315 -270 -225 -180 -135 -90 -45 0
Open-Loop Phase (deg)
Fig 14. Nichols Chart showing open-loop frequency response of DC motor and proportional
controller with gain increasing from G=1 V/rads-1 to G=10 V/rads-1
R Dixon 23 of 26
Fig 15. Nichols Chart showing open-loop frequency response of DC motor – with the model
including the effect of inductance - and proportional controller with gain increasing from G=1
V/rads-1 to G=10 V/rads-1
We now see that whilst the first order model suggest the PM would be a minimum of 90° in
fact the phase margin reduces to 35°. Both models offer a sensible approximation to the DC
motor in question at low frequencies. However when we decide to ignore the effect of
inductance, in the model we are ignoring the faster (time domain) higher frequency effects.
Which – if we design a controller with a high enough gain – means that we will not be aware
of the impact on the stability margins.
The matlab example will illustrate this and its effect on the time domain response.
R Dixon 24 of 26
4.3 Practice sketching
For the motor system model and proportional controller
0.38 2.5
𝐺𝐺𝐺𝐺(𝑠𝑠) = =
0.15𝑠𝑠 + 0.152 0.0987𝑠𝑠 + 1
Sketch the Bode diagram on the charts below. Consider how to move this to the Nichols
Chart.
Bode Diagram
20
0
Magnitude (dB)
-20
-40
0
Phase (deg)
-50
-100
-1 1 2
10 10 0 10 10 10 3
Frequency (rad/s)
Freq (rad/s)
Gain (dB)
Phase (deg)
R Dixon 25 of 26
40
0 dB
0.25 dB
0.5 dB
20 1 dB -1 dB
(dB)
(dB)
3 dB
-3 dB
Gain
6 dB
Open-Loopgain
0 -6 dB
Open-loop
-12 dB
-20 -20 dB
-40 -40 dB
-360 -270 -180 -90 0
Open-Loop P has e (deg)
R Dixon 26 of 26