Intro To State Space 2
Intro To State Space 2
Lecture Notes
An Introduction to
State Space Methods
© Eric Kerrigan and Shafeen Tejani
Imperial College London
Preface
This set of notes is based on the first half of the Control Systems module taught at the Department
of Aeronautics, Imperial College London. It is aimed to help students understand the material
through carefully worked examples, specifically tailored towards the learning outcomes of the
course.
KJ Åström and RM Murray. Feedback Systems: An Introduction for Scientists and Engineers.
Second Edition. Princeton University Press, 2020.
These notes are intended as supplementary material to the above book and not intended as a
replacement. The textbook above should always be consulted as the primary source.
Within each chapter of the notes there is a brief recap of the theory covered in the textbook,
followed by a theory-based section, a MATLAB based-section, and a Simulink-based section. The use
of MATLAB and Simulink will help to develop a much deeper understanding of the course. MATLAB
and Simulink are used extensively in industry and research and will also be useful in your research
and design projects while at university.
Note that MATLAB and Simulink figures and user interfaces might be slightly different from those
shown here, depending on which version is used. However, the general functionality should still be
the same.
There will inevitably be some mathematical and typing mistakes in these notes. We will appreciate it
very much if any errors could be brought to our attention.
Learning Outcomes
The student should be able to:
- Give examples of open-loop and closed-loop systems and give reasons why they are open-
loop or closed-loop.
- Give examples of dynamical systems where feedback plays an important role. The student
should also be able to identify the sensing mechanism, actuation mechanism and give a
qualitative description of the control law for these feedback systems.
- Give reasons why feedback is useful in dynamical systems.
A dynamical system is a system whose behaviour evolves with time. These systems can be described
by ordinary differential equations. If two or more systems are connected together they are said to
be closed-loop if they are connected in such a way that each system influences the other. If this
connection is removed the systems are said to be open-loop.
Closed-Loop Open-Loop
In the first diagram above, the output of System A is the input of System B and the output of System
B is the input of System A. Both systems affect each other and thus they are closed-loop. In the
second diagram above, System A affects System B but System B does not affect System A and thus
they are open-loop.
Control is the application of an input to a system in order to change its behaviour. There are two
main forms of control, open-loop and closed-loop. Assuming the initial conditions of the system are
known, an open-loop controller is design by calculating the input required to achieve the correct
response. A closed-loop controller is where the input depends on the current output of the system.
This mechanism is known as feedback. The three main aspects of feedback control are sensing,
where the output of the system is measured, controlling, where an input is calculated based on the
given output, and actuation, where this calculated input is applied to the system:
Feedback Control
Worked Example 1.1
In this Worked Example we will consider a static system, i.e. one that does not evolve with time.
Consider a heated plate whose temperature 𝑇 is determined by the ambient temperature 𝑇 , the
power supplied to the heater 𝑃, and any thermal disturbances 𝐷. In steady-state, the temperature is
given by:
𝑇 𝑇 +𝛼 𝑃+𝐷
For this system, the sensing mechanism is a thermometer which measures the temperature of the
plate and the actuating mechanism is the heater. The control mechanism is the way in which the
required power 𝑃 is calculated.
𝑇 −𝑇
𝑃 −𝐷
𝛼
therefore 𝑃 10 𝑊.
This system is said to be open-loop as there is no connection between the output and the input as
shown below:
Open-Loop System
Assuming that we have measured the initial conditions of the system with perfect accuracy, an input
of 𝑃 10 𝑊 will raise the temperature of the plate to exactly 𝑇 30 𝐶. However, no measuring
device is perfect and there will almost certainly be some error in measurements of the initial
conditions. Let the error in the temperature be 𝑒 𝑇 − 𝑇 . Applying the open-loop power
𝑃 10 𝑊, we can see how small errors in the measurements of 𝑇 , 𝛼 and 𝐷 affect the error in
the temperature of the plate:
𝑻𝒂𝒎𝒃 𝜶 𝑫 𝒆
10 2 0 0
10.5 2 0 0.5
10 2.5 0 5
10 2 0.5 1
We can now try using a closed-loop controller on the system. This is where there is feedback
between the output and input of the system. Consider the following closed-loop controller where
the input 𝑃 is proportional to the output 𝑇:
𝑇 − 10
𝑃 +𝑘 𝑇−𝑇
2
𝑘 is called the proportional feedback gain. For 𝑘 0 we can see that if 𝑇 𝑇 the proportional
term will increase 𝑃 and if 𝑇 𝑇 the proportional term will decrease 𝑃. If 𝑘 0 it will have the
opposite effect and cause the error to increase, this is known as positive feedback.
Closed-Loop System
For a feedback gain of 𝑘 −2, adding small errors to the measurements of 𝑇 , 𝛼 and 𝐷 produce
the following errors in the temperature of the plate:
𝑻𝒂𝒎𝒃 𝜶 𝑫 𝒆
10 2 0 0
10.5 2 0 0.1
10 2.5 0 1
10 2 0.5 0.2
It can be seen that using proportional feedback the error in final temperature is significantly less.
This shows the importance of using feedback when dealing with uncertainty in systems.
Representing dynamical systems: Matlab
Matlab is a programming environment that is tailored towards the analysis of dynamical systems.
State-space dynamical systems can be created, simulated and adapted using Matlab. Below is a
worked example which gives an insight into the many capabilities of Matlab. Throughout the course
you will be using Matlab to analyse dynamical systems.
In this Worked Example we will look at a dynamical system i.e. one that evolves with time. Consider
a system described by the differential equation:
𝑑𝑥
𝑎𝑥 + 𝑏𝑢 𝑦 𝑐𝑥 + 𝑑𝑢
𝑑𝑡
𝑥 is the state of the system at time 𝑡, 𝑢 is the input force applied to the system and 𝑦 is the output of
the system. Let 𝑎 𝑏 𝑐 1, and 𝑑 0
𝑑𝑥
𝑥+𝑢 𝑦 𝑥
𝑑𝑡
For zero input force the solution to the differential equation is given by:
𝑥 𝑡 𝑒 𝑥
where 𝑥 is the initial condition of the system. For non-zero initial conditions the system therefore
grows exponentially with time and can be described as unstable. Suppose we wish to control the
system such that the solution is given by:
𝑥 𝑡 𝑒 𝑥
In this case, for non-zero initial conditions, the system will return to zero as time increases and can
therefore be described as stable. Firstly, we can compute an open-loop controller. This is done by
substituting the desired solution back into the differential equation and solving for the input 𝑢:
𝑑𝑥
𝑥 +𝑢
𝑑𝑡
−𝑒 𝑥 𝑒 𝑥 +𝑢
𝑢 −2𝑒 𝑥
This is a form of open-loop control as the applied input depends only on the value of the initial
condition and thus there is no feedback from the output to the input of the system. The following
commands show how to use Matlab to construct this system as a state-space system and simulate
the effect of the open-loop controller:
Input the a, b, c and d values
>> a = 1;
>> b = 1;
>> c = 1;
>> d = 0;
Define the desired time interval T for simulation, in this case T ranges from 0s to 6s in
intervals of 0.001s
>> T = [0:0.001:6];
Simulate the dynamical system with zero input force and initial condition 𝑥 using the
intial(sys,x0,T) command
>> initial(sys,x0,T)
It can be seen that the uncontrolled system is unstable and increases exponentially with time.
Simulate the dynamical system with the open-loop input using the lsim(sys,U,T,x0)
command
>> lsim(sys,U_ol,T,x0)
It can be seen that the open-loop input 𝑢 −2𝑒 𝑥 stabilises the system and causes it to return to
zero. Let us assume that there is a 10% error associated with the measurement of the initial
condition 𝑥 . The open-loop input is still calculated using the measured initial condition 𝑥 1,
however the system behaves according to the actual initial condition 𝑥 1.1. This can be simulated
in Matlab as follows:
Simulate the dynamical system with the open-loop input and an initial condition error
>> lsim(sys,U_ol,T,(1.1*x0))
This simulation produces the following plot:
It can be seen that a slight error in the measurement of the initial condition 𝑥 causes the controlled
system to become unstable again. This shows that open-loop control is very susceptible to
uncertainty in systems.
We can now look at designing a proportional feedback controller. This is where the input is
proportional to the output of the system:
𝑢 𝑘𝑥
this gives,
𝑑𝑥
1+𝑘 𝑥 𝑦 𝑥
𝑑𝑡
𝑥 𝑡 𝑒 𝑥
𝑢 −2𝑥
𝑎 1+𝑘 𝑏 0 𝑐 1 𝑑 0
The feedback controller can be simulated in Matlab using the following commands:
Input the closed-loop a, b, c and d values and construct a closed-loop state-space system
>> a_cl = -1;
>> b_cl = 0;
>> c_cl = 1;
>> d_cl = 0;
>> sys_cl = ss(a_cl,b_cl,c_cl,d_cl);
It can be seen that, for accurately measured initial conditions, the feedback controller also stabilises
the system and causes the output to return to zero. In the same way as with the open-loop
controller the system can be simulated with a 10% error in the measurement of the initial condition:
It can be seen that despite an error in the measurement of the initial condition the feedback
between the output and input ensures that the closed-loop system is still stabilised. This shows that
using feedback control is much more powerful in dealing with uncertainty than using an open-loop
strategy.
Chapter 2 – State Space Systems
Learning Outcomes
State-Space Form
We will consider systems of ordinary differential equations (ODEs) that can be written in the
following state-space form:
𝑥 𝑡 𝑓 𝑥 𝑡 ,𝑢 𝑡
𝑦 𝑡 𝑔 𝑥 𝑡 ,𝑢 𝑡
where 𝑥 𝑡 is the state vector and is of dimension n, 𝑢 𝑡 is the vector of input variables and is of
dimension m, and 𝑦 𝑡 is the output vector of measured signals and is of dimension p. In particular,
we will be considering linear time-invariant (LTI) systems that can be represented in the following
form:
𝑥 𝑡 𝐴𝑥 𝑡 + 𝐵𝑢 𝑡
𝑦 𝑡 𝐶𝑥 𝑡 + 𝐷𝑢 𝑡
1. Identify all variables in the equations that are differentiated with respect to time and note
the highest order derivative for each variable. For each differentiated variable, include in the
state vector the variable itself and all higher order derivatives, except for the highest order
derivative. E.g. suppose the highest order derivative for variable v is dvq/dtq, then the state
vector should include v, dv/dt, dv2/dt2, ..., dvq-1/dtq-1 but not dvq/dtq.
2. Do not include variables that do not have time derivates in the state vector. These are
constant parameters.
3. The inputs and outputs of the system should have been specified to you or be obvious from
the physics.
Worked Example 2.1
Mass-Spring-Damper System
The input to this system is the force 𝑓 𝑡 applied to the mass. The output of this system is the
displacement 𝑦 𝑡 of the mass from its initial starting position.
The ordinary differential equation representing the equation of motion for this system is:
𝑚𝑦 𝑡 + 𝑐𝑦 𝑡 + 𝑘𝑦 𝑡 𝑓 𝑡
A good choice for the state vector is the mass displacement 𝑦 𝑡 , and mass velocity 𝑦 𝑡 .
𝑦 𝑡 𝑥 𝑡 𝑥 𝑡
𝑥 𝑡
𝑦 𝑡 𝑥 𝑡 𝑥 𝑡
𝑚𝑥 𝑡 + 𝑐𝑥 𝑡 + 𝑘𝑥 𝑡 𝑓 𝑡
We can then write the original second order differential equation as a system of two first order
differential equations using the state variables
𝑥 𝑡 𝑥 𝑡
𝑥 𝑡 − 𝑥 𝑡 − 𝑥 𝑡 + 𝑓 𝑡
We can now put these equations in matrix form to arrive at the state-space description for the mass-
spring-damper system.
𝑥 𝑡
𝑦 𝑡 1 0 + 0𝑓 𝑡
𝑥 𝑡
Worked Example 2.2
Consider the mass-spring-damper system used in Worked Example 2.1. The dynamical system can be
represented in state-space form as:
𝑥 𝑡 0 1 𝑥 𝑡 0
−𝑘 −𝑐⁄ + 1 𝑓 𝑡
𝑥 𝑡 𝑚 𝑚 𝑥 𝑡 𝑚
𝑥 𝑡
𝑦 𝑡 1 0 + 0𝑓 𝑡
𝑥 𝑡
For convenience, let 𝑚 𝑘 𝑐 1. We can construct this state-space system in the Matlab
environment using the following commands:
So far we have constructed a state-space system and saved it under the variable name sys.
Matlab can be used to analyse the behaviour of the dynamical system to various inputs and control
laws. For example, to analyse the response of the system to a step input, we can use the following
command:
We can also analyse the response of the system to a user defined input. For example, if
𝑓 𝑡 𝑒 sin 𝑡
We can simulate the response to this input using the function lsim(sys,U,T,x0).
Define the desired time interval T, in this case T ranges from 0-20 seconds in intervals of 0.1
seconds
>> T = [0:0.1:20];
Define the value of each input at each time interval, in this case we have only one input f(t)
>> U = [(exp(-T).* i (T)) ];
NB : The input matrix U must have a number of columns equal to the number of inputs, and a number of
rows equal to the number of time increments, where the values of the ith row are the values of the
inputs at the ith time interval. Notice the transpose sign is used in the above expression to make U of
the correct form.
Define the initial condition of each of the states, in this example we have two states
>> x0 = [0;0];
input
response
Finally we can also simulate the unforced response of the system with a given initial condition. For
example, with an initial displacement of 𝑥 𝑦 1 and an initial velocity of 𝑥 𝑦 0, the
response of the system can be plotted with the following commands:
The following worked example will show you how to model a simple system using Simulink.
Consider the mass-spring-damper system in Worked Example 2.2. This system can be modelled in
Simulink in two different ways. Firstly, we can model the state-space representation of the system
and secondly, we can model the actual dynamic equations of motion. We will see how to simulate
the response of the system to a step input using both methods.
To create a block diagram you can simply drag the desired block from the Library Browser to your
model. To begin with, we need to select an input signal.
Drag the Step signal block from the Sources block-set to the new model
Drag the State-Space block from the Continuous block-set to the new model
Next we can plot the output of our system using a Scope block.
Drag the Scope block from the Sinks block-set to the new model
Finally, connect the out-port of the Step block to the in-port of the State-Space block and the
out-port of the State-Space block to the in-port of the Scope block by holding the left mouse
button over one port and dragging an arrow to the other. The final model should look like this:
Now that the model has been created we need to change the parameters of the system. Double click
on the State-Space block to open the parameters window. Enter the values for the 𝐴, 𝐵, 𝐶 and
𝐷 matrices with the same syntax used for the Matlab command line.
Next, double click the Step block to open the parameters window. Enter the following parameters
Lastly, we need to set the simulation time. In the model window, select Simulation >
Configuration Parameters. Set the time interval to range between 0 and 20 seconds in the
Solver tab of the Configuration Parameters window.
Finally select Simulation > Run. Double click the Scope block. The response of the system
should look like the figure below.
Instead of modelling the system using a State-Space block, we can model the equations of
motion of the dynamic system.
𝑓 𝑡 𝑐 𝑘
𝑦 𝑡 𝑦 𝑡 𝑦 𝑡
𝑚 𝑚 𝑚
where 𝑓 𝑡 is the step input to the system and 𝑦 𝑡 is the measured response of the system.
We start by considering the signal which is the highest order time derivative, 𝑦 𝑡 , and converting
this to the output signal, 𝑦 𝑡 , using Integrator blocks which can be found in the Continuous
block-set. Construct the following block-diagram in a new model:
Now that we have a signal for each of the states of the system we can start to model the equation of
motion. Using a Sum block and a Gain block from the Math Operations block-set we can
model the stiffness and damping terms of the equation. The value of the Gain block is equal to the
(magnitude) of the coefficient in front of the respective terms in the equation.
The number and sign of the in-ports to the Sum block can be changed by double-clicking the block
and opening the block parameters window.
Finally we need to model the step input of the system. This can be done using a Step block and a
Gain block to produce the final model shown below.
Note that the signal entering the sum block is equal to 𝑦 𝑡 𝑦 𝑡 , and the signal
leaving the Sum block is 𝑦 𝑡 , therefore we have modelled the equation of motion correctly. Set the
time interval to range between 0 and 20 seconds and simulate the system. The output is shown
below:
Step response of Mass-Spring-Damper System
Notice that this is identical to the output given from modelling the system using a State-Space
block.
Chapter 3 – Equilibrium Points and Stability
Learning Outcomes
- Analytically solve and simulate initial value problems for basic dynamical systems.
- Give the definition of stability of the solution of a dynamical system.
- Compute the equilibrium points of a system.
- Use a phase portrait to identify any equilibrium points or limit cycles.
- Use a phase portrait to classify whether an equilibrium point or limit cycle is stable or
unstable and, if it is stable, whether or not it is asymptotically stable or not.
𝑦 𝑐 𝑦 +𝑐 𝑦
where 𝑦 and 𝑦 are themselves linearly independent solutions to the differential equation and can
thus be added to form the homogenous solution.
The constants of integration, 𝑐 and 𝑐 , are determined from initial conditions. For a given initial
condition there are specific values for 𝑐 and 𝑐 which determine the response of the system to that
initial state. To refresh your memory on how to solve differential equations you may refer to Stroud,
K.A. (2003, p.355) Advanced Engineering Mathematics.
Equilibrium Points
The equilibrium points of a system are the points where the rate of change of the states of the
system is zero. Thus, if a system is at an equilibrium point, the state of the system will not change
with time and the system will remain at the equilibrium point.
Mathematically, if a system is described by the differential equation:
𝑑𝑥
𝐹 𝑥
𝑑𝑡
Then the equilibrium points of the system is the set of points 𝑥 , for which 𝐹 𝑥 0.
Worked Example 3.1
Mass-Spring-Damper System
𝑐 𝑘
𝑦 𝑡 + 𝑦 𝑡 + 𝑦 𝑡 0
𝑚 𝑚
𝑦 𝐴𝑒
Substituting this into the differential equation leads to the auxiliary equation
𝑟 + 𝑟+ 0
𝑟 − ±
√
√ √
𝑦 𝐴 𝑒 𝑒 𝐴 𝑒 cos 𝑡 + 𝐢𝑠𝑖𝑛 𝑡
√
√ √
𝑦 𝐴 𝑒 𝑒 𝐴 𝑒 cos 𝑡 − 𝐢𝑠𝑖𝑛 𝑡
√ √
𝑦 𝑒 𝐵 cos 𝑡 + 𝐵 sin 𝑡
where 𝐵 𝐴 + 𝐴 , and 𝐵 𝐴 − 𝐴 , are the constants of integration.
The velocity of the mass can be expressed as the time derivative of the displacement, giving
√ √ √ √
𝑦 𝑒 − 𝐵 + 𝐵 cos 𝑡 + − 𝐵 − 𝐵 sin 𝑡
𝑦 1 𝑦 0
The expressions for 𝑦 and 𝑦, at time 𝑡 0, reduce to the following simultaneous equations
1 𝐵
√
0 − 𝐵 + 𝐵
giving 𝐵 1 and 𝐵 . Thus the response for the given initial condition is
√
√ √
𝑦 𝑒 cos 𝑡 + sin 𝑡
√
The response is oscillatory and damped. After approximately 10 seconds the mass returns to 𝑦 0
and remains there.
Worked Example 3.2
Inverted Pendulum
𝐽 𝐽 + 𝑚𝑙 where 𝐽, 𝑚 and 𝑙 are the moment of inertia, mass and length of the pendulum
respectively. 𝛾 is the rotational coefficient of friction and 𝑢 is the input force applied to the bottom
of the pendulum.
In order to find the equilibrium points of this system we first need to put the equation of motion in
state-space form. As this is a nonlinear equation its state-space form is:
𝑥 𝑓 𝑥, 𝑢
𝑦 ℎ 𝑥, 𝑢
𝜃 𝑥
Defining the state vector as 𝑥 𝑥 and letting 𝐽 𝑚𝑔 𝑙 1 for simplicity, the state-
𝜃
space form of the equation of motion is:
𝑥 𝑥
𝑥 sin 𝑥 − 𝛾𝑥 + 𝑢 cos 𝑥
The equilibrium points of the system are defined as the points where the rate of change of the state
variables is equal to zero. Thus we are required to find the values of the state variables 𝑥 and 𝑥
which make the left-hand-side of the above equation equal to zero. We therefore arrive at the
following simultaneous equations:
0 𝑥 , 0 sin 𝑥 − 𝛾𝑥 + 𝑢 cos 𝑥
which has the solution 𝑥 − tan 𝑢 , 𝑥 0. Thus for zero input force, the equilibrium points of
the system are 𝑥 𝜃 𝑛𝜋, corresponding to the up and down positions of the pendulum.
W Worked Example 3.3
pplane allows you to input the state-space form of the set of differential equations for the planar
dynamical system which you wish to analyse. Recalling that the state-space form of the equations
governing the motion of the inverted pendulum is:
"̇ ""
! ! $ = &sin " − +" + - cos " 1
"̇ " ! " !
Enter the differential equations into pplane, setting the values + = 1 and - = 0, and the axis range
from −4 to 4 as below:
Click Graph Phase Plane to plot the phase portrait. The phase plot produced contains vector
arrows whose direction and magnitude correspond to the rate of change of the states of the system
at a given point in phase space. Select Option > Solution Direction > Forward. By
clicking a point on the graph pplane will use the values of the states at that point as initial conditions
to solve the differential equations. A curve corresponding to the trajectory of the system from the
given initial conditions will be plotted on the phase portrait.
The following plot shows the phase portrait for the inverted pendulum with some trajectories
plotted.
From the phase portrait it we can clearly see the two equilibrium points of the system are at "# =
0 5
& 1, corresponding to the up position and at "# = & 1, corresponding to the down position. Note
0 0
5 −5
that the equilibrium point at "# = & 1 is equivalent to the equilibrium point at "# = & 1 as they
0 0
both correspond to the down position of the pendulum.
5
By selecting initial conditions close to the equilibrium point at "# = & 1 we can observe that
0
trajectories starting close to the equilibrium point converge towards it, therefore the down position
of the inverted pendulum is a stable equilibrium point.
0
Conversely, by selecting initial conditions close to the equilibrium point at "# = & 1 we can observe
0
that trajectories starting close to the equilibrium point diverge away from it, therefore the up
position of the inverted pendulum is an unstable equilibrium point.
When using pplane, there may be a situation where a point in phase space looks like it may be an
equilibrium point of the system. To check whether this is true select Solution > Find an
Equilibrium Point and click close to the desired point on the graph. The prompt at the
bottom of the phase portrait will confirm whether or not there is an equilibrium point in that region.
Worked Example 3.4
This worked example will construct a Simulink model of the Lorenz attractor. The equations of
motion of this system are:
𝑥 𝜎 𝑦 𝑥
𝑦 𝜌𝑥 𝑥𝑧 𝑦
𝑧 𝑥𝑦 𝛽𝑧
Start by considering the signals with the highest order derivatives, 𝑥, 𝑦, and 𝑧, and converting them
to the output signals, 𝑥, 𝑦 and 𝑧 i g I eg a bl ck
To model the first equation, use a Sum block to construct the signal 𝑦 𝑥 and a Gain block to
multiply this by 𝜎. The final signal is equal to the 𝑥 signal.
To model the second equation, use a Gain block to construct the signal 𝜌𝑥 and a Product block
to construct the signal 𝑥𝑧 . Finally, use a Sum block to sum the signals 𝜌𝑥 , 𝑥𝑧 , and – 𝑦 , and
set this equal to the 𝑦 signal.
To model the last equation, use a Gain block to construct the signal 𝛽𝑧 and a Product block to
construct the signal 𝑥𝑦 . Finally use a Sum block to sum the signals 𝑥𝑦 and – 𝛽𝑧 , and set this
equal to the 𝑧 signal.
Instead of using a Scope block to view the output we can save the output values to structured
variables in the Matlab workspace. This is done by connecting the output signals to a To
Workspace block in the Sinks library. Double-clicking the block will open the Block
Parameters window where the variable name can be set. Ensure that the Save Format >
Structure with time option is selected.
The structured variables created contain both the time and signal values. These can be accessed
i g he d ea F e am le if he a iable ame i x:
Simulating the system for 60 seconds, with parameter values 𝜎 10, 𝛽 and 𝜌 28, and the
initial conditions 𝑥 8, 𝑦 8, 𝑧 27, gives the response of the x-coordinate shown below.
NB: to set the initial conditions for a signal, double-click on the Integrator block producing the
signal and set the Initial Condition entry to the correct value.
Perturbing the initial condition slightly to 𝑥 8.1, 𝑦 8, 𝑧 27, gives the following response:
We can see that a very small change in the initial condition has produced a large change in the
response, this is an example of chaos in a dynamical system.
Chapter 4 – Stabilization of Linear Systems
Learning Outcomes
- Compute the characteristic polynomial of the dynamics matrix of a linear system.
- Determine whether a linear system is asymptotically stable or unstable.
- Transform a linear system with distinct eigenvalues into diagonal/modal form.
- Use the Routh-Hurwitz criterion to determine whether or not a 2nd or 3rd order linear system
is asymptotically stable.
- Compute the characteristic polynomial of the closed-loop dynamics matrix for a system in
closed-loop with a static/proportional output feedback controller.
- Use the Routh-Hurwitz criterion to compute a static/proportional output feedback law that
ensures the closed-loop system is asymptotically stable.
Open-Loop Dynamics
For a linear state-space system of the form:
𝑥 𝐴𝑥 + 𝐵𝑢
𝑦 𝐶𝑥 + 𝐷𝑢
The dynamics are determined by the A matrix. The characteristic polynomial of the dynamics matrix
is given by:
𝑝 𝑠 det 𝑠𝐼 − 𝐴
where 𝐼 is the identity matrix. The eigenvalues of the dynamics matrix are the roots of the
characteristic polynomial, i.e.:
𝜆 𝐴 𝑠 ∈ ℂ ∶ det 𝑠𝐼 − 𝐴 0
Stability
The stability of a linear system can be determined by the real part of the eigenvalues of the
dynamics matrix. More formally,
The system is asymptotically stable if and only if all eigenvalues of A have a strictly negative real
part and is unstable if any eigenvalue of A has a strictly positive real part
The stability of a linear system can also be determined by using the Routh-Hurwitz stability criterion.
The Routh-Hurwitz stability criterion for 2nd and 3rd order systems are:
𝜎 𝜔 0 0 0
⎡−𝜔 𝜎 ⋱ 0 0 ⎤
⎢ ⎥
𝑇𝐴𝑇 ⎢ 0 ⋱ ⋱ ⋱ 0 ⎥ for eigenvalues 𝜆 𝜎 ±𝜔
⎢ 0 0 ⋱ 𝜎 𝜔 ⎥
⎣ 0 0 0 −𝜔 𝜎 ⎦
Worked Example 4.1
Inverted Pendulum
Assuming small displacements about the inverted position 𝜃 0, the equations of motions can be
linearised to produce the following set of state-space equations:
𝑥 0 1 𝑥 0
+ 𝑢
𝑥 1 −𝛾 𝑥 1
𝑥 𝑥 𝜃
𝑦 1 0 𝑥 where 𝑥 𝜃
These equations have been normalised for simplicity by letting 𝐽 𝑚𝑔 𝑙 1. Note that the
coefficient of friction 𝛾 0 for a physically real system.
s 0 0 1 𝑠 −1
𝑝 𝑠 det 𝑠𝐼 − 𝐴 det − det
0 s 1 −𝛾 −1 𝑠+𝛾
𝑝 𝑠 𝑠 + 𝛾𝑠 − 1
Applying the Routh-Hurwitz condition we can see that the constant term is negative. Therefore, this
system (which has been linearized about the inverted position) is unstable. This is an intuitive result.
We can confirm this by looking at the eigenvalues of the dynamics matrix:
1 1
𝜆 − 𝛾+ 𝛾 +4
2 2
1 1
𝜆 − 𝛾− 𝛾 +4
2 2
The eigenvalue 𝜆 is a positive real number for any choice of 𝛾 thereby confirming that the system is
unstable. In order to stabilise this system about the equilibrium point we can implement a
proportional output controller of the form:
𝑢 𝑘𝑦
𝑥 0 1 0 𝑥 0 1 𝑥
+ 𝑘1 0 𝑥
𝑥 1 −𝛾 1 1+𝑘 −𝛾 𝑥
𝑠 −1
𝑝 𝑠 det
−1 − 𝑘 𝑠+𝛾
𝑝 𝑠 𝑠 + 𝛾𝑠 + −1 − 𝑘
For stability, we require (−1 − 𝑘 0 , therefore the system can be stabilised by choosing a
feedback gain 𝑘 −1.
Below is a comparison of the open-loop and closed-loop phase portraits of the system. It can be
0
seen that the proportional feedback controller stabilises the equilibrium point 𝑥
0
Phase Portrait for Open-Loop linearized Inverted Pendulum Phase Portrait for Closed-Loop linearized Inverted Pendulum with
feedback gain 𝒌 −𝟒
The controller we have designed is based on a linearized model of the inverted pendulum which
assumes small displacements about the inverted position 𝜃 0. If we apply the same controller to
0
full nonlinear system we obtain the phase plot below. It shows that the equilibrium point 𝑥 is
0
only asymptotically stable in a small region around the equilibrium point. Trajectories outside of this
region converge to the equilibrium points corresponding to the pendulum down position. This shows
the limitations of using a linearized model to design a controller for a nonlinear system.
𝑥 𝑥 + 3𝑥 + 𝑢
𝑥 3𝑥 − 6𝑥
𝑥 1 3 𝑥 1
+ 𝑢
𝑥 3 −6 𝑥 0
𝑥
𝑦 1 0 𝑥
To determine whether or not the open-loop system is asymptotically stable we must first compute
the characteristic polynomial of the dynamics matrix. This can be done by entering the following into
the Matlab command line:
Calculate the characteristic polynomial. This function will produce a vector of the polynomial
coefficients corresponding to the 𝑥 , 𝑥 and constant terms respectively
>> p = poly(A)
p = 1.0 5.0 -15.0
The coefficient of the constant term is negative, therefore, according to the Routh-Hurwitz stability
criterion, the dynamical system is not asymptotically stable. To calculate the open-loop eigenvalues
we can use the Matlab function eig():
One of the eigenvalues of the open-loop system has a positive real value, showing that the system is
unstable.
We can transform the dynamics matrix to its modal form using the following Matlab commands:
The response of the open-loop system to a small disturbance can be characterized by the impulse
response of the system. An impulse is a very brief input signal, which can be mathematically
modelled as a Dirac delta function for continuous time systems. The impulse response can be
plotted using the following command:
The open-loop impulse response is given below. It can be seen that the impulse causes the unstable
0
system to diverge away from the equilibrium point 𝑥 .
0
We now aim to design a proportional feedback controller of the form 𝑢 𝑘𝑦, which will stabilise the
closed-loop dynamics of the system. To do this we can use the Symbolic Maths Toolbox in Matlab
which allows the user to work with algebraic variables instead of numerical values:
Declare the algebraic feedback gain variable k
>> syms k
5−𝑘 0 ⇒ 𝑘 5 and − 15 + 6𝑘 0 ⇒ 𝑘 −
Therefore the proportional controller will stabilise the system for feedback gain values 𝑘 − .
The closed-loop impulse response, using a feedback gain value of 𝑘 −5 is shown below. The
system is now asymptotically stable and it returns to the equilibrium point following a disturbance.
Consider a simplified model of an aircraft that can only move in the longitudinal degrees of freedom.
The input to this dynamical is system is the elevator deflection which controls the pitch of the
aircraft. The measured output is the pitch angle.
𝜃 is the pitch angle of the aircraft, 𝑞 is the pitch rate, and 𝛼 i he ai c af a gle f a ack The
elevator deflection angle is 𝛿 .
The linearised equations of motion of the system are:
𝜃 57𝑞
𝑥 0.3 57 0 𝑥 0.232
𝑥 𝐴 𝐵𝑢 0.01 0.5 0 𝑥 0.0203 𝛿
𝑥 0 57 0 𝑥 0
𝑥
𝑦 𝐶 𝐷𝑢 0 0 1 𝑥 0𝛿
𝑥
This system can be modelled on Simulink in a few different ways. We can model the equations of
motion of the system or use a State-Space block. These methods have been described in worked
example 2.3 and worked example 3.4.
An additional way of modelling the system is to create a model of the state-space equations, as
shown in the block diagram below. The Gain blocks 𝐴, 𝐵, 𝐶, and D have matrix values equivalent to
the corresponding values of the matrices in the state-space equations. This is achieved by entering
the matrices into the Block Parameters window and changing the Multiplication
parameter to Matrix.
Aircraft Pitch State-Space Model
You will notice that the In1 port represents the input to the system and the Out1 port represents
the output of the system. The model has been created in this way so that it can be imported into a
new model as a Subsystem to give a clearer looking and more flexible diagram. To import this
system into a new model we must do the following:
Save the current model as a *.mdl file by selecting File > Save from the model window
Open a new model by selecting File > New > Model from the Library window.
Drag a Subsystem block from the Ports and Subsystems blockset to the new model
Highlight and copy the saved model by selecting Edit > Copy
Paste the saved model into the Subsystem block window by selecting Edit > Copy
Save the new Subsystem block by selecting File > Save from the Subsystem block
window
In order to use proportional feedback control to make the system asymptotically stable we must
first multiply the output signal by the feedback gain 𝑘 and then add this to the input of the system.
The closed-loop block diagram is shown below:
It can be shown that the feedback gain required to make the system asymptotically stable must be in
the range 𝑘 0. The response of the system to different feedback gains is shown below:
Closed-Loop Response, .
Closed-Loop Response,
Chapter 5 – Linear Systems and Jacobian Linearization
Learning Outcomes
- Compute the initial condition response of a linear system using the matrix exponential.
- Use the principle of superposition to compute the response of a linear system from the
initial condition and forced response of the system.
- Use the Jordan form of a linear system to determine whether the system is neutrally stable,
asymptotically stable or unstable.
- Compute the Jacobian linearization of a nonlinear system at an equilibrium point.
- Determine whether an equilibrium point for a nonlinear system is asymptotically stable or
unstable by looking at the linearization at the equilibrium point.
- Compute a proportional output feedback law that ensures the equilibrium of a nonlinear
closed-loop system is asymptotically stable.
Matrix Exponential
𝑒 𝐼+𝑋+ 𝑋 + 𝑋 +⋯ ∑ 𝑋
! !
Principle of Superposition
The principle of superposition roughly states
The e e f a li ea e , with zero initial state, to the sum of two inputs 𝑢 and 𝑢 is the
sum of the outputs 𝑦 and 𝑦 c e di g he i di id al i
𝑦 𝑡 𝑎𝑦 𝑡 + 𝑏𝑦 𝑡
The response of a forced system with a given initial condition (general solution 𝑦 ) is equal to the
superposition of the unforced response with the given initial condition (homogenous solution 𝑦 )
and the forced response with zero initial condition (particular solution 𝑦 ).
𝑦 𝑡 , 𝑦 𝑡 , +𝑦 𝑡 ,
Jordan Form
It has already been shown that matrices with distinct (non-repeating) eigenvalues can be
transformed into modal matrices. In this form the matrix exponential is easily computed.
𝜆 . 0 𝑒 . 0
𝐴 . ⋱ . 𝑒 . ⋱ .
0 . 𝜆 0 . 𝑒
Some matrices have repeating eigenvalues and cannot be transformed to diagonal form, however
they can be transformed to Jordan form 𝐽.
A a i 𝐴∈ℝ can be transformed into Jordan form with the
eigenvalues of 𝐴 determining 𝜆 i he J da f
𝐽 0 … 0 𝜆 1 0 0
0 𝐽 0 ⋮ 0 𝜆 ⋱ 0
𝐽 where 𝐽
⋮ 0 ⋱ 0 0 ⋱ ⋱ 1
0 … 0 𝐽 0 0 0 𝜆
Each 𝐽 is called a Jordan block. Note that if a particular Jordan block is not scalar then there will be
s appearing in the super-diagonal of that block.
⎡1 𝑡 !
…
!⎤
𝑒 0 … 0 ⎢ ⎥
0 𝑒 0 ⋮ ⎢0 1 𝑡 … ⎥
𝑒 where 𝑒 ⎢ ! 𝑒
⎥
⋮ 0 ⋱ 0
⎢⋮ . 1 ⋱ ⋮ ⎥
0 … 0 𝑒 ⎢. . . ⋱ 𝑡 ⎥
⎣0 … . 0 1 ⎦
In the previous chapter the stability of a system was defined in terms of the real parts of the
eigenvalues of the dynamics matrix. However, nothing was said about the stability of a system which
had eigenvalues with zero real part. For these systems the stability can be analysed by considering
the Jordan form of the dynamics matrix.
If he e 𝑥 𝐴𝑥 has no eigenvalues with strictly positive real part and one or more eigenvalues
with zero real part then it is stable if and only if the Jordan blocks corresponding to each eigenvalue
with zero real part are scalar 1𝑥1 bl ck
Jacobian Linearization
Jacobian linearization allows us to create a linear model of a nonlinear system about an equilibrium
point, assuming that the states stay close to the equilibrium point.
𝑓 𝑥, 𝑢 𝑥 ∈ℝ ,𝑢 ∈ℝ
𝑦 ℎ 𝑥, 𝑢 𝑦∈ℝ with equilibrium point 𝑥 , 𝑢 .
To study the behaviour close to the equilibrium point 𝑥 , 𝑢 assume 𝑥 − 𝑥 and 𝑢 − 𝑢 are both
small, thus we can ignore higher order terms, and define the new deviation states
𝑧 𝑥−𝑥 𝑣 𝑢−𝑢 𝑤 𝑦 − ℎ 𝑥 ,𝑢
The Jacobian linearization of the system is then given by
𝐴𝑧 + 𝐵𝑣 𝑤 𝐶𝑧 + 𝐷𝑣
where
𝐴 𝐵 𝐶 𝐷
, , , ,
Worked Example 5.1
𝑥 0 6 −4 𝑥 2
𝑥 𝐴𝑥 + 𝐵𝑢 ⇒ 𝑥 0 0 −1 𝑥 + 0 𝑢
𝑥 0 0 0 𝑥 0
𝑥
𝑦 𝐶𝑥 + 𝐷𝑢 ⇒ 𝑦 1 0 0 𝑥
𝑥
1
with the initial condition 𝑥 2
1
According to the principle of superposition, the response of the system can be obtained from the
superposition of the initial condition response and the forced response. This Chapter focuses on
computing the initial condition response, therefore assume that the forced response, for 𝑢 𝑡 𝑡,
is given as:
𝑦 𝑡 𝒙𝟎 𝑡
The initial condition response is calculated by setting 𝑢 0, which gives a solution of the form:
𝒙𝒉 𝑡 𝑒 𝒙𝟎 ⇒ 𝑦 𝑡 𝑥 𝑡
The first step is to calculate the matrix exponential 𝑒 by using the infinite series
1 1 1
𝑒 𝐼 + 𝐴𝑡 + 𝐴 𝑡 + 𝐴 𝑡 + ⋯ 𝐴 𝑡
2 3! 𝑘!
Note that
0 6 −4 0 0 −6 0 0 0
𝐴 0 0 −1 𝐴 0 0 0 𝐴 0 0 0
0 0 0 0 0 0 0 0 0
Therefore only the first three terms in the series need to be evaluated. This gives the matrix
exponential as:
1 6𝑡 − 3𝑡 + 4𝑡
𝑒 0 1 −𝑡
0 0 1
1 6𝑡 − 3𝑡 + 4𝑡 1
𝑥 𝑡 0 1 −𝑡 2 ⇒ 𝑦 𝑡 −3𝑡 + 8𝑡 + 1
0 0 1 1
The general solution is then given by the superposition of the homogeneous and particular solutions
resulting in:
𝑦 𝑡 −2𝑡 + 8𝑡 + 1
System Response
Worked Example 5.2
Consider the following dynamical system. The ball can roll along the beam whose angle can be
changed with an applied torque. The ball has position 𝑝 𝑡 from the centre of rotation and the beam
rotates through an angle 𝜃 𝑡 due to an applied torque 𝜏 𝑡 . 𝐽 is the mass moment of inertia of the
beam and 𝑚, 𝑟, and 𝐽 are the mass, radius and mass moment of inertia of the ball, respectively.
𝐽
+ 𝑚 𝑝 𝑡 + 𝑚𝑔 sin 𝜃 𝑡 − 𝑚𝑝 𝑡 𝜃 𝑡 0
𝑟
𝑥 𝑝
𝑥 𝑝
Choosing the state vector 𝑥 , the state space form of the system is
𝜃
𝑥 𝜃
𝑥 𝑥
𝑥 𝑥 𝑥 − 𝑔 sin 𝑥
𝑥 𝑥
−6𝑥 𝑥 𝑥 − 3𝑔𝑥 cos 𝑥 + 𝑢
𝑥
3𝑥 + 8
𝑦 𝑥
𝑝
0
The equilibrium point of this system is 𝑥 0 , 𝑢 3𝑔𝑝 where 𝑥 𝑝 corresponds to any
0
constant ball position along the beam. In order to linearize this system about the equilibrium point
we must switch to the new variables:
𝑥 −𝑝
𝑥
𝑧 𝑥−𝑥 𝑥 𝑣 𝑢−𝑢 𝜏 − 3𝑔𝑝 𝑤 𝑦 − ℎ 𝑥 ,𝑢 𝑥 −𝑝
𝑥
𝐴𝑧 + 𝐵𝑣 𝑤 𝐶𝑧 + 𝐷𝑣
where
𝐴
,
|
0 1 0 0
⎡ ⎤
⎢ 𝑥 0 − 𝑔 cos 𝑥 𝑥 𝑥 ⎥
⎢ 0 0 0 1 ⎥
⎢ ⎥
⎣ ⎦ ,
0 1 0 0
⎡ ⎤
⎢ 0 0 − 𝑔 0⎥
⎢ 0 0 0 1⎥
⎢ ⎥
⎣ 0 0 0⎦
0 0
⎡ 0 ⎤ ⎡ 0 ⎤
𝐵 ⎢ 0 ⎥ ⎢ 0 ⎥
, ⎢ ⎥ ⎢ ⎥
⎣ ⎦ ,
⎣ ⎦
𝐶 1 0 0 0 𝐷 0
, ,
3
8 + 3𝑝 𝑔
p s det 𝑠𝐼 − 𝐴 𝑠 − 2
3𝑝 + 8 3𝑝 + 8
which, according to the Routh-Hurwitz criterion, shows that the equilibrium point is not
asymptotically stable.
Worked Example 5.3
The equation below describes a modified version of the Van der Pol oscillator, where the measured
output is 𝑥 and the input to the system is 𝑢.
𝑥 𝜇 𝑥 1 𝑥 𝑥 𝑢
𝑦 𝑥
𝑥 0.1
The initial condition response, with 𝑢 0 and 𝑥 is:
0.1
Open-loop Response
The trajectory diverges away from the equilibrium point at the origin and converges to a periodic
solution known as a limit cycle. The Jacobian linearization of the system about the equilibrium point
0
𝑥 𝑢 0, using the method described in Worked Example 5.2 is:
0
𝑥 0 1 𝑥 0
𝑢
𝑥 1 1 𝑥 1
𝑥
𝑦 0 1 𝑥
The eigenvalues of the linearized dynamics matrix are:
𝜆 0.5 0.866𝑖
𝜆 0.5 0.866𝑖
This shows that, assuming small perturbations, the equilibrium point at the origin is unstable. To
stabilise this system we can use a proportional output feedback controller of the form 𝑢 𝑘𝑦.
The closed-loop dynamics matrix then becomes:
0 1
𝐴 𝐵𝑘𝐶
1 1 𝑘
The closed-loop characteristic polynomial is given by:
det 𝑠𝐼 𝐴 𝐵𝑘𝐶 𝑠 1 𝑘 𝑠 1
Therefore, according to the Routh-Hurwitz criterion, in order to stabilise the equilibrium point the
feedback gain must be in the range 𝑘 1. The closed-loop Simulink model, for 𝑘 2, is shown
below:
Closed-Loop System
The response for the same initial conditions now shows that the equilibrium point is stabilised. The
significance of this is that linear control can be applied to stabilise the equilibrium points of
nonlinear systems, assuming small perturbations.
Close-Loop Response
Chapter 6 – Input-Output Response of Linear Systems
Learning Outcomes
- Compute the impulse and step response of a system by using the convolution equation.
- Compute the steady-state value, rise time, overshoot and settling time of the step response
of a linear system.
- Transform a state-space system from one coordinate system to another equivalent system.
- Compute a proportional output feedback law that changes the closed loop response of a
system to external inputs.
𝑥 𝐴𝑥 + 𝐵𝑢 𝑦 𝐶𝑥 + 𝐷𝑢
𝑥 𝑡 𝑒 𝑥 + 𝑒 𝐵𝑢 𝜏 𝑑𝜏
𝑦 𝑡 𝐶𝑒 𝑥 + 𝐶𝑒 𝐵𝑢 𝜏 𝑑𝜏 + 𝐷𝑢 𝑡
Impulse Response
If the system is initially at the origin and we apply an impulse described by the delta function:
0, 𝑡 0
𝛿 𝑡 lim 1
→ 𝜖, 0 𝑡 𝜖
0, 𝑡 𝜖
ℎ 𝑡 𝐶𝑒 𝐵𝛿 𝜏 𝑑𝜏 𝐶𝑒 𝐵
Step Response
If the system is initially at the origin and we apply the step function:
0, 𝑡 0
𝑆 𝑡
1, 𝑡 0
then the step response is given by:
𝑦 𝑡 𝐶𝐴 𝑒 𝐵 + 𝐷 − 𝐶𝐴 𝐵 ∀𝑡 0
Note that if all the eigenvalues of the 𝐴 matrix have a negative real part, the initial transient
response of the system will decay with time and the system will converge to a steady-state
response.
- The steady-state value of the response, 𝑦 , is the final value the response converges to.
- The rise time, 𝑇 , is the time taken for the response to go from 10% of its steady-state value
to 90% of its steady-state value.
- The overshoot, 𝑀 , is the percentage of the steady-state value by which the response
initially rises above the steady-state value.
- The settling time, 𝑇 , is the time required for the signal to remain bounded within 2% of its
steady-state value for all future time.
Step Response1
Coordinate Transformation
The transformation 𝑧 𝑇𝑥 will convert the state-space system:
𝑥 𝐴𝑥 + 𝐵𝑢 𝑦 𝐶𝑥 + 𝐷𝑢
into
𝑧 𝐴𝑧 + 𝐵 𝑢 𝑦 𝐶 𝑧 + 𝐷𝑢
where,
𝐴 𝑇𝐴𝑇 𝐵 𝑇𝐵 𝐶 𝐶𝑇
Second-Order Systems
The characteristic polynomial of a second-order system is of the form:
𝑝 𝑠 𝑠 + 2𝜁𝜔 𝑠 + 𝜔
where 𝜔 is the natural frequency of the system and 𝜁 is the system s damping ratio
1
Astrom, K.J. & Murray M.M. (2008, p.151) Feedback Systems
Worked Example 6.1
𝑥 −2 4 𝑥 0
+ 𝑢
𝑥 −4 −2 𝑥 1
𝑥
𝑦 1 0 𝑥 + 0𝑢
𝑦 𝑡 𝐶𝐴 𝑒 𝐵 + 𝐷 − 𝐶𝐴 𝐵
𝑎 𝑏
Note : For a matrix of the form 𝐴 , the matrix exponential is given by:
−𝑏 𝑎
𝑒 cos 𝑏𝑡 𝑒 sin 𝑏𝑡
𝑒
𝑒 sin −𝑏𝑡 𝑒 cos 𝑏𝑡
Notice that As 𝑡 → ∞ the time-varying part of the step response will decay and the response will
converge to its steady-state value of 𝑦 0.2.
To calculate the overshoot of the step-response we first need to find the maximum value the
response initially rises to. This is done by setting the differential of the step response to zero, solving
for 𝑡, and then finding the value of the step response at 𝑡.
𝑑𝑦
𝑒 sin 4𝑡 0
𝑑𝑡
The time of the peak response is the smallest positive solution of the above equation:
1 𝜋
𝑡 sin 0
4 4
Note that some systems will exhibit a step response with no overshoot. In these cases the above
equation will not have a solution.
𝑦 0.2416
The overshoot, which is the percentage of the final value by which the response initially rises above
the final value, can then be calculated by:
𝑦 −𝑦
𝑀 × 100
𝑦
𝑀 20.8%
Step Response
Worked Example 6.2
The step response of this system can be produced using the following Matlab commands:
Step Response
Note that this is identical to the plot calculated analytically in Worked Example 6.1.
The step response characteristics can also be stored under a variable name by using the stepinfo()
function:
Matlab can also be used to plot the impulse response of a system, using the impulse() function, as
described in Worked Example 4.2.
Impulse Response
Chapter 7 – State Feedback Control of Second Order Systems
Learning Outcomes
- Compute the damping ratio, damped frequency and natural frequency of a second-order
system
- Compute whether the step response of a second order system is underdamped, critically
damped or overdamped.
- Derive conditions on a system on which one can guarantee that state feedback can
arbitrarily place the eigenvalues of the closed-loop dynamics matrix.
- Give examples of systems where proportional output feedback does not allow one to
arbitrarily place the eigenvalues of the closed-loop dynamics matrix, but state feedback
allows one to do so.
Second-Order Systems
A second-order system can be described by a differential equation of the form
𝑞 + 2𝜁𝜔 𝑞 + 𝜔 𝑞 𝑘𝜔 𝑢, 𝑦 𝑞
where 𝜔 is the natural frequency of the system and 𝜁 is the system s damping ratio
𝑞
In state-space form, for the state vector 𝑞 , this is
𝑑𝑥 0 1 0
𝑥+ 𝑢, 𝑦 1 0𝑥
𝑑𝑡 −𝜔 −2𝜁𝜔 𝑘𝜔
𝑝 𝑠 𝑠 + 2𝜁𝜔 𝑠 + 𝜔
with eigenvalues:
𝜆 −𝜁𝜔 ± 𝜔
The form of the eigenvalues, and hence the response of the system depend on the damping ratio 𝜁.
If 0 𝜁 1 then the eigenvalues have an imaginary part and the solution is therefore oscillatory.
The step response is said to be underdamped and is given by:
𝜁
𝑦 𝑡 𝑘 1−𝑒 cos 𝜔 𝑡 + 𝑒 sin 𝜔 𝑡 , 0 𝜁 1
1−𝜁
If 𝜁 1 the eigenvalues become real and the solution is no longer oscillatory. The step response is
said to be critically damped and is given by:
𝑦 𝑡 𝑘 1−𝑒 1+𝜔 𝑡 , 𝜁 1
Finally, if 𝜁 1, the real eigenvalues become larger in magnitude. The step response is said to be
overdamped and is given by:
1 𝜁 1 𝜁
𝑦 𝑡 𝑘 1− +1 𝑒 + −1 𝑒 , 𝜁 1
2 𝜁 −1 2 𝜁 −1
The properties of the step response for an underdamped second-order system can be calculated
using the formulae in the figure below:
2
Astrom, K.J. & Murray M.M. (2008, p.185) Feedback Systems
Worked Example 7.1
The diagram below shows a rotational mechanical system. There is an applied torque 𝑡 to the
motor shaft which has an angular displacement 𝜃 𝑡 . The motor shaft has a polar inertia 𝐼, the
stiffness of the torsional spring is 𝑘 , and there is a rotational viscous damper with damping
coefficient 𝑏.
Rotational System
The ordinary differential equation describing the dynamics of this system is:
𝐼𝜃 𝑡 𝑏𝜃 𝑡 𝑘 𝜃 𝑡 𝑡
𝑥 0 1 𝑥 0 𝑥
𝑢 𝑦 1 0 𝑥
𝑥 1 1 𝑥 1
𝑥 𝜃
for the state vector 𝑥 .
𝜃
𝑝 𝑠 𝑠 𝑠 1
𝜁 0.5 1
4
𝑇 8
𝜁
𝑀 𝑒 16%
Suppose we wanted to design a state feedback controller of the form 𝑢 𝐾𝑥 to make the closed-
loop system have a settling time of 𝑇 4 and an overshoot of 𝑀 4%. It can be shown that the
desired damping ratio and natural frequency of the closed-loop system would then be:
1
𝜁 √2
√2
By implementing the state feedback controller we can form the closed-loop dynamics matrix:
0 1 0 𝑘 0 1
𝐴 𝐵𝐾 𝑘
1 1 1 1 𝑘 1 𝑘
𝑝 𝑠 det 𝑠𝐼 𝐴 𝐵𝐾 𝑠 1 𝑘 𝑠 1 𝑘
By comparing this with the general form of the characteristic polynomial of a second order system
we arrive at a set of linear equations:
1 𝑘 2𝜁 2
1 𝑘 2
𝐾 1 1
Note that this state feedback controller has allowed us to arbitrarily assign values of the damping
coefficient 𝜁 and the natural frequency . As the eigenvalues of this system are functions of only 𝜁
and this implies that we can arbitrarily place them as well.
Worked Example 7.2
𝑥 0 1 𝑥 0 𝑥
+ 𝑢 𝑦 1 0 𝑥 𝜁, 𝜔 0
𝑥 −4 −2 𝑥 1
The eigenvalues, damping ratio and natural frequency of the system can be found using the
following Matlab commands:
Suppose we required the closed-loop system to have a damping ratio of 𝜁 0.75 and to have a
natural frequency of 𝜔 4. We can use the place(A,B,P) function in Matlab to calculate the
required state feedback controller gain 𝐾. The place(A,B,P) function returns the state feedback
gain vector 𝐾 which places the eigenvalues of the closed-loop system at the locations specified in
the vector 𝑃. State feedback can only be used to arbitrarily place the eigenvalues if the system is
reachable. The topic of reachability will be covered in Chapter 8. For now, assume that all the
systems in this section are reachable.
NB: The convention used in Matlab is to implement a state-feedback controller of the form 𝑢 −𝐾𝑥.
Therefore the closed-loop dynamics matrix will be 𝐴 − 𝐵𝐾 . When using the place(A,B,P) function,
you must therefore multiply the 𝐾 vector by -1 for it to be consistent with the sign conventions used
in the Control Systems course.
𝜆 −𝜁𝜔 + 𝜔 𝜁 −1 −3 + 𝐢√7
𝜆 −𝜁𝜔 − 𝜔 𝜁 −1 −3 − 𝐢√7
Matlab can then be used to calculate the feedback gain vector:
-12.0000 -4.0000
The step response of the open-loop and closed-loop systems can be seen below:
Simulink can be used to simulate effect of state feedback control on a dynamical system. Consider
the rotational mechanical system used in Worked Example 7.1.
𝑥 0 1 𝑥 0 𝑥
+ 𝑢 𝑦 1 0 𝑥
𝑥 −1 −1 𝑥 1
𝜁 0.5 𝜔 1
The block diagram below shows a Simulink model of the open-loop system. This has been created by
modelling the state-space equations. The Gain blocks 𝐴, 𝐵, 𝐶, and D have matrix values equivalent
to the corresponding values of the matrices in the state-space equations. This is achieved by
entering the matrices into the Block Parameters window and changing the Multiplication
parameter to Matrix.
Applying a step input to the open-loop system gives the following response:
Open-Loop Step Response
1
𝜁 𝜔 √2
√2
we require the state feedback gain vector 𝐾 −1 −1 . This can be implemented in the Simulink
model by multiplying the state signal by 𝐾 and adding this to the input of the system.
Applying a step input to the closed-loop system gives the following response:
Closed-Loop Step Response
We can see that the closed-loop system converges to a steady-state response quicker and with much
less overshoot. Also, the open-loop system converges to a steady-state of 𝑦 1, whereas the
closed-loop system converges to a steady-state of 𝑦 0.5.
Chapter 8 – Reachability and State Feedback
Learning Outcomes
- Give the definition of reachability of a linear system.
- Form the reachability matrix of a linear system and determine whether the system is
reachable.
- Give examples of reachable and unreachable systems.
- Transform a linear system into reachable form.
- Compute the characteristic polynomial of the closed-loop dynamics matrix if the controller is
a state feedback law.
- Compute a state feedback law that stabilises a reachable system or places the eigenvalues of
the closed-loop dynamics where required.
- Design a state feedback law that ensures there is no steady-state error between the output
and a constant reference signal.
- Design a state feedback law that ensures a system has a specified closed-loop response
when there is a step in reference signal, where the response is defined in terms of one or
more of the damping ratio, damped frequency, natural frequency, settling time, overshoot,
rise time and steady-state value.
Reachability
For the linear dynamical system:
𝑥 𝐴𝑥 + 𝐵𝑢
The reachable set ℛ 𝑥 , 𝑇 is defined as the set of all points 𝑥 such that there exists an input
𝑢 𝑡 , 0 𝑡 𝑇 that moves the system from 𝑥 0 𝑥 to 𝑥 𝑇 𝑥 . In other words, it is the set of
points which can be achieved within time 𝑡 𝑇 by applying an input to the system with an initial
condition 𝑥 .
A linear system is termed reachable if the system can be moved from any initial state 𝑥 to any final
state 𝑥 i hi fi i e i e
𝑟𝑒𝑎𝑐ℎ𝑎𝑏𝑙𝑒 ⇔ ∀ 𝑥 , 𝑥 ∈ ℝ ∃ 𝑇 0 , 𝑢: 0, 𝑇 ∶ 𝑥 0 𝑥 ,𝑥 𝑇 𝑥
𝑊 𝐵 𝐴𝐵 𝐴 𝐵 ⋯ 𝐴 𝐵
For the system to be reachable we require the reachability matrix to be full rank, i.e. it must have 𝑛
linear independent columns. If 𝑊 is a square matrix it is full rank if and only if 𝑑𝑒𝑡 𝑊 0.
Reachable Canonical Form
A reachable linear state-space system can be put into the following reachable canonical form:
−𝑎 −𝑎 −𝑎 ⋯ −𝑎 1
⎡ 1 0 0 ⋯ 0 ⎤ ⎡0⎤
𝑑𝑥 ⎢ 0 ⎥ ⎢ ⎥
⎢ 1 0 ⋯ 0 ⎥ 𝑥 + ⎢0⎥ 𝑢
𝑑𝑡 ⎢⋮⎥
⎢ ⋮ . ⋱ ⋱ ⋮ ⎥
⎣ 0 . . 1 0 ⎦ ⎣0⎦
𝑦 𝑏 𝑏 𝑏 ⋯ 𝑏 𝑥 + 𝑑𝑢
𝑝 𝑠 𝑠 +𝑎 𝑠 + ⋯+ 𝑎 𝑠+𝑎
𝑥 𝐴 + 𝐵𝐾 𝑥 𝑦 𝐶𝑥
where 𝐴 + 𝐵𝐾 is the closed-loop dynamics matrix and thus determines the behaviour of the
closed-loop system.
A linear system in reachable canonical form has the closed-loop form:
−𝑎 +𝑘 −𝑎 + 𝑘 −𝑎 + 𝑘 ⋯ −𝑎 + 𝑘
⎡ 1 0 0 ⋯ 0 ⎤
𝑑𝑥 ⎢ ⎥
𝑑𝑡 ⎢ 0 1 0 ⋯ 0 ⎥𝑥
⎢ ⋮ . ⋱ ⋱ ⋮ ⎥
⎣ 0 . . 1 0 ⎦
𝑝 𝑠 𝑠 + 𝑎 −𝑘 𝑠 + ⋯+ 𝑎 −𝑘 𝑠+𝑎 −𝑘
𝑝 𝑠 𝑠 +𝑝 𝑠 + ⋯+ 𝑝 𝑠+𝑝
𝐾 𝑎 −𝑝 𝑎 −𝑝 ⋯ 𝑎 −𝑝
𝑢 𝐾𝑥 + 𝑘 𝑟
can be used to design a closed-loop system for which the output tracks a constant reference signal 𝑟.
𝑥 𝐴 + 𝐵𝐾 𝑥 + 𝐵𝑘 𝑟 𝑦 𝐶𝑥
It can be seen that the closed-loop dynamics matrix remains the same and so the dynamics of the
system do not depend on 𝑘 and 𝑟.
The closed-loop response of a system with a constant reference signal is the step response of that
system multiplied by the value of the reference signal:
𝑦 𝑡 𝐶 𝐴 + 𝐵𝐾 𝑒 𝐵𝑘 𝑟 – 𝐶 𝐴 + 𝐵𝐾 𝐵𝑘 𝑟
If the system is stable, the response will converge to a steady-state value. In order for the steady-
state value to be equal to the constant reference signal we require:
−1
𝑘
𝐶 𝐴 + 𝐵𝐾 𝐵
−ℜ 𝜆
𝜁
|𝜆|
Therefore the eigenvalues whose real parts have large magnitudes will also have large damping
ratios.
𝐽 0 … 0
𝑑𝑧 0 𝐽 0 ⋮
𝑧 + 𝐵𝑢
𝑑𝑡 ⋮ 0 ⋱ 0
0 … 0 𝐽
The response of the system will be a linear combination of responses from the individual Jordan
subsystems. As a result, the part of the response due to the Jordan blocks consisting of eigenvalues
with large damping ratios will decay faster. After an initial transient the response will then be
dominated by the eigenvalues with low damping ratios.
This allows us to use state feedback to convert a higher order system into an approximate second-
order system, by assigning all but two of the eigenvalues a very large damping ratio.
Worked Example 8.1
Consider the DC Servomotor model below. The input to the system is the applied voltage 𝑣 𝑡 and
the output is the rotation of the motor shaft 𝜃 𝑡 .
DC Servomotor
𝐿 and 𝑅 are the circuit inductance and resistance respectively. 𝐽 is the polar inertia of the motor
shaft, 𝑘 is the electromotive force constant, 𝑏 is the rotational viscous damping coefficient and 𝑖 𝑡
is the armature current.
The equations of motion for this system are given by:
𝐽𝜃 𝑏𝜃 𝑘 𝑖
𝑑𝑖
𝐿 𝑅𝑖 𝑣 𝑘 𝜃
𝑑𝑡
Let 𝐽 𝑅 5, 𝐿 1, 𝑘 𝑏 10. The state-space form of the equations of motion for this system
is:
𝑑 𝜃 0 1 0 𝜃 0
𝜃 0 2 2 𝜃 0 𝑢
𝑑𝑡
𝑖 0 10 5 𝑖 1
𝜃
𝑦 1 0 0 𝜃
𝑖
𝑊 𝐵 𝐴𝐵 𝐴 𝐵
0 2
𝐴𝐵 2 𝐴 𝐵 14
5 5
therefore
0 0 2
𝑊 0 2 14
1 5 5
det 𝑊 4
This system is therefore reachable and so there always exists an input to move the system from a
given initial condition to a desired final state within finite time.
Suppose we required the response of the system to track a constant reference signal 𝑟, with a
steady-state value 𝑦 𝑡 𝑟, an overshoot 𝑀 0.1, and a settling time 𝑇 𝑠.
Using a state feedback controller of the form 𝑢 𝐾𝑥 𝑘 𝑟, we can give one eigenvalue a very large
damping ratio, and the remaining two dominant eigenvalues the second order characteristics
required to shape the desired response.
ln 0.1
𝜁 0.5912
π ln 0.1
4 2
→ 10
𝜁 3
𝜆 20 𝜆 6 8𝐢 𝜆 6 8𝐢
By implementing a state feedback controller we can form the closed-loop dynamics matrix:
0 1 0 0
𝐴 𝐵𝐾 0 2 2 0 𝑘 𝑘 𝑘
0 10 5 1
0 1 0
0 2 2
𝑘 10 𝑘 𝑘
Comparing this with the desired characteristic polynomial we can form 3 simultaneous equations:
2𝑘 2000
30 2𝑘 2𝑘 340
7 𝑘 32
This gives the state feedback gain vector:
𝐾 1000 130 25
1
𝑘
𝐶 𝐴 𝐵𝐾 𝐵
therefore,
1
𝑘 1000
0.17 0.015 0.001 0
1 0 0 1 0 0 0
1 0.5 0 1
𝜃
𝑢 1000 130 25 𝜃 1000𝑟
𝑖
Worked Example 8.2
Consider the ball and beam system introduced in Worked Example 5.2.
0
Let 𝐽 𝐽 𝑚 4, 𝑟 1 and 𝑔 10. For the equilibrium position 𝑥 0 the linearised state-
0
0
space form of the equations of motion is:
𝑥 0 1 0 0 𝑥 0
𝑥 0 0 −5 0 𝑥 0
+ 0 𝑢
𝑥 0 0 0 1 𝑥
1
𝑥 −5 0 0 0 𝑥 8
𝑥
𝑥
𝑦 1 0 0 0 𝑥
𝑥
The eigenvalues of the dynamics matrix can be computed using the eig() function in Matlab:
The open-loop system is therefore unstable as there is an eigenvalue with a positive real part.
Before designing a state feedback controller for the system we can check if the system is reachable.
The reachability matrix of a state-space system is given by the Matlab command ctrb(sys):
Compute the reachability matrix of the system and compute its determinant
>> Wr = ctrb(sys)
Wr =
0 0 0 -0.6250
0 0 -0.6250 0
0 0.1250 0 0
0.1250 0 0 0
>> det(Wr)
ans = 0.0061
The determinant of the reachability matrix is non-zero and therefore the system is reachable.
Suppose we would like the system to have a stable closed-loop response, with a damping ratio of
𝜁 0.8 and a natural frequency of 𝜔 5. We can set two eigenvalues to large negative numbers
so that the system can be approximated as a second-order system:
𝜆 −20 𝜆 −30
NB: The two eigenvalues have been chosen to have different values because the place(A,B,P) function in
Matlab requires that the multiplicity of the eigenvalues cannot be greater than the number of inputs.
The acker(A,B,P) function may be used instead as it does not have this requirement, however this
functions becomes numerically ill-conditioned for higher order systems.
𝜆 −4 + 3𝐢 𝜆 −4 − 3𝐢
The following commands show how Matlab can be used to design and implement a state feedback
controller of the form 𝑢 𝐾𝑥 + 𝑘 𝑟:
The step responses of the open and closed-loop systems are shown below. It can be seen that the
closed-loop system is now stable and the output tracks the reference (step) signal with the desired
second order characteristics.
The following Worked Example will show how Simulink can be used to simulate the effect of a state
feedback controller of the form 𝑢 𝐾𝑥 + 𝑘 𝑟 on a linear dynamical system.
Consider the DC Servomotor system described in Worked Example 8.1. The state-space form of the
equations of motion is:
𝑥 0 1 0 𝑥 0
𝑥 0 −2 2 𝑥 + 0 𝑢
𝑥 0 −10 −5 𝑥 1
𝑥
𝑦 1 0 0 𝑥
𝑥
The block diagram below shows a Simulink model of the open-loop system. This has been created by
modelling the state-space equations as described in the previous sections. The Gain blocks 𝐴, 𝐵, 𝐶,
and D have matrix values equivalent to the corresponding values of the matrices in the state-space
equations.
For the closed-loop response to track a constant reference signal 𝑟 and for the eigenvalues of the
closed-loop dynamics matrix to be:
𝜆 −20 𝜆 −6 + 8𝐢 𝜆 −6 − 8𝐢
This can be implemented in the Simulink model by multiplying the state signal by 𝐾 and adding this
to the reference signal 𝑟 multiplied by 𝑘 to form the input to the system.
It can be seen that the closed-loop response is asymptotically stable and tracks the step input signal.
𝑢 𝐾𝑥 + 𝑘 𝑟 + 𝑑
This can be modelled in Simulink by adding a constant signal, using a Constant block from the
Sources blockset, to the input signal 𝑢 as shown below:
Simulating the system with a constant input disturbance 𝑑 20 produces the plots below:
Closed-Loop Response with Constant Input Disturbance.
It can be seen that with a constant disturbance to the input signal the response has a steady-state
error. A similar result is obtained by simulating the system with a constant disturbance to the
measured output 𝑦 𝑥 + 𝑑. Therefore the limitations of this form of control are that it does not
reject constant disturbance signals. In Chapter 11 we will look at control laws which do reject
constant disturbances.
Chapter 9 – Observability and State Estimators
Learning Outcomes
- Give the definition of observability of a linear system.
- Construct the observability matrix of a system.
- Determine whether a system is observable.
- Give examples of observable and unobservable systems.
- Transform a linear system into observable canonical form.
- Design a state estimator/observer using eigenvalue assignment.
Observability
Consider the linear dynamical system:
𝑥 = 𝐴𝑥 + 𝐵𝑢 𝑦 = 𝐶𝑥 + 𝐷𝑢
A linear system is observable if for any 𝑇 0 it is possible to determine the state of the system 𝑥 𝑇
through measurements of the output 𝑦 𝑡 and the input 𝑢 𝑡 on the interval 0, 𝑇
It can be shown that for an autonomous system the derivatives of the output can be expressed in
terms of the state as:
𝑦 𝐶
⎡ 𝑦 ⎤ ⎡ ⎤
𝐶𝐴
⎢ 𝑦 ⎥ ⎢ ⎥
⎢ =
⎥ ⎢ 𝐶𝐴 ⎥𝑥
⎢ ⋮ ⎥ ⎢ ⋮ ⎥
⎣𝑦 ⎦ ⎣𝐶𝐴 ⎦
𝐶
⎡ 𝐶𝐴 ⎤
⎢ ⎥
The system is observable if and only if the observability matrix 𝑊 = ⎢ 𝐶𝐴 ⎥ is full rank.
⎢ ⋮ ⎥
⎣𝐶𝐴 ⎦
NB: It can be shown that the observability criterion remains unchanged for a system with inputs.
−𝑎 1 0 ⋯ 0 𝑏
⎡ −𝑎 0 1 ⋯ 0⎤ ⎡ ⎤
𝑑𝑥 ⎢ 𝑏
⎥ ⎢ ⎥
= ⋮ . . ⋱ .⎥𝑥 + ⎢ ⋮ ⎥𝑢 𝑦= 1 0 0 ⋯ 0 𝑥 + 𝐷𝑢
𝑑𝑡 ⎢−𝑎
⎢ 0 0 . 1⎥ ⎢𝑏 ⎥
⎣ −𝑎 0 0 ⋯ 0⎦ ⎣ 𝑏 ⎦
The characteristic polynomial of the dynamics matrix in observable canonical form is
𝑝 𝑠 =𝑠 +𝑎 𝑠 + ⋯+ 𝑎 𝑠+𝑎
State Estimation
For the observable linear dynamical system:
𝑥̇ = 𝐴𝑥 + 𝐵𝑢 𝑦 = 𝐶𝑥
The state estimator, or observer, can be represented as the linear dynamical system:
𝑑𝑥
= 𝐴𝑥 + 𝐵𝑢 + 𝐿(𝑦 − 𝐶𝑥 )
𝑑𝑡
where 𝑥 is an estimate of the state of the system. Notice the feedback term (𝑦 − 𝐶𝑥 ) , which is
proportional to the difference between the observed output and the output predicted by the
observer. Defining the estimation error as 𝑥 = 𝑥 − 𝑥 , it follows that
𝑑𝑥
= (𝐴 − 𝐿𝐶)𝑥
𝑑𝑡
The error dynamics are therefore determined by the eigenvalues of (𝐴 − 𝐿𝐶). The gain 𝐿 can be
chosen so that error in the state estimate is stable and decays rapidly in comparison to the time
evolution of the dynamical system being observed.
−𝑎 −𝑙 1 0 ⋯ 0
⎡ ⎤
𝑑𝑥 ⎢ −𝑎 −𝑙 0 1 ⋯ 0
⎥
= ⋮ . . ⋱ .⎥𝑥
𝑑𝑡 ⎢−𝑎 −𝑙 0 0 . 1⎥
⎢
⎣ −𝑎 −𝑙 0 0 ⋯ 0⎦
𝑝 (𝑠) = 𝑠 + (𝑎 + 𝑙 )𝑠 + ⋯ + (𝑎 +𝑙 )𝑠 + 𝑎 + 𝑙
𝑝 (𝑠) = 𝑠 + 𝑝 𝑠 + ⋯+ 𝑝 𝑠+𝑝
𝑝 −𝑎
𝑝 −𝑎
𝐿= ⋮
𝑝 −𝑎
The system being observed and the observer can be considered as one dynamical system which can
be expressed in state-space form as:
𝑑 𝑥 𝐴 0 𝑥 𝐵
= + 𝑢
𝑑𝑡 𝑥 𝐿𝐶 (𝐴 − 𝐿𝐶) 𝑥 𝐵
𝐶 0 𝑥
𝑦=
0 𝐶 𝑥
Worked Example 9.1
𝛼
The state vector for this system is given by 𝑥 𝑞 , where 𝛼 i he ai c af a gle f a ack 𝑞 is the
𝜃
pitch rate and 𝜃 is the pitch angle of the aircraft. The input to the system is the elevator deflection
angle 𝛿 .
𝑥 0.3 57 0 𝑥 0.232
𝑥 0.01 0.5 0 𝑥 0.0203 𝑢
𝑥 0 57 0 𝑥 0
𝑥
𝑦 0 0 1 𝑥
𝑥
𝐶
𝑊 𝐶𝐴
𝐶𝐴
𝐶𝐴 0 57 0 𝐶𝐴 0.57 28.5 0
therefore
0 0 1
𝑊 0 57 0
0.57 28.5 0
det 𝑊 32.49
This system is therefore observable and so given measurements of the output and input we can
determine the state of the system.
The state can be estimated from the output using an observer of the form:
𝑑𝑥
𝐴𝑥 𝐵𝑢 𝐿 𝑦 𝐶𝑥
𝑑𝑡
The error dynamics in the state estimation depend on the eigenvalues of 𝐴 𝐿𝐶 and so the gain 𝐿
must be chosen to give desired dynamics.
The dynamics of the aircraft pitch system are determined by the eigenvalues of the dynamics matrix:
In practice, for state estimation to be useful, we require that the error in the state estimate is stable
and decays rapidly in comparison to the time evolution of the dynamical system being observed. We
can therefore choose the desired eigenvalues of the error dynamics matrix 𝐴 𝐿𝐶 to be, for
example:
𝜆 6 𝜆 8 𝜆 10
By implementing the observer feedback gain 𝐿 we can form the closed-loop error dynamics matrix:
0.3 57 0 𝑙
𝐴 𝐿𝐶 0.01 0.5 0 𝑙 0 0 1
0 57 0 𝑙
0.3 57 𝑙
0.01 0.5 𝑙
0 57 𝑙
Comparing this with the desired characteristic polynomial we can form 3 simultaneous equations:
0.8 𝑙 24
724
This gives the observer gain vector 𝐿 2.96 and therefore the desired observer is:
23.2
𝑥 0.3 57 0 𝑥 0.232 724 𝑥
𝑑
𝑥 0.01 0.5 0 𝑥 0.0203 𝑢 2.96 𝑦 0 0 1 𝑥
𝑑𝑡
𝑥 0 57 0 𝑥 0 23.2 𝑥
Worked Example 9.2
Consider the ball and beam system introduced in Worked Example 5.2:
0
Let 𝐽 = 𝐽 = 𝑚 = 4, 𝑟 = 1 and 𝑔 = 10. For the equilibrium position 𝑥 = 0 the linearised state-
0
0
space form of the equations of motion is:
𝑥̇ 0 1 0 0 𝑥 0 𝑥
𝑥̇ 0 0 −5 0 𝑥 0 𝑥
= + 0 𝑢 𝑦= 1 0 0 0 𝑥
𝑥̇ 0 0 0 1 𝑥
1
𝑥̇ −5 0 0 0 𝑥 8 𝑥
The observability matrix of a state-space system is given by the Matlab command obsv(sys):
Compute the observability matrix of the system and compute its determinant
>> Wo = obsv(sys)
Wo =
1 0 0 0
0 1 0 0
0 0 -5 0
0 0 0 -5
>> det(Wo)
ans = 25
The determinant of the observability matrix is non-zero and therefore the system is observable.
Suppose we would now like to create an observer of the form 𝐴 𝐵 𝐿 𝐶 to
estimate the state of the system given the output. In order for the error to decay rapidly in
comparison to the time evolution of the system we can choose the desired eigenvalues of the matrix
𝐴 𝐿𝐶 to be:
12 8 10𝐢 8 10𝐢 10
The following commands show how Matlab can be used to design and implement an observer of the
form 𝐴 𝐵 𝐿 𝐶 with the input to the system 𝑡 sin 3𝑡 and the initial
1
0
condition
0
0
NB: When setting the initial condition vector, the first half of the entries correspond to the initial
conditions of the system being observed, , the second half of the entries correspond to the initial
conditions of the state estimates , which are zero. Therefore .
0
Simulate and store the response 𝑌 and the states 𝑍 at each time-step 𝑇
>> [Y,T,Z] = lsim(sys_o,U,T,z0);
Plot the evolution of the states along with their observer estimates
>> plot(T, Z(:,1),'-b', T, Z(:,5),'--r')
>> plot(T, Z(:,2),'-b', T, Z(:,6),'--r')
>> plot(T, Z(:,3),'-b', T, Z(:,7),'--r')
>> plot(T, Z(:,4),'-b', T, Z(:,8),'--r')
The plots comparing the actual and estimated state values are shown below. It can be seen that with
the chosen error dynamics the estimated state converges to the actual state within 1 second.
Position 𝑷 Velocity 𝑷
Consider the aircraft pitch model described in Worked Example 4.3. The state-space form of the
equations of motion is given by:
𝑥1 −0.3 57 0 𝑥1 0.232 𝑥1
𝑥2 −0.01 −0.5 0 𝑥2 + 0.0203 𝑢 𝑦 0 0 𝑥
1 2
𝑥3 0 57 0 𝑥3 0 𝑥3
The dynamics of this are determined by the eigenvalues of the dynamics matrix:
𝑑𝑥
𝐴𝑥 + 𝐵𝑢 + 𝐿 𝑦 − 𝐶𝑥
𝑑𝑡
In order for the error dynamics to be much faster than the dynamics of the aircraft we can choose
the desired eigenvalues of the matrix 𝐴 − 𝐿𝐶 to be:
𝜆1 −6 𝜆2 −8 𝜆3 −10
−724
which results in the observer gain vector 𝐿 2.96 .
23.2
To implement this observer in a Simulink model we must first create an open-loop model of the
aircraft pitch system using the techniques described in the previous sections. For a clearer looking
diagram this model can be created as a Subsystem using the method described in Worked
Example 4.3. The Subsystem is shown below. The Gain blocks 𝐴, 𝐵, 𝐶, and D have matrix values
equivalent to the corresponding values of the matrices in the state-space equations.
The observer can be implemented by taking the input and output signals from the aircraft pitch
system and creating another dynamical system as shown below. The actual and estimated responses
have been combined into one signal using a Mux block from the Signal Routing blockset,
these are then plotted using a Scope block.
1 0
For an input 𝑢 𝑡 sin 3𝑡 and the initial conditions 𝑥0 1 and 𝑥0 0 , a simulation for 1
1 0
second produces the following plot:
It can be seen that the estimate of the response 𝑦 converges to the actual response 𝑦 in
approximately 0.9 seconds.
Chapter 10 – Separation Principle and Dynamic Output
Feedback
Learning Outcomes
- Show that the eigenvalues of the closed-loop dynamics matrix with a dynamic output
feedback controller, which consists of a state feedback gain and a state estimator, are the
union of the eigenvalues of the closed-loop dynamics matrix obtained with state feedback
and the eigenvalues of the observer error dynamics
- Explain what is meant with the principle of separation.
- Use the principle of separation to design a dynamic output feedback controller using
eigenvalue assignment.
= 𝐴𝑥 + 𝐵𝑢 𝑦 = 𝐶𝑥 + 𝐷𝑢
= 𝐴𝑥 + 𝐵𝑢 + 𝐿 𝑦 − 𝐶𝑥
𝑢 = 𝐾𝑥 + 𝑘 𝑟
𝑑𝑥
= 𝐴𝑥 + 𝐵𝐾𝑥 + 𝐵𝑘 𝑟
𝑑𝑡
𝑑𝑥
= 𝐴 − 𝐿𝐶 + 𝐵𝐾 𝑥 + 𝐿𝐶𝑥 + 𝐵𝑘 𝑟
𝑑𝑡
𝑑𝑥
= 𝐴 − 𝐿𝐶 𝑥
𝑑𝑡
Choosing the augmented state , the closed-loop system can be expressed in state-space form
as:
𝑑 𝐴 𝐵𝐾 𝐵𝐾 𝐵𝑘
𝑟
𝑑𝑡 0 𝐴 𝐿𝐶 0
𝐶 0
𝑝 𝑠 det 𝑠𝐼 𝐴 𝐵𝐾 det 𝑠𝐼 𝐴 𝐿𝐶
It can be seen that the eigenvalues of the closed-loop system, which are the roots of this polynomial,
are then simply the eigenvalues of 𝐴 𝐵𝐾 and 𝐴 𝐿𝐶 . This is a statement of the separation
principle which implies that, if a system is reachable and observable, we can design the controller
and observer dynamics separately by a correct choice of the gains 𝐾 and 𝐿.
Worked Example 10.1
Rotational System
𝜃
Let 𝐼 2, 𝑏 2 and 𝑘 1. For the state vector 𝑥 , the state-space form of the equations of
𝜃
motion is:
𝑥 0 1 𝑥 0 𝑥
𝑢 𝑦 1 0 𝑥
𝑥 0.5 1 𝑥 1
det 𝑊 1
det 𝑊 1
This system is observable and reachable and therefore we can implement a dynamic output
feedback controller, consisting of an observer of the form:
𝑑𝑥
𝐴𝑥 𝐵𝑢 𝐿 𝑦 𝐶𝑥
𝑑𝑡
and a state feedback control law of the form:
𝑢 𝐾𝑥 𝑘 𝑟
𝑑 𝑥 𝐴 𝐵𝐾 𝐵𝐾 𝑥 𝐵𝑘
𝑟
𝑑𝑡 𝑥 0 𝐴 𝐿𝐶 𝑥 0
𝑥
𝑦 𝐶 0
𝑥
for which, according to the separation principle, the eigenvalues can be arbitrarily assigned.
Suppose we required the dynamics of the closed-loop mechanical system to correspond to the
eigenvalues:
𝜆 2 2𝐢 𝜆 2 2𝐢
and the error dynamics in the observer to correspond to the eigenvalues:
𝜆 10 𝜆 10
The closed-loop dynamics of the mechanical system are determined by the eigenvalues of 𝐴 𝐵𝐾 .
0 1 0 0 1
𝐴 𝐵𝐾 𝑘 𝑘
0.5 1 1 0.5 𝑘 1 𝑘
𝑝 𝑠 𝑠 1 𝑘 𝑠 0.5 𝑘
𝑝 𝑠 𝑠 𝜆 𝑠 𝜆 𝑠 4𝑠 8
1 𝑘 4
0.5 𝑘 8
𝐾 7.5 3
1
𝑘
𝐶 𝐴 𝐵𝐾 𝐵
0 1 0.5 0.125
𝐴 𝐵𝐾 → 𝐴 𝐵𝐾
8 4 1 0
therefore,
1
𝑘 8
0.5 0.125 0
1 0
1 0 1
The required state-feedback controller is then:
𝑥
𝑢 7.5 3 𝑥 8𝑟
0 1 𝑙 𝑙 1
𝐴 𝐿𝐶 1 0
0.5 1 𝑙 0.5 𝑙 1
The closed-loop characteristic polynomial is then
𝑝 𝑠 𝑠 𝑙 1 𝑠 𝑙 𝑙 0.5
𝑝 𝑠 𝑠 𝜆 𝑠 𝜆 𝑠 20𝑠 100
𝑙 1 20
𝑙 𝑙 0.5 100
19
𝐿
80.5
𝑑 𝑥 0 1 𝑥 0 19 𝑥
𝑢 𝑦 1 0
𝑑𝑡 𝑥 0.5 1 𝑥 1 80.5 𝑥
𝑥 0 1 0 0 𝑥 0 𝑥
𝑑 𝑥 8 4 7.5 3 𝑥 8 𝑥
𝑟 𝑦 1 0 0 0 𝑥
𝑑𝑡 𝑥 0 0 19 1 𝑥 0
𝑥 0 0 81 1 𝑥 0 𝑥
Worked Example 10.2
Consider a satellite orbiting the Earth with a constant angular velocity 𝜔, a radial position 𝑟 and a
tangential position 𝜃.
The following reachable and observable linear dynamical system describes the perturbations in
radial and tangential positions and velocities for the satellite. The first input component 𝑢1 𝑡 is the
radial thrust, and the second component 𝑢2 𝑡 is the tangential thrust:
𝑟 0 1 0 0 𝑟 0 0 𝑟
𝑟 3𝜔2 0 0 2𝜔 𝑟 1 0 𝑢 𝑢2 1 0 0 0 𝑟
[ ]=[ ] +[ ] 1 𝑦=
𝜃 0 0 0 1 𝜃 0 0 0 0 1 0 𝜃
𝜃 0 −2𝜔 0 0 𝜃 0 1 𝜃
For simplicity let 𝜔 = 1. The eigenvalues of the open-loop dynamics matrix can be computed using
the eig() function in Matlab:
Inspection of the Jordan form reveals that the zero eigenvalues are associated with a non-scalar
Jordan block, hence the open-loop system is unstable.
The following MATLAB commands show how to implement a dynamic output feedback controller of
the form:
𝑑𝑥
= 𝐴𝑥 + 𝐵𝑢 + 𝐿 𝑦 − 𝐶𝑥 𝑢 = 𝐾𝑥 + 𝑘𝑟 𝑟
𝑑𝑡
such that the dynamics of the closed-loop system are determined by the eigenvalues:
𝜆1 = −1 𝜆2 = −1 + 3𝐢 𝜆3 = −1 − 3𝐢 𝜆4 = −1
NB: When setting the initial condition vector, the initial values of the state estimates 𝑥0 are zero and
therefore the initial values of the error will be equal to the initial values of the states, 𝑥𝑜 = 𝑥𝑜
Simulate and store the open-loop response 𝑌_𝑜 and the states 𝑍_𝑜 at each time-step 𝑇_𝑜
>> [Y_o,T_o,X] = lsim(sys,U,T,x0);
Simulate and store the closed-loop response 𝑌 and the states 𝑍 at each time-step 𝑇
>> [Y,T,Z] = lsim(sys_cl,U,T,z0);
Plot the evolution of the states along with their observer estimates
>> plot(T, Z(:,1),'-b', T, (Z(:,1)-Z(:,5)),'--r')
>> plot(T, Z(:,2),'-b', T, (Z(:,2)-Z(:,6)),'--r')
>> plot(T, Z(:,3),'-b', T, (Z(:,3)-Z(:,7)),'--r')
>> plot(T, Z(:,4),'-b', T, (Z(:,4)-Z(:,8)),'--r')
The following plots show a comparison of the open-loop, closed-loop and estimated radial position 𝑟:
It can be seen that the application of feedback control causes the state to return to the origin must
faster than the open-loop case. The state estimate provided by the observer converges to the actual
state in approximately 2 seconds.
The following plot shows a comparison of the response using a state feedback controller, where the
states are all measured, with the response using a dynamic output feedback controller, where the
states are estimated.
It can be seen that despite initial differences both controllers have the same effect after
approximately 4 seconds. This is due to the estimate of the state becoming more accurate.
Worked Example 10.3
Consider the rotational mechanical system described in Worked Example 10.1. The state-space form
of the equations of motion is:
𝑥 0 1 𝑥 0
𝑢
𝑥 0.5 1 𝑥 1
𝑥
1 0 𝑥
In Worked Example 11.1 it was shown that using the dynamical output feedback controller
𝑑 𝑥 0 1 𝑥 0 19 𝑥
𝑢 1 0
𝑑𝑡 𝑥 0.5 1 𝑥 1 80.5 𝑥
𝑥
𝑢 7.5 3 8𝑟
𝑥
2 2𝐢 2 2𝐢
10 10
To implement this controller in a Simulink model we must first create an open-loop model of the
rotational mechanical system using the techniques described in the previous sections. For a clearer
looking diagram this model can be created as a Subsystem using the method described in Worked
Example 4.3. The Subsystem is shown below.
Open-Loop Subsystem
1
By applying a step input, and with the initial condition 𝑥 = , the open-loop response is shown
1
below:
Open-Loop Response
It can be seen that the open-loop system takes approximately 10 seconds to settle at a steady-state
value. There is also an error between the reference input and the steady state response.
To create the closed-loop system we must first create the observer. This can be done using the
methods described in Worked Example 9.3. For a clearer final diagram the observer can be created
as a Subsystem where the inputs are 𝑢 and the response 𝑦 and the outputs are the estimated state
𝑥 and the estimated response 𝑦:
Observer Subsytem
The closed-loop system can then be created by taking the state estimate signal 𝑥 generated by the
observer, multiplying it by the state feedback gain 𝐾 and adding it to the input of the system, along
with the reference input 𝑟 multiplied by the gain 𝑘 . A Simulink model of the closed-loop system is
shown below. The actual and estimated closed-loop responses have been combined into one signal
using a Mux block from the Signal Routing blockset, these are then plotted using a Scope block.
Closed-Loop Simulink Model
1 0
By applying a step input, and with the initial conditions 𝑥 = and 𝑥 = , the closed-loop
1 0
response is shown below:
Closed-Loop Response
It can be seen that the closed-loop response reaches a steady-state in approximately 4 seconds and
tracks the reference signal exactly. The state estimate produced by the observer converges to the
actual value in approximately 0.75 seconds.
𝑦 =𝑥 +𝑑
This can be modelled in Simulink by adding a constant signal, using a Constant block from the
Sources blockset, to the input signal 𝑢 as shown below:
Simulating the system with a constant input disturbance 𝑑 1 produces the plots below:
It can be seen that with a constant disturbance to the measured output the response has a steady-
state error. A similar result is obtained by simulating the system with a constant disturbance to the
input signal 𝑢 𝐾𝑥 + 𝑘 𝑟 + 𝑑. Therefore the limitations of this form of control are that it does not
reject constant disturbance signals. In the next Chapter we will look at control laws which do reject
constant disturbances.
Chapter 11 – Integral Control
Learning Outcomes
- Work out which is the dominant eigenvalue pair for a high order system.
- Use eigenvalue assignment to design a controller to ensure integral action i.e. to reject
constant unmeasured disturbances while tracking a constant setpoint.
Integral Control
Consider the reachable linear dynamical system:
𝑥 𝐴𝑥 𝐵𝑢 𝑦 𝐶𝑥 𝐷𝑢
If a control law of the form 𝑢 𝐾𝑥 𝑘 𝑟 is implemented, the gain 𝐾 can be chosen to place the
eigenvalues of the closed-loop system in desired locations and the gain 𝑘 can be chosen so that the
input tracks a constant reference signal 𝑟. However, this is based on the assumption that we have an
exact model and so any disturbances to the system may result in a steady-state error. A solution to
this problem is to use integral feedback in which the controller uses an integrator to provide zero
steady-state error. This is done by introducing the state , which is equal to the integral of the error:
𝑑
𝑦 𝑟 ⇒ 𝑦 𝑟 𝐶𝑥 𝑟
𝑑𝑡
𝑥
By choosing the augmented state the state-space form of the open-loop system is:
𝑑 𝑥 𝐴 0 𝑥 𝐵 0 𝑥
𝑢 𝑟 𝑦 𝐶 0
𝑑𝑡 𝐶 0 0 1
Given the augmented system the following integral control law can now be applied:
𝑢 𝐾𝑥 𝑘 𝑟
where 𝐾 is the state feedback gain and 𝑘 is an integral gain. Substituting this into the open-loop
equations results in the closed-loop system:
𝑑 𝑥 𝐴 𝐵𝐾 𝐵𝑘 𝑥 𝐵 𝑥
𝑟 𝑦 𝐶 0
𝑑𝑡 𝐶 0 1
The eigenvalues of the closed-loop dynamics matrix are the union of the eigenvalues corresponding
to the closed-loop system dynamics and the eigenvalues corresponding to the dynamics of the
integral action, which should preferably be much faster than the system dynamics. The gains 𝐾 and
𝑘 can be chosen such that the closed-loop system has desired eigenvalue locations.
𝑢 𝐾𝑥 𝑘 𝑟 𝑑
The state-space form of the closed-loop system becomes:
𝑑 𝑥 𝐴 𝐵𝐾 𝐵𝑘 𝑥 𝐵 𝐵 𝑟 𝑥
𝑦 𝐶 0 𝑧
𝑑𝑡 𝑧 𝐶 0 𝑧 1 0 𝑑
Proportional-Integral Control
Both proportional and integral terms can be used to produce a proportional-integral controller. For
the linear dynamical system:
𝑥 𝐴𝑥 𝐵𝑢 𝑦 𝐶𝑥 𝐷𝑢
𝑢 𝐾𝑥 𝑘𝑧 𝑘 𝑟
𝑑 𝑥 𝐴 𝐵𝐾 𝐵𝑘 𝑥 𝐵𝑘 𝑥
𝑟 𝑦 𝐶 0 𝑧
𝑑𝑡 𝑧 𝐶 0 𝑧 1
The gains 𝐾 and 𝑘 are found by comparing the characteristic polynomial of the closed-loop
dynamics matrix with the desired characteristic polynomial, and the gain 𝑘 is given by:
1
𝑘
𝐶 𝐴 𝐵𝐾 𝐵
𝑢 𝐾𝑥 𝑘𝑧 𝑘 𝑟 𝑑
𝑑 𝑥 𝐴 𝐵𝐾 𝐵𝑘 𝑥 𝐵𝑘 𝐵 𝑟 𝑥
𝑦 𝐶 0 𝑧
𝑑𝑡 𝑧 𝐶 0 𝑧 1 0 𝑑
Worked Example 11.1
Inverted Pendulum
For 𝐽 = 𝑚𝑔 = 𝑙 = 1 and 𝛾 = 2, the linearized state-space form of the equation of motion is:
𝑥̇ 0 1 𝑥 0 𝑥
= + 𝑢 𝑦= 1 0 𝑥
𝑥̇ 1 −2 𝑥 1
𝜆 = −2.4142 𝜆 = 0.4142
𝑢 = 𝐾𝑥 + 𝑘 𝑧 + 𝑘 𝑟
such that the eigenvalues corresponding to the closed-loop system dynamics are:
𝜆 = −2 + 3𝐢 𝜆 = −2 − 3𝐢
and the eigenvalue corresponding to the dynamics of the integral action is:
𝜆 = −12
𝑥
Introducing the augmented state 𝑥 the closed-loop system is given by:
𝑧
𝑑 𝑥 (𝐴 + 𝐵𝐾) 𝐵𝑘 𝑥 𝐵𝑘 𝑥
= + 𝑟 𝑦= 𝐶 0 𝑧
𝑑𝑡 𝑧 𝐶 0 𝑧 −1
where (𝐴 + 𝐵𝐾) = 0 1
+
0 𝑘 𝑘
1 −2 1
0 1
=
1+𝑘 −2 + 𝑘
therefore:
𝑑 0 1 0 0
1 𝑘 2 𝑘 𝑘 𝑘 1 0 0
𝑑
1 0 0 1
2 𝑘 1 𝑘 𝑘
2 3𝐢 2 3𝐢 12 16 61 156
2 𝑘 16
1 𝑘 61
𝑘 156
𝐾 62 14
𝑘 156
1
𝑘
𝐶 𝐴 𝐵𝐾 𝐵
16 1
0 1
𝐴 𝐵𝐾 → 𝐴 𝐵𝐾 61 61
61 16
1 0
therefore,
1
𝑘 61
16 1 0
1 0 61 61
1 0 1
62 14 156 61
Worked Example 11.2
Consider the following mass-spring-damper system. The input 𝑓 is a force applied to the mass 𝑚
and the output is measured as the translation 𝑝 of the mass 𝑚 .
Mass-Spring-Damper System
𝑝
𝑝
Let 𝑚 1, 𝑚 2, 𝑘 10, 𝑘 4, 𝑐 6 and 𝑐 4. For the state-vector 𝑝 the state-
𝑝
space form of the equations of motion is:
0 1 0 0 0
14 10 4 4 1
1 0 0 0
0 0 0 1 0
2 2 2 2 0
The eigenvalues of the open-loop dynamics matrix can be computed using the eig() function in
Matlab:
0.5 1 1 2𝐢 1 2𝐢
and the eigenvalue corresponding to the dynamics of the integral action is:
15
𝑥
By choosing the augmented state the state-space form of the open-loop system is:
𝑧
𝑑 𝑥 𝐴 0 𝑥 𝐵 0 𝑥
+ 𝑢+ 𝑟 𝑦 𝐶 0 𝑧
𝑑𝑡 𝑧 𝐶 0 𝑧 0 1
Input the augmented open-loop system matrices and create a state-space system
>> A_o = [A ([0;0;0;0]) ; C 0];
>> B_o = [B ; 0];
>> C_o = [C 0];
>> D_o = [0];
>> sys_o = ss(A_o,B_o,C_o,D_o);
𝑑 𝑥 𝐴 0 𝐵 𝐾 𝑥 𝐵𝑘 𝑥
+ 𝑘 + 𝑟 𝑦 𝐶 0 𝑧
𝑑𝑡 𝑧 𝐶 0 0 𝑧 1
A vector containing the state feedback and integral gains 𝐾 and 𝑘 can thus be found with the
place(A,B,P) function by using the augmented open-loop matrices A_o and B_o as inputs:
We can now calculate the proportional gain 𝑘 and create a closed-loop system in Matlab:
The plot below shows the step responses of the closed-loop system with proportional-integral
control, and the closed-loop system with just proportional control i.e. the same system but with
𝑘 1.
Step Response with Proportional-Integral Control Step Response with Integral Control
It can be seen that in both cases the steady-state response tracks the reference step signal. Using
integral control it takes approximately 14 seconds for the system to reach a steady-state, whereas
with a proportional-integral controller it takes only 10 seconds to converge to a steady-state.
If we allow for an unknown constant input disturbance 𝑑, the closed-loop form of the system
becomes:
𝑑 𝐴 𝐵𝐾 𝐵𝑘 𝐵𝑘 𝐵 𝑟
𝑑 𝐶 0 1 0 𝑑
This can be implemented in Matlab by changing the closed-loop control matrix Bcl:
Input the new closed-loop control matrix and create a state-space system
>> Bcl = [B*kr B; -1 0];
>> sys_cl = ss(Acl,Bcl,Ccl,Dcl);
The following commands show how to simulate the system with a constant reference signal
0
⎡ ⎤ ⎡0⎤
⎢ ⎥ ⎢ ⎥
𝑟 2, a constant input disturbance 𝑑 1, and the initial conditions ⎢ ⎥ ⎢ 0 ⎥. Note that
⎢ ⎥ ⎢0⎥
⎣ ⎦ ⎣ 2⎦
by definition 𝑟.
It can be seen that despite a constant disturbance in the input signal, the proportional-integral
controller ensures that the response still converges to the reference value with zero steady-state
error.
By setting the integral gain 𝑘 0 in the closed-loop dynamics matrix and simulating the system
with the same input signal the following plot is obtained:
It can be seen that without the integral action the disturbance causes there to be a steady-state
error in the response.
Worked Example 11.3
Consider the inverted pendulum described in Worked Example 11.1. The state-space form of the
equations of motion is:
𝑥 0 1 𝑥 0 𝑥
+ 𝑢 𝑦 1 0 𝑥
𝑥 1 2 𝑥 1
In Worked Example 12.1 it was shown that using the proportional-integral controller:
𝑥
𝑢 62 14 𝑥 156𝑧 + 61𝑟
𝜆 2 + 3𝐢 𝜆 2 3𝐢
𝜆 12
To implement this controller in a Simulink model we must first create an open-loop model of the
inverted pendulum using the techniques described in the previous sections. The open-loop model is
shown below:
Open-Loop Subsystem
0
The step response of the open-loop system with the initial condition 𝑥 is shown below:
0
To implement the proportional-integral controller in Simulink we must first take the difference
between the output signal 𝑦 and the reference signal 𝑟, to form the signal 𝑦 𝑟 , which can then
be passed through an integrator to form the 𝑧 signal. This signal is then multiplied by the integral
gain 𝑘 and added to the input signal 𝑢. Lastly, the state signal 𝑥 mulitplied by the state feedback
gain 𝐾 and the reference signal 𝑟 multiplied by 𝑘 are both added to the input of the system to form
the controller. The closed-loop system is shown below:
Closed-Loop System
𝑥 0
The step response of the closed-loop system with the initial condition 𝑥 0 is shown below:
𝑧 1
It can be seen that the controller stabilises the system as well as forcing the output 𝑦 to track the
reference signal 𝑟 with zero steady-state error.
The effect of a constant input disturbance 𝑑 can be modelled by adding a constant signal, using a
Constant block from the Sources blockset, to the input signal 𝑢 as shown below:
It can be seen that response of the system using the proportional-integral controller tracks the
reference signal with zero steady-state error. For the system without the integral action, the
disturbance causes a steady-state error in the response.
In a similar way, Simulink can be used to model a constant disturbance 𝑑 in the measured output .
The following plots show Simulations of the system with a measurement disturbance 𝑑 0.5:
Again it can be seen that despite a constant measurement disturbance the controller with integral
action causes the steady-state error to go to zero.