You are on page 1of 39

Minimum variance control

Properties of ARMAX model

A( q ) y ( k )  B ( q ) u ( k )  C ( q ) e ( k )

The model can always be scaled such that the coefficient of


the highest power term in polynomial A is one (A is then
called monic).
Consider now the C-polynomial, which multiplies the noise
e. This noise is white and does not correlate with any other
term in any time instant (except with itself when  =0). The
absolute time instant thus loses its importance.
Properties of ARMAX model

• C-polynomial can be shifted in time arbitrarily forward or


backward (multiply with q or q-1)
• C-polynomial can be normed to be monic
• C-polynomial, with roots outside the unit circle (unstable
inverse) can always be replaced by another polynomial, the
roots of which are inside the unit circle (stable inverse). This
is essential in optimal prediction theory that follows.
Properties of ARMAX model

C-polynomial can always be normed to be monic monic by


using scaling in the noise term (i.e. scaling the variance):

b g
v ( k )  2q  0.6 e( k ) ,  2e  2

v ( k )  bq  0.6 2g  2e( k )  bq  0.3g  e ( k )



,  2e  2 2  2  8

var{ax}  a 2 var{x}
Properties of ARMAX model
The original disturbance model can be replaced by
b 
g
v ( k )  q  0.3  e ( k ) ,  2e  8
C-polynomial having roots outside the unit circle (unstable
inverse) can by spectral analysis be replaced by another
polynomial with roots inside the unit circle (stable inverse).
Consider an example of two disturbances and the spectral
density of the output:
R|v (k)  c1 05. q he(k)  H (q)e(k)
1 R| ()  c1 05. e h c1 05. e h
i  e
2
i

S|v (k)  b1 05. qge(k)  H (q)e(k)


1 v1
, S| ()  c1 05. e h c1 05. e h
v1 2

T
2 v2
T
v2
i  e
2
2
i

because
 yy ( )  H ( ei ) uu ( ) H T ( e  i )
Properties of ARMAX model
The spectral densities are identical so that the processes
can be replaced by each other, when needed (assuming that
the input is white noise). Consider the roots of the two
processes

RSH v1 ( z )  1  0.5z1
R|S 
Hv1 ( z )  z  Hv1 ( z )  z  (1  0.5z 1 )  z  0.5
TH v 2 ( z )  1  0.5z
,
|T 
Hv1 ( z )  2  Hv 2 ( z )  2  (1  0.5z )  z  2

The root of the first process is inside the unit disc


(-0.5), but for the other process outside the disc ( -2).
Properties of ARMAX model
Only those roots, which are outside the disc, must be
shifted. Factorize C as follows:
C  C C 
in which C- contains factors outside the unit disc. When C-
is mapped inside the disc, the reciprocal polynomial C-* is
obtained; replace C with C+ C-*.
Summary: ARMAX-model is changed into a form where A
and C are monic, and the roots of C are inside the unit disc.
If needed the C-polynomial can always be multiplied or
divided by q so that it has the same degree as A.
Properties of ARMAX model
Example: Transform the process model into ARMAX-form.
0.2 q2
2 y (k )  u (k )  3 e( k ) ,  e2  0.1
q  0.5 q  0.1
 2( q  0.5)( q  0.1) y ( k )  0.2( q  0.1)u ( k )  3( q  2)( q  0.5)e( k )
 ( q  0.5)( q  0.1) y ( k )  0.1( q  0.1)u ( k )  1.5( q  2)( q  0.5)e( k )
 ( q 2  0.6q  0.05) y ( k )  (0.1q  0.01)u ( k )  1.5( q  2)( q  0.5)e( k )
One of the roots of C is outside the unit disc.

C   1.5( q  0.5)


   C *  1  2q  2( q  0.5)
C  q  2
Properties of ARMAX model
We get the model
( q 2  0.6q  0.05) y ( k )  ( 0.1q  0.01) u( k )  3( q  0.5)( q  0.5) e( k )
 ( 0.1q  0.01) u( k )  3( q 2  0.25) e( k )

Normalize C to be monic


3(q  0.25)e( k )  (q  0.25)  3e( k )  (q  0.25)  e ( k ) ,  2e  32  2e  0.9
2 2 2
Properties of ARMAX model

Simplify by using ( k )  e( k )
e

which leads to the general ARMAX-model:

. q  0.01)u( k )  (q 2  0.25)e( k ) ,  2e  0.9


(q 2  0.6q  0.05) y( k )  (01
A(q) y( k )  B(q)u( k )  C(q)e( k ) ,  2e  0.9
Optimization criteria for I/O-models
For the regulator problem: minimize the output variance.
J mv  var{ y ( k )}  E {( y ( k )  my ( k )) 2 }
Usually y has been scaled such that the desired value of y is
zero, the mean value becomes unimportant and the criterion
becomes:
J mv  E { y 2 ( k )}

Minimum variance control minimizes this criterion. If the


excessive use of control signal is avoided, a linear quadratic
criterion can be used. J  E { y 2 ( k )  u 2 ( k )}
lq
Example of minimum variance controller
Develop a minimum variance controller for the system
y ( k  1)  ay ( k )  bu( k )  e( k  1)  ce( k ) ,  2e  1 ja c  1

Determine the value of e(k) based on u and y.


y ( k )  ay ( k  1)  bu( k  1)  e( k )  ce( k  1)
 e( k )  ce( k  1)  y ( k )  ay ( k  1)  bu( k  1)
 (1  cq 1 ) e( k )  (1  aq 1 ) y ( k )  bq 1u( k )
(1  aq 1 ) y ( k )  bq 1u( k )
 e( k ) 
1  cq 1
Estimate y(k+1) which takes e(k) into account
Example of minimum variance controller
y ( k  1)   ay ( k )  bu( k )  e( k  1)  ce( k )
 y ( k  1| k )   ay ( k )  bu( k )  ce( k )
e is white noise so that nothing can be said about e(k+1),
which is left out of the estimator formula. The value of e(k)
can be computed based on old values of u and y , so it can
be included in the estimator. 1 1
(1  aq ) y( k )  bq u( k )
y ( k  1| k )  ay( k )  bu( k )  c
1  cq 1
a(1  cq 1 ) y( k )  b(1  cq 1 )u( k ) c(1  aq 1 ) y( k )  bcq 1u( k )
 1

1  cq 1  cq 1
ay( k )  acq 1 y( k )  bu( k )  bcq 1u( k )  cy( k )  acq 1 y( k )  bcq 1u( k )

1  cq 1
Example of minimum variance controller
( c  a ) y ( k )  bu( k )
y ( k  1| k ) 
1  cq 1
Find control u(k), which drives the estimated y(k+1) as close
to zero as possible.
ac
y ( k  1| k )  0  (c  a ) y ( k )  bu( k )  0  u( k )  y( k )
b
This controller gives the minimum possible variance to the
output. Consider the behaviour of the output signal, when
minimum variance control is used.
y ( k )  ay ( k  1)  bu( k  1)  e( k )  ce( k  1)
 (1  aq 1 ) y ( k )  bq 1u( k )  (1  cq 1 ) e( k )
Example of minimum variance controller

1 ac
1
 (1  aq ) y( k )  bq y( k )  (1  cq 1 )e( k )
b
 (1  aq 1 ) y( k )  (aq 1  cq 1 ) y( k )  (1  cq 1 )e( k )
 (1  aq 1  aq 1  cq 1 ) y ( k )  (1  cq 1 )e( k )
1
1  cq
 (1  cq 1 ) y( k )  (1  cq 1 )e( k )  y( k )  1
e( k )  e( k )
1  cq
y(k) is then white noise. Now it can be seen that if the roots
of C are outside the unit disc, the output has a
uncontrollable and unobservable mode.
Optimal prediction
Assume that the output is generated by the stochastic
process
C (q ) q  n C (q ) C * ( q 1 )
y( k )  e( k )   n e( k )  * 1 e ( k )
A( q ) q A( q ) A (q )
Then y(k + m | k) can be estimated at the time k by the
model.
C* (q1 )
y(k  m)  * 1 e(k  m)
A (q )
 e(k  m)  f1e(k  m 1)    fm1e(k 1)  fme(k )  fm1e(k 1)  
    
unknown at time k known at time k
These are obtained from the series expansion. e(k), e(k-1),
… can always be determined by y and u
Optimal prediction
e is white noise, the values of which are unknown and
cannot be predicted. The optimal predictor can only contain
terms which are known or can be calculated based on old
data.
y ( k  m| k )  f m e( k )  f m1e( k  1)  f m 2 e( k  2)  
~
y ( k  m| k )  e( k  m)  f e( k  m  1)    f e( k  1)
1 m 1

Estimator error is A* ( q 1 )
e ( k )  * 1 y ( k )
C (q )

If the roots of C are inside the unit disc, then e can be


computed by using the inverse model
Optimal prediction
Derive for y

C* (q1 )
y(k  m)  * 1 e(k  m)
A (q )
 e(k  m)  f1e(k  m 1)    fm1e(k  1)  fme(k )  fm1e(k 1)  
    
unknown at time k known at time k
1
1
*
 m G (q ) 1 G* (q1 )
 F (q )e(k  m)  q
*
* 1
e(k  m)  F (q )e(k  m)  * 1 e(k )
*

A (q ) A (q )
1 G* (q1 ) A* (q1 ) 1 G* (q1 )
 F (q )e(k  m)  * 1  * 1 y(k )  F (q )e(k  m)  * 1 y(k )
* *

A (q ) C (q ) C (q )
The division of C* by A* has the result F* and remaining
value G*.
Optimal prediction
C * ( q 1 ) 1 m G *
( q 1
)
1
 F (q )  q
*
*
A (q ) A * ( q 1 )
Summarizing:
 C * ( q 1 )  A * ( q 1 ) F * ( q 1 )  q  m G * ( q 1 )
The Diophantine equation
 q m1C ( q )  A(q ) F (q )  G (q )

G * ( q 1 ) qG ( q )
Estimator: y ( k  m| k )  * 1 y ( k )  y( k )
C (q ) C (q )
y ( k  m| k )  F * ( q 1 ) e( k  m)  F (q )e( k  1)
~
Estimator error:

Variance of the estimator error: y
2
~  1  f 1
2
   f 2
m 1  2
e c h
R|SF (q
* 1
)  1  f1q 1    f m1q m1

R|SF(q)  q  f q   f
m1
1
m2
m1

|TG (q
* 1
)  g0  g1q 1    gn1q n1 |TG(q)  g q  g q   g
0
n1
1
n 2
n1
Optimal prediction, example
Determine a 3-step predictor for the process

q 2  0.2q  0.5
y( k )  2 e( k ) ,  e2  1 m  3, n  2
q  15 . q  0.7

R|SF (q)  q  f q
m 1
1
m 2
   f m1  q 2  f 1q  f 2
|TG(q)  g q  g q
0
n 1
1
n2
   gn 1  g0q  g1
q m1C ( q )  A( q ) F ( q )  G ( q )
c
 q 2 q 2  0.2q  0.5  q 2  15h c hc
. q  0.7 q 2  f 1q  f 2  g0 q  g1 h
 q 4  0.2q 3  0.5q 2  q 4  f 1  15 b
. q 3  f 2  15 g b
. f 1  0.7 q 2 g
b
 g0  15
. f2  0.7 f gq  b g  0.7g
1 1
Optimal prediction, example
R| f  15.  0.2
1 R| f  1.3
1

|S f  15. f  0.7  0.5


2 1

|S f  1.75
2

|| g  15. f  0.7 f  0
0 2 1 ||g  1.715
0

T g  0.7  0
1 1Tg  1.225
We obtain the 3-step predictor

qG ( q ) 1.715q 2  1.225q
y ( k  3| k )  y( k )  2 y(k )
C (q ) q  0.2q  0.5)
Estimator variance becomes

c h c h
 2~y  1  f 12    f m21  e2  1  1.32  1.752  1  5.7525
Optimal prediction, example
The coefficients of F are values of the process pulse
response or coefficients of the weighting function h. They
can also be found by simulating the process pulse response
y=
1.0000
1.3000 2

1.7500 1.5

1.7150 1

1.3475 0.5

0.8208 0

-0.5

0.2879 -1
0 5 10 15 20 25 30

-0.1427
Optimal prediction, example

The ”goodness” of the estimator can be evaluated by


different estimation horizons m.
14

The estimator error 12

variance approaches 10

the variance of y Estimator error variance


8
(var{y} = 12.26 ), when
6
m is large. The
estimator is good for 4

small values of m. 2

m
0
0 2 4 6 8 10 12 14 16 18 20
Minimum variance control
Consider the special case when the roots of B are inside
the unit disc (stable inverse, minimum phase system)

A(q) y( k )  B(q)u( k )  C(q)e( k )


B( q ) C( q ) B* (q 1 )  d C* (q 1 )
 y( k )  u( k )  e( k )  * 1 q u( k )  * 1 e( k )
A(q) A(q) A (q ) A (q )
in which d = degA - degB > 0 is the pole excess of the
system
C * ( q 1 ) B * ( q 1 )
y ( k  d )  * 1 e( k  d )  * 1 u ( k )
A (q ) A (q )
* 1 * 1
1 G ( q ) B ( q )
 F ( q ) e( k  d )  * 1 e( k )  * 1 u ( k )
*

A (q ) A (q )
Minimum variance control
Determine e from the original model

B * ( q 1 )  d C * ( q 1 )
y ( k )  * 1 q u ( k )  * 1 e( k )
A (q ) A (q )
A * ( q 1 ) y ( k )  B * ( q 1 ) q  d u ( k )
 e( k ) 
C * ( q 1 )
Substitute into y(k + d)
* * * d *
G G B q B
y ( k  d )  F *e ( k  d )  * y ( k )  * *
u( k )  * u( k )
C AC A
G *
 F e( k  d )  * y ( k )  *
B *
CFG*
 G * d
q IJ
H K
*
*
u( k )
C C A
Minimum variance control
Because C* = A*F* + q-d G*, then C* - q-d G* = A*F*, and

G *
B
y ( k  d )  F e( k  d )  * y ( k )  *
*
A * *
F FG IJ
H K
*
*
u( k )
C C A
* * *
G B F
 F e( k  d )  * y ( k ) 
*
*
u( k )
C C
Calculate the variance of y(k + d)

2 R
|
E { y ( k  d )}  E {c F e( k  d ) h }  E SG
F G *
y( k ) 
*
B F *
IJ U|V
2

|TH C K |W
2 *
* *
u( k )
C
The minimum is obtained when the last term is zero
Minimum variance control
G* B* F * G*
*
y( k )  *
u( k )  0  u( k )   * * y ( k )
C C B F
G * ( q 1 ) G (q )
 u ( k )   * 1 * 1 y ( k )   y( k )
B (q ) F (q ) B(q ) F (q )

With this controller y(k) becomes

y ( k )  F * ( q 1 ) e( k )  e( k )  f 1e( k  1)    f d 1e( k  d  1)

and variance  2
y  1  f 1
2
c  f 2
d 1  2
e h
Minimum variance control, example
Design a minimum variance controller for the process
cq  17. q
3 2
h b g c h
 0.7q y( k )  q  0.5 u( k )  q 3  0.9q 2 e( k ) ,  e2  1, d  2
Earlier F and G were determined from the identity
q d 1C (q )  A( q ) F (q )  G (q )
Let us now try a direct polynimial division. Divide qd-1C(q) by
A(q), the result is F(q) and the remainder G(q),

q d 1C ( q ) G (q )
 F (q ) 
A( q ) A( q )
Minimum variance control, example
q  0.8
q 3  1.7q 2  0.7q q 4  0.9q 3
 ( q 4  1.7q 3  0.7q 2 )
0.8q 3  0.7q 2
 ( 0.8q 3  1.36q 2  0.56q )
0.66q 2  0.56q
q d 1C(q) G( q ) q 4  0.9q 3 0.66q 2  056
. q
 F (q )   3  q  08
.  3
A(q) A(q) q  17
. q  0.7q
2
q  17
. q 2  0.7q
RS F (q)  q  0.8
We obtain F and G: TG(q)  0.66q  0.56q
2
Minimum variance control, example
The minimum variance controller is
G(q) 0.66q 2  056
. q 0.66q 2  056
. q
u( k )   y( k )   y( k )  2
B(q) F (q) b q  05gb
. q  08. g q  13
. q  0.4
y( k )
and the output variance

c h c h
 2y  1  f 12    f d21  2e  1  0.82  1  1.64

Check by simulation
Minimum variance control, example
1.8

Variance of y 1.6

1.4

cov(y) = 1.6384 1.2

y is white noise; 0.8

everything that can be 0.6

done has been done, 0.4

and there is nothing 0.2

more to explain in the 0

data. -0.2
-20 -15 -10 -5 0 5 10 15 20
General minimum variance control
The control law is valid only if the roots of B are inside the
unit disc (stable inverse)
G (q )
u( k )   y( k )
B (q ) F (q )
Develop minimum variance control so that it can be used
also in this latter case. Factorize B
B( z)  B  ( z) B  ( z)
All the roots of B+ are inside the unit disc and all roots of B-
are outside it. Additionally, B-*(z) is monic and A and B- do
not have common factors.
General minimum variance control
Minimum variance control and the output are
G (q ) d 1 F (q )
u( k )    y( k ) y ( k ) q  * e( k )
B (q ) F (q ) B (q )
in which F and G are polynomials that satisfy the
Diophantine equation
d 1 *
q C(q) B (q)  A(q) F (q)  B (q)G(q) RS
deg F  d  deg B 
1
T
deg G  deg A  n

If B has an unstable inverse, there might exist many local


minima . The given control law gives the smallest minimum
so that all signals are finite.
General minimum variance control, example
Develop a minimum variance control without and with
cancellation of the zero. Compare the results
cq 2
h b g c h
. q  0.7 y( k )  0.9q  1 u( k )  q 2  0.7q e( k ) ,  2e  1, d  1
 17

First: Compensate the zero outside the unit disc

1 RS F (q)  1
q 2  1.7q  0.7 q 2  0.7q TG(q)  q  0.7
 ( q 2  1.7q  0.7)  q  0.7
u( k )  y( k )
q  0.7 0.9q  1
 2y  12   2e  1
General minimum variance control, example
Now without cancellation
2
cq  17. q  0.7h y(k )  b0.9q  1gu(k )  cq  0.7qhe(k ) ,
2
 2e  1, d  1

R|S B (q)  1

** 1
 B ( q )  0.9q  1  B 1 *
(q )  q  0.9
|T B (q)  0.9q  1

q d 1C(q) B * (q)  A(q) F (q)  B  (q)G(q)


 cq 2
hb g c
 0.7q q  0.9  q 2  17 hb g b gb
. q  0.7 q  f1  0.9q  1 g0q  g1 g
b
 q 3  0.2q 2  0.63q  q 3  0.9 g0  f1  17
. q2 g
b
 0.9 g1  g0  17 g b
. f1  0.7 q  g1  0.7 f1 g
General minimum variance control, example

R|0.9 g  f  1.7  0.2


0 1 R| f  1
1

S|0.9 g  g  1.7 f  0.7  0.63


1 0 1  S| g  1
0

T g  0.7 f  0
1 1 T g  0.7
1

G (q )  q  0.7
u( k )    y( k )  y( k )
B (q ) F (q ) q 1

The output by using this controller is


F (q ) q 1
y ( k ) q d 1  *
e( k )  y( k )  e( k )
B (q ) q  0.9
General minimum variance control, example
Calculate the output variance (see the chapter on
Disturbance models ). For a first order system it has been
derived:
b0q  b1 (b 2
 b1 ) a 0  2b0b1a1
2
y( k )  e( k )   y 
2 0
 2

a0q  a1 a0 ( a02  a12 )


e

q 1 (1  1)  2  0.9 2 0.2 2 0.2


y( k )  e( k )   2y  e  e   105
.
q  0.9 1  0.9 2
019
. 019
.

The variance is about 5% bigger than with the controller, for


which compensation was used. Check by simulation
General minimum variance control, example
For a small time
period both
controllers perform
well and almost
identically.
4

-1

-2

-3
0 20 40 60 80 100 120
General minimum variance control, example
An incorrect design leads eventually to instability.
5
x 10
4 3

3
2

2
1

-1
-1

-2
-2

-3 -3
0 20 40 60 80 100 120 0 20 40 60 80 100 120

7
x 10
5 10

4
8

3
6
2

4
1

0 2

-1
0

-2
-2
-3

-4
-4

-5 -6
0 50 100 150 200 250 300 350 400 450 500 0 100 200 300 400 500 600

You might also like