Nonlinear Observers: Control of Nonlinear Dynamic Systems: Theory and Applications J. K. Hedrick and A. Girard © 2005
Nonlinear Observers: Control of Nonlinear Dynamic Systems: Theory and Applications J. K. Hedrick and A. Girard © 2005
Nonlinear Observers: Control of Nonlinear Dynamic Systems: Theory and Applications J. K. Hedrick and A. Girard © 2005
10
2005
`Nonlinear Observers
Key points
All the control methodologies covered so far require full state information. This
can be impossible, or expensive, to obtain.
Nonlinear observers:
o Deterministic:
Lyapunov based: Thau, Raghavan
Geometric
Sliding
o Stochastic: Extended Kalman Filter (EKF)
2005
Linearization
I/O and I/S feedback linearization
Sliding control (robust I/O linearization)
Integrator backstepping
Dynamic surface control
Note: make sure you understand what the similarities and differences between all those
methodologies are!
In general, we only have access to p sensor outputs, that is:
z = M .x + v(t )
where:
Even in nonlinear systems, the measurements will be linearly related to the state in general
(property of any useful sensor).
The best-known methodology for dealing with a full state feedback controller is to separate the
problem into a static controller (for example u = -kx) and a dynamic observer. We then:
a. Design the controller as if x = x .
b. Design the observer so that x x as quickly as possible.
2005
x& = Ax + Bu + w(t )
z = M .x + v(t )
~
x = x x
~
x& = x& x& = Ax + Bu + w Ax Bu L( Mx + v Mx ) = ( A LM ) ~
x + w(t ) Lv (t )
There are two different classical approaches to dealing with the choice of L:
~
x& = ( A LM ) ~
x and if (A,M) is observable, then the eigenvalues of (A-LM) can be placed
arbitrarily.
x& = Ax + Bu + L( z Mx )
L = PM T R 1
P& = AP + PAT + Q PM T R 1 MP
The steady-state Kalman filter is usually implemented. In that case the last equation becomes:
2005
AP + PAT + Q PM T R 1 MP = 0
and is usually referred to as the Algebraic Ricatti Equation (are).
Nonlinear Observers
Overview
Nonlinear Observers
Thaus method
Geometric
observers
Sliding
observers
Raghavans
method
Thaus method: a common sense approach. Mimic the nonlinear dynamics and add a linear
correction term. Not constructive. An analysis method. The control analog is linearization.
Raghavans method: Uses the same observer structure as Thaus method, but provides a
constructive iteration to get the gains.
Geometric observers: The observer analog to I/S linearization. Find a state transformation so
that the nonlinear system looks linear, and apply well known linear techniques. Seek a new state
so that when we observe this new state, the error dynamics are linear.
Sliding observers: Explicitly account for imperfect models. Its the observer analog to sliding
mode control.
They are generally of two types:
a. deterministic
b. stochastic
The dominant stochastic nonlinear observer is called an Extended Kalman Filter
If x& = f ( x) + g ( x)u and y = h(x) , use a standard Kalman filter, but with:
A=
f
taken at the current operating point
x
C=
2005
h
taken at the current operating point
x
( x1 , x 2 ),
f ( x1 ) f ( x 2 ) x1 x 2
f ( x1 ) f ( x 2 ) x1 x 2
bounded derivative:
if x 2 = x1 + h
h
f ( x1 ) f ( x1 + h) h
f ( x1 ) f ( x1 + h)
In particular,
l im
h0
f ( x1 ) f ( x1 + h)
f
h
x
2005
x& = Ax + g (t , u, z ) + f ( x)
z = Mx
Assumptions:
No noise
The nonlinearity, f, depends only on x.
Notes:
Ax is the LTI part
The g part can be cancelled out (we know t, u and z).
The f part represents the rest of the stuff.
Let the observer be:
x& = Ax + g (t , u, z ) + f ( x ) + L( z Mx )
Given an L and the Lipschitz constant of f, , Thaus method tells us whether or not the L gives
asymptotically stable error dynamics.
This method is NOT constructive: it gives a yes/no answer.
The error dynamics are given by:
~
x = x x
~
x& = x& x& = ( A LM ) ~
x + f ( x) f ( x )
Assumptions:
(A,M) is an observable pair
f is globally Lipschitz
2005
~
x& = ( A LM ) ~
x + f ( x) f ( x )
x 0 as t ) if:
is globally asymptotically stable ( ~
<
min (Q)
2 max ( P)
( A LM ) T P + P( A LM ) = Q
Proof:
The proof is Lyapunov based.
Select
Then
V =~
x T P~
x
T ~
~
&
&
V = x Px + ~
x T P~
x&
=~
x T ( A LM ) T P + P( A LM ) ~
x + 2~
x T P[ f ( x) f ( x )]
(A,M) is an observable pair there exists L such that (A-LM) is stable there exists (P,Q) such
that:
( A LM ) T P + P( A LM ) = Q
and P and Q are positive definite.
V& = ~
x T Q~
x + 2~
x T P[ f ( x) f ( x )]
Using the Lipschitz condition and the fact that:
2005
2
V& min (Q) ~
x + 2~
x T P~
x
2
2
min (Q) ~
x + 2max ( P) ~
x
2
[2 max ( P) min (Q)] ~
x
(Q)
So V& 0 if < min
2 max ( P )
FACT:
min (Q)
is maximized for Q=I.
2 max ( P )
x& = Ax + g (t , u, z ) + f ( x ) + L( z Mx )
z = Mx
Choose an L (of size nxp) such that ( A LM ) T P + P ( A LM ) = I and <
x& = Ax + g (t , u, z ) + f ( x)
z = Mx
x& = Ax + g (t , u, z ) + f ( x ) + L( z Mx )
~
x = x x
~
&x = ( A LM ) ~
x + f ( x) f ( x )
Define A0 = A LM
V =~
x T P~
x
V& = ~
x T A0T P + PA0 ~
x + 2~
x T P[ f ( x) f ( x )]
Fact 1:
2~
x T P[ f ( x) f ( x )] 2 P~
x ~
x
1
2 max ( P )
2005
(from f Lipschitz)
Fact 2: (name?)
ab
a2
+ b2
4
a 2 P~
x
~
b x
Let:
Then, 2 P~
x ~
x 2~
x T PP~
xT + ~
xT~
x
V& ~
x T A0T P + PA0 + 2 PP + I ~
x
Fact 3: if A0T P1 + P1 A0 + 2 P1 P1 + I < 0 (negative definite) then there exists a P2 such that:
[A P
0
+ P2 A0T + 2 P2 P2 + I < 0
x 0 exponentially.
Then, we have V& ~
xT~
x < 0 so ~
( A LM ) P + P( A LM ) T + 2 PP + I ( + 1) = 0
Let L
PM T
2
2
MTM
Then AP + PA + P I
If we set: R1 2 I
P + I ( + 1) = 0
MTM
and Q1 ( + 1) I
Then we have:
AP + PAT + PR1 P + Q1 = 0
Standard algebraic Ricatti equation (are in Matlab)
Design Steps
a. Set to a small positive value.
Ricatti equation
2005
If yes, set L
(ii)
If no, set =
PM T
2
and repeat
It is shown that if the algorithm fails, then there does not exist a P, L such that V& < 0 for all f
with Lipschitz constant .
x& = Ax + f ( x) + Bu
y = Cx
f is Lipschitz with constant
( x, y ), f ( x) f ( y ) x y
Observer:
x& = Ax + f ( x ) + Bu + L( y Cx )
Theorem:
The observer has exponentially stable error dynamics ( e = x x )
if the solution pair (P, Q) to:
( A LC ) T P + P( A LC ) = Q
satisfies: <
min (Q)
2 max ( P )
x& = 2 x + sin( x) + Bu
y = x
Note: this is pointless except for intuition since we know x
A=[-2], f(x)=[sin(x)], B=[1], C=[1]
10
2005
x& = 2 x + sin( x ) + u + L( x x )
The error dynamics are given by:
d
( x x ) = e& = (2 L)e + sin( x) sin( x )
dt
We would like: e& = e
Common sense analysis:
a. Bounded nonlinear term: for sin(x) is 1
b.
2 L + < 0 2 + L >
(2 L) T P + P(2 L) = Q
So: 2P(-2-L)=-Q
Choose Q=I=1 P =
1
2(2 + L)
<
min (Q)
2 max ( P )
11
So: 1 <
2005
1
< ( 2 + L)
2
2(2 + L)
1 < 2 + L L > 1
In the scalar case, it is easy to see how to choose L to give exponentially stable error dynamics. In
higher dimensions, it is not as easy to see how to choose L.
For most problems (for example, homework 7), you need to construct a gain matrix L. To do this,
use the algorithm on page 519 of the Raghavan paper distributed in class.
Raghavans method
Setup
x = Ax + f ( x) + Bu
y = Cx
Observer: x& = Ax + f ( x ) + Bu + L( y Cx )
Plant:
R = 2 I C T C
o Q = ( I + I )
o Solve for P: AP + PAT + PRP + Q = 0
o
1
PC T
2
L=
Implementation Notes
Set: R ' = R
Q' = Q
12
2005
x& = f ( x) + g ( x)u
y = h( x )
Can we find a nonlinear change of coordinates z = (x) such that:
z& = Az + K ( y, u )
y = Cz
where (A,C) is an observable pair.
Then a design such as:
z& = Az + K ( y, u ) + L( y Cz )
yields the following linear error dynamics:
~
z& = ( A LC ) ~
z
1
x = ( z )
(Nice linear design).
x& = f ( x) + g ( x)u
be transformed to
y = h( x )
z& = Az + K ( y, u )
?
y = Cz
13
2005
x& = f ( x)
y = h( x )
z = (x)
z& = Az + K ( y )
y = Cz
The results presented here are for SISO case, but can be extended.
Theorem:
A transformation z = (x) exists iff:
a. The row vectors dh, dL f h,..., dLnf1 h are linearly independent (observability condition).
dh
0
...
c.
r
qi also has to satisfy:
Note: This is an important result theoretically, but this is very difficult to satisfy.
Sliding Observers
Motivation
x&1 = x 2
x& 2 = k 2 sgn( x1 )
14
x&1 = x 2 k1 sgn( x1 )
x& 2 = k 2 sgn( x1 )
sliding patch
?
x1 x&1 = x1 [x 2 k1 sgn( x1 )] 0
15
2005
2005
x 2 avg
k1
k2
x 2 avg
k1
The k2/k1 term determines the size of the sliding patch, and how long it takes to converge.
One can also add damping. We can get better system performance by adding linear Luenbergertype terms.
x&1 = x 2 h1 x1 k1 sgn( x1 )
x& 2 = h2 x1 k 2 sgn( x1 )
(We measure x1).
Second-Order Example
16
x&1 = x 2
x& = f ( x , x )
1
2
2
z = x1 + v(t )
Observer structure:
~
x1 = x1 x1
x&1 = x 2 h1 ~
x1 k1 sgn( ~
x1 )
&
~
~
x 2 = f ( x1 , x 2 ) h2 x1 k 2 sgn( x1 )
The error dynamics are given by:
~
x&1 = ~
x 2 h1 ~
x1 k1 sgn( ~
x1 )
~&
~
~
x 2 = f ( x1 , x 2 ) f ( x1 , x 2 ) h2 x1 k 2 sgn( x1 )
The sliding patch is given by:
~
x 2 k1 .
k2
x 2 avg + Y ( x 2 avg )
k1
sgn( ~
x1 + v(t )) = 0
17
2005
2005
Nonlinear Compensators
Observers seldom work in isolation.
Consider the system:
x& = f ( x(t ), u (t ))
y = h( x(t ))
x& = g ( x (t ), y (t ), u (t ))
(*)
(**)
For a linear system, this can be analyzed and it can be shown that the eigenvalues decouple. For a
nonlinear system, there are only a few things that you can say about local behavior.
18
2005
(x = 0, x = 0)
~
x = x x u ( x ) u ( x) during the transient period.
Due to x (0) 0,
Design Method
a. The observer is designed for good state estimation, x (t ) x (t )
b. The controller is designed on the observed state estimate, that is x (t ) x d (t )
c. Implement the resulting control law on the physical model
Note:
x=~
x + x
If x 0 , then x x and x x d , so x x d
Second-Order Example
x&1 = x 2
x& = f ( x , x ) + u
1
2
2
z = y = x1
GOAL: x1 x1d (t )
a. Design the asymptotic observer
x&1 = x 2 + l1 ( x1 x1 ) = x 2 + l1 ( ~
~
x1 )
x& =
1
&
~&
~
x2 =
x 2 = f ( x1 , x 2 ) + u + l 2 ( x1 )
~
f l1 ( ~
x1 )
~
f l2 (~
x1 )
19
2005
S& = f ( x1 , x 2 ) + u + l 2 ~
x1 &x&1d + [x 2 + l1 ~
x1 x&1d ]
We choose u such that: S& = k1 S
u = f ( x1 , x 2 ) l 2 ~
x1 + &x&1d [~
x 2 + l1 ~
x1 x&1d ] k1 S
The terms containing l1 and l2 are due to the design of the control law being based on the
observer.
So the control law knows x1 x1 , and in steady-state these terms go to zero.
20