solns adaptive control by astrom
TRANSCRIPT
-
8/12/2019 Solns Adaptive Control by Astrom
1/46
-
8/12/2019 Solns Adaptive Control by Astrom
2/46
Preface
This Solution Manual contains solutions to selected problems in the secondedition of Adaptive Control published by Addison-Wesley 1995, ISBN 0-201-55866-1.
-
8/12/2019 Solns Adaptive Control by Astrom
3/46
PROBLEM SOLUTIONS
SOLUTIONS TO CHAPTER 1
1.5 Linearization of the valve shows thatv = 4v30u
The loop transfer function is then
G0( s) GPI( s)4v30
where GPIis the transfer function of a PI controller i.e.
GPI(s) = K
1 +
1sTi
The characteristic equation for the closed loop system is
sTi( s + 1)3+ K 4v
30(sTi +1) = 0
with K = 0.15 and Ti = 1 we get
( s + 1)
s(s + 1)2 +0.6v30 = 0
( s + 1)( s3 +2s2 + s +0.6v30) = 0
The root locus of this equation with respect to vo is sketched in Fig. 1.According to the Routh Hurwitz criterion the critical case is
0.6v30 = 2 v0 = 3
103 = 1.49
Since the plant G0 has unit static gain and the controller has integral
action the steady-state output is equal to v0 and the set point yr. Theclosed-loop system is stable for yr = uc = 0.3 and 1.1 but unstable foryr = uc = 5.1. Compare with Fig. 1.9.
1
-
8/12/2019 Solns Adaptive Control by Astrom
4/46
2 Problem Solutions
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Real Axis
ImagAxis
Figure 1. Root locus in Problem 1.5.
1.6 Tune the controller using the Ziegler-Nichols closed-loop method. Thefrequencyu, where the process has 180 phase lag is first determined.The controller parameters are then given by Table 8.2 on page 382 where
Ku =1
G0(iu)
we have
G0( s) =e s/ q
1 + s/ q
arg G0( i) =
q arctan
q =
q G0(i) K Ti
0.5 1.0 0.45 1 5.242.0 0.45 1 2.624.1 0.45 1 1.3
A simulation of the system obtained when the controller is tuned for thesmallest flow q = 0.5 is shown Fig. 2. The Ziegler-Nichols method is notthe best tuning method in this case. In the Fig. 3 we show results for
-
8/12/2019 Solns Adaptive Control by Astrom
5/46
Solutions to Chapter 1 3
0 10 20 30 40
0
1
2
Process output
0 10 20 30 40
0
1
2
Control signal
Figure 2. Simulation in Problem 1.6. Process output and control signalare shown for q = 0.5 (full), q = 1 (dashed), and q = 2 (dotted). Thecontroller is designed for q = 0.5.
controller designed for q = 1 and in Fig. 4when the controller is designedforq = 2.
1.7 Introducing the feedbacku = k2y2
the system becomes
dx
dt =
1 0 0
0 3 0
0 0 1
x k2
0
2
1
1 0 1x +
1
0
0
u1y1 =
1 1 0xThe transfer function from u1to y1is
G( s) =
1 1 0
s +1 0 0
2k2 s +3 2k2k2 0 s +1 + k2
1
1
0
0
=s2 +( 4 k2) s + 3 + k2
( s + 1)( s+ 3)(s+ 1 + k2)
-
8/12/2019 Solns Adaptive Control by Astrom
6/46
4 Problem Solutions
0 10 20 30 40
0
1
2
Process output
0 10 20 30 40
0
1
2
Control signal
Figure 3. Simulation in Problem 1.6. Process output and control signalare shown for q = 0.5 (full), q = 1 (dashed), and q = 2 (dotted). Thecontroller is designed for q = 1.
The static gain is
G(0) =3 + k2
3(1 + k2)
-
8/12/2019 Solns Adaptive Control by Astrom
7/46
Solutions to Chapter 1 5
0 10 20 30 40
0
1
2
Process output
0 10 20 30 40
0
1
2
Control signal
Figure 4. Simulation in Problem 1.6. Process output and control signalare shown for q = 0.5 (full), q = 1 (dashed), and q = 2 (dotted). Thecontroller is designed for q = 2.
-
8/12/2019 Solns Adaptive Control by Astrom
8/46
6 Problem Solutions
SOLUTIONS TO CHAPTER 2
2.1 The function Vcan be written as
V(x1 xm) =
n
i,j =1 x
ixj ( aij + aji )/
2 +
n
i=1 b
ixi + c
Taking derivative with respect to xi we get
V
xi=
nj =1
( aij + aji )xj + bi
In vector notation this can be written as
gradxV(x) = (A + AT)x+ b
2.2 The model is
yt = Tt + e t =ut ut
1 b0
b1
+ etThe least squares estimate is given as the solution of the normal equation
= (T) 1TY =
u2t utut 1utut
1
u2t 1
1 utytut
1yt
(a) Input is a unit step
ut =
1 t 0
0 otherwise
Evaluating the sums we get
=
N N 1N 1 N 1
1
N1
yt
N2
yt
=
1 1 1
N
N 1
N1
yt
N2
yt
=
y1
1N 1
N2
yt y1
The estimation error is
=
e1
1N 1
N2
et e1
-
8/12/2019 Solns Adaptive Control by Astrom
9/46
Solutions to Chapter 2 7
Hence
E( )( ) T = (T) 1 1 =
1 1
1 N
N 1
1 1
1 1
when N . Notice that the variance of the estimates do not go tozero as N . Consider, however, the estimate ofb0 + b1.
E( b0 + b1 b0 b1) = 1 1
1 1 1
N
N 1
1
1
= 1N 1
With a step input it is thus possible to determine the combinationb0 +b1consistently. The individual values ofb0and b1can, however,not be determined consistently.
(b) Input uis white noise with Eu2 = 1 and u is independent ofe.
Eu2t = 1 Eutut 1 = 0
cov( ) = 1 E(T) 1 =
N 00 N 1
1 =
1N
0
0 1N 1
In this case it is thus possible to determine both parameters consis-tently.
2.3 Data generating process:
y( t) = b0u( t) + b1u( t 1) + e(t) = T( t)0 + e( t)
whereT( t) = u( t), 0 = b0
ande(t) = b1u(t 1) + e(t)
Model:y(t) = bu( t)
ory( t) = bu(t) +( t) = T(t) + ( t)
where(t) = y( t) y( t)
The least squares estimate is given by
T( 0) = TEd Ed =
e(1)
...
e(N)
-
8/12/2019 Solns Adaptive Control by Astrom
10/46
8 Problem Solutions
1N
T =
1N
N1
u2( t) Eu2 N
1
N
TEd =
1
N
N
1 u( t)e(t) =1
N
N
1 u(t) (b1u( t 1) + e( t)) b1E (u( t)u( t 1)) + E (u( t)e(t)) N
(a)
u(t) =
1 t 1
0 t < 1
E(u2) = 1 E (u( t)u( t 1)) = 1 Eu(t)e( t) = 0
Henceb = 0 + b1 = b0 + b1 N
i.e. bconverges to the stationary gain
(b)u(t) N(0,) Eu2 = 2 Eu(t)u( t 1) = 0 Eu(t)e( t) = 0
Henceb b0 N
2.6 The model is
yt = Tt + t =
yt
1 ut 1
Tt
ab
+
et + ce t 1
t
The least squares estimate is given by the solution to the normal equation
(2.5). The estimation error is = (T) 1T =
y2t
1
yt 1ut 1
yt
1ut
1
u2t
1
1
yt
1et c
yt 1et 1
ut 1et + c
ut
1et
1
Notice that T and are not independent. utand e tare independent, ytdepends on et, et
1, et
2, . . .and yt depends on ut
1,ut
2, . . ..
Taking mean values we get
E( ) = E(T) 1E(T)
To evaluate this expression we calculate
E
y2t 1
yt
1ut 1
yt
1ut 1
u2t 1
= N Ey2t 0
0 Eu2t
-
8/12/2019 Solns Adaptive Control by Astrom
11/46
-
8/12/2019 Solns Adaptive Control by Astrom
12/46
-
8/12/2019 Solns Adaptive Control by Astrom
13/46
Solutions to Chapter 2 11
Estimator
b
1
q + a
Kuc = 0 u
y
d
y
1
Figure 5. The system redrawn.
(b) Similarly to ( a), we get
1N
Nk=1
u( k
1)2 11
N
Nk=1
u( k
1) y(k)
(u2( k 1))0
1
(u( k 1)y( k))0, as N
where ()0denote the stationary value of the argument. We haveu2( k 1)
0 = (( u( k))0)
2
(u( k 1)y( k))0 = (u( k))0b (( u( k)0+ d0)
(u( k))0 = Hud (1) d0 = K b
1 + a + K bd0
and the asymptotic LS estimate becomes
b =
(u2( k 1))0
1
(u( k 1)y( k))0 = b
1 +d0
(u( k)) 0
= b
1
1 + a + K bK b
=
1 + aK
How do we interpret this result? The system may be redrawn as inFigure 5. Since Uc = 0, we have that u = Kq+a y, and we can regard
Kq+a
as the controller for the system in Figure 5. It is then obviousthat we have estimated the negative inverse of the static controllergain.
(c) Introduction of high pass regressor filters as in Figure 6 eliminates or
at least reduces the influence from the disturbance don the estimateofb. One choice of regressor filter could be Hf(q 1) = 1 q 1, i.e. adifferentiator. Another possibility would be to introduce a constant in
-
8/12/2019 Solns Adaptive Control by Astrom
14/46
12 Problem Solutions
Estimator
K
uc
u y
d
bq + a
Hf Hf
1
Figure 6. Introduction of regressor filters.
the regressor and then estimate both b and bd. The regression modelis in this case
y( t)
= u( t 1) 1b
bd = (t) T2.18 The equations for recursive least squares are
y( t) = T(t 1)0
( t) = ( t 1) + K(t)( t)
( t) = y( t) T( t 1)(t 1)
K( t) = P( t)(t 1)
=P( t 1)( t 1)
+ T(t 1)P( t 1)( t 1)
P( t) = I K( t)T( t 1)P( t 1) /
Since the quantity P( t)( t 1) appears in many places it is convenientto introduce it as an auxiliary variable w = P. The following computercode is then obtained:
Input u,y: realParameter lambda: realState phi, theta: vector
P: symmetric matrix
Local variables w: vector, den : real"Compute residuale=y-phi^T*theta
"update estimatew=P*phiden=w^T*phi+lambda
-
8/12/2019 Solns Adaptive Control by Astrom
15/46
-
8/12/2019 Solns Adaptive Control by Astrom
16/46
14 Problem Solutions
SOLUTIONS TO CHAPTER 3
3.1 Given the process
H(z) =B(z)
A(z) =
z +1.2
z2 z +0.25Design specification: The closed system should have a pole that corre-spond to following characteristic polynomial in continuous time
s2 +2s + 1 = ( s + 1)2
This corresponds toAm(z) = z
2+ am1z + am2
with am1 = (e
1 + e 1) = 2e 1
am2 = e 2
(a) Determine an indirect STR of minimal order. The controller shouldhave an integrator and the stationary gain should be 1.Solution:Choose Bm such that
Bm(1)Am(1)
= 1
The integrator condition gives
R = R(z 1)
We get the following conditions
B T = BmAo(1)
AR + B S = AmAo(2)
As B is unstable must Bm = B B m. This makes (1) B T =B B mAo T = B
mAo. Choose B
m such that
B(1)B m(1)A(1)
= 1 B m(1) =A(1)B(1)
The simplest way is to choose
B m = bm =
A(1)B(1)
=0.252.2
Further we have
(z2 + a1z + a2)(z 1)(z+ r) +( b0z + b1)(s0z2 + s1z + s2)
= (z2 + am1z + am2)(z2+ ao1z + ao2)
-
8/12/2019 Solns Adaptive Control by Astrom
17/46
Solutions to Chapter 3 15
with a1 = 1, a2 = 0.25 and ao1and ao2chosen so that Ao is stable.Equating coefficients give
r 1 + a1 + b0s0 = ao1 + a m1
r + a1(r 1) + a2 + b0s1 + b1s0 = ao2 + am1ao1 + am2 ar + a2( r 1) + b0s2 + b1s1 = am1ao2 + am2ao1 a2r + b1s2 = am2ao2
or1 b0 0 0
a1 1 b1 b0 0
a2 a1 0 b1 b0 a2 0 0 b1
r
s0
s1
s2
=
ao1 + am1 +1 a1aa2 + am1ao1 + a m2 + a1 a2
am1ao2 + am2ao1 + a2
am2ao2
Now choose to estimate
= b1 b1 a1 a2T
by equation 3.22 in the textbook.
(b) As H(z) is not minimum phase we cancel B = B between R andS. This is difficult, see page 118 in the textbook. An indirect STR is
given by Eq. 3.24.AoAmy = Ru + S y
with R = B R, S = B S, T = B mAo. Furthermore we have
AoAmym = AoBmuc = AoB Bmuc = B Tuc =
Tu c
y = R 1
AoAmu
=uf+S
1AoAm
y
=yfym = T
1AoAm
uc =uc f
= y ym = Ruf + S yf Tuc f
Now estimate R, S and T with a recursive method in the aboveequation. Then cancel B and calculate the control signal.
(c) Take a = 0 in Example 5.7, page 206 in the textbook. This gives
dt0
dt = uce
ds0dt
= ye
with e = y ym = y Gmuc.
-
8/12/2019 Solns Adaptive Control by Astrom
18/46
16 Problem Solutions
3.3 The process has the transfer function
G(s) =b
s + a
q
s + p
wherepand qare known. The desired closed loop system has the transferfunction
Gm( s) =2
s2 +2 s +2
Since a discrete time controller is used the transfer functions are sampled.We get
H(z) =b0z + b1
z2 + a1z + a2
Hm(z) =bm0z + bm1
z2 + am1z + am2
The fact that p and q are known implies that one of the poles of H isknown. This information will be disregarded. In the following we willassume
G( s) =1
s( s+ 1)
Withh = 0.2 this gives
H(z) =0.0187(z+ 0.936)(z 1)(z 0.819)
Furthermore we will assume that = 2 and = 0.7.Indirect STR:The parameters of a general pulse transfer function of second order is
estimated by recursive least squares( See page 51). We have
= bo b1 a1 a2 T
( t) =u(t 1) u( t 2) y( t 1) y( t 2)
The controller is calculated by solving the Diophantine equation. We lookat two cases1.B canceled:
(z2 + a1z + a2)1 + b0( s0z + s1) = z2 + am1z + am2
z1
: a1 + b0s0 = am1 s0 =am1 a1
b0
z0 : a2 + b0s1 = am2 s1 =am2 a2
b0
-
8/12/2019 Solns Adaptive Control by Astrom
19/46
Solutions to Chapter 3 17
The controller is thus given by
R(z) = z + b1 / b0
S(z) = s0z + s1
T(z) = t0z where t0 =1 + am1 + am2
b0
2. B not canceled:The design equation becomes
(z2 + a1z + a2)(z+ r1) +( b0z + b1)( s0z + s1) = (z2+ am1z + am2)(z + ao1)
Identification of coefficients of equal powers ofzgives
z2 : a1 + r1 + b0s0 = am1 + ao1
z1 : a2 + a1r1 + b1s0 + b0s1 = am1ao1 + am2
z0 : a2r1 + b1s1 = am2ao1
The solution to these linear equations is
r1 =b21n1 b0b1n2 + ao1am2b20
b20a2 a1b0b1 + b21
s0 =n1 r1
b0
s1 =b0n2 b1n1 r1( a1b0 b1)
b20
wheren1 = a1 am1 ao1
n2 = am1ao1 + am2 a2
The solution exists if the denominator of r1 is different from zero, whichmeans that there is no pole-zero cancellation. It is helpful to have access
to computer algebra for this problems e.g. Macsyma, Maple or Matem-atica! Figure 7 shows a simulation of the controller obtained when thepolynomial B is canceled. Notice the ringing of the control signal whichis typical for cancellation of a poorly damped zero. In this case we havez = 0.936. In Figure 8 we show a simulation of the controller with nocancellation. This is clearly the way to solve the problem.Direct STR:To obtain a direct self-tuning regulator we start with the design equation
AR + B S = AmAoB+
HenceB +AmAoy = ARy + B Sy = B Ru + B Sy
y = R B
AoAmu
uf
+S B
AoAmy
yf
-
8/12/2019 Solns Adaptive Control by Astrom
20/46
-
8/12/2019 Solns Adaptive Control by Astrom
21/46
Solutions to Chapter 3 19
0 10 20 30 40 50
2
1
0
1
2uc y
0 10 20 30 40 50
10
0
10
u
Figure 8. Simulation in Problem 3.3. Process output and control signalare shown for the indirect self-tuning regulator when the process zero isnot canceled.
by RLS. The case r0 = 0 must be taken care of separately. FurthermoreThas the form T( q) = t0qwhere
B T
AR + B S =
B toq
B + bo B Am=
toq
Am
To get unit steady state gain choose
to = Am(1)
A simulation of the system is shown in Fig. 9. We see the typical ringingphenomena obtained with a controller that cancels a poorly damped zero.To avoid this we will develop an algorithm where the process zero is notcanceled.2. No cancellation of process zero:We then haveB + = 1 and B = b0q+b1. From the analysisof the indirectSTR we know that a first order observer is required, i.e. A0 = q+ ao1. Wehave as before
y = R B
AoAmu
uf
+S B
AoAmy
yf
()
-
8/12/2019 Solns Adaptive Control by Astrom
22/46
20 Problem Solutions
0 10 20 30 40 50
2
1
0
1
2uc y
0 10 20 30 40 50
10
0
10
u
Figure 9. Simulation in Problem 3.3. Process output and control signalare shown for the direct self-tuning regulator when the process zero iscanceled.
Since B is not known we can, however, not calculate uf and yf. Onepossibility is to rewrite( *)as
y = R B
R
1AoAm
u
+ S B
S
1AoAm
y
and to estimate R and S as second order polynomials and to cancelthe common factor B from the estimated polynomials. This is difficultbecause there will not be an exact cancellation. Another possibility is touse some estimate of B . A third possibility is to try to estimate B Rand B S as a bilinear problem. In Fig. 811 we show simulation whenthe model (*)is used with
B = 1
B = q
B =q +0.4
1.4
B =q 0.4
0.6
-
8/12/2019 Solns Adaptive Control by Astrom
23/46
Solutions to Chapter 3 21
0 10 20 30 40 50
2
1
0
1
2uc y
0 10 20 30 40 50
10
0
10u
Figure 10. Simulation in Problem 3.3. Process output and control signalare shown for the direct self-tuning regulator when the process zero is notcanceled and when B = 1.
3.4 The process has the transfer function
G( s) =b
s( s+ 1)
with proportional feedbacku = k(uc y)
we get the closed loop transfer function
Gcl ( s) =kb
s2 + s + k b
The gain k = 1 / bgives the desired result. Idea for STR: Estimate banduse k = 1 / b. To estimate b introduce
s( s + 1)y = bu
s(s + 1)( s + a)2
yf
y = b 1( s + a)2
u
-
8/12/2019 Solns Adaptive Control by Astrom
24/46
22 Problem Solutions
0 10 20 30 40 50
2
1
0
1
2uc y
0 10 20 30 40 50
10
0
10
u
Figure 11. Simulation in Problem 3.3. Process output and control signalare shown for the direct self-tuning regulator when the process zero is notcanceled and when B = q.
The equations on page 56 gives
db
dt = Pe = P(yf b)
dP
dt = P
P T
P = P
P2
2
Withb(0) = 1, P(0) = 100, = 0.1, and a = 1 we get the result shownin Fig. 14.
-
8/12/2019 Solns Adaptive Control by Astrom
25/46
Solutions to Chapter 3 23
0 10 20 30 40 50
2
1
0
1
2uc y
0 10 20 30 40 50
10
0
10
u
Figure 12. Simulation in Problem 3.3. Process output and control signalare shown for the direct self-tuning regulator when the process zero is notcanceled and when B = (q + 0.4) / 1.4.
-
8/12/2019 Solns Adaptive Control by Astrom
26/46
24 Problem Solutions
0 10 20 30 40 50
2
1
0
1
2uc y
0 10 20 30 40 50
10
0
10
u
Figure 13. Simulation in Problem 3.3. Process output and control signalare shown for the direct self-tuning regulator when the process zero is notcanceled and when B = (q 0.4) / 0.6.
-
8/12/2019 Solns Adaptive Control by Astrom
27/46
Solutions to Chapter 3 25
0 5 10 15 202
0
2uc y
0 5 10 15 20
0
5
10u
0 5 10 15 20
0.2
0.6
1b
Figure 14. Simulation in Problem 3.4. Process output, control signaland estimated parameter b are shown for the indirect continuous-timeself-tuning regulator.
-
8/12/2019 Solns Adaptive Control by Astrom
28/46
26 Problem Solutions
SOLUTIONS TO CHAPTER 4
4.1 The estimate bmay be small because of a poor estimate. One possibilityis to use a projection algorithm where the estimate is restricted to be ina given range, bo b b1. This requires prior information about b:svalues. Another possibility is to replace
1
bb y
b
b2 + P
where P is the variance of the estimate. Compare with the discussion ofcautious control on pages 356358.
4.10 Using ( 4.21)the output can be written as
yt+d =R
Cut +
S
Cyt +
R1C
et+do
= rout + ft
()
Consider minimization of
J = y2t+d +u2t ( +)
Introduce the expression ( *)
J = ( rout + ft)2+ u2t
= ( r2o +)u2t +2routft + f
2t
= ( r2o +)
u2t +
2routftr2o +
+ f2t
= ( r
2
o +) ut + roftr2o +2
r2of2t
r2o + + f
2
t
Hence
J =1
r2o +
ft +
r2o +
rout
2+
r2o + f2t
=1
r2o +
ft +
ro +
ro
ut
2+
r2o + f2t
=1
r2o +
yt+d +
rout
2+
r2o + f2t
Since r2o + is a constant we find that minimizing ( +) is the same as tominimize
J1 = yt+d + ro
ut = ft +
ro + ro
ut
-
8/12/2019 Solns Adaptive Control by Astrom
29/46
Solutions to Chapter 5 27
SOLUTIONS TO CHAPTER 5
5.1 The plant is
G( s) =1
s(s + a) =
B
A
The desired response is
Gm( s) =2
s2 +2 s +2 =
Bm
Am
(a) Gradient method or MIT rule. Use formulas similar to (5.9). In thiscase B + = 1 and Ao is of first order. The regulator structure is
R = s + r1 S = s0s + s1 T = t0Ao
This gives the updating rules
dr1
dt = e
1
AoAmu
ds0
dt = e
p
AoAmy
ds1
dt = e
1
AoAmy
dt0
dt = e
1
AoAmuc
(b) Stability theory approach 1. First derive the error equation. If all
process zeros are cancelled we have
AoAmy = AR1y + boSy = B R1u + boSy
= bo(Ru + Sy)Further
AoAmym = AoBmuc = boTuc
HenceAoAme = AoAm(y ym) = bo(Ru + Sy Tuc)
e =b
AoAm(Ru + Sy Tuc)
Since 1 / AoAm is not SPR we introduce a polynomial D such thatD / AoAm is SPR. We then get
e =bD
AoAm Ruf + Syf Tuc fwhere
uf =1
Du yf =
1D
y uc f =1
Du c
-
8/12/2019 Solns Adaptive Control by Astrom
30/46
28 Problem Solutions
(c) Stability theory approach 2. In this case we assume that all statesmeasurable. Process model:
x =
a 0
1 0
Ap
x +
1
0
Bp
y =
0 1 C
x
Control lawu = Lr uc Lx = 3uc 1x1 2x2
The closed loop system is
x = (Ap BpL)x + B Lr uc = Ax + Buc
y = C x
whereA() = Ap BpL =
a 1 21 0
B() = BpLr =
30
The desired response is given by
xm = Amxm + Bmuc
where
Am =
2 2
1 0
Bm =
2
0
We have(A Am)
T=
2 a 1 02 2 0
(B Bm)
T=
3 2 0Introduce the state error
e = x xm
we gete = x xm = Ax + Buc Amxm Bmuc
= Ame + (A Am)x+ (B Bm)uc()
The error goes to zero if Am is stable and
A() Am = 0 ()
-
8/12/2019 Solns Adaptive Control by Astrom
31/46
Solutions to Chapter 5 29
B() Bm = 0 ( +)
It is thus necessary that A() and B() are such that there is a for which ( *)and ( +)hold. Introduce the Lyapunov function
V = eTPe + tr(A Am)TQa(A Am)
+ tr(B Bm)TQb(B Bm)
Notice thattr(A + B) = trA + trB
xTAx = tr(xxTA) = tr(AxxT)
tr(AB ) = tr(B A)
we get
dV
dt = tr
P eeT + Pe eT + ATQa(A Am)
+(A
Am)T
QaA +
B Qb(B
Bm) + (B
Bm)T
Qb B
( +)
But from ( *)
P eeT = P (Ame +(A Am)x +(B Bm)uc)eT
Pe eT = Pe (Ame + (A Am)x+ (B Bm)uc)T
Introducing this into ( +) and collecting terms proportional to (A Am)
T we find that they are
2tr(A Am) T
Qa A + PexT
Similarly we find that terms proportional to (B Bm) are
2tr(B
Bm)TQb B + PeuTc
HencedV
dt =eTPAme + e
TATmPe
+2tr(A Am) T
Qa A + Pe xT
+2tr(B Bm) T
Qb B + PeuTc
Hence if the symmetric matrix P is chosen so that
ATmP + PAm = Q
where Qis positive definite ( can always be done ifAm is stable!)andparameters are updated so that
(A Am)T
Qa A + Pe xT =0
(B Bm)T
Qb B + Peu Tc =0
( +)
-
8/12/2019 Solns Adaptive Control by Astrom
32/46
30 Problem Solutions
we getdV
dt = eTQe
The equations for updating the parameters derived above can now be
used. This gives2 a 1 02
2 0
Qa 1 20 0
+ Pe xT = 03 2 0Qb 30
+ Peu c = 0Hence with Qa = Iand Qb = 1
d1dt
= p11e1x1 + p12e2x1 = (p11e1 + p12e2)x1
d2dt
= p11e1x2 + p12e2x2 = (p11e1 + p12e2)x2
d3
dt = (p11e1 + p12e2)uc
where e1 = x1 xm1 and e2 = x2 xm2. It now remains to determineP such that
ATmP + PAm = Q
Choosing = 0.707, = 2 and
Q =
41.2548 11.313711.3137 16.0000
we get
P = 4 22 16The parameter update laws become
d1dt
= (4e1 +2e2)x1
d2dt
= (4e1 +2e2)x2
d3dt
= (4e1 +2e2)uc
A simulation of the system is given in Fig. 15.
5.2 The block diagram of the system is shown in Fig. 16. The PI version ofthe SPR rule isd
dt = 1
d
dt(uce) 2uce ()
-
8/12/2019 Solns Adaptive Control by Astrom
33/46
Solutions to Chapter 5 31
0 10 20 30 40
2
1
0
1
2States x1 xm1 x2 xm2
0 10 20 30 40
0
0.5
1
Estimated parameters
Figure 15. Simulation in Problem 5.1. Top: Process and modelstates, x1 ( full), xm1 (dashed), x2 (dotted), and xm2 (dash-dotted).Bottom: Controller parameters3( full), 1 (dashed), and 2 ( dot-ted).
u c
ym
e
y
1s
1s
0
Figure 16. Block diagram in Problem 5.2.
To derive the error equation we notice that
dym
dt = 0
uc
dy
dt = uc
-
8/12/2019 Solns Adaptive Control by Astrom
34/46
32 Problem Solutions
Hencede
dt = ( 0)uc
we getd2e
dt2 =d
dt uc +(
0
)duc
dt
Inserting the parameter update law ( *) into this we get
d2e
dt2 = 1
duc
dt e +u c
de
dt
uc 2u
2ce +(
0)duc
dt
Henced2e
dt2 +1u
2c
de
dt +
1uc
duc
dt +2u
2c
e = ( 0)
duc
dt
Assuming that u c is constant we get the following error equation
d2e
dt2 +1u
2
c
de
dt +2u
2
c
e = 0
Assuming that we want this to be a second order system with and we get
1u2c = 2 1 = 2 / u
2c
2u2c =
2 2 = 2
/ u2c
This gives an indication of how the parameters 1 and 2 should beselected. The analysis was based on the assumption that ucwas constant.To get some insight into what happens when uc changes we will givea simulation where uc is a triangular wave with varying period. Theadaptation gains are chosen for different and. Figure 17 shows whathappens when the period of the square wave is 20 and = 0.5, 1 and 2.Corresponding to the periods 12, 6 and 3. Figure 18 show what happenwhen uc is changed more rapidly.
5.6 The transfer function is
G( s) =b0s
2 + b1s + b2
s2 + a1s + a2
The transfer function has no poles and zeros in the right half plane ifa1 0, a2 0, b0 0, b1 0, and b2 0. Consider
G( i) =B( i)
A( i)
A( i)
A( i)
The condition Re G( i) 0 is equivalent to Re (B( i)A( i) ) 0. But
g() = Re
( b02+ ib1 + b2)(
2 ia1 + a2)
= b0
4+ (a1b1 b0a2 b2)
2+ a2b2
-
8/12/2019 Solns Adaptive Control by Astrom
35/46
Solutions to Chapter 5 33
0 5 10 15 20
0
5
10
Process and model output
0 5 10 15 20
0
0.5
1
1.5Estimated parameter
0 5 10 15 20
0
5
10
Process and model output
0 5 10 15 20
0
0.5
1
1.5Estimated parameter
Figure 17. Simulation in Problem 5.2 for a triangular wave of period 20.Left top: Process and model outputs, Left bottom: Estimated parameterwhen = 0.5 (full), 1 (dashed), and 2 (dotted) for = 0.7. Right top:Process and model outputs, Right bottom: Estimated parameter when = 0.4 ( full), 0.7( dashed), and 1.0( dotted) for = 1.
Completing the squares the function can be written as
g() = b0
2 +
a1b1 b0a2 b2
2b0
2+ a2b2
( a1b1 b0a2 b2)2
4b0When b0 = 0 the condition for gto be positive is that
a1b1 b0a2 b2 0 ( i)
Ifb0 > 0 the function g() is nonnegative for all if either ( i) holds orif
a1b1 b0a2 b2 < 0
and
a2b2 > ( a1b1 b0a2 b2)
2
4b0Example 1. Consider
G( s) =s2 +6s + 8s2 +4s + 3
We have a1b1 b0a2 b2 = 24 3 8 = 13 > 0. Hence the transfer
function G( s)is SPR. Example 2.
G( s) =3s2 + s +1s2 +3s + 4
-
8/12/2019 Solns Adaptive Control by Astrom
36/46
34 Problem Solutions
0 5 10 15 20
0
5
10
Process and model output
0 5 10 15 20
0
0.5
1
1.5Estimated parameter
0 5 10 15 20
0
5
10
Process and model output
0 5 10 15 20
0
0.5
1
1.5Estimated parameter
Figure 18. Simulation in Problem 5.2 for a triangular wave of period 5.Left top: Process and model outputs, Left bottom: Estimated parameterwhen = 0.5 (full), 1 (dashed), and 2 (dotted) for = 0.7. Right top:Process and model outputs, Right bottom: Estimated parameter when = 0.4 ( full), 0.7( dashed), and 1.0( dotted) for = 1.
we have a1b1 a2b0 b2 = 3 12 1 = 10. Furthermore
a2b2 = 4
( a1b1 a2b0 b2)2
4b0=
10012
Hence the transfer function G( s)is neither PR nor SPR.
5.7 Consider the systemdx
dt = Ax + B1u
y = C1x
where
B1 =
1
0...
0
Let Qbe positive and let P be the solution of the Lyapunov equation
ATP + PA = Q ()
-
8/12/2019 Solns Adaptive Control by Astrom
37/46
Solutions to Chapter 5 35
Define C1as
C1 = BTP =
p11 p12 . . . p1nAccording to the Kalman-Yacobuvich Lemma the transfer function
G1( s) = C1(sI A)
1B1
is then positive definite. This transfer function can, however, be writtenas
G( s) =p11s
n 1 + p12s
n 2 +. . . + p1n
sn + a1sn 1 +. . . + an
Since there are good numerical algorithms for solving the Lyapunov equa-tion we can use this result to construct transfer functions that are SPR.The method is straightforward.
1. Choose A stable.2. Solve ( *)for given Qpositive.
3. Choose B asB( s) = p11s
n 1
+ p12sn
2+. . . + p1n
5.11 Let us first solve the underlying design problem for systems with knownparameters. This can be done using pole placement. Let the plant dy-namics be
y =B
Au
and let the controller beRu = Tuc sy
The basic design equation is then
AR + B S = AmAo ()
In this case we haveA = ( s + a)( s + p)
B = bq
Am = s2+2 s +2
We need an observer of at least first order. The design equation ( *) thenbecomes
(s + a)( s+ p)( s + r1) + bq( s0s + s1) = (s2+2 s +2)( s+ a0) ( +)
where Ao = s + ao is the observer polynomial. The controller is thus ofthe formdu
dt + r1u = t0uc s0y s1
dy
dt
-
8/12/2019 Solns Adaptive Control by Astrom
38/46
36 Problem Solutions
It has four parameters that have to be updatedr1,t0,s0, ands1. If no priorknowledge is available we thus have to update these four parameters.When parameter p is known it follows from the design equation ( +)thatthere is a relation between the parameters and it then suffices to estimatethree parameters. This is particularly easy to see when the observerpolynomial is chosen as Ao(s) = s + p. Puttings = pin ( +)gives
s0p + s1 = 0
Hences1 = ps0 ()
In this particular case we can thus update t0, s0, and r1 and computes1 from (**). Notice, however, that the knowledge of q is of no valuesince q always appear in combination with the unknown parameter b.The equations for updating the parameters are derived in the usual way.Witha0 = pequation( +) simplifies to
( s + a)( s+ r1) + bqs0 = s2
+2 s +2
IntroducingA( s) = s + a S( s) = s0 T
= t0
we get
y =B T
AR + B Suc
e
t0=
B
AR + B Suc
B
Amuc
e
s0=
B TB
(AR + B S)2uc =
B
AR + B S y
B
Amy
e r1
= A
B T
(AR + B S)2uc = A
AR + B S y A
Amy
= A
Am
B
Au =
B
Am( s + p)u
The MIT rule then gives
dr1
dt =
1
( s + p)Amu
e
ds0
dt =
1Am
y
e
dt0
dt = 1Am uce
A simulation of the controller is given in Fig. 19.
-
8/12/2019 Solns Adaptive Control by Astrom
39/46
Solutions to Chapter 5 37
0 20 40 60 80 100
2
1
0
1
2Model and process output
0 20 40 60 80 100
0.5
1
1.5
2
Estimated parameters
Figure 19. Simulation in Problem 5.11. Top: Process (full) and model(dashed)output. Bottom: Estimated parameters r1 ( full),s0 (dashed), andt0 ( dotted).
5.12 The closed loop transfer function is
Gcl ( s) =kb
s2 + s + k b
This is compatible with the desired dynamics. The error is
e = y ym =kb
p2 + p + kbuc ym
Hence e
k =
b
p2 + p + kbuc
b2k
(p2 + p + k b)2uc
=b
p2 + p + kb( uc y)
b 1
p2 + p +1( uc y) p =
d
dt
The following adjustment rule is obtained from the MIT rule
dk
dt =
e
ke = b
1
p2 + p +1( uc y)
e
-
8/12/2019 Solns Adaptive Control by Astrom
40/46
38 Problem Solutions
0 20 40 602
0
2ym y, gamma = 0.05
0 20 40 600
1
2k, gamma = 0.05
0 20 40 60
2
0
2ym y, gamma = 0.3
0 20 40 60
0
1
2k, gamma = 0.3
0 20 40 60
2
0
2ym y, gamma = 1
0 20 40 60
0
1
2k, gamma = 1
Figure 20. Simulation in Problem 5.12. Left: Process (full) and model(dashed) output. Right: Estimated parameter kfor different values of.
A simulation of the system is given Fig. 20. This shows the behavior ofthe system when u c is a square wave.
-
8/12/2019 Solns Adaptive Control by Astrom
41/46
Solutions to Chapter 6 39
SOLUTIONS TO CHAPTER 6
6.1 The process is given by
G( s) =b
s( s + a)
and the regressor filter should be
Gf(s) =1
Af(s) =
1Am( s)
=1
s2 +2 s +2
The controller is given by
U( s) =s0s + s1
s + r1Y(s) +
t0(s + ao)
s + r1uc(s)
For the estimation of process parameters we use a continuous-time RLSalgorithm. The process is of second order and the controller is of firstorder. The regressor filter is of second order and both inputs and outputsshould be filtered. Hence we need seven states in. The process parame-ters are contained in , and the controller parameters in. The relationbetween these are given by
=
r1
s0
s1
t0
=
2 + ao a
( ao2 +2 ar1) / b
2 ao / b
2 / b
= ()
To find A(), B(), C() and D()we start by finding realizations fory, yf, ufand the controller. We get
d
dt y
y = a 0
1 0 yy +
b
0u
d
dt
yfyf
= 2 21 0
yfyf
+ 10
yand
d
dt
ufuf
= 2 21 0
ufuf
+ 10
uand the control law can be rewritten as
u = s0y + t0uc + s1 + r1s0
p + r1y +
aot0 t0r1
p + r1uc
We need one state for the controller and it can be realized as
x = r1x + ( s1 + r1s0)y + ( aot0 r1t0)uc
u = x s0y + t0uc
-
8/12/2019 Solns Adaptive Control by Astrom
42/46
-
8/12/2019 Solns Adaptive Control by Astrom
43/46
Solutions to Chapter 6 41
If we use the relations a = r1 +2 + aoandb = 2 / t0 then ecan bewritten as
e = 2 yf 2yf + y +( r1 +2 + ao)yf 2
t0uf
=
0 1 r1 + ao 0 0 2t0 0
y
y
yfyf
uf
uf
x
Combining the expressions for and egives
e
=
0 1 r1 + ao 0 0 2
t00
0 0 1 0 0 0 0
0 0 0 0 0 1 0
y
y
yfyf
uf
uf
x
= C()
i.e. D() = 0. As given in the problem description, the estimator isdefined by
d
dt = Pe
dP
dt = P P TP
where P is a 2 2 matrix and eand are given above.
6.3 The averaged equations for the parameter estimates are given by (6.54)on page 303. In this particular case we have
G( s) =
ab2
( s + a)(s + b)2
Gm( s) =a
s + a
-
8/12/2019 Solns Adaptive Control by Astrom
44/46
-
8/12/2019 Solns Adaptive Control by Astrom
45/46
Solutions to Chapter 6 43
The desired response is
Gm( s) =bm
s + am(3)
Combining( 1) and( 2)gives the closed loop transfer function
Gcl =b1
s + a + b2
Equating this with Gm( s)given by ( 3) gives
b1 = bm
a + b2 = am
If these equations are solved for 1 and 2 we obtain the controllerparameters that give the desired closed loop system. Conversely if theequations are solved for aand b we obtain the parameters of the processmodel that corresponds to given controller parameters. This gives
a = am
bm2/
1b = bm / 1
The parametersa and bcan thus be interpreted as the parameters of themodel the controller believes in. Inserting the expressions for1 and2from page 318 we get
a() =
229 312
259 2
b() =458
259 2
( +)
When
= 22931 = 2.7179we get a() = 0. The reson for this is that the value of the plant transferfunction
G(s) =458
(s + 1)( s2 +30s + 229) ()
is G(2.7179i) = 0.6697i. The transfer function of the plant is thuspurely imaginary. The only way to obtain a purely imaginary value ofthe transfer function
G =b
s + a ()
is to make a = 0. Also notice that b(2.7179i) = 1.8203 which gives
G(2.7179i) = 0.6697i.When =
259 = 16.09 we get infinite values ofaand b. Notice that G( i
259) = 0.0587 that is real and negative. Theonly way to make G( i)negative and real is to have infinite large values
-
8/12/2019 Solns Adaptive Control by Astrom
46/46
44 Problem Solutions
ofaandb. It is thus easy to explain the behavior of the algorithm from thesystem identification point of view. The controller can be interpreted asif it is fitting a model (**) to the process dynamics ( *). With a sinusoidalinput it is possible to get a perfect fit and the parameters are given by( +).