CiontrolLecturePartII 2020
CiontrolLecturePartII 2020
Frequency responses
yr (t ) A sin( wt ) y (t ) B sin( wt )
H(s)
The frequency w of the sinusoisodal input may be varied => frequency response of H(s)
Frequency - Response Method
• The frequency of the sinusoisodal input is varied and the output reponse
is studied.
• The frequency response is the steady state response (after the transient).
• The decibels (dB) are used to measure sound level, and are
widely used in electronics, signals and communication.
Easier to use!!!
3
Frequency - Response Method
• Logarithmic technique changes multiplication into addition, and
division into subtraction
• Octave : the frequency interval for which the frequency doubles
[1=> 2=> 4 …]
• Decade : the frequency interval for which the frequency is
multiplied by 10 [1=> 10 => 100 …]
• As a number increases/decreases by a factor of 10, the dB value
Increases/decreases by 20 dB
• As a number increases/decreases by a factor of 2, the dB value
Increases/decreases by 6 dB
• Frequency response of a low pass filter with 6 dB per octave or
20 dB per decade
In dB the reciprocal numbers differ only in sign!
• 0.01 = -40 dB
• 0.1 = -20 dB
• 0.5 = -6 dB the number is divided by 2=> in dB its value is
decreased by 6 dB
• 1.0 = 0 dB
• 2.0 = 6 dB
• 10.0 = 20 dB
• 100.0 = 40 dB
Frequency responses
• The frequency - response curves give a complete description
of the system’s dynamic behavior and allow us to compute
the response for any input (not only sine waves)
• A negative phase angle is called phase lag, and a positive
phase angle is called phase lead
If the reference is yr(t)=sin2t and the output y(t)=0.3sin(2t-80°) => phase lag 80°
https://ocw.mit.edu/courses/aeronautics-and-astronautics/16-30-feedback-control-systems-fall-2010/lecture-
notes/MIT16_30F10_lec03.pdf
Frequency responses
• Every dynamical system has a frequency
spectrum
• When combined with the system’s frequency
response, we can calculate from it the system
time response
• The peak amplitude ratio is a relative stability
criterion. Bigger peak => poorer stability
Frequency response
• H(jw) is a complex function of w so we plot
separate graphs for the :
Phase response
Magnitude response
Phase response
Definition. The phase response F(w) = <H(jw) or arg(H(jw)) of a linear time invariant
(LTI) system is defined as the phase (or the angle) of the frequency response H(jw)
https://en.wikipedia.org/wiki/Angular_frequency
The phase response gives the phase shift in radians that each input Im
component sinusoid will undergo.
w is the radian frequency , w=2 *f =2 / T [rad/sec]
|H]
w is in rad/sec ; f is in Herz ; T is in seconds
F
Re
F cos F + j.sin F]
Im
The magnitude response gives the magnitude change that each input
component will undergo under frequency variation.
F
w is in rad/sec ; f is in Herz ; T is in seconds
Re
(for f=1 Hz => w [rad/s] = 2π [rad/s] = 6.2831853 [rad/s] )
(for w=1 [rad/s] => f [Hz] = 1/2π [Hz] = 0.1591549 [Hz] )
Some recalls
For a complex number
Phase=arg{H(jw)}=arctan
For instance, = =
Phase=arg{H(jw)}=arctan
For instance, = =
=arctan{G1(jw)} - arctan{G2(jw)}=arctan{Im{G1}/Re{G1}]-
-arctan{Im{G2}/Re{G2}]=arctan{w/0.2}-arctan{w/5}
For a complex number :
Phase=arg{H(jw)}=arctan
For instance, = =
=arctan{G1(jw)} - arctan{G2(jw)}=arctan{Im{G1}/Re{G1}]-
-arctan{Im{G2}/Re{G2}]=arctan{w/0.2}-arctan{w/5}
For instance Consider an RC circuit with R = 10k and C = 1μ => RC= 10ms
Vo 1 1
W ( s)
Vi 1 jwRC 1 0.01 jw
Vo VI i VO
w 50 0 . 89 27 R=10k
Vi
Vo
w 100 0 . 71 45 C=1μ
Vi
Vo
w 300 0 . 32 72
Vi
vo Magnitude: Vo
1
1
Magnitude Vi 1 jwRC 1 ( wRC ) 2
vi
1
Magnitude response
0 1 2 3 4 5
wRC
Vo Phase Shift:
Phase
Vi Vo wRC
0 ( jwRC 1) arctan( )
Vi 1
-0,2
-0,4 Phase response
0 1 2 3 4 5
wRC 15
Logarithmic axes for w
• Gain
• Integrator
• General form first order transfer function
• General form second order transfer function
Magnitude response of a gain H(s)=k
• The gain is recognizable by its zero magnitude slope, which is
always 0dB/dec
40𝑑𝐵
Slope 0 dB/dec
20*log
20𝑑𝐵
0𝑑𝐵
Magnitude response of an integrator
• The integrator is recognizable by its magnitude slope, which is
always -20dB/dec
=>| =>| 0 – 20*log => -20dB/dec
| |
Note that for = 1 0 (crosses the w-axis)
* Good building element in controllers => it suppresses noise (always high
frequency)
40𝑑𝐵
20𝑑𝐵
0𝑑𝐵
Logarithmic axes
30𝑑𝐵
10𝑑𝐵
Logarithmic axes
30𝑑𝐵
10𝑑𝐵
• Key idea:
•
( )
( )
0𝑑𝐵
−20𝑑𝐵
| =-3dB=0.707
0𝑑𝐵
−20𝑑𝐵
40
Magnitude (dB)
20
-20
-135
-180
-2 -1 0 1
10 10 10 10
Frequency (rad/s)
What if there is a numerator wich is not just a gain?
Additional first order transfer functions:
• For the elementary transfer functions G(s) = s
and G(s) = 1+sT, the magnitude responses are
symmetrical to and on ω axis i.e. with
slopes of +20db/dec
• Exercise : Plot the magnitude response of
= Hint : plot each elementary TF
separately, and sum up the corersponding log plots
Second order frequency responses
• When a physical system exhibits a natural
oscillatory behavior, a 1st order model (or
even a cascade of several 1 st-order models)
cannot provide the desired response
k k
1 2 / n * j 1 / n2 * ( j ) 2 1 2j / n 2 / n2
Second order magnitude responses
• k k
for k 1
1 2 / n * j 1 / n2 * ( j ) 2 1 2j / n 2 / n2
0 .1
0𝑑𝐵
Second order magnitude responses
k k
•
1 2 / n * j 1 / n2 * ( j ) 2 1 2j / n 2 / n2
| | ( / n ) 2
0 .1 | 0 - 20log ( / n ) 2
40 log 40 log n
0𝑑𝐵
neglectable with w ≫ 𝑤
−40𝑑𝐵 n , | H ( j ) | 1 0dB
Second order magnitude responses
k
• 1 2 / N * s 1 / N2 * s 2
0 .1
0𝑑𝐵
−40𝑑𝐵
Second order magnitude responses
k
• 1 2 / N * s 1 / N2 * s 2
0 .1 0 .1
20𝑙𝑜𝑔𝑘[𝑑𝐵]
20𝑙𝑜𝑔𝑘 − 40 [𝑑𝐵]
10𝑤 10𝑤
Second order magnitude responses
k
•
1 2 / N * s 1 / N2 * s 2
0 .1 0 .1
20𝑙𝑜𝑔𝑘[𝑑𝐵]
20𝑙𝑜𝑔𝑘 − 40 [𝑑𝐵]
10𝑤 10𝑤
Second order magnitude responses
k
• 1 2 / N * s 1 / N2 * s 2
0 .1 Impossibl
e
d’afficher
l’image.
0 .1
0 .3
0 .5
20 ∗ 𝑙𝑜𝑔𝑘[𝑑𝐵]
0 . 707
0 .1
0 .3
0 .5
20 ∗ 𝑙𝑜𝑔𝑘[𝑑𝐵]
0 . 707
NB Obviously, if ξ is smaller, the magnitude peak H (r ) is bigger, r is bigger so shifted to the right
http://lpsa.swarthmore.edu/Bode/underdamped/underdampedApprox.html
Frequency responses - bandwidth
• The bandwidth is the frequency for which the
amplitude ratio (the magnitude |H(jw)|) has
dropped to 0.707 of its zero frequency value
• It corresponds to the maximum frequence for
which a sinusoidal input will be reproduced at
the output
Magnitude responses for any H(jω)
• Factorize the polynomials in H(jω)
• Sort the corner frequencies by their increasing
order
• For each simple element plot the
corresponding magnitude log-log response
• Add all the magnitude responses
Phase response
The phase φ(ω) in degrees (°) or radians (rad)
φ [rad]
Derivation H(s)= s = jω
𝜋/2
ωT ω<< ω φ 0
0.1ω ω 10 ω
ωT ω ω φ ω[rad/sec]
NB At ω= ω φ = ) so the
phase is φ=
φ [rad]
First order H(s)=1-Ts=1-Tjω (T>0)
= arctan( ωT) H(s)=1-Ts=1-Tjω
Two horizontal asymptotes:
0.1ω ω 10 ω
0
ωT φ ω[rad/sec]
ωT φ -
-
NB At ω= ω the phase is φ=
Phase response of elementary systems
First order H(s)=1/(1+Ts)=1/(1+Tjω), T>0 φ [rad]
= arctan( ωT)
Two horizontal asymptotes: H(s)=1/(1+Ts)
ωT φ 0.1ω ω 10 ω
0
ωT φ ω[rad/sec]
-
NB At ω= ω the phase is φ= -
NB At ω= ω the phase is φ=
Phase response of elementary systems
1
Second order H(s)=
1 2 / n * s 1 / n2 * s 2 φ [rad]
2n
F arctan 2
n 2
Two horizontal asymptotes:
0.1ω ω 10ω
0
ω ω φ ω[rad/sec]
ω ω φ -
0 .2
NB At ω= ω the phase is φ=
-𝜋
At ω= ω the phase is φ arcsin
0.05
1 2
ω ω φ 0
0.1ω ω 10ω
ω ω φ ω[rad/sec]
NB At ω= ω the phase is φ =
Bode and Nyquist planes
1
Example : H ( s)
s 2 2s 1
Im{H}
Bode Diagram
0
Nyquist Diagram
-10 0.8
-20
No physical meaning
-30
0.6
ω<0
Magnitude (dB)
-40
0.4
-50
-60
0.2 H 0 ω = 0 => |H|=Re{H} =1
-70
Re{H}
Imaginary Axis
-80
0
0
F
-0.2
|H|
-45
Phase (deg)
-0.4
-90
-135
-0.6 ω>0
-180 -0.8
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-2 -1 0 1 2
10 10 10 10 10 Real Axis
Frequency (rad/s)
Nyquist Diagram
-10 0.8
-20
0.6
-30
Magnitude (dB)
-40
0.4
-50
-60
0.2
-70
Re{H}
Imaginary Axis
-80
0
0
F
-0.2
-45
|H|
Phase (deg)
-90 -0.4
-135 -0.6
-180 -0.8
-2 -1 0 1 2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
10 10 10 10 10
Real Axis
Frequency (rad/s)
-20
-30 0.6
Magnitude (dB)
-40
0.4
-50
-60
0.2
-70
Re
Imaginary Axis
-80
0
0
F
-0.2
-45
|H|
FM
Phase (deg)
-0.4
-90
-0.6
-135
-180 -0.8
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-2 -1 0 1 2
10 10 10 10 10 Real Axis
Frequency (rad/s)
Question : If the gain margin is higher, it means a more stable or a less stable system ?
http://lpsa.swarthmore.edu/Nyquist/NyquistStability.html
Example of phase margin in Nyquist
Diagram
Question : A higher phase margin means a more stable or a less stable system ?
http://lpsa.swarthmore.edu/Nyquist/NyquistStability.html
Delay margin
• The delay margin is the time delay that can be added to the open loop
system so that the closed loop system will be on the verge of instability.
• It is important because a lot of controller applications use A/D converters for the
sensors, and D/A converters for the actuators, where the computation takes
time!
0 dB
0.25 dB
0.5 dB
20 1 dB
-1 dB
3 dB
-3 dB
FM = 180°
6 dB
0 -6 dB
-12 dB
Open-Loop Gain (dB)
-20 -20 dB
-40 -40 dB
-60 -60 dB
GM =
-80 dB
-80
-360 -315 -270 -225 -180 -135 -90 -45 0
Open-Loop Phase (deg)
Black - Nichols chart: Magnitude as a function of the phase
=> Closed loop peak frequency response at the resonance is given by the M-circles
Nichols Chart
40
0 dB
0.25 dB
0.5 dB
20 1 dB
-1 dB
0 -6 dB
-12 dB
Open-Loop Gain (dB)
-20 -20 dB
-40 -40 dB
-60 -60 dB
-80 dB
-80
-360 -315 -270 -225 -180 -135 -90 -45 0
Open-Loop Phase (deg)
Exemple of an open loop system with one integrator
Open loop unstable, closed loop stable
Nichols Chart
40 ω →0
F → −90°
0 dB
0.25 dB
0.5 dB
20 1 dB -1 dB
2.3 dB
3 dB
-3 dB
6 dB
0 -6 dB
-12 dB
Open-Loop Gain (dB)
-20 -20 dB
-40 -40 dB
-60 -60 dB
ω → 𝑖𝑛𝑓
F → −180° -80 dB
-80
-360 -315 -270 -225 -180 -135 -90 -45 0
Open-Loop Phase (deg)
Open loop H(s) before correction
1
H (s)
s 2 2s 1
Step Response
1
System: sys
Time (seconds): 5.86
0.9 Amplitude: 0.98
0.8
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8
Time (seconds)
Tuning of P controllers
• M-circle is related to the closed loop first overshoot =>
– calculate the M-circle (closed loop resonance peak)
corresponding to the required overshoot X% that you want
to achieve
– then, measure the gain P such as the open loop becomes
tangent to the corresponding M-circle => get the required P
• For instance, for an overshoot of 25% :
( , )
( , )
= 1,35 => dB] = 2,63dB => corresponding (desired) M-circle for the closed loop
Tuning the proportional gain P
calculated to shift up and down the nichols chart
Nichols Chart
40
0 dB
0.25 dB
0.5 dB
20 1 dB
-1 dB
M-circle of 2.63 dB
3 dB
-3 dB
6 dB
0 -6 dB
-12 dB
Open-Loop Gain (dB)
-20 -20 dB
-60 -60 dB
-80 dB
-80
-360 -315 -270 -225 -180 -135 -90 -45 0
Open-Loop Phase (deg)
Nichols chart, proportional gain P
Nichols Chart
40
0 dB
0.25 dB
0.5 dB
20 1 dB -1 dB
2.63 dB P*H(jω)
3 dB
6 dB -3 dB
0 -6 dB
H(jω) -12 dB
Open-Loop Gain (dB)
-40 -40 dB
-60 -60 dB
-80 -80 dB
-100 dB
-100
-360 -315 -270 -225 -180 -135 -90 -45 0
Open-Loop Phase (deg)
Nichols chart: tuning the
proportional gain P
• Correct if necessary the gain P so that Q = 2,63dB (or X=25%)
• Recall :
Bode diagram of the closed loop => P=5
P * H ( s) 5
T ' (s) 2 𝒓
1 P * H ( s) s 2s 6 20log10(5/6) = -1.58
Bode Diagram
20 System: syscl
System: syscl
Frequency (rad/s): 2.02
10 Frequency (rad/s): 0.1
Magnitude (dB): 1.05
Magnitude (dB): -1.55
0
-10
Magnitude (dB)
-20
-30
-40
-50
-60
-70
-80
0
-45
Phase (deg)
-90
-135
-180
-1 0 1 2
10 10 10 10
Frequency (rad/s)
Time response of the new closed loop
For P=5 the closed loop’s overshoot is X=25% and the system is faster
∗ , ,
=> T’(s) =
∗ ,
Step Response
1.4
1.2
System: syscl
Time (seconds): 1.41
Amplitude: 1.04
1
System: syscl System: syscl
Time (seconds): 4.92 Time (seconds): 8
Amplitude: 0.836 Amplitude: 0.833
0.8
Amplitude
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8
Time (seconds)
1
PI controller K ( s ) P(1 )
sTi
Nichols Chart
40
0 dB
0.25 dB
0.5 dB 𝑃𝑖 ∗ 𝑊(𝑠)
20 1 dB -1 dB
3 dB
6 dB -3 dB
0 -6 dB
Open-Loop Gain (dB)
𝑊(𝑠)
-12 dB
-20 -20 dB
-40 -40 dB
-60 -60 dB
-80 dB
-80
-360 -315 -270 -225 -180 -135 -90 -45 0
Open-Loop Phase (deg)
1
PI controller K ( s ) P(1 )
sTi
• PI has no action in high frequencies !
• Decreasing the frequency ω implies a phase lag which tends to -
• Zero static error φ°=−90°
Nichols Chart Integral action
|𝐾(𝑗ω)| 60
40 𝑃𝑖 ∗ 𝑊(𝑠)
0 dB
0.25 dB
0.5 dB
20 1 dB
2.63 dB -1 dB
3 dB 𝑃 ∗ 𝑊(𝑠)
0
10/𝑇 1/𝑇 10/𝑇
ω[rad/sec] -60 -60 dB
-
-80 dB
-80
- -360 -315 -270 -225 -180 -135 -90 -45 0
Open-Loop Phase (deg)
1
PI controller K ( s ) P(1 )
sTi
1. Tune the proportional gain P to get tangent to the desired M-circle
2. Note the resonance frequency ω Nichols Chart Integral action
3. Choose Ti in the interval [10/ ω , 1/ ω ] 60
𝑃𝑖 ∗ 𝑊(𝑠)
4. Decrease P to re-tangent the desired M-circle
40
0 dB
0.25 dB
0.5 dB
20 1 dB
2.63 dB -1 dB
3 dB 𝑃 ∗ 𝑊(𝑠)
-20 -20 dB
-40 -40 dB
-60 -60 dB
-80 dB
-80
-360 -315 -270 -225 -180 -135 -90 -45 0
Open-Loop Phase (deg)
Ti = 10/ ω
1
PI controller K ( s) P(1 )
1. Tune the proportional gain P to get tangent to the desired M-circle
sTi
2. Note the resonance frequency ω
3. Choose Ti in the interval [10/ ω , 1/ ω ]
4. Decrease P to re-tangent the desired M-circle
-20 -20 dB
-40 -40 dB
-40 -40 dB
-60 -60 dB
-60 -60 dB
0.6
0.4
0.2
0
0 100 200 300 400 500 600 700 800 900
Time (seconds)
1
PI controller K ( s ) P(1 )
sTi
NB. If the step response is dragging as in the example below, Ti should be
decreased (towards 1/ ω to speed up the system, and P must be
decreased as well to keep sufficient stability margins
Step Response
1.2
System: syscl
Time (seconds): 20
Amplitude: 0.995
1
System: syscl
Time (seconds): 0.757
Amplitude: 0.771
0.8
0.6
Amplitude
0.4
0.2
-0.2
0 2 4 6 8 10 12 14 16 18 20
Time (seconds)
1
PID controller K ( s ) P(1 sTd )
sTi
1. Zero static error : after the transient, the output is equal to the reference; rejects noise!
2. Fast step response
3. The derivative part increases the stability margins (but amplifies the noise)
4. Instead of three parameters to tune P, Ti, Td => Method of the ω pivot invariant point
2n
2
Let’s pose Td = and Ti = ω
ω
1 sTd
NB In practice, deg(num) ≤ deg(den) for feasibility => the PID controller is K ( s ) P(1 )
(low pass filter)
sTi 1 s
Where is to be chosen very small not to interfere with the system dynamics << 1/ω
PID controller tuning
• Tune a P controller as usual : Open loop with P controller tangent to the
desired M-circle (for instance 2,3 dB for 23% overshoot)
• Note the value of ω for φ°=−100° : that is the pivot (invariant) point
(ω <ω )
• Tune until you reach the desired value for which the open loop with
PID controller becomes again tangent to the desired M-circle ( hint : check with
Bode closed loop for more precision => T = T(jω ) = M-circle in dB )
1 Ts
Phase lag compensator K ( s ) Plag
1 bTs
(approximated PI controller)
|𝐾(𝑗ω)| 1 1 1
ω =
𝑇𝑏 𝑇
𝑇 𝑏 ω[rad/sec]
0𝑑𝐵
We use :
−10log(𝑏) Maximum gain decrease b
in high frequencies
−20log(𝑏)
φ[rad] ω =
0
ω[rad/sec]
-
−φM
-
1 Ts
Phase lag tuning K ( s ) Plag
1 bTs
K ( s) H ( s) 1
E ( s ) Yc ( s ) Y ( s ) Yc ( s )(1 T ( s )) Yc ( s )1 Yc ( s )
1 K ( s) H ( s) 1 K ( s) H ( s)
1 1 1 s 1
lim e(t ) lim s.E ( s ) lim s 2 lim 0.003
t s 0 s0
s 1 K ( s ) H ( s ) s0
s s K ( s ) H ' ( s ) 0 K ( 0) H ' ( 0 )
1 1
0.003 Plag 34.03
Plag * H ' (0) Plag * 9.794
Phase lag compensator tuning
1 Ts
K ( s ) Plag
1 bTs
• Tune a P controller, note as usual (to tangent the desired M-circle)
• Adjust b and T until you reach the desired M-circle and the desired closed loop overshoot
1 aTs
Phase lead compensator K ( s) Plead
(approximated PD controller) 1 Ts
|𝐾(𝑗ω)|
20log(𝑎)
10log(𝑎)
0𝑑𝐵
ω[rad/sec]
φ[rad]
φM
𝜋 We use :
4
Maximum phase lead φM
ω = ω[rad/sec] around frequency
1 aTs
Phase lead compensator tuning K ( s ) Plead
(approximated PD controller) 1 Ts
• Tune a P controller, as usual (to tangent the desired M-circle)
• Calculate Plead to guarantee the required static error
• Plot in Nichols plane the two responses P*H and Plead*H
• Measure the phase φ between P*H and Plead*H (n
• Calculate a = (1+sinφ )/(1-sinφ ) and T=10/ (initial values)
• Adjust a and T until you reach the desired M-circle and the
desired closed loop overshoot