FPE7e Appendices
FPE7e Appendices
FPE7e Appendices
A Review of Complex
Variables
This appendix is a brief summary of some results on complex variables
theory, with emphasis on the facts needed in control theory. For a comprehensive study of basic complex variables theory, see standard textbooks such
as Brown and Churchill (1996) or Marsden and Hoffman (1998).
j2 = 1 or j = 1.
(WA.1)
A complex number may be defined as
A = + j,
(WA.2)
where is the real part and is the imaginary part, denoted, respectively, as
= Re(A),
= Im(A).
(WA.3)
0 2 ,
(WA.4)
= arg(A) = tan1
(WA.6)
(WA.7)
Figure WA.1
The complex number A
represented in
(a) Cartesian and
(b) polar coordinates
Im (s)
A
jx
jx
r
u
Re (s)
(a)
Im (s)
Re (s)
(b)
Im (s)
Im (s)
A1 + A2
A1 A2
A2
A2
A2
A1 u2
A1
u2
u1 + u2
A1
u1
u1
Re (s)
Re (s)
u1 - u2
Re (s)
A1
A2
(a)
(b)
(c)
Figure WA.2
Arithmetic of complex numbers: (a) addition; (b) multiplication; (c) division
Care must be taken to compute the correct value of the angle, depending
on the sign of the real and imaginary parts (that is, one must find the quadrant
in which the complex number lies).
The conjugate of A is defined as
A = j
(WA.8)
Therefore,
(A ) = A,
A1
(WA.9)
A2 ,
(A1 A2 ) =
A
A1
= 1 ,
A2
A2
(WA.10)
(WA.11)
(A1 A2 ) = A1 A2 ,
Re(A) =
A + A
,
2
(WA.12)
Im(A) =
A A
,
2j
AA = (|A|)2 .
(WA.13)
(WA.14)
and
A2 = 2 + j2 ,
(WA.15)
then
A1 + A2 = (1 + j1 ) + (2 + j2 ) = (1 + 2 ) + j(1 + 2 ). (WA.16)
Because each complex number is represented by a vector extending from
the origin, we can add or subtract complex numbers graphically. The sum is
obtained by adding the two vectors. This we do by constructing a parallelogram and finding its diagonal, as shown in Fig. WA.2a. Alternatively, we
could start at the tail of one vector, draw a vector parallel to the other vector,
and then connect the origin to the new arrowhead.
Complex subtraction is very similar to complex addition.
(WA.17)
(1 2 + 1 2 ) + j(1 2 1 2 )
.
22 + 22
(WA.18)
1 j
e ,
r
r = 0.
(WA.19)
(WA.20)
r2 = 0,
(WA.21)
A1 r1
A
where A
= r2 and arg A1 = 1 2 . The division of complex numbers
2
2
may be carried out graphically in polar coordinates as shown in Fig. WA.2c.
EXAMPLE WA.1
G( j) =
Re(G( j))
+1
m
(s + zi )
G(s) = ni=1
.
i=1 (s + pi )
(WA.22)
The value of the transfer function for sinusoidal inputs is found by replacing
s with j. The gain and phase are given by G( j) and may be determined
analytically or by a graphical procedure. Consider the pole-zero configuration for such a G(s) and a point s0 = j0 on the imaginary axis, as shown
in Fig. WA.3. Also consider the vectors drawn from the poles and the zero
to s0 . The magnitude of the transfer function evaluated at s0 = j0 is simply
the ratio of the distance from the zero to the product of all the distances from
the poles:
r1
|G( j0 )| =
.
(WA.23)
r2 r3 r4
The phase is given by the sum of the angles from the zero minus the
sum of the angles from the poles:
arg G( j0 ) = G( j0 ) = 1 (2 + 3 + 4 ).
(WA.24)
Im (s)
Figure WA.3
Graphical
determination of
magnitude and phase
s0
r4
r2
r3
u2
r1
u1
u4
Re (s)
u3
Im (s)
Figure WA.4
Illustration of graphical
computation of s + z1
s0 + z1
- z1
s0
s0 + z1
z1
Re (s)
Fig. WA.4. This means that a vector drawn from the zero location to s0 is
equivalent to s+z1 . The same reasoning applies to the poles. We reflect p1 , p2 ,
and p3 about the origin to obtain the pole locations. Then the vectors drawn
from p1 , p2 , and p3 to s0 are the same as the vectors in the denominator
represented in polar coordinates. Note that this method may also be used to
evaluate s0 at places in the complex plane besides the imaginary axis.
ss0
(WA.28)
(WA.29)
(WA.30)
A = ej = cos j sin .
(WA.32)
cos =
(WA.33)
(WA.34)
G(s)ds = 0.
(WA.35)
C
Figure WA.5
Contours in the s-plane:
(a) a closed contour;
(b) two different paths
between A1 and A2
Im (s)
C1
A2
A1
A2
C2
A1
Re (s)
Re (s)
(a)
(b)
C2
An
A1
+ ... +
+ B0 + B1 (s s0 ) + . . . . (WA.37)
(s s0 )n
(s s0 )
1
A1 = Res[G(s); s0 ] =
G(s) ds,
(WA.38)
2 j C
where C denotes a closed arc within an analytic region centered at s0 that
contains no other singularity, as shown in Fig. WA.6. When s0 is not repeated
with n = 1, we have
A1 = Res[G(s); s0 ] = (s s0 )G(s)|s=s0 .
This is the familiar cover-up method of computing residues.
(WA.39)
Figure WA.6
Contour around an
isolated singularity
s0
Re (s)
G(s) ds =
Res[G(s); si ].
(WA.40)
i=1
1
G (s)
ds = N P
(WA.41)
2 j
G(s)
or
1
2 j
d(ln G) = N P,
(WA.42)
where N and P are the total number of zeros and poles of G inside C,
respectively. A pole or zero of multiplicity k is counted k times.
Proof Let s0 be a zero of G with multiplicity k. Then, in some
neighborhood of that point, we may write G(s) as
G(s) = (s s0 )k f (s),
(WA.43)
(WA.45)
h (s)
lh(s)
,
l
(s s0 )
(s s0 )l+1
(WA.48)
so that
G (s)
l
h (s)
=
.
(WA.49)
+
G(s)
s s0
h(s)
This analysis may be repeated for every pole. The result is that the sum of
the residues of G (s)/G(s) at all the poles of G(s) is P.
d[ln G(s)] = N P,
(WA.50)
where d[ln G(s)] was substituted for G (s)/G(s). If we write G(s) in polar
form, then
d[ln G(s)] =
d{ln |G(s)| + j arg[ln G(s)]}
s=s2
2
= ln |G(s)||s=s
s=s1 + j arg G(s)|s=s1 .
(WA.51)
Because is a closed contour, the first term is zero, but the second term is
2 times the net encirclements of the origin:
1
d[ln G(s)] = N P.
(WA.52)
2 j
Intuitively, the argument principle may be stated as follows: We let G(s)
be a rational function that is analytic except at possibly a finite number of
points. We select an arbitrary contour in the s-plane so that G(s) is analytic
at every point on the contour (the contour does not pass through any of the
singularities). The corresponding mapping into the G(s)-plane may encircle
(WA.55)
d b
,
a c
=
d b
,
a c
a c
R,
R =
a c
(WA.56)
(WA.57)
which is the equation for a circle in the s-plane. For alternative proofs
the reader is referred to Brown and Churchill (1996) and Marsden and
Hoffman (1998).
Appendix WB
Summary of Matrix Theory
In the text, we assume you are already somewhat familiar with matrix theory and with the solution of linear systems of equations. However, for the
purposes of review we present here a brief summary of matrix theory with
an emphasis on the results needed in control theory. For further study, see
Strang (2006) and Gantmacher (1959).
(WB.1)
A= .
..
.. ,
.
.
.
.
am1 am2 amn
where the entries aij are its elements. If m = n, then the matrix is square;
otherwise it is rectangular. Sometimes a matrix is simply denoted by A =
[aij ]. If m = 1 or n = 1, then the matrix reduces to a row vector or a column
vector, respectively. A submatrix of A is the matrix with certain rows and
columns removed.
(WB.2)
(WB.3)
where
That is, the addition is done element by element. It is easy to verify the
following properties of matrices:
A + B = B + A,
(WB.4)
(A + B) + C = A + (B + C).
(WB.5)
(WB.6)
11
n
aik bkj .
(WB.7)
k=1
(WB.8)
(WB.9)
WB.3 Trace
The trace of a square matrix is the sum of its diagonal elements:
trace A =
n
aii .
(WB.10)
i=1
WB.4 Transpose
The n m matrix obtained by interchanging the rows and columns of A is
called the transpose of matrix A:
AT = .
..
..
..
.
.
a1n a2n . . . amn
A matrix is said to be symmetric if
AT = A.
Transposition
(WB.11)
(WB.12)
(ABC) = C B A ,
(WB.13)
(A + B) = A + B .
(WB.14)
T
T
n
aij ij
for any
i = 1, 2, . . . , n,
(WB.15)
j=1
(WB.16)
13
where the scalar det Mij is called a minor. Mij is the same as the matrix A
except that its ith row and jth column have been removed. Note that Mij is
always an (n 1) (n 1) matrix, and that the minors and cofactors are
identical except possibly for a sign.
The adjugate of a matrix is the transpose of the matrix of its cofactors:
adj A = [ij ]T .
(WB.17)
(WB.18)
1 0 ... ... 0
0 1
0 ... 0
I= .
.
.. ;
..
..
..
.
.
0 ... ... 0 1
that is, I has ones along the diagonal and zeros elsewhere. If det A = 0, then
the inverse of a matrix A is defined by
A1 =
and has the property
adj A
,
det A
AA1 = A1 A = I.
(WB.19)
(WB.20)
Inversion
and
(AB)1 = B1 A1
(WB.21)
(ABC)1 = C1 B1 A1 .
(WB.22)
(WB.23)
Hence
det(A) = n det A.
(WB.24)
then
2. If any two rows (or columns) of A are interchanged to obtain A,
= det A.
det A
(WB.25)
(WB.27)
(WB.28)
and
Applying Eq. (WB.28) to Eq. (WB.20), we have
det A det A1 = 1.
(WB.29)
A C
det
= det A det B.
(WB.30)
0 B
If A is nonsingular, then
A B
det
= det A det(D CA1 B).
C D
(WB.31)
Using this identity, we can write the transfer function of a scalar system
in a compact form:
(sI A) B
det
C
D
.
(WB.32)
G(s) = C(sI A)1 B + J =
det(sI A)
1 1
A C
A
A1 CB1
.
=
0 B
0
B1
(WB.33)
Some matrices have special structures and are given names. We have already
defined the identity matrix, which has a special form. A diagonal matrix has
(possibly) nonzero elements along the main diagonal and zeros elsewhere:
0
a11
a22
a
33
(WB.34)
A=
.
.
..
0
ann
15
A matrix is said to be (upper) triangular if all the elements below the main
diagonal are zeros:
a11 a12
a1n
0 a22
..
..
0
.
A= .
(WB.35)
.
..
.
.
..
..
0
.
0
0 0 ann
The determinant of a diagonal or triangular matrix is simply the product of
its diagonal elements.
A matrix is said to be in the (upper) companion form if it has the
structure
an
a1 a2
1
0
0
1
0
0
(WB.36)
Ac =
.
..
..
..
.
.
.
0
1
0
Note that all the information is contained in the first row. Variants of this form
are the lower, left, or right companion matrices. A Vandermonde matrix
has the following structure:
1 a1 a12 a1n1
1 a2 a2 an1
2
2
A= . .
.
(WB.37)
..
..
.. ..
.
.
1 an an2 ann1
WB.9 Rank
The rank of a matrix is the number of its linearly independent rows or
columns. If the rank of A is r, then all (r + 1) (r + 1) submatrices of A
are singular, and there is at least one r r submatrix that is nonsingular. It
is also true that
row rank of A = column rank of A.
(WB.38)
(WB.39)
(WB.41)
(WB.42)
(WB.43)
(WB.44)
det(I A) = 0,
(WB.45)
Because v is nonzero,
so is an eigenvalue of the matrix A as defined in Eq. (WB.43). The normalization of the eigenvectors is arbitrary; that is, if v is an eigenvector, so
is v. The eigenvectors are usually normalized to have unit length; that is,
v2 = vT v = 1.
If wT is a nonzero row vector such that
wT A = wT ,
(WB.46)
(WB.47)
(WB.48)
17
(WB.49)
T = x,
(WB.50)
T = AT + Bu,
(WB.51)
If we let
then Eq. (WB.49) becomes
= A
(WB.52)
= T1 AT,
A
B = T1 B.
(WB.53)
where
is
The characteristic polynomial of A
= det(sI T1 AT)
det(sI A)
= det(sT1 T T1 AT)
= det[T1 (sI A)T]
= det T1 det(sI A) det T.
(WB.54)
(WB.55)
(WB.57)
(WB.58)
eA eB = eB eA .
(WB.59)
and, in general,
(In the exceptional case where A and B commutethat is, AB = BAthen
eA eB = eB eA .)
(WB.60)
for some vector y. The null space of A, denoted by N (A), is defined by the
set of vectors x such that
Ax = 0.
(WB.61)
If x N (A) and y R(AT ), then yT x = 0; that is, every vector in the null
space of A is orthogonal to every vector in the range space of AT .
(WB.63)
0
S=
,
(WB.64)
0 0
where is a diagonal matrix of nonzero singular values in descending order:
1 2 r > 0.
(WB.65)
The unique diagonal elements of S are called the singular values. The
maximum singular value is denoted by (A), and the minimum singular
value is denoted by (A). The rank of the matrix is the same as the number
of nonzero singular values. The columns of U and V,
U = [ u1
u2
. . . um ],
V = [ 1
...
n ],
(WB.66)
19
are called the left and right singular vectors, respectively. SVD provides
complete information about the fundamental subspaces associated with a
matrix:
N (A) = span[ r+1
r+2
...
n ],
R(A) = span[ u1
u2
. . . ur ],
R(A ) = span[ 1
...
ur+2
r ],
. . . um ].
(WB.67)
Here N denotes the null space and R, the range space, respectively.
The norm of the matrix A, denoted by A2 , is given by
A2 = (A).
(WB.68)
(WB.69)
for all x.
(WB.70)
Appendix WC
Controllability and
Observability
Controllability and observability are important structural properties of
dynamic systems. First identified and studied by Kalman (1960) and later
by Kalman et al. (1961), these properties have continued to be examined
during the last five decades. We will discuss only a few of the known results
for linear constant systems with one input and one output. In the text, we
discuss these concepts in connection with control law and estimator designs.
For example, in Section 7.4 we suggest that, if the square matrix given by
C = [B AB A2 B . . . An1 B]
(WC.1)
WC.1 Controllability
We begin our formal discussion of controllability with the first of four
definitions.
Definition WC.1 The system (A, B) is controllable if, for any given nthorder polynomial c (s), there exists a (unique) control law u = Kx such
that the characteristic polynomial of A BK is c (s).
From the results of Ackermanns formula (see Appendix WD), we have
the following mathematical test for controllability: (A, B) is a controllable
pair if and only if the rank of C is n. Definition WC.1 based on pole placement
is a frequency-domain concept. Controllability can be equivalently defined
in the time domain.
Definition WC.2 The system (A, B) is controllable if there exists a (piecewise continuous) control signal u(t) that will take the state of the system
from any initial state x0 to any desired final state xf in a finite time interval.
We will now show that the system is controllable by this definition if and
only if C is full rank. We first assume that the system is controllable but that
rank[B AB A2 B . . . An1 B] < n.
(WC.2)
20
(WC.3)
WC.1 Controllability
21
or
vB = vAB = vA2 B = . . . = vAn1 B = 0.
(WC.4)
(WC.5)
Therefore,
vAn B = a1 vAn1 B + a2 vAn2 B + . . . + an vB = 0.
(WC.6)
= eAt
eA Bu( ) d .
(WC.8)
(WC.9)
for all u(t) and t > 0. This implies that all points reachable from the origin are
orthogonal to v. This restricts the reachable space and therefore contradicts
the second definition of controllability. Thus if C is singular, (A, B) is not
controllable by Definition WC.2.
Next we assume that C is full rank but (A, B) is uncontrollable by
Definition WC.2. This means that there exists a nonzero vector v such that
tf
(tf )
v
eA
Bu( ) d = 0,
(WC.10)
0
because the whole state-space is not reachable. But Eq. (WC.10) implies
that
(tf )
veA
B = 0,
0 tf .
(WC.11)
(WC.12)
b1
1
s + n1
c1
b2
1
s + n2
c2
1
s + nn
cn
bn
y
+
(WC.13)
1
s+1
u
1
s+1
1
s+1
y
u
s-1
s+1
1
s-1
1
s-1
(a)
(b)
(c)
Figure WC.2
Examples of uncontrollable systems
WC.1 Controllability
23
and x2d . Therefore, even in such a simple case, we have two conditions for
controllability:
1. All eigenvalues of Ad are distinct.
2. No element of Bd is zero.
Now let us consider the controllability matrix of this diagonal system.
By direct computation,
b1 b1 1 . . . b1 n1
1
..
b2 b2 2 . . .
C= .
.
.
..
.
..
.
n1
bn bn n . . . bn n
1 2 . . . n1
1
b1
0
1
1
..
2 ...
b
2
1
2
2
.
=
(WC.15)
. .
.
.
.
.
. .
.
.
.
. .
.
.
0
bn
1 n 2n . . . n1
n
Note that the controllability matrix C is the product of two matrices and
is nonsingular if and only if both of these matrices are invertible. The first
matrix has a determinant that is the product of bi , and the second matrix
(called a Vandermonde matrix) is nonsingular if and only if the i are distinct.
Thus Definition WC.3 is equivalent to having a nonsingular C also.
Important to the subject of controllability is the PopovHautus
Rosenbrock (PHR) test (see Rosenbrock, 1970, and Kailath, 1980), which
is an alternate way to test the rank (or determinant) of C. The system (A, B)
is controllable if the system of equations
vT [sI A
B] = 0T ,
(WC.16)
has only the trivial solution vT = 0T that is, if the matrix pencil
[sI A
B] = n,
(WC.17)
(WC.18)
v B = 0.
(WC.19)
This test is equivalent to the rank-of-C test. It is easy to show that, if such
a vector v exists, C is singular. For if a nonzero v exists such that vT B = 0
then by Eqs. (WC.18) and (WC.19), we have
vT AB = svT B = 0.
(WC.20)
(WC.21)
AB ] =
2
1
2
1
(WC.22)
(WC.25)
WC.2 Observability
25
WC.2 Observability
So far we have discussed only controllability. The concept of observability
is parallel to that of controllability, and all of the results we have discussed
thus far may be transformed to statements about observability by invoking
the property of duality, as discussed in Section 7.7.2. The observability
definitions are analogous to those for controllability.
Definition WC.1: The system (A, C) is observable if, for any nth-order
polynomial e (s), there exists an estimator gain L such that the characteristic
equation of the state estimator error is e (s).
Definition WC.2: The system (A, C) is observable if, for any x(0), there is a
finite time such that x(0) can be determined (uniquely) from u(t) and y(t)
for 0 t .
Definition WC.3: The system (A, C) is observable if every dynamic mode
in A is connected to the output through C.
Definition WC.4: The asymptotically stable system (A, C) is observable if
the observability Gramian is nonsingular.
As we saw in the discussion for controllability, mathematical tests can
be developed for observability. The system is observable if the observability
matrix
C
CA
O=
(WC.27)
..
.
CAn1
is nonsingular. If we take the transpose of O and let CT = B and
AT = A, then we find the controllability matrix of (A, B), which is another
manifestation of duality. The observability matrix O may be computed
2 We have shown the latter for diagonal A only, but the result is true in general.
(WC.30)
also can be computed (for an asymptotically stable system) using the gram
command in Matlab: [og]=gram(A,C). The observability Gramian has an
interpretation as the information matrix in the context of estimation.
Appendix WD
Ackermanns Formula
for Pole Placement
Given the plant and state-variable equation
x = Ax + Bu,
(WD.1)
(WD.2)
(WD.3)
First we have to select c (s), which determines where the poles are to be
shifted; then we have to find K such that Eq. (WD.3) will be satisfied. Our
technique is based on transforming the plant equation into control canonical
form.
We begin by considering the effect of an arbitrary nonsingular transformation of the state, as
x = Tx,
(WD.4)
where x is the new transformed state. The equations of motion in the new
coordinates, from Eq. (WD.4), are
x = Tx = Ax + Bu = ATx + Bu,
x = T
ATx + T
x + Bu.
Bu = A
(WD.5)
(WD.6)
AB
A2 B
An1 B ],
(WD.7)
provides a useful transformation matrix. We can also define the controllability matrix for the transformed state:
A
B
Cx = [ B
2 B
A
An1 B ].
(WD.8)
T1 ATT1 B
] = T1 Cx
(WD.9)
(WD.10)
From Eqs. (WD.9) and (WD.10), we can draw some important conclusions. From Eq. (WD.9), we see that if Cx is nonsingular, then for
any nonsingular T, Cx is also nonsingular. This means that a similarity
27
a1 a2 a3
1
= Ac = 1
0
0 , B = Bc = 0 . (WD.11)
A
0
1
0
0
The controllability matrix, by direct computation, is
1 a1 a12 a2
Cx = Cc = 0
1
a1 .
0
0
1
(WD.12)
Because this matrix is upper triangular with ones along the diagonal, it is
always invertible. Also note that the last row of Cx is the unit vector with all
zeros, except for the last element, which is unity. We shall use this fact in
what we do next.
As we pointed out in Section 7.5, the design of a control law for the
state x is trivial if the equations of motion happen to be in control canonical
form. The characteristic equation is
s3 + a1 s2 + a2 s + a3 = 0,
(WD.13)
and the characteristic equation for the closed-loop system comes from
Acl = Ac Bc Kc
(WD.14)
(WD.15)
(WD.16)
so
a1 + Kc1 = 1 ,
a2 + Kc2 = 2 ,
a3 + Kc3 = 3 ,
(WD.17)
or in vector form,
a + Kc = ,
(WD.18)
where a and are row vectors containing the coefficients of the characteristic
polynomials of the open-loop and closed-loop systems, respectively.
29
We now need to find a relationship between these polynomial coefficients and the matrix A. The requirement is achieved by the Cayley
Hamilton theorem, which states that a matrix satisfies its own characteristic
polynomial. For Ac , this means that
Anc + a1 An1
+ a2 An2
+ + an I = 0.
c
c
(WD.19)
Anc
(WD.20)
T
0 ] = en1
,
(WD.22)
0 ]Ac
=[ 0
T
0 ] = en2
,
(WD.23)
and continue the process, successive unit vectors are generated until
enT An1
= 1 0 0 = e1T .
(WD.24)
c
Therefore, if we multiply Eq. (WD.21) by enT , we find that
enT c (Ac ) = (a1 + 1 )e1T + (a2 + 2 )e2T + + (an + n )enT
= [ Kc1
Kc2
Kcn ] = Kc ,
(WD.25)
(WD.26)
In the last step of Eq. (WD.26), we used the fact that (T1 AT)k = T1 Ak T
and that c is a polynomial, that is, a sum of the powers of Ac . From
Eq. (WD.9), we see that
T1 = Cc Cx1 .
(WD.27)
(WD.28)
Now, we use the observation made earlier for Eq. (WD.12) that the last row
of Cc , which is enT Cc , is again enT . We finally obtain Ackermanns formula:
K = enT Cx1 c (A).
(WD.29)
(WD.30)
(WD.31)
K = bT c (A).
(WD.32)
Appendix W2.1.4
Complex Mechanical Systems
In some cases, mechanical systems contain both translational and rotational
portions. The procedure is the same as that described in Section 2.1: sketch
the free-body diagrams, define coordinates and positive directions, determine all forces and moments acting, and apply Eqs. (2.1) and/or (2.14).
EXAMPLE W2.1
Figure W2.1
Crane with a hanging
load
Source: Photo courtesy of
Harnischfeger Corporation,
Milwaukee, Wisconsin
31
mt
I, mp
u
Figure W2.3
Inverted pendulum
I, mp
u
mt
x
x
33
lu2
lu
x
I, mp
u
mt
bx, friction
N
Reaction
P
force from
pendulum
u
u
mpg
(a)
(b)
(c)
Figure W2.4
Hanging crane: (a) free-body diagram of the trolley; (b) free-body diagram of the pendulum; (c) position
vector of the pendulum
axes that are inertially fixed and a vector r describing the position of the
pendulum center of mass. The vector can be expressed as
r = xi + l(i sin j cos ).
The first derivative of r is
i cos + j sin ).
r = x i + l (
Likewise, the second derivative of r is
i cos + j sin ) l 2 (i sin j cos ).
r = x i + l (
Note that the equation for r confirms the acceleration components shown in
Fig.W2.4b. The l 2 term is aligned along the pendulum pointing toward the
axis of rotation, and the l term is aligned perpendicular to the pendulum
pointing in the direction of a positive rotation.
Having all the forces and accelerations for the two bodies, we now
proceed to apply Eq. (2.1). In the case of the trolley, Fig.W2.4a, we see that
it is constrained by the tracks to move only in the x-direction; therefore,
application of Eq. (2.1) in this direction yields
mt x + bx = u N,
(W2.1)
where N is an unknown reaction force applied by the pendulum. Conceptually, Eq. (2.1) can be applied to the pendulum of Fig. W2.4b in the vertical
and horizontal directions, and Eq. (2.14) can be applied for rotational motion
to yield three equations in the three unknowns: N, P, and . These three equations then can be manipulated to eliminate the reaction forces N and P so
that a single equation results describing the motion of the pendulumthat
(W2.2)
(W2.3)
Application of Eq. (2.14) for the rotational pendulum motion, for which the
moments are summed about the center of mass, yields
Pl sin Nl cos = I ,
(W2.4)
where I is the moment of inertia about the pendulums mass center. The
reaction forces N and P can now be eliminated by combining Eqs. (W2.3)
and (W2.4). This yields the equation
(I + mp l 2 ) + mp gl sin = mp lx cos .
(W2.5)
(W2.6)
Equations (W2.5) and (W2.6) are the nonlinear differential equations that
describe the motion of the crane with its hanging load. For an accurate
calculation of the motion of the system, these nonlinear equations need to
be solved.
To linearize the equations for small motions about = 0, let cos
= 1,
sin
= , and 2
= 0; thus the equations are approximated by
(I + mp l 2 ) + mp gl = mp lx ,
(mt + mp )x + bx + mp l = u.
(W2.7)
Neglecting the friction term b leads to the transfer function from the
control input u to the hanging crane angle :
mp l
(s)
=
.
2
U(s)
((I + mp l )(mt + mp ) mp2 l 2 )s2 + mp gl(mt + mp )
(W2.8)
Inverted pendulum
equations
35
, assume =
For the inverted pendulum in Fig. W2.3, where =
+ , where represents motion from the vertical upward direction. In this
case, cos
= 1, sin
= in Eqs. (W2.5) and (W2.6), and Eqs. (W2.7)
1
become
(I + mp l 2 ) mp gl = mp lx ,
(mt + mp )x + bx mp l = u.
(W2.9)
As noted in Example 2.2, a stable system will always have the same
signs on each variable, which is the case for the stable hanging crane modeled
by Eqs. (W2.7). However, the signs on and in the top Eq. (W2.9) are
opposite, thus indicating instability, which is the characteristic of the inverted
pendulum.
The transfer function, again without friction, is
mp l
(s)
=
.
(W2.10)
U(s)
((I + mp l 2 ) mp2 l 2 )s2 mp gl(mt + mp )
m = x /r.
Appendix W3.2.3
W3.2.3 Masons Rule and the Signal-Flow Graph
Signal-ow graph
A compact alternative notation to the block diagram is given by the signalflow graph introduced by S. J. Mason (1953, 1956). As with the block
diagram, the signal-flow graph offers a visual tool for representing the causal
relationships between the components of the system. The method consists of
characterizing the system by a network of directed branches and associated
gains (transfer functions) connected at nodes. Several block diagrams and
their corresponding signal-flow graphs are shown in Fig. W3.1. The two
ways of depicting a system are equivalent, and you can use either diagram
to apply Masons rule (to be defined shortly).
In a signal-flow graph, the internal signals in the diagram, such as the
common input to several blocks or the output of a summing junction, are
called nodes. The system input point and the system output point are also
nodes; the input node has outgoing branches only, and the output node has
incoming branches only. Mason defined a path through a block diagram as
a sequence of connected blocks, the route passing from one node to another
in the direction of signal flow of the blocks without including any block more
than once. A forward path is a path from the input to output such that no
node is included more than once. If the nodes are numbered in a convenient
order, a forward path can be identified by the numbers that are included.
Any closed path that returns to its starting node without passing through any
node more than once is a loop, and a path that leads from a given variable
back to the same variable is a loop path. The path gain is the product of
component gains (transfer functions) making up the path. Similarly, the loop
gain is the path gain associated with a loopthat is, the product of gains in a
loop. If two paths have a common component, they are said to touch. Notice
particularly in this connection that the input and the output of a summing
junction are not the same and that the summing junction is a one-way device
from its inputs to its output.
Masons rule relates the graph to the algebra of the simultaneous equations it represents.1 Consider Fig. W3.1c, where the signal at each node has
been given a name and the gains are marked. Then the block diagram (or the
signal-flow graph) represents the system of equations:
X1 (s) = X3 (s) + U(s),
X2 (s) = G1 (s)X1 (s) + G2 (s)X2 (s) + G4 (s)X3 (s),
Y (s) = 1X3 (s).
1 The derivation is based on Cramers rule for solving linear equations by determinants and is
37
38 Appendix W3.2.3
G3
G3
1
+
G1
G2
G1
G2
G4
G4
(a)
G3
0
+
G1
G3
3
G2
0 1
G2
G1
G4
G4
(b)
G4
X1
+
G1
X2
G4
X3 Y
G3
U 1
G1
1 Y
G2
G3
G2
1
1
(c)
Figure W3.1
Block diagrams and corresponding signal-ow graphs
Masons rule
Masons rule states that the inputoutput transfer function associated with a
signal-flow graph is given by
G(s) =
1
Y (s)
=
G i i ,
U(s)
i
where
Gi = path gain of the ith forward path,
= the system determinant
=1
(all individual loop gains) + (gain products of all possible
two loops that do not touch) (gain products of all possible three
loops that do not touch) + . . . ,
Appendix W3.2.3
39
EXAMPLE W3.1
232
2342
23452
Path Gain
1
G1 = 1
(b1 )(1)
s
1
1
(b2 )(1)
G2 = 1
s
s
1
1
1
(b3 )(1)
G3 = 1
s
s
s
Loop Path Gain
l1 = a1 /s
l2 = a2 /s2
l3 = a3 /s3
Y (s)
(b1 /s) + (b2 /s2 ) + (b3 /s3 )
=
U(s)
1 + (a1 /s) + (a2 /s2 ) + (a3 /s3 )
s3
b1 s2 + b2 s + b3
.
+ a1 s 2 + a2 s + a 3
40 Appendix W3.2.3
b1
b2
U(s)
1 +
+
2
+
+
1
s
3
x1c
1
s
1
s
x2c
5
x3c
+ 6
Y(s)
b3
- a1
- a2
- a3
Figure W3.2
Block diagram for Example W3.1
Masons rule is particularly useful for more complex systems where
there are several loops, some of which do not sum into the same point.
EXAMPLE W3.2
Path Gain
G 1 = H1 H 2 H 3
G2 = H4
Loop Path Gain
l1 = H1 H5 (does not touch l3 )
l2 = H2 H6
l3 = H3 H7 (does not touch l1 )
l4 = H4 H7 H6 H5
Appendix W3.2.3
H4
41
H6
U
1 +
+
H1
H2
+
H3
H5
H7
Figure W3.3
Block diagram for Example W3.2
compared with path-by-path block-diagram reduction is that it is systematic
and algorithmic rather than problem dependent. MATLAB and other control
systems computer-aided software allow you to specify a system in terms of
individual blocks in an overall system, and the software algorithms perform
the required block-diagram reduction; therefore, Masons rule is less important today than in the past. However, there are some derivations that rely
on the concepts embodied by the rule, so it still has a role in the control
designers toolbox.
Appendix W.3.6.3.1
Routh Special Cases
Special case I
If only the first element in one of the rows is zero, then we can consider
a modified equation with one of the coefficients perturbed by > 0 and
applying the test by taking the limit as 0.
EXAMPLE W3.3
Special case II
Another special2 case occurs when an entire row of the Routh array is
zero. This indicates that there are complex conjugate pairs of roots that are
mirror images of each other with respect to the imaginary axis. To apply
Rouths test correctly, we follow the ensuing procedure. If the ith row is
zero, we form an auxiliary equation from the previous (nonzero) row:
a1 (s) = 1 si+1 + 2 si1 + 3 si3 + .
(W3.1)
Here {i } are the coefficients of the (i+1)th row in the array. We then replace
the ith row by the coefficients of the derivative of the auxiliary polynomial
and complete the array. However, the roots of the auxiliary polynomial in
Eq. (W3.1) are also roots of the characteristic equation, and these must be
tested separately.
1 The actual roots computed with Matlab are at 2.9043, 0.6567 1.2881j, 0.7046 0.9929j.
2 Special case II.
42
EXAMPLE W3.4
43
1
5
6.4
3
0
6
12.
11
23
25.6
12
0
0
28
12
0
a1 (s) = 3s2 + 12
1 (s)
= 6s
dads
There are no sign changes in the first column. Hence all the roots have
negative real parts except for a pair on the imaginary axis. We may deduce
this as follows: When we replace the zero in the first column by > 0, there
are no sign changes. If we let < 0, then there are two sign changes. Thus,
if = 0, there are two poles on the imaginary axis, which are the roots of
a1 (s) = 3s2 + 12 = 0,
or
s = j2.
This agrees with the fact that the actual roots are at 3, 2j, 1, and 1,
as computed using the roots command in Matlab.
Appendix W3.7
System Identication
W3.7.1 A Perspective on System Identication
In order to design controls for a dynamic system, it is necessary to have a
model that will adequately describe the systems dynamics. The information
available to the designer for this purpose is typically of three kinds.
1. Physical model: First, there is the knowledge of physics, chemistry,
biology, and the other sciences which have over the years developed equations of motion to explain the dynamic response of rigid and flexible bodies,
electric circuits and motors, fluids, chemical reactions, and many other constituents of systems to be controlled. The model based on this knowledge
is referred to as a physical model. There are many advantages to this
approach, including ease of controller development and testing. One disadvantage of this approach is that a fairly high-fidelity physical model must be
developed.
2. Black box model: It is often the case that for extremely complex
physical phenomena the laws of science are not adequate to give a satisfactory
description of the dynamic plant that we wish to control. Examples include
the force on a moving airplane caused by a control surface mounted on a wing
and the heat of combustion of a fossil fuel of uncertain composition. In these
circumstances, the designer turns to data taken from experiments directly
conducted to excite the plant and measure its response. The second approach
uses an empirical or heuristic model referred to as the black box model.
In this approach, the control engineer injects open-loop commands into the
system and records the sensor response. The process of constructing models from experimental data is called system identification. Standard system
identification techniques (for example, linear least-squares) are used to identify a dynamic input/output model. The advantage of this technique is that the
control engineer does not need to have a deep understanding of how the system physically behaves, but instead can design a controller solely based on
the derived model. There are several major disadvantages to this approach.
First, the control engineer must have access to working hardware. Another
serious disadvantage of this approach is that it does not provide insight or
physical understanding of how specific hardware modifications will affect
the controlusually hardware modifications require the control engineer to
repeat the full cycle of system identification, control design, and validation.
The advantage of this approach is that we use logic and data to model inputs
and outputs and the detailed knowledge of the physics is not required.
3. Grey box model: The third approach is the use of the combination
of physical and empirical models referred to as grey box modeling.
44
Parametric model
Nonparametric model
45
Our sources of
experimental data
Transient response
Frequency response
1 Ziegler and Nichols (1943), building on the earlier work of Callender et al. (1936), use the
step response directly in designing the controls for certain classes of processes. See Chapter 4
for details.
Pseudorandom noise
(PRBS)
47
Figure W3.4
A step response
characteristic of many
chemical processes
y(t)
1.0
(W3.2)
10
10
(W3.3)
= log10 A 0.4343t.
This is the equation of a line whose slope determines and intercept determines A. If we fit a line to the plot of log10 [y y()] (or log10 [y() y]
if A is negative), then we can estimate A and . Once these are estimated,
we plot y [y() + Aet ], which as a curve approximates Bet and on
the log plot is equivalent to log10 B 0.4345t. We repeat the process, each
time removing the slowest remaining term, until the data stop is accurate.
Then we plot the final model step response and compare it with data so we
can assess the quality of the computed model. It is possible to get a good fit
to the step response and yet be far off from the true time constants (poles)
of the system. However, the method gives a good approximation for control
of processes whose step responses look like Fig. W3.4.
EXAMPLE W3.5
1.602 1.167
0.435
=
= 1.
t
1
A = 1.33,
= 1.0.
TABLE W3.1
y(t)
y(t)
0.1
0.1
0.2
0.3
0.4
0.5
0.000
0.005
0.034
0.085
0.140
0.215
1.0
1.5
2.0
2.5
3.0
4.0
0.510
0.700
0.817
0.890
0.932
0.975
1.000
49
1.0
Figure W3.5
Step response data in
Table W3.1
0.8
y(t)
0.6
0.4
0.2
0
-0.2
Figure W3.6
log10 [y() y]
versus t
3
Time (sec)
0.5
0.125
log10 |1 - y|
-0.5
-1.0
-1.167
-1.5
-1.602
-2.0
Time (sec)
If we now subtract 1 + Aet from the data and plot the log of the result,
we find the plot of Fig. W3.7. Here we estimate
log10 B = 0.48,
0.4343 =
0.48 (1.7)
= 2.5,
0.5
-0.48
log10 Be-bt
-0.5
-1.0
-1.5
-1.7
-2.0
0.1
0.2
0.3
0.4
0.5
Time (sec)
Figure W3.8
Model ts to the
experimental data
1.0
0.8
y(t)
0.6
0.4
A = -1.33, a = 1, B = 0.33, b = 5.8
0.2
A = -1.37, a = 1, B = 0.37, b = 4.3
0
Data
-0.2
3
Time (sec)
= 5.8,
B = 0.33.
Combining these results, we arrive at the y estimate
y (t)
= 1 1.33et + 0.33e5.8t .
(W3.4)
Equation (W3.4) is plotted as the colored line in Fig. W3.8 and shows a
reasonable fit to the data, although some error is noticeable near t = 0.
From y (t), we compute
1
1.33
0.33
Y (s) =
+
s
s + 1 s + 5.8
(s + 1)(s + 5.8) 1.33s(s + 5.8) + 0.33s(s + 1)
=
s(s + 1)(s + 5.8)
0.58s + 5.8
=
.
s(s + 1)(s + 5.8)
51
0.58(s 10)
.
(s + 1)(s + 5.8)
Notice that this method has given us a system with a zero in the RHP,
even though the data showed no values of y that were negative. Very small
differences in the estimated value for A, all of which approximately fit the
data, can cause values of to range from 4 to 6. This illustrates the sensitivity
of pole locations to the quality of the data and emphasizes the need for a
good signal-to-noise ratio.
By using a computer to perform the plotting, we are better able to iterate
the four parameters to achieve the best overall fit. The data presentation in
Figs. W3.6 and W3.7 can be obtained directly by using a semilog plot. This
eliminates having to calculate log10 and the exponential expression to find
the values of the parameters. The equations of the lines to be fit to the data are
y(t) = Aet and y(t) = Bet , which are straight lines on a semilog plot. The
parameters A and , or B and , are iteratively selected so that the straight
line comes as close as possible to passing through the data. This process
produces the improved fit shown by the dashed black line in Fig. W3.8. The
revised parameters, A = 1.37, B = 0.37, and = 4.3 result in the transfer
function
G(s) =
0.22s + 4.3
.
(s + 1)(s + 4.3)
Least-squares system
identication
If the transient response has oscillatory modes, then these can sometimes
be estimated by comparing them with the standard plots of Fig. 3.18. The
period will give the frequency d , and the decay from one period to the next
will afford an estimate of the damping ratio. If the response has a mixture
of modes not well separated in frequency, then more sophisticated methods
need to be used. One such is least-squares system identification, in which
a numerical optimization routine selects the best combination of system
parameters so as to minimize the fit error. The fit error is defined to be a
scalar cost function
J=
(ydata ymodel )2 , i = 1, 2, 3, , for each data point,
i
so that fit errors at all data points are taken into account in determining the
best value for the system parameters.
EXAMPLE W3.6
53
10
Magnitude with
second-order term
removed
Magnitude, |G|
f2
f0
Slope = -2
0.1
0.01
f1
0.1 0.2
2
f (Hz)
10
20
100
20
100
305
05
f2
Phase, jG
-305
f0
-605
Phase with
second-order
term removed
-905
-1205
-1505
-1805
0.1 0.2
2
f (Hz)
10
the damping ratio in order to subtract out this second-order pole. For this,
the phase curve may be of more help. Since the phase around the break-point
frequency is symmetric, we draw a line at the slope of the phase curve at f1
to find that the phase asymptote intersects the 0 line at f0
= 0.71 Hz (or
4.46 rad/sec). This corresponds to f1 /f0
= 2.34, which in time corresponds
to
= 0.5, as seen on the normalized response curves in Fig. 6.3b. The
magnitude curve with the second-order factor taken out shows an asymptotic
amplitude gain of about 6.0 db, or a factor of 106.0/20 = 2.0. As this is a
gain rise, it occurs because of a lead compensation of the form
s/a + 1
,
s/b + 1
where b/a = 2.0. If we remove the second-order terms in the phase curve,
we obtain a phase curve with a maximum phase of about 20 , which also
G(s)
=
55
[4] M. B. Tischler and R. K. Remple, Aircraft and Rotorcraft System Identification: Engineering Methods with Flight-Test Examples, AIAA,
2006.
[5] R. Pintelon and J. Schoukens, System Identification: A Frequency
Domain Approach, 2nd ed., Wiley-IEEE Press, 2012.
[6] System Identification Toolbox, The Mathworks.
Appendix W3.8
Amplitude and Time Scaling
The magnitude of the values of the variables in a problem is often very different, sometimes so much so that numerical difficulties arise. This was a
serious problem years ago when equations were solved using analog computers and it was routine to scale the variables so that all had similar magnitudes.
Todays widespread use of digital computers for solving differential equations has largely eliminated the need to scale a problem unless the number
of variables is very large, because computers are now capable of accurately
handling numbers with wide variations in magnitude. Nevertheless, it is wise
to understand the principle of scaling for the few cases in which extreme variations in magnitude exist and scaling is necessary or the computer word size
is limited.
(W3.6)
then
x = Sx x
and
x = Sx x .
(W3.7)
56
EXAMPLE W3.7
57
and
i = Si i,
such that both Sx and Si have a value of 1000 in order to convert x and i
in meters and amps to x and i in millimeters and milliamps. Substituting
these relations into Eq. (W3.8) and taking note of Eq. (W3.7) yields
x = 1667x + 47.6
Sx
i .
Si
(W3.9)
d2x
d2x
= o2 2 .
2
dt
d
(W3.11)
EXAMPLE W3.8
(W3.12)
=
Ax +
Bu = Ax
d
o
o
(W3.13)
1
1
ADx z +
BDu v.
o
o
(W3.14)
Then
z =
1 1
1 1
+ Bv.
D ADx z +
D BDu v = Az
o x
o x
(W3.15)
EXAMPLE W3.9
59
and
B =
0
103
Appendix W4.1.4.1
The Filtered Case
Thus far the analysis has been based on the simplest open- and closed-loop
structures. A more general case includes a dynamic filter on the input and
also dynamics in the sensor. The filtered open-loop structure is shown in
Fig. W4.1 having the transfer function Tol = GDol F. In this case, the openloop controller transfer function has been simply replaced by DF and the
discussion given for the unfiltered open-loop case is easily applied to this
change.
For the filtered feedback case shown in Fig. W4.2, the changes are more
significant. In that case, the transform of the system output is given by
Y=
G
HGDcl
GDcl F
R+
W
V.
1 + GDcl H
1 + GDcl H
1 + GDcl H
(W4.1)
As is evident from this equation, the sensor dynamics, H, is part of the loop
transfer function and enters into the question of stability with Dcl H replacing
the Dcl of the unity feedback case. In fact, if F = H, then with respect to
stability, tracking, and regulation, the filtered case is identical to the unity
case with Dcl H replacing Dcl . On the other hand, the filter transfer function F
can play the role of the open-loop controller except that here the filter F would
GDcl
be called on to modify the entire loop transfer function, 1+GD
, rather than
cl H
simply GDol . Therefore the filtered closed-loop structure can realize the best
W(s)
R(s)
Filter
F(s)
Rf (s)
Controller
Dol (s)
U(s)
+
Plant
G(s)
Y(s)
Figure W4.1
Filtered open-loop system
W(s)
R(s)
Filter
F(s)
Rf (s) +
Controller
Dcl (s)
U(s)
+
Plant
G(s)
Sensor
H(s)
Y(s)
+
V(s)
+
Figure W4.2
Filtered closed-loop. R = reference, U = control, Y = output, V = sensor noise
60
61
properties of both the open-loop and the unity feedback closed-loop cases.
The controller, Dcl , can be designed to effectively regulate the system for
the disturbance W and the sensor noise V , while the filter F is designed to
improve the tracking accuracy. If the sensor dynamics H are accessible to
the designer, this term also can be designed to improve the response to the
sensor noise. The remaining issue is sensitivity.
Using the formula given in Eq. (4.18), with changes in the parameter of
interest, we can compute
SFTcl = 1.0,
(W4.2)
1
,
(W4.3)
1 + GDcl H
GDcl H
.
(W4.4)
SHTcl =
1 + GDcl H
Of these, the most interesting is the last. Notice that with respect to H, the
sensitivity approaches unity as the loop gain grows. Therefore it is particularly important that the transfer function of the sensor be not only low in
noise but also very stable in gain. Money spent on the sensor is money well
spent!
SGTcl =
EXAMPLE W4.1
T=
S+T =
(W4.5)
1 + DGH (1 + DGH)(DG)
FDG
(1 + DGH)2
1 + DGH
1 + DGH
= 1.
STF = F
STH = H
Appendix W4.2.2.1
Truxals Formula for the Error
Constants
Truxal (1955) derived a formula for the velocity constant of a Type 1 system
in terms of the closed-loop poles and zeros, which is a formula that connects
the steady-state error to the systems dynamic response. Since control design
often requires a trade-off between these two characteristics, Truxals formula
can be useful to know. Its derivation is quite direct. Suppose the closed-loop
transfer function T (s) of a Type 1 system is
(s z1 )(s z2 ) (s zm )
.
(W4.6)
T (s) = K
(s p1 )(s p2 ) (s pn )
Since the steady-state error in response to a step input in a Type 1 system is
zero, the DC gain is unity; thus
T (0) = 1.
The system error is given by
(W4.7)
Y (s)
= R(s)[1 T (s)].
(W4.8)
E(s) R(s) Y (s) = R(s) 1
R(s)
The system error due to a unit ramp input is given by
1 T (s)
.
(W4.9)
E(s) =
s2
Using the Final Value Theorem, we get
1 T (s)
.
(W4.10)
ess = lim
s0
s
Using LHpitals rule, we rewrite Eq. (W4.10) as
dT
,
(W4.11)
ess = lim
s0 ds
or
dT
1
.
(W4.12)
ess = lim
=
s0 ds
Kv
Equation (W4.12) implies that 1/Kv is related to the slope of the transfer
function at the origin, which is a result that will also be shown in Section
6.1.2. Using Eq. (W4.7), we can rewrite Eq. (W4.12) as
dT 1
ess = lim
,
(W4.13)
s0 ds T
or
d
(W4.14)
ess = lim [ln T (s)].
s0 ds
63
or
(W4.15)
(W4.16)
i=1
n
m
d ln T
1 1
1
=
=
+
.
Kv
ds
s=0
pi
zi
i=1
(W4.17)
i=1
EXAMPLE W4.2
Truxals Formula
Truxals formula
+ ,
Kv
2 + 2j 2 2j 0.1
z
or
1
0.1 = 0.5 + 10 + ,
z
1
= 0.1 0.5 10
z
= 10.4.
Therefore, the closed-loop zero should be at z = 1/ 10.4 = 0.096.
Appendix W4.5
Introduction to Digital
Control
As a result of the revolution in the cost-effectiveness of digital computers,
there has been an increasing use of digital logic in embedded applications such as controllers in feedback systems. A digital controller gives the
designer much more flexibility to make modifications to the control law after
the hardware design is fixed, because the formula for calculating the control
signal is in the software rather than the hardware. In many instances, this
means that the hardware and software designs can proceed almost independently, saving a great deal of time. Also, it is relatively easy to include binary
logic and nonlinear operations as part of the function of a digital controller as
compared to an analog controller. Special processors designed for real-time
signal processing and known as digital signal processors (DSPs) are particularly well suited for use as real-time controllers. Chapter 8 includes a more
extensive introduction to the math and concepts associated with the analysis
and design of digital controllers and digital control systems. However, in
order to be able to compare the analog designs of the next three chapters
with reasonable digital equivalents, we give here a brief introduction to the
most simple techniques for digital designs.
A digital controller differs from an analog controller in that the signals
must be sampled and quantized.1 A signal to be used in digital logic needs
to be sampled first and then the samples need to be converted by an analog-todigital converter or A/D2 into a quantized digital number. Once the digital
computer has calculated the proper next control signal value, this value
needs to be converted back into a voltage and held constant or otherwise
extrapolated by a digital-to-analog converter or D/A3 in order to be applied
to the actuator of the process. The control signal is not changed until the
next sampling period. As a result of sampling, there are strict limits on the
speed and bandwidth of a digital controller. Discrete design methods that
tend to minimize these limitations are described in Chapter 8. A reasonable
rule of thumb for selecting the sampling period is that, during the risetime of the response to a step, the input to the discrete controller should be
sampled approximately six times. By adjusting the controller for the effects
1A controller that operates on signals that are sampled but not quantized is called discrete,
while one that operates on signals that are both sampled and quantized is called digital.
2 Pronounced A to D.
3 Often spelled DAC and pronounced as one word to rhyme with quack.
65
kI
+ kD s)E(s),
s
(W4.18)
= uP + uI + uD .
A/D
e(kT)
Digital controller
D(z)
u(kT)
D/A
Plant
G
(W4.20)
Clock
Sensor
H
Figure W4.3
Block diagram of a digital controller
67
Based on these terms and the fact that the system is linear, the next control
sample can be computed term-by-term. The proportional term is immediate:
uP (kTs + Ts ) = kP e(kTs + Ts ).
(W4.21)
The integral term can be computed by breaking the integral into two parts
and approximating the second part, which is the integral over one sample
period, as follows.
kTs +Ts
uI (kTs + Ts ) = kI
e( )d ,
0
kTs
= kI
(W4.22)
e( )d + kI
kTs +Ts
e( )d ,
(W4.23)
kTs
(W4.24)
(W4.25)
In Eq. (W4.25), the area in question has been approximated by that of the
trapezoid formed by the base Ts and vertices e(kTs +Ts ) and e(kTs ) as shown
by the dashed line in Fig. W4.4.
The area also can be approximated by the rectangle of amplitude e(kTs )
and width Ts shown by the solid blue in Fig. W4.4 to give uI (kTs +
Ts ) = uI (kTs ) + kI Ts e(kTs ). These and other possibilities are considered
in Chapter 8.
In the derivative term, the roles of u and e are reversed from integration
and the consistent approximation can be written down at once from Eqs.
(W4.25) and (W4.19) as
Ts
{uD (kTs + Ts ) + uD (kTs )} = kD {e(kTs + Ts ) e(kTs )}.
2
(W4.26)
As with linear analog transfer functions, these relations are greatly simplified
and generalized by the use of transform ideas. At this time, the discrete
transform will be introduced simply as a prediction operator z much as if we
.
x
Figure W4.4
Graphical
interpretation of
numerical integration
.
x = f (x, u)
.
x (ti)
t.
x dt
0
ti
ti + 1
Ts
[zE(z) + E(z)] ,
2
(W4.27)
Ts z + 1
E(z),
(W4.28)
2 z1
and from Eq. (W4.26), the derivative term becomes the inverse as
UI (z) = kI
UD (z) = kD
2 z1
E(z).
Ts z + 1
(W4.29)
(W4.30)
Trapezoid rule
EXAMPLE W4.3
Discrete Equivalent
Find the discrete equivalent to the analog controller having transfer function
Dc (s) =
U(s)
11s + 1
=
,
E(s)
3s + 1
(W4.32)
69
U(z)
23z 21
=
.
E(z)
7z 5
(W4.35)
(W4.36)
(W4.37)
5
23
21
u(k) + e(k + 1) e(k).
7
7
7
(W4.38)
EXAMPLE W4.4
(W4.39)
s+6
U
= 1.4
.
E
s
(W4.40)
The closed-loop system has a rise time of about 0.2 sec and an overshoot
of about 20%. Design a discrete equivalent to this controller and compare
the step responses and control signals of the two systems. (a) Compare the
responses if the sample period is 0.07, which is about three samples per rise
time. (b) Compare the responses with a sample period of Ts = 0.035 sec,
which corresponds to about six samples per rise time.
6 The process is entirely similar to that used in Chapter 3 to find the ordinary differential equation
(W4.44)
(W4.45)
For controllers with many poles and zeros, making the continuousto-discrete substitution called for in Eq. (W4.31) can be very tedious.
PI Control s+ 6
s
Slider Kc
1.4
Step
Tau 1
9
s+9
Mux
Slider Kd
1.4
Tau 1
9
s+9
Tau 2
5
s+5
Control
Mux 1
Tau 2
5
s+5
Figure W4.5
Simulink block diagram to compare continuous and discrete controllers
Output
2.5
1.2
Continuous controller
2.0
Digital controller (Ts = 0.07 sec)
1.0
1.5
0.8
Continuous controller
0.6
1.0
Discrete controller (Ts = 0.035 sec)
0.4
0.5
0.2
0
71
0.5
1.5
2 2.5 3
Time (sec)
(a)
3.5
4.5
0.5
1.5
2.5 3
Time (sec)
3.5
4.5
(b)
Figure W4.6
Comparison plots of a speed control system with continuous and discrete controllers: (a) output
responses and (b) control signals
Fortunately, Matlab provides a command that does all the work. If one has a
continuous transfer function given by Dc (s) = numD
denD represented in Matlab
as sysDc = tf(numD,denD), then the discrete equivalent with sampling period
Ts is given by
sysDd = c2d(sysDc,Ts ,' t' ).
(W4.46)
In this expression, of course, the polynomials are represented in Matlab
form. The last parameter in the c2d function given by t calls for the conversion to be done using the trapezoid (or Tustin) method. The alternatives
can be found by asking Matlab for help c2d. For example, to compute the
polynomials for Ts = 0.07 sec for Example W4.4, the commands would be
numD = [1 6];
denD = [1 - 0];
sysDc = tf(numD,denD)
sysDd = c2d( sysDc,0.07,' t' )
Appendix W4.6
Sensitivity of Time Response
to Parameter Change
We have considered the effects of errors on the steady-state gain of a dynamic
system and showed how feedback control can reduce these errors. Since
many control specifications are in terms of the step response, the sensitivity of
the time response to parameter changes is sometimes very useful to explore.
For example, by looking at the sensitivity plot, we can tell if increasing a
particular parameter will increase or decrease the overshoot of the response.1
The following analysis is also a good exercise in small-signal linearization.
To consider the sensitivity of the output y(t, ) of a system having
a parameter of interest, , we compute the effect of a perturbation in
the parameter, , on the nominal response by using the Taylors series
expansion
y(t, + ) = y(t, ) +
y
+ .
(W4.47)
y
.
(W4.48)
T11
+
X
Y
+
T22
T12
T21
1As we will see in Chapter 5, the development of the MATLABTM root locus interface rltool
72
73
of this block diagram, the equations relating Y and Z to the reference input
can be written immediately.
Y = T11 R + T21 Z,
(W4.49)
Z = T12 R + T22 Z.
(W4.50)
(W4.51)
(W4.52)
Multiplying these out and ignoring the small term Z, the expressions for
the perturbations in Y and Z are given by
Y = T21 (Z + Z),
(W4.53)
Z = T22 (Z + Z).
(W4.54)
du
T21
0y
dY = 0u du
T22
dZ
u
(a)
0y
0u
T21
Z
T22
u
(b)
u
+
T21
0y
u 0u
T22
(c)
transfer function
0y
u 0u
Y
+
u
u
+
y(t, )
y
the output side of the block to its input as shown in Fig. W4.8c. We are
now in a position to give the final block diagram of the system as it is to be
implemented, shown in Fig. W4.9.
In this figure, it is clear that, to compute the sensitivity of the output to
a parameter, one needs to simulate two copies of the system. The input to
the first system is the reference input of interest, and the input to the second
system is at the input to the parameter of interest of the variable Z taken
from the input to the parameter in the original system. The transfer function
from the reference input to the output sensitivity is readily computed to be
y
=
which is
ln
T12 T21
.
(1 T22 )2
(W4.55)
Response sensitivity
EXAMPLE W4.5
Time-Domain Sensitivity
Compute the sensitivity of the output of the speed control example shown in
the upper portion of Fig. W4.10 with respect to the control gain, Kcl . Take
the nominal values to be Kcl = 9, = 0.01 sec, and A = 1 rad/volt-sec.
Figure W4.10
Block diagram showing
the computation of the
sensitivity of the output
of the speed control
example
Kcl
+
A
ts + 1
Kcl
A
ts + 1
0Y
0K
75
Solution. The required block diagram for the computation is given in Fig.
W4.10 based on Fig. W4.9. In MATLAB, we will construct the several transnij
fer functions with Tij =
and implement Eq. (W4.55). For comparison,
dij
we compute the nominal response from Fig. W4.7 and add 10% of the sensitivity to the nominal response. The instructions to do the computation in
MATLAB are
% script to compute sensitivity for Fig. W4.10
% First input the data for the component transfer functions Tij
% and the nominal parameter, Kcl for this problem
Kcl=9; tau=0.01;
n11=0; d11=1;
n12=1; d12=1;
n22=[0 -1]; d22= [tau 1];
n21=1; d21=[tau 1];
% Now compute the numerator and denominator polynomials of the
transfer functions
% using the convolution function conv to multiply the polynomials
% and put them into system transfer function forms with the MATLAB
function tf.
% The over-all transfer function is
% Y/R =n11/d11 + (n12*n21*d22)/(d12*d21*[d22-Kcl*n22]) = sysy
% The transfer function from the reference input to the sensitivity is
% Kcl*(dy/dKcl)/R = sysdy
% Now dene the numerators and denominators of several intermediate
transfer functions
n1=Kcl*conv(n21,n12);
d1=conv(d21,d12);
n2=d22;
d2=[d22-Kcl*n22];
ny=conv(n1,n2);
dy=conv(d1,d2);
% Now put these together to form two intermediate transfer functions
sysy1 = tf(ny,dy);
sysy2 = tf(n11,d11);
% Now construct the nal transfer functions
% The overall transfer function Y/R
sysy=sysy1+sysy2;
% The sensitivity transfer function
ndy=conv(ny,n2);
ddy=conv(dy,d2);
sysdy=tf(ndy,ddy);
% Now use these to compute the step responses and
% plot the output, the sensitivity and a perturbed response
[y,t]=step(sysy);
[yd,t]=step(sysdy);
plot(t,[y yd y+.1*yd]);
1.0
y + dy
0.8
y
0.6
0.4
Kcl
dy
dKcl
0.2
3
4
Time (m sec)
Appendix W5.4.4
Analog and Digital
Implementations
Lead compensation can be physically realized in many ways. In analog
electronics, a common method is to use an operational amplifier, an example
of which is shown in Fig. W5.1. The transfer function of the circuit in
Fig. W5.1 is readily found by the methods of Chapter 2 to be
s+z
Dlead (s) = a
,
(W5.1)
s+p
where
p
a = , if Rf = R1 + R2 ,
z
1
z=
,
R1 C
R1 + R2
1
p=
.
R2
R1 C
If a design for Dc (s) is complete and a digital implementation is desired,
then the technique ofAppendix W4.5 can be used by first selecting a sampling
period Ts and then making substitution of T2s z1
z+1 for s. For example, consider
s+2
the lead compensation Dc (s) = s+13 . Then, since the rise time is about
0.3, a sampling period of six samples per rise time results in the selection
2 z1
of Ts = 0.05 sec. With the substitution of 0.05
z+1 for s into this transfer
function, the discrete transfer function is
40 z1
U(z)
z+1 + 2
=
z1
E(z)
40 z+1 + 13
1.55z 1.4
.
(W5.2)
1.96z 1
Clearing fractions and using the fact that operating on the time functions
zu(kTs ) = u(kTs + Ts ), we see that Eq. (W5.2) is equivalent to the formula
for the controller given by
1
1.55
1.4
u(kTs ) +
e(kTs + Ts )
e(kTs ). (W5.3)
u(kTs + Ts ) =
1.96
1.96
1.96
=
Figure W5.1
Possible circuit of a lead
compensation
Vin
R1
Rf
R2
V0
77
Step
s+2
s + 13
91
Pl
control
Slider
Kc
1
s
1
s+1
Tau 1
Tau 2
Mux
Mux 1
Mux
Mux 1
1.55z - 1.4
1.96z + 1
91
Discrete
Pl control
Slider
Kd
Output
Control
1
s
1
s+1
tau 1
tau 2
Figure W5.2
Simulink diagram for comparison of analog and digital control
Figure W5.3
Comparison of analog
and digital control
output responses
1.4
Digital controller
1.2
Continuous controller
Amplitude
1
0.8
0.6
0.4
0.2
0
0.5
1
Time (sec)
1.5
79
100
80
Continuous controller
Amplitude
60
40
Digital controller
20
0
-20
-40
0.5
1
Time (sec)
1.5
Figure W5.5
Possible circuit of lag
compensation
R1
Ri
R2
they too can be implemented using analog electronics, and a circuit diagram
of a lag network is given in Fig. W5.5. The transfer function of this circuit
can be shown to be
s+z
Dc (s) = a
,
s+p
where
R2
a=
,
Ri
R1 + R2
z=
,
R1 R 2 C
1
p=
.
R1 C
Usually Ri = R2 , so the high-frequency gain is unity, or a = 1, and the
low-frequency increase in gain to enhance Kv or other error constant is set
2
by k = a pz = R1R+R
.
2
Appendix W5.6.3
Root Locus with Time Delay
Time delays often arise in control systems, both from delays in the process
itself and from delays in the processing of sensed signals. Chemical plants
often have processes with a time delay representing the time material takes
to be transported via pipes or other conveyer. In measuring the attitude of a
spacecraft en route to Mars, there is a significant time delay for the sensed
quantity to arrive back on Earth due to the speed of light. There is also a
small time delay in any digital control system due to the cycle time of the
computer and the fact that data is processed at discrete intervals. Time delay
always reduces the stability of a system; therefore, it is important to be able
to analyze its effect. In this section, we discuss how to use the root locus for
such analysis. Although an exact method of analyzing time delay is available
in the frequency-response methods described in Chapter 6, knowing several
different ways to analyze a design provides the control designer with more
flexibility and an ability to check the candidate solutions.
Consider the problem of designing a control system for the temperature
of the heat exchanger described in Chapter 2. The transfer function between
the control As and the measured output temperature Tm is described by two
first-order terms plus a time delay Td of 5 sec. The time delay results because
the temperature sensor is physically located downstream from the exchanger,
so that there is a delay in its reading. The transfer function is
G(s) =
e5s
,
(10s + 1)(60s + 1)
(W5.4)
e5s
(10s + 1)(60s + 1)
= 0,
(W5.5)
How would we plot the root locus corresponding to Eq. (W5.5)? Since it
is not a polynomial, we cannot proceed with the methods used in previous examples. So we reduce the given problem to one we have previously
1 Time delay is often referred to as transportation lag in the process industries.
80
Pad approximant
81
solved by approximating the nonrational function e5s with a rational function. Since we are concerned with control systems and hence typically with
low frequencies, we want an approximation that will be good for small s.2
The most common means for finding such an approximation is attributed to
H. Pad. It consists of matching the series expansion of the transcendental
function e5s with the series expansion of a rational function whose numerator is a polynomial of degree p and whose denominator is a polynomial of
degree q. The result is called a (p, q) Pad approximant3 to e5s . We will
initially compute the approximants to es , and in the final result, we will
substitute Td s for s to allow for any desired delay.
The resulting (1, 1) Pad approximant (p = q = 1) is
1 (Td s/2)
.
eTd s
=
1 + (Td s/2)
(W5.6)
(W5.7)
Figure W5.6
Poles and zeros of the
Pad approximants to
es , with superscripts
identifying the
corresponding
approximants; for
example, x 1 represents
the (1,1) approximant
Im (s)
2
2
1
1
23
22
1
21
Re (s)
21
2
22
2 The nonrational function e5s is analytic for all finite values of s and so may be approximated
by a rational function. If nonanalytic functions such as s were involved, great caution would
be needed in selecting an approximation that is valid near s = 0.
3 The (p, p) Pad approximant for a delay of T sec is most commonly used and is computed by
Contrasting methods of
approximating delay
eTd s =
.
(W5.8)
1 + Td s
To illustrate the effect of a delay and the accuracy of the different approximations, root loci for the heat exchanger are drawn in Fig. W5.7 for four
cases. Notice that, for low gains and up to the point where the loci cross the
imaginary axis, the approximate curves are very close to exact. However,
the (2, 2) Pad curve follows the exact curve much further than does the
first-order lag, and its increased accuracy would be useful if the delay were
larger. All analyses of the delay show its destabilizing effect and how it limits
the achievable response time of the system.
While the Pad approximation leads to a rational transfer function, in
theory, it is not necessary for plotting a root locus. A direct application of
the phase condition can be used to plot portions of an exact locus of a system
with time delay. The phase-angle condition does not change if the transfer
function of the process is nonrational, so we still must search for values of
s for which the phase is 180 + 360 l. If we write the transfer function as
No delay
Delay approximated by
first-order lag, Eq. W5.8
Delay approximated by
Pad (2, 2) approximant, Eq. W5.7
-5s
Delay = e
(exact)
-0.5
0.5
Re(s)
-0.2
-0.4
-0.6
Figure W5.7
Root loci for the heat exchanger with and without time delay
83
Appendix W6.7.2
Digital Implementation of
Example 6.15
EXAMPLE W6.1
1
s(s + 1)
that was carried out in Section 5.4.1. This also represents the model of a
satellite-tracking antenna (see Fig. 3.60). This time we wish to obtain a
steady-state error of less than 0.1 for a unit-ramp input. Furthermore, we
desire an overshoot Mp < 25%.
1. Determine the lead compensation satisfying the specifications.
2. Determine the digital version of the compensation with Ts = 0.05 sec.
3. Compare the step and ramp responses of both implementations.
Solution.
1. The steady-state error is given by
Dc
ess = lim s
R(s),
s0
1 + KDc (s)G(s)
(W6.1)
84
85
200
40
100
KDc(s)G(s)
20
10
db
Magnitude, L
KG(s)
20
Lead zero
2
1
0
0.1
0.2
1
2
v (rad/sec)
10
Lead pole
Phase (deg) jL
- 905
- 1205
- 1505
- 1805
PM = 205
- 2105
- 2405
0.1
0.2
1
2
v (rad/sec)
535
10
safe, we will design the lead compensator so that it supplies a maximum phase lead of 40 . Fig. 6.53 shows that 1/ = 5 will accomplish
that goal. We will derive the greatest benefit from the compensation if
the maximum phase lead from the compensator occurs at the crossover
frequency. With some trial and error, we determine that placing the
zero at = 2 rad/sec and the pole at = 10 rad/sec causes the maximum phase lead to be at the crossover frequency. The compensation,
therefore, is
s/2 + 1
KDc (s) = 10
.
s/10 + 1
The frequency-response characteristics of L(s) = KDc (s)G(s) in
Fig. W6.1 can be seen to yield a PM of 53 , which satisfies the design
goals.
The root locus for this design, originally given as Fig. 5.24, is
repeated here as Fig. W6.2, with the root locations marked for K = 10.
The locus is not needed for the frequency-response design procedure; it
Im(s)
s
+1
2
KDc(s) = K s
+1
10
1
G(s) =
s(s + 1)
- 15
-10
10
8
6
4
2
-5
K = 10
-2
Re(s)
-4
-6
-8
- 10
is presented here only for comparison with the root locus design method
presented in Chapter 5. The entire process can be expedited by the use
of Matlabs sisotool routine, which simultaneously provides the root
locus and the Bode plot through an interactive GUI interface. For this
example, the Matlab statements
G=tf(1,[1 1 0]);
Dc =tf(10*[1/2 1],[1/10 1]);
sisotool(G,Dc )
will provide the plots as shown in Fig. W6.3. It also can be used to
generate the Nyquist and time-response plots if desired.
2. To find the discrete equivalent of Dc (s), we use the trapezoidal rule
given by Eq. (W4.31). That is,
Dd (z) =
2 z1
Ts z+1 /2 + 1
,
2 z1
Ts z+1 /10 + 1
(W6.2)
(W6.3)
U(z)
= KDd (z),
E(z)
the discrete control equation that results is
u(k + 1) = 0.6u(k) + 10(4.2e(k + 1) 3.8e(k)).
(W6.4)
(W6.5)
Figure W6.3
SISOTOOL graphical interface for Example W6.1
+
Step
Ramp
0.5 s + 1
0.1 s + 1
10
Lead
control
Slider
Kc
4.2 z - 3.8
z - 0.6
10
Discrete lead
control
Slider
Kd
1
s
1
s+1
Tau 1
Tau 2
Mux
1
s
1
s+1
tau 1
tau 2
Mux 1
Output
Figure W6.4
Simulink block diagram for transient response of lead-compensation design
87
Digital controller
1.2
y
0.8
Continuous controller
0.4
0
0.5
1.5
2.5 3
Time (sec)
3.5
4.5
1.6
1.8
(a)
2
Input ramp
1.5
y
Continuous controller
1
0.5
0
Digital controller
0
0.2
0.4
responses of the two controllers are plotted together in Fig. W6.5a and
are reasonably close to one another; however, the discrete controller
does exhibit slightly increased overshoot, as is often the case. Both overshoots are less than 25%, and thus meet the specifications. The ramp
responses of the two controllers, shown in Fig. W6.5b, are essentially
identical, and both meet the 0.1 specified error.
Appendix W6.8.1
Time Delay via the Nyquist
Diagram
EXAMPLE W6.2
1
(W6.6)
= ( sin j cos ).
Using Eq. (W6.6) and substituting in different values of , we can make the
Nyquist plot, which is the spiral shown in Fig. W6.6.
Let us examine the shape of the spiral in more detail. We pick a Nyquist
path with a small detour to the right of the origin. The effect of the pole at the
origin is the large arc at infinity with a 180 sweep, as shown in Fig. W6.6.
From Eq. (W6.6), for small values of > 0, the real part of the frequency
response is close to 1 because sin
= and Re[G( j)]
= 1. Similarly,
89
Im[G(s)]
v = 0-
2
-p
0.6
0.4
1
p
2
3p
0.2
-1 -0.8
-0.4 -0.2
-0.2
-0.4
-0.6
0.4
0.6
0.8
Re[G(s)]
v= +
-q
1
-p
v = 0+
which means that, for stability, we must have 0 < K < /2.
(W6.9)
Appendix W6.9.2
The Inverse Nyquist Diagram
The inverse Nyquist plot is simply the reciprocal of the Nyquist plot
described in Section 6.3 and used in Section 6.4 for the definition and discussion of stability margins. It is obtained most easily by computing the inverse
of the magnitude from the Bode plot and plotting that quantity at an angle in
the complex plane, as indicated by the phase from the Bode plot. It can be
used to find the PM and GM in the same way that the Nyquist plot was used.
When |G(j)| = 1, |G1 (j)| = 1 also, so the definition of PM is identical
on the two plots. However, when the phase is 180 or +180 , the value
of |G1 (j)| is the GM directly; no calculation of an inverse is required, as
was the case for the Nyquist plot.
The inverse Nyquist plot for the system in Fig. 6.24 (Example 6.9) is
shown in Fig. W6.7 for the case where K = 1 and the system is stable.
Note that GM = 2 and PM
= 20 . As an example of a more complex case,
Fig. W6.8 shows an inverse Nyquist plot for the sixth-order case whose
Nyquist plot was shown in Fig. 6.41 and whose Nichols chart was shown in
Fig. 6.83. Note here that GM = 1.2 and PM
= 35 . Had the two crossings of
the unit circle not occurred at the same point, the crossing with the smallest
PM would have been the appropriate one to use.
Figure W6.7
Inverse Nyquist plot for
Example 6.9
Im[G -1(s)]
2.0
1.5
1.0
0.5
0
-0.5
-1.0
Re[G -1(s)]
PM
GM
-1.5
-2.0
-2
-1
91
Im[G -1(s)]
2.0
1.5
1.0
0.5
PM
0
-1.0
GM
-1.5
-2.0
-2
Re[G -1(s)]
-1
-0.5
-1
Appendix W7.8
Digital Implementation
of Example 7.31
EXAMPLE W7.1
Discrete controller
The equation for the control law (with the sample period suppressed for
clarity) is
u(k + 1) = 1.3905u(k) 0.7866u(k 1) + 0.1472u(k 2)
+ e(k) 7.2445e(k 2) + 2.0782e(k 2).
Simulink simulation
A Simulink diagram for simulating both the continuous and discrete systems is shown in Fig. W7.1. A comparison of the continuous and discrete
step responses and control signals is shown in Fig. W7.2. Better agreement
between the two responses can be obtained if the sampling period is reduced.
93
Step
Continuous controller
94.5 s2 + 992.25s + 1900.3572
s3 + 19.16 s2 + 150. 27s + 631.06
Plant
10
s3 + 10 s2 + 16 s
Mux
Discrete controller
+
Mux 1
Control
Plant 1
10
s3 + 10 s2 + 16 s
Figure W7.1
Simulink block diagram to compare continuous and discrete controllers
1.4
Digital controller
1.2
1.0
Continuous controller
0.8
y
Figure W7.2
Comparison of step
responses and control
signals for continuous
and discrete
controllers: (a) step
responses; (b)control
signals
0.6
0.4
0.2
0
2
3
Time (sec)
(a)
7
6
5
4
u
3
2
Continuous controller
1
0
2.1
2.2
Digital controller
0
2
3
Time (sec)
(b)
Output
Appendix W7.9
Digital Implementation
of Example 7.33
EXAMPLE W7.2
Servomechanism
Matlab c2d
The equation for the control law (with sample period suppressed for
clarity) is
u(k + 1) = 1.6630u(k) + 0.6637u(k 1) + 8.32e(k + 1)
15.8855e(k) + 7.5721e(k 1).
Simulink simulation
A Simulink diagram for simulating both the continuous and discrete systems
is shown in Fig. W7.3. A comparison of the continuous and discrete step
responses and control signals is shown in Fig. W7.4. Better agreement
between the two responses can be achieved if the sampling period is reduced.
95
Plant 1
1
Continuous controller
8.32s2 + 9.12s + 0.8
s2 + 4.0996s + 0.08
Step 1
s2 + s
Mux
Discrete controller
+
Plant 1
1
Mux 1
Control
s2 + s
Figure W7.3
Simulink block diagram to compare continuous and discrete controllers
1.4
Digital controller
1.2
1.0
0.8
Continuous controller
Figure W7.4
Comparison of step
responses and control
signals for continuous
and discrete
controllers: (a) step
responses; (b) control
signals
0.6
0.4
0.2
0
2
3
Time (sec)
(a)
10
8
6
4
2
Continuous controller
0
22
Digital controller
0
2
3
Time (sec)
(b)
Output
Appendix W7.14
Solution of State Equations
In this section, we consider the solution of state variable equations. This
material is not necessary to understand the design of pole placement but will
give a deeper insight into the method of state variables. It is instructive to
consider first the unforced, or homogenous, system, which has the form
x = A(t)x,
x(0) = x0 .
(W7.1)
If the elements of A(t) are continuous functions of time, then the above
equation has a unique solution for any initial state vector x0 . There is a
useful representation for the solution of this equation in terms of a matrix,
called the transition matrix. Let i (t, t0 ) be the solution to the special initial
condition
0
0
ith row
1
x(0) = ei = 0 .
(W7.2)
..
.
0
If x(t0 ) is the actual initial condition at t0 , then we can express it in the
decomposed form
x(t0 ) = x01 e1 + x02 e2 + + x0n en .
(W7.3)
Because Eq. (W7.1) is linear, the state x(t) also can be expressed as a sum
of the solutions to the special initial condition i , as
x(t) = x01 1 (t, t0 ) + x02 2 (t, t0 ) + + x0n n (t, t0 ),
or in matrix notation, as
x(t) =
1 (t, t0 ), 2 (t, t0 ),
n (t, t0 )
(W7.4)
x01
x02
..
.
(W7.5)
x0n
So we can define the transition matrix1 to be
(t, t0 ) = 1 (t, t0 ), 2 (t, t0 ), ,
n (t, t0 )
(W7.6)
(W7.7)
97
(W7.8)
(W7.9)
d
[(t, t0 )] = A(t, t0 ),
dt
(W7.10)
(t, t) = I.
(W7.11)
Therefore
and also
2.
3.
(t, )
= (t2 , t1 )(t1 , t0 );
(W7.12)
= ( , t);
(W7.13)
d
(t, ) = (t, )A( );
dt
4. det (t, t0 ) = e t0
(W7.14)
traceA( )d
(W7.15)
The second property implies that (t, ) is always invertible. What this
means is that the solution is always unique so that, given a particular value
of state at time , we can not only compute the future states from (t, )
but also past values 1 (t, ).
For the inhomogenous case, with a forcing function input u(t), the
equation is
x (t) = A(t)x(t) + B(t)u(t),
(W7.16)
(W7.17)
t0
We can verify this by substituting the supposed solution, Eq. (W7.17), into
the differential equation, Eq. (W7.16), as
d
d
d
x(t) = (t, t0 )x0 +
dt
dt
dt
t
(t, )B( )u( )d .
t0
(W7.18)
99
t
(t, )B( )u( )d =
t0
(W7.19)
Using the basic relations, we have
d
x(t) = A(t)(t, t0 )x0 + A(t)
dt
t
(t, )B( )u( )d
t0
+ B(t)u(t),
(W7.20)
= A(t)x(t) + B(t)u(t),
(W7.21)
which shows that the proposed solution satisfies the system equation.
For the time-invariant case
(t, t0 ) = eA(tt0 ) = (t t0 ),
where
At
A2 t 2
= I + At +
+
2!
Ak t k
k=0
k!
(W7.22)
(W7.23)
(W7.24)
A(tt0 )
t
x0 +
eA(t ) Bu( )d ,
(W7.25)
t0
and
y(t) = Cx(t) = Ce
A(tt0 )
t
x0 + C
(W7.26)
t0
h(t )Bu( )d ,
(W7.27)
t0
where h(t) is the impulse response. In terms of the state variables matrices,
h(t) = CeAt B + D(t).
(W7.28)
(W7.30)
then we can compute (s) from the A matrix and matrix algebra. Given this
matrix, we can use the inverse Laplace Transform to compute
(t) = L1 {(s)} ,
= L1 (sI A)1 .
(W7.31)
(W7.32)
The last method we mentioned operates on the system matrix. If the system
matrix can be diagonalized, that is, if we can find a transformation matrix T
so that
= T1 AT,
(W7.33)
where A is reduced to the similar but diagonal matrix
= diag {1 , 2 , , n } ,
(W7.34)
then from the series, Eq. (W7.23), we see that we need only compute scalar
exponentials, since
eAt = T1 diag e1 t , e2 t , , en t T.
(W7.35)
Appendix W8.7
Discrete State-Space Design
Methods
We have seen in previous chapters that a linear, constant-coefficient continuous system can be represented by a set of first-order matrix differential
equations of the form
x = Ax + Bu,
(W8.1)
where u is the control input to the system. The output equation can be
expressed as
y = Cx + Du.
(W8.2)
The solution to these equations (see Franklin et al., 1998) is
t
A(tt0 )
x(t) = e
x(t0 ) +
eA(t ) Bu( ) d .
(W8.3)
t0
AT
x(kT ) +
d Bu(kT ).
If we let
= eAT
and
=
T
0
eA d B,
(W8.5)
101
(W8.6)
(W8.7)
Here x(k + 1) is a shorthand notation for x(kT + T ), x(k) for x(kT ), and
u(k) for u(kT ). The series expansion
= eAT = I + AT +
A2 T 2
A3 T 3
+
+
2!
3!
(W8.8)
where
=I+
AT
A2 T 2
+
+ .
2!
3!
Ak T k+1
B
(k + 1)!
k=0
Ak T k
=
TB
(k + 1)!
k=0
= T B.
(W8.9)
Matlab c2d
which has better numerical properties than the direct series. We then find
from Eq. (W8.9) and from Eq. (W8.8). For a discussion of various methods
of numerical determination of and , see Franklin et al. (1998) and Moler
and van Loan (1978, 2003). The evaluation of the and matrices in
practice is carried out by the c2d function in Matlab.
To compare this method of representing the plant with the discrete transfer function, we can take the z-transform of Eqs. (W8.6) and (W8.7) with
J = 0 to obtain
(zI )X(z) = U(z),
(W8.10)
Y (z) = CX(z).
(W8.11)
Therefore,
Y (z)
= G(z) = C(zI )1 .
U(z)
(W8.12)
EXAMPLE W8.1
103
T
1
0
1
0 1
0
U(z)
T2
z+1
=
.
2 (z 1)2
,
=
T
1
T 2 /2
T
1
.
T 2 /2
T
(W8.13)
This is the same result we obtained using Eq. (8.33) and the z-transform
tables in Example 8.4.
Note that to compute Y /U, we find that the denominator of Eq. (W8.13)
is det(zI ), which was created by the matrix inverse in Eq. (W8.12). This
determinant is the characteristic polynomial of the transfer function, and
the zeros of the determinant are the poles of the plant. We have two poles at
z = 1 in this case, corresponding to two integrations in this plants equations
of motion.
We can further explore the question of poles and zeros and the statespace description by considering again the transform formulas [Eqs. (W8.10)
and (W8.11)]. One way to interpret transfer-function poles from the perspective of the corresponding difference equation is that a pole is a value of z
such that the equation has a nontrivial solution when the forcing input is
zero. From Eq. (W8.10), this interpretation implies that the linear equations
(zI )X(z) = 0
0 z
0 1
z 1 T
= det
0
z1
= (z 1)2 = 0,
which is the characteristic equation, as we have seen. In Matlab, the poles
of the system are found by P = eig(Phi).
Along the same line of reasoning, a system zero is a value of z such that
the system output is zero even with a nonzero state-and-input combination.
Thus, if we are able to find a nontrivial solution for X(z0 ) and U(z0 ) such
that Y (z0 ) is identically zero, then z0 is a zero of the system. In combining
Eqs. (W8.10) and (W8.11), we must satisfy the requirement that
zI
X(z)
= 0.
C
0
U(z)
Once more the condition for the existence of nontrivial solutions is that
the determinant of the square coefficient system matrix be zero. For
Example W8.1, the calculation is
z 1 T T 2 /2
T T 2 /2
det 0
z1
T = det
z1
T
1
0
0
T2
(z 1)
2
T2
T2
=
z+
2
2
T2
=
(z + 1).
2
= T2 +
(W8.14)
105
2
. . . n1 ]
is full rank.
A discrete full-order estimator has the form
x (k + 1) = x(k) + u(k) + L[y(k) Cx(k)],
where x is the state estimate. The error equation,
x (k + 1) = ( LC)x(k),
can be given arbitrary dynamics e (z), provided that the system is observable,
which requires that the observability matrix
C
C2
O=
..
.
Cn1
be full rank.
As was true for the continuous-time case, if the open-loop transfer
function is
Y (z)
b(z)
G(z) =
=
,
U(z)
a(z)
then a state-space compensator can be designed such that
Y (z)
Ks (z)b(z)
=
,
R(z)
c (z)e (z)
where r is the reference input. The polynomials c (z) and e (z) are
selected by the designer using exactly the same methods discussed in
Chapter 7 for continuous systems. c (z) results in a control gain K such
that det(zI + K) = c (z), and e (z) results in an estimator gain L
such that det(zI + LC) = e (z). If the estimator is structured according to Fig. 7.48a, the system zeros (z) will be identical to the estimator
poles e (z), thus removing the estimator response from the closed-loop system response. However, if desired, we can arbitrarily select the polynomial
(z) by providing suitable feed-forward from the reference input. Refer to
Franklin et al. (1998) for details.
EXAMPLE W8.2
1.6
.
L=
0.68
0])
(W8.15)
(W8.16)
107
1.6
Plant output y(t)
1.4
1.2
1.0
0.8
0.6
0.4
0.2
0
0
10
15
20
Time (sec)
25
30
PROBLEMS
W8.1
W8.2
(W8.17)
(W8.18)
Problems
Figure W8.2
Satellite-tracking
antenna (Courtesy
Space Systems/Loral)
Figure W8.3
Schematic diagram of
satellite-tracking
antenna
u
If we define
B
= a,
J
the equation simplifies to
u=
Tc
,
B
and
T
wd = d ,
B
1
+ = u + wd .
a
After using the Laplace transformation, we obtain
(s) =
1
[u(s) + wd (s)],
s(s/a + 1)
or with no disturbance,
(s)
1
=
= G2 (s).
u(s)
s(s/a + 1)
109
z+b
(z)
=K
,
u(z)
(z 1)(z eaT )
where
1 eaT aTeaT
aT 1 + eaT
, b=
.
a
aT 1 + eaT
and write the continuous-time state equations
(a) Let a = 0.1 and x1 = ,
for the system.
(b) Let T = 1 sec, and find a state feedback gain K for the equivalent
discrete-time system that yields closed-loop polescorresponding
to the
3
following points in the s-plane: s = 1/2 j
2 . Plot the step
K=
1
(qin qout ),
cM
where
Te = tank temperature,
c = specific heat of the fluid,
Figure W8.4
Tank temperature
control
Hot
Tec
Negligible heat
loss in walls
Tei
Cold
Mixing
value
Tank fluid at
temperature Te
Te
Problems
111
.
M
The transfer function of the system is thus
a=
e ds
Te (s)
= G3 (s).
=
s/a + 1
Tec (s)
To form a discrete transfer function equivalent to G3 preceded by a ZOH,
we must compute
ed s
1 esT
G3 (z) = Z
.
s
s/a + 1
We assume that for some integer l, d = lT mT , where 0 m < 1. Then
elsT emsT
1 esT
G3 (z) = Z
s
s/a + 1
emsT
1
l
= (1 z )z Z
s(s/a + 1)
emsT
emsT
1
l
= (1 z )z Z
s
s+a
z1 1
=
Z{1(t + mT ) ea(t+mT ) 1(t + mT )}
z
zl
z
eamT z
z1 1
=
z
z 1 z eaT
zl
and
eamT eaT
.
1 eamT
The zero location varies from = at m = 0 to = 0 as m 1.
Note also that G3 (1) = 1.0 for all a, m, and l. For the specific values
d = 1.5, T = 1, a = 1, l = 2, and m = 21 , the transfer function reduces to
=
z + 0.6065
.
G3 (z) = 0.3935 2
z (z 0.3679)
(a)
(b)
(c)
(d)
(e)
W8.4
W8.5
The open-loop plant of a unity feedback system has the transfer function
G(s) =
1
.
s(s + 2)
Determine the transfer function of the equivalent digital plant using a sampling period of T = 1 sec, and design a proportional controller for the
discrete-time system that yields dominant closed-loop poles with a damping
ratio of 0.7.
W8.6
Write a computer program to compute and from A, B, and the sample period T . It is okay to use Matlab, but dont use C2D. Write code in
Matlab to compute the discrete matrices using the relations developed in
this chapter. Use your program to compute and when
(a)
A=
1
0
0
2
,
B=
1
1
,
T = 0.2 sec,
Problems
(b)
113
1
3 2
, T = 0.2sec.
, B=
0
1
0
Consider the following discrete-time system in state-space form:
x1 (k + 1)
x1 (k)
0
0
1
u(k).
+
=
10
x2 (k + 1)
x2 (k)
0 1
A=
W8.7
2
1 T
T /2
and =
.
0 1
T
(a) Find a transformation matrix T so that, if x = Tw, the state equations
for w will be in control canonical form.
(b) Compute the gain Kw so that, if u = Kw w, the characteristic equation
will be c (z) = z2 1.6z + 0.7.
(c) Use T from part (a) to compute Kx , which is the feedback gain
required by the state equations in x to achieve the desired characteristic
polynomial.
Let
=
W8.9
Consider a system whose plant transfer function is 1/s2 and has a piecewise
constant input of the form
u(t) = u(kT ),
kT t < (k + 1)T .
(b) Design a second-order estimator that will always drive the error in the
estimate of the initial state vector to zero in time 2T or less.
(c) Is it possible to estimate the initial state exactly with a first-order
estimator? Justify your answer.
W8.10 In this problem, you will show how to compute by changing states so
that the system matrix is diagonal.
(a) Using an infinite series expansion, compute eAT for
1
0
A=
.
0
2
(b) Show that if A = TAT1 for some nonsingular transformation matrix
T, then
eAT = TeAT T1 .
(c) Show that if
A=
3
2
1
0
,