Lecture 13|Applicationsand Case
Studies
Theme,Discuss some practical issues that must
be dealt with to obtain a working adaptive
controller
1,Introduction
2,Controller Implementation
3,Parameter Estimation
4,Interaction Controller Estimator
5,Operational issues
6,Conclusions
Introduction
Many aspects even for a simple controller
u#28t#29=K
,
e+
1
T
i
Z
t
e#28s#29ds + T
d
de
dt
#01
#0F Operational issues
#7B Hand-automatic switches
#7B Parameter changes
#7B Avoid bumps
#0F Algorithmic issues
#7B Antialiasing #0Clters
#7B Filtering of derivative
#7B Integrator windup
#7B Nonlinearities
#0F Numerical issues
#7B Approximations
#7B Wordlength
#7B Converter resolution
More in adaptive controllers
How to Thinkabout the Problem
An adaptive controller can be viewed as an
automation of modeling and control design
#0F What can go wrong?
#0F Guidance from theory
#0F Experiments
Control Design and Implementation
#0F Control design issues
#0F Digital control
#0F Computational delay
#0F Sampling rates
#0F Multirate sampling
#0F Antialiasing
#0F Integral Windup
#0F Control Design
#0F Parameterization
#0F Numerics
c#0D K,J,#C5str#F6m and B,Wittenmark 1
Control System Design
#0F Design issues
#7B Load disturbances
#7B Measurement noise
#7B Command signal following
#7B Model uncertainty
#0F Controller structure
#7B Two-degree-of-freedom
#7B Explicit observer #28White box#29
#7B Polynomial #28Black box#29
#0F Design methods
#7B Pole placement
#7B Linear quadratic gaussian
#7B Many others
#7B Design parameters
Robust Pole Placement
Idea,Obtain robustness adn disturbance rejec-
tion by introducing constraints on polynomials
R and S Process
Ay = B#28u + v#29
A
v
v = e
Controller Ru = Tu
c
,Sy
Closed loop system
y =
BT
AR + BS
u
c
+
BR
AR + BS
v
u =
AT
AR + BS
u
c
,
AR
AR + BS
v
Sensitivity to model errors
jH#28z#29,H
0
#28z#29j #3C
#0C
#0C
#0C
#0C
H#28z#29T#28z#29
H
m
#28z#29S#28z#29
#0C
#0C
#0C
#0C
Example z,1 factorofRand z +1factorof
S
Design witn Constraints
First solve the ordinary Diophantine
AR
0
+ BS
0
= A
c
The controller
R = XR
0
+YB
S=XS
0
,YA
then satis#0Ces
AR + BS = A
c
X
Choose X introduce the constraints and solve
for Y and R
Interpretations,The controller is
#28XR
0
+YB#29u=,#28XS
0
,YA#29y
Hence
u =,
S
0
R
0
y +
Y
XR
0
#28Ay,Bu#29
The Youla-Kucera Parameterization
If the controller
R
0
u =,S
0
y
stabilizes the system
Ay = Bu
Then all stabilizing controller can be written as
u =,
S
0
,QA
R
0
+ QB
y
where Q is a stable transfer function
Process
yu
- S
0
A
- B
Y
X
R
0
1
S
S
c#0D K,J,#C5str#F6m and B,Wittenmark 2
ComputationalDelays
y
y(tk- 1)
y(tk)
y(tk+1)
Time
u
t k- 1
t k
tk+1
u(tk- 1)
u(t
k
)
Time
Control Variable
Measured Variable
Case B
y(tk- 1)
y(tk )
y(t k+1)
y
Time t k- 1 t k t k+1
u(tk)
u(t
k+ 1
)
u
Time
Control Variable
Measured Variable
Case A
Computa-
tional
lag
t = h
Computa-
tional
lag t
R
#03
#28q
,1
#29u#28t#29=T
#03
#28q
,1
#29u
c
#28t#29,S
#03
#28q
,1
#29y#28t#29
Implement as follows:
1,Make A-D conversion of y#28t#29 and u
c
#28t#29
2,Compute u#28t#29=t
0
u
c
#28t#29,s
0
y#28t#29+u
1
#28t#29
3,Make D-A conversion of u#28t#29
4,Compute
u
1
#28t +1#29=#281,R
#03
#29u#28t+1#29+#28T
#03
,t
0
#29y#28t+1#29
,#28S
#03
,s
0
#29y#28t+1#29
Choice of samplinginterval
Rule of thumb #28deterministic design#29:
!
o
h #19 0:2,0:6
!
o
#7B The natural frequency of the dominating
poles of the closed-loop system
The rule implies about 5#7B20 samples in a step
response of the closed-loop system
Di#0Berent rates in controller and estimatormay
be useful
Special hold circuits
Post #0Clters
Antialiasing#0Clter
Eliminate all frequencies above the Nyquist
frequency #28!
N
= #19=h#29 before sampling.
Use 2#7B6 order Butterworth or Bessel #0Clters
Sampling interval dependence
G
aa
#28s#29=
!
2
s
2
+2#10!s+!
2
Bad news,The antialiasing #0Clter will in#0Duence
the process and the design
Good news,Can often be approximated bya
time delay,Good in the adaptive case
E#0Bect of Anti-AliasingFilter
Process
G#28s#29=
1
s#28s+1#29
Fixed parameter pole placement controller.
Fourth order Bessel #0Clter with the bandwidth
!
B
.
y
m
#28t#29=y#28t#29+a
d
sin#28!
d
t#29
0 5 10 15 20
0
1
0 5 10 15 20
0
1
0 5 10 15 20
0
1
0 5 10 15 20
0
1
Time Time
Time Time
#28a#29
u
c
y
u
#28b#29
u
c
y
u
#28c#29
u
c
y
u
#28d#29
u
c
y
u
Parameters !
d
=11:3rad#2Fs and a
d
=0:1.
#28a#29 !
B
=25rad#2Fs; #28b#29 !
B
=6:28 rad#2Fs;
#28c#29 !
B
= 2:51 rad#2Fs and the regulator
compensated for a delayof1:7h.
c#0D K,J,#C5str#F6m and B,Wittenmark 3
Controller Windup
What is it?
#0F The feedback loop is broken
#0F Trouble if there are unstable systems in
the loop
How to avoid it?
(b)
(a)
Estimator Actuator Process
State
feedback
x y
u
Estimator Actuator Process
State
feedback
x
y
u u
a
Notice
#0F Level saturation
#0F Rate saturation
#0F Other nonlinearities
#0F Even worse for adaptive systems,Why?
PolynomialControllers
Let the controller be
R#28q#29u#28t#29=T#28q#29u
c
#28t#29,S#28q#29y#28t
Introduce the observer dynamics explicitely
A
o
#28q#29u#28t#29=T#28q#29u
c
#28t#29,S#28q#29y#28t#29+#28A
o
#28q#29,R#28q#29#29u#28t#29
Let the saturating actuator be described by the
function f the controller with anti-windup then
becomes
A
o
#28q#29v#28t#29=T#28q#29u
c
#28t#29,S#28q#29y#28t#29+#28A
o
#28q#29,R#28q#29#29u#28t#29
u#28t#29=f#28v#28t#29#29
An Example
Process model G#28s#29=
1
s#28s+1#29
0 2040608010
1
0
1
2
0 2040608010
50
0
50
Time
Time
u
c
y
u
0 2040608010
1
0
1
0 2040608010
0.5
0.0
0.5
Time
Time
u
c
y
u
Singularitiesin Diophantine
equation
c#0D K,J,#C5str#F6m and B,Wittenmark 4
Singularitiesin Diophantine
equation
Estimation Issues
Theme,Use only relevant data,treat it carefully
and do not throwaway good information
#0F Model structure
#0F Data #0Clters and excitation
#0F Parameter tracking
#7B Exponential forgetting
#7B Covariance resetting
#7B Parallel estimators
#0F Estimator windup
#7B Conditional updating
#7B Constant-trace algorithms
#7B Directional forgetting
#7B Leakage
#0F Robust estimation
Model Structure
What happens when loworder models are
#0Ctted to data generated by a complex system?
#0F Perfect #0Ct often possible if excitation is
poor,for example steps and sinusoids
#0F BUT models are strange
#0F Bad #0Ct with good excitation,Parameters
will change substantially.
Example
Let the model be G#28s#29=
b
s+a
and let the input
be sinusoidal.
a =,
!
o
#3CfG#28i!
o
#29g
=fG#28i!
o
#29g
b =,
!
o
jG#28i!
o
#29j
2
=fG#28i!
o
#29g
A good model structure
H#28z#29=
b
0
z
2
+b
1
z+b
2
z
d
#28z
2
+a
1
z+a
2
Data Filters and Excitation
Model
y#28t#29=G
0
#28q#29u#28t#29+v#28t#29
where v is a disturbance,Filter data by
y
f
#28t#29=H
f
#28q#29y#28t#29
u
f
#28t#29=H
f
#28q#29u#28t
So that v
f
#28t#29=H
f
#28q#29v#28t#29is small,This gives
the model
y
f
#28t#29=G
0
#28q#29u
f
#28t#29+v
f
#28t#29
Typical #0Clter
rad/s
H
f
w
fh
w
fl
c#0D K,J,#C5str#F6m and B,Wittenmark 5
Parameter Tracking
How to discard old data?
#0F Conditional updating
#7B Support from theory
#7B Monitor excitation.
#7B Add perturbation signals or switch o#0B
estimation if excitation is poor
#7B A poorly tuned controller also gener-
ates perturbation
#7B Filtering may be useful
#0F Exponential forgetting
#0F Constant-trace algorithms
#0F Directional forgetting
#0F Leakage
#7B Force paraqmeters towards prior values
ExponentialForgetting
Lossfunction
V =
t
X
1
#15
t,k
e
2
#28k#29
Estimator equations
^
#12#28t#29=
^
#12#28t,1#29 + K#28t#29
#10
y#28t#29,'
T
#28t#29
^
#12#28t,1#29
#11
K#28t#29=P#28t,1#29'#28t#29
,
#15 + '
T
#28t#29P#28t,1#29'#28t#29
#01
,1
P#28t#29=
1
#15
,
I,K#28t#29'
T
#28t#29
#01
P#28t,1#29
The forgetting factor is given by
#15 = e
,h=T
f
We have
T
f
=h 5 10 20 50 100
#15 0.82 0.9 0.95 0.98 0.99
An Example
Consider the process
dy
dt
=,y#28t#29+K
p
#28t#29u
Estimated model
y#28kh + h#29+ay#28kh#29=bu#28kh#29
Design a controller with integral action and
A
m
#28q#29=q+a
m
=q,e
,h=T
m
A
o
#28q#29=q+a
o
=q,e
,h=T
o
Controller structure
u#28kh#29=t
0
u
c
#28kh#29+t
1
u
c
#28kh,h#29
,s
0
y#28kh#29,s
1
y#28kh,h#29+u#28kh,h#29
Controller parameters
t
0
=
1+a
m
b
t
1
=a
o
t
0
s
0
=
1+a
o
+a
m
,a
b
s
1
=
a
o
a
m
+a
b
Estimate parameter b only
Simulation
Forgetting factor #15 =0:95
0 200 400 600 800 1000
1
1
0 200 400 600 800 1000
10
10
0 200 400 600 800 1000
0
1
2
Time
Time
Time
u
c
y
u
b
^
b
#28a#29 #15 =0:1; #28b#29 #15 =0:7; #28c#29 #15 =0:95
0 200 400 600 800 1000
0.4
0.0
0.4
0 200 400 600 800 1000
0.4
0.0
0.4
0 200 400 600 800 1000
0.4
0.0
0.4
Time
Time
Time
#28a#29
#28b#29
#28c#29
~
b
~
b
~
b
c#0D K,J,#C5str#F6m and B,Wittenmark 6
Covariance Resetting
Exponential forgetting #15 =0:95
0 200 400 600 800 1000
1
1
0 200 400 600 800 1000
10
10
0 200 400 600 800 1000
0
1
2
Time
Time
Time
u
c
y
u
b
^
b
Covariance resetting
0 200 400 600 800 1000
1
1
0 200 400 600 800 1000
10
10
0 200 400 600 800 1000
0
1
2
Time
Time
Time
u
c
y
u
b
^
b
Estimator Windup
What is it?
^
#12#28t#29=
^
#12#28t,1#29 + K#28t#29
#10
y#28t#29,'
T
#28t#29
^
#12#28t,1#29
#11
K#28t#29=P#28t,1#29'#28t#29
,
#15 + '
T
#28t#29P#28t,1#29'#28t#29
#01
,1
P#28t#29=
1
#15
,
I,K#28t#29'
T
#28t#29
#01
P#28t,1#29
Notice that if P#28t,1#29' =0we get
^
#12#28t#29
^
#12#28t,1#29
P#28t#29=
1
#15
P#28t,1#29
Exponential instability!!
An Example
Process
G#28s#29=
#0B
s+#0C
Estimate parameters in
y#28kh + h#29+ay#28kh#29=bu#28kh#29 #281#29
#28a#29 #28a#29 output y and setpoint u
c; #28b#29 covari-
ance p
11; #28c#29 control signal u; and #28d#29 estima-
tor gain k
1
0 50 100 150
1
0
1
0 50 100 150
1
0
1
0 50 100 150
0
20
40
0 50 100 150
2
1
0
1
Time Time
Time Time
#28a#29
u
c
y
#28b#29
p
11
#28c#29
u
#28d#29
k
1
Parameter Estimates
0 50 100 150
1
0
1
0 50 100 150
0
1
Time
Time
^
b
^a
^
k
c#0D K,J,#C5str#F6m and B,Wittenmark 7
ConditionalUpdating
Update when '#28t#29
T
P#28t#29'#28t#29 #3E 2#281,#15#29
0 50 100 150
1
0
1
0 50 100 150
1
0
1
0 50 100 150
0
20
40
0 50 100 150
2
1
0
1
Time Time
Time Time
#28a#29
u
c
y
#28b#29
p
11
#28c#29
u
#28d#29
k
1
0 50 100 150
1
0
1
0 50 100 150
1
0
1
0 50 100 150
0
2
4
0 50 100 150
1
0.5
0
0.5
Time Time
Time Time
#28a#29
u
c
y
#28b#29
p
11
#28c#29
u
#28d#29
k
1
RegularizedConstant Trace
Algorithm
^
#12#28t#29=
^
#12#28t,1#29 + K#28t#29
#10
y#28t#29,'
T
#28t#29
^
#12#28t,1#29
#11
K#28t#29=P#28t,1#29'#28t#29
,
#15 + '#28t#29
T
P#28t,1#29'#28t#29
#01
,1
#16
P#28t#29=
1
#15
#12
#16
P#28t,1#29,
P#28t,1#29'#28t#29'
T
#28t#29P#28t,1#29
1+'#28t#29
T
P#28t,1#29'#28t#29
#13
P#28t#29=c
1
#16
P#28t#29
tr
,
#16
P#28t#29
#01 + c
2
I
Typical values
c
1
=c
2
#19 10
4
'
T
'#01c
1
#1D 1
Directional Forgetting
Key idea,Forget only in the direction where
there is useful information
Start with
P
,1
#28t +1#29=P
,1
#28t#29+'#28t#29'
T
#28t#29
Decompose P as
P
,1
#28t +1#29=P
,1
#28t#29+'#28t#29'
T
#28t#29
where
~
P
,1
#28t#29'#28t#29=0,Hence
#0D#28t#29=
'
T
#28t#29P
,1
#28t#29'#28t#29
#28'
T
#28t#29'#28t#29#29
2
Apply exponential forgetting only to the second
term
P
,1
#28t +1#29=
~
P
,1
#28t#29+#15#0D#28t#29'#28t#29'
T
#28t#29+'#28t#29'
T
#28t
The RHS can be writeen as
P
,1
#28t#29+
#12
1+#28#15,1#29
'
T
#28t#29P
,1
#28t#29'#28t#29
#28'
T
#28t#29'#28t#29#29
2
#13
'#28t#29'
T
#28t#29
Use of Prior Knowledge#7B Leakage
Modify equations to
^
#12#28t#29=
^
#12#28t,1#29 + K#28t#29
#10
y#28t#29,'
T
#28t#29
^
#12#28t,1#29
#11
+ K
a
#28#12
0
,
^
#12#28t,
K#28t#29=P#28t,1#29'#28t#29
,
#15 + '
T
#28t#29P#28t,1#29'#28t#29
#01
,1
P#28t#29=
1
#15
,
I,K#28t#29'
T
#28t#29
#01
P#28t,1#29
where #12
0
isaprior estimate
#12#28t +1#29=:::#5B #5D+K#5B#12
0
,#12#28t#29#5D
Interpretation!
c#0D K,J,#C5str#F6m and B,Wittenmark
Robust Estimation
A di#0Eculty with least squares:
#0F A single large error has large impact
Robust statistics #28Huber#29
Apply to recursive least squares
^
#12#28t#29=
^
#12#28t,1#29 + P#28t#29'#28t,1#29f #28"#28t#29#29
where
f#28"#29=
"
1+aj"j
Numerics
The normal equations
#10
X
'#28k#29'
T
#28k#29
#11
#12 =
X
'#28k#29y#28k#29 #282#29
Numerical conditioning
Square root algorithms #28Section 11.6#29
Particularly important for high signal-to-noise
ratios
Interaction of Control and
Estimation
#0F Integral action
#0F Speci#0Ccations
#0F Compatible criteria for control and
estimation
Integral Action
Many adaptive control algorithms give zero
steady state error even if the basic controller
does not have integral action.
Example,The direct self-tuner
y#28t + d#29=R
#03
#28q
,1
#29u#28t#29+S
#03
#28q
,1
#29y#28t
Properties
^r
y
#28#1C#29=0 #1C=d;:::;d+l
^r
yu
#28#1C#29=0 #1C=d;:::;d+k
We thus have three ways to obtain integral
action
#0F let the adaptive algorithm handle it
automatically
#0F Estimate the disturbance explicitely
A#28q#29y#28t#29=B#28q#29u#28t#29+v
#0F Use a controller with integral action and
#0Clter the signals to the estimator
c#0D K,J,#C5str#F6m and B,Wittenmark 9
An Example An Example
E#0Bect of Speci#0Ccations
CompatibleCriteria for Estimation
and Control
Process,Ay#28t#29=Bu#28t#29
Controller,Ru#28t#29=Tu
c
#28t#29,Sy#28t#29
Closed loop system
y
0
#28t#29=
P
0
T
R+P
0
S
u
c
#28t#29 u#28t#29=
T
R+P
0
u
c
#28t#29
Control performance error
e
cp
=
#10
P
0
T
R + P
0
S
,
PT
R+PS
#11
u
c
=
RT#28P
0
,P#29
#28R + P
0
S#29#28R + PS#29
u
c
=
R
R+PS
#28Ay
0
,Bu
0
#29
But
R
R + PS
=
R
A
o
A
m
Least squares error
e = H
f
#28Ay
0
,Bu
0
#29
Choose #0Clter as
H
f
=
R
A
o
A
m
c#0D K,J,#C5str#F6m and B,Wittenmark 10
Operational Issues
#0F Human-machine interface
#0F Operational modes
#7B Manual-Automatic
#7B Initialize
#7B Estimate
#7B Adapt
#0F Supervision
#7B Estimation
#7B Control design
Initialization
Prior information required
#0F Sampling period
#0F Speci#0Ccations
Relay#7Bautotuning
u y
S G(s)
u
c
- 1
+d
- d
0510
1
0
1
Time
y
u
Gives sampling period and initial estimates of
closed loop time scales
Summary
Process parameters
Design
Estima-
tion
y
Controller Process A-DD-A
u
u
c
H
f
H
f
G
pf
(s)
G
aa
(s)
parameters
Controller
#0F Controller Implementation
#7B Anti-aliasing #0Clters
#7B Post sampling #0Clter
#0F Parameter Estimation
#7B Estimation #0Clters
#0F Interaction Controller Estimator
#0F Operational issues
#7B Initialization
#7B Multi-mode operation
#7B Supervision
c#0D K,J,#C5str#F6m and B,Wittenmark 11