Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

EE16B

Designing Information
Devices and Systems II
Lecture 8A
Observability and Observers

EE16B M. Lustig, EECS UC Berkeley


Outputs
~x(t + 1) = A~x(t) + Bu(t)
Can’t always measure state directly or all states…
Define output:
~y (t) = C~x(t) p x n matrix for p
outputs

EE16B M. Lustig, EECS UC Berkeley


Observability
A system is “observable” if, by watching
y(0),y(1),y(2),… we can determine the full state

Two stage approach:


1) Determine initial state x(0) from y(0),y(1),….
t
2) ~
x(t) = A ~x(0) + Bu(t) 2 3 2 3
y(0) C
6 y(1) 7 6 CA 7
6 7 6 7
~y = 6 .. 7= 6 .. 7 ~x(0)
4 . 5 4 . 5
t
y(t) CA
= Ot
EE16B M. Lustig, EECS UC Berkeley
Observability 2 3 2 3
y(0) C
Q: What conditions on Ot, to 6 y(1) 7 6 CA 7
6 7 6 7
determine x(0) uniquely? ~y = 6 .. 7= 6 .. 7 ~x(0)
4 . 5 4 . 5
t
y(t) CA
A: Ot must have n independent rows
strictly On-1 has full rank2 = Ot
3
null-space is {0} C
6 CA 7
6 7
Observability ,6 .. 7 has rank = n
4 . 5
n 1
CA

EE16B M. Lustig, EECS UC Berkeley


Example 
cos ✓ sin ✓
~x(t + 1) = ~x(t) y(t) = x1 (t)
sin ✓ cos ✓
A rotation C = [1 0]
matrix
 
C 1 0
= ) rank = 2 if ✓ 6= k⇡
CA cos ✓ sin
x

2


✓=
2
x1
  1
x1 (0) C y(0)
=
x2 (0) CA y(1)
EE16B M. Lustig, EECS UC Berkeley
State Feedback Control

~x(t + 1) = A~x(t) + Bu(t) ~y (t) = C~x(t)

~x(t + 1) = A~x(t) + Bu(t)


u(t)
k1
x1 (t) w/o observer
..
. xn (t)
kn
EE16B M. Lustig, EECS UC Berkeley
A Common Observer Algorithm
Start with initial guess x̂(0)
Update estimate each time using: nxp

x̂(t + 1) = Ax̂(t) + Bu(t) + L(C x̂(t) y(t))


Copy of system model correction

observer
x̂(t + 1) = Ax̂(t) + Bu(t)
~x(t + 1) = A~x(t) + Bu(t)
u(t) u(t), y(t) +L(C x̂(t) y(t))
x̂1 (t)
k1 ..
. x̂n (t)
kn
EE16B M. Lustig, EECS UC Berkeley
Choosing L for Observer
~x(t + 1) = A~x(t) + Bu(t)
x̂(t + 1) = Ax̂(t) + Bu(t) + L(C x̂(t) y(t))
C~x(t)
~e(t) = x̂(t) ~x(t)

~e(t + 1) = x̂(t + 1) ~x(t + 1)


= A (x̂(t) ~x(t)) LC(x̂(t) x(t))
~e(t) ~e(t)
~e(t + 1) = (A + LC)~e(t)
~e(t) ! 0 If (A + LC) has eigenvalues inside unit circle

EE16B M. Lustig, EECS UC Berkeley


Choosing L for Observer
Claim: if (A,C) observable, then we can arbitrarily
assign eigenvalues of A+LC
transpose T T T
A + LC A +C L

=
=

=
à + B̃ K̃
If (Ã, B̃) controllable, we can
T
L = K̃ design K̃ to assign eigenvalues
ofà + B̃ K̃ (same eigenvalues
as A+LC)
T T
Given (A,C) observable, can we claim à = A , B̃ = C Controllable?
EE16B M. Lustig, EECS UC Berkeley
2 3
C
6 CA 7
6 7
6 .. 7 has rank = n
4 . 5
n 1
CA

T T T T n 1 T
[C A C · · · (A ) C ] has rank = n
=

=
n 1
[B̃ ÃB̃ ··· Ã B̃]

satisfies controllability!

EE16B M. Lustig, EECS UC Berkeley


Back to Example

cos ✓ sin ✓
~x(t + 1) = ~x(t) y(t) = [1 0]~x(t)
sin ✓ cos ✓
 
cos ✓ sin ✓ l1
x̂(t + 1) = x̂(t)+ ([1 0]x̂(t) y(t))
sin ✓ cos ✓ l2
eigenvalues of A+LC must be inside unit circle
⇡   
✓= 0 1 l1 l1 1
2 + [1 0] =
1 0 l2 1 + l2 0
2 2
l1 + (l2 + 1) = 0 1,2 = ±0.9i ) + 0.81 = 0
=0 = 0.81
EE16B M. Lustig, EECS UC Berkeley
Example
 
cos ✓ sin ✓ l1
x̂(t + 1) = x̂(t)+ ([1 0]x̂(t) y(t))
sin ✓ cos ✓ l2
 
l1 = 0 1 1
l2 = 0.19 ~x(0) = x̂(0) =
1 1.3

1.5

1
~e(t) = ~x(t) x̂(t)
0.5

-0.5

-1

-1.5

-2
0 20 40 60 80 100 120 140 160 180 200

EE16B M. Lustig, EECS UC Berkeley


2

= ±0.9i
1.5

0.5
1,2
0

-0.5

-1

-1.5

-2
0 20 40 60 80 100 120 140 160 180 200
2

1.5

0.5
1,2 = ±0.987i
0

-0.5

-1

-1.5

-2
0 20 40 60 80 100 120 140 160 180 200

1.5

1 1,2 = ±0.9i
0.5

-0.5

-1

-1.5

-2
0 100 200 300 400 500 600 700 800

= ±0.987i
1.5

0.5
1,2
0

-0.5

-1

-1.5

-2
0 100 200 300 400 500 600 700 800

EE16B M. Lustig, EECS UC Berkeley


Kalman Filter
• We have not assumed noise and errors in our system
model and inputs
x̂(t + 1) = Ax̂(t) + Bu(t) + L(C x̂(t) y(t))
32 murat arcak

Copy of system model correction


A more elaborate form of the observer (58), where the matrix L is
also updated at each time, is known as the Kalman Filter and is
the industry standard in navigation. The Kalman Filter takes into
A more elaborate form of the observer where the matrix L is also updated at
account the statistical properties of the noise that corrupts measure-
ments and minimizes the mean square error between x (t) and x̂ (t).
each time, is known as the Kalman Filter and is the industry standard in
navigation. The Kalman Filter takes into account the statistical properties of the
noise that corrupts measurements and minimizes the mean square error
between x(t) and xˆ(t)
Figure 3: Rudolf Kalman (1930-2016)
introduced the Kalman Filter as well
as many of the state space concepts
we studied, such as controllability and
observability. He was awarded the
National Medal of Science in 2009.

EE16B M. Lustig, EECS UC Berkeley


Control Recap
2 3
2 3 u(0)
• Controllability: 6
6 u(1) 7
7
~x(n) A ~x(0) = 4An 1 B An
n 2
B · · · AB B 5 6 .. 7
4 . 5
u(n 1)
If Rn is full rank then
we can move to any
target value
Same rank test for
continuous time
• Open loop control:
Can use the above equation to design an input sequence – and apply it
blindly. Accuracy of result will depend on accuracy of model.

EE16B M. Lustig, EECS UC Berkeley


Control Recap – State Feedback
u(t) = K~x(t)
Closed-loop system: ) ~x(t + 1) = (A + BK)~x(t)
Must choose K s.t. A+BK has
eigenvalues inside the unit circle
(or left half-plane for coninuous time)

If controllable, can assign eigenvalues for A+BK arbitrarily

If not, some eigenvalues of A can not be changed!


(could be OK, if stable, bad news if not)

EE16B M. Lustig, EECS UC Berkeley


Control Recap - Observers
Not all state variable are measured, but we get “outputs”
~y (t) = C~x(t)
To estimate the state we estimate an initial guess and
update: x̂(t + 1) = Ax̂(t) + Bu(t) + L(C x̂(t) y(t))
Copy of system model correction
Design L, such that A+LC has eigenvalues inside unit
circle
~e(t + 1) = (A + LC)~e(t)

Can assign arbitrary eigenvalues if system is observable

EE16B M. Lustig, EECS UC Berkeley


2 3 2 3
Control Recap y(0) C
6 y(1) 7 6 CA 7
6 7 6 7
Observability: 6 .. 7= 6 .. 7 ~x(0)
4 . 5 4 . 5
n 1
y(n 1) CA
On-1 must have n independent rows (full
rank) to determine x(0) uniquely from
output
Duality: Observability of (C,A) is the same as
T T
controllability of (A ,C )

Guidance, Navigation & Control (GNC) is aerospace engineering


Open loop Observers feedback
or “kalman”
filters
EE16B M. Lustig, EECS UC Berkeley

You might also like