Lecture 4
Deterministic STR Part 2
Theme:Add practically useful features
1,Review of Indirect STR
2,Disturbances with known properties
3,The Direct Self-tuner
4,Continuous time STR
5,Coding and implementation
6,Conclusions
The Indirect STR
Process parameters
Controller
design
Estimation
Controller
Process
Controller
parameters
Reference
Input Output
Specification
Self-tuning regulator
The separation principle
#0F Estimate parameters
#0F Design controller as if the estimates
were correct,#28The Certainty Equivalence
Principle#29
#0F Direct and indirect controllers
Designing the Controller
Process Ay = Bu and controller Ru =
Tu
c
,Sy
Closed loop response
y#28t#29=
BT
AR+ BS
u
c
#28t#29
Desired response
y
m
#28t#29=
A
m
B
m
u
c
#28t#29
Perfect model following
BT
AR+BS
=
BT
A
c
=
B
m
A
m
Factore B-polynomial B = B
+
B
,
B
m
= B
,
B
0
m
A
c
= A
o
A
m
B
+
R = R
0
B
+
#281#29
Hence
AR
0
+B
,
S = A
o
A
m
= A
0
c
T = A
o
B
0
m
Cancellation of Process Zeros
0 2040608010
1
0
1
0 2040608010
4
2
0
2
Time
Time
u
c
y
u
0 5 10 15 20
2
1
0
0 5 10 15 20
0.0
0.1
0.2
Time
Time
^a
2
^a
1
^
b
1
^
b
0
c#0D K,J,#C5str#F6m and B,Wittenmark 1
No Process Zeros Canceled
0 2040608010
1
0
1
0 2040608010
4
2
0
2
Time
Time
u
c
y
u
0 100 200 300 400 500
2
1
0
0 100 200 300 400 500
0.0
0.1
0.2
Time
Time
^a
2
^a
1
^
b
1
^
b
0
Load Disturbances
Controller
u
Process
y
B
A
u
c
Ru = Tu
c
- Sy
v
S
#0F What happens with disturbances?
#0F Can we understand what happens?
#0F How to modify the system
Simulation Compare Exampel 3.5
0 2040608010
1
0
1
0 2040608010
4
2
0
2
Time
Time
u
c
y
u
0 2040608010
2
1
0
0 2040608010
0.0
0.1
0.2
Time
Time
^a
2
^a
1
^
b
1
^
b
0
Explain what happens
#0F What happens to estimator?
Process model
Ay = Bu
Actual Process
Ay = Bu+Bv
#0F Structure of the control law
u#28t#29+r
1
u#28t,1#29 = t
o
u
c
,s
0
y#28t#29,s
1
y#28t,1#29
No integral action
#0F Notice what the adaptive controller does!
#7B Parameters do not settle
#7B No steady state error if setpoint
constant
c#0D K,J,#C5str#F6m and B,Wittenmark 2
How to Deal with Disturbances
#0F Characterize disturbances as #0Clters driven
by
#7B An impulse #28pulse#29
#7B Sequences of impulses #28pulses#29
#7B White noise
The only thing that matters is the poles
of the #0Clter! Think about this as the
disturbance annihilator which wipes out
as much as possible of the disturbance!
A
d
v = e
#0F How will the disturbance in#0Duence the
system?
#0F How should the control system be modi-
#0Ced?
#0F The Internal Model Principle
Modi#0Ced Control Design
Process model
Ay = B#28u +v#29
Disturbance model
A
d
v = e
Hence
y =
BT
AR+ BS
u
c
+
BR
A
d
#28AR+ BS#29
e
u=
AT
AR+ BS
u
c
,
BS
A
d
#28AR+ BS#29
e
The e#0Bect of the disturbances can be reduced
by requiring that A
d
is a factorofR!!
The controller should contain a model of the
disturbances #28Internal Model Principle#29
Details
Find a controller which gives a speci#0Ced closed
loop characteristic polynomial such that A
d
is
a factorofR
Let R
0
and S
0
be a solution to
AR
0
+BS
0
= A
0
c
Polynomials
R = XR
0
+YB
S=XS
0
,YA
then satis#0Ces
AR+ BS = XA
0
c
Determine R
0
,S
0
to give A
0
c
as before,Choose
a stable polynomial X with degX = degA
d
which represents the additional dynamics
required to deal with disturbances,Determine
R
0
and X so that
R = A
d
R
0
= XR
0
+YB
Example Integral action
Step disturbance
A
d
= q,1
Same A
d
for any piece-wise constant signal
Choose X = q + x
0
,Then
#28q,1#29R
0
=#28q+x
0
#29R
0
+y
0
B
Hence
y
0
=,
#281 + x
0
#29R
0
#281#29
B#281#29
The new controller is given by
R =#28q+x
0
#29R
0
+y
0
B
S=#28q+x
0
#29S
0
,y
0
A
c#0D K,J,#C5str#F6m and B,Wittenmark 3
Modi#0Ccation of Estimator
Process model
Ay = B#28u +v#29
Disturbance model
A
d
v = e
Notice e small,Hence
A
d
Ay = BA
d
u+BA
d
v = BA
d
u+Be
Introduce the #0Cltered signals
y
f
= A
d
y
u
f
= A,du
Then
Ay
f
= Bu
f
+Be
Example 3.10
Process model
G#28s#29=
1
s#28s+1#29
Disturbance step i.e,A
d
= q,1
Nominal controller
R
0
= q + r
1
S
0
= s
0
q + s
1
Modi#0Ced controller A
d
= q,1,X = q
R = q#28q +r
1
#29+y
0
#28b
0
+b
1
#29=#28q,1#29#28q,b
1
y
0
#29
S = q#28s
0
q + s
1
#29,y
0
#28q
2
+a
1
q +a
2
#29
Estimator
u
f
=
q,1
q
2
+a
1
q + a
2
u
y
f
=
q,1
q
2
+a
1
q + a
2
y
Estimation model
y
f
#28t#29+a
1
y
f
#28t,1#29 +a
2
y
f
#28t,2#29 #282#29
= b
0
u
f
#28t,1#29 + b
1
u
f
#28t,2#29 #283#29
Simulation
0 2040608010
1
0
1
0 2040608010
4
2
0
2
Time
Time
u
c
y
u
0 2040608010
2
1
0
0 2040608010
0.0
0.1
0.2
Time
Time
^a
2
^a
1
^
b
1
^
b
0
Direct STR
#0F Why?
#7B Avoid design calculation
#7B Comparisons with other algorithms
#0F The Idea
#0F Minimum-phase Systems
#0F Examples
#0F Feedforward Control
#0F Non-minimum Phase Systems
c#0D K,J,#C5str#F6m and B,Wittenmark 4
The Idea
Process model
Ay#28t#29=Bu#28t#29
Desired response
A
m
y
m
#28t#29=B
m
u
c
#28t#29
Diophantine equation
A
o
A
m
= AR
0
+ B
,
S
let this operate on y#28t#29!
A
o
A
m
y#28t#29=R
0
Ay#28t#29+B
,
Sy#28t#29
= R
0
Bu#28t#29+B
,
Sy#28t#29
But Hence
A
o
A
m
y#28t#29=B
,
#28Ru#28t#29+Sy#28t#29#29 #284#29
Estimate parameters in this equation instead.
Minimum Phase Systems
Consider the equation
A
o
A
m
y#28t#29=B
,
#28Ru#28t#29+Sy#28t#29#29
Minimum phase system #28B
,
= b
0
#29!!
A
m
A
o
y#28t#29=b
0
#28Ru#28t#29+Sy#28t#29#29 =
~
Ru#28t#29+
~
Sy#28t#29
Natural to choose
B
m
= q
d
0
A
m
#281#29
Introduce parameter vector
#12 =#28r
0
::,r
`
s
0
::,s
`
#29
and regression vector
'#28t#29=#28u#28t#29,:,u#28t,`#29 y#28t#29,:,y#28t,`#29#29
Hence
#11#28t#29=A
#03
o
,
q
,1
#01
A
#03
m
,
q
,1
#01
y#28t#29='
T
#28t,d
0
#29#12
An Alternative
As before
A
m
A
o
y#28t#29=b
0
#28Ru#28t#29+Sy#28t#29#29 =
~
Ru#28t#29+
~
Sy#28t#29
Filter signals so that we can take derivatives
u
f
#28t#29=
1
A
#03
o
#28q
,1
#29A
#03
m
#28q
,1
#29
u#28t#29
y
f
#28t#29=
1
A
#03
o
#28q
,1
#29A
#03
m
#28q
,1
#29
y#28t#29
Introduce parameter vector
#12 =#28r
0
::,r
`
s
0
::,s
`
#29
and regression vector
'#28t#29=#28u
f
#28t#29,:,u
f
#28t,`#29 y
f
#28t#29,:,y
f
#28t,`#29#29
The model then becomes
y#28t#29=
1
A
o
A
m
#28Ru#28t#29+Sy#28t#29#29
= R
#03
u
f
#28t,d
0
#29+S
#03
y
f
#28t,d
0
#29= '
T
#28t,d
0
#29#12
A standard regression model!!
An direct STR
1,Data,Polynomials A
m
,B
m
,and A
o
and
relative degree d
0
#28degA
o
= d
0
,1#29
2,Estimate the coe#0Ecients of the polynomi-
als R and S in
y#28t#29=R
#03
u
f
#28t,d
0
#29+S
#03
y
f
#28t,d
0
#29
by recursive least squares.
3,Compute the control signal from
R
#03
u#28t#29=T
#03
u
c
#28t#29,S
#03
y#28t#29
where
T
#03
= A
#03
o
A
m
#281#29
4,Repeat Steps 2 and 3 at each sampling
period.
c#0D K,J,#C5str#F6m and B,Wittenmark 5
Example 3.7
G#28s#29=
1
s#28s+1#29
With degA
m
=2and d
0
=1we have
degA
0
= d
0
,1=0.
Filtering
u
f
#28t#29+a
m1
u
f
#28t,1#29 +a
m1
u
f
#28t,2#29 = u#28t#29 #285#29
y
f
#28t#29+a
m1
y
f
#28t,1#29 +a
m1
y
f
#28t,2#29 = y#28t#29 #286#29
Regression model
y#28t#29=r
0
u
f
#28t,1#29 + r
1
u
f
#28t,2#29
+s
0
y
f
#28t,1#29 + s
1
y
f
#28t,2#29
Control law
^r
0
u#28t#29+^r
1
u#28t,1#29 =
^
t
0
u
c
#28t#29,^s
0
y#28t#29,^s
1
y#28t,1#29
where
T
#03
= A
#03
0
A
#03
m
#281#29 = 1 + a
m1
+ a
m2
Simulation
0 2040608010
1
0
1
0 2040608010
4
2
0
2
Time
Time
u
c
y
u
0 5 10 15 20
4
2
0
2
Time
^
t
0
=^r
0
^s
0
=^r
0 ^r
1
=^r
0
^s
1
=^r
0
What happens with d
0
#3E 1?
Choose d
0
=2and A
0
= q #28dead-beat#29
0 2040608010
1
0
1
0 2040608010
4
2
0
2
Time
Time
u
c
y
u
0 5 10 15 20
2
1
0
1
2
Time
^
t
0
=^r
0
^s
0
=^r
0
^r
1
=^r
0
^s
1
=^r
0
Continuous Time STR
#0F Estimation
#0F An Algorithm
#0F Examples
c#0D K,J,#C5str#F6m and B,Wittenmark 6
Estimation
Process model #28No disturbances!#29
A#28p#29y#28t#29=B#28p#29u#28t#29
where p = d=dt and
A#28p#29=p
n
+a
1
p
n,1
+#01#01#01+a
n
B#28p#29=b
0
p
n,1
+#01#01#01+b
n
#287#29
Filtered signals
y
f
#28t#29=H
f
y#28t#29 u
f
#28t#29=H
f
u#28t#29
'#28t#29=#28,p
n,1
y
f
#01#01#01,y
f
p
n,1
u
f
#01#01#01u
f
#29
T
#12=#28a
1
#01#01#01a
n
b
1
#01#01#01b
n
#29
T
#288#29
Model for #0Cltered signals
p
n
y
f
#28t#29='
T
#28t#29#12
Recursive least squares with exponential
forgetting
d
^
#12#28t#29
dt
= P#28t#29'#28t#29
#10
p
n
y
f
#28t#29,'
T
#28t#29
^
#12#28t#29
#11
dP#28t#29
dt
= #0BP#28t#29,P#28t#29'#28t#29'
T
#28t#29P#28t#29
Example
Process model
G#28s#29=
b
s#28s+a#29
Regressor #0Clter
H
f
#28s#29=
1
A
m
#28s#29
Desired response
G
m
#28s#29=
!
2
s
2
+2#10!s+!
2
Observer polynomial A
o
#28s#29=s+a
o
Nominal values a =1,b=1,#10=0:7,!=1
and a
o
=2.
Control Design
G#28s#29=
b
s#28s+a#29
Choose
A
o
#28s#29=s+a
o
and
B
m
#28s#29
A
m
#28s#29
=
!
2
s
2
+2#10!s+!
2
Diophantine equation
s#28s + a#29#28s+ r
1
#29+b#28s
0
s+s
1
#29
=#28s
2
+2#10!s+!
2
#29#28s +a
o
#29
Identi#0Ccation of coe#0Ecients of powers of s
a+ r
1
=2#10!+a
o
ar
1
+bs
0
= !
2
+2#10!a
o
bs
1
= !
2
a
o
#289#29
Control Design - Cont.
If b 6=0
r
1
=2#10!+a
o
,a
s
0
=
a
o
2#10!+!
2
,ar
1
b
s
1
=
!
2
a
o
b
#2810#29
c#0D K,J,#C5str#F6m and B,Wittenmark 7
Simulation
0 2040608010
1
0
1
0 2040608010
4
2
0
2
Time
Time
u
c
y
u
0 2040608010
1
2
0 5 10 15 20
0
1
2
Time
Time
^a
^
b
^a
^
b
Prototype algorithm
Skeleton algorithm
1 Analog_Digital_conversion
2 Compute_control_signal
3 Digital_Analog_conversion
4 If estimate then
5 Filter_data
6 Organize_data_for_estimation
7 Parameter_update
8 If tune then
9 th_design:=th_estimate
10 Design_calculations
11 Organize_data
12 Compute_as_much_as_possible_of_
control_signal|
Parameter update
Estimated model
y#28t#29='
T
#28t#29#12
Recursive Least Squares Code
eps = y - phi'*th_estimated
w = P*phi
den = lambda + phi'*w
k = w#2Fden
th_estimated = th_estimated + k*eps
P = #28P - w*w'#2Fden#29#2Flambda
Omola code
new#28w#29:=P*EC.phi;
new#28den#29:=lambda+trans#28new#28w#29#29*EC.phi;
new#28K#29:=new#28w#2Fden#29;
new#28EC.e#29:=EC.val-trans#28EC.phi#29*EC.theta;
new#28EC.theta#29:=EC.theta+new#28K*EC.e#29;
new#28P#29:=#28P-new#28K*trans#28w#29
c#0D K,J,#C5str#F6m and B,Wittenmark 8