Victor
Manuel Hernández-Guzmán andRamón Silva-OrtigozaAutomatic Control with
ExperimentsAdvanced Textbooks in Control and Signal
Processinghttps://doi.org/10.1007/978-3-319-75804-6_7
7. The State Variables
Approach
Victor Manuel Hernández-Guzmán1
andRamón Silva-Ortigoza2
(1)
Universidad Autonoma de Queretaro,
Facultad de Ingenieria, Querétaro, Querétaro, Mexico
(2)
Instituto Politécnico Nacional,
CIDETEC, Mexico City, Mexico
The design methods presented in Chaps.
5 and 6 constitute what is now known as
classical control. One of the features of classical control is that
it relies on the so-called input–output approach, i.e., the use of
a transfer function. This means that a transfer function is like a
black box receiving an input and producing an output, i.e., nothing
is known about what happens inside the black box. On the contrary,
the state variable approach allows us to study what happens inside
the system.
The study of the state variable approach
is a complex subject involving the use of advanced mathematical
tools. However, the aim in this chapter is not to present a
detailed formal exposition of this approach, but merely to present
the basic concepts allowing its application to control simple
plants. Thus, only controllable and observable, single-input
single-output plants are considered.
7.1
Definition of State Variables
Consider the following linear, constant
coefficients differential equations:
(7.1)
(7.2)
Note that each one of these differential equations has an effect on
the other. It is said that these differential equations must be
solved simultaneously. One useful way of studying this class of
differential equations is the state variables approach. The state
variables are defined as follows.
If the input u(t)
is known for all t ≥ t0, the state variables
are the set of variables the knowledge of
which at t = t0 allows us to compute the
solution of the differential equations for all t ≥ t0.
Note that this definition of the state
variables is ambiguous. Although this may seem to be a drawback, it
becomes an advantage because this allows us to select the state
variables that are most convenient. According to this, although
several criteria are proposed in the literature to select the state
variables, it must be understood that no matter how they are
selected they must be useful in solving the corresponding
differential equations at any future time. In this chapter, the
state variables are selected using the following criterion.
Criterion 7.1
Identify the unknown variable in each one of
the differential equations involved. Identify the order of each
differential equation and designate it as r. Select the state
variables as the unknown variable and its first r − 1
time derivatives in each one of the
differential equations involved. It is also possible to select some
of these variables multiplied by some nonzero constant.
It is common to use n to designate the number of state
variables. On the other hand, the
state is a vector whose components
are given by each one of the state variables. Hence, the state is a
vector with n components.
According to this criterion, the state variables selected for
equations (7.1), (7.2) are i,
θ, , i.e., n = 3 and the state is given as:
Using this nomenclature, the differential equations in
(7.1),
(7.2), can be
written as:
i.e.,:
, which can be rewritten in a compact form as:
On the other hand, it is common to use y to represent the output to be
controlled. It must be stressed that the state x consists variables that are internal to
the system; hence, in general, they cannot be measured. On the
contrary, the output y is a
variable that can always be measured. If the output is defined as
the position, i.e., if y = θ = x2, then:
The set of equations:
(7.3)
(7.4)
is known as a linear, time invariant, dynamical equation (A, B, and C are constant matrices and vectors). The
expression in (7.3) is known as the state equation
and the expression in (7.4) is known as the output equation .
Although the state equation in
(7.3) has been
obtained from a single input differential equation, i.e.,
u is an scalar, it is very easy
to extend (7.3) to the case where there are p inputs: it suffices to define
u as a vector with p components, each one of them
representing a different input, and B must be defined as a matrix with
n rows and p columns. On the other hand, it is also
very easy to extend the output equation in (7.4) to the case where
there are q outputs: merely
define y as a vector with
q components, each one
representing a different output, and C must be defined as a matrix with
q rows and n columns.
Note that a state equation is composed
of n first-order differential
equations. A property of (7.3), (7.4), i.e., of a linear, time invariant
dynamical equation, is that the right-hand side of each one of the
differential equations involved in (7.3) is given as a linear
combination of the state variables and the input using constant
coefficients. Also note that the right-side of (7.4) is formed as the
linear combination of the state variables using constant
coefficients.
A fundamental property of linear, time
invariant dynamical equations is that they satisfy the superposition principle , which is reasonable as this class of state
equations is obtained, as explained above, from linear, constant
coefficients differential equations, which, according to Sect.
3.7, also satisfy the superposition
principle.
Example 7.1
Consider the mechanical system shown
in Fig. 7.1.
The corresponding mathematical model was obtained in Example
2.4, Chap. 2, and it is rewritten here for ease
of reference:
(7.5)
(7.6)
Note that there are two second-order differential equations. This
means that only four state variables exist: the unknown variable in
each one of these differential equations, i.e., x1 and x2, and the first time
derivative of each one of these unknown variables, i.e.,
and :
Fig.
7.1
Mechanical system
Using this nomenclature, the differential equations in
(7.5),
(7.6), can be
rewritten as:
i.e.,:
(7.7)
Hence, the following state equation is obtained:
(7.8)
On the other hand, the output equation depends on the variable to
be controlled. For instance, if it is desired to control the
position of mass 1, then:
but, if it is desired to control position of mass 2, then:
Example 7.2
A mechanism known as ball and beam is
studied in Chap. 14. In that chapter, the
corresponding mathematical model is obtained and presented in
(14.8). This model is rewritten here
for ease of reference:
Using the inverse Laplace transform, the corresponding differential
equations can be obtained, i.e.,:
(7.9)
As there are two second-order differential equations, then there
are four state variables: the unknown variable in each differential
equation, i.e., x and
θ, and the first time
derivative of each unknown variable, i.e., and :
Using this nomenclature, the differential equations in
(7.9) can be
rewritten as:
i.e.,:
(7.10)
Hence, the following state equation is obtained:
(7.11)
As explained in Chap. 14, the variable to be controlled is
x; thus, the output equation is
given as:
7.2 The
Error Equation
Consider a linear state equation of
the form:
The control objective for this plant can be stated by defining a
constant desired state vector x∗ and ensuring that lim t→∞x(t) = x∗. This means that
x(t) must converge to the constant
x∗, which implies
that , i.e., the control problem has a
solution if, and only if, there is a pair (x∗, u∗) such that:
(7.12)
where u∗ =lim
t→∞u(t)
is also a constant. The pair (x∗, u∗)
is known as the operation point. The error state vector is defined
as e = x − x∗ and it is clear that the control objective can be
restated as lim t→∞e(t) = 0. To analyze the evolution of
e(t), i.e., to find the conditions ensuring
that the above limit is satisfied, it is important to have a state
equation in terms of the state error. In the following examples, it
is shown how to proceed to obtain this equation, which is known as
the error equation.
Example 7.3
Consider the ball and beam system
studied in Example 7.2. The system state equation is given in
(7.11).
However, to obtain the error equation, the expression in
(7.10) is
more convenient, i.e.,:
Mimicking (7.12), to obtain the possible operation points,
find all possible solutions of:
It is clear that:
where c is any real constant
because no constraint is imposed on . Once the operation points
(z∗, u∗) are defined, the error
state is given as:
(7.13)
The error equation is obtained differentiating the error state
once, i.e.,:
From the last expression, u∗ = 0, and (7.13), we have:
Thus, defining v = u − u∗, the error equation can be written as:
Consider the mechanical system in
Example 7.1.
The corresponding state equation is given in (7.8). However, to obtain
the error equation, it is preferable to consider (7.7), i.e.,:
Mimicking (7.12), to obtain the possible operation points
find all the possible solutions of:
i.e., , , and the solutions of:
Solving these expressions, it is found that the operation points
are given as:
(7.14)
where c is any real constant.
Once the operation points (x∗, u∗)
are defined, the error state is given as:
(7.15)
The error equation is obtained differentiating the error state
once, i.e.,:
Adding and subtracting terms and in the third row and fourth row
respectively of the last expression and using (7.14), (7.15), yields:
Thus, defining v = u − u∗, the error equation can be written as:
7.3
Approximate Linearization of Nonlinear State Equations
Nonlinear state equations are
frequently found. These are state equations given as:
(7.16)
where at least one the of functions fi (x, u), i = 1, …, n, is a scalar nonlinear function of
x or u, i.e., this function cannot be written
as a linear combination of the components of x or u. For instance, in a state equation with
three state variables and two inputs:
It is important to stress that the notation fi (x, u)
means that the i −th component
of vector f is in general a
function of the components of the state vector x and the input vector u. However, as shown in the previous
examples, it is not necessary for fi (x, u)
to be a function of all the state variables and all the inputs.
Moreover, it is also possible that fi (x, u)
is not a function of any state variable, but it is a function of
some of the inputs and vice versa. A state equation of the form
(7.16)
possessing the above features is known as a nonlinear time
invariant state equation , i.e., it has no
explicit dependence on time.
The study of nonlinear state equations
is much more complex than the study of linear state equations.
However, most physical systems are inherently nonlinear, i.e.,
their models have the form given in (7.16). Hence, suitable
analysis and design methodologies must be developed for this class
of state equations. One of the simplest methods is to find a linear
state equation, such as that in (7.3), which is approximately equivalent to
(7.16). The
advantage of this method is that the linear state equations such as
that in (7.3)
can be studied much more easily. Hence, the analysis and design of
controllers for (7.16) are performed on the basis of the much
simpler model in (7.3). Although this method is very useful, it
must be stressed that its main drawback is that the results
obtained are only valid in a small region around the point where
the linear approximation is performed. These ideas are clarified in
the following sections.
7.3.1
Procedure for First-order State Equations Without Input
Consider a nonlinear first-order
differential equation without input:
(7.17)
where x is a scalar and
f(x) is a scalar nonlinear function of
x. It is desired to obtain a
linear differential equation representing (7.17), at least
approximately. Define an equilibrium
pointx∗ of (7.17) as that value of
x satisfying f(x∗) = 0. According to (7.17), this means that at an equilibrium point
, i.e., the system can remain at
rest at that point
forever.
Suppose that f(x)
is represented by the curve shown in Fig. 7.2. The dashed straight
line h(x) is tangent to f(x)
at the point x∗.
Because of this feature, h(x)
and f(x) are approximately equal for values of
x that are close to x∗, i.e., if x − x∗≈ 0. However, the difference between h(x)
and f(x) increases as x and x∗ become far apart, i.e.,
for large values of x − x∗. Hence, h(x)
can be employed instead of f(x)
if x is constrained to only
take values that are close to x∗. In Fig. 7.2, it is observed that:
where the constant m represents
the slope of h(x), i.e., the derivative of f(x)
evaluated at the equilibrium point x∗. Then, from the first
expression:
(7.18)
and, as h(x) ≈ f(x),
it is possible to write:
As x∗ is an
equilibrium point, then f(x∗) = 0 and:
Defining the new variable z = x − x∗, then , because . Hence, the linear approximation of
(7.17) is
given by:
(7.19)
, which is valid only if x − x∗≈ 0. Once (7.19) is employed to compute z, the definition z = x − x∗ can be used to obtain x as the equilibrium point x∗ is known. Finally, note
that the only requirement for all the above to stand is that
exists and is continuous, i.e., that
f(x) is, at least once, continuously
differentiable.
Fig.
7.2
Approximation of a nonlinear function
f(x) using a straight line h(x)
7.3.2
General Procedure for Arbitrary Order State Equations with an
Arbitrary Number of Inputs
Now consider the state equation:
(7.20)
where x ∈ Rn is a vector with n components and u ∈ Rp is a vector with
p components standing for the
state equation input. Note that f(x,
u) must be a vectorial function
with n components. This means
that (7.20)
has the form defined in (7.16). In this case, it is preferable to employ
the concept of operation point
instead of equilibrium point
because the latter concept is only defined for state equations
without inputs. An operation
point is defined as the pair
(x∗, u∗) satisfying f(x∗, u∗) = 0. This means that the solution of the state
equation can remain at rest at
x∗, because
, if the suitable inputs u∗ (p inputs) are applied, which are also
constant.
Note that f(x,
u) depends on n + p
variables. Define the following vector:
with n + p components. Then (7.20) can be written as:
(7.21)
Following the ideas in the previous section, it is desired to
approximate the nonlinear function f(y)
by a function h(y) that is tangent to f(y)
at the operation point y∗ defined as:
Extending the expression in (7.18) to the case of n + p
variables, it is possible to write:
where is a constant matrix defined as:
Taking advantage of f(y) ≈ h(y),
(7.21) can be
approximated as:
As f(y∗) = f(x∗, u∗) = 0 and , because , the following is found:
(7.22)
(7.23)
(7.24)
where z = x − x∗ and v = u − u∗ have been defined. The expressions in (7.22), (7.23), (7.24) constitute the
linear approximate model
employed in the analysis and design of
controllers for the nonlinear system in (7.20). Note that this
linear approximate model is valid only if the state x and the input u remain close to the operation point
(x∗, u∗), i.e., only if z = x − x∗≈ 0 and v = u − u∗≈ 0. From a practical point of view, it is commonly
difficult to determine the values of x and u satisfying these conditions; hence,
they are employed heuristically. Finally, note that the only
requirement for all the above to stand is that all the partial
derivatives defining the matrices A and B exist and are continuous, i.e., that
f(x, u)
is, at least once, continuously differentiable.
Example 7.5
In Fig. 7.3, a simple pendulum is
shown. In Example 2.6, Chap. 2, it was found that the
corresponding mathematical model is given by the following
nonlinear differential equation:
(7.25)
The feature that renders this differential equation nonlinear is
the function representing the effect of gravity.
As it is a second-order differential equation, then only two state
variables exist: the unknown θ
and its first-time derivative :
Using this nomenclature, the differential equation in (7.25) can be written as:
i.e.,
Hence, the following state equation is found:
Note that in this case, it is not possible to obtain the linear
form because of the function . To obtain a linear approximation for
this nonlinear state equation, the operation points are first
obtained, i.e., those pairs (x∗, u∗)
satisfying f(x∗, u∗) = [0 0] T :
From this, the following is found:
This means that the input at the operation point depends on the
pendulum position at the operation point. This is because, to
maintain the pendulum at rest, it is necessary to have an input
that exactly compensates for the effect of gravity. To continue, a
particular value for must be selected. Two cases are
considered here:
When , , u∗ = 0. Using (7.22), (7.23), (7.24), the following is
found:
where z = x − x∗ = x and v = u − u∗ = u have been
defined. Note that, according to this state equation:
Combining these first-order differential equations the following
linear, second-order differential equation with constant
coefficients is obtained:
(7.26)
This differential equation can be analyzed using the concepts
studied in Sects. 3.3 (complex conjugate roots with a
negative or zero real part), 3.4.2 (real and repeated negative
roots) and 3.4.1 (real, different and negative
roots), Chap. 3, as it corresponds to a
differential equation with the form:
where:
with ζ ≥ 0, ωn > 0 and k > 0 because m > 0, g > 0, l > 0 and b ≥ 0.
When , , u∗ = 0. Using (7.22), (7.23), (7.24), the following is
found:
where and v = u − u∗ = u have been
defined. Note that this state equation implies:
Combining these first-order differential equations the following
linear, second-order differential equation with constant
coefficients is obtained:
(7.27)
This differential equation can be analyzed using the concepts
studied in Sect. 3.4.1, Chap. 3 (real, different roots, one
positive and the other negative, see Example 3.11) as it corresponds to a
differential equation of the form:
where:
Note that, according to (7.26) and Sect. 3.3, Chap. 3, the pendulum oscillates with a
natural frequency given as when operating around , , u∗ = 0. This means that a
longer pendulum oscillates slower whereas a shorter pendulum
oscillates faster. These observations are useful, for instance,
when it is desired to adjust the rate of a clock that leads or lags
in time. Moreover, rearranging (7.26) the following is found:
(7.28)
According to Example 2.5, Chap. 2, which analyzes the rotative
spring-mass-damper system shown in Fig. 7.4, (7.28) means that factor
K = mgl > 0 is equivalent to the stiffness
constant of a spring because of the effect of gravity.
Fig.
7.3
Simple pendulum
Fig.
7.4
A rotative spring-mass-damper system
On the other hand, using similar
arguments, it is observed that, rearranging (7.27):
When the pendulum operates around , , u∗ = 0, it behaves as a
mass-spring-damper system possessing a negative stiffness constant
K = −mgl < 0. This can be seen as follows.
A positive stiffness constant K > 0 indicates that the force exerted
by the spring is always in the opposite sense to its deformation
and, because of that, the spring forces the body to move back to
the point where the spring is not deformed. This is the reason why
the pendulum oscillates around , , u∗ = 0. On the other hand,
because of the sign change, in a spring with a negative stiffness
constant K < 0, the opposite
must occur, i.e., the force exerted by the spring must now be
directed in the same sense as the deformation. This means that the
deformation of a spring with K < 0 forces the deformation to
increase further, i.e., the body moves away from the point where
the spring deformation is zero (i.e., where z1 = 0). This is exactly what
happens to a pendulum around , , u∗ = 0: if z1 ≠ 0 then the gravity
forces the pendulum to fall; hence, to move away from z1 = 0, i.e., where
. This behavior is the experimental
corroboration of what is analytically demonstrated by a
characteristic polynomial with a positive root: the operation
points , , u∗ = 0 are unstable.
Note that using the above methodology, a
linear approximate model of a nonlinear system is already given in
terms of the equation error introduced in Sect. 7.2. The reader is
referred to Sect. 13.2, Chaps. 13, Sect. 15.3, Chap. 15, and Sect. 16.4, Chap. 16, to see some other examples of how
to employ (7.22), (7.23), (7.24), to find linear approximate state
equations for nonlinear state equations.
7.4 Some
Results from Linear Algebra
Some results that are useful for
studying the state variables approach are presented in this
section.
Let
w1, w2, …, wn, be n vectors with n components. These
vectors are linearly dependentif, and only if, there exist n
scalars α1, α2, …, αn, not all zero such that:
(7.29)
where
zero at the right represents a vector with n zero components. If
the only way of satisfying the latter expression is that α1 = α2 = ⋯ = αn = 0, then it is said that w1,
w2, …, wn,
are linearly independent vectors .
In the simplest version of the linear
dependence of vectors, two vectors with two components are linearly
dependent if they are parallel. This can be shown as follows. Let
w1 and w2 be two vectors, each one
having n = 2 components. These
vectors are linearly dependent if there are two constants
α1 ≠ 0 and
α2 ≠ 0 such that:
which means that:
Note that α1 cannot
be zero for obvious reasons. On the other hand, if α2 is zero, then w1 = 0 is the only solution
in this case that is not of interest. Hence, it is assumed that
both α1 ≠ 0 and
α2 ≠ 0. Thus, as
the factor is a scalar (positive or negative),
the above means that w1 and w2
are vectors with the same direction, i.e., they are
parallel.1
In the case of three or more vectors,
linear dependence means that one of vectors can be computed as the
addition of the other vectors when suitably affected by factors
αi (this is what is known as a
linear combination of vectors), i.e.,:
is directly obtained from (7.29) when n = 3 and α1 ≠ 0. As n = 3, the above means that w1, w2 and w3 are in the same plane,
which is embedded in a volume (in R3), i.e., that the linear
combination of w1,
w2 and w3 does not allow another
vector to be obtained that is not contained in the same plane.
According to this, three vectors with three components are linearly
independent if their linear combination spans three dimensions.
Thus, the linear combination of n linearly independent vectors (with
n components) spans an
n −dimensional space. The
linear combination of n
linearly dependent vectors (with n components) spans a space with fewer
than n dimensions.
where
w1, w2, …, wn, are n column with n components. The vectors
w1, w2, …, wnare linearly independent if, and only if,
matrix E is nonsingular, i.e., if, and only if, the determinant of E
is different from zero ().
To explain this result, the following is
employed.
Consider
an n × n matrix E. The only
solution of Ew = 0, where w
represents an n −dimensional
vector, is w = 0 if, and only
if, matrix E is nonsingular.
According to Fact 7.3, the vector [α1α2 … αn ] = [0 0 … 0] is the only
solution of this homogeneous system if, and only if, the matrix
E = [w1w2 … wn ] is nonsingular. This implies
that the vectors w1, w2,
…, wn are linearly independent if, and
only if, .
The rank
of an n × n matrixE is the
order of the largest nonzero determinant obtained as submatrices of
E. The rank of E is n if, and only if, E is nonsingular. The
inverse matrix E−1exists if, and only if, the matrix E is
nonsingular [2], chapter
10.
The
eigenvaluesof an n × n matrix E are those scalars λ
satisfying:
where I
stands for the n × n identity
matrix. The expressionis a
n −degree polynomial in the
variable λ and it is known as the characteristic polynomial of the
matrix E. The eigenvalues of a matrix E can be either real or
complex numbers. Matrix E has exactly n eigenvalues, which can be
repeated.
Ifis any
determinant andis the
determinant whose rows are the columns of,
then.
According to the above, can be computed using, for instance,
the first column of matrix λI − E, whereas can be computed using, for instance,
the first row of matrix λI − F. Note that the first column of
λI − E is equal to the first row of λI − F as (λI − E) T = λI − F because F = ET . Similarly, the
rows of the cofactor of entry at row i and column 1 in matrix λI − E are equal to the columns of the
cofactor of entry at row 1 and column i in matrix λI − F. This shows that E and F have the same characteristic
polynomial, i.e.,:
; thus, the eigenvalues of F
are identical to those of E.
7.5 Solution
of a Linear Time Invariant Dynamical Equation
Finding the solution of the dynamical
equation:
(7.33)
(7.34)
is a complex problem requiring the knowledge of advanced linear
algebra and calculus concepts that are outside the scope of this
book. However, the fundamental ideas that are involved in the
corresponding procedure can be understood if resorting to the
solution procedure of the following first-order differential
equation:
Use of the Laplace transform yields:
where X(s), U(s),
stand for Laplace transforms of x and u respectively. This can be written as
follows:
The solution of the state equation in
(7.33) is
similar to this last equation and we just need to use matrix
notation, i.e., the solution of (7.33) is [1], pp.
142:
(7.37)
where e At is an
n × n matrix2 and it is explained in the
following how it is given.
If λ is a (positive, negative or zero) real
nonrepeated eigenvalue of matrix A, then at least one of the entries of
matrix e At includes
the following function of time:
where c is a real
constant.
If λ is a (positive, negative or zero) real
and r times repeated eigenvalue
of matrix A, then each one of
the following functions of time:
where ck , k = 1, 2, …, r − 1, are real constants, are included
in at least one of the entries of matrix e At .
If λ = a ± jb is a nonrepeated complex eigenvalue of
matrix A, where , a is a (positive, negative or zero) real
number and b is a strictly
positive real number, then each one of the following functions of
time:
where c and d are real constants, are included in at
least one of the entries of matrix e At .
If λ = a ± jb is a complex eigenvalue of matrix
A that repeats r times, where , a is a (positive, negative or zero) real
number and b is a strictly
positive real number, then each one of the following functions of
time:
(7.38)
where ck and dk , k = 1, 2, …, r − 1, are real constants, and included
in at least one of the entries of matrix e At .
Finally, the output of the dynamical equation in (7.33), (7.34), is computed using
(7.37),
i.e.,:
(7.39)
7.6
Stability of a Dynamical Equation
It is important to study the stability
of the following dynamical equation without input:
(7.40)
where x ∈ Rn , y ∈ R, E
is an n × n constant matrix and C is a constant row vector with
n components. Although a
dynamical equation without input may seem unrealistic, it is shown
in Sect. 7.11
that a closed-loop dynamical equation can be written as in
(7.40),
because in a feedback system the input is chosen as a function of
the state, i.e., u = −Kx
where K is a row vector with
n components. Then, replacing
this input in (7.33) and defining E = A − BK, (7.40) is retrieved. This is the main motivation
for studying this dynamical equation without input.
Although a formal definition of
stability of (7.40) is elaborated, it
can be simplified, stating that the dynamical equation
(7.40) is
stable if lim t→∞x(t) = 0 (hence, lim t→∞y(t) = 0) for any initial state x(0) ∈ Rn . This means that, if:
then lim t→∞xi (t) = 0 for all i = 1, 2, …, n, for any initial state. According to
the solution in (7.37), the solution of (7.40) is obtained by
defining u = 0 and A = E
in (7.37),
i.e.,:
As x(0) is a constant vector,
the latter expression implies that, to satisfy lim t→∞x(t) = 0, then lim t→∞ e Et = 0 where “0” stands for an
n × n matrix all of whose entries are equal
to zero. Recalling how the entries of matrix e At , A = E, are given (see the the previous
section) the following is proven:
The
solution of (7.40) satisfies lim t→∞x(t) = 0, no
matter what the initial state x(0) is, if, and only if, all eigenvalues of matrix
E have a strictly negative real part. Under these conditions, it is
said that the origin x = 0 of (7.40) is
globally asymptotically stable.
Recall that in Sect. 3.4.2, Chap. 3, it has been proven that:
for any integer j > 0 and
any real number p < 0.
The reader may wonder why it is of
interest to ensure that lim t→∞x(t) = 0 in a practical control problem. To
answer this question is important to stress that the above result
is very important if the dynamical equation without input given in
(7.40)
represents the error equation (see Sect. 7.2) of the closed-loop
system. In such a case, the state x represents the error state and, as
explained in Sect. 7.2, ensuring that the state error converges to
zero implies that the plant state converges to its desired
value.
7.7
Controllability and Observability
Two important properties of the
dynamical equation:
(7.41)
(7.42)
that are employed throughout this chapter are controllability and
observability.
A state equation is controllable
at t0 if there
exists a finite time t1 > t0 such that given any states x0 and x1 exists and input
u that is applied from
t = t0 to t = t1 transfers the state from x0 at t = t0 to x1
at t = t1. Otherwise, the state
equation is not controllable.
Note that this definition does not
specify the trajectory to be tracked to transfer the state from
x0 to x1. Furthermore, it is not
necessary for the state to stay at x1 for all t > t1. Also note that
controllability is a property that is only concerned with the
input, i.e., with the state equation, and the output equation is
not considered. Finally, this definition is very general as it also
considers the possibility that the state equation is time variant,
i.e., that the entries of A and
B are functions of time.
In the case of a time-invariant state
equation, such as that shown in (7.41), i.e., when all entries of A and B are constant, if the state equation is
controllable then it is controllable for any t0 ≥ 0 and t1 is any value such that
t1 > t0. This means that the
transference from x0 to x1
can be performed in any nonzero time interval. This allows us to
formulate a simple way of checking whether a state equation is
controllable:
The
state equation in (7.41) is
controllable if, and only if, any of the following equivalent
conditions are satisfied (see Exercises10and11at the end
of this Chapter):
1.
The
following n × n matrix:
(7.43)
is nonsingular for any
t > 0.
2.
The
n × n controllability
matrix:
(7.44)
has rank n, i.e., its determinant is
different from zero.
The reason for this result can be
explained as follows. The following input:
(7.45)
transfers the system state from x0 = x(0) at t0 = 0 to x1 at t1 > 0. This can be
verified by replacing in the solution shown in (7.37) but evaluated at
t = t1, i.e.,:
the input in (7.45) but evaluated at t = τ, i.e.,:
to obtain:
Note that this result needs the n × n
matrix Wc (t), defined in (7.43), to be nonsingular,
which is true for any t1 = t > 0 if the
state equation is controllable. The fact that t1 is any positive time means
that the state may go from x0 to x1
in any nonzero time interval.
On the other hand, the equation in
(7.43) can be
corroborated as follows. Defining v = t − τ:
which corroborates equation in (7.43) if τ
is used instead of v in last
integral, which is valid because the use of v or τ as the integration variable in the last
integral does not affect the result.
Finally, the fact that the rank of
matrix in (7.44) is n
and the nonsingularity of Wc (t) are equivalent conditions is very
useful because it is easier to verify that (7.44) has rank n than the nonsingularity of Wc (t).
A dynamical equation is observable at
t0 if there is a
finite t1 > t0 such that for any unknown state x0 at t = t0, the knowledge of the input u and the output y on the time interval [t0, t1] suffices to uniquely
determine the state x0. Otherwise the dynamical equation is not
observable.
Note that observability is a property
that is concerned with the possibility of knowing the system state
(a variable that is internal to the system) only from measurements
of the variables that are external to the system, i.e., the input
and the output. Also note that this definition is very general as
it also considers the possibility that the dynamical system is time
variant, i.e., that the entries of A, B,
and C are functions of time. In
the case of a time invariant dynamical equation, such as that shown
in (7.41),
(7.42), with
constant entries of A,
B and C, if the dynamical equation is
observable, then it is observable for all t0 ≥ 0 and t1 is any time such that
t1 > t0. This means that the
determination of the initial state can be performed in any nonzero
time interval. This allows us to obtain a very simple way of
checking whether a dynamical equation is observable:
The
dynamical equation in (7.41),
(7.42), is
observable if, and only if,any of the following equivalent
conditions are satisfied:
1.
The
following n × n matrix:
(7.46)
is nonsingular for any
t > 0.
2.
The
n × n observability
matrix:
(7.47)
has a rank n, i.e., its determinant
is different from zero.
The reason for this result is
explained as follows. Consider the solution given in (7.39) and define:
(7.48)
(7.49)
Note that, according to (7.49), the function can be computed from the exclusive
knowledge of the input and the output. Multiplying both sides of
(7.48) by
and integrating on [0, t1] it is found that:
If the matrix Wo (t1) is nonsingular, which is
true if the system is observable, then the initial state x(0) = x0 can be uniquely computed
as:
Note that this result needs the n × n
matrix Wo (t) defined in (7.46) to be nonsingular,
which is true for any t1 = t > 0 if the
dynamical equation is observable. The fact that t1 is any positive time means
that the state x0
can be computed with information obtained from the input and the
output in any nonzero time interval.
Finally, the fact that the rank of
matrix in (7.47) is n
and the nonsingularity of Wo (t) are equivalent conditions is very
useful, as it is easier to check (7.47) to have rank
n than the nonsingularity of
Wo (t).
Example 7.6
One way of estimating the actual state
x(t) (not the initial state x(0)) is using input and output
measurements in addition to some of their time derivatives. It is
shown in the following that a necessary condition for this is,
again, that the matrix in (7.47) has the rank n. Consider the dynamical equation in
(7.41),
(7.42). The
first n − 1 time derivatives of
the output are computed as:
where the exponent between brackets stands for the order of a time
derivative. Using matrix notation:
where:
Thus, if the matrix in (7.47) has the rank n, then the n × n
matrix D is invertible and the
actual state can be computed as:
(7.50)
i.e., by only employing input and output measurements in addition
to some of their time derivatives. A drawback of (7.50) is that
measurements of any variable have significant noise content in
practice and this problem becomes worse as higher order time
derivatives are computed from these measurements. This is the
reason why (7.50) is not actually employed in practice to
compute x(t) and asymptotic methods such as that
presented in Sect. 7.12 are preferred.
7.8 Transfer
Function of a Dynamical Equation
Consider the following single-input
single-output dynamical equation:
(7.51)
where x ∈ Rn , u ∈ R, y ∈ R, are functions of time, A is an n × n
constant matrix, B is a
constant column vector with n
components and C is a constant
row vector with n components.
Applying the Laplace transform to (7.51), the following is
obtained:
(7.52)
(7.53)
where X(s), Y (s), U(s)
represent the Laplace transform of the state vector x, the scalar output y, and the scalar input u respectively, whereas x(0) is the initial value of the state
x. Recall that, given a
vectorial function of time x = [x1, x2, …, xn ] T , its Laplace transform is
obtained by applying this operation to each entry of the vector,
i.e., [3], chapter 4:
A transfer function is always defined assuming zero initial
conditions. Replacing x(0) = 0
in (7.52) and
solving for X(s):
(7.54)
where I represents the
n × n identity matrix. Replacing
(7.54) in
(7.53) it is
found that:
(7.55)
Note that the transfer function G(s)
given in (7.55) is a scalar. Now, proceed to analyze this
transfer function. In the following, it is assumed that n = 3 for ease of exposition of ideas,
i.e., that A is an 3 × 3
matrix, I is the 3 × 3 identity
matrix, and B and C are column and row vectors
respectively, with 3 components:
The reader can verify that the same procedure is valid from any
arbitrary n. First, compute the
matrix:
whose inverse matrix is given as where [2],
chapter 10:
(7.56)
with Cof(sI − A) the cofactors matrix of sI − A, and Cofij = (−1) i+jMij with Mij the (n − 1) × (n − 1) determinant (2 × 2 in this case)
resulting when eliminating the i −th row and the j −th column from the determinant of
matrix sI − A [2],
chapter 10. Explicitly computing these entries, it is realized that
Cofij is a polynomial in s whose degree is strictly less than
n = 3. On the other hand,
solving through the first row it is found that:
i.e., is a polynomial in s whose degree equals n = 3. From these observations, it is
concluded that all entries of the matrix:
(7.57)
are given as the division of two polynomials in s such that the degree of the polynomial
at the numerator is strictly less than n = 3 and the polynomial at the
denominator is , which has the degree n = 3.
On the other hand, the product
(sI − A)−1B is a column vector with n = 3 components. Each one of these
components is obtained as:
According to the previous discussion on the way in which the
entries Invij of matrix (sI − A)−1 are given, and resorting
to the addition of fractions with the same denominator, it is
concluded that each one of the entries di of the column vector (sI − A)−1B is also given as a division of two
polynomials in s such that the
polynomial at the numerator has a degree strictly less than
n = 3 whereas the polynomial at
the denominator is , whose degree equals n = 3. Finally, the following is found:
Reasoning as before, the following is concluded, which is valid for
any arbitrary n:
The
transfer function in (7.55) is a
scalar, which is given as the division of two polynomials in s such
that the degree of the polynomial at the numerator is strictly less
than n and the polynomial at the denominator, given as, has
the degree n, i.e.,
(7.58)
for some
real constants bk,
al, k = 0, 1, …, m, l = 0, 1, …, n − 1,
with n > m.
However, this statement is completely
true if the following is satisfied [1],
chapter 7:
Condition 7.1
The
dynamical equation in (7.51) must be
controllable, i.e., the determinant of the matrix in
(7.44)
must be different from
zero.
Moreover, if the following is also true,
then the polynomials bmsm + bm−1sm−1 + ⋯ + b1s + b0 and sn + an−1sn−1 + ⋯ + a1s + a0 have no common roots [1],
chapter 6:
Condition 7.2
The
dynamical equation in (7.51) is
observable, i.e., the determinant of the matrix in
(7.47)
is different from zero.
Finally, the reader can revise the
discussion presented above to verify that:
is the transfer function of the dynamical equation:
where x ∈ Rn , u ∈ R, y ∈ R, are functions of time, A is an n × n
constant matrix, B is a
constant column vector with n
components, C is a constant row
vector with n components, and
D is a constant scalar. This
means that the polynomials at the numerator and the denominator of
have the same degree in this
case.
Example 7.7
According to Chap. 10, the mathematical model of a
permanent magnet brushed DC motor is given as (see (10.8)):
when no external disturbance is present. Furthermore, the electric
current i∗ can be
considered to be the input signal if an internal high-gain electric
current loop is employed. Defining the state variables as the
position and the velocity, it is not difficult to realize that the
following dynamical equation is obtained:
(7.59)
where C is a row vector to be
defined later depending on the output to be considered. Note that
the following matrix:
has the rank n = 2 because its
determinant is equal to . From the definitions in
(7.59) the
following results are obtained:
To obtain the corresponding transfer function, the following cases
are considered:
The output is the position, i.e.,
y = θ = x1 = Cx, where
C = [1 0]. Then:
In this case, the matrix:
has the rank n = 2 because its
determinant is unity, i.e., it is different from zero.
The output is velocity, i.e.,
, where C = [0 1]. Then:
The following matrix:
has a rank less than n = 2
because its determinant is zero.
Note that in both cases the transfer function obtained satisfies
what was established in (7.58): the polynomial at the denominator is
equal to . Also note that this is true because
matrix [BAB] has the rank n = 2 in both cases. Finally, the effect
due to the fact that the system is not observable is also present:
in the second case the system is not observable; hence, the
corresponding transfer function has one pole and one zero, which
cancel each other out and this does not occur in the first case
because the system is observable. Such pole-zero cancellation in
the second case results in a first-order transfer function, which
means that only one of the states (velocity) is described by this
transfer function. This implies that the motor position has no
effect when velocity is the variable to control.
The above results are useful for
giving an interpretation of observability in the following. When
the output is the position, the system is observable because, once
the position is known, the velocity can be computed (the other
state variable) by position differentiation, for instance. But, if
the output is velocity, the knowledge of this variable does not
suffice to compute the position (the other state variable):
although it may be argued that the position θ(t)
can be computed by simple velocity integration, note that:
means that besides the knowledge of velocity, it is necessary to
know the initial position θ(0),
which is also unknown. Thus, the system is not observable when the
output is velocity. However, as previously stated, if controlling
the velocity is the only thing that matters, then this can be
performed without any knowledge of the position. Observability is
important in other classes of problems that are studied later in
Sects. 7.12
and 7.13.
Finally, the reader can verify the
correctness of the above results by comparing the transfer
functions obtained with those in Chaps. 10 and 11.
7.9 A
Realization of a Transfer Function
The realization of a transfer function
consists in finding a dynamical equation that describes the
transfer function in an identical way. The importance of this
problem arises, for instance, when a controller is given that is
expressed as a transfer function. Then, expressing a transfer
function in terms of a dynamical equation is important for
practical implementation purposes because the latter can be solved
numerically, for instance.
An important property of the state
variables representation is that it is not unique. This means that
several dynamical equations exist correctly describing the same
physical system. This also means that given a transfer function,
several dynamical equations exist correctly describing this
transfer function. In the following, a way of obtaining one of
these dynamical equations is presented. Consider the following
transfer function:
(7.60)
Solving for the output:
Define the following variable:
(7.61)
to write:
(7.62)
Applying the inverse Laplace transform to (7.61) and solving for the
highest order time derivative:
(7.63)
where . According to Sect. 7.1, define the state
variables as the unknown variable in (7.63), v, and its first n − 1 time derivatives:
On the other hand, using the inverse Laplace transform in
(7.62), the
following is obtained:
If it is assumed that m takes
its maximal value, i.e., m = n − 1 (recall that n > m) then (7.64) can be used to
write:
(7.66)
Using (7.64),
(7.65) and
(7.66), the
following can be written:
(7.67)
The dynamical equation in (7.67) represents identically the transfer
function in (7.60) and it is said that it is written in the
controllability canonical form
. As is shown later, the controllability
canonical form is very useful for finding a procedure for designing
a state feedback controller.
7.10
Equivalent Dynamical Equations
It has been shown in Sect. 7.8 that any controllable
single-input single-output dynamical equation (7.51) can be written as
the transfer function in (7.58). Note that requiring observability is
merely to ensure that no pole-zero cancellation is present in
(7.58). On
the other hand, it has been shown in Sect. 7.9 that the transfer
function in (7.58) can be written as the dynamical equation
in (7.67).
This means that any of the dynamical equations in (7.51) or (7.67) can be obtained
from the other, i.e., these dynamical equations are equivalent.
In the following, it is shown how to
obtain (7.51)
from (7.67)
and vice versa, without the necessity of the intermediate step of a
transfer function. Consider the single-input single-output
dynamical equation in (7.51) and define the following linear transformation :
(7.68)
where P is an n × n
constant matrix defined from its inverse matrix as [1],
chapter 7:
(7.69)
It is important to stress that the matrix P−1 is invertible, i.e., its
inverse matrix P always exists
if the matrix defined in (7.44) has the rank n [1],
chapter 7, or equivalently if (7.51) is controllable. This can be explained as
follows. If the matrix defined in (7.44) has the rank
n, i.e., all its columns are
linearly independent, then when adding its columns as in the
previous expressions defining vectors q1, …, qn−2, qn−1, qn , the columns q1, …, qn−2, qn−1, qn are linearly independent (see
fact 7.1).
This means that the determinant of P−1 is different from zero;
hence, its inverse matrix P
exists.
The matrix and the vectors , in (7.70) are given as in the
controllability canonical form (7.67) no matter what the particular form of
A, B and C is, as long as the matrix defined in
(7.44) has
the rank n. A formal proof for
this latter statement requires mathematical tools that are outside
of the scope of this book; hence, it is not presented. The reader
is advised to see [1] for a complete solution to this problem.
The reader can also verify these ideas by proposing numerical
values for the matrices A,
B, and C, and performing the corresponding
computations. The above means that each one of the dynamical
equations (7.51) and (7.67) can be obtained from the other and the
relationship among the matrices involved is given in (7.70), i.e., these
dynamical equations are equivalent. Note that the fundamental
condition for the existence of this equivalence is that the matrix
defined in (7.44) has the rank n [1],
chapter 5. This is summarized as follows:
If
(7.51)
is controllable, then this dynamical
equation is equivalent to (7.67) through
the linear transformation (7.68),
(7.69), i.e.,
through (7.70).
Example 7.8
The linear approximate model of a
mechanism known as the Furuta pendulum is obtained in Chap.
15. This model is presented in
(15.17), (15.18), and it is rewritten here for
ease of reference:
(7.71)
To render the algebraic manipulation easier, the following
constants are defined:
The following matrix has the form:
After a straightforward but long algebraic procedure, it is found
that:
Thus, the dynamical equation in (7.71) is controllable for any set of the Furuta
pendulum parameters. This result does not change if the mechanism
is large or small, heavy or light. This also means that the matrix
P introduced in (7.68) is nonsingular and
it is computed in the following using (7.69). To simplify the
computations, the following numerical values are employed:
Hence:
With these data, the roots of the characteristic polynomial
are found to be:
Then the following product is computed:
to find, by equating coefficients on both sides:
(7.72)
Using these values in (7.69) the following is found:
hence:
(7.73)
Finally, to verify (7.70), the following products are performed:
Note that these matrices have exactly the same form as that
presented in (7.67) for and . The above computations have been
performed by executing the following MATLAB code in an m-file:
clc
A=[0 1 0 0;
0 0 -35.81 0;
0 0 0 1;
0 0 72.90 0];
B=[0;
13.4684;
0;
-12.6603];
U=[B A∗B Aˆ2∗B Aˆ3∗B];
det(U)
v=eig(A)
f=conv([1 -v(1)],[1 -v(2)]);
g=conv(f,[1 -v(3)]);
h=conv(g,[1 -v(4)]);
a3=h(2);
a2=h(3);
a1=h(4);
a0=h(5);
q4=B;
q3=A∗B+a3∗B;
q2=Aˆ2∗B+a3∗A∗B+a2∗B;
q1=Aˆ3∗B+a3∗Aˆ2∗B+a2∗A∗B+a1∗B;
invP=[q1 q2 q3 q4]
P=inv(invP)
Ab=P∗A∗invP
Bb=P∗B
7.11 State
Feedback Control
In this section, it is assumed that the
plant to be controlled is given in terms of the error equation (see
Sect. 7.2),
i.e., given a plant as in (7.51), it is assumed that the state x stands for the state error. Hence, the
control objective is defined as ensuring that the state error tends
toward zero as time increases, i.e., lim t→∞x(t) = 0.
Consider the single-input state
equation in (7.51), in closed-loop with the following
controller:
(7.74)
where ki , i = 1, …, n, are n constant scalars. Substituting
(7.74) in
(7.51), it is
found that:
(7.75)
This state equation has no input like that in (7.40). Hence, the
stability criterion for (7.40) can be applied to (7.75). This means that
the vector x(t), the solution of (7.75), satisfies lim
t→∞x(t) = 0 if, and only if, all eigenvalues
of the matrix A − BK have a strictly negative real part.
However, from the point of view of a practical application, this is
not enough as a good closed-loop performance is also required. It
is important to stress that the waveform of the solution x(t)
of (7.75)
depends on the exact location of the eigenvalues of the matrix
A − BK. Hence, it must be possible to
arbitrarily assign the eigenvalues of the matrix A − BK. As the row vector K can be chosen as desired, it is of
interest to know how to choose K such that the eigenvalues of A − BK are assigned as desired. The solution
to this problem is presented in the following.
Consider the linear transformation
(7.68),
(7.69), and
substitute it in (7.75) to obtain:
(7.76)
where and are given as in (7.70) and (7.67). Note that
is a scalar given as:
, which, according to (7.67), only affects the last row of
(7.76);
hence, the following can be written:
If the following is chosen:
(7.77)
the following is obtained:
Note that, according to (7.70) and (7.76), the following can be written:
i.e., the matrices and A − BK satisfy (7.30); hence, they
possess identical eigenvalues. According to previous sections, the
eigenvalues λ of satisfy:
where , i = 1, …, n stand for the desired eigenvalues and
these are proposed by the designer. It is stressed that when a
complex conjugate desired eigenvalue is proposed, then its
corresponding complex conjugate pair must also be proposed. This is
to ensure that all the coefficients , i = 0, 1, …, n − 1 are real, which also ensures that
all the gains and K are real. The following is the
procedure [1], chapter 7, suggested to compute the vector of
the controller gains K, which
assigns the desired eigenvalues for the closed-loop matrix
A − BK.
Check that the state equation in
(7.51) is
controllable. If this is the case, proceed as indicated in the
remaining steps. Otherwise, it is not possible to proceed.
Find the polynomial:
Propose the desired closed-loop
eigenvalues . If some of them are complex, then
also propose its corresponding complex conjugate pair as one of the
desired eigenvalues.
Compute:
Compute:
Compute the vectors q1, …, qn−2, qn−1, qn according to (7.69), obtain the matrix
P−1 defined in that
expression and obtain its inverse matrix P.
Compute the vector of controller gains
in (7.74) as
.
Example 7.9
Let us continue with the Example
7.8, in
which the Furuta pendulum is studied. It is desired, now, to find
the vector of controller gains K, which, when used in the controller
(7.74) (with
x = z), assigns the eigenvalues of matrix
A − BK at:
To this aim, the coefficients of the following polynomial:
are found to be:
Using these values and those obtained in (7.72), is computed according to (7.77), i.e.,:
Finally, using this and matrix P shown in (7.73) the vector of the
controller gains K is computed
using :
The above computations are performed
by executing the following MATLAB code after executing the MATLAB
code at the end of Example 7.8:
lambda1d=-94;
lambda2d=-18;
lambda3d=-0.5;
lambda4d=-1;
fd=conv([1 -lambda1d],[1 -lambda2d]);
gd=conv(fd,[1 -lambda3d]);
hd=conv(gd,[1 -lambda4d]);
a3b=hd(2);
a2b=hd(3);
a1b=hd(4);
a0b=hd(5);
Kb=[a0b-a0 a1b-a1 a2b-a2 a3b-a3];
K=Kb∗P
eig(A-B∗K)
The command “eig(A-B*K)” is employed
to verify that matrix A-B*K has the desired eigenvalues. Some
simulation results are presented in Figs. 7.5 and 7.6 when controlling the
Furuta pendulum using the vector gain K = [−1.5997 − 4.9138 − 154.4179
− 14.1895] and z1(0) = z2(0) = z4(0) = 0, z3(0) = 0.3 as initial conditions. Note that all the
state variables converge to zero, as expected. These simulations
were performed using the MATLAB/Simulink diagram in Fig.
7.7. Block
Furuta has the following parameters:
and [0 0 0.3 0] as initial conditions. To obtain these results, one
has to proceed as follows: (1) Execute the above MATLAB code to
compute all the required parameters. (2) Run the simulation in Fig.
7.7. (3)
Execute the following MATLAB code in an m-file:
Fig.
7.5
Simulation result for the state z1 of the Furuta pendulum
Fig.
7.6
Simulation results for the Furuta pendulum.
Top: z2. Middle:
z3. Bottom:
z4
In this section, it is assumed again
that the plant to be controlled is given in terms of the error
equation (see Sect. 7.2), i.e., given a plant as in (7.51), it is assumed that
the state x stands for the
error state. Hence, the control objective is defined as ensuring
that the state error tends toward zero as time increases, i.e., lim
t→∞x(t) = 0.
As pointed out in Sect. 7.1, the state x is composed of variables that are
internal to the system; hence, they are not known in general. On
the other hand, the output y
represents a variable that is always known. This means that the
practical implementation of the controller (7.74) is only possible if
the complete state is measured. Because of this, it is important to
know an estimate of the state x(t),
which is represented by , allowing a controller to be
constructed of the form:
(7.78)
The estimate is computed using a state observer
or, simply, an observer. An
observer must compute exclusively employing information
provided by the system input and output. On the other hand, if the
controller (7.78) has to replace the controller in
(7.74), then
a fundamental property that an observer must satisfy is that the
estimate converges to x as fast as possible or, at least,
asymptotically, i.e., such that:
An observer satisfying this property is the following:
(7.79)
where L = [L1, L2, …, Ln ] T is a constant column vector. This
can be explained as follows. Define the estimation error as
. Then, subtracting (7.79) from (7.51) the following is
obtained:
Using y = Cx:
Using the results in Sect. 7.6, it is concluded that ; hence, if, and only if, all the eigenvalues
of matrix A − LC have strictly negative real parts.
Hence, the only problem that remains is how to select the gain
column vector L such that all
the eigenvalues of matrix A − LC have strictly negative real parts and
that they can be arbitrarily assigned. This problem is solved as
follows:
The
state of the dynamical equation in (7.51) can be estimated using the observer in
(7.79)
and all the eigenvalues of matrix
A − LC can be arbitrarily
assigned, if, and only if, (7.51) is
observable.
Again, the complex eigenvalues must
appear as complex conjugate pairs. To explain the above result, the
following theorem is useful.
where
u, y, γ ∈ R,
whereas x, z ∈ Rn.
The dynamical equation in (7.80) is
controllable (observable) if, and only if, the dynamical equation
in (7.81) is
observable (controllable).
Hence, going back to the observer
problem, as the pair (A,
C) is observable, then the pair
(−AT , CT ) and the pair (AT , CT ) are controllable (because sign
“−” of matrix AT does not affect the linear
independence of the columns of the matrix in (7.44), see Sect.
7.4). From
this, it is concluded that, following the procedure introduced in
Sect. 7.11,
it is always possible to find a constant row vector K such that the matrix AT − CTK has any desired set of eigenvalues
(arbitrary eigenvalues). As the eigenvalues of any matrix are
identical to those of its transposed matrix (see Sect. 7.4), then the matrix
A − KTC has the same eigenvalues as matrix
AT − CTK (the desired eigenvalues). Defining
L = KT , the gain column vector required
to design the observer in (7.79) is computed.
It is stressed that assigning the
eigenvalues to the matrix A − LC arbitrarily means that they can be
located where desired by the designer. It is obvious that all
eigenvalues must have strictly negative real parts; however, they
must be located on regions of the complex plane ensuring a fast
convergence of to x(t).
To determine where the eigenvalues of matrix A − LC must be located, the concepts of the
transient response studied in Chap. 3, where a relationship has been
established with a location of poles of the transfer function in
(7.58), are
very important.
Finally, note that given the plant
we can try to construct an observer
as , which results in the following
estimation error dynamics:
If all the eigenvalues of the matrix A have negative real parts, then
is ensured and the observer works.
However, this result is very limited because it is constrained to
be used only with plants that are open-loop asymptotically stable.
Moreover, even in such a case, the convergence speed of
depends on the eigenvalue locations
of the open-loop plant, i.e., it is not possible to render such a
convergence arbitrarily fast. Note that, according to the previous
arguments in this section, these drawbacks are eliminated when
using the observer in (7.79). Also see Example 7.6.
7.13 The
Separation Principle
When a dynamical equation (plant):
(7.82)
and an observer:
(7.83)
are connected using the following controller (see Fig. 7.8):
(7.84)
the question arises regarding how the stability of the closed-loop
system (7.82), (7.83), (7.84), is affected, i.e., it is important to
verify whether ensuring that and lim t→∞x(t) = 0 are enough to ensure stability of
the complete closed-loop system. The answer to this question is
known as the separation
principle , which claims the
following:
Fig.
7.8
A feedback system employing an observer to
estimate the state
The
eigenvalues of the closed-loop system (7.82), (7.83),
(7.84), are the
union of the eigenvalues of matrices A − BK and A − LC.
This means that the eigenvalues of the
observer are not affected by the feedback in (7.84) and, at least in
what concerns the eigenvalues, there is no difference between
feeding back the estimate and feeding back the actual state
x(t). However, the reader must be aware
that the system’s transient response is often different if
x(t) is employed or is employed to compute the input. The
important fact is that both and lim t→∞x(t) = 0 are still true and the complete
closed-loop system is stable. Thus, the design of the vector of
controller gains K and the
vector of gains L for the
observer can be performed independently of each other.
Example 7.10
Consider the DC motor in Example
7.7, i.e.,
consider the dynamical equation:
(7.85)
where it is assumed that the output is the position whereas
velocity cannot be measured; hence, it shall be estimated using an
observer. Suppose that it is desired to control the motor to reach
a constant position, i.e., the desired values of the position and
velocity are:
where θd is a constant representing the
desired position and the desired velocity is zero because the
desired position is constant. Defining the state variables as:
and computing , , the following dynamical equation is
obtained:
(7.86)
where γ is the new output and
the matrix A and vectors
B, C, are defined as in (7.85). Note that the
measured output is now the position error . From this point on, the numerical
values of the motor controlled in Chap. 11 are considered, i.e.,:
(7.87)
The corresponding observer is designed in the following. In the
Example 7.7,
it was shown that the dynamical equation in (7.85) is observable;
hence, the dynamical equation in (7.86) is also observable.
According to theorem 7.6, this implies that pairs (−AT , CT ) and (AT , CT ) are controllable, i.e., that
the following matrices have the rank n = 2:
because the sign “−” of the matrix A does not affect the linear independence
of these columns (see Sect. 7.4). Using the numerical values in
(7.87), the
roots of the polynomial are computed:
Then, the following product is performed:
and equating coefficients:
(7.88)
Using B = CT and AT , instead of A, (7.69) becomes:
Using the numerical values in (7.87), (7.88), in addition to the matrix A and vector C defined in (7.85) the following is
obtained:
hence:
(7.89)
Suppose that it is desired to assign
the following eigenvalues to matrix A − LC:
(7.90)
Then, the following polynomial is computed:
to find, equating coefficients, that:
Using these data and values in (7.88), the vector of gains is computed according to (7.77):
Using this and the matrix P
shown in (7.89), the vector of the controller gains
K is computed as and it is assigned L = KT :
(7.91)
On the other hand, using a similar procedure to those in examples
7.14.1 and
7.14.2, it is
found that the vector of the controller gains:
(7.92)
assigns at:
(7.93)
the eigenvalues of the matrix A − BK. Note that the gains in (7.92) are identical to
the proportional and velocity feedback gains for the controller
designed and experimentally tested in Sect. 11.2.1 Chap. 11, where the closed-loop poles are
assigned at the values in (7.93). The above computations have been
performed by executing the following MATLAB code in an m-file:
clc
k=675.4471;
a=2.8681;
A=[0 1;
0 -a];
B=[0;
k];
C=[1 0];
v=eig(A');
h=conv([1 -v(1)],[1 -v(2)]);
a0=h(3);
a1=h(2);
q2=C';
q1=A'∗C'+a1∗C';
invP=[q1 q2]
P=inv(invP)
lambda1d=-150;
lambda2d=-100;
hd=conv([1 -lambda1d],[1 -lambda2d]);
a0b=hd(3);
a1b=hd(2);
Kb=[a0b-a0 a1b-a1];
K=Kb∗P;
L=K'
v=eig(A);
h=conv([1 -v(1)],[1 -v(2)]);
a0=h(3);
a1=h(2);
q2=B;
q1=A∗B+a1∗B;
invP=[q1 q2]
P=inv(invP)
lambda1d=-15.4+30.06∗j;
lambda2d=-15.4-30.06∗j;
hd=conv([1 -lambda1d],[1 -lambda2d]);
a0b=hd(3);
a1b=hd(2);
Kb=[a0b-a0 a1b-a1];
K=Kb∗P
F=[L B];
Finally, it is stressed that the
observer to construct is given as:
(7.94)
where z = [z1z2] T is the estimate of vector
y u = i∗. The controller is given as:
(7.95)
where L and K take the values indicated in
(7.91) and
(7.92). Note
that the controller must employ z1, i.e., the estimate of
, despite being a known measured variable. This
is because the theory above assumes that the whole state is to be
estimated and fed back. In this respect, it is worth saying that
the so-called reduced-order observers also exist that estimate only
the unknown part of the estate if the other states are known. The
reader is referred to [1] for further details.
In Fig. 7.9, some simulation
results are shown when using the observer in (7.94) and the feedback in
(7.95)
together with the gains in (7.91) and (7.92) to control a DC motor whose parameters
are shown in (7.87). The desired position is θd = 2, the observer initial
conditions are z(0) = [0 0]
T , whereas
θ(0) = 0 (i.e., ) and . It is observed that the estimates
z1 and z2 asymptotically converge to
the real values and x2 and that both and x2 converge to zero, i.e.,
θ converges to θd . It is interesting to realize
that this convergence is achieved before the motor finishes
responding. This has been accomplished by selecting the eigenvalues
of the matrix A − LC (shown in (7.90)) to be much faster
than the eigenvalues assigned to the matrix A − BK (shown in (7.93)). This is a
criterion commonly used to assign the eigenvalues for an observer.
Fig.
7.9
Simulation results. Use of the observer in
(7.94) to
control a DC motor Top figure: continuous , dashed z1 Bottom figure: continuous
, dashed z2
In Fig. 7.10 the MATLAB/Simulink
diagram used to perform the above simulations is presented. Block
step represents θd = 2. Block DC
motor has the following parameters:
and [0 2] as initial conditions. The observer block has the
following parameters:
and [0 0] as initial conditions, where the matrix F is computed at the end of the last
MATLAB code above in an m-file. The simulation must be performed
following these steps: (1) Execute last MATLAB code above in an
m-file. (2) Run the simulation in Fig. 7.10. (3) Execute the
following MATLAB code in an m-file:
nn=length(Estados(:,1));
n=nn-1;
Ts=0.5/n;
t=0:Ts:0.5;
figure(1)
subplot(2,1,1)
plot(t,Estados(:,1),'b-',t,Estados(:,3),'r--');
axis([0 0.3 -2.5 1])
ylabel('rad')
subplot(2,1,2)
plot(t,Estados(:,2),'b-',t,Estados(:,4),'r--');
axis([0 0.3 -100 100])
xlabel('t [s]')
ylabel('rad/s')
Fig.
7.10
MATLAB/Simulink diagram for use of the
observer in (7.94) to control a DC motor
In Chap. 16 the linear approximate model of a
mechanism known as the inertia wheel pendulum is obtained. This
model is shown in (16.25), (16.28), and it is rewritten here for
ease of reference:
(7.96)
To simplify the algebraic manipulation, the following constants are
defined:
The following matrix has the form:
After a straightforward procedure, the following is found:
because is a property of the mechanism, as
explained in Chap. 16. Hence, the dynamical equation in
(7.96) is
controllable for any set of the inertia wheel parameters. This
means that the result does not change whether the mechanism is
large or small, heavy or light. The matrix P introduced in (7.68) is nonsingular and
it is obtained in the following using (7.69). To simplify the
computations, the following numerical values are considered:
where:
, which correspond to parameters of the inertia wheel pendulum that
is built and experimentally controlled in Chap. 16. Thus:
Using these data, the roots of the polynomial are found to be:
Then, the following product is performed:
and, equating coefficients, the following is found:
Finally, to verify the expressions in (7.70), the following
products are performed:
Note that these matrices have exactly the forms shown in
(7.67) for
and .
7.14.2 State
Feedback Control
Now, the vector of controller gains
K is computed. It is desired
that using the controller (7.74) (with x = z
and u = w), the eigenvalues of matrix A − BK are assigned at:
Hence, these values are used to compute the polynomial:
and, equating coefficients:
These data and the values obtained in (7.97) are employed to
compute the vector of the gains according to (7.77):
Finally, using this and the matrix P shown in (7.98) the vector of the
controller gains K is computed
using as:
which, except for some rounding errors, is the vector of the
controller gains used to experimentally control the inertia wheel
pendulum in Chap. 16. Some simulation results are
presented in Fig. 7.11 where z1(0) = 0.3 and z2(0) = z3(0) = 0 were set as initial
conditions. It is observed that the state variables converge to
zero, as desired. These simulations were performed using the
MATLAB/Simulink diagram shown in Fig. 7.12. The inertia wheel
pendulum block has the following parameters:
and [0.3 0 0] as initial conditions. The results in Fig.
7.11 were
obtained following these steps: 1) Execute the following MATLAB
code in an m-file to obtain all the above computations:
Fig.
7.11
Simulation results when using the gain vector
K = [−345.5910 − 11.2594
− 0.0086] to control the inertia wheel pendulum. Top: z1. Middle: z2. Bottom: z3
Fig.
7.12
MATLAB/Simulink diagram used to simulate the
control of the inertia wheel pendulum
clc
A=[0 1 0;
86.5179 0 0;
-86.5179 0 0];
B=[0;
-1.2758;
245.6998];
U=[B A∗B Aˆ2∗B];
det(U)
v=eig(A);
f=conv([1 -v(1)],[1 -v(2)]);
h=conv(f,[1 -v(3)]);
a2=h(2);
a1=h(3);
a0=h(4);
q3=B;
q2=A∗B+a2∗B;
q1=Aˆ2∗B+a2∗A∗B+a1∗B;
invP=[q1 q2 q3]
P=inv(invP)
Ab=P∗A∗invP
Bb=P∗B
lambda1d=-5.8535+17.7192∗j;
lambda2d=-5.8535-17.7192∗j;
lambda3d=-0.5268;
fd=conv([1 -lambda1d],[1 -lambda2d]);
hd=conv(fd,[1 -lambda3d]);
a2b=hd(2);
a1b=hd(3);
a0b=hd(4);
Kb=[a0b-a0 a1b-a1 a2b-a2];
K=Kb∗P
eig(A-B∗K)
2) Run the simulation in Fig.
7.12. 3)
Execute the following MATLAB code in an m-file:
The mathematical models used in the
state variable approach are sets of first-order differential
equations that must be solved simultaneously. Hence, the analysis
and design are performed in the time domain and the Laplace
transform is no longer used. This allows the study of nonlinear
control systems, i.e., those systems represented by nonlinear
differential equations (see Chap. 16 for an example of such
applications). Recall that the Laplace transform cannot be employed
when the differential equations are nonlinear.
Although an equivalence exists between
the state space representation and the transfer function, the
former is more general. This can be seen in the fact that the
transfer function only represents the controllable and observable
part of a state space representation. This means that there are
some parts of a system that cannot be described by the transfer
function. However, if a system is controllable and observable, the
analysis and the design of the control system are simplified. In
fact, there are powerful results for this case, which are presented
in Sects. 7.11 and 7.12.
An advantage of the state space
approach is that it gives simple solutions to problems that have a
more complicated result when using the transfer function approach.
Two examples of this situation are the experimental prototypes that
are controlled in Chaps. 15 and 16, where two variables have to be
controlled simultaneously: the arm and the pendulum positions (in
Chap. 15) and the pendulum position and the
wheel velocity (in Chap. 16). Another advantage of the state
space approach is that it allows us to develop a general
methodology to obtain a linear approximate model of nonlinear
systems (see Sect. 7.3 and Chaps. 13, 15 and 16).
7.16 Review
Questions
1.
What is a controllable state
equation?
2.
What is an observable dynamical
equation?
3.
How can you check controllability and
observability?
4.
How useful is a controllable dynamical
equation?
5.
How useful is an observable dynamical
equation?
6.
What is the difference between the
system state and the system output?
7.
Suppose that a dynamical equation is
controllable and observable. What is the relationship between the
poles of the corresponding transfer function and the eigenvalues of
matrix A?
8.
What does global asymptotic stability
of the origin mean?
9.
What are the conditions required for
the origin to be globally asymptotically stable?
10.
Why is it important for the origin of a
dynamical equation without input to be globally asymptotically
stable?
11.
What does state feedback control
mean?
12.
What is a state observer and what is it
employed for?
7.17
Exercises
1.
Say what you understand by state and
propose a physical system to indicate its state.
2.
Verify that the following dynamical
equations are controllable:
Compute the matrices and vectors
, , defined in (7.70).
Corroborate that these matrices and
vectors have the forms defined in (7.67).
Using these results, find the transfer
function corresponding to each dynamical equation.
Employ the MATLAB “tf(⋅)” command to
compute the transfer function corresponding to each dynamical
equation. Verify that this result and that in the previous item are
identical.
Use MATLAB/Simulink to simulate the
response of the dynamical equation and the corresponding transfer
function when the input is a unit step. Plot both outputs and
compare them. What can be concluded?
3.
Elaborate a MATLAB program to execute
the procedure at the end of Sect. 7.11 to compute the
vector of controller gains K
assigning the desired eigenvalues to the closed-loop matrix
A − BK. Employ this program to compute the
gains of the state feedback controllers in Chaps. 15 and 16. Note that this program is
intended to perform the same task as MATLAB’s “acker(⋅)”
command.
4.
Modify the MATLAB program in the
previous item to compute the observer vector gain L, assigning the desired eigenvalues to
the observer matrix A − LC. Employ this program to design an
observer for the system in Chap. 15. Define the system output as the
addition of the pendulum and the arm positions.
5.
The following expression constitutes
a filter where y(t) is intended to replace the time
derivative of u(t).
In fact, y(t) is known as the dirty derivative of u(t)
and it is often employed to replace velocity measurements in
mechanical systems. To implement this filter in practice, the
corresponding dynamical equation is obtained. Find such a dynamical
equation. Recall that u(t)
must be the input. Can you use frequency response arguments to
select a value for a?
6.
Find a dynamical equation useful for
implementing the lead controller:
where U(s) is the plant input and E(s)
is the system error. Compare with the result in Sect. F.3.
7.
Consider the following system without
input:
Applying the Laplace transform to both sides, it is possible to
find that:
Recall (7.57)
and (7.56) to
explain that, in general, the following stands for the solution of
the closed-loop state equation:
xi (t), for any i = 1, …, n, depends on all the initial conditions
xi (0), i = 1, …, n, i.e., the system is coupled.
xi (t), for any i = 1, …, n, depends on all the eigenvalues of the
matrix A − BK.
A particular ki does not affect only a particular
xi (t), i = 1, …, n.
A particular ki does not affect only a particular
eigenvalue of the matrix A − BK.
8.
Given an n × n
matrix A, an eigenvector w is
an n −dimensional vector such
that Aw = λw where the scalar λ is known as the eigenvalue associated
with w. From this definition
(λI − A)w = 0 follows, where I is the n × n
identity matrix. Hence, a nonzero w is ensured to exist if, and only if,
. As is an n degree polynomial in λ, the matrix A has n eigenvalues that can be real, complex,
different or repeated. In the case of n real and different eigenvalues,
λi , i = 1, …, n, n
linearly independent eigenvectors wi , i = 1, …, n exist. Thus, an invertible n × n
matrix:
and a linear coordinate transformation:
can be defined such that:
where x, z ∈ Rn , are related by
E = QAQ−1. Show that the matrix
E is given as:
i.e., that:
and:
9.
Consider the matrix and the vector , defined in (7.67), when n = 5.
Suppose that for i = 0, 1, …, 4. Show that:
i.e., these vectors are linearly independent, the matrix
has a determinant that is different
from zero, and, thus, the system in (7.67) is
controllable.
Suppose that for i = 0, 1, …, 4. Show that:
where the symbol “∗” stands for some numerical values depending on
for i = 0, 1, …, 4. Show that these vectors
are still linearly independent, i.e., that the matrix has a determinant that is different
from zero; thus, the system in (7.67) is controllable.
10.
(Taken from [1]) A
set of n functions of time
fi (t), i = 1, …, n, is said to be linearly dependent on
the interval [t1,
t2] if there are
numbers α1,
α2, …, αn , not all zero such that:
for all t ∈ [t1, t2]. Otherwise, the set of
functions is said to be linearly independent of [t1, t2]. Use these arguments to
explain why the following functions:
are linearly dependent on [0, 1] and on [−1, 0]. However, they are
linearly independent of [−1, 1].
Show that for all t ∈ R, i.e., that e At is nonsingular for all
t ∈ R.
Define:
(7.99)
Use the definition in the previous exercise to prove that
f1(t) and f2(t) are linearly independent for all
t ∈ R.
The following theorem is taken from
[1]. Let fi (t), i = 1, 2, …, n, be 1 × p continuous functions defined on
[t1, t2]. Let F(t) be the
n × p matrix with fi (t) as its i −th row. Define:
Then, f1(t), f2(t), …, fn ((t), are linearly independent of
[t1, t2] if, and only if, the
n × n constant matrix W(t1, t2)
is nonsingular.
Use this theorem to prove that the two
scalar functions defining the two rows of matrix e AtB defined in the previous item are
linearly independent of t ∈ R.
The following theorem is taken from
[1]. Assume that for each i, fi is analytic on
[t1, t2]. Let F(t)
be the n × p matrix with fi as its i −th row, and let F(k)(t) be the k −th derivative of F(t).
Let t0 be any fixed
point in [t1,
t2]. Then, the
fi s are linearly independent of
[t1, t2] if, and only if, the rank
of the following matrix, with an infinite number of columns, is
n:
Using the definition in (7.99), show that , n = 2, t0 = 0, has rank 2.
Using the facts that all the entries of
e AtB are analytic functions, e At = e AtA, Am , for m ≥ n, can be written as a linear combination
of I, A, …, An−1 (Cayley–Hamilton theorem), and
e At |
t=0 = I (see [1] for
an explanation of all these properties), show that the theorems in
the two previous items establish the equivalence between the two
conditions in theorem 7.2 to conclude controllability.
12.
Consider the ball and beam system
studied in Example 7.2, in this chapter, together with the
following numerical values:
Obtain the corresponding dynamical
equation when the state is defined as and the output is γ = x − xd , where xd is a constant standing for the
desired value for x.
Design a state feedback controller to
stabilize the system at x = xd , . Choose the desired eigenvalues as
follows. Propose two pairs of desired rise time and overshoot.
Using the expression in (3.71), Chap. 3, determine two pairs of complex
conjugate eigenvalues such that the two pairs of desired rise time
and overshoot are achieved.
Design an observer to estimate the
complete system state. Recall that the eigenvalues of the matrix
A − LC must be several times faster than
those for the matrix A − BK.
Fix all initial conditions to zero,
except for x(0) − xd ≠ 0. Test the closed-loop system
employing the above observer and the above state feedback
controller to stabilize the system at x = xd , . Verify through simulations whether
the desired transient response characteristics have been
accomplished.