Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MSD Part 1
Control Systems
Dr M Ristic
Relevant 2nd year subjects
• Dynamics
– Vibrations, resonance
• Mathematics
– Linear DEs, Laplace transforms
• Mechatronics
– Electrical filters, Bode diagrams, Control
Control Systems
Autumn term Lecture Topic Tutorial Group
Week (Room 649)
3 Control #1 – Introduction, system models, block A
diagrams, Laplace transform, transfer function
e=u–x
1 1
N.B. superposition !
Control computer
Error
Power
Input + Controller D/A Plant Output
- amp
Signal
A/D Sensor
Conditioning
Control System Design
• Ramp Input
(constant speed)
t
• Impulse
• Sinusoid
(Frequency response)
t
SISO System Models:
Differential Equation of Motion
• Solution:
Natural mode of response,
Independent of u(t)
2ζ 0
ζ 1
ζ 1 cos sin
F
x (1 e nt (cos d t sin d t ))
k 1 2
PI, input dependent
CF, natural mode of response
20 20
15 15
deflection (mm)
deflection (mm)
10 10
5 5
k = 1000 N/m; M = 25 kg; zeta = 0.1; k = 1000 N/m; M = 25 kg; zeta = 0.9;
step force, 10N at t = 0 step force, 10 N at t=0
0 0
0 1 2 3 4 5 0 1 2 3 4 5
time (sec) time (sec)
Second Order System Response
= 1 (critical damping); > 1 (overdamped)
12
(critical damping)
10
deflection (mm)
8
6
4
2 k = 1000 N/m; M = 25 kg
step force 10N at t = 0
0
0 2 4 6 8 10
time (sec)
1 1
+ + +
- -
-
dx
Ku ( t ) x ( t )
dt
dx dx
u(t) K.u ( t ) dt 1 dt x(t)
K
+
- dt
C t
x ( t ) C.e
0.37 C
t
u(t) x(t)
Pure Integration u(t) x(t)
Some examples i(t)=const v(t)
1
Ideal current source charging v(t)
a capacitor C
t
DE changes to: .
1
Block diagram .
1
+
-
Response characteristic
• 2nd order, 2 natural modes
• Same form as mass/spring/dashpot: , , etc …
Higher order systems ( )
e.g. Consider 3rd order DE
3 natural modes solution (CF)
• Either 3 exponentials , ,
cos sin
• Control systems
– Negative feedback, closed loop
– Response: transient and steady-state performance
• Dynamic system models
– Linear differential equation of motion, order ‘n’
– Solution
– Block diagram representation: signal flow, transfer functions
• Natural modes of response (CF)
– Signals (functions)
– Generated whenever the dynamic system is disturbed
– Define transient response
– Can be exponential or harmonic
• Need better generic tools to analyse response of complex
(high-order) systems
Lecture 2
Laplace transforms
• Laplace transforms
• What is the ‘Laplace variable’ ?
• Laplace transforms of common signals
• Solution of diff. equation of motion
• Steady state values ( → ∞)
• Transfer function poles and zeros
• Root locus introduction
Laplace Transform
Laplace transform of is
Definition:
i
's-plane‘
(complex conjugate)
In general, any signals f(t) may be represented by a combination of points in the s-plane
Laplace transforms of signals
In most cases of interest in control, f(t) = 0, t < 0 so
L f (t ) f (t )e st dt f (t )e st dt
0
a
Consider step function, amplitude a,
0, 0
i.e.
, 0 t
This image cannot currently be display ed.
Laplace Transforms of some common signals
b b
F (s) 2
s t
Sinusoid: sin , 0 1
F (s) 2 t
s 2
Cosinusoid: cos , 0 1
s
F ( s) 2 t
s 2
Exponential: , 0
1
1
F (s)
sa
t
Inverse Laplace Transforms
i
1
Formally: L F ( s )
1
F ( s ) e st
ds f (t )u (t )
2i i
u(t)
time
The complex integration is difficult in most cases.
Most important information about control systems is obtained in the 's plane'
so we will not deal much with inverse transforms.
Important Properties of Laplace Tranforms
d
x(t ) x( t )
1. Differentiation dt
X( s ) sX( s )
mass-spring-dashpot
Taking Laplace transform
0 0 0
F
x
M Assume zero initial conditions 0 0 0
k c
1
Transfer function
Response analysis
1
0.4 40
0.01
7.6 40 3.8 5.05
.
0.01 1 cos 5.05 0.75 sin 5.05
System response
k c
1
… + … +
⋯ ⋯
Transfer function:
⋯
Ratio of two polynomials in ‘s’
⋯
More importantly:
Let: → … Then: →∞ Transfer function ‘poles’:
Marginal
stability
Unstable
Stable region region
Example: transfer function poles and zeros
Gain K is adjustable (design parameter)
Consider the control system below.
Gain K is adjustable (the ‘design parameter’)
1
+ 1 2
-
1
1 2
1 1 2
1
1 2
0.5
3 2 0.5 0
→ 0.40 0.25, 2.19
1 1
3 2 1 0 3 2 1
→ 0.34 0.56, 2.32
2
3 2 2 0
→ 0.24 0.86, 2.52 1
5
3 2 5 0
→ 0.05 1.31, 2.90
10 2
3 2 10 0
→ 0.04 1.50, 3.09
Closed loop poles: 1 2 0
0 3 2 0
1 2 0 Open loop pole locations
0.1 2
3 2 0.1 0
→ 0.9, 0.05, 2.04
0.3
3 2 0.3 0
→ 0.21, 0.66, 2.13 1
0.5
3 2 0.5 0
→ 0.40 0.25, 2.19
1 1
3 2 1 0 3 2 1
→ 0.34 0.56, 2.32
2
3 2 2 0
→ 0.24 0.86, 2.52 1
5
3 2 5 0
→ 0.05 1.31, 2.90
10 2
3 2 10 0
→ 0.04 1.50, 3.09
Root locus diagram
Properties:
• Symmetrical about axis
• Number of branches = number of open loop poles
• Branches:
– start at open loop poles,
– end at open loop zeros or at → ∞.
Asymptotes
→∞
Real axis crossing
portion of RL
Open loop
poles & zeros
‘Breakaway’
points
j
j
asymptotes
double
CL pole
Root locus examples
1
. .
. .
j
j
Root locus examples
. .
Stable
for all K Unstable
for all K
Root locus examples 1
. .
1
. . j
j
asymptotes
double
CL pole
. .
Closed Loop System Design
Adjustable gain
1
K influences the position of
closed loop poles
Therefore
• gain K influences closed loop natural modes (transient response)
• Oscillatory/damped, stable/unstable
2
Design criteria is s-plane
Consider a pole pair
j
j
j j
s-plane regions
Settling time criterion
Damping ratio
criterion
Matlab analysis example: Aircraft Roll Control
Measured using
Schematics of a roll control system for an aircraft rate gyroscope
Adjustable gain
Integration
1 5 1
s1 s 5 s
Aircraft Roll Control II
Open loop transfer function:
5 5
1 5 6 5
Open loop poles: 0, 1, 5
plant = tf (num,den);
% Define controller gain K=0.1:
contr =0.1;
% Define closed loop unity-feedback system:
system = feedback(contr*plant,1);
% Plot step response:
t = 0:0.01:60;
step (system,t) Unity feedback
num = [5];
den = [1,6,5,0];
plant = tf (num,den);
contr = 0.1;
system = feedback(contr*plant,1);
t = 0:0.01:60;
step (system,t)
Closed loop poles K=0.1
+ K
5 5
- 6 5 6 5 5
Matlab command:
>> pzmap(system)
Exponential modes
Aircraft Roll Control III
Same system, increase K=1
num = [5];
den = [1,6,5,0];
plant = tf (num,den);
contr = 1;
system = feedback(contr*plant,1);
t = 0:0.01:60;
step (system,t)
Faster response, more oscillatory
Oscillatory mode
(complex conjugate poles)
Closed loop poles
>> pzmap(system)
Exponential mode
Response with increasing Gain K
Try K=5 Try even larger gain K=7
Very oscillatory
Unstable
Matlab comands:
Increasing K
Root locus
System
configuration
setup
Bode diagram
(open loop)
Let 0, so:
• constant amplitude harmonic signal angular frequency
Transfer function
Magnitude and phase relationship between input and output
x(t )
K.G ( j)
Vi
ωt Vo
ωt
Cascade of simple transfer functions
Overall transfer function T1*T2*T3
• Product of magnitudes (gains)
• Sum of phase shifts
Overall magnitude:
In dB (sum of logs):
20 log 20 log + 20 log + 20 log
Adjustable gain
Integration
1 5 1
s1 s 5 s
1 1 1
1 jω 1 0.2 jω jω
20.log10 K * ωτ*
ωτ*
5
45
45
90
90
K
j
1 1 1
Bode phase diagram 1 1 0.2
90° tan tan
90° tan tan 0.2
Bode plot using Matlab (K=1)
Matlab comands:
K>1
num = [5];
den = [1,6,5,0];
plant = tf (num,den);
bode(plant)
K=1
Increasing gain K:
u e KG ( j) x
x K.G ( j)
u 1 K.G ( j)
• When KG(jω) = -1
Closed loop: self-sustained oscillations
.
u0
1
u e
KG ( j) x
In this case
• Negative feedback makes Loop Transfer = (-1)(-1) = +1.
• Closed loop system becomes self-oscillatory,
• Once set in motion, the system will oscillate forever, even if u=0.
NB: This system has closed loop poles exactly on the -axis
Stability limits
1
e
u0 KG ( j) x
0dB
Note:
We plot:
• Bode diagram of the
open loop TF KG(jω)
0.1 1 10
In order to analyse
• closed loop system
response
-180
0.1 1 10
Increased gain K:
Unstable closed loop system
u e KG ( j) x
Increased gain K:
N.B.
• Gain change
only affects the
magnitude plot
• up/down by
20log10(K) dB
Reduced gain K
Stable closed loop system
e KG ( j) x
u
KG ( j )
0.1 1 10
-180
0.1 1 10
e
u
KG ( j) x
Stability Margins
Gain Margin:
ADDITIONAL GAIN that
can be introduced before Gain Margin
the onset of instability
Phase Margin:
ADDITIONAL PHASE LAG
that can be introduced
before the onset of Phase Margin
instability
Problem sheet 4 Q1
1. Figures below show Bode magnitude corner plots for some transfer
functions . In each case:
(i) Estimate the gain .
(ii) Estimate the frequency dependent part by considering
the slopes and the corner frequencies.
a) As → 0, → 30
∴ 20 log 30
30 31.6
1
1 1 1
1
Step response
Settling time: 4
(2% of final value)
Frequency response (2nd order system)
e K
u x
j1 j
Damped resonant
frequency: d n 1 2
Resonance peak 1
M
magnitude: 2
e K
… but for control design we plot the u x
j1 j
open loop Bode diagram
Corresponding
open loop transfer function
• is related to phase
margin (how oscillatory)
• is closely related to
bandwith (how fast)
Phase Margin is used as a useful measure of
transient performance
ξ M % O/S Phase
Margin (deg)
100
0 ∞ 100 0 90
0.1 5.0 73 12.5 80
50
PM
0.4 1.3 25 49.1
40
0.5 1.0 16 57.2 30
0.6 0.8 9 63.4 20
0.8 ‐ 2 71.5 0
0 0.5 1 1.5 2 2.5 3 3.5
1.0 ‐ 0 76.3 Damping ratio
1.2 ‐ 0 79.4
1.3 ‐ 0 80.6
What do we do for system higher than 2nd order?
cos sin
Aircraft roll control example
1 5 1
s1 s 5 s
1 1 1
1 jω 1 0.2 jω jω
1 1 1
1 jω 1 0.2 jω jω
a) Plot the Bode diagram for the open loop system, assuming K=1.
Estimate the frequency at which the phase is −180°
Find Gain Margin, Phase Margin
b) Estimate the maximum amplifier gain K for which the closed loop system is stable.
c) Estimate the gain K for which the closed loop system will be critically damped (ξ=1).
Bode plot K=1
ξ Phase
GM=15.6 dB Margin
(deg)
0 0
0.1 12.5
0.2 25.9
0.3 38.6
0.4 49.1
0.5 57.2
0.6 63.4
0.7 68.0
0.8 71.5
1.0 76.3
1.2 79.4
1.3 80.6
PM=43 deg
Step response, K=1
• phase is −180° at
frequency ω=2.2 rad.s-1 GM=15.6 dB
• corresponding magnitude
is −15.6 dB
PM=43 deg
From the Bode plot
(b) Estimate the maximum amplifier gain K for which the closed loop system is stable
or K=6.03
PM=43 deg
(c) ξ=1 corresponds to Phase Margin ≈76 deg
ξ Phase
Margin
(deg)
0 0
0.1 12.5 New 0dB line
0.2 25.9 K=0.25
0.3 38.6 12dB
0.4 49.1
0.5 57.2
0.6 63.4
0.7 68.0
0.8 71.5
1.0 76.3
Bode plot for K=1
1.2 79.4
1.3 80.6
Hence:
−12dB= 20log10(K)
or K=0.25
Step response
K=1
Position
Error
K = 0.25
Critical damping
• Fast response
• No overshoot
Steady state errors
u + e x
Consider the control system:
- 1 1 2
1
. →
1 .
u + e x
- 1 1 2
1
Let u(t) = unit step
1 1 2 1 1 1 2 1
lim lim . . lim
→ → 1 1 2 → 1 1 2 1
1
1
1 K
Need → ∞ to achieve zero
steady state error
t
Steady state errors /3
Consider now similar system u + e x
- 1 1 2
1 1 1 1 2
1 . 1 1 1 2
1 1 2
1
Unit step input
1 1 2 1 1 1 2
lim lim . . lim 0
→ → 1 1 2 → 1 1 2
1
Unit ramp input
1 1 2 1 1 1 2 1
lim lim . . lim
→ → 1 1 2 → 1 1 2
Response to a ramp input
u, x
1
E ss
K
t
System Class
• System class is equal to the number of ‘free integrators’ in the open loop transfer function.
• Determines the steady state errors that the system will exhibit in response to different types of
input.
• ‘Class 0’ – no free integrators and it will exhibit a finite positional error in response to a step input
(droop)
• ‘Class 1’ – zero steady state error due to step, but a finite steady state error due to ramp.
In general:
• Aim to maximise DC gain, K
– Reduced steady state errors
– Improved disturbance rejection
– Upper limit: system may become too oscillatory or even unstable
• Integrator holds a constant output value for zero input
– ‘Infinite DC gain’
• Output of a time constant reduces to zero for zero input
Lecture 6
Compensation
Matlab example
• PID control design
using simulation
Compensation
KDs
KP
G( s )
KI
s
or
1
1 TI = integration time constant
TD = differentiation time constant
PID implementation: op-amps
PID component
signals during step
response
PD – high-pass filter
G PD
Kp
Kp
Kd
Phase advance at high frequencies:
• Improved stability margins 90
• Improved damping Phase
angle
0
PID filter characteristics 2/3
PI – low-pass filter
G PI
0
Negative phase
• Reduced stability margins 90
• More oscillatory response
PID filter characteristics 2/3
GPID
90
Matlab: DC Motor Position Control
PID Design using simulation
J = 3.2284E-6 kg.m2/s2
b = 3.5077E-6 Nms
K=Ke=Kt = 0.0274 Nm/Amp
R = 4 ohm
L = 2.75E-6 H
V: Source Voltage, input
: position of shaft, output
Differential Equations
Transfer function:
Θ
Θ
Design requirements
dist_cl=feedback(motor,contr);
step(dist_cl,t)
J=3.2284E‐6;
b=3.5077E‐6;
K=0.0274;
R=4;
L=2.75E‐6;
num=K;
den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2) 0];
motor=tf(num,den);
Kp=1.7;
Ki=20;
contr=tf([Kp Ki],[1 0]);
sys_cl=feedback(contr*motor,1);
PI control performance
Response to step input R, D=0
t=0:0.001:0.4;
step(sys_cl,t)
1.7 20 17 200
10
Note
• the zero introduced by PI is still at 11.8,
.
• loop gain has increased 10
200
17 0.15
Kp=17;
Ki=200;
Kd=0.15;
contr=tf([Kd Kp Ki],[1 0]);
sys_cl=feedback(contr*motor,1);
t=0:0.001:0.1;
step(sys_cl,t)
600
17 0.15
• Selecting even the initial values of the three PID parameters is in practice often
difficult.
• Ziegler-Nichols empirical method has been shown to work well in practice.
• 2 separate cases: oscillatory and non-oscillatory systems
P control 1/
0.9/ t
PI control L
3.3
1.2/
PID control 2
0.5
Root Locus Plot
Adjustable gain
1
K influences the position of
closed loop poles
Asymptotes
→∞
Real axis crossing
portion of RL
Open loop
poles & zeros
‘Breakaway’
points
j
j
asymptotes
double
CL pole
Root locus examples
1
. .
. .
j
j
Root locus examples
. .
Stable
for all K Unstable
for all K
PID Controller design using Root Locus
J = 3.2284E-6 kg.m2/s2
b = 3.5077E-6 N/m/s
K=Ke=Kt = 0.0274 Nm/Amp
R = 4 ohm
L = 2.75E-6 H
V: Source Voltage, input
: position of shaft, output
Design requirements
• Settling time < 40 ms
• Overshoot <16%
• No steady-state error due to step input
• No steady-state error due to a steady disturbance (step)
sin
j j
Lines
Drawing the root locus: P–control
Root Locus
6
J=3.2284E‐6; 40 x 10 Root Locus
2.5 0.5
b=3.5077E‐6; 0.5
K=0.0274;
R=4; 30 2
L=2.75E‐6;
num=K; 1.5
den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2) 0];
20
motor=tf(num,den) 1
0
0
rlocus(motor) NB: very
-0.5 fast decaying mode,
1.5 10
%lines of constant -10 -1
%(radial through origin) -1.5
sgrid(.5,0) sigrid(100)
-20
-2
%lines of constant
0.5
%in (vertical) -30 -2.5
-4 -3 -2 -1 0 1 2
-1 6
0.5 )
Real Axis (seconds x 10
-40
-70 -60 -50 -40 -30 -20 -10 0 10
Model reduction
Assume L→0
≪
1
J=3.2284E‐6;
b=3.5077E‐6;
K=0.0274;
R=4;
L=2.75E‐6;
num=K;
den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2) 0];
poles=roots(den);
%deconvolution (polynomial division)
den2=deconv(den,[1/max(abs(poles)) 1]);
motor=tf(num,den2);
rlocus(motor)
sgrid(.5,0)
sigrid(100)
Integral Control
1
• never stable
• another controller must be
used
Now:
Double pole @
origin
PI Control
20
20
• System is stable
• Zero steady-state error
to a disturbance,
• Response still not fast
enough
• Poor damping
PID Control
60 70 60 70
130 4200
Root Locus
0.5
denc=[1 0];
contr=tf(numc,denc);
50
Imaginary Axis (seconds-1)
-50
-100
0.5
Root Locus
0.5
100
-50
-100
0.5
-300 -250 -200 -150 -100 -50 0 50
Real Axis (seconds -1)
Response, K=0.0945
1.2 0.06
1 0.05
0.8 0.04
Amplitude
p
0.6 0.03
0.4 0.02
0.2 0.01
0 0
0 0.05 0.1 0.15 0.2 0.25 0 0.05 0.1 0.15 0.2 0.25
Time (seconds) Time (seconds)
Satisfactory Satisfactory
sys_cl=feedback(k*contr*motor,1);
Try higher gain
[k,poles] = rlocfind(contr*motor)
sys_cl=feedback(k*contr*motor,1);
Root Locus
0.5
100
selected_point =
‐1.3943e+02+ 1.8502e+01i
k = 0.1309
poles = Imaginary Axis (seconds-1) 50
1.0e+06 * ‐1.4542
‐0.0001 + 0.0000i
‐0.0001 ‐ 0.0000i 0
‐0.0001
-50
-100
0.5
-300 -250 -200 -150 -100 -50 0 50
Real Axis (seconds -1)
PID Control – time response, K=0.13
Step input Step disturbance
Step Response Step Response
1.4 0.05
0.045
1.2
0.04
1
0.035
0.03
0.8
Amplitude
Amplitude
0.025
0.6
0.02
0.4 0.015
0.01
0.2
0.005
0 0
0 0.05 0.1 0.15 0.2 0.25 0 0.05 0.1 0.15 0.2 0.25
Time (seconds) Time (seconds)
∴ 20 log 30
30 31.6
. . .
→ . . .
1
. .
1 . 1 .
1
1 1 1 2
. .
1 1
1 1 2 1 1 2
1 1 2 1
. .
1 1 2 1 1 2