Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
14 views

Cos Lecture Notes 2016

A very nice description of COE1
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Cos Lecture Notes 2016

A very nice description of COE1
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 96

lOMoARcPSD|35905196

COS-Lecture Notes 2016

Control Engineering 1 (Syddansk Universitet)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)
lOMoARcPSD|35905196

Control Systems
M.Sc. in Mechatronics
Lecture Notes.

Lecturer: Jerome Jouffroy

September 2016

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

Contents

1 Signal And System Representations 3


1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 A few systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Block Diagrams and Matlab/Simulink . . . . . . . . . . . . . . . 9
1.4 State-Space Representation . . . . . . . . . . . . . . . . . . . . . 13
1.4.1 The State-Vector and the State-Space . . . . . . . . . . . 13
1.4.2 State-Space representations of Linear Time Invariant (LTI)
Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4.3 Nonlinear State-Space representations . . . . . . . . . . . 16
1.5 Combining State-Space representations . . . . . . . . . . . . . . . 17
1.5.1 Cascade/Hierarchy structure . . . . . . . . . . . . . . . . 17
1.5.2 General Feedback Combination . . . . . . . . . . . . . . . 18
1.6 Bridges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.6.1 From continuous to discrete-time state-space representa-
tions: discretization using the Euler Method . . . . . . . . 19
1.6.2 From ODEs to State-Space representations . . . . . . . . 20

2 Controllability and Open-Loop control 25


2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.2 Controllability and the Kalman criterion . . . . . . . . . . . . . . 26
2.2.1 Controllability notions . . . . . . . . . . . . . . . . . . . . 26
2.2.2 Mathematical preliminaries . . . . . . . . . . . . . . . . . 27
2.2.3 The Kalman criterion . . . . . . . . . . . . . . . . . . . . 28
2.2.4 Controllability and Controllability Canonical Form (CCF) 30
2.3 Open-Loop control . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.3.1 Open-Loop Control and the Controllability Canonical Form 32
2.3.2 Computing polynomial trajectories . . . . . . . . . . . . . 34
2.3.3 General LTI Systems . . . . . . . . . . . . . . . . . . . . . 35
2.4 Flatness Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.4.1 The linear case . . . . . . . . . . . . . . . . . . . . . . . . 40
2.4.2 The nonlinear case . . . . . . . . . . . . . . . . . . . . . . 43
2.5 Concluding remarks on open-loop control . . . . . . . . . . . . . 45

3 Stability and State-Feedback 46


3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.2 Stability of Linear Time-Invariant systems . . . . . . . . . . . . . 48
3.2.1 A stability result for Transfer Functions . . . . . . . . . . 48

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

CONTENTS

3.2.2 Stability criterion for non-controlled state-space represen-


tations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.3 Stabilization of LTI systems by state feedback . . . . . . . . . . . 51
3.3.1 Basic principle . . . . . . . . . . . . . . . . . . . . . . . . 51
3.3.2 Eigenvalue assignment/pole placement for the controlla-
bility canonical form . . . . . . . . . . . . . . . . . . . . . 52
3.3.3 Pole placement: the general case . . . . . . . . . . . . . . 55
3.4 Linear state-feedback for nonlinear systems . . . . . . . . . . . . 56
3.4.1 Equilibrium Points . . . . . . . . . . . . . . . . . . . . . . 56
3.4.2 Linear approximation of a nonlinear system . . . . . . . . 58
3.4.3 Stabilizing a nonlinear system by linear state-feedback . . 62
3.5 More applications of linear state-feedback . . . . . . . . . . . . . 63
3.5.1 Stabilization of a linear system around an equilibrium point 63
3.5.2 Tracking control for linear systems . . . . . . . . . . . . . 64
3.6 Integration using linear state-feedback . . . . . . . . . . . . . . . 65
3.6.1 Basic principle . . . . . . . . . . . . . . . . . . . . . . . . 65
3.6.2 Integral feedback law for systems in controllability canon-
ical form . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.6.3 General LTI systems . . . . . . . . . . . . . . . . . . . . . 68
3.6.4 Stabilization around an equilibrium point . . . . . . . . . 69
3.6.5 Polynomial disturbances . . . . . . . . . . . . . . . . . . . 69
3.6.6 A link with PID control . . . . . . . . . . . . . . . . . . . 70
3.7 Linearization by state-feedback: a tiny introduction to nonlinear
state-feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

4 Observability and state estimation 75


4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.2 Observability and the Kalman criterion . . . . . . . . . . . . . . 75
4.2.1 Observability notions . . . . . . . . . . . . . . . . . . . . . 75
4.2.2 Observability of linear systems and the role played by inputs 77
4.2.3 A criterion to check observability . . . . . . . . . . . . . . 78
4.3 State estimation using observers . . . . . . . . . . . . . . . . . . 80
4.3.1 The observer as a virtual plant . . . . . . . . . . . . . . . 80
4.3.2 Feedback on the measurement . . . . . . . . . . . . . . . . 82
4.4 The Observability Canonical Form and observer tuning . . . . . 83
4.5 Observer tuning for the general case . . . . . . . . . . . . . . . . 86
4.6 Output feedback using an observer . . . . . . . . . . . . . . . . . 90
4.6.1 Basic idea . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
4.6.2 Application to tracking control . . . . . . . . . . . . . . . 90
4.7 A super tiny introduction to Kalman filtering . . . . . . . . . . . 91
4.7.1 Observer tuning and the ‘place’ Matlab function . . . . . 91
4.7.2 The Kalman Filter as an observer . . . . . . . . . . . . . 92
4.7.3 The Extended Kalman Filter (EKF) . . . . . . . . . . . . 93

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

Chapter 1

Signal And System


Representations

1.1 Introduction

Figure 1.1: Diagram of a dynamical system

Traditionally, picturing a dynamical system Σ in the context of classical control


theory is roughly summarized in the figure above (see fig 1.1). Variable u(t) is a
signal/stimuli whose variations have some effect on the behavior of system Σ .
u(t) is called the control input. Variable y(t) is a signal representing a selected
part of the dynamics of the system. It typically represents what is measured.

Example : A car as a dynamical system?


• The speed of the car is what is usually measured, ie it is therefore y(t).
• Let us take the gas pedal position as the control input u(t).

In what is called classical control theory, the system Σ will be mathematically


described by a so-called Transfer Function, which, roughly speaking, is a Laplace
domain representation of the relation between the input and the output (or in
the z-domain if the time is discrete).
This kind of representation is mostly made for systems with only one input, one
output systems, which are linear and have constant parameters. As we will see,
many systems do not fit into this category.

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.2. A FEW SYSTEMS

In this course, mostly focused on what is called Modern Control Theory, we will
use State-space representation, which allow to represent more different kinds of
systems than Transfer Functions.

1.2 A few systems


Most systems in this course will be described by ordinary differential equations,
ODEs for short. However, many mathematical models are also described using
difference equations where the time variable k is discrete.

Example: Bank Account with Interest Rate


Consider a bank account with an interest rate of 3% per year. We have an initial
deposit of y0 = 10000DKK. The model of this relatively simple system can be
given as:

y(k + 1) = (1 + 0.003)y(k), y(0) = y0 = 10000DKK (1.1)

where the unit of k is the year, and y(k) represents the amount of money on
the bank account at year k.
In the present situation, the dynamical behavior of the system depends only on
the initial condition y(0).
Adding an input to this system corresponds to an influx of money. Therefore
the new model with an input can be represented with the following:

y(k + 1) = 1.03y(s) + u(k), y(0) = y0 = 10000DKK (1.2)

Coming back to ODEs, a first we–known system, very important in mecha-


tronics, is the Mass-Spring-Damper system.

Example: Mass-Spring-Damper system


A second order linear differential equation will mathematically represent the
system shown in figure 1.2:

mÿ(t) + dẏ + ky(t) = u(t) (1.3)

where y(0) is the initial position of mass and ẏ(0) is the initial velocity of mass.

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.2. A FEW SYSTEMS

Figure 1.2: Mass-Spring-Damper System

Other systems can be modeled by a combination of ODEs.

Example: Pharmacokinetics using compartment model

Figure 1.3: Compartment Model

In many situations, a drug for a part of the body will be injected from another
part (think aspirine for the blood injested into the stomach through the mouth
for example). Hence the drug will propagate from place to place until it reaches
the right concentration in the “target organ”.

To model this, the compartment model diagram is used (see figure 1.3),
where V1 and V2 are the constant volume of each compartment, and c1 , c2 are
the time-varying drug concentrations in each compartment. A drug of con-
centration c0 is injected in compartment 1 at a volume flow rate u(t) (control
input). Constant parameters q0 and q are outflow rates resulting in a decrease
of concentration over time.
¨ The differential equations representing this systems is given below.
(
V1 c˙1 = q (c2 (t) − c1 (t)) − q0 c1 (t) + c0 u(t)
(1.4)
V2 c˙2 = q (c1 (t) − c2 (t)))

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.2. A FEW SYSTEMS

with
y(t) = c2 (t) (1.5)
since what we interested in is to monitor c2 (t).

Other systems are inherently nonlinear in their nature. In this case, Laplace
transforms do not apply, and their dynamical properties are generally studied
based on their differential equation representation.

Example: Pendulum

Figure 1.4: Pendulum

Consider the following simple model of a pendulum without friction and subject
to a gravity field
ml2 θ̈(t) + mgl sin θ(t) = 0 (1.6)
where the measurement and the initial conditions are given by

y(t) = θ(t), θ(0) = θ0 , θ̇(0) = ω0

and the parameters m, l and g represent the mass of the pendulum “tip”, the
length of the pendulum and the gravity constant, respectively.
Adding rotational damping to the system gives

ml2 θ̈(t) + dθ l2 θ̇(t) + mgl sin θ(t) = 0 (1.7)

while adding an external torque T (t) to the pendulum gives

ml2 θ̈(t) + dθ l2 θ̇(t) + mgl sin θ(t) = τ (t) (1.8)

where the control input is therefore

u(t) = τ (t)

Another well-known dynamical system combining linear and nonlinear dy-


namics is the so-called Lorenz system. This system is at the origin of Chaos
Theory (the butterfly effect, anyone?).

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.2. A FEW SYSTEMS

Example: Lorenz System


One of the different version of the Lorenz system is given by the 3 following
coupled differential equations

ẋ1 = −px1 + px2

ẋ2 = −x1 x3 − x2 (1.9)

ẋ3 = x1 x2 − x3

where p is a constant.

To finish with this set of relatively simple examples, let us mention the field
of mobile robotics, which is rich with systems which are nonlinear and have
several inputs and outputs.

Example: The 2-Wheeled Robot

Figure 1.5: 2-Wheeled Robot

A 2-wheeled robot can be mathematically described by the following equations:



ẋ1 (t) = u1 (t) cos θ(t)

ẋ2 (t) = u1 (t) sin θ(t) (1.10)

θ̇(t) = u2 (t)

where x1 (t), x2 (t) represent the position of the robot in the plane, and θ(t) the
orientation of the robot. The robot is steered by the longitudinal velocity u1 (t)
and the rotational velocity u2 (t).

Hence if we would like to monitor all 3 of the dynamic variables, we have

y1 (t) = x1 (t), y2 (t) = x2 (t), y3 (t) = θ(t)

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.2. A FEW SYSTEMS

while we clearly also have the 2 control inputs

u1 (t), u2 (t)

The so-called car-like robot is obtained by only slightly modifying the equa-
tions of the 2-wheeled robot.

Example: Car-like Robot

Figure 1.6: Car-like Robot

Consider the following mathematical representation



ẋ1 (t) = v(t) cos θ(t)

ẋ2 (t) = v(t) sin θ(t) (1.11)
θ̇(t) = v(t)

L tan δ(t)

with the following inputs

u1 (t) = v(t), u2 (t) = δ(t)

where δ(t) represents the steering angle of the front wheels of the car, and L is
the constant length between the rear axis and the front axis.

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.3. BLOCK DIAGRAMS AND MATLAB/SIMULINK

1.3 Block Diagrams and Matlab/Simulink


To simulate systems, Matlab/Simulink uses a graphical representation of sys-
tems called “block diagrams”. This kind of representation is very much in use
in control systems.
To build a block diagram, one typically combines a number of basic blocks by
linking them together. See below a few of these basic blocks.

• Summator

Figure 1.7: Summator

• Gain

Figure 1.8: Gain

• Integrator

Figure 1.9: Integrator

• Differentiator

Figure 1.10: Differentiator

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.3. BLOCK DIAGRAMS AND MATLAB/SIMULINK

• Multiplier

Figure 1.11: Multiplier

The next step consists in linking them to implement/realize a system, often


represented mathematically as a differential equation. Let us see that through
a simple example.

Example: Block diagrams for a linear first-order differential equation


Consider the following first-order linear differential equation given by
d
y(t) = −3y(t), y(0) = 6 (1.12)
dt
A first simple block diagram implementation consists in connecting a differen-
tiator block with a gain as in figure 1.12.

Figure 1.12: Block diagram of a first-order system: the differentiator solution

First note that the initial condition is not present and therefore not ac-
counted for. This is not difficult to solve, and can be done by simply adding a
constant input to signal y(t).
However, the problem is that this solution is typically quite sensitive to noise or
discretization errors, mostly due to the effect that differentiation has on high-
frequency signals (ie it amplifies them).

Hence another possible solution consists in using a integrator. Indeed,


Z t
ẏ(τ )dτ = y(t) − y(0) (1.13)
0

10

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.3. BLOCK DIAGRAMS AND MATLAB/SIMULINK

which obviously gives Z t


y(t) = ẏ(τ )dτ + y(0) (1.14)
0
or, in block diagram dialect

Figure 1.13: Integration of a time-derivative

The above solution is now quite robust to noise thanks to the smoothing
properties of the integrator.

Hence, system (1.12) can be implemented/represented by the block diagram


hereafter

Figure 1.14: Block diagram of a first-order system: the integrator solution

or, using another notation to incorporate the initial condition into the inte-
grator

11

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.3. BLOCK DIAGRAMS AND MATLAB/SIMULINK

Figure 1.15: A different notation for the integrator solution

Exercises
Make a block diagram for each system described in section (1.2).

Simulating systems represented by difference equations where the time is


discrete is not more difficult. In this case, instead of an integrator, we just use
the following unit delay block

Figure 1.16: The unit delay block

With this block, we can now go back to our bank account example, which is
represented by

Figure 1.17: Block account for the bank account example

And similarly for multi-dimensional, nonlinear, time-varying systems or a


combination thereof.

12

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.4. STATE-SPACE REPRESENTATION

1.4 State-Space Representation


These representations are at the basis of modern control theory, and many con-
trol concepts such as stability, controllability and observability are defined using
state-space representations. As we will see, the power of these representations
lies in their ability to describe a wide range of systems, including nonlinear sys-
tems, as well as their great usefulness when it comes to demonstrating important
dynamical properties, mostly coming from the relative simple way state-space
representations are defined.

1.4.1 The State-Vector and the State-Space


Introduce first a vector x(t) taking values in Rn (mathematically, write x(t) ∈
Rn ). We call this vector the state vector or simply state, while the space Rn
is called the State-Space. In state-space representations, ie centered around the
state vector and the state-space concepts, a particularity is that the knowledge
of the state vector x of a considered system at instant t0 is enough to know the
future evolution of this system for all t ≥ t0 .

Example: A simple discrete-time system


Consider a system described by the following set of difference equations:
(
x1 (t + 1) = x2 (t), x1 (0) = 1
(1.15)
x2 (t + 2) = x1 (t), x2 (0) = 0

In the above system the state vector is the vector of dimension 2 defined by
 
x (t)
x(t) := 1 (1.16)
x2 (t)

So that the state space is R2 . Let us now draw a simple 2-dimensional graphical
representation of the evolution of this state at time t = 0, 1, 2, 3. For initial
conditions set as above (ie x(0) = [1, 0]T ), this evolution can be seen in figure
1.18a:

(a) State evolution for system (b) Initial conditions changed to


(1.15). x(0) = [1, −1]T

Figure 1.18: Graphical representation of the evolution of state vector x(t)

13

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.4. STATE-SPACE REPRESENTATION

If we now modify only the initial conditions of system (1.15) to x(0) =


[1, −1]T , it is easy to obtain the new values of the state for different subsequent
times, as represented in figure 1.18b.

This means that knowing x at time t = 0 is enough to know the evolution of


x(t) for all t ≥ t0 . Hence the vector/variable we have chosen for system (1.15)
is indeed a valid state vector.

Generally speaking, state-space representations are described by a system


of first-order difference or differential equations with the state-vector as the
delayed or differentiated variable. This is obviously the case in the previous
example.

Let us see now another example.

Example: Fibonacci sequence


Consider the system described by the difference equation:

F (t + 2) = F (t + 1) + F (t) (1.17)

The order is 2, so we need 2 initial conditions which are set to

F (1) = 1, F (0) = 0

The first observation one can make is that since system (1.17) is of order 2, then
it is not a state-space representation.
Let us now consider the variable F (n). Could this be a valid state vector? If that
were the case, then this would mean that knowning F (0) would be sufficient to
obtain F for any future n, which is not the case since we also need F (1)! Hence
dynamic variable F (n) is not a state vector.

1.4.2 State-Space representations of Linear Time Invari-


ant (LTI) Systems
We would like to extend the above ideas to have a linear representation contain-
ing a dynamic part responsible for the evolution of the state, and also allows
for the addition of external control signals.
Hence we have the two following linear state-space representations given below,
one for continuous-time system, the other for discrete-time ones.

Continous-Time: Linear State-Space Representation


x(t + 1) = A.x(t) + B.u(t), x(0) = x0 (1.18)
where the vectors and matrices have the dimensions

x ∈ R, A ∈ Rn×n , u ∈ Rm , B ∈ Rn×m

and where u(t) is called the control input vector.

14

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.4. STATE-SPACE REPRESENTATION

Discrete-Time: Linear State-Space Representation


ẋ(t) = Ax(t) + Bu(t), x(0) = x0 (1.19)
again with
x ∈ R, A ∈ Rn×n , u ∈ Rm , B ∈ Rn×m
Some systems of differential equations are directly or almost directly put
into a state-space representation. Let us see that with the example below.

Example: The Compartment model as a linear state-space represen-


tation
Let take again the system represented by
(
V1 c˙1 = q (c2 (t) − c1 (t)) − q0 c1 (t) + c0 u(t)
(1.20)
V2 c˙2 = q (c1 (t) − c2 (t)))

Let us then define the state as


   
x1 (t) c1 (t)
x(t) := = (1.21)
x2 (t) c2 (t)
To obtain a “legit” state-space representation, isolate the terms in ẋ as follows
(
ċ1 (t) = Vq1 (c2 (t) − c1 (t)) − Vq01 c1 (t) + Vc01 u(t)
(1.22)
ċ2 (t) = Vq2 (c1 (t) − c2 (t))

and put this component form into a vectorial/matrix form to obtain the state-
space representation:
  q
− V1 − Vq01 q 
   c0 
c˙1 (t) V1 c1 (t)
= q q + V1 u(t) (1.23)
c˙2 (t) V2 − V2 c 2 (t) 0
Coming back to the general representations, equations (1.18) and (1.19)
are often called dynamic equations in a state-space representation context. In
order to represetn outputs of interest, for example parts of the state that are
measured by sensors, it is common to add to the dynamic equation a so-called
output equation so that we obtain:
(
ẋ(t) = Ax(t) + Bu(t), x(0) = x0
(1.24)
y(t) = Cx(t) + Du(t)

where
y ∈ Rp , C ∈ Rp×n , D ∈ Rp×m

Example: Compartment continued


Coming back to our previous example, we assume now we measure only c2 (t) or
equivalently x2 (t), which means that we have y(t) = c2 (t) = x2 (t). In vectorial
form, this gives
 
  c1 (t)  
y(t) = 0 1 + 0 u(t) = Cx(t) + Du(t) (1.25)
c2 (t)

15

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.4. STATE-SPACE REPRESENTATION

1.4.3 Nonlinear State-Space representations


In the nonlinear case, matrices of the linear state-space representations are
replaced by a vector field or multi-dimensional function.
This, if the system is without control input, a state-space representation will
have the following form

ẋ(t) = f (x(t)), continous-time (1.26)

or, for the discrete-time version

x(t + 1) = f (x(t)), discrete-time (1.27)

where f is a vector field taking values in Rn , ie we have

f : Rn → Rn (1.28)

Example: The Lorenz System


This system is already described in state-space form since all the differential
equations are of first order

ẋ1 = −px1 + px2

ẋ2 = −x1 x3 − x2 (1.29)

ẋ3 = x1 x2 − x3

where p is a constant. Let us then define the state as:


 
x1 (t)
x(t) = x2 (t) (1.30)
x3 (t)

So that for f : R3 → R3 :
   
−px1 (t) + px2 (t) f1 (x1 , x2 , x3 )
f (x(t)) = −x1 (t)x3 (t) − x2 (t) = f2 (x1 , x2 , x3 ) (1.31)
x1 (t)x2 (t) − x3 (t) f3 (x1 , x2 , x3 )

When inputs are included in the representation, vector field f also depends
on u(t) and we have
ẋ(t) = f (x(t), u(t)) (1.32)
and similarly for discrete time systems. An output equation, also nonlinear, can
be added:
y(t) = h (x(t), u(t)) (1.33)
where h is another vector field.

16

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.5. COMBINING STATE-SPACE REPRESENTATIONS

1.5 Combining State-Space representations


Combining State-Space representations gives another State-Space representa-
tion, just a larger one, which, in the linear case, can be written in a vectorial
form. This perspective can be quite useful to understand the structure of a
system, ie to distinguish the subsystems composing it.

1.5.1 Cascade/Hierarchy structure

Figure 1.19: Hierarchy Structure

Consider two systems Σ1 and Σ2 represented by

ẋ1 = A1 x1 + B1 u1 and ẋ2 = A2 x2 + B2 u2 (1.34)

where we assume for simplicity that dim(u2 ) = dim(x1 ).


Then, if we connect these systems together as shown in figure 1.19, what will
a new State-Space representation be? To see that, first simply state that con-
necting Σ1 to Σ2 in cascade means that we have

x1 = u2 (1.35)

so that the original system


(
ẋ1 = A1 x1 + B1 u1
(1.36)
ẋ2 = A2 x2 + B2 u2

becomes (
ẋ1 = A1 x1 + B1 u1
(1.37)
ẋ2 = A2 x2 + B2 x1
This can be written in the following State-Space form
    
ẋ1 A1 0 x1  
= + B1 u1 (1.38)
ẋ2 B2 A2 x2

If, instead, Σ2 is connected to Σ1 , we have


    
ẋ1 A1 B 1 x 1  
= + B2 u2 (1.39)
ẋ2 0 A2 x2

17

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.5. COMBINING STATE-SPACE REPRESENTATIONS

1.5.2 General Feedback Combination


If now, Σ2 is connected to Σ1 and the output would be fed back to the input of
Σ1 , the representation would look like this
    
ẋ1 A1 B1 x1
= (1.40)
ẋ1 B2 A2 x2

18

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.6. BRIDGES

1.6 Bridges
Mathematical bridges or transformations between systems that are described
mathematically can be very useful, not only for finding interesting theoretical
results, but also for more practical-related matters.
The first one which we will see afterwards concerns the actual implentation
of our continuous-time systems on a digital computers, ie how to discretize a
system by a simple program written in C or pure Matlab (ie no Simulink).

1.6.1 From continuous to discrete-time state-space repre-


sentations: discretization using the Euler Method
The Euler method is probably the crudest and simplest method of discretizing
an ODE. However, it is still very widely used because it can quite often be
enough to give satisfactoty results.
Principle: Approximate a first-order derivative by a difference in time. Thus,
discretizing
ẋ(t) = f (x(t), u(t)) (1.41)
gives, after discretization,
x(t + 1) − x(t)
= f (x(t), u(t)), Ts : Sampling period (1.42)
Ts
Finally, we have the following discrete-time state-space representation

x(t + 1) = x(t) + Ts f (x(t), u(t)) = f ′ (x(t), u(t)) (1.43)

Example: The Lorenz System


Consider the following system

ẋ1 (t) = −px1 (t) + px2 (t)

ẋ2 (t) = −x1 (t)x3 (t) − x2 (t) (1.44)

ẋ3 (t) = x1 (t)x2 (t) − x3 (t)

Discretizing this system using the Euler method gives



x1 (t+1)−x1 (t)

 Ts = −px1 (t) + px2 (t)



x2 (t+1)−x2 (t)
Ts = −x1 (t)x3 (t) − x2 (t) (1.45)



 x3 (t+1)−x3 (t) = x (t)x (t) − x (t)

Ts 1 2 3

from which we can now obtain the following discrete-time state-space represen-
tation 
x1 (t + 1) = x1 (t) + Ts [−px1 (t) + px2 (t)]

x2 (t + 1) = x2 (t) + Ts [−x1 (t)x3 (t) − x2 (t)] (1.46)

x3 (t + 1) = x3 (t) + Ts [x1 (t)x2 (t) − x3 (t)]

It is quite important to note that choosing the sampling period obviously depend
on the system dynamics. A fast system will generally need a small Ts while a
slow one will do with a larger sampling period.

19

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.6. BRIDGES

1.6.2 From ODEs to State-Space representations


Obviously, ODEs can be of any order, while State-Space Representations are
exclusively of first order. While State-Space Representations are widely used in
control systems, ODEs come naturally when modeling many physical systems
(especially mechanical systems, ie many of second order).
If we are to control them, we should find a way to obtain a State-Space
representation out of systems modelled by ODEs. We give below a few tips on
how to do that (note: we consider only systems with 1 input and 1 output).
Consider the following differential equation

y (n) (t) + an−1 y (n−1) (t) + ... + a1 ẏ(t) + a0 y(t) = bu(t) (1.47)

which is a linear equation of order n.


Main idea: Define a state vector x(t) that contains y(t) and the derivatives of
y(t).    
x1 (t) y(t)
 x2 (t)   ẏ(t) 
   
x(t) =  x3 (t)  =  ÿ(t) (1.48)
   
 ..   ..


 .   . 
xn (t) y (n−1) (t)
A State-Space Representation relates ẋ(t) to x(t):
   
ẏ(t) x2 (t)
 ÿ(t)   x3 (t) 
ẋ(t) =  ..  =  .. (1.49)
   

 .   . 
(n) (n)
y (t) y (t) = ẋn (t)

Then, by isolating the highest-order derivative, i.e. by computing

y n (t) = −a0 y(t) − a1 ẏ(t) − ... − an−1 y (n−1) (t) + b.u(t) (1.50)

we get the component form




 x2 (t)

x3 (t)

ẋ(t) = . (1.51)
..



−a0 x1 (t) − a1 x2 (t) − ... − an−1 xn (t) + b.u(t)

which can then be put under a vectorial/matrix form


    
ẋ1 (t) 0 1 0 0 ... 0 x1 (t)  
 ẋ2 (t)   0 0
   0 1 0 ... 0 
 x2 (t)

  0
 ẋ3 (t)   0 0 0 1 ... 0 x3 (t)
  .. 
   
..  =  .. .. .. .. ..  +  .  u(t)
..
   
 .. 

 .   .
  . . . . . 
 .
  
  0
ẋn−1 (t)  0 0 0 0 ... 1   xn−1 (t)
b
ẋn (t) −a0 −a1 −a2 −a3 ... −an−1 xn (t)
(1.52)

20

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.6. BRIDGES

so that we have the following A and B matrices


 
0 1 0 0 ... 0  
 0 0
 0 1 0 ... 0 
 0
 0 0 0 1 ... 0 .
  
A= . .. .. .. ..  and B =  ..  (1.53)
 
 .. ..
 . . . . . 

 
0
 0 0 0 0 ... 1 
b
−a0 −a1 −a2 −a3 ... −an−1

Example: Mass-Spring-Damper System


Consider the following mass-spring-damper system

mÿ(t) + dẏ(t) + ky(t) = u(t) (1.54)

We would like to find a state-space representation for this system.

Start by defining the state as


     
x (t) y(t) ẏ(t)
x(t) = 1 := ⇒ ẋ(t) = (1.55)
x2 (t) ẏ(t) ÿ(t)

and isolate the highest-order derivative


d k 1
ÿ(t) = − ẏ(t) − y(t) + u(t) (1.56)
m m m
so that we have the state-space representation
    
0 1 x1 (t) 0
ẋ(t) = k d + u(t) (1.57)
−m −m x2 (t) 1/m
 
  x1 (t)
y= 0 1
x2 (t)
Important remark: At this point, it is important to insist on the fact that
the definition is state is something which is decided upon.
Hence one can have many different state-space representations corresponding to
a single system, as there are many possible ways to define the state.

Example: Second order system


Consider the system described below

ÿ + a1 ẏ + a0 y = bu (1.58)

and let this time the state vector be defined by


 
1 d 1 1
x1 := y, x2 := y = ẏ (1.59)
b dt b b

Hence, using (1.59) we obtain the derivative of the state


1
ẋ1 = x2 , ẋ2 = ÿ (1.60)
b

21

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.6. BRIDGES

and putting (1.60) into (1.58), we get


1 a1 a0
ÿ = − ẏ − y + u (1.61)
b b b
and replacing with our state definitions x1 x2 :

ẋ2 = u − a1 x2 − a0 x1 (1.62)

we have the following state-space representation:


      
ẋ1 0 1 x1 0
= + u (1.63)
ẋ2 −a0 −a1 x2 1
 
  x1
y= b 0
x2
which is different from a state-space representation obtained by the usual defi-
nition of the state, ie
      
ẋ1 0 1 x1 0
= + u (1.64)
ẋ2 −a0 −a1 x2 b
 
  x1
y= 1 0
x2
Thus, we can see that two different state-space representations can be obtained
starting with the same dynamical system.

Derivatives of the input


State-space representations can also be obtained for linear equations containing
derivatives of the input signal, ie we start with

y (n) (t) + an−1 y (n−1) (t) + ... + a1 ẏ(t) + a0 y(t)


= bn−1 u(n−1) (t) + bn−2 u(n−2) (t) + · · · + b1 u̇(t) + b0 u(t) (1.65)

A corresponding state-space representation reads


     
ẋ1 (t) 0 1 0 0 ... 0 0
 ẋ2 (t)   0 0 1 0 ... 0  0
     
 ẋ3 (t)   0 0 0 1 ... 0  0
..  =  .. .. .. .. . x(t) +  ..  u(t) (1.66)
     
 .. .. 


 .   .
  . . . . 
.
 
ẋn−1 (t)  0 0 0 0 ... 1  0
ẋn (t) −a0 −a1 −a2 −a3 ... −an−1 1

and  
y = b0 b1 b2 ··· bn−1 x(t) (1.67)
for the output equation. Note that, if this state-space representation is very
similar to the one we obtained without derivatives in the input, the definition of
the state is generally more complicated than the simple x(t) = [y(t), ẏ(t), · · · ]T .

22

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.6. BRIDGES

Discrete-Time Systems
The reasoning is almost the same for discrete-time systems. Indeed, in this case,
consider instead the difference equation of order n
y(t + n) + an−1 y(t + n − 1) + ... + a1 y(t + 1) + a0 y(t) = bu(t) (1.68)
Define then the state vector as
 
y(t)

 y(t + 1) 

x(t) :=
 y(t + 2) 
..
 
 
 . 
y(t + (n − 1))
and calculate the state vector at time t + 1, ie
   
y(t + 1) x2 (t)
 y(t + 2)   x3 (t) 
   
x(t + 1) =  y(t + 3)  =  x4 (t)  (1.69)
   
 ..   .. 
 .   . 
y(t + n) −a0 x1 (t) − a1 x2 (t)... − an−1 xn (t)
so that we have
 
0 1 0 0 ... 0  
0

 0 0 1 0 ... 0 
 0
 0 0 0 1 ... 0 
.
 
x(t + 1) =  .. .. .. .. ..  x(t) +  ..  u(t) (1.70)
 
..

 . . . . . . 

 
0
 0 0 0 0 ... 1 
b
−a0 −a1 −a2 −a3 ... −an−1
with the output equation
 
y= 1 0 ... 0 x(t) (1.71)

Example: The Fibonacci Sequence


Let us go back to the Fibonacci sequence described by
y(t + 2) = y(t + 1) + y(t) (1.72)
with the 2 inital conditions
y(1) = 1, y(0) = 0
To find a state-space representation, start with the definition of a state vector
       
x1 (t) y(t) y(t + 1) x2 (t)
x(t) = := ⇒ x(t + 1) = = (1.73)
x2 (t) y(t + 1) y(t + 2) x1 (t) + x2 (t)
which gives    
x (t + 1) 0 1
x(t + 1) = 1 = x(t) (1.74)
x2 (t + 1) 1 1
     
  x1 (t) y(0) 0
y(t) = 1 0 , x(0) = = (1.75)
x2 (t) y(1) 1

23

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

1.6. BRIDGES

Nonlinear Systems
Generally, not all nonlinear ODEs can be converted to state-space representa-
tions, and this is a topic of current research.
For example, the nonlinear system

ÿ = y u̇2 (1.76)

cannot be transformed into a state-space representation. This system is then


said to be nonrealizable.

However, in many cases, it is possible to obtain a State-Space representation


of nonlinear systems by using the same reasoning as for the linear systems in
previous examples. Let us show this through the following example.

Example: state-space representation for the Pendulum/Robot elbow


Take again the pendulum equation

ml2 θ̈ + mgl sin θ = u, y=θ (1.77)

Isolating the highest-order equation


g 1
θ̈ = − sin θ + u, y=θ (1.78)
l ml2
and defining the state vector as
   
x1 (t) θ(t)
x(t) = := (1.79)
x2 (t) θ̇(t)

which gives the following state-space representation


 
x2 (t)
ẋ(t) = (1.80)
− gl sin x1 (t) + ml1 2 u(t)

24

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

Chapter 2

Controllability and
Open-Loop control

2.1 Introduction
In the previous chapter, we spent some time modeling and simulating systems
towards control systems applications. In this chapter, we will focus on comput-
ing a control signal u(t) so that x(t) or y(t) will follow a pre-defined pattern.
Note first that by saying that, we are not talking at all about feedback. Indeed,
as useful as it is, feedback is not the only way to control a system.
Open-loop or feedfoward control is another very important concept, which we
will see in the present chapter.

An open-loop or feedforward controller uses the knowledge on the system


model and a desired behavior/trajectory xd (t)/yd (t) to compute the desired
actions ud (t).

Figure 2.1: Feed-Forward Controller

The main advantage of this technique is that no sensor is needed in the case
of pure open-loop control. And no sensor can mean a cheaper product!

However, in some cases, the considered system is such that no matter what
action is taken, the desired behavior cannot be realized. This concept is related
to the notion of controllability, which helps to determine whether or not such
cases will appear.

25

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.2. CONTROLLABILITY AND THE KALMAN CRITERION

2.2 Controllability and the Kalman criterion


2.2.1 Controllability notions
The main idea for controllability can be explained as follows: starting from the
initial state x0 = 0, is it possible, using the control input u(t), to steer/control
the considered system to any desired/target state xT (any point of the state
space)? If yes, the system is said to be controllable.

A first simple way to consider the controllability concept consists in taking


a quite visual perspective using block diagrams. Let us see that through the
following example.

Example: A second-order System


Consider the dynamical system modeled by the following block diagram

Figure 2.2: Block Diagram of a Second-Order System

One can obviously obtain the equation corresponding to this block diagram:
(
ẋ1 = −3x1
(2.1)
ẋ2 = −2x2 + x2 + u

Coming back to the block diagram in figure 2.2, following the arrows represent-
ing the flow of information in the system, we can see that u(t) will be able to
change x2 (t) but does not have any influence on the component x1 (t) of the
state. Therefore the system is not controllable.

However, taking now the other example below,

Example: Mass-Spring-Damper with m = 1kg


whose block diagram is shown in 2.3,

26

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.2. CONTROLLABILITY AND THE KALMAN CRITERION

Figure 2.3: Block Diagram of a Mass-Spring-Damper System

we can now see that, in this new example, u(t) influences the whole state
(directly or not), thus indicating that the system is in fact controllable.

We are now ready to state a more formal definition, in line with the few
ideas we have seen so far.

Formal Definition
The system represented by: ẋ = Ax + Bu is controllable if, for x(0) = 0 and for
any point xT of the state-space, there exists a finite time T > 0 and a control
input u(t), t ∈ [0, T ], such that x(T ) = xT .

In the above definition, note that u(t) is considered on a finite interval of


time.

Checking the flow/path might be a bit tedious, especially if one think of


systems with higher dimensions. Hence we would like to have a mathematical
tool which would allow us to conclude on the controllability property just by
using the knowledge we have on the model, ie embedded in the state-space
representation matrices A and B.
This is roughly speaking what the Kalman criterion is about. But before digging
right into it, we will need a few useful mathematical results.

2.2.2 Mathematical preliminaries


Solutions of LTI Systems
Firstly, we would like to answer the following question: what does the solution
of the first-order differential equation ẋ = Ax + Bu, x(0) = x0 look like?

To compute it, first we pre-multiply the above equation with e−At :

e−At ẋ(t) − e−At Ax(t) = e−At Bu(t) (2.2)

27

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.2. CONTROLLABILITY AND THE KALMAN CRITERION

Then, rewrite (2.2) as follows

d −At 
e x(t) = e−At Bu(t) (2.3)
dt
which is then integrated to give

 τ =t
Z t
e−At x(τ ) τ =0
= e−At Bu(τ )dτ
0

Z t
−At
e x(t) − x(t) = e−At Bu(τ )dτ
0

Z t
x(t) = eAt x0 + eA(t−τ ) Bu(τ )dτ (2.4)
0

Impulse response
The impulse response, is, simply put, the response of the system in the case the
control input is an impulse, ie we have

u(t) = δ(t) and x(0) = 0 (2.5)

Then the impulse response is given by


Z t
x(t) = eA(t−τ ) Bu(τ )dτ = eAt B (2.6)
0

Another useful property: the derivative response property


If u(t) has the response x(t), then its derivative u̇(t) has the response of ẋ(t).

2.2.3 The Kalman criterion


What we will consider now can be sumarized by the following problem state-
ment: can we check whether the system ẋ = Ax + Bu is controllable or not, just
by considering/looking at the matrices A and B? Rudolf Kalman solved this
problem by proposing a simple recipe to check controllability of a considered
system.

More precisely, what we would like to determine are the conditions on ma-
trices A and B from x0 = 0 such that we can reach any target xT just by using
the control input u(t)? The problem might not be as simple as it could appear.
Indeed, x(t) is of dimension n while u(t) is only of dimension l (ie only one input
in the present case).

The main idea for solving this problem consists in constructing the signal
u(t) on [0, T ] so that it is made of a sum of several basic elements whose com-
bination allows the system state to span the whole state-space.

28

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.2. CONTROLLABILITY AND THE KALMAN CRITERION

To do so, let us define n basic signal elements. First, define the first basic
control element as an impulse, whose response is the impulse response (see
previous section), ie we write

δ(t) ⇒ x(t) = eAt B (2.7)

Then, we would to be able to modulate/change the amplitude of this basic


control element with a constant α0 which we can choose at our convenience.
Hence we replace (2.7) with

u1 (t) = α0 δ(t) ⇒ x(t) = α0 eAt B (2.8)

Next, we proceed similarly with the definition of a second control element u2


made this time of the derivative of an impulse, again modulated by a constant
α1 :
u2 (t) = α1 δ̇(t) ⇒ x(t) = α1 AeAt B (2.9)
and we proceed similarly for all the n control elements until the last one:

un (t) = αn−1 δ (n−1) (t) ⇒ x(t) = αn−1 An−1 eAt B (2.10)

so that we now have our n basic control elements u1 (t) to un (t).

In order to simplify the discussion further, we let t = 0+ (i.e. we want to


steer the system from 0 to xT in a very short amount of time). Then, if the
control input signal is a sum of all the n above control elements, ie if
n−1
X
u(t) = ui (t) = α0 δ(t) + α1 δ̇(t) + α2 δ̈(t) + ... + αn−1 δ (n−1) (t) (2.11)
i=0

then we have the following response, which is just the sum of the individual
responses:

x(t) = α0 B + α1 AB + α2 A2 B + ... + αn−1 An−1 B (2.12)

Since the αi coefficients are parameters which we are free to choose, then we
can steer the system to any point provided that the vectors B, AB, A2 B,
... , An−1 B are linearly independent.
Said differently, we have to check that the matrix composed of these vectors,
called controllability matrix and expressed

Wc = A, AB, A2 B, ..., An−1 B


 
(2.13)

is nonsingular.
A standard way to check whether a square matrix is nonsingular is to check that
its determinant is different from 0. Hence the system is controllable provided
det(Wc ) 6= 0.

Main result
The system ẋ = Ax + Bu is controllable if, and only if the controllability matrix
Wc as given by equation (2.13) is invertible!

29

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.2. CONTROLLABILITY AND THE KALMAN CRITERION

Example: Third-Order System


Consider the following third-order system
   
−1 1 0 0
ẋ =  1 −1 1  x + 1 u (2.14)
0 1 −1 0
Is this system controllable?

To see this, let us compute the controllability matrix


 
0 1 −2
Wc = B, AB, A2 B = 1 −1 3  ⇒ det(Wc ) = 0
 
0 1 −2
whose determinant is equal to zero, thus showing that the system is not con-
trollable.
There is also another way to find the result. Indeed, note that, after we have
computed the 3 vectors B, AB and A2 B, that we have
A2 B = −4AB − B (2.15)
meaning that one of the vectors is a linear function of the 2 others, ie the column
vectors of Wc are not linearly independent! Here gain, the conclusion is clear:
not controllable.

2.2.4 Controllability and Controllability Canonical Form


(CCF)
In the previous chapter, we have seen a special kind of linear state-space repre-
sentation, which had the form
   
0 1 0 0 ... 0 0
 0 0 1 0 ... 0  0
   
 0 0 0 1 ... 0  0
ẋ(t) =  . . . .. ..  x(t) +  ..  u(t) (2.16)
   
 .. .. .. ..
 . . . 

.
 
 0 0 0 0 ... 1  0
−a0 −a1 −a2 −a3 ... −an−1 b
The question which naturally arises is whether this representation is actually
controllable. To see that it is indeed the case, let us compute the column vectors
of Wc , so that we have
       
0 0 0 b
0  0  ..  ∗
.
 .. 
     
0   ∗
.
B = . , AB =   , A2 B = 0 , An−1 B =  .  (2.17)
     
 ..   0 b  .. 
       
0 b  ∗ ∗
b ∗ ∗ ∗
Putting them together to form matrix Wc makes the determinant of the latter
equal to zero only if b = 0, which is not really supposed to happen for this

30

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.2. CONTROLLABILITY AND THE KALMAN CRITERION

particular form, otherwise the input has no impact at all.


Hence a Controllability Canonical Form is always controllable. Now its name
makes a little bit more sense, does it not? :-)

31

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.3. OPEN-LOOP CONTROL

2.3 Open-Loop control


In this section, we will be interested in computing a control signal u(t) to steer
the system from x0 to xT , where information on the state is not used to make
corrections on the control input. Hence, u(t) will only depend on time.

2.3.1 Open-Loop Control and the Controllability Canon-


ical Form
Let us start with our familiar CCF, which we will put in component form


 ẋ1 = x2

ẋ2 = x3





ẋ3 = x4

.. (2.18)


 .

ẋn−1 = xn





ẋn = −a0 x1 − a1 x2 − ... − an−1 xn + bu

where we recall that we also have the output equation

y = x1 (2.19)

What we would like is for the output variable y(t), or equivalently x1 (t) to
follow a pre-defined/desired trajectory yd (t)/x1d (t). What is the corresponding
control input u(t) = ud (t)?

To answer this question, let us first assume that our desired trajectory yd (t)
is a polynomial in the time variable. Then, if the output y(t) follows this desired
trajectory, we also have that

x1 (t) = x1d (t) = yd (t) is a polynomial (2.20)

But thanks to the special structure of the CCF, we can also say that

x2 (t) = ẋ1 (t) = ẋ1d (t) = ẏd (t) is a polynomial (2.21)

and similarly for x3 (t), so that

x3 (t) = ẋ2 (t) = ẍ1 (t) = ẍ1d (t) = ÿd (t) is a polynomial (2.22)

and so on and so forth until the last state component xn (t)


(n−1) (n−1)
xn (t) = ẋn−1 (t) = x1 (t) = yd (t) is a polynomial (2.23)

while its derivative ẋn (t)


(n) (n)
ẋn (t) = ẋn (t) = x1 (t) = yd (t) is a polynomial (2.24)

Then, using expressions (2.20) to (2.24) and taking the last line in our CCf
expression (2.18), we can isolate our desired control signal to have
1h (n−1) (n)
i
u(t) = ud (t) = a0 yd (t) + a1 ẏd (t) + ... + an−1 yd (t) + yd (t) (2.25)
b

32

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.3. OPEN-LOOP CONTROL

or, equivalently,
1h (n−1) (n)
i
ud (t) = a0 x1d (t) + a1 ẋ1d (t) + ... + an−1 x1d (t) + x1d (t) (2.26)
b
and because a sum of polynomials is also a polynomials, then this means that
expression (2.25) and (2.26) are also polynomial in time!

At this point, let us take a step back and discuss the consequences of these
few derivattions. If yd (t) is a polynomial trajectory going from one point to
another (i.e. from yd (0) to yd (T ) in a time T , then by taking the successive
derivatives of yd (t) = x1d up the order n, we can compute an open-loop control
signal ud (t) that will steer the system variable y(t) = x1 (t) from yd (0) to yd (T )
(i−1)
and similarly for the other state components since we will have xi (0) = yd (0)
(i−1)
and xi (T ) = yd (T ). Hence we can conclude that, since we can decide on
the desired trajectory yd (t), it is possible to compute ud (t) so that we steer the
state of system (2.18) from any initial state x0 to any desired target state xT .

Hence equation (2.25) is an expression of a open-loop/feedforward controller


for system (2.18), that is expression which computes a control input signal ud (t)
which will make the considered system follow the desired trajectory yd (t).

Example: Mass-Spring-Damper
Taking now our well-known mass-spring damper system:
      
ẋ1 (t) 0 1 x1 (t) 0
= + u(t) (2.27)
ẋ2 (t) −k/m −d/m x2 (t) 1/m

and assume, as we have seen, that we want its output y(t) = x1 (t) to follow the
desired polynomial trajectory yd (t).
Then, if x1 (t) follows yd (t), then x1 (t) = yd (t). Similarly, we have then

x2 (t) = ẋ1 (t) = ẋ1d (t) = ẏd (t) (2.28)

which makes x2 (t) a polynomial, and

ẋ2 (t) = ẍ1 (t) = ÿd (t) (2.29)

also a polynomial. Isolating u(t) in (2.27), we have the following feedforward


controller:
ud (t) = kyd (t) + dẏd (t) + mÿd (t) (2.30)
Even though we have used a polynomial desired trajectory in the above rea-
soning, we should stress that yd (t) does not have to be a polynomial. It just has
to be differentiable a sufficient number of times. Then a feedforward controller
is just the sum of these derivatives.
However, because of their simplicity, polynomials are of special interest. Also
for their computer efficiency.

33

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.3. OPEN-LOOP CONTROL

2.3.2 Computing polynomial trajectories


In this section, we will look at how to define a desired trajectory for a second-
order system (n = 2), and generalization should not be a problem once the basic
ideas are in place.
For a start, we want to steer our system
     
x x (T ) x
from x(0) = 10 to x(T ) = 1 = 1T = xT (2.31)
x20 x2 (T ) x2T

this using a polynomial trajectory written as

yd (t) = α0 + α1 t + α2 t2 + α3 t3 + . . . (2.32)

and because we have 4 boundary conditions, ie 2 initial conditions and 2 final


conditions as we have see in (2.31), then we only need 4 coefficients in (2.32),
from α0 to α3 .

What we would like to obtain is a way to compute the coefficients αi of yd (t).


Since we are working with a CCF, recall that we have x2 (t) = ẋ1 (t), which gives
(
x1 (t) = yd (t) = α0 + α1 t + α2 t2 + α3 t3
(2.33)
x2 (t) = ẋ1 (t) = ẏd (t) = α1 + 2α2 t + 3α3 t2

Interestingly, evaluating these polynomial expressions at t = 0 and t = T will


allow us to match them with the initial conditions (x0 ) and final conditions
(xT ), giving us our αi coefficients.
For t = 0 and the initial conditions, the polynomial expressions (2.33) give

x1 (0) = x10 = α0 , x2 (0) = x20 = ẋ1 (0) = α1 (2.34)

ie we directly have α0 and α1 .


For t = T and the final conditions, equation (2.33) reads
(
x1 (T ) = α0 + α1 T + α2 T 2 + α3 T 3 = x1T
(2.35)
x2 (T ) = α1 + 2α2 T + 3α3 T 2 = x2T

which is a bit more involved but not that much. Indeed, we know α0 and α1
since we have just calculated them. The only unknowns are α2 and α3 and two
equations, so that should not be a problem. First isolate the unknowns
(
x1T − (x10 + x20 T ) = α2 T 2 + α3 T 3
(2.36)
x2T − x20 = 2α2 T + 3α3 T 2

and rewrite in vectorial form to obtain


  2
T3
  
x1T − (x10 + x20 T ) T α2
= (2.37)
x2T − x20 2T 3T 2 α3

Inverting then the T -dependent matrix, we finally have the α2 -α3 coefficients
   2 −1 
T3

α2 T x1T − (x10 + x20 T )
= (2.38)
α3 2T 3T 2 x2T − x20

34

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.3. OPEN-LOOP CONTROL

Example: Mass-Spring-Damper
We have previously seen that a feedforward controller for the mass-spring-
damper system can be written as

ud (t) = kyd (t) + dẏd (t) + mÿd (t) (2.39)

and since the considered system is of order 2 then the polynomial desired tra-
jectory can be written as

yd (t) = α0 + α1 t + α2 t2 + α3 t3 (2.40)

which also gives


ẏd (t) = α1 + 2α2 t + 3α3 t2 (2.41)
and the derivative of (2.41):

ÿd (t) = 2α2 + 6α3 t (2.42)

Putting (2.40), (2.41) and (2.42) into (2.39) gives

ud (t) = k(α0 + α1 t + α2 t2 + α3 t3 ) + d(α1 + 2α2 t + 3α3 t2 ) + m(2α2 + 6α3 t) (2.43)

The above feedforward controller is indeed a function of time only and a poly-
nomial.

2.3.3 General LTI Systems


As we have seen doing open-loop control when the system is represented by a
CCF is quite straightforward.
For a more general linear state-space representation, we will simply try to trans-
form the current state-space representation into a CCF, which will allow us to
apply the open-loop control technique we have seen in the previous section.

State-coordinate transformation
In the last chapter, we have seen that, for a particular system, there are several
ways to define the state vector, leading to a different state-space representation.
What we would like to do here is to find an explicit relation between the 2
state-space representations and their associated state-vectors

Let us first start with our usual linear time-invariant state-space representation
(
ẋ = Ax + Bu
(2.44)
y = Cx

and consider another state-vector z(t) defined differently from x(t). What we
know for now about z(t) is that it is a linear invertible combination of x(t),
written as
z(t) = T x(t), with T ∈ Rn×n (2.45)

35

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.3. OPEN-LOOP CONTROL

which implies that


x = T −1 z and ż = T ẋ (2.46)
Then, using these few relations, equation (2.44) first transforms into
(
ż = T (Ax + Bu)
(2.47)
y = CT −1 z

and then (
ż = T AT −1 z + T Bu
(2.48)
y = CT −1 z
so that we have the following state-space representation in the z-space:
(
ż = Ãz + B̃u
(2.49)
y = C̃z

where
à = T AT −1 , B̃ = T B, C̃ = CT −1 (2.50)

Example: Second-Order System


Consider the second-order system

ÿ + 3ẏ = 2y + u, (2.51)

its corresponding CCF    


0 1 0
ẋ = x+ u (2.52)
2 −3 1
and a coordinate transform matrix
 
3 1
T = (2.53)
1 0

The new state-space representation after coordinate transform is obtained by


computing the matrices à and B̃, which gives
     
−1 3 1 0 1 0 1 0 2
à = T AT = = (2.54)
1 0 2 −3 1 −3 1 −3

and     
3 1 0 1
B̃ = T B = = (2.55)
1 0 1 0
so that we have the new state-space representation
   
0 2 1
ż = z+ u (2.56)
1 −3 0

36

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.3. OPEN-LOOP CONTROL

Transforming a state-space representation into a CCF


Our aim is thus to find a coordinate transform z = T x such that, after the
transform, the state-space representation in the z-space
ż = Ãz + B̃u (2.57)
is a controllability canonical form.
First, note that if such a transform exists (let us remember that important “if”
for later), then we have the two following important relations
à = T AT −1 ⇒ ÃT = T A, B̃ = T B (2.58)
Hence the transformation T that we are looking for is really the solution of these
two algebraic equations.
In order to solve it in a quite easy way, let us first decompose T into n stacked
row vectors Ti , ie we have  
T1
 T2 
T = .  (2.59)
 
 .. 
Tn
and rewrite the first equation of (2.58), ÃT = T A, by taking into account the
special structure of à and T
    
0 1 ... 0 T1 T1 A
 .. .. ..   T2   T2 A 
 .
 0 . .   ..  =  .. 
   
(2.60)
 0 ... 0 1   .   . 
−a0 −a1 ... −an−1 Tn Tn A
which gives    
T2 T1 A
 T3   T2 A 
..  =  ..  (2.61)
   

 .   . 
−a0 T1 − a1 T2 − ... − an−1 Tn Tn A
This last expression has the following important consequence: if it happens so
that we know T1 , then T2 is readily obtained because T2 = T1 A...
...if we know T2 , then T3 is readily obtained because T3 = T2 A....
...and if we know Tn−1 , then Tn is readily obtained because Tn = Tn−1 A....

This simple reasoning means that if we have T1 , then the rest of the rows of
the coordinate transform T can be deduced directly from this first row T1 and
the matrix A!

Next question is of course how to obtain this first row vector T1 . To answer
that question, let us turn to the second expression of (2.58), B̃ = T B. Use the
structure of T and B̃ to write
   
T1 B T1 B
 T2 B   T1 AB 
2
   
B̃ =  T3 B  =  T1 A B  (2.62)
   
 ..   .. 
 .   . 
Tn B T1 An−1 B

37

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.3. OPEN-LOOP CONTROL

where note that, because the right handside term of (2.62) is a vector, the terms
T1 Ai B are scalars.
Transposing expression (2.62) gives
B̃ T = 0 ... 0 1 = T1 B T1 AB T1 A2 B ... T1 An−1 B
   
(2.63)
which is nothing but
B̃ T = T1 Wc (2.64)
ie T1 multiplied by the controllability matrix!
Hence, provided Wc is nonsingular and therefore invertible, T1 is given by
T1 = B̃ T Wc−1 (2.65)
At this point, several important remarks can be made. First, if the original
system is not controllable, it means that Wc is singular and not invertible.
Hence T1 cannot be obtained. Hence the “if such a transform exists” statement
at the beginning of the discussion. This can be also explained by the fact that a
non-controllable system should be able to be put under a CCF, which we have
seen to be always controllable.
 T
Secondly, note that having set B̃ as 0 ... 0 1 is not the only possibility,
 T
ie we could have decided that B̃ = 0 ... 0 3 for example, as long as B̃
has the required CCF shape. In this case, however, we would have obtained a
different state-space representation.

Example: Back to our previous example


Let us go back to our previous example, and just assume that it is written in
the x-space as follows    
0 2 1
ẋ = x+ u (2.66)
1 −3 0
We want to find our way back to a CCF.
To do this, compute first the controllability matrix Wc :
 
  1 0
Wc = B AB = (2.67)
0 1
whose determinant is obviously 1, so that we know that the system is control-
lable, and hence that a transform T to a CCF exists.
The, defining B̃ as
B̃ T = 0 1
 
(2.68)
We can now obtain the first row vector of T , T1 :
 
 1 0
T1 = B̃ T Wc−1 = 0 1
  
= 0 1 (2.69)
0 1
and then T2 :  
  0 2  
T2 = T1 A = 0 1 = 1 −3 (2.70)
1 −3
So that we finally have the transform
 
0 1
T = (2.71)
1 −3

38

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.3. OPEN-LOOP CONTROL

It is then easy to check that we obtain, after transform, the following CCF
   
0 1 0
ż = z+ u (2.72)
2 −3 1

Once both the coordinate transform T and the CCF in the z-space are
obtained, we can apply the open-loop control technique we have learnt in this
chapter.
This is summarized in the following “algorithm”.

Algorithm - Open-loop control for general LTI systems


Given the following state-space representation
(
ẋ = Ax + Bu
(2.73)
y = Cx

• After checking the controllability of the system, compute the transform T


and obtain a CCF.
• We want the state x(t) to go from x0 to xT . Translate this in the z-space:
we want the state z(t) to go from z0 = T x0 to zT = T xT .

• Construct polynomial trajectory yd (t) using z0 and zT as boundary con-


ditions.
• Implement feedforward controller
(n−1) (n)
ud (t) = a0 yd (t) + a1 ẏd (t) + ... + an−1 yd (t) + yd (t)

39

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.4. FLATNESS THEORY

2.4 Flatness Theory


Flatness is a theory/tool in control systems which was proposed in the 1990s by
Michel Fliess and his co-workers, which turns out to be very useful for, among
other things, open-loop control. It can be applied on a wide variety of systems
and is quite used in the industry.
It stems for a different way of looking at controllability.

2.4.1 The linear case


Previously, we have seen that one can only find a linear transform T (from a
state-space representation to a controllability canonical form) if the considered
system is controllable, and that this transform will change the state-space rep-
resentation in the x-space to another state-space representation in the z-space.
What we also have seen is the special role played by the first row vector of
T , ie T1 , which hence links the first component of the state z with state x or
x1 = T1 x.
Indeed, mathematically, we have

z = Tx (2.74)

or
z1
     
z1 T1 x
 z2   ż1   T1 Ax 
 z3   z̈1   T1 A2 x 
     
 = = (2.75)
 ..   ..   ..


.  .   . 
(n−1)
zn z1 T1 An−1 x
since recall that the state-space representation in the z-space is a CCF.
Hence the starting relation
z1 = T 1 x (2.76)
seems quite central to find the whole transform T . If now express relation (2.76)
in plain words, we will just say that scalar variable z1 is a linear function
of the state x.
Conversely, we then also have that

x = T −1 z = Λz, with Λ := T −1 (2.77)

which also means  


z1

 ż1 

x = Λ
 z̈1 
(2.78)
..

 
 . 
z1n−1
or, if we state things in plain words again, the state x is a linear function
of z1 and its derivatives up to order (n − 1).
Finally, and we have seen when we did open-loop control for a CCF, we also
have the relation
(n−1) (n)
u = a0 z1 + a1 ż1 + ... + an−1 z1 + z1 (2.79)

40

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.4. FLATNESS THEORY

or, in plain words, the input u is a linear function of z1 and its deriva-
tives up to order n.

Hence variable z1 is quite central to the above discussion! In flatness theory,


this variable is called flat variable or output and is sometimes noted F . We will
use this notation in the rest of this section.
We are now ready to give a different definition of controllability using the con-
cept of flat output:

Definition: If, for the system represented by ẋ = Ax + Bu (dim(u) = 1),


there exists a linear function of the state, F = T1 x (F is called flat output or
variable), such that:
• the state x can be described as a linear function of F and its derivatives
up to order n − 1,
• the input u can be described as a linear function of F and its derivatives
up to order n,
then the system is controllable.

Important remark
As we will see, it is not always easy to pick the right candidate for the flat
output F . Indeed, for some choices of F , it is difficult or not possible to express
x as a function of F and its derivatives.
In this case, one can only pick another candidate for the flat output. If the
system is controllable however, it is guaranteed that there is one such variable.
For linear systems, finding F can be systematically obtained by the method we
saw in the previous section.
To see how to check that a system is controllable using the above definition
and the flat output concept, let us consider (again) our previous example.

Example: our (now-infamous) second-order system


Recall that we have the following state-space representation
   
0 2 1
ẋ = x+ u (2.80)
1 −3 0

To begin with, we choose a flat output candidate (ie we do not know just yet if
that is the right candidate). Let us be as simple as possible and pick

F = x1

Then we would like to express the whole state as a (linear) function of the flat
output and its derivative. We already have x1 , so that we only have left to
determine x2 .
To do so, rewrite system (2.80) in component form by replacing x1 with F so
that we have (
Ḟ = 2x2 + u
(2.81)
ẋ2 = F − 3x2

41

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.4. FLATNESS THEORY

Remember that we are supposed to express the state components as a (linear)


function of F and its derivatives, and that only. Hence in the above expression,
it looks a bit tricky, because x2 would be a function of Ḟ and control input u
in the first line, while x2 would be a function of F and ẋ2 , which is not really
working either...
Hence it looks like we do not have the right flat output candidate. OK, let us
pick instead the new flat output candidate

F = x2 which gives x2 = F (2.82)

Now we need to express x1 in terms of its derivatives. Let us see: using the new
flat output candidate, we have
(
ẋ1 = 2F + u
(2.83)
Ḟ = x1 − 3F

In the above set of equations, the second line turns out to be quite useful.
Indeed, x2 can be easily isolated, so that, combined with (2.82), we get
(
x1 = 3F + Ḟ
(2.84)
x2 = F

meaning that the state is now expressed as a (linear) function of the


flat variable F and its derivative (up to order 1)!
We are only to consider control input u. To do so, isolate u in the first equation
of (2.83) to get
u = −2F + ẋ1 (2.85)
which, thanks to (2.84), gives

u = −2F + 3Ḟ + F̈ (2.86)

Hence the control input u is also a (linear) function of the flat output
F and its derivatives (up to order 2)!
To conclude, these two statements, given by (2.84) and (2.86) allow us to con-
clude that the system (2.80) is controllable.

Application to open-loop control:


Because of the way controllability is defined in flatness theory, the verification of
whether a system is controllable leads directly to the definition of an feedforward
controller. Indeed, letting the flat output F (t) follow a desired trajectory, which
we will note for convenience Fd (t), we are then able to express the feedforward
control input ud (t) as a (linear) function of Fd (t) and its derivatives up to order
n.
For example, in the above example, we would have

ud (t) = −2Fd (t) + 3Ḟd (t) + F̈d (t) (2.87)

42

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.4. FLATNESS THEORY

2.4.2 The nonlinear case


Roughly speaking, the above method can be directly extended to nonlinear
systems by simply replacing the word ”linear” by the word ”nonlinear” in the
definition of controllability.

Definition: If, for the system represented by ẋ = f (x, u) (dim(u) = 1),


there exists a nonlinear function of the state, F = φ(x) (F is called flat output
or variable), such that:
• the state x can be described as a nonlinear function of F and its derivatives
up to order n − 1, ie we have
 
x = ψx F, Ḟ , . . . , F (n−1) (2.88)

• the input u can be described as a nonlinear function of F and its derivatives


up to order n, ie we have
 
u = ψu F, Ḟ , . . . , F (n) (2.89)

then the system is controllable.

Let us now see how the above can be applied on a simple example.

Example: Robot “elbow”/pendulum


Recall a state-space representation of the controlled pendulum
 
x2 (t)
ẋ(t) = (2.90)
− gl sin x1 (t) + ml1 2 u(t)

First, note that by choosing the flat output candidate F = x1 (ie we have
φ(x) = x1 ), we get the simple expression
(  
x1 = F F
⇒ ψx (F, Ḟ ) = (2.91)
x2 = Ḟ Ḟ

ie the state is a function of F and its derivative.


Next, we look at the control input, and from the second line of (2.90), we get

u = mgl sin F + ml2 F̈ = ψu (F, Ḟ , F̈ ) (2.92)

ie the control input is a function of F and its derivatives. From (2.91) and
(2.92), we can conclude that the system is controllable.

Algorithm: open-loop control for nonlinear systems


• check that the system is controllable using Flatness Theory.
• compute F (0) and F (T ) from the function φ(x(t)), evaluated at times
t = 0 and t = T . Also compute the derivatives of F (t), also evaluated at
times t = 0 and t = T ,

43

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.4. FLATNESS THEORY

• construct a polynomial trajectory Fd (t) from Fd (0) to Fd (T ), with deriva-


tives at times t = 0 and t = T corresponding to the boundary conditions
on the derivatives of F (t) computed in the previous step,
• Define the feedforward controller using the function φu , that is
 
(n)
ud (t) = φu Fd (t), Ḟd (t), ..., Fd (t)

For systems with multiple inputs, the flat output is now a vector F whose
dimension is the same as the dimension of the control input vector u. Indeed,
if we have p inputs, this means
   
u1 F1
 u2   F2 
u= . ⇒F = .  (2.93)
   
 ..   .. 
up Fp

but the rest of the procedure for checking controllability is exactly the same.
Let us see that through our examples in mobile robotics.

Example: Flatness of the two-wheeled robot


Recall the model of a two-wheeled robot we saw in the previous chapter:

ẋ = u1 cosθ

ẏ = u1 sinθ (2.94)

θ̇ = u2

Since we have 2 control inputs (u1 and u2 ), then we will need a flat output with
2 components. Let us choose the flat output candidate

F1 = x and F2 = y (2.95)

ie the position of the robot in the plane.


In order to get the function ψx , we need to have the 3rd component of the state
as a function of the flat output and derivatives. To do this, replace the terms in
x and y by F1 and F2 in model (2.94), and divide the second line of the model
by the first line to get
F˙2
= tan θ (2.96)
F˙1
so that the function x = ψx (F, Ḟ ) reads
 
F1
x = ψx (F, Ḟ ) = 
 F
2

 (2.97)
arctan F˙2 /F˙1

Hence the state is a nonlinear function of F and its derivative. Now for the
control inputs. For u1 , add the squared first line to the squared second line of
(2.94) to obtain (after replacement with the flat output components)

Ḟ12 + Ḟ22 = u21 (2.98)

44

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

2.5. CONCLUDING REMARKS ON OPEN-LOOP CONTROL

which gives q
u1 = ± Ḟ12 + Ḟ22 (2.99)
For u2 , taking the third line of (2.94) and using (2.97), we have
!!
d Ḟ2
u2 = arctan (2.100)
dt Ḟ1

which, after derivative calculation and simplification, gives

F̈2 Ḟ1 − F̈1 Ḟ2


u2 = (2.101)
Ḟ12 + Ḟ22

to finally obtain  q 
± Ḟ12 + Ḟ22
u = ψu (F, Ḟ , F̈ ) =  
F̈2 Ḟ1 −F̈1 Ḟ2
(2.102)
Ḟ12 +Ḟ22

so that, combining (2.97) and (2.102), we can conclude that the system is con-
trollable.

Exercise: Car-like robot


Prove that the car-like robot is controllable.

2.5 Concluding remarks on open-loop control


Before closing this chapter, it might be good to reflect a little bit on the use of
open-loop control in general. When is it useful to pre-compute a control input
made to correspond to a desired trajectory is obviously a matter of context, and
a correct answer, if not very informative, is that it depends.

First, it is worthy to mention that open-loop control should only be used


by itself if the system to be controlled is stable in some sense (it forgets initial
conditions). Otherwise, a feedforward controller will either need to be helped
by a feedback stabilizer as it tries to follow the desired trajectory, or the state
of the system will have to be caught as it reaches a vicinity of the target state,
again by a feedback stabilizer.

Generally, open-loop control can be very useful for plants evolving in con-
trolled environments where the model of the system, as well as its parameters
are quite well-known and constant or varying in a predictable way (think of an
industrial robot for example). However, open-loop control might be less useful
when models are very changing and very uncertain, with highly unpredictable
disturbances (think of a ship in a storm). In this case, feedback will be more
prevalent.

45

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

Chapter 3

Stability and
State-Feedback

3.1 Introduction
During our computer experiments, we saw that, despite our carefully-planed
trajectories and the corresponding open-loop controller calculating the desired
input ud (t), the obtained result could be not exactly the same as the desired
behavior, ie it turned out that y(t) was not following exactly yd (t).

Obviously, this behaviour is not what we usually require from many systems.
Indeed, what we would like is a final behavior which is consistently the same,
and this despite a change in initial conditions. This entails the notion of sta-
bility, which, roughly speaking, means to be robust to changes. There quite a
few ways to define stability for dynamical systems. In the present case, we will
consider stability with respect to changes in initial conditions.

Intuitively, stability with respect to initial conditions, which we will call here
simple stability, can be represented graphically by the figure 3.1a

(a) Stable Case (b) Unstable Case

Figure 3.1: Stable vs. Unstable

where the horizontal axis is the time, and the vertical one is the amplitude of
a considered variable, say output y(t). In this case, stable will mean that taking
different possible signals y(t) intialized differently, they will all eventually reach

46

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.1. INTRODUCTION

the same point after a transient.


Obivously, a contrario the other figure 3.1b would represent an unstable system.
Stability and independence with respect to initial conditions can also be
examined mathematically through the simple example that follows.

Figure 3.2: Stabilizing an unstable plant

Example: First-order linear scalar system


Consider the basic equation
ẋ(t) = −x(t), x(0) = x0 (3.1)
To check that the system is stable, we just compute its solution given by
x(t) = x0 e−t (3.2)
and remark that, when t → ∞, the “final” behavior of the system is
lim x(t) = lim x0 e−t = 0 (3.3)
t→∞ t→∞

and this no matter what the initial condition of the system is! Hence this system
is obviously stable.

Many systems are not naturally stable (think of the upstraight position of a
pendulum for example). In this case, one can render or make this system stable
by using information on the state to send corrections on the control input so
that the system in closed loop is stable. The controller that does that is called
feedback stabilizer or feedback controller (see figure 3.2).

Let us now consider another scalar system, albeit an unstable one, and see
how it can be stabilized by feedback.

Example: Stabilizing an unstable scalar system


Consider the system modelled by
ẋ(t) = x(t) + u(t), x(0) = x0 (3.4)
Without control input, ie when
u(t) = 0, we have x(t) = x0 et (3.5)

47

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.2. STABILITY OF LINEAR TIME-INVARIANT SYSTEMS

which means that,



if
 x0 > 0 ⇒ limt→∞ x(t) = +∞
if x0 = 0 ⇒ limt→∞ x(t) = 0 (3.6)

if x0 < 0 ⇒ limt→∞ x(t) = −∞

that is the final behavior is hightly dependent on the initial condition, implying
that the system is not stable.
The basic idea behind stabilization by feedback consists in choosing a control
expression u (also called control law ) as a function of the state x so that the
global system, also called system in closed-loop, is stable.
Let
u(t) = −2x(t) (3.7)
Then, replace signal u(t) in (3.4) with control law (3.7), which gives

ẋ = x(t) − 2x(t) = −x(t) (3.8)

so that the system in closed-loop is stable. Hence the simple linear controller
(3.7) with proportional gain 2 was able to stabilize system (3.4).

3.2 Stability of Linear Time-Invariant systems


What we would like is a general tool/criterion to assess whether a system rep-
resented by a state-space representation is stable or not.
Before doing so, let us make a small brush up on a stability result used in
classical control theory.

3.2.1 A stability result for Transfer Functions


Consider a linear single-input single-output (SISO) system modelled by the
transfer function
y(s) bm sm + ... + b1 s + b0
= n (3.9)
u(s) s + an−1 sn−1 + ... + a1 s + a0

where the ai and bj parameters are constant, with m ≤ n.

An important result from classical control theory states that system (3.9)
is stable if and only if each root of the denominator a(s) (called char-
acteristic polynomial ) has a strictly negative real part.

Remark that this result is meant for an input-output notion of stability, and
therefore that initial conditions are not explicitly considered. In addition, in the
way this result is stated, it requires the presence of an input signal, which, as
we have seen is not always the case (think of a state-space representation with
the matrix B = 0).

48

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.2. STABILITY OF LINEAR TIME-INVARIANT SYSTEMS

3.2.2 Stability criterion for non-controlled state-space rep-


resentations
Consider the system modelled by

ẋ(t) = Ax(t), x(0) = x0 (3.10)

Similarly to the scalar cases we have seen in section 3.1, we want to have
a simple criterion allowing us to conclude on the stability of system (3.10) by
considering only matrix A.

A simple but neat way to obtain such a criterion consists first in applying
the Laplace transform on system (3.10) so that we get

s.x(s) − x0 = Ax(s) ⇒ (sI − A)x(s) = x0 (3.11)

where x(s) is the Laplace transform of x(t) and I is the identity matrix.

From there, we have


x(s) = (sI − A)−1 x0 (3.12)
and if we rewrite the inverse of matrix sI −A in terms of how it can be computed,
we get
adj(sI − A)
x(s) = x0 (3.13)
det(sI − A)
Note that, under this form, expression (3.13) looks a lot like the transfer func-
tion expression (3.9). Indeed, in this case, x(s) in (3.13) corresponds to y(s) in
(3.9) while x0 plays in (3.13) the same role as input u(s) in (3.9). Interestingly,
a constant like x0 in the Laplace domain is an impulse of amplitude x0 in the
time domain.

Now we know from section 3.2.1 that transfer function (3.13) is stable (for
all inputs and therefore for the impulse of amplitude x0 ) if and only if each
root of the denominator of (3.13), ie characteristic polynomial det(sI − A) has
its real part strictly negative, or, using other words, if each solution λ of the
equation det(λI − A) = 0 has a strictly negative real part.

Recall from maths: The solutions λ of the equation det(λI − A) = 0 are


called the eigenvalues of matrix A.

The above means that, in order to assess the stability of system ẋ = Ax, one
can directly compute the eigenvalues of matrix A without having to compute
the corresponding transfer function.
This finally leads to the following result.

Main result: The system represented by ẋ = Ax(t) is stable if and only if


the real part of each eigenvalue of A is strictly negative.

49

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.2. STABILITY OF LINEAR TIME-INVARIANT SYSTEMS

Example: Two-dimensional system


Consider the following system
 
−1 0
ẋ = x (3.14)
1 −1

Computing its eigenvalues gives the equation


   
λ 0 −1 0
det(λI − A) = det −
0 λ 1 −1
 
λ+1 0
= det
−1 λ+1
= (λ + 1)2 = 0 (3.15)

From equation (3.15), we can see that we have a double eigenvalue λ = −1,
whose real part is strictly negative. Hence the system (3.14) is stable.
Take now another system:  
−1 −1
ẋ = x (3.16)
1 −1
The eigenvalues of matrix A are given this time by λ1 = −1 + i and λ2 =
−1 − i. Both eigenvalues have a strictly negative real part, the system again is
stable.

50

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.3. STABILIZATION OF LTI SYSTEMS BY STATE FEEDBACK

3.3 Stabilization of LTI systems by state feed-


back
3.3.1 Basic principle
Consider a linear system with inputs ẋ = Ax + Bu. As we have seen in the
previous section, if not all the eigenvalues of A have their real part strictly
negative, then the system is not stable. Then, similarly to our discussion of
in the introduction, we can use the state x(t) as information fed back to the
control input, and to define a controller of the form

u(t) = K.x(t) (3.17)

where, in a general multi-input context, we would have

u(t) ∈ Rm , x(t) ∈ Rn (3.18)

which implies, for matrix K:


K ∈ Rm×n (3.19)
The controller or control law (3.17) is called a state-feedback controller.
If we put back the expression of this controller into the state-space represen-
tation, and in place of the control input u(t), we have the dynamics of the
closed-loop system written as

ẋ(t) = Ax(t) + BKx(t) (3.20)

or
ẋ(t) = (A + BK)x(t) (3.21)
Clearly the closed-loop dynamics (3.21) is stable if each eigenvalue of A + BK
has a strictly negative real part.
Hence, in this case, the role of the control engineer is to pick values of matrix
K such that its closed-loop dynamics is stable!

Example: Multiple-input system


Consider the two-input system represented by
   
2 0 0 1 0
ẋ = 1 −1 2  x + 0 2 u (3.22)
0 2 −1 0 0

and assume that we would like to stabilize this system by state-feedback (first
one can also check that this system is not stable when u = 0, which it is not).
Since dim(x) = 3 and dim(u) = 2, we have that K ∈ R2×3 .
Let us rewrite (3.22) in component-form as follows

ẋ1 = 2x1 + u1

ẋ2 = x1 − x2 + 2x3 + 2u2 (3.23)

ẋ3 = 2x2 − x3

51

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.3. STABILIZATION OF LTI SYSTEMS BY STATE FEEDBACK

A possible control law (but there are many other possibilities) could be u1 =
−3x1 and u2 = −x3 . This would give the closed-loop dynamics

ẋ1 = −x1

ẋ2 = x1 − x2 (3.24)

ẋ3 = 2x2 − x3

or  
−1 0 0
ẋ =  1 −1 0 x (3.25)
0 2 −1
which is a cascade of 3 stable subsystems, giving an overall stable system (one
can also check the eigenvalues of closed-loop system (3.25)). Hence the system
was stabilize by state-feedback with the gain matrix K written as
 
−3 0 0
K= (3.26)
0 0 −1

In the above example, we have proceeded by mere guess and examination of


the system subdynamics for choosing the values of gain matrix K. The effect of
choosing these values could only be checked a posteriori by stability assessment.
While this way of doing things might very well work in quite a few cases, it might
not be so for all systems, and it would be interesting of have a more systematic
method. This is what we will see in the next section.

3.3.2 Eigenvalue assignment/pole placement for the con-


trollability canonical form
For systems which are described by a controllability canonical form (CCF),
designing a state-feedback controller, and tuning it so that it is stable with the
desired poles/eigenvalues is quite simple. Let us see that through the following
example.

Example: 2nd order system


Assume we have the two-dimensional CCF given by
 " # " #
ẋ = 0 1 0

x+ u

−a0 −a1 1 (3.27)
 h i
y = 1 0 x

where we assume that a0 = 6 and a1 = −5. Computing the eigenvalues of A,


we have that  
2
eig(A) = (3.28)
3
showing that the system is not stable.
Similarly, if we take a look at the poles of the corresponding transfer function,
which are the roots of the characteristic polynomial, we have
y(s) 1 1
= 2 = 2 (3.29)
u(s) s + a1 s + a0 s − 5s + 6

52

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.3. STABILIZATION OF LTI SYSTEMS BY STATE FEEDBACK

which, given the values of our ai parameters, can be re-written as

y(s) 1
= . (3.30)
u(s) (s − 2)(s − 3)

thus giving the 2 poles α1 = 2, α2 = 3, leading obviously to the same conclu-


sion, ie the considered system is not stable. Indeed, as we have previously seen,
the eigenvalues of A correspond exacntly to the poles of the equivalent transfer
function. Both are roots to the so-called characteristic polynomial s2 + a1 s + a0 ,
here given by s2 − 5s + 6.

What we want, is to stabilize system (3.27), so that the eigenvalues/poles of


the system in closed-loop are given by

α1,cl = λ1,cl = −2, and α2,cl = λ2,cl = −1 (3.31)

These “desired” eigenvalues/poles are themselves the roots of the characteristic


polynomial

(s − λ1,cl )(s − λ2,cl ) = s2 + p1 s + p0 = s2 + 3s + 2 (3.32)

which we will call desired characteristic polynomial, and where p1 and p0 are its
polynomial coefficients.
In turn, this would give the closed-loop matrix A′ = A + BK written as
   
0 1 0 1
A′ = = (3.33)
−p0 −p1 −2 −3

and, because of the way A′ is defined, we have


       
0 1 0 0 0 1 0 1
A + BK = + = =
−a0 −a1 k1 k2 −a0 + k1 −a1 + k2 −p0 −p1
(3.34)
or, with our values for the parameters ai ,
       
0 1 0 0 0 1 0 1
A + BK = + = = (3.35)
−6 5 k1 k2 −6 + k1 5 + k2 −2 −3

Thus, equating the two right handside terms of expression (3.34), we obtain an
expression linking the gains of the feedback controller with the parameters of
the system, as well as the coefficients of the desired characteristic polynomial:
( (
−a0 + k1 = −p0 k1 = −p0 + a0
⇒ (3.36)
−a1 + k2 = −p1 k2 = −p1 + a1

and for our numerical values


( (
−6 + k1 = −2 k1 = 4
⇒ (3.37)
5 + k2 = −3 k2 = −8

53

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.3. STABILIZATION OF LTI SYSTEMS BY STATE FEEDBACK

After this example, the n-dimensional case is not more difficult. Indeed,
considering now the n-dimensional CCF
   
0 1 0 ... 0 0
 .. . .. . .. .
..  .
 .. 
 
 . 0
 ... ..  x + . u
   
ẋ =  .. ..  ..  (3.38)
 . . . 0    
 0 0 ... 0 1   0
−a0 −a1 . . . . . . −an−1 1
whose characteristic polynomial is

a(s) = sn + an−1 sn−1 + . . . + a2 s2 + a1 s + a0 (3.39)

Using a state-feedback controller given by


 
x1
 x2 

 
u = Kx = k1 k2 ... kn  .  (3.40)
 .. 
xn
we have the closed-loop system
 
0 1 0 ... 0
 .. .. .. .. 
 . 0 . . . 
. ..
 
ẋ =  .. .. .. x (3.41)

 . . . 0 

 0 0 ... 0 1 
−a0 + k1 −a1 + k2 ... ... −an−1 + kn
whose closed-loop characteristic polynomial is

acl (s) = sn + (an−1 − kn )sn−1 + . . . + (a2 − k3 )s2 + (a1 − k2 )s + a0 − k1 (3.42)

Thus, wanting the system in closed-loop to have the desired characteristic poly-
nomial
p(s) = sn + pn−1 sn−1 + . . . + p2 s2 + p1 s + p0 (3.43)
means that we need to set the state-feedback controller gains to

k1 = −p0 + a0 , k2 = −p1 + a1 , ..., kn = −pn−1 + an−1 (3.44)

Algorithm/summary: Stabilization of a controllability canonical form


using a linear state-feedback controller
• compute the characteristic polynomial

a(s) = sn + an−1 sn−1 + . . . + a2 s2 + a1 s + a0

of the CCF,
• using the n desired poles of the system in closed-loop, compute the desired
characteristic polynomial

p(s) = sn + pn−1 sn−1 + . . . + p2 s2 + p1 s + p0 ,

54

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.3. STABILIZATION OF LTI SYSTEMS BY STATE FEEDBACK

• set the state-feedback controller gains to




 k1 = −p0 + a0

k2 = −p1 + a1

.. (3.45)


 .

kn = −pn−1 + an−1

3.3.3 Pole placement: the general case


How do we control a state-space representation which is not in a controllability
canonical form? The answer is actually pretty simple and very similar to what
we did for open-loop control. Indeed, if ẋ = Ax + Bu is not a CCF, then find
a coordinate transform z = T x such that ż = Ãz + B̃u is a CCF, then proceed
as in the previous subsection.

Algorithm/summary: Stabilization of a general state-space represen-


tation ẋ = Ax + Bu by state-feedback
• If the system is controllable, compute the transform T to obtain a CCF,
as well as matrix Ã,
• compute the characteristic polynomial

ã(s) = sn + ãn−1 sn−1 + . . . + ã2 s2 + ã1 s + ã0

of the CCF,
• using the n desired poles of the system in closed-loop, compute the desired
characteristic polynomial

p(s) = sn + pn−1 sn−1 + . . . + p2 s2 + p1 s + p0 ,

• set the state-feedback controller gains (defined in the z coordinates) to



k̃1 = −p0 + ã0


k̃2 = −p1 + ã1

.. (3.46)


 .

k̃n = −pn−1 + ãn−1

• apply the control input using the original x coordinates

u = K̃T x (3.47)

55

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.4. LINEAR STATE-FEEDBACK FOR NONLINEAR SYSTEMS

3.4 Linear state-feedback for nonlinear systems


The interest of linear state-feedback control lies essentially in its simplicity: take
the current state as information, and multiply it by a few gains to compute the
control input which is then applied back to the plant. As we have seen, the
computation of the gains is not very complicated for linear systems.
Interestingly, applying linear state-feedback to systems which are nonlinear is
also possible. The basic idea consists in choosing a point of interest where
one wishes to stabilize the system, and then apply the right state-feeedback
controller based on an approximation of the system around the point of interest.

3.4.1 Equilibrium Points


In order to make the notion of “point of interest” a bit more specific, we will
use the concept of equilibrium point. Let us start by giving a definition of an
equilibrium point in the state-space context.

Definition: An equilibrium point or equilibrium, noted x∗ , is a point in the


state-space, for which, if the state x(t) reaches x∗ , it will stay there forever (in
a state of equilibrium).

Figure 3.3: Trajectory and equilibrium point for a two-dimensional discrete-time


system

From the above definition, note, importantly, that while it is possible that
the origin of the state-space is an equilibrium, it does not have to be so (see for
example the illustration in figure 3.3). Second, and we will see on an example,
the definition implies that there can be several points, not just one.

It now remains to be able to determine/compute equilibrium point(s) for


a given system. As it turns out, the above definition also helps us with that.
Indeed, for continuous-time systems, an important implication of the definition
can be written as
d ∗
x =0 (3.48)
dt
which, if the considered system is described by ẋ = f (x), gives

0 = f (x∗ ) (3.49)

56

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.4. LINEAR STATE-FEEDBACK FOR NONLINEAR SYSTEMS

Hence, a mathematical way to obtain the set of equilibrium points of a continuous-


time system described by the nonlinear state-space representation ẋ = f (x) con-
sists in finding all the solutions x∗ of equation (3.49).

Let us see that through the following example.

Example: Pendulum
Recall that we have  
x2 (t)
ẋ(t) = (3.50)
− gl sin x1 (t)
A first simple way to find the equilibrium points of this system is through using
a simple physical reasoning. The system is in equilibrium means that it does not
move anymore :-). Hence we have that the second component of x∗ , ie angular
velocity x∗2 is zero. This corresponds to 2 equilibrium positions (modulo 2π),
pendulum up and pendulum down. Thus we can easily conjecture 2 equilibrium
points:  ∗    ∗  
x 0 x π
x∗ = 1∗ = and x∗ = 1∗ = (3.51)
x2 0 x2 0
Let us now confirm that mathematically. Indeed, having equation (3.49) means
that we need to solve    
x∗2 π
g = (3.52)
− l sin x∗1 0
which indeed leads exactly to the 2 equilibrium points obtained in (3.51).

At this point, it is worth mentioning that the dynamic behavior around (but
not on) each equilibrium point can be very different whether the pendulum is up
or down. This is indeed the case and we will discuss that when we look at stabil-
ity considerations. For now, let us continue our discussion on equilibrium points.

For discrete-time systems like x(t + 1) = f (x(t)), the concept of derivative


with respect to the time-variable does not apply. However, saying that x∗
will “will stay there forever” can easily be translated mathematically by the
expression
x∗ = f (x∗ ) (3.53)
which we need to solve in order to find the set of equilibrium points.

The systems we have considered now did not have any input signal... Let us
first see what happens when a torque input is added to our pendulum example.

Example: Pendulum with control input


Consider now our pendulum with a torque applied to it. The state-space model
is now  
x2 (t)
ẋ(t) = (3.54)
− gl sin x1 (t) + ml1 2 u(t)
where the control input signal u(t) is the torque applied to the pendulum. Let
us now start with a basic consideration given by the physics of the system. Since

57

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.4. LINEAR STATE-FEEDBACK FOR NONLINEAR SYSTEMS

a specific constant torque can maintain the pendulum in a particular fixed an-
gle/position, then the input signal plays an important role in the definition of
equilibrium points.
Let us see that mathematically. Setting the fector field to zero leads to expres-
sion    
x∗2 0
g = (3.55)
− l sin x∗1 + ml1 2 u∗ 0
where u∗ stands for the control input associated to the equilibrium x∗ , ie the
value of the control input for which we have an equilibrium. Rewriting the
second line of this expression gives
g 1 ∗
0 = − sin x∗1 + u (3.56)
l ml2
where we see that we can choose any value of x∗1 as long as we find the corre-
sponding u∗ !
For example, assume that we would like to maintain the pendulum on position
x∗1 = π4 . Then we have the associated control input
π
u∗ = mgl sin (3.57)
4
Hence, for system (3.54), we have the set of equilibrium points given by
 ∗
x
x∗ = 1 (3.58)
0
and its associated control input
u∗ = mgl sin x∗1 (3.59)

Hence, for systems with a control input, the set of equilibrium points can
have to be considered in conjunction with their associated control input u∗ .

3.4.2 Linear approximation of a nonlinear system


Similarly to a smooth curve being approximated by a straight line in a neighbor-
hood around a point, a nonlinear can be locally and approximatively described
by a linear system around an equilibrium point x∗ .
Let us see how such a linear approximation can be obtained, first on a system
without input. Hence, starting with the nonlinear system dynamics
d
x(t) = f (x(t)) (3.60)
dt
we would like to find the linear dynamics corresponding to small deviations
around an equilibrium point, ie we define
δx(t) := x(t) − x∗ (3.61)
which makes it possible to rewrite nonlinear system (3.60) as
d ∗
(x + δx(t)) = f (x∗ + δx(t)) (3.62)
dt
Let us now recall a basic mathematical result on the use of Taylor series.

58

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.4. LINEAR STATE-FEEDBACK FOR NONLINEAR SYSTEMS

First-order approximation using Taylor series:


Around x∗ , an approximation of function f can be written as

∂f
f (x∗ + δx(t)) ≈ f (x∗ ) + (x) .δx(t) (3.63)
∂x x=x∗

where, if we have the vector field given by


 
f1 (x1 , x2 , ..., xn )
 f2 (x1 , x2 , ..., xn ) 
f (x) =  .. , (3.64)
 
 . 
fn (x1 , x2 , ..., xn )
∂f
the expression ∂x is the so-called Jacobian matrix written as
 ∂f ∂f1 ∂f1

∂x1 (x) ∂x2 (x) . . . ∂xn (x)
1

 ∂f2 ∂f ∂f
 ∂x1 (x) ∂x22 (x) . . . ∂xn2 (x)

∂f
(x) =  .
 .. ..  (3.65)
∂x  .. . ... . 

∂fn ∂fn ∂fn
∂x1 (x) ∂x2 (x) . . . ∂xn (x)

Then, combine (3.62) and (3.63) to get

d ∗ ∂f
(x + δx(t)) ≈ f (x∗ ) + (x) .δx(t) (3.66)
dt ∂x x=x∗

d ∗
Then, since x∗ is an equilibrium point, we have dt x = 0 and f (x∗ ) = 0, which
finally gives us the dynamics
 
d ∂f
(δx(t)) = (x) δx(t) (3.67)
dt ∂x x=x∗

Note that the above system is linear.

Example: Linearized pendulum


We would like to have the linear approximation of the pendulum system around
both equilibrium points x∗ = [0, 0]T and x∗ = [π, 0]T . Recall that
   
x2 x2
ẋ = ⇒ f (x) = (3.68)
− gl sin x1 − gl sinx1

which gives the Jacobian


 
∂f 0 1
(x) = (3.69)
∂x − gl cos x1 0

Evaluating this Jacobian on the two equilibrium points gives


 
∂f 0 1
(x) = (3.70)
∂x x=x∗ =[0,0]T
− gl 0

59

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.4. LINEAR STATE-FEEDBACK FOR NONLINEAR SYSTEMS

for x∗ = [0, 0]T and  


∂f 0 1
(x) = g (3.71)
∂x x=x∗ =[0,0]T l 0

x∗ = [π, 0]T . Hence, for both equilibrium points, we have the linear dynamics
of the small variations
δ ẋ = Aδx (3.72)
but with different matrix A! Indeed, for equilibrium x∗ = [0, 0]T we have
 
0 1
A= (3.73)
− gl 0

while for x∗ = [π, 0]T we have


 
0 1
A= g (3.74)
l 0

The previous reasoning can easily be extended to systems with inputs rep-
resented by
ẋ(t) = f (x(t), u(t)) (3.75)
In this case, we want to obtain a linear approximation of the system around x∗
and its associated input u∗ . Hence we write
d ∗
(x + δx(t)) = f (x∗ + δx(t), u∗ + δu(t)) (3.76)
dt
so that the first-order approximation of f (x, u) is now

f (x∗ + δx(t), u∗ + δu(t))


 
∗ ∗ ∂f
≈ f (x , u )+ ∂x (x, u) .δx(t)
x=x∗ ,u=u∗
 
∂f
+ ∂u (x, u) .δu(t) (3.77)
x=x∗ ,u=u∗

where δu(t) := u(t) − u∗ . From there, and similarly to what we have done for
systems without inputs, we end up with the following linear approximation
" # " #
d ∂f ∂f
δx(t) = (x, u) δx(t) + (x, u) δu(t) (3.78)
dt ∂x x=x∗ ,u=u∗ ∂u x=x∗ ,u=u∗

that is we have the following state-space representation

δ ẋ = Aδx + Bδu (3.79)

with
" # " #
∂f ∂f
A= (x, u) and B= (x, u) (3.80)
∂x x=x∗ ,u=u∗ ∂u x=x∗ ,u=u∗

60

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.4. LINEAR STATE-FEEDBACK FOR NONLINEAR SYSTEMS

Example: Linearization of the robot “elbow”


We want to linearize again our controlled pendulum, but this time around the
equilibrium points
   
∗ π/2 ∗ π/4
x = and x = (3.81)
0 0

Recalling that the controlled pendulum equations read


 
x2 (t)
ẋ(t) = (3.82)
− gl sin x1 (t) + ml1 2 u(t)

it means that we have the two Jacobians


   
∂f 0 1 ∂f 0
(x, u) = and (x, u) = (3.83)
∂x − gl cos x1 0 ∂u 1
ml2

Hence, for the first equilibrium point, we have


   
π/2 ∂f 0 1
x∗ = ⇒ (x) = (3.84)
0 ∂x x=x∗ ,u=u∗
0 0

so that the local dynamics around x∗ are


   
0 1 0
δ ẋ = δx + 1 δu (3.85)
0 0 ml2

For the second equilibrium point, we have this time

0 1
   
π/4 ∂f
x∗ = ⇒ (x) = √
2g (3.86)
0 ∂x x=x ,u=u
∗ ∗ − 2l 0

which gives the local linear dynamics

0 1
   
0
δ ẋ = √ δx + 1 δu (3.87)
− 2l2g 0 ml2

61

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.4. LINEAR STATE-FEEDBACK FOR NONLINEAR SYSTEMS

3.4.3 Stabilizing a nonlinear system by linear state-feedback


Once the local dynamics around an equilibrium point x∗ are calculated, design-
ing a feedback controller to stabilize the corresponding nonlinear system around
that point is pretty straightforward.
Indeed, recall that, mathematically, linerization round (x∗ , u∗ ) gives the lin-
ear system
δ ẋ = Aδx + Bδu (3.88)
If this linear system is not stable, then it can be stabilized with a linear state-
feedback law given by
δu(t) = Kδx(t) (3.89)
where we know how to compute the values of gain row vector K so that we
have the desired poles in closed-loop. However, remember that δu(t) represents
only small deviations around a nominal u∗ , and therefore that δu should not
be applied directly to the nonliner system. Indeed, the control input signal is
and will always be u(t). Hence, using the way δu is defined, the control input
applied to the nonlinear system is given by

u(t) = u∗ + δu(t) (3.90)

Similarly, the variable δx used for feedback in (3.89) still represents small de-
viations around x∗ , not the state x(t) as measured from the nonlinear system
itself. As a consequence, what enters our feedback controller (3.89) is

δx(t) = x(t) − x∗ (3.91)

Hence, combining (3.89), (3.90) and (3.91), a way to implement our linear state-
feedback stabilizer of a nonlinear system would be given by the following ex-
pression
u(t) = K(x(t) − x∗ ) + u∗ (3.92)
This linear controller and its nonlinear plant are represented together in a block
diagram below (see figure 3.4).

Figure 3.4: Linear state-feedback controller for a nonlinear system

62

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.5. MORE APPLICATIONS OF LINEAR STATE-FEEDBACK

3.5 More applications of linear state-feedback


3.5.1 Stabilization of a linear system around an equilib-
rium point
Interestingly the results of section 3.4.3 can naturally apply to linear systems
as well. Indeed, so far, when stabilizing a linear system represented by ẋ =
Ax + Bu, we have mostly used the control law u = Kx, meaning the state x(t)
of the system in closed loop was converging to 0.
First, note that in doing so, we have implictly stated that the equilibrium point
of the system in closed loop is x∗ = 0. This is indeed the case, ie have we that

0 = A′ x∗ = (A + BK)x∗ (3.93)

has the solution x∗ = 0 for any matrix A′ .

But what if we want to stabilize the system on another equilibrium point?


As we have seen previously, for systems with inputs, equilibrium points x∗ and
their associated u∗ should be the solution of the algebraic equation

0 = Ax∗ + Bu∗ (3.94)

ie for some x∗ , there will be a corresponding control input u∗ . And since we


want to stabilize around x∗ , let us define

∆x(t) := x(t) − x∗ and ∆u(t) := u(t) − u∗ (3.95)

where ∆x represents the “error” around x∗ In order to stabilize the system,


∆u the control input changes around the nominal u∗ . In this case, what is
important is to drive the error variable ∆x(t) to 0. To see this, first compute
its time-derivative:
d d
(∆x(t)) = (x(t) − x∗ ) = Ax + Bu (3.96)
dt dt
and, since Ax∗ + Bu∗ = 0, we can also write
d
(∆x(t)) = Ax − Ax∗ + Bu − Bu∗ (3.97)
dt
which finally gives
d
(∆x(t)) = A∆x(t) + B∆u(t) (3.98)
dt
These dynamics are called error dynamics. Note that, in (3.98), if ∆u(t) = 0
(which also means if u(t) = u∗ ), then we have the corresponding equilibrium
point ∆x∗ = 0.
Then, similarly to the previous section, we can simply stabilize this system with
the linear state-feedback controller

∆u(t) = K.∆x(t) (3.99)

while the control input applied to the system, is also given by

u(t) = K(x(t) − x∗ ) + u∗ (3.100)

63

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.5. MORE APPLICATIONS OF LINEAR STATE-FEEDBACK

The difference with the previous section is that, contrary to the nonlinear system
case, the variations around (x∗ , u∗ ) do not to be local or “small” since we are
not using an approximation. The system is linear and the error variable ∆x(t)
(and ∆u(t) as well) can be as big as we want. Hence the notation ∆x used here
as opposed to δx for the nonlinear case.

Figure 3.5: State-feedback controller for a linear system

3.5.2 Tracking control for linear systems


One can extend the previous result for a system to track or follow a particular
trajectory of reference xd (t). In this case, the feedback controller will have to
compensate for errors around this trajectory.

First, we need to make sure it is actually possible at all for the system to
follow this trajectory, especially when there is no disturbance or difference in
initial conditions. Hence, we will call feasible trajectory for the system ẋ =
Ax + Bu a desired trajectory xd (t) if an open-loop control signal ud (t) can be
found such that xd (t) is a solution for the system with ud (t) as input. That is
we have xd (t) and ud (t) verifying
ẋd (t) = Axd (t) + Bud (t) (3.101)
Note that this expression can be seen as an extension of the equilibrium relation
(3.94) we just saw in section 3.5.1. Indeed, if xd (t) is constant, then expression
(3.101) reduces to 0 = Axd + Bud , which is nothing else than (3.94).
Alternatively, one can also draw links with open-loop control using flatness the-
ory: in the linear case, the desired control input ud (t) as a function of desired
flat variable Fd (t) and its derivatives is just another way to write expression
(3.94) here above.

Once the feasible trajectory xd (t) and its associated ud (t) are defined, we
can introduce, similarly again to the previous section the “delta” variables given
by
∆x(t) := x(t) − xd (t) and ∆u(t) := u(t) − ud (t) (3.102)
which again leads to the error dynamics around (xd (t), ud (t))
∆ẋ = A∆x + B∆u (3.103)

64

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.6. INTEGRATION USING LINEAR STATE-FEEDBACK

form which we obtain the tracking controller expression

u(t) = K(x(t) − xd (t)) + ud (t) (3.104)

Interestingly, note that tracking controller (3.104) thus combines an open-loop/feedforward


controller with a standard linear state-feedback controller, as represented in fig-
ure 3.6.

Figure 3.6: OL + Linear State-FB = tracking controller.

3.6 Integration using linear state-feedback


3.6.1 Basic principle
Through our simulations/experiments, we have seen that linear state-feedback
is quite good at coping with transitory disturbances, such as high-frequency
noise or differences in initial conditions.
However, other more persistent disturbances can perturb the system. For
example, a constant wind will influence the behavior of a plane, a heavy pas-
senger in the car might push the driver to increase the action on the throttle to
maintain speed.
To see how persistent disturbances affect systems, let us start with the simple
linear scalar system represented by

ẋ = ax + bu (3.105)

where a and b are the constant parameters of the system. Applying the state-
feedback controller u = kx, we will get the closed-loop dynamics

ẋ = (a + bk) x (3.106)

which will be stable around equilibrium point x∗ = 0 provided a + bk < 0.


Assume now that a constant disturbance d affects the system additively, ie we
have
ẋ = ax + bu + d (3.107)
Using the same feedback law u = kx means that, because of the disturbance d,
closed-loop dynamics (3.106) become

ẋ = (a + bk) x + d (3.108)

65

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.6. INTEGRATION USING LINEAR STATE-FEEDBACK

for which we have a new equilibrium point given by


−1
x∗ = d (3.109)
a + bk
Expression (3.109) means that unless we set the gain of our controller to k = ∞
(both unrealistic and unreasonable), the equilibrium cannot be x∗ = 0 anymore.
Hence, the simple feedback law u(t) = kx(t) cannnot completely compensate
for constant disturbances.
Let us now introduce a state-feedback law where an integral term is added:
Z t
u(t) = kx(t) + kI x(τ )dτ (3.110)
0

with kI a constant scalar gain tuning the influence/importance of the integral


term. Putting (3.110) into disturbed system (3.107), we get the closed-loop
dynamics Z t
ẋ = ax + bkx + bkI x(τ )dτ + d (3.111)
0

Expression (3.111), combining both integral and differential terms, is simply


called an integro-differential equation. In order to obtain a differential equation,
differentiate (3.111) to get

ẍ = (a + bk)ẋ + bkI x (3.112)

where it is important to notice that the constant disturbance term has disap-
peared since d˙ = 0. Converting this second-order system into a state-space
representation by defining the state coordinates [x1 , x2 ]T := [x, ẋ]T , we get
    
d x1 0 1 x1
= (3.113)
dt x2 bkI a + bk x2

which has equilibrium point


   ∗  
x∗1 x 0
= ∗ = . (3.114)
x∗2 ẋ 0

We know that the whole state [x1 (t), x2 (t)]T and hence x1 (t) = x(t), will con-
verge to 0 provided each eigenvalue of the matrix
 
0 1
AI (3.115)
bkI a + bk

has a strictly negative real part. The result is quite important, because it means
that provided that k and kI are chosen properly, ie so that the dynamics (3.113)
are stable, controller (3.110) can stabilize our scalar system around the origin,
and this despite the presence of an additive constant disturbance!

66

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.6. INTEGRATION USING LINEAR STATE-FEEDBACK

3.6.2 Integral feedback law for systems in controllability


canonical form
We can now extend the previous idea to consider a controllability canonical form
where the disturbance term is at the same level as the input. For simplicity of
the discussion, we also have set b = 1. Thus, our disturbed system reads


 ẋ1 = x2

ẋ2 = x3

.. (3.116)


 .

ẋn = −a0 x1 − ... − an−1 xn + u + d

Let us now introduce the state-feedback law with integral term on x1 (t)
Z t
u(t) = Kx(t) + kI x1 (τ )dτ
0
Z t
= kn xn (t) + ... + k2 x2 (t) + k1 x1 (t) + kI x1 (τ )dτ (3.117)
0

where the order of the terms ki xi (t) are inverted just for convenience (see also
in figure 3.7 a block diagram of the proposed controller in connection with a
plant).

Figure 3.7: State-feedback control with integration

Putting (3.117) into (3.116), we get the closed-loop dynamics




 ẋ1 = x2

ẋ2 = x3

...


 Rt
ẋn = (kn − an−1 ) xn + ... (k2 − a1 ) x2 + (k1 − a0 ) x1 + kI 0 x1 (τ )dτ + d

(3.118)

67

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.6. INTEGRATION USING LINEAR STATE-FEEDBACK

As previously, differentiate the integro-differential term ẋn and introduce the


additional state component xn+1 = ẋn to obtain


 ẋ1 = x2
ẋ = x3


 2


..
. (3.119)





 ẋn = xn+1

ẋn+1 = (kn − an−1 ) ẋn + ... (k2 − a1 ) x3 + (k1 − a0 ) x2 + kI x1

or, in vectorial form:


  0 1 0 ... 0
 
ẋ1 x1
 ẋ2    0 0 1 ... 0 
 x2 
 ..  
  ..  ..

 . = 0 0 0 . 0   .

 (3.120)
  . .. .. ..
 
 ẋn    ..  xn 

. . . 1
ẋn+1 kI (k1 − a0 ) (k2 − a1 ) ... (kn − an−1 ) xn+1

ie because of the integrator we have the n + 1-dimensional closed-loop dynamics


of the form
ẋE = AE xE (3.121)
with xE := [xT , ẋn ]T . As we know quite well by now, closed-loop system (3.120)-
(3.121) is stable if the real part of each eigenvalue of AI is strictly negative.
Another way to state this, is that we need to tune the gains kI , k1 , ..., kn so that
(3.120) or (3.121) is stable. How? With exactly the same method as the one we
saw in section 3.3, with this time characteristic polynomials of order n + 1.

3.6.3 General LTI systems


In case the system considered is not a controllability canonical form, we just
start with transforming the system described by

ẋ = Ax + B(u + d) (3.122)

which, using the transform z = T x, becomes

ż = T AT −1 z + T B(u + d) (3.123)

so that the system is now in controllability canonical form in the z-coordinates,


so that we can design the controller
Z t
u(t) = K̃z(t) + k̃I z1 (τ )dτ (3.124)
0

Note, importantly, that, since we use z1 (t) in the integral term, we will have
then Z t
u(t) = K̃T x(t) + k̃I T1 x(τ )dτ (3.125)
0
when we come back to the x-coordinates to implement the controller. Hence, in
this case, this means that we might need to integrate the whole state, not just
x1 (t).

68

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.6. INTEGRATION USING LINEAR STATE-FEEDBACK

3.6.4 Stabilization around an equilibrium point


Let us come back to our scalar system

ẋ = ax + bu (3.126)

and assume this time that we want to stabilize it around an equilibrium point not
at the origin, ie we have x∗ 6= 0. For convenience, let us rewrite this equilibrium
point as r := x∗ (often called “reference”). As an alternative to what we saw in
section 3.5, ie a combined open-loop/state-feedback control strategy, consider
instead the following dynamic state-feedback controller (with integral term)
Z t
u(t) = kx(t) + kI (x(τ ) − r)) dτ (3.127)
0

This gives the closed-loop dynamics, after differentiation,

ẍ = (a + bk) ẋ + bkI (x − r) (3.128)

whose state-space representation is


      
d x1 0 1 x1 0
= + r (3.129)
dt x2 bkI a + bk x2 −bkI
or, in component form
(
ẋ1 = x2
(3.130)
ẋ2 = (a + bk)x2 + bkI (x1 − r)

Let us now look at the equilibrium points of system (3.129) or (3.130). Setting
the derivative of the state components to 0, we get
) (
0 = x∗2 x∗1 = r
∗ ∗
⇒ (3.131)
0 = (a + bk)x2 + bkI (x1 − r) x∗2 = 0

which means that we are free to choose any r we want! The important im-
plication of this is that, provided of course that k and kI are chosen so that
the system is stabilized, using integral controller means that the system will be
stabilized around the desired reference r = x∗ .
This particular technique is quite interesting because, contrary to the method
that we have seen in section 3.5.1 for stabilizing around an equilibrium point
x∗ , it does not require the computation of u∗ . It is implicitely computed by the
dynamic controller (3.127).
The above discussion can be generalized to higher-order systems using the
derivations used in the previous subsections.

3.6.5 Polynomial disturbances


More complex disturbances than the simple constant signals seen in section 3.6.1
can be considered using the same basic integral idea. Indeed, consider again our
scalar example but affected this time with a constantly increasing disturbance

ẋ = ax + bu + d.t (3.132)

69

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.6. INTEGRATION USING LINEAR STATE-FEEDBACK

where the constant term d is multiplied by the time variable t. To compensate


for this first-order polynomial disturbance, one will then use the following linear
state-feedback controller with double integrator
Z t Z tZ τ
u(t) = kx(t) + kI x (τ ) dτ + kII x(σ)dσdτ (3.133)
0 0 0

and similarly for higher-order polynomial disturbances where we will simply


need more integrators.

3.6.6 A link with PID control


Linear state-feedback controller with integration can be related to the well-
known Proportional-Integral-Derivative (PID) controller, widely used in the in-
dustry. This controller, whose block diagram can be seen in figure 3.8,

Figure 3.8: PID Controller

is usually mathematically described as


Z t
de
u(t) = kp e(t) + ki e(τ )dτ + kd (t) (3.134)
0 dt

where kp , ki and kd are the proportional, integral and derivative gains, respec-
tively. Variable e(t), called the error, is defined by e(t) = r(t) − y(t), where r(t)
is the so-called reference signal.
In order to compare a PID controller with linear state-feedback techniques,
let us first assume, for simplicity, that the reference signal is such that r(t) = 0
(i.e. we want to stabilize the system output around the origin). In this case,
controller (3.134) simplifies into
Z t
u(t) = −kp y(t) − ki y(τ )dτ − kd ẏ(t) (3.135)
0

Furthermore, we will also assume that the plant is a second-order system rep-

70

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.6. INTEGRATION USING LINEAR STATE-FEEDBACK

resented by the following controllability canonical form



ẋ1 = x2

ẋ2 = −a0 x1 − a1 x2 + bu (3.136)

y = x1

As we have seen, in this case, a linear state-feedback controller with integral


term takes the form
Z t
u(t) = k1 x1 (t) + k2 x2 (t) + kI x1 (τ )dτ (3.137)
0

which, because we have a controllability canonical form, we have x1 = y and


x2 = ẏ, and this implies
Z t
u(t) = k1 y(t) + k2 ẏ(t) + kI y(τ )dτ (3.138)
0

Note the striking resemblance between the above expression and equation (3.135).
Indeed, we have exactly kp = −k1 , kd = −k2 and ki = −kI , ie besides the sign
difference, k1 plays the same role as the proportional gain kp , k2 the same as
derivative gain kd and kI the same as ki .

A quite similar analysis can be carried out for second-order systems stabilized
around a non-zero reference input signal. However, for higher-order systems, a
state-feedback controller will have more gains, allowing to control more complex
dynamics (roughly corresponding to adding higher derivative terms in the PID
control frameworkd), while the PID controller will basically remain the same.
However, PID control turns out to be quite effective and sufficiently performant
while remaining quite simple in many cases, hence its popularity.

71

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.7. LINEARIZATION BY STATE-FEEDBACK: A TINY


INTRODUCTION TO NONLINEAR STATE-FEEDBACK

3.7 Linearization by state-feedback: a tiny in-


troduction to nonlinear state-feedback
If linear state-feedback can work nicely for nonlinear systems, it does so some-
times only in a neighborhood around the chosen equilibrium point. However,
as we will very briefly see in this section, the mechanisms behind linear state-
feedback can be very easily extended to obtain controllers that are nonlinear.
But before jumping into this, let us revisit linear state-feedback with a slightly
different perspective.

Start with the simple second order system (think of a MSD system with a
mass of m = 1, for example) described by
(
ẋ1 = x2
(3.139)
ẋ2 = −a0 x1 − a1 x2 + u

In this pole placement method, we have seen that, after feedback, the system
would have the (desired) characteristic polynomial p(s) = s2 + p1 s + p0 , which
corresponds to the state-space representation
(
ẋ1 = x2
(3.140)
ẋ2 = −p0 x1 − p1 x2

To obtain these closed-loop dynamics, we have used the linear state-feedback


controller
u = k1 x1 + k2 x2 (3.141)
where k1 was obtained by k1 = −p0 + a0 and similarly k2 = −p1 + a1 , meaning
that we could replace expression (3.141) with

u = (−p0 + a0 )x1 + (−p1 + a1 )x2 (3.142)

If we separate the system coefficients from the desired ones, this last expression
can be rewritten as
u = a 0 x 1 + a 1 x 2 − p0 x 1 − p 1 x 2 (3.143)
Putting now control law (3.143) back into system (3.139), we get
(
ẋ1 = x2
(3.144)
ẋ2 = −a0 x1 − a1 x2 + ({a0 x1 + a0 x2 } + [−p0 x1 − p1 x2 ])

where, in the second line of closed-loop system (3.144), the terms in parentheses
are the terms clearly coming from controller expression (3.143). Note that we
have separated the terms of this control expression into two parts: a part in
braces and a part in brackets.
As can be seen in the second line of (3.144), the part in braces is exactly the
opposite of the system dynamics themselves. In control terminology, we say
hence that this part of the control law cancels the system dynamics.
As for the part in brackets, it is simply there to obtain the new stable dynamics
one the old system dynamics have been eliminated by the terms in braces. These
terms in the brackets are usually called stabilizing terms. They correspond to

72

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.7. LINEARIZATION BY STATE-FEEDBACK: A TINY


INTRODUCTION TO NONLINEAR STATE-FEEDBACK

our desired poles, the dynamics of the system in closed-loop.

Thus, the separation of these different kinds of term leads to consider two
combined controllers: one in charge of cancelling the dynamics of the original
plant or system, and one for stabilizing the newly-obtained dynamics, ie after
cancellation. To see this, restart from scratch with system (3.139), whose dy-
namics we want to erase totally so that, after using our first feedback law, we
would have the new dynamics
(
ẋ1 = x2
(3.145)
ẋ2 = v

where v is a new control input. To go from system (3.139) to (3.145), we used


the “dynamics-cancelling” controller expression
u = a0 x1 + a1 x2 + v (3.146)
Then, once we obtain the new dynamics (3.145), they are quite easy to stabilize
since it is only a chain of two integrators. We can simply apply the stabilizing
state-feedback term
v = −p0 x1 − p1 x2 (3.147)
to obtain the stable closed-loop dynamics (3.140). Hence we have used a com-
bination of two controllers to do pole placement of system (3.139): a cascade
of a controller cancelling the system dynamics with a controller stabilizing the
newly-obtained dynamics.

More generally, if we take a controllability canonical form of order n (we also


assume b = 1), we can use a control law that will cancel the system dynamics
u = a0 x1 + a1 x2 + ... + an−1 xn + v (3.148)
which will give new simple dynamics (ie a chain of integrators)


 ẋ1 = x2

ẋ2 = x3

(3.149)
...



ẋn = v

that we can stabilize using the linear state-feedback controller


v = −p0 x1 − p1 x2 − ... − pn−1 xn (3.150)
This basic idea of first cancelling a system dynamics to then stabilize the
simpler system is what leads to the definition, for nonlinear systems, of nonlinear
controllers. Let us see that on our (now famous) controlled-pendulum example.

Example: cancelling the nonlinear dynamics of the robot elbow


Let us start, as usual, with
(
ẋ1 = x2
(3.151)
ẋ2 = − gl sin(x1 ) + 1
ml2 u

73

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

3.7. LINEARIZATION BY STATE-FEEDBACK: A TINY


INTRODUCTION TO NONLINEAR STATE-FEEDBACK

Since this system is of second-order, we would like to define a controller that will
cancel the system dynamics of the second line of (3.151) and obtain a system
identical to (3.145). To do so, remark it implies that we want
g 1
v = − sin(x1 ) + u (3.152)
l ml2
which means that, after isolating u, we have our “cancelling” controller

u = mgl sin(x1 ) + ml2 v (3.153)

Note that this controller is nonlinear. Because it allows to obtain linear system
(3.145), it is therefore called linearizing controller of feedback linearizing con-
troller, ie a controller that renders a system linear by feedback. Then, we just
have to define a stabilizing controller identical to the one we have in (3.147).
To summarize, putting (3.153) and (3.147) together in a global controller, we
get the state-feedback control law

u = mgl sin(x1 ) + ml2 (−p0 x1 − p1 x2 ) (3.154)

which is nonlinear.

The above example can naturally be generalized to higher-order nonlinear


forms of our familiar CCF. If this is quite beyond the scope of this course and
these notes, one can also apply feedback linearization for even more general non-
linear systems, which, roughtly speaking involve a coordinate transformation,
this time nonlinear, ie z = T (x) and which can be quite involved compared to
our good-old linear case. However, the general principle or basic idea is still
pretty much the same as the one presented in the few paragraphs above.

74

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

Chapter 4

Observability and state


estimation

4.1 Introduction
Whether it was for stabilization, with or without integrator, tracking a trajec-
tory, we always assumed, when applying linear state-feedback that the state
vector x(t) was entirely accessible for measuremetns, and we were able to mea-
sure the whole state.
In practice, this might sometimes be the case, if one has enough sensors to
measure the whole state, but not always. In some situations, having enough
sensors might be too costly, or just plainly impractical. When the state is not
available, what one would like to have is an estimate of x(t).

This estimate, which we will note here x̂(t), is then used for state-feedback,
but not only: estimating the state of a system is useful for other applications as
well: monitoring and fault-diagnosis. As we will see, state estimation can also
be related to filtering.

What we will see in this are a few techniques to compute an estimate of the
state x(t) using only the available measurements y(t) as well as the knowledge
of the system’s state-space representation.

Depending on the structure of this state-space representation, as well as its


parameters (ie the matrices of the state-space representation for linear systems),
it is not always possible to compute an estimate of the whole state. This is
related to the notion of observability, notion that we will start this chapter
with.

4.2 Observability and the Kalman criterion


4.2.1 Observability notions
Given the linear state-space representation of a particular system, we would
like to know if it is possible, using the measurements y(t) (and maybe also

75

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.2. OBSERVABILITY AND THE KALMAN CRITERION

the control input signal u(t)) to compute/give an estimate of the state x(t).
When the answer to this question is a resounding yes, the system is said to be
observable.
Similarly to what we did in chapter 2 when we introduced the controllability
concept, the notion of observability can first be tackled using a block-diagram
perspective. Let us consider this with the simple following example.

Example: Vehicle on a straight road with a GPS sensor


Consider the idealized model of a vehicle travelling in a straight line, and whose
absolute position is given by a GPS sensor.

Figure 4.1: Vehicle with a GPS

A state-space representation of an extremely simplified dynamical model of


the vehicle could read, in component form:
(
ẋ1 (t) = x2 (t)
d 1
(4.1)
ẋ2 (t) = − m x2 (t) + m u(t)

where the output equation is


y(t) = x1 (t) (4.2)
with y(t) the position as measured by GPS.

Drawing the block diagram of system (4.1)-(4.2), we obtain (see figure below)

Figure 4.2: Block diagram of the vehicle-with-GPS example

76

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.2. OBSERVABILITY AND THE KALMAN CRITERION

By somewhat thinking in reverse, being able to compute an estimate of x(t)


using the measurements y(t) leads to all the components of the state have an
influence, direct or not, on the measurement. Looking at the flow of information
in the block diagram figure 4.2, one can see that the state components are
either directly connected to the measurement y(t), like x2 (t), or influence other
state components, which are themselves connected to y(t), like x1 (t) (which
influences x2 (t), itself connected to y(t). With this interpreration, the system
is observable.

Example: changing the sensor with a speedometer


Replacing now our GPS sensor with a speedometer, the output equation be-
comes
y(t) = x2 (t) (4.3)
while the state-space representation remains the same. Rewiring our output,
we have the block diagram shown in figure 4.3 below.

Figure 4.3: Example of a non-observable system

This time, notice that not all state components have an effect on the mea-
surement y(t). Indeed, x1 (t) will be totally invisible to y(t). The system is
therefore not observable. Note that a simple physical explanation of that is
that since we measure only the velocity of the vehicle, it is therefore not possi-
ble to know the whole state at time t because we do not know where the vehicle
started from.

4.2.2 Observability of linear systems and the role played


by inputs
For linear systems, the observability is not change depending on the presence
or absence of control inputs. This comes mostly from the linear property. To
see this mathematically, recall that
Z t
At
x(t) = e x0 + eA(t−τ ) Bu(τ )dτ (4.4)
0

is the solution of the dynamical equation

ẋ(t) = Ax(t) + Bu(t), x(0) = x0 (4.5)

77

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.2. OBSERVABILITY AND THE KALMAN CRITERION

Using then the measurement equation of the state-space representation of a


linear system, ie using y(t) = Ax(t) + Du(t), we have
Z t
y(t) = CeAt x0 + C eA(t−τ ) Bu(τ )dτ + Du(t) (4.6)
0

Considering for an instant equation (4.6), we see that y(t) known since we
measure it, A, B, C and D are also known because we assume we know the
state-space representation of the considered system. Control signal u(t) is also
assumed to be known, which means that the integral term of (4.6) is known, as
well as Du(t). In (4.6), the only unknown term is x0 .

Putting together the know terms on one side, we get

ȳ(t) = CeAt x0 (4.7)

where ȳ(t) is defined as


Z t
ȳ(t) := y(t) − C eA(t−τ ) Bu(τ )dτ + Du(t) (4.8)
0

and can be seen as a new output signal. Note that we would have had the same
expression as (4.8) had we had no input signal at all, except that ȳ(t) would
have been replaced by y(t). Hence the inputs do not play a role in the possibility
or not of recovering the state, ie it does not change anything to the observability
property of a linear system. Thus, and without loss of generality, we will in the
rest of this section assume that we have a state-space representation of the form
(
ẋ(t) = Ax(t), x(0) = x0
(4.9)
y(t) = Cx(t)

Note that this perperty applied only for linear systems. For nonlinear sys-
tems, things get generally more tricky, and there are input signals that can
change the observability property and make the system obsevable/unobservable.
Think of the nonlinear measurement equation y = x.u for example. If u = 0,
then it is going difficult to estimate the state at all.

4.2.3 A criterion to check observability


Having at our disposal a systematic criterion to test observability of a state-space
representation using only matrices A and B would be certainly more practical
than looking at block diagrams each time. Especially for system of order larger
than 2.
Before presenting such a criterion, let us give a more formal definition of
observability for linear systems.

Definition: The system represented by


(
ẋ(t) = Ax(t), x(0) = x0
(4.10)
y(t) = Cx(t)

78

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.2. OBSERVABILITY AND THE KALMAN CRITERION

is said to be (completely) observable if there is a time T > 0 such that knowledge


of y(t) on the interval [0, T ] is sufficient to determine the whole state x(t).

Rudolf Kalman proposed a criterion to systematically verify whether a sys-


tem represented by the pair (A, C) is observable or not. Let us this how it
works. Note that, at first glance, and assuming we have only one output, the
problem does not seem so obvious since the dimension of y(t) is 1 while the
dimension of the state which we want to compute is n.
However, the idea for the criterion is pretty simple. Indeed, since y(t) is
available on interval [0, T ], then we can compute its successive time-derivative.
Differentiating this output signal n − 1 successively, we obtain


 y(t) = Cx(t)
ẏ(t) = C ẋ(t) = CAx(t)





ÿ(t) = C ẍ(t) = CA2 x(t) (4.11)

 .
..



 (n−1)
y (t) = Cx(n−1) (t) = CAn−1 x(t)
whcih gives us n equations for n unknowns, the components of the state x(t).
Putting that in vectorial form, we thus get
   
C y(t)
 CA   ẏ(t) 
 CA2 
   
 x(t) =  ÿ(t)  (4.12)
 
 ..  ..

 
 .   . 
CAn−1 y (n−1) (t)
where the left handside matrix, noted Wo is called observability matrix. An
estimate of x(t) can then be obtained if and only if the row vectors of Wo
are linearly independent, or, in other words, if the observability matrix Wo is
nonsingular (if det(Wo ) 6= 0).
In this case, we can cimply compute an estimate of the state given by
 
y(t)
 ẏ(t) 
 
x̂(t) = Wo  ÿ(t) 
−1 
(4.13)

 .. 
 . 
y (n−1) (t)
Let us summarize this discussion with the following important result.

Theorem: The system represented by


ẋ = Ax, y = Cx (4.14)
is observable if and only if the n × n observability matrix
 
C
 CA 
2 
 
Wo =  CA  (4.15)

 .. 
 . 
CAn−1

79

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.3. STATE ESTIMATION USING OBSERVERS

is invertible.

Example: Back to the vehicle with speedometer


Setting d = 1 and m = 1, recalling that we had the state-space representation
 " #
ẋ = 0 1 x(t)


0 −1 (4.16)
 h i
y(t) = 0 1 x(t)

It is then easy to compute the observability matrix


 
  0 1
Wo = C CA = (4.17)
0 −1

and since
det(Wo ) = 0 (4.18)
the system is not observable, confirming thus our analysis using both basic
thinking and block diagram interpretation.

4.3 State estimation using observers


As we have seen in the previous section, an estimate of the state can be theore-
ically obtained directly from the observability analysis, as given by the formula
(4.13). However, since any measurement tends to be corrupted by noise, having
an estimate based on the successive derivatives of these measurements is not such
a good idea considering the usual noise-amplifying character of the derivative
operator. Hence it would be more suitable to have a state estimation algorithm
whose description would not need to differentiate the y(t) signals. Among these
estimation techniques are the so-called dynamic observers, or simply observers,
very widely used in control systems.

4.3.1 The observer as a virtual plant


The essential idea at the core of the observer concept goes like this: assume we
make a virtual copy of the plant’s model, ie a copy of the plant on the computer,
and apply to it the same control input as the one applied on the real plant (see
figure 4.4).

80

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.3. STATE ESTIMATION USING OBSERVERS

Figure 4.4: The observer as a virtual plant

The reasoning behind this idea, is that since both the plant and the observer
have the same models, then if apply to them the same input, them they will
have the same dynamical behavior. Hence the state of the observer, ie the state
estimate x̂, should have the same evolution as the state x(t). Now if the state
x(t) of the plant is not accessible/measurable, the state estimate x̂(t) certainly
is since the model is build on a computer, which makes every single variable
accessible!
To make these few points a bit more rigorous, let us recall the expression of
the plant given by
(
ẋ = Ax + Bu, x(0) = x0
(4.19)
y = Cx

and since our observer is (for now) a mere copy of the plant, we have
(
x̂˙ = Ax̂ + Bu, x̂(0) = x̂0
(4.20)
ŷ = C x̂

Note that, since x(t) is unknown, there is no reason (unless we are really, really
lucky) that both initial conditions are equal. Hence we have x0 6= x̂0 . Saying
that the observer is doing a good job means that, ideally, there would be no
difference whatsoever between the state and its estimate. Let us therefore define
this difference as
x̃(t) := x̂(t) − x(t) (4.21)

81

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.3. STATE ESTIMATION USING OBSERVERS

and call it estimation error. Clearly, initially, the estimation error is given by

x̃0 = x̂0 − x0 6= 0 (4.22)

The important question is how this estimation error evolves over time. To
answer this, let us compute the so-called estimation error dynamics. They are
simply obtained by computing the time-derivative of x̃(t):

x̃˙ = x̂˙ − ẋ = Ax̂ + Bu − Ax − Bu = A(x̂ − x) (4.23)

and the estimation error dynamics are given by

x̃˙ = Ax̃ (4.24)

Thus, if the estimation error dynamics (4.24) is stable, then x̃(t) will eventually
converge to 0 as t → ∞, which means that x̂(t) will converge to the true state
x(t)!

Since A is the matrix linked to the model of the plant, then this result means
that the observer will work just great and its estimate will converge to the actual
state of the plant as long as this plant is stable.
However, the downside of this technique would also mean that if the original
plant is not stable, then neither will the error dynamics be, so that the estimate
and the state will gradually drift apart from each other. There is a solution to
this issue. We will keep the powerful idea of copying the plant dynamics, but
will also add a little extra to make sure the observer does the right thing.

4.3.2 Feedback on the measurement


When we made a pure copy of the plant to design an observer, we used the
control input signal u(t), which we measure, as information to feed to the ob-
server. However, there is another signal we could use: the plant measurements
y(t)! Hence the idea is to take the available measurements y(t) = Cx(t) to make
corrections on the state estimate x̂(t). We propose then the following observer
equations (
x̂˙ = Ax̂ + Bu + L(y − ŷ)
(4.25)
ŷ = C x̂
Where L is a column vector of dimension n representing the amount of correc-
tions to be done on x̂(t) based on the difference between the output y(t) and
the estimated output ŷ(t). A block diagram of observer (4.25) is given in figure .

Note that if x̂(t) = x(t) in (4.25), then ŷ(t) = y(t) which means that
L(y − ŷ) = 0. This is an important implication, since, in this case, the ob-
server has the same dynamics as the plant.
However, when x̂(t) 6= x(t), the feedback term L(y − ŷ) corrects the state-
estimate x̂(t) so that it improves over time and gradually converge to x(t).

82

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.4. THE OBSERVABILITY CANONICAL FORM AND OBSERVER


TUNING

Figure 4.5: Block diagram of an observer

Let us now have a look at the estimation error dynamics corresponding to


observer (4.25). Computing the derivative of x̃(t), we get
x̃˙ = x̂˙ − ẋ = Ax̂ + Bu + L(y − ŷ) − Ax − Bu
= Ax̂ + LC(x − x̂) − Ax
= (A − LC)(x̂ − x) (4.26)
which gives the estimation error dynamics
x̃˙ = (A − LC)x̃ (4.27)
Hence the state estimate x̂(t) will converge to the state x(t) of the plant if the
real part of each eigenvalue of A − LC is strictly negative.

4.4 The Observability Canonical Form and ob-


server tuning
In the previous chapter, we have seen that, when doing linear state-feedabck,
the controllability canonical form was well suited for the calculation of the con-
troller gains ki .

As we will see, for observer design, one can proceed quite analogously, using
another form called Observability Canonical Form (OCF). Indeed, for the n-th
order differential equation
y (n) (t) + an−1 y (n−1) (t) + ... + a1 ẏ(t) + a0 y(t) = bu(t) (4.28)

83

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.4. THE OBSERVABILITY CANONICAL FORM AND OBSERVER


TUNING

we have the observability canonical form




 ẋ1 = −a0 xn + bu
ẋ = x1 − a1 xn


 2


ẋ3 = x2 − a2 xn (4.29)

 ..



 .

x˙n = xn−1 − an−1 xn

where note that the coefficients ai are the same as those of the controllability
canonical form. We also have the output equation

y = xn (4.30)

Hence, in vectorial notation, we have


 
0 ··· ··· 0 −a0  
1 0 ··· 0 −a1  b

 .. ..

 0
0 1
ẋ =  . . −a2 x + 
 
. u (4.31)
. .. .. ..   .. 
 .. . . 0 .  0
0 0 ··· 1 −an−1

and  
y = 0 ··· 0 1 x (4.32)
Before proceeding further, let us actually check that state-space representation
(4.31)-(4.32) indeed corresponds to system (4.28) for the simple special case
n = 2.

Example: Second-order system


Consider the second-order OCF given by
(
ẋ1 = −a0 x2 + bu
(4.33)
ẋ2 = x1 − a1 x2

with output equation


y = x2 (4.34)
To obtain the corresponding differential equation, firt differente the output to
get
ẏ = ẋ2 = x1 − a1 x2 (4.35)
which, isolating x1 and replacing x2 with y gives

x1 = ẏ + a1 y (4.36)

whose time-derivative is
ẋ1 = ÿ + a1 ẏ (4.37)
Putting expression (4.37) in equation with the first line of (4.33), we finally get

ÿ + a1 ẏ + a0 y + bu (4.38)

84

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.4. THE OBSERVABILITY CANONICAL FORM AND OBSERVER


TUNING

Because of the particular structure of the observability canonical form, com-


puting the values of the observer gain vector L from a desired dynamics of the
estimation error dynamics is actually quite simple. To see this, let us go back
to our second-order example.

Example: Observer tuning for a second-order OCF


For a second-order OCF, observer (4.25) can be re-written as
     
˙x̂ = 0 −a0 x̂ + b u + l1 (y − ŷ) (4.39)
1 −a1 0 l2
where  
ŷ = 0 1 x̂ (4.40)
Hence, the estimation error dynamics

x̃˙ = (A − LC)x̃ (4.41)

can be re-written as
      
0 −a0 l  0 −a0 − l1
x̃˙ = − 1 0 1 x̃ =

x̃ (4.42)
1 −a1 l2 1 −a1 − l2
We would like now to tune the values li so that the estimation error dynamics
x̃˙ = (A − LC)x̃ has the desired characteristic polynomial

s 2 + p 1 s + p0 (4.43)

Or, in other words, we want to have


   
0 −a0 − l1 0 −p0
= (4.44)
1 −a1 − l2 1 −p1
from which we can now compute the observer gains
) (
−a0 − l1 = −p0 l 1 = p0 − a 0
⇒ (4.45)
−a1 − l2 = −p1 l 2 = p1 − a 1

The above reasoning can be generalized to the tuning of any system repre-
sented by an observability canonical form of dimension n.

Algorithm/summary: Observer tuning for a system represented by


an observability canonical form
• using the n poles of the desired estimation error dynamics, compute the
desired characteristic polynomial

p(s) = sn + pn−1 sn−1 + . . . + p2 s2 + p1 s + p0 ,

85

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.5. OBSERVER TUNING FOR THE GENERAL CASE

• set the observer gains to:




 l 1 = p0 − a 0

 l 2 = p1 − a 1

.. (4.46)


 .

ln = pn−1 − an−1

4.5 Observer tuning for the general case


For the general case, we will proceed, once again, in a very similar way to what
we have done for linear state-feedback. Indeed, starting with the general linear
state-space representation
(
ẋ = Ax + Bu
(4.47)
y = Cx

we want to find an invertible change of coordinates z = T x that will transform


(4.47) into an observability canonical form.

If this transform exists, then, similarly to finding a change of coordinates for


controllable systems, we have the relations

−1
Ã = T AT

B̃ = T B (4.48)
 −1
C̃ = CT

where Ã, B̃, and C̃ are the matrices of an observability canonical form. Equiv-
alently, by using the inverse of the change of coordinates defined as V := T −1 ,
we get 
−1
Ã = V AV ⇒ V Ã = AV

B̃ = V −1 B (4.49)

C̃ = CV

In order to find V (or T ), let us first decompose V into n column vectors Vi , ie


we have  
V = V1 , V2 , · · · , Vn (4.50)
Then, rewrite the first equality of (4.49) V Ã = AV by taking into account the
special structure of the matrices à and V :
 
0 0 0 ··· 0 −a0
1 0 0 · · · 0 −a 1

  
V1 , V2 , · · · , Vn 0 1 0 · · · 0 −a2
 
 = AV1 , AV2 , · · · , AVn (4.51)
 
 .. .. .. . . . ..
. ..

. . . . 
0 0 0 ··· 1 −an−1

86

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.5. OBSERVER TUNING FOR THE GENERAL CASE

which gives
   
V2 , V3 , · · · , Vn , −a0 V1 − a1 V2 − · · · − an−1 Vn = AV1 , AV2 , · · · , AVn (4.52)
This last equality means that, if we take term by term, V2 = AV1 , V3 = AV2 , ...
until the last column vector is obtained with Vn = AVn−1 . Hence, because of
these recursive terms, the whole matrix V can be obtained as soon as we have
the first column vector V1 .

To find V1 , we will use the last equality in (4.49), C̃ = CV . Using the


decomposition of V into column vectors, we can write
C̃ = CV1 , CV2 , ..., CVn = CV1 , CAV1 , ..., CAn−1 V1
   
(4.53)

Transposing then (4.53) and using the special form of C̃, we get
   
0 CV1
 ..   CAV1 
C̃ T =  .  =  .. (4.54)
   

 0  . 
n−1
1 CA V1
which can finally be re-written as
C̃ T = Wo V1 (4.55)
where Wo is the observability matrix of the original state-space representation.

Hence if the original state-space representation is observable, then Wo is


invertible, which implies that the transform V (or T ) exists and that V1 is given
by
V1 = Wo1 C̃ T (4.56)
All the other column vectors of V are then obtained as we have seen above in
equality (4.53).

Once we get V then it is easy to get à and B̃ (and of course T ), and then
compute L̃, the feedback gain of the observer in the z-coordinates, using the pole
placement method.

To get the observer feedback gain L in the x-space, transform the observer
based on the OCF given by
(
ẑ˙ = Ãẑ + B̃u + L̃(y − ŷ)
(4.57)
ŷ = C̃ ẑ

into the observer expressed in the x coordinates T (or equivalently V )


(
T x̂˙ = ÃT x̂ + B̃u + L̃(y − ŷ)
(4.58)
ŷ = C̃T x̂

which gives (
x̂˙ = T −1 ÃT x̂ + T −1 B̃u + T −1 L̃(y − ŷ)
(4.59)
ŷ = C̃T x̂

87

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.5. OBSERVER TUNING FOR THE GENERAL CASE

to finally have the observer expressed in the x coordinates


(
x̂˙ = Ax̂ + Bu + V L̃(y − ŷ)
(4.60)
ŷ = C x̂

Hence the feedback gain of the observer expressed in the x coordinates is given
by L = V L̃.

Example: a second-order system


Consider the following system described by the state-space representation
" # " #" # " #
 ẋ1 = 1 1 x1 1

+ u

ẋ2 0 −1 x2 0 (4.61)
 h i
y = 1 0 x

We start with computing the observability matrix, which gives


 
1 0
Wo = ⇒ det(Wo ) = 1 (4.62)
1 1

Hence the system is observable. From there, we compute the first column vector
V1 :     
−1 T 1 0 0 0
V1 = Wo C̃ = = (4.63)
−1 1 1 1
and V2 :     
1 1 0 1
V2 = AV1 = = (4.64)
0 −1 1 −1
so that we have    
0 1 1 1
V = and T = (4.65)
1 −1 1 0
Using this change of coordinates, we then have the matrices corresponding to
an observability canonical form
     
1 1 1 1 0 1 0 1
à = T AV = = , (4.66)
1 0 0 −1 1 −1 1 0
    
1 1 1 1
B̃ = T B = = (4.67)
1 0 0 1
and  
 0 1  
C̃ = CV = 1 0 = 0 1 (4.68)
1 −1
Note, interestingly, that because of matrices à and B̃, the system
   
0 1 1
ż = z+ u (4.69)
1 0 1

88

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.5. OBSERVER TUNING FOR THE GENERAL CASE

is not controllable (feel free to check that yourself). Then, using the pole place-
ment technique of section 4.4 with the desired poles of the estimation error
dynamics set to (−1, −1), we get the observer gain
 
2
L̃ = (4.70)
2

which, translated into the x-coordinates, gives


 
2
L = V L̃ = (4.71)
0

89

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.6. OUTPUT FEEDBACK USING AN OBSERVER

4.6 Output feedback using an observer


4.6.1 Basic idea
In many situations, the state is not measured entirely. In the case when only
the output y(t) is given, one can use the observer estimate x̂(t) in lieu of the
state x(t) and use our good old linear state-feedback technique.
Indeed, we replace the control law

u(t) = Kx(t) (4.72)

with
u(t) = K x̂(t) (4.73)
In doing so, note that we are hence combining both a state-feedback controller
and an observer to end up with a controller referred to as output feedback con-
troller, since it only uses the output for feedback as seen in the block diagram
of figure 4.6.

Figure 4.6: Output feedback controller combining linear state feedback con-
troller and observer

4.6.2 Application to tracking control


Once we are able to stabilize a system by output feedback, tracking control using
only the output for measurement, where we want the system to follow a desired
trajectory xd (t), is not very far. Indeed, recall that for a tracking controller, we
had
∆u(t) = K∆x(t) (4.74)

90

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.7. A SUPER TINY INTRODUCTION TO KALMAN FILTERING

where ∆u(t) and ∆x(t) were given by


(
∆u(t) := u(t) − ud (t)
(4.75)
∆x(t) := x(t) − xd (t)

which gave us
u(t) = K (x(t) − xd (t)) + ud (t) (4.76)
Now, as seen previously, replace x(t) with its estimate x̂(t) so that we have

u(t) = K(x̂(t) − xd (t)) + ud (t) (4.77)

Note as can be seen in the block diagram below (see figure 4.7), this last con-
troller consists of 3 main subparts: a feedforward controller, an observer and a
linear state-feedback controller.

Figure 4.7: Block diagram of a tracking controller using only the output as
measurement

4.7 A super tiny introduction to Kalman filter-


ing
Since its inception in the 1960s, the so-called Kalman filter has seen many
applications, from economics to inertial navigation systems.
In the way is was initially presented, the description of the Kalman filter usually
needs a stochastic framework. While this would take us much further than
intended in this course, and sometimes needs an entire course in and of itself
to see the many interesting theoretical and practical ideas linked with Kalman
filtering, it is also possible to quickly put together/hack a Kalman filter (KF)
by taking a deterministic view and consider a KF as an observer.
But before doing that, let us take a small detour and revisit observer tuning.

4.7.1 Observer tuning and the ‘place’ Matlab function


In one of our computer sessions, we have seen that we could use the so-called
place Matlab command in order to tune the linear state-feedback gain K. Using
the matrices A and B, we would type

K = −place(A, B, P ) (4.78)

91

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.7. A SUPER TINY INTRODUCTION TO KALMAN FILTERING

where P was a vector containing the desired poles of the system in closed-loop.
This function computes the values of K such that

P = eig(A + BK) (4.79)

ie it solves an algebraic equation.


As it turns out, we can use the same reasoning to tune the feedback gain L. To
see this, recall that, in the observer design context, the pole placement method
means that we want to set the values of L such that, the estimation error
dynamics
x̃˙ = (A − LC)x̃ (4.80)
will have its eigenvalues equal to the desired poles, ie we want

Pobs = eig(A − LC) (4.81)

with Pobs the vector containing the desired poles of the estimation error dynam-
ics. Hence we also have to solve an algebraic equation. To do that using the
place function from Matlab, we first transpose A − LC to get

(A − LC)T = AT − C T LT (4.82)

Hence, since transposition does not change eigenvalues, we can rewrite (4.81) as

Pobs = eig(AT − C T LT ) (4.83)

Comparing (4.83) with (4.79), we see now that the unknown LT is at the same
spot in the equation that needs to be solved as K is in (4.79). Hence, using the
place function, we can write
T
L = place(AT , C T , P ) (4.84)

4.7.2 The Kalman Filter as an observer


As we have seen, designing an observer basically consists in 3 main things:

• make a copy of the plant model,


• add a correction term based on the measurement L(y − ŷ),
• tune the gain vector L such that the estimation error has the desired
dynamics.

There are different ways to tune L, and we saw a few of them (deduction
from physics and basic knowledge of control, pole placement/eigenvalue assig-
ment and even the place Matlab command).

In 1961, Kalman published 2 seminal papers presenting what can be seen as


(although there is of course a lot more to it) a method to tune the gain L for
linear time-varying systems of the form
(
ẋ(t) = A(t)x(t) + B(t) + u(t), x(0) = x0
(4.85)
y(t) = C(t)x(t)

92

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.7. A SUPER TINY INTRODUCTION TO KALMAN FILTERING

for which the observer structure is also a copy of the plant with corrections from
the measurements:
(
˙
x̂(t) = A(t)x̂(t) + B(t)u(t) + L(t) (y(t) − ŷ(t))
(4.86)
ŷ(t) = C(t)x̂(t)

Once the copy of the plant is combined with the feedback term L(t) (y(t) − ŷ(t)),
the remaining question is obviously how to tune the gain vector L(t).
To do so, Kalman used a combination of two equations. The first one (or the
second one, depending on the order in which these equations are presented)
gives the observer gain vector and reads
L(t) = P (t)C T (t)R−1 (t) (4.87)
where, in the deterministic case, R(t) is a positive definite matrix of design
parameters (possible time-varying). The n × n matrix P (t) is then obtained as
a solution of a matrix differential equation expressed as
Ṗ (t) = A(t)P (t) + P (t)AT (t) − P (t)C T (t)R−1 (t)C(t)P (t) + Q(t) (4.88)
where P (t) has the initial condition P (0) = P T (0) > 0, and where Q(t) is an-
other positive definite matrix of design parameters. Expression (4.88) is called
the Riccati equation and is quite famous in control systems. Together with the
gain expression (4.87), they result in a choice of L(t) that will, among other
things, make sure that the observer estimate x̂(t) converges to the actual state
x(t).
Equations (4.86), (4.87) and (4.88) are known as the Kalman filter.

One of the fundamental results related to the Kalman filter is that its esti-
mate x̂(t) is the best estimate one can obtain under the assumption of Gaussian
noise affecting both the state equation and the output equation. The Kalman
filter is said to be an optimal estimator.

4.7.3 The Extended Kalman Filter (EKF)


After its inception, the Kalman was extended in many directions, and ver-
sions/adaptations to different contexts can be found in the literature. One of
them, referred to as the Extended Kalman Filter (EKF) applies to nonlinear
systems described by the dynamics
ẋ(t) = f (x(t), u(t)) (4.89)
together with the output equation
y(t) = h(x(t)) (4.90)
For systems put under form (4.89)-(4.90), the observer part of the EKF is given
by
˙
x̂(t) = f (x̂(t), u(t)) + L(t) (y(t) − h(x̂(t))) (4.91)
where feedback term L(t) is again calculated from expressions (4.87) and (4.88)
but where matrices A(t) and C(t) are given by the Jacobian matrices
∂f
A(t) = (x(t), u(t)) (4.92)
∂x x(t)=x̂(t)

93

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)


lOMoARcPSD|35905196

4.7. A SUPER TINY INTRODUCTION TO KALMAN FILTERING

and
∂h
C(t) = (x(t)) (4.93)
∂x x(t)=x̂(t)

The Extended Kalman Filter found its way in many applications where the sys-
tem is nonlinear, from induction machines to underwater navigation. However,
despite its usefulness, it is also known to be not always easy to tune, and does
not have a global optimal property, compared to its linear ancestor.

94

Downloaded by Daniel Borregaard (dfghjiolk1@gmail.com)

You might also like