You are on page 1of 11

lecture notes «

Full- and Reduced-Order Linear Observer


Implementations in Matlab/Simulink
Verica Radisavljevic-Gajic

T
he design of observers is usually considered a grad- nova University; California State University, Los Angeles;
uate-level topic and therefore tends to be taught in a American University of Sharjah; University of Belgrade;
graduate-level control engineering course. However, and Lafayette College.
several recent editions of standard undergraduate control- Hopefully, by understanding full- and reduced-order
system textbooks cover full-order, and even reduced-order, observer design and Matlab/Simulink implementation,
observers [1]–[9]. Observers are also used in their own right students, instructors, engineers, and scientists will appre-
to strictly observe the state variables of a dynamic system ciate the importance of observers and feel confident using
rather than to be used for feedback control (for example, in observers and observer-based controllers in numerous en-
an experiment whose state variables have to be monitored, gineering and scientific applications.
observed, or estimated at all times). In undergraduate classes on control systems, time invari-
This tutorial is primarily for undergraduate students ant linear systems are represented, in state-space form, by
and their instructors as a supplement to textbooks, labora-
dx (t)
tory manuals, and project design assignments. This tutorial = Ax (t) + Bu (t), x (0) = x 0, (1)
dt
is intended to be a self-contained and complete presentation
of full- and reduced-order observer designs drawn from where x (t) is the state-space vector of dimension n, u (t)
several undergraduate and graduate textbooks. Elementa- is the system input vector (which may be used as a sys-
ry knowledge of state-space and linear algebra is assumed. tem control input) of dimension m, and matrices A and
In addition, this article attempts to resolve challenges that B are constant and of appropriate dimensions. In practice,
undergraduate students are faced with while implement- the initial condition is often unknown, in which case an
ing full- and reduced-order observers in Matlab/Simulink. observer is designed, [1]–[9], to estimate or observe system
The implementation part of the tutorial demonstrates state-space variables at all times.
»» how to input full- and reduced-order observer system, To take the advantage of the useful features of feedback
input, and output matrices using Simulink state-space (see, for example, [10, Chap. 12]), it is often assumed that all
blocks and how to determine dimensions of the state variables are available for feedback (full-state feedback),
observer output matrices (they are either identity or allowing that a feedback control input can be applied as
zero matrices)
u (x (t)) =-Fx (t), (2)
»» how to find proper full- and reduced-order observer
feedback gains where F is a constant feedback matrix of dimension m # n.
»» how to set observer initial conditions. The fact that all state-space variables must be available for feed-
To that end, two novel theoretical results have also been back is a prevalent implementational difficulty of full-state
developed: how to set up the reduced-order initial condi- feedback controllers. Moreover, large-scale systems with
tions using the least-squares method, derived in (38)–(40), full-state feedback have many feedback loops, which might
and an observation that the reduced-order observer output become very costly and/or impractical. Moreover, often not
is identical to the original system’s actual output, the result all state variables are available for feedback. Instead, an
established in (36). output signal that represents a linear combination of the
This tutorial is also useful for practicing engineers and state-space variables is available
y (t) = Cx ^ t h, (3)
scientists interested in controlling or observing linear

dynamic systems. This tutorial has been used, in various
forms, by the author and her colleagues over several years where dim " y (t) , = l < n = dim " x (t) ,. It is assumed that
at several academic institutions: Rutgers University; Villa- l = c = rank " C ,, so there are no redundant measurements.
In such a case, under certain conditions, an observer can
Digital Object Identifier 10.1109/MCS.2015.2449691 be designed that is a dynamic system driven by the system
Date of publication: 16 September 2015 input and output signals with the goal of reconstructing

1066-033X/15©2015ieee october 2015  «  IEEE CONTROL SYSTEMS MAGAZINE  91


(observing, estimating) all system state-space variables at eo (t) = (A - KC) e (t),
all times. 
e (t 0) = unknown. (8)
This article shows how to implement full- and reduced-
order observers using the Matlab and Simulink software If the observer gain K is chosen such that the feedback
packages for computer-aided control system design. In fact, matrix A - KC is asymptotically stable (has all eigenvalues
how to implement a linear system and its observer, repre- with negative real parts), then the estimation error e (t) will
sented by their state-space forms, using the Simulink state- decay to zero for any initial condition e (t 0) . This stabilization
space blocks is shown. How to choose the observers’ initial requirement can be achieved if the pair (A, C) is observable [14].
conditions and how to set the observers’ gains is also dis- It can be also noted that the error (and observer) stabiliza-
cussed. This presentation is at the level of undergraduate tion can be achieved under a weaker condition that the pair
junior or senior students taking their first undergraduate (A, C ) is detectable (not all, but at least the unstable modes
control systems class and assumes knowledge of the linear of matrix A are observable) [14].
state-space system representation and linear algebra. A standard rule of thumb is that an observer should be
designed such that its response is much faster than the sys-
Full-Order Observer Design tem. This is especially important when the observed state
The theory of observers originated in the mid 1960s [11]– variables are used for the purpose of feedback control.
[13]. According to [11], any system driven by the output of Namely, since the system changes in time, its estimated
the given system can serve as an observer for that system. state variables must be as current as possible, otherwise the
Consider a linear dynamic system feedback signals represent considerably delayed estimates
of the actual state variables, which can make the controller
xo (t) = Ax (t) + Bu (t), x (t 0) = x 0 = unknown, inaccurate and inefficient. This can be achieved theoreti-

y (t) = Cx (t) . (4) cally by choosing the observer eigenvalues to be about ten
times faster than the system eigenvalues, that is by setting
The system output variables y (t) are available at all times, the smallest real part of the observer eigenvalues to be ten
and that information can be used to construct an artificial times larger than the largest real part of the closed-loop
dynamic system of the same order ^n h as the system under system eigenvalues
consideration that can estimate the system state-space vari-
ables at all times. Since the matrices A, B, C are known, it is Re " m min (A - KC) , observer > 10 Re " m max (A - BF) , system . (9)
rational to postulate an observer for (4) as
Theoretically, an observer can be made arbitrarily fast by locating
xto (t) = Axt (t) + Bu (t), its closed-loop eigenvalues very far to the left in the complex plane,
xt (t 0) = xt 0,  but very fast observers can generate noise, which is not desirable.
yt (t) = Cxt (t) . (5) In control system practice and applications, instead of ten
times larger, it is sufficient that the closed-loop observer
If the outputs y (t) and yt (t) are compared, they will, in gen- eigenvalues are faster than the closed-loop system eigen-
eral, be different since, in the first case, the initial condition values by a factor of five to six times.
of (4) is unknown, and, in the second case, the initial condi- After the system eigenvalues m i (A - BF) are deter-
tion of the proposed observer (5) is chosen arbitrarily by a mined, the observer eigenvalues m i (A - KC) are placed in
control engineer (designed). The difference between these the desired locations by selecting the corresponding ob-
two outputs generates an error signal server gain K using the eigenvalue assignment technique
[14] (traditionally known as the pole-placement technique).
y (t) - yt (t) = Cx (t) - Cxt (t) = Ce (t), (6) If an observer is to be used only for the purpose of observ-
ing the system states rather than for feedback control, (9)
which can be used as the feedback signal to the observer is less important and the observer closed-loop eigenvalues
such that the estimation (observation) error e (t) = x (t) - xt (t) only need be faster than the fastest system dynamics.
is reduced. An observer that takes into account feedback
information about the observation error is [11]–[13] Separation Principle
It is important to point out that the system-observer con-
xto (t) = Axt (t) + Bu (t) + K (y (t) - yt (t)) figuration preserves the closed-loop system eigenvalues

= Axt (t) + Bu (t) + KCe (t), (7) that would have been obtained if the linear, perfect-state-
feedback control had been used. This fact is shown below.
where the matrix K represents the observer gain, which The system (4) under perfect state-feedback control, that is,
must be selected such that the observation error tends to u (x (t)) =-Fx (t) has the closed-loop form
zero as time increases. From (4) and (7), comes an expres-
sion for dynamics of the observation error xo (t) = (A - BF) x (t), (10)

92  IEEE CONTROL SYSTEMS MAGAZINE  »  october 2015


so that the eigenvalues of the matrix A - BF are the closed- observer equation (14) yields the observer form used in prac-
loop system eigenvalues under perfect state feedback. In the tical implementations
case of the system-observer configuration, the actual con-
trol signal applied to both the system and the observer is xto (t) = (A - KC) xt (t) + Bu (t) + Ky (t). (15)

u (xt (t)) =-Fxt (t) =-Fx (t) + Fe (t). (11) The corresponding block diagram of the system-observer
configuration, also known as the observer-based control-
From (8), (10), and (11), ler configuration, is presented in Figure 1 with the feedback
loop closed using the feedback controller as defined in (11),
namely u (xt ^ t h) =-Fxt (t). This block diagram can be imple-
; E =; E; E = A; E. 
xo (t) A - BF BF x ( t) x (t)
(12)
eo (t) 0 A - KC e (t) e (t) mented using Matlab/Simulink, as presented in Figure 2(a).
In Figure 2(a), the rectangular blocks at the end of signal
Since the state matrix of this augmented system is upper flows (sinks) pass the identified data (variables) to the Matlab
block triangular, its eigenvalues are equal to the union of workspace. The clock generates the time vector and passes it
the eigenvalues of the matrices A - BF and A - KC. A very to the Matlab workspace. The signals may be observed on the
simple relation among x (t), e (t), and xt (t) can be written scopes or plotted in Matlab using, for example, plot(t,y).
using the definition of the estimation error as This block diagram is edited and presented in Figure 2(b) to
improve clarity, as explained in the figure caption.
; E =; E; E = T; E. (13)
x (t) I 0 x ( t) x (t)
In Figure 2, the state-space block of Simulink is used. That
e (t) I -I xt (t) xt (t)
block allows only one input vector and one output vector.
Note that the matrix T is nonsingular. To go from xe -coor- For that reason, the observer in (15) is represented as a sys-
dinates to xxt -coordinates, the similarity transformation tem with one augmented input
defined in (13) is used, which has a property of preserving
u (t)
the eigenvalues [1]–[9], that is, the eigenvalues m (A - BF) and xto (t) = (A - KC) xt (t) + 6B K@= G. (16)
y (t)
m (A - KC) obtained in the xe -coordinates are identical to
the system-observer eigenvalues in xxt -coordinates. The fact Using the given dimensions of the state, input, and output
that the system-observer configuration has the closed-loop variables (respectively n, m, and c), the system matrices for
eigenvalues separated into the original system closed-loop the state-space Simulink blocks are set as follows. For the sys-
eigenvalues (obtained under perfect state feedback) and the tem, the matrices are respectively: A, B, C, zeros(c,m),
actual observer closed-loop eigenvalues is known as the sep- the last one meaning a zero matrix of dimensions c # m. Note
aration principle. Hence, the system and the observer eigen- that in the original state-space form, the input signal is not
values can be independently placed (assigned) into desired present in the system measurements so that D = 0, and this
locations using the system gain F and the observer gain K. matrix is of dimensions c # m. The system initial condition
is unknown, but to run a simulation requires an initial con-
Full-Order Observer Implementation in Simulink dition (denoted x0). Any vector of dimension n is acceptable.
An observer, being an artificial dynamic system of the Hence, the system state-space block setup in Simulink is
same order as the original system, can be built by a control
engineer using either capacitors and resistors (what electri- System State-Space Block Setup: A, B, C, zeros ^c,m h, x0.
cal engineers do) or using masses, springs, and frictional (17)
elements (what mechanical engineers prefer) or simply After opening the system state-space block in the Simulink
using a personal computer that simulates and solves the window, it is possible to set up the system state-space data.
corresponding differential equation, which is something
that anybody with a basic knowledge of control systems
and differential equations can do, especially those familiar t
u(x(t)) y(t)
Linear
with Matlab and Simulink.
System
As described in the previous section, an observer has the
same structure as the original system plus the driving feedback
term that carries information about the observation error, that is
-F K

xto (t) = Axt (t) + Bu (t) + K (y (t) - yt (t)),



yt (t) = Cxt (t) . (14) t
x(t)
Observer
In practice, the observer is implemented as a linear dynamic
system driven by the original system input and output
signals, that is, u (t) and y (t) . Eliminating yt (t) from the Figure 1 A block diagram for the system observer configuration.

october 2015  «  IEEE CONTROL SYSTEMS MAGAZINE  93


Namely, a new window will open (see Figure 3) to input the (or figure) can be further edited using numerous Matlab
system data. These matrices must be previously defined in the figure-editing functions. For the observer, the correspond-
Matlab window by running the corresponding Matlab program. ing matrices should be set using information from (16)
The results obtained for y (t) and yt (t), and output ob-
servation error e (t), may be presented using the Simulink Observer State Space
block “scope,” or passed to the Matlab window, together Block Setup:

with time, where they can be plotted using the Matlab A - K * C, 6B K@,eye ^n h,
plot function. For example, plot(t,error) plots the zeros ^n, m + c h, x0hat. (18)
output observation error as a function of time t. Such a plot
The first matrix is the observer
feedback matrix, the second is
the augmented matrix of two
t inputs into the observer [see
Clock Time (16)], and the third matrix (set
y
to the identity of dimension n)
xl = Ax + Bu indicates that estimates of all n
y
y = Cx + Du
state variables are available on
System System Output
the observer output. Since the
observer is a system either built
Error by a designer or a computer pro-
xhat + gram that simulates observer
- Error
dynamics, the designer has
xl = Ax + Bu Add Output
-F* u full freedom to choose the
y = Cx + Du
Observer
Observer Error
observer output matrix and set
System Feedback
it to an identity matrix so that
Gain
all observed (estimated) state-
C* u yhat
space variables appear on the
Observer Output observer output. The fourth
Gain
(a) matrix represents the matrix
“D” in the observer block and,
t due to the fact that the input
Clock matrix into the observer is
Time
y the augmented matrix [B K]
u = -Fxt xl = Ax + Bu of dimension n # (m + c) and
y
y = Cx + Du the output matrix from the
System System Output observer is of dimension n # n
u = -Fxt y (identity matrix I n), the dimen-
y Error sion of the zero matrix must
xhat + be n # (m + c) . Finally, the
y - yt
-F
xt xl = Ax + Bu
y = Cx + Du
QUu
y yt
-
Add Output
last entry in (18) denotes the
observer initial condition vec-
Observer tor that can be set arbitrarily.
System Observer Error Later on in the article, a rational
Feedback Gain
yt = Cxt choice of the observer initial
C yt condition will be discussed.
Observer Output These matrices can be entered
Gain
in the Simulink state-space
(b) block by double left clicking on
the observer state-space block,
Figure 2 (a) A Simulink implementation of the system-observer configuration, the actual block dia- which will open a new win-
gram produced by Simulink. Note that the triangular blocks representing a product of a matrix and a dow as shown in Figure 4. For
vector have in Simulink the “Matrix ) vector” notation with the vector being denoted by u. The matrix details, see “Matlab Code: Sys-
can be specified and hence changed, but u cannot be changed since it denotes by default all incom-
ing signals. (b) A Simulink implementation of the system-observer configuration, the edited Simulink
tem State-Space Block Setup.”
block diagram, to improve clarity of the Simulink block diagram presented in (a) with labeling the The observer initial condition
signal wires and to make signal notation consistent with the notation used in the article. has to be specified. Usually, it

94  IEEE CONTROL SYSTEMS MAGAZINE  »  october 2015


Figure 3 The system state-space Simulink data-input window. Figure 4 The observer state-space Simulink data-input window.

can be any vector whose dimension is equal to the dimension


of the system state-space variables. Engineering experience can Matlab Code: System
help one choose the observer’s initial condition, but no general State-Space Block Setup
guidelines exist. In practice, engineers often set xt (0) = 0 [15] so % System State-Space Block Setup
that e (0) = x (0) - xt (0) = x (0) . Since the matrix C is not, in gen- n = input(‘dimension of state vector’);
eral, invertible, the initial condition cannot be directly obtained %% dimension of system;
from y (0) = Cx (0). It was recommended in [15] that the partial m =input(‘dimension of input vector’);
information about the system initial condition available from c = input(‘dimension of output vector’);
the system measurements at the initial time, y (0) = Cx (0), be % dimension of output vector = l = c = rank(C);
used to obtain an estimate of xt (0) . In such a case, xt (0) can be A=
A; B=B; C=C; D=zeros(c,m);
obtained via the least-squares method as %% assumed D is a zero matrix
% 
to be able to run simulation we must assign
xt (0) = (C T C) -1 C T y (0), (19) % some value to the system initial condition
% since in practice this value is given, but
where y (0) is a known measured signal at t = 0. Since it % unknown, that is
was assumed after (3) that matrix C has full rank, that is, x0 = input(‘some column vector of dimension
dim " y (t) , = l = c < n = dim " x (t) ,, c = rank " C ,, the inver- n’);
sion defined in (19) does not exist and a pseudoinverse has % Observer State-Space Block Setup
to be used [15]. Ao
bs=A-K*C; Bobs=[B K]; Cobs=eye(n);
Dobs=zeros(n,m+c);
Reduced-Order Observer Design xo
bs=input(‘any column vector of dimension
Consider the linear dynamic system defined in (4) with n’)
the corresponding measurements. Assume that the out-
put matrix C has full rank (equal to c) so that there are
no redundant measurements. This means that the output system output, and hence is known at all times. In this sec-
equation y (t) = Cx (t) represents, at any time, c linearly tion, it is shown how to construct an observer of reduced
independent algebraic equations for n unknown state vari- order r = n - c for estimating the remaining r state-space
ables x (t) . Note that y (t), of dimension c, is the measured variables [c state variables can be obtained directly from

october 2015  «  IEEE CONTROL SYSTEMS MAGAZINE  95


the system measurements y (t) = Cx (t) ]. As indicated in y (t) = Cx (t) = CLy (t) + CL 1 p (t) = y (t) + 0 = y (t) . (26)
[3], the reduced-order observer should be used when the
system measurements have no noise. If noise is present, it More information about y (t) can be obtained from the
is better to use the full-order observer, since it filters the knowledge of yo (t), in which case
system measurements and, in general, all state variables.
It will be seen that the procedure for obtaining the re- yo (t) = Cxo (t) = CAx (t) + CBu (t)

duced-order observer is not unique. An arbitrary matrix C 1 = CAL 1 p (t) + CALy (t) + CBu (t) . (27)
of dimension r # n whose rank is equal to r = n - c can be
found such that the augmented matrix This indicates that yo (t) contains information about p (t), so
that it can be used to construct an observer for p (t)
rank ; E = n, (20)
C

C1
pto (t) = C 1 AL 1 pt (t) + C 1 ALy (t) + C 1 Bu (t) + K 1 (yo (t) - yto (t)),
has full rank equal to n. Introduce a vector p (t) of dimen-  (28)
sion r such that
where K 1 is the reduced-order observer gain, which has to
p (t) = C 1 x (t) . (21) be determined such that the reduced-order observer error
p (t)-pt (t) goes to zero as time increases. The reduced-order
Combining (3) and (21) yields observer measurement is obtained from (27) by replacing
p (t) by its estimate (observation) pt (t), that is,
= G = ; E x (t), 
y (t ) C

p (t ) C1 yto (t) = CAL 1 pt (t) + CALy (t) + CBu (t). (29)

which can be solved to obtain Signal differentiation is not a recommended operation since
it is very sensitive to noise; signal differentiation amplifies

x (t) = ; E = G = 6L L 1@= G = Ly (t) + L 1 p (t) . (22)


C -1 y (t) y (t) noise so it should be avoided in all practical applications.

C1 p (t) p (t) Using an appropriate change of variables, it is possible to
completely eliminate the need for information about the
An estimate of x (t) can be obtained from (22) as derivative of the system measurements yo (t) .
Eliminating yto (t) from (28) using (29), produces
xt (t) = Ly (t) + L 1 pt (t), (23)
pto (t) = C 1 AL 1 pt (t) + C 1 ALy (t) + C 1 Bu (t)

where y (t) are known system measurements and pt (t) has + K 1 (yo (t) - CAL 1 pt (t) + CALy (t) + CBu (t)) . (30)
to be obtained using a reduced-order observer of dimension
r < n. As a preliminary result in the process of constructing Bringing the term with yo (t) to the left-hand side of (30) and
a reduced-order observer for p (t), it can be noticed from introducing a change of variables
(22) that the following algebraic relations exist
qt (t) = pt (t) - K 1 y (t) which implies qto (t) = pto (t) - K 1 yo (t),
 (31)
; E; E = I n = ; E6L L 1@ = ; E =; E (24)
C C -1 C CL CL 1 Ic 0

C1 C1 C1 C1 L C1 L1 0 Ir
the reduced-order observer for qt (t) is
giving CL = I c, C 1 L 1 = I r, CL 1 = 0, C 1 L = 0, where I n, I c, I r,
are identity matrices of corresponding dimensions and qto (t) = A q qt (t) + B q u (t) + K q y (t), (32)
n = c + r.
Since from (21) p (t) = C 1 x (t), the differential equation where
for p (t) can be easily constructed using the original system
differential equation (4) and (22), which leads to A q = ^C 1 - K 1 C h AL 1, B q = (C 1 - K 1 C) B,

K q = ^C 1 - K 1 C h A (L + L 1 K 1) . (33)
po (t) = d " p (t) , = d " C 1 x (t) , = C 1 xo (t)
dt dt 
= C 1 Ax (t) + C 1 Bu (t) = C 1 AL 1 p (t) + C 1 Bu (t) . (25) Using the observation for qt (t) obtained from (32)–(33), the
reduced-order observer estimate is obtained from (31) as
Trying to design an observer for p (t) using the above-estab- pt (t) = qt (t) + K 1 y (t), which gives the estimate of the origi-
lished principle [see (14); an observer has the same structure as the nal state-space variables as
original system plus the driving feedback term that carries informa-
tion about the observation error], it can be found that y (t) does xt (t) = Ly (t) + L 1 pt (t) = Ly (t) + L 1 (qt (t) + K 1 y (t))

not contain information about p (t) since from (22) and (24) = ^L + L 1 K 1 h y (t) + L 1 qt (t) . (34)

96  IEEE CONTROL SYSTEMS MAGAZINE  »  october 2015


In Figure 5, the obtained system-reduced-observer con- the reduced-order observer and sets its eigenvalues in the
figuration block diagram produced by Simulink is present- desired locations (to make the reduced-order observer much
ed in (a), and this block diagram is edited and presented in faster than the system). These questions will be answered in
(b), where signal wires are labeled and the reduced-order the following subsections.
observer equation (32) and its Simulink implementation are
denoted. As shown in Figure 6, for the reduced-order ob- Least-Squares Choice for the Reduced-Order
server, the corresponding matrices are set as Observer Initial Conditions
The least-squares solution for the choice of the reduced-
Observer State-Space Block Setup: Aq, 6Bq Kq@, order observer initial conditions can be obtained by extend-

eye ^n - c h, zeros ^n - c, m + c h, x0hat- reduced. (35) ing the least-squares solution of the full-order observer

Comment
An interesting observation can t
be made about the signal yt (t) =
Clock Time y
Cxt (t), namely, using the result
established in (24)
xl = Ax + Bu y
yt (t) = Cxt (t) y = Cx + Du
= C ^L 1 qt (t) System (L + L1*K1)* u System Output

+ ^ L + L 1 K 1 h y ( t) h Gain1

= CL 1 qt (t) + CLy (t)


 xhat
+ CL 1 K 1 y (t)
+
= 0qt (t) + Iy (t) xl = Ax + Bu + xhat
L1* u
+ 0y (t) y = Cx + Du
Gain Add Observer
= y (t)
(36) Reduced Observer Output

indicating that the reduced- -F* u


order observer also produces System
in its output information about Feedback Gain System Reduced-Order-Observer Configuration
the exact values of the system (a)
actual output at any time, that is
t
yt (t) = Cxt (t)
 Clock y
= y (t), for all t $ t 0 = 0. Time
(37)
u = -Fxt xl = Ax + Bu y
y
This appears to be a new result y = Cx + Du
not previously observed in en- System System
L + L1K1
Output
gineering literature. Hence, the u = -Fxt y Gain1
system output and full-order
observer output can be com- xhat
pared as in the block diagram
in Figure 2(a) and (b) to define
uob = u
yQU $
qt = Aqqt + QBq KqUuob qt
L1
+ xt
xt
qt = Iqt + Q0Uuob +
the output-observation error Add Observer
Reduced Observer Gain
signal. However, in the case of Output
the system reduced-order con- xt
-F
figuration y (t) - yt (t) produces
signal equal to zero at all times. System
Feedback Gain
Like in the case of the full- (b)
order observer design, the
designer is faced with two Figure 5 (a) A Simulink implementation of the system-observer configuration, the actual block dia-
fundamental problems: how gram produced by Simulink. Note that the triangular blocks representing a product of a matrix and a
to choose the reduced-order vector have in Simulink the “Matrix ) vector” notation with the vector being denoted by u. The matrix
can be specified and hence changed, but u cannot be changed since it denotes by default all incom-
observer initial conditions and ing signals. (b) A Simulink implementation of the system-observer configuration, the edited Simulink
how to find the reduced-order block diagram, to improve clarity of the Simulink block diagram presented in (a) with labeling the
observer gain that stabilizes signal wires and to make signal notation consistent with the notation used in the article.

october 2015  «  IEEE CONTROL SYSTEMS MAGAZINE  97


Since the matrix C has full rank equal to c, the least-
squares solution for qt (t) is

L 1 dqt (0) = dxt (0) - (L + L 1 K 1) dy (0)


= 6^C T C h C T - (L + L 1 K 1)@ dy (0),
-1 
(39)

which produces

T
dqt (0) = (L 1 L 1)
-1
L T1 6(C T C) -1 C T - (L + L 1 K 1)@ dy (0) . (40)

It follows from (24) that L 1 has full rank equal to r, C 1 L 1 = I r,


r = n - c so that the corresponding inversion L T1 L 1 exists.
Equation (40) presents a novel theoretical result regarding
setting the reduced-order observer initial condition using the
least-squares method.

Setting Reduced-Order-Observer
Eigenvalues in the Desired Locations
As discussed in (9), good performance typically requires
placing the reduced-order observer eigenvalues such that
the reduced-order observer is roughly ten times faster
than the system whose speed is determined by the closed-
loop system eigenvalues given by m (A - BF) . Note that the
reduced-order observer matrix can be written as
Figure 6 A reduced-order observer state-space Simulink data-
input window. A q = C 1 AL 1 - K 1 CAL 1 = ^C 1 AL 1h - K 1 ^CAL 1 h . (41)

To determine the reduced-order observer gain K 1 such that


it arbitrarily places the reduced-order observer eigenvalues,
Reduced-Order-Observer the pair ^C 1 AL 1, CAL 1h must be observable. The next sub-
Design Process section will show that this condition is satisfied if the origi-
Step 1: Check the observability condition.
nal system is observable (the pair ^ A, C h is observable). See
Step 2: Find the closed-loop system eigenvalues.
“Reduced-Order-Observer Design Process” for details on
Step 3: S
 elect the closed-loop reduced-order observer
the steps involved in the design of this observer.
eigenvalues
Step 4: Find the reduced-order observer feedback gain.
Reduced-Order Observer Design
The corresponding Matlab code is given by:
with a Change of State Coordinates
% Step 1:
It is shown first in this subsection that a reduced-order observer
O=obsv(C1*A*L1,C*A*L1); rank(O);
can be also designed with a change of state coordinates. More
%% rank must be equal to r=n-c
importantly, with this change of state coordinates, it becomes
% Step 2:
easy to prove the result that if the original system is observable
lambda_sys=eig(A-B*F);
then the reduced-order observer is also observable.
%Step 3: input desired lambda_obs (reduced-
Consider a linear system with the corresponding mea-
% order observer eigenvalues)
surements defined in (4). The reduced-order observer de-
lambda_obs=input(‘input desired observer
sign can be simplified, and some important conclusions can
eigenvalues’)
easily be made using a nonsingular transformation P n # n
% Step 4:

Px (t) = ; E , (42)
K1T=place((C1*A*L1)’, (C*A*L1)’, lambda_ x 1 (t)

obs); K1=K1T’ x 2 (t)

such that

initial conditions of [15] [given in (19)] to the reduced-order


y (t) = Cx (t) = CP -1 Px (t) = CP -1 ; E
x 1 (t )
observer case. Equation (34) at the initial time t = 0 produces x 2 (t )

= 6I c 0@; E = x 1 (t),
x 1 (t )
t (0) = L 1 dqt (0) + (L + L 1 K 1) dy (0) . (38)
dx
(43)
x 2 (t )

98  IEEE CONTROL SYSTEMS MAGAZINE  »  october 2015


to map the system into new coordinates in which the where
system measurements provide complete information about a A z = A 22 - K 2 A 12,
part of the state-space vector x 1 (t) of dimension c. In such
B z = B 2 - K 2 B 1, 
a case, an observer is needed to estimate the remaining
K z = A 21 - K 2 A 11 + ^ A 22 - K 2 A 12 h K 2 . (51)
part of the state-space vector, that is, x 2 (t) of dimen-
sion r = n - c. This is possible since there exists a trans- The expression for dynamics of the estimation error can
formation P of the full-rank matrix C, obtained using be obtained from the observation error definition, that is,
elementary transformations, such that CP -1 = 6I c 0@ . eo 2 (t) = xo 2 (t) - xto 2 (t), leading to
This procedure can be found in many standard lin-
ear algebra textbooks, for example [16]. Such a trans- eo 2 (t) = ^ A 22 - K 2 A 12 h e 2 (t), (52)
formation is defined in (24) with P -1 = 6L L 1@ so that
CP -1 = C 6L L 1@ = 6CL CL 1@ = 6I 0@ . which indicates that the estimation error e 2 (t) decays to
In the new coordinates, the state transformation (42) zero if A 22 - K 2 A 12 is an asymptotically stable matrix.
produces The eigenvalues of matrix A 22 - K 2 A 12 can be arbitrarily
located via the feedback matrix K 2 if the pair ^ A T22, A T12 h is
; E =; E; E + ; E u ^ t h,
xo 1 (t) A 11 A 12 x 1 (t) B1 controllable, which by duality between controllability and
xo 2 (t) A 21 A 22 x 2 (t) B2 observability is equivalent to the requirement that the pair
x 2 ^t 0h = x 20 = unknown,  ^ A 22, A 12 h is observable. Below it is shown that having the
y^ t h = x 1 ^ t h. (44) pair ^ A, C h observable implies that the pair ^ A 22, A 12 h is
also observable.
Since x 1 (t) is directly measured at all times, its estimate is Using the Popov–Belevitch–Hautus observability test
xt 1 (t) = y (t) . An observer for x 2 (t) can be constructed in a [14], the pair ^ A, C h is observable if the following matrix
standard manner using the observer design principle: an has rank n for all eigenvalues of matrix A
observer has the same structure as the system plus a driving feed-

rank '; E1 = n, for all m i (A), i = 1, 2, ..., n. (53)


back term coming from the system measurements that carries A - mi I

information about the observation error, that is C

xto 2 (t) = A 21 x 1 (t) + A 22 xt 2 (t) + B 2 u (t) + K 2 (y (t) - yt (t)) . (45) Using the specific partitioning of matrices A and C as
given in (43) and (44), it follows that
But this design does not produce information about
e 2 (t) = x 2 (t) - xt 2 (t) since y (t) provides complete informa- A 11 - m i I c A 12
tion about x 1 (t) and no information about x 2 (t) . To obtain rank *> A 21 A 22 - m i I rH4 = n,

more information, it is necessary to know the derivative of Ic 0
y (t) . This derivative is for all m i (A), i = 1, 2, ..., n, (54)

yo (t) = xo 1 (t) = A 11 x 1 (t) + A 12 x 2 (t) + B 1 u (t), (46) which is due to the facts that the last c rows have rank c
and n = c + r. Equation (54) implies the following condition
so that the reduced-order observer measurements are
rank '; E1 = r, for all m i (A 22), i = 1, 2, ..., r, (55)
A 22 - m i I r
A 12
yto (t) = A 11 x 1 (t) + A 12 xt 2 (t) + B 1 u (t), 
so that the pair ^ A 22, A 12 h is observable by the direct appli-
(47)
and the reduced-order observer becomes cation of the Popov–Belevitch–Hautus observability test.
Hence, under the condition that the original full-order
xto 2 (t) = A 21 x 1 (t) + A 22 xt 2 (t) + B 2 u (t) + K 2 (yo (t) - yto (t)), system is observable, the reduced-order observer can be

yto (t) = A 11 y (t) + A 12 xt 2 (t) + B 1 u (t) . (48) constructed. The reduced-order observer gain should be
chosen such that the reduced-order observer eigenvalues
The need for yo (t) can be eliminated by introducing a new are placed far to the left, which causes that the estimation
variable error to quickly decay to zero.

zt 2 (t) = xt 2 (t) - K 2 y (t), (49) Extension to Kalman Filtering


By mastering the design of deterministic observers pre-
which produces the final form for the reduced-order sented in this article, more complex linear dynamic esti-
observer mation problems can also be considered, for example,
the Kalman filtering and other optimal linear estimation
zto 2 (t) = A z zt 2 (t) + B z u (t) + K z y (t), (50) problems [17]–[20]. In fact, the Kalman filter can also be

october 2015  «  IEEE CONTROL SYSTEMS MAGAZINE  99


implemented as a software program in Matlab/Simulink observer eigenvalues are placed at -10, -11 and the full-
using the methodology presented in this article. For a order observer eigenvalues are placed at -10, -11, -12,
linear dynamic system disturbed by a Gaussian white -13. Moreover, the reduced-order observer is simpler for
noise stochastic process w (t) and system measurements implementation, since it is a dynamic system of lower
corrupted by a Gaussian white noise stochastic process order than the original system. An additional advantage
v (t) . of the reduced-order observer is that they require fewer
sensors and fewer feedback loops for corresponding
xo (t) = Ax (t) + Bu (t) + Gw (t), feedback control applications.

y (t) = Cx (t) + v (t), (56) The importance of Matlab/Simulink implementation
of the full- and reduced-order observers has been demon-
the Kalman filter is given by [17]–[20] strated in the previous sections of this article. These results
can be used in all areas of science and engineering. For ex-
ample, Matlab/Simulink simulation and implementation of
xto KF (t) = ^ A - KC h xt KF (t) + Bu (t) + K KF y (t), (57)
switching converters and power converters is nicely dem-
onstrated in [21]–[22].
which is exactly the same structure as the full-order
observer structure presented in (15). The Kalman filter gain
K KF and the Kalman filter initial conditions must be chosen
using results from optimal Kalman filtering theory. Matlab Program for the Aircraft
Simulation Example
Full- and reduced-order observer % n=system order; m=number inputs;
designs for an aircraft model % l=number of outputs; c=rank of the output
The state-space matrices for an aircraft model are [7] matrix
n=4; m=1; l=2; c=2;
R -0.01357 -32.2 -46.3 0 V
S W A=[-0.01357 -32.2 -46.3 0;
S 0.00012 0 1.214 0 W 0.00012 0 1.214 0;
A =S
-0.0001212 0 -1.214 1 W,
SS W -0.0001212 0 -1.214 1;
T 0.00057 0 -9.1 -0.6696WX
0.00057 0 -9.1 -0.6696]
R -0.433 V
S W B=[-0.433;0.1394;-0.1394;-0.1577]
S 0.1394 W
B =S , C=[0 0 0 1;
-0.1394W
SS WW 1 0 0 0];
T-0.1577X D=[0;0]
C =; E,
0 0 0 1
x0=[2;2;2;2];
1 0 0 0
lambdaSystemDesired=[-0.5, -1+j*1, -1-j*1, -2]
D = ; E.
0
F=place(A,B,lambdaSystemDesired)
0
lambdaObsDesired=[-10 -11 -12 -13];
Matrix C 1 needed for the reduced-order observer design KT=place(A’,C’,lambdaObsDesired);
is chosen as K=KT’

C1 = ; E.
0 1 0 0 % Reduced-order Observer Design
0 0 1 0 C1=[0 1 0 0;0 0 1 0];
Caug=[C;C1]; Laug=inv(Caug);
See “Matlab Program for the Aircraft Simulation Exam- L=Laug(1:n,1:c); L1=Laug(1:n,c+1:n)
ple” for the corresponding Matlab program with all lambda_red_obs=[-10 -11];
simulation data. The obtained differences between the K1T=place((C1*A*L1)’,(C*A*L1)’,lambda_red_
actual and estimated state trajectories using the full- and obs);
reduced-order observers are presented in Figures 7 and K1=K1T’
8. In both cases, the initial conditions for the observers Aq=C1*A*L1-K1*C*A*L1;
are obtained using the least-squares formulas (19) and Bq=C1*B-K1*C*B;
(40). It can be seen from Figures 7 and 8 that the reduced- Kq=C1*A*L1*K1+C1*A*L-K1*C*A*L-K1*C*A*L1*K1;
order observer performs better than the full-order % Least-Squares Choices for Initial Conditions
observer. Not only are there no observation errors for the y0=C*x0;
two state variables directly measured, but the reduced- x0hat=pinv(C’*C)*C’*y0;
order observer is also more accurate than the full-order x0hat_reduced=inv(L1’*L1)*L1’*(pinv(C’*C)
observer. Note that the eigenvalues for both observers *C’-(L+L1*K1))*y0;
are placed to be of the same speed. The reduced-order

100  IEEE CONTROL SYSTEMS MAGAZINE  »  october 2015


2
3 e1
e2
2 e3
1.5 e4

Reduced-Order Observer
1
Full-Order Observer
Observation Errors

Observation Errors
0 1
-1
e1
-2 e2 0.5
e3
-3 e4
0
-4
-5 -0.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (s) Time (s)

Figure 7 Full-order observer estimation errors e (t) = x (t) - xt (t) for Figure 8 Reduced-order observer estimation errors x (t) - xt (t) with
the aircraft example. xt (t) obtained from (34) for the aircraft example.

Conclusions References
In this tutorial, It has been shown in detail how to implement [1] N. Nise, Control Systems Engineering. Hoboken, NJ: Wiley, 2008.
[2] R. Stefani, C. Savant, B. Shahian, and G. Hostetter, Design of Feedback
full- and reduced-order observers in Matlab/Simulink. The Control Systems. Orlando, FL: Saunders College Publishing, 1994.
corresponding fundamental derivations and results have [3] G. Franklin, J. Powel, and A. Emami-Naeini, Feedback Control of Dynamic
been presented. This presentation can inspire undergradu- Systems. Upper Saddle River, NJ: Prentice Hall, 2002.
[4] R. Dorf and R. Bishop, Modern Control Systems. Upper Saddle River, NJ:
ate and graduate students to further study observers and use Pearson Education, 2005.
them as powerful tools for observing system dynamics and/ [5] K. Ogata, Modern Control Engineering. Upper Saddle River, NJ: Prentice
or designing feedback control loops. Hopefully, control engi- Hall, 2002.
[6] S. Shinners, Modern Control Systems Theory and Design. New York: Wiley,
neers will use observers more often in practice because they 1992.
are easily implemented on personal computers. [7] Z. Gajic and M. Lelic, Modern Control Systems Engineering, London, U.K.:
Prentice Hall, 1996.
[8] B. Friedland, Control Systems Design: An Introduction to State Space Meth-
Author Information ods. Mineola, NY: Dover Publications, 2005.
Verica Radisavljevic-Gajic (verica.gajic@villanova.edu) re- [9] F. Fairman, “A pedagogical approach to minimal order observers,” IEEE
ceived her doctoral degree from Rutgers University, Depart- Trans. Educ., vol. 33, no. 3, pp. 268–269, 1990.
[10] Z. Gajic, Linear Dynamic Systems and Signals. Upper Saddle River, NJ:
ment of Mechanical and Aerospace Engineering, under the Prentice Hall, 2003.
direction of Prof. Haim Baruh in modeling and control of [11] D. Luenberger, “Observing the state of a linear system,” IEEE Trans.
complex dynamic systems described by differential-algebra- Military Electron., vol. 8, no. 2, pp. 74–80, 1964.
[12] D. Luenberger, “Observers for multivariable systems,” IEEE Trans. Au-
ic equations. She held visiting professor positions at Rutgers tom. Contr., vol. 11, no. 2, pp. 190–197, 1966.
University and Lafayette College and a postdoctoral position [13] D. Luenberger, “An introduction to observers,” IEEE Trans. Autom. Con-
in systems biology. From 2009 to 2012 she was an assistant tr., vol. 16, no. 6, pp. 596–602, 1971.
[14] C.-T. Chen, Linear Systems: Analysis and Design. Oxford, U.K.: Oxford
professor of mechanical engineering at California State Uni- Univ. Press, 2012.
versity, Los Angeles (she was on leave at the American Uni- [15] C. D. Johnson, “Optimal initial condition for full-order observers,” Int.
versity of Sharjah, United Arab Emirates from 2010 to 2012). J. Control, vol. 48, no. 3, pp. 857–864, 1988.
[16] G. Strang, Introduction to Linear Algebra. Wellesley, MA: Wellesley Cam-
Since 2012 she has been Clare Boothe Luce Assistant Profes- bridge Press, 2009.
sor of Mechanical Engineering at Villanova University. She [17] A. Gelb, Applied Optimal Estimation. Cambridge, MA: MIT Press, 1974.
has four years of industrial experience in control systems. [18] D. Simon, Optimal State Estimation, Kalman, H Infinity, and Nonlinear Ap-
proaches. New York: Wiley-Interscience, 2006.
Her research interests are in modeling and control of com- [19] A. Sinha, Linear System: Optimal and Robust Control. Boca Raton, FL: CRC
plex dynamic mechanical systems and systems in biology Press Taylor and Francis Group, 2007.
and medicine. One of the main areas of her research focuses [20] M. Grewal and A. Andrews, Kalman Filtering: Theory and Practice with
MATLAB. New York: Wiley-IEEE Press, 2014.
on control of distributed-parameter systems (with applica- [21] J.-H. Su, J.-J. Chen, and D.-S. Wu, “Learning feedback controller design
tions to heat and beam equations). Recently, she has become of switching converters via MATLAB/SIMULINK,” IEEE Trans. Educ., vol.
interested in power and energy systems, particularly in dy- 45, no .4, pp. 307–315, 2002.
[22] V. Peres and J. Silva, “Teaching nonlinear modeling, simulation, and
namic models and control of proton exchange membrane control of electronic power converters using MATLAB/SIMULINK,” IEEE
fuel cells. She has published over 20 journal papers in the Trans. Educ., vol. 45, no. 3, pp. 253–261, 2002.
leading journals in these fields. 

october 2015  «  IEEE CONTROL SYSTEMS MAGAZINE  101

You might also like