State Estimation and Linear Observers: Automatic Control 1
State Estimation and Linear Observers: Automatic Control 1
Automatic Control 1
State estimation and linear observers
Prof. Alberto Bemporad
University of Trento
Academic year 2010-2011
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 1 / 13
Lecture: State estimation and linear observers State estimation
State estimation
State estimation problem
At each time k construct an estimate x(k) of the state
x(k), by only measuring the output y(k) and input u(k)
Open-loop observer: Build an articial copy of the system, fed in parallel by
with the same input signal u(k)
x(k) y(k)
A,B
u(k)
C
A,B
!"#$%&'$()*+,'-..
x(k)
./$/-)-./&%$/-
/+0-)./$/-
The copy is a numerical simulator x(k +1) = Ax(k) +Bu(k) reproducing the
behavior of the real system
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 2 / 13
Lecture: State estimation and linear observers State estimation
Open-loop observer
x(k) y(k)
A,B
u(k)
C
A,B
!"#$%&'$()*+,'-..
x(k)
./$/-)-./&%$/-
/+0-)./$/-
The dynamics of the real system and of the numerical copy are
x(k +1) = Ax(k) +Bu(k) True process
x(k +1) = Ax(k) +Bu(k) Numerical copy
The dynamics of the estimation error x(k) = x(k) x(k) are
x(k +1) = Ax(k) +Bu(k) Ax(k) Bu(k) = Ax(k)
and then x(k) = A
k
(x(0) x(0))
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 3 / 13
Lecture: State estimation and linear observers State estimation
Open-loop observer
x(k) y(k)
A,B
u(k)
C
A,B
!"#$%&'$()*+,'-..
x(k)
./$/-)-./&%$/-
/+0-)./$/-
The estimation error is x(k) = A
k
(x(0) x(0)). This is not ideal, because
The dynamics of the estimation error are xed by the eigenvalues of A and
cannot be modied
The estimation error vanishes asymptotically if and only if A is asymptotically
stable
Note that we are not exploiting y(k) to compute the state estimate x(k) !
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 4 / 13
Lecture: State estimation and linear observers State observer
Luenberger observer
x(k) y(k)
A,B
u(k)
C
A,[B L]
!"#$%&'$()*+,'-..
x(k)
./$/-)
-./&%$/-
/+0-)./$/-
+
-
C
y(k)
./$/-),1.-+2-+
Luenberger observer: Correct the estimation equation with
a feedback from the estimation error y(k) y(k)
x(k +1) = Ax(k) +Bu(k) + L(y(k) Cx(k))
. _ .
feedback on estimation error
where L
np
is the observer gain
David G.
Luenberger
(1937-)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 5 / 13
Lecture: State estimation and linear observers State observer
Luenberger observer
x(k) y(k)
A,B
u(k)
C
A,[B L]
!"#$%&'$()*+,'-..
x(k)
./$/-)
-./&%$/-
/+0-)./$/-
+
-
C
y(k)
./$/-),1.-+2-+
The dynamics of the state estimation error x(k) = x(k) x(k) is
x(k +1) = Ax(k) +Bu(k) Ax(k) Bu(k) L[y(k) Cx(k)]
= (A LC)x(k)
and then x(k) = (A LC)
k
(x(0) x(0))
Same idea for continuous-time systems x(t) = Ax(t) +Bu(t)
dx(t)
dt
= Ax(t) +Bu(t) +L[y(t) Cx(t)]
The dynamics of the state estimation error are
dx(t)
dt
= (A LC)x(t)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 6 / 13
Lecture: State estimation and linear observers State observer
Eigenvalue assignment of state observer
Theorem
If the pair (A, C) is observable, then the eigenvalues of
(A LC) can be placed arbitrarily
Proof:
If the pair (A, C) is completely observable, the dual system (A
, C
, B
, D
) is
completely reachable
Then we can design a compensator K for the dual system and place the
eigenvalues of (A
+C
K) arbitrarily
The eigenvalues of matrix (A
+C
C)
Dene L = K
2
. . .
n
] = desired observer
eigenvalues
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 7 / 13
Lecture: State estimation and linear observers Example of observer design
Example of observer design
We want to design a state observer for the continuous-time system in
state-space form
_
_
_
x(t) =
_
1 0
1 1
_
x(t) +
_
2
0
_
u(t)
y(t) =
_
0
1
2
_
x(t)
We want to place the poles of the observer in {4, 4}
It is easy to verify that the system is completely observable
Let L =
_
2
_
be the unknown observer gain
Write the generic state estimation matrix
A LC =
_
1 0
1 1
_
2
_
_
0
1
2
_
=
_
1
1
2
1
1 1
1
2
2
_
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 8 / 13
Lecture: State estimation and linear observers Example of observer design
Example of observer design (contd)
The characteristic polynomial of the observer is
det(I A +LC) =
2
+ (2 +
1
2
2
)+
1
2
2
+
1
2
1
+1
Impose the polynomial equals the desired one (+4)
2
=
2
+8+16
Solve the linear system of equations in
1
,
2
and get
1
= 18,
2
= 12
The resulting Luenberger observer is
dx(t)
dt
=
_
1 9
1 7
_
x(t) +
_
2
0
_
u(t) +
_
18
12
_
y(t)
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 9 / 13
Lecture: State estimation and linear observers Example of observer design
Example of observer design in MATLAB
MATLAB
A =[1.8097 -0.8187; 1 0];
B = [0.5; 0];
C =[0.1810 -0.1810];
D = 0;
L=place(A,C,[.5 .7])
eig(A-L
*
C)
ans = 0.7000 0.5000
State-space model in discrete-time
A =
_
1.8097 0.8187
1 0
_
, B =
_
0.5
0
_
C = [
0.1810 0.1810
] , D = 0
Resulting observer gain
L =
_
82.6341
86.0031
_
Double-check observer poles: answer is ok !
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 10 / 13
Lecture: State estimation and linear observers Example of observer design
Example of observer design in MATLAB (contd)
0 10 20 30 40
10
0
10
20
30
40
time (s)
x
1
(t)
x
1
(t)
^
response from initial conditions
x(0) =
_
1
1
_
, x(0) =
_
0
0
_
for u(k) 0.1
MATLAB
x=[-1;1]; % initial state
xhat=[0;0]; % initial estimate
XX=x;
XXhat=xhat;
T=40;
UU=.1
*
ones(1,T); % input signal
for k=0:T-1,
u=UU(k+1);
y=C
*
x+D
*
u;
yhat=C
*
xhat+D
*
u;
x=A
*
x+B
*
u;
xhat=A
*
xhat+B
*
u+L
*
(y-yhat);
XX=[XX,x];
XXhat=[XXhat,xhat];
end
plot(0:T,[XX(1,:);XXhat(1,:)]);
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 11 / 13
Lecture: State estimation and linear observers Example of observer design
Example of observer design in MATLAB (contd)
0 10 20 30 40
20
0
20
40
60
80
time (s)
true state
estimator L1
estimator L2
estimator L3
Comparison of different observer gains
Response from initial conditions
x(0) =
_
1
1
_
, x(0) =
_
0
0
_
for u(k) 0.1
MATLAB
L1=place(A,C,[.5 .7]);
L2=place(A,C,[.75 .8]);
L3=place(A,C,[.4 .5]);
A fast observer often implies large
estimation errors in the transient
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 12 / 13
Lecture: State estimation and linear observers Example of observer design
English-Italian Vocabulary
estimation error errore di stima
Luenberger observer osservatore alla Luenberger
observer gain guadagno dellosservatore
Translation is obvious otherwise.
Prof. Alberto Bemporad (University of Trento) Automatic Control 1 Academic year 2010-2011 13 / 13