Nonlinear Observers: Control of Nonlinear Dynamic Systems: Theory and Applications J. K. Hedrick and A. Girard © 2005

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

Control of Nonlinear Dynamic Systems: Theory and Applications

J. K. Hedrick and A. Girard

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)

Introduction to Nonlinear Observers


Motivation
The big weakness of all the control methodologies that we have learned so far is that they require
the full state.
Sometimes impossible to measure.
Sometimes, possible, but expensive.

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

Methodologies learned so far:

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:

z is the measurement (of size px1)


M is the measurement matrix (of size pxn)
x is the state (of size nx1)
v(t) represents measurement noise (of size px1)

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.

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

Review of Linear Observers


Process:
Measurement:

x& = Ax + Bu + w(t )
z = M .x + v(t )

Let: x& = Ax + Bu + L( z Mx ) where the last term is basically a correction term ( z z )


The error dynamics are expressed by:

~
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:

A. Deterministic (Luenberger observer)


Ignore w(t), v(t).

~
x& = ( A LM ) ~
x and if (A,M) is observable, then the eigenvalues of (A-LM) can be placed

arbitrarily.

B. Stochastic (Kalman-Bucy filter)


L is chosen to minimize the variance of x x , the state estimation error.

x& = Ax + Bu + L( z Mx )
L = PM T R 1

(Intuition: if the variance is small make the gains large)


R and Q are noise statistics (R is associated with v)
Note that R-1 is identical to 1/r for scalars.

P& = AP + PAT + Q PM T R 1 MP
The steady-state Kalman filter is usually implemented. In that case the last equation becomes:

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

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

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

C=

2005

h
taken at the current operating point
x

Justification: the nonlinearities are treated as process noise.


As a preliminary to discussing deterministic nonlinear observers, lets review what Lipschitz
means.

Definition and Intuition for Lipschitz


f : n n
f is globally Lipschitz if there exists a (called the Lipschitz constant of f) such that:

( x1 , x 2 ),

Interpretation (in the scalar case)


( 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

In the scalar case, if f has a bounded derivative, f is Lipschitz.

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

Deterministic, Lyapunov-Based Nonlinear Observers:


Thaus Method
Let the plant be:

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

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

Theorem (Thau, 1973):


Under the above assumptions, the system given by:

~
x& = ( A LM ) ~
x + f ( x) f ( x )
x 0 as t ) if:
is globally asymptotically stable ( ~

<

min (Q)
2 max ( P)

where P and Q are defined by:

( 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:

min (Q) ~x ~x T Q~x max (Q) ~x


2

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

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 )

So for the observer structure:

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 <

Alternative Approach: Ragahvans Method


Reference: Raghavan, IJC

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 )

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

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

(This is proven in the IJC paper).


Let A0 P + P A0T + 2 P P + I I with *+

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

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

b. Solve the ARE


c. Check if P is symmetric and positive definite
(i)

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 .

Intuition for Thaus method

Setup and theorem:


Plant:

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 )

Intuition building example (hopefully)


Plant:

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

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

The observer is given by:

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.

e& = (2 L)e + ( = 1)e e& = [ 2 L + ]e

Condition for exponentially stable error dynamics:

2 L + < 0 2 + L >

We can get the same result using Thaus theorem:


a. = 1
b. Lyapunov equation

(2 L) T P + P(2 L) = Q
So: 2P(-2-L)=-Q
Choose Q=I=1 P =

1
2(2 + L)

Plug into Thaus equation:

<

min (Q)
2 max ( P )

11

(P, scalar = PT)

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

So: 1 <

Exact same result:

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:

Procedure (to get L)


Initialize , A, B, C
Initialize a small number (for example on the order of 0.1)
Initialize a flag P_not_positive_definite = 1
While (P_not_positive_definite)
o = /2

R = 2 I C T C

o Q = ( I + I )
o Solve for P: AP + PAT + PRP + Q = 0
o

o Check if P is positive definite and update flag


End while

1
PC T
2

L=

Implementation Notes

The command are in MATLAB solves Ricatti equations of this form:

A'T P + PA' PR' P + Q' = 0


A' = AT

Set: R ' = R
Q' = Q

12

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

To check positive definiteness, use the command chol (sets a flag).

Exact Linearization Geometric Observers


Observers with linearized error dynamics
Suppose we are given:

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 )

Question: When can

z& = Az + K ( y, u )
?

y = Cz

There are two primary results:


Systems with no inputs
Krenner and Isidori, Systems and Control Letters, Vol. 3, 1983
Systems with inputs
Marino, IEEE Transactions on Automatic Control, Vol. 35, September 1990

Systems with no control input

13

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

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).

b. The unique vector solution, qi , to the following equation:

dh
0
...

q ( x) = ... satisfies q, ad k q = 0 for k =1, 3, , (2n-1)


f
...
0
n 1

1
dL f h

c.

r
qi also has to satisfy:

[q, ad q] = 0 for k =0,1, , n-2


k
f

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

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

Add a term to the first channel:

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

Find a patch, test slightly negative and slightly positive.


Lets try x1 > 0 ( x 2 k1 ) 0
The sliding patch is x 2 k1 .

15

2005

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

On the sliding patch, x1avg 0 and x&1avg 0


If x&1 = 0 , then 0 = x 2 avg k1 sgn( x1 ) sgn( x1 )

We then have: x& 2 avg =

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

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

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 .

On the sliding patch, x1avg 0 and x&1avg 0


We then have: x& 2 avg
What about sensor noise?

k2
x 2 avg + Y ( x 2 avg )
k1
sgn( ~
x1 + v(t )) = 0

One possible adaptation is to add a dead zone:

17

2005

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

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.

Theorem (Vidyasagar, IEEE TAC)


On stabilization of nonlinear systems using state detection, 1980.
Assume f is continuously differentiable with f(0,0)=0, h is continuous and h(0,0)=0.
If:
a. u(t)=m(x(t)) is a uniformly asymptotically stable control law to x = 0 for the combined
system (*) + (**)
b. The system (**) is an observer for system (*), that is:

x (t ) x(t ) 0 uniformly and asymptotically


Then:

18

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

(x = 0, x = 0)

is a uniformly asymptotically stable equilibrium point of (*) + (**) under the


control law u(t)=m(x(t)).
Note: this is a local result.

Nonlinear Compensator Design


Problems can occur due to peaking (large errors during the transient period).

~
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 )

Assuming that f is Lipschitz and we can find l1 and l2, ~


x 0

19

Control of Nonlinear Dynamic Systems: Theory and Applications


J. K. Hedrick and A. Girard

2005

b. Design the control law


Let S = x 2 x&1d + [x1 x1d ]
(Note: we dont use x1 in the control surface, or we would have to differentiate the measurement,
which is bad because it introduces a lot of noise).

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

You might also like