Soln. of Transfer Functions.
Soln. of Transfer Functions.
August 1996
These lecture notes is meant to be used in the Control Theory part of the course
SCE1106 which is to be held for the master study in Systems and Control Engi-
neering. The contents is also basic theory for courses as System Identification and
Advanced Control theory.
The following words should be noted
All this –
was for you, dear reader,
I wanted to write a book
that you would understand.
For what good is it to me
if you can’t understand it ?
But you got to try hard —
Preface i
2 Canonical forms 30
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.2 Controller canonical form . . . . . . . . . . . . . . . . . . . . . . . . 31
2.2.1 From transfer function to controller canonical form . . . . . . 31
2.2.2 From state space form to controller canonical form . . . . . . 33
2.3 Controllability canonical form . . . . . . . . . . . . . . . . . . . . . . 33
2.4 Observer canonical form . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4.1 From transfer function to observer canonical form . . . . . . 34
2.5 Observability canonical form . . . . . . . . . . . . . . . . . . . . . . 37
2.6 Duality between canonical forms . . . . . . . . . . . . . . . . . . . . 39
2.6.1 Duality between controller and observer canonical forms . . . 39
2.6.2 Duality between controllability and observability canonical forms 40
2.7 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5 Time delay 83
5.1 Padé approximations to the exponential for eθ . . . . . . . . . . . . . 83
5.1.1 Developing a 1st order Padé approximation . . . . . . . . . . 83
5.1.2 Alternative prof of the 1st order Padé approximation . . . . . 84
5.1.3 Developing a (1, 0) Padé approximation . . . . . . . . . . . . 85
5.1.4 (s, t) Padé approximations . . . . . . . . . . . . . . . . . . . . 86
5.2 Padé approksimasjoner for e−τ s . . . . . . . . . . . . . . . . . . . . . 88
5.3 Balchen approksimasjoner for e−τ s . . . . . . . . . . . . . . . . . . . 89
6 Feedback systems 90
6.1 Description of feedback systems . . . . . . . . . . . . . . . . . . . . . 90
6.2 Reasons for using feedback . . . . . . . . . . . . . . . . . . . . . . . 96
CONTENTS v
References 169
The aim of this section is not to discuss modeling principles of dynamic systems in
detail. However we will in this introductory section mention that dynamic models
may be developed in many ways. For instance so called first principles methods as
mass balances, force balances, energy balances, i.e., conservation of law methods,
leads to ether non-linear models of the type
ẋ = f (x, u) (1.1)
y = g(x) (1.2)
or linear or linearized models of the type
ẋ = Ax + Bu (1.3)
y = Dx (1.4)
Note also that a linearized approximation of the non-linear model usually exist. We
will in the following give a simple example of a system which may be described by
a linear continuous time state space model
The model for the damped spring system consists of two continuous time ordinary
differential equations. Those two ODEs may be written in standard state space form
1.2 Linear Time State Space Models 2
as follows
ẋ A x B
z }| { z }| {
z }| { z }| {
ẋ 0 1 x 0
= k µ + 1 u (1.6)
v̇ −m −m v m
Modeling from first principles, e.g., as the in the damped spring example above,
often leads to a standard linear continuous time state space model on the form
ẋ = Ax + Bu (1.7)
where x ∈ Rn is the state vector, u ∈ Rr is the control input vector, A ∈ Rn timesn
An important class of state space models is the time invariant linear and continuous
time state space model of the form
As we see, the solution consists of two parts. The first part represents the
autonomous response (homogenous solution) driven only by initial values different
from zero. The second term represents the in homogenous solution driven by the
control variable, u(t).
In order to compute the first term we have to compute the matrix exponential
eA(t−t0 ) . This matrix exponential is defined as the transition matrix, because it
defines the transition of the state from the initial value, x(t0 ), to the final state x(t)
in an autonomous system ẋ = Ax with known initial state x(t0 ). The transition
matrix is defined as follows
def
Φ(t) = eAt . (1.11)
Using this definition of the transition matrix we see that the solution (1.10) can be
written as follows
Z t
x(t) = Φ(t − t0 )x(t0 ) + Φ(t − τ )Bu(τ )dτ. (1.12)
t0
1.2 Linear Time State Space Models 3
The second term in the solution (1.10) (or equivalent as in (1.12)) consists of a
convolutional integral. This integral must usually be computed numerically, e.g. it
is usually hard to obtain an analytically solution. However, an important special
case is the case where the control u(τ ) is constant over the integration interval
t0 < τ ≤ t.
where ∆ is shown to be
Z t Z t−t0
∆= eA(t−τ ) Bdτ = eAτ Bdτ (1.14)
t0 0
when A is non singular. It is this solution which usually is used in order to compute
the general solution to the state equation. Hence, the control input u(t) is assumed
to be constant over piece wise identical intervals ∆t = t − t0 .
The constant interval ∆t is in control theory and control systems defined as the
sampling time in the digital controller. If we now are putting t = t0 + ∆t in the
solution (1.13) then we get
where ∆ is given by
The solution given by (1.16) and (1.17) is the starting point for making a discrete
time state space model for the system. In digital control systems discrete time mod-
els are very important. Discrete time models are also very important for simulation
purposes of a dynamic system.
Consider now the case where we let t0 in (1.16) and (1.17) take the discrete time
values
t0 = k∆t ∀ k = 0, 1, . . . , (1.18)
Note also that we usually are using symbols as A and B also for discrete time state
space models, e.g., so that the model (1.20) is written as
we will usually using the symbols A and B also for discrete time models. However,
in cases where there can be conflicts symbols as Φ and ∆ are used.
It is important to note that the steady state solution to a continuous time model
ẋ = Ax + Bu can be found by putting ẋ = 0. I.e., the steady state solution when
time approach infinity (t → ∞) is given by
ẋ = Ax + Bu = AeA(t−t0 ) z + Bu (1.27)
where we have used that x is given as in (1.25). Comparing (1.26) and (1.27) shows
that
This gives
ż = e−A(t−t0 ) Bu (1.29)
1.3 Linear transformation of state space models 5
where we have used that (eA )−1 = e−A . This gives the following solution for the
vector z, i.e.,
Z t
z(t) = z0 + e−A(τ −t0 ) Budτ. (1.30)
t0
This section is meant to show how the solution to the continuous time state equation
can be proved.
Let x be the state vector in the state space realization (A, B, D) such that
An equivalent realization of the system defined by (1.33) and (1.34) can be found
by choosing another basis for the state space (choosing another state). The state
vector x can be transformed to a new coordinate system. This can be done by
defining a non singular transformation matrix T ∈ Rn×n and the following linear
transformation,
x = T z ⇔ z = T −1 x (1.35)
These two state space realizations can be shown to be identical and represent the
same system. The two systems has the same transfer function from the input, u to
the output, y.
An infinite number of non singular transformation matrices T can be chosen.
This leads to an infinite number of state space model realizations. Some of these
realizations has special properties, e.g., state space models with special properties
can be found by choosing T properly.
1.4 Eigenvalues and eigenvectors 6
where the n coefficients p1 , p2 , . . . , pn−1 , pn are real values. These coefficients can be
found by actually expressing the determinant. The characteristic equation is defined
as
The n roots of the character polynomial and equivalently, the n solutions to the
characteristic equation, λi ∀ i = 1, . . . , n, is defined as the eigenvalues of the matrix
A. The characteristic equation has always n solutions and the matrix A ∈ Rn×n has
always n eigenvalues. The eigenvalues can be real or complex. If the eigenvalues are
complex, then they will consists of complex conjugate pair, i.e., if λk = α + jβ is an
eigenvalue, then λk+1 = α − jβ will also be an eigenvalue. The matrix A is said to
have multiple eigenvalues if two or more of the eigenvalues are identical.
The spectrum of the eigenvalues of the matrix A is defined as all the eigenvalues,
i.e. the collection σ(A) := {λ1 , λ2 , · · · , λn } of al the eigenvalues is the spectrum of
A.
The spectral radius of the matrix A is defined from the eigenvalue with the
largest absolute value, i.e., ρ(A) = max |λi | ∀ i = 1, . . . , n.
The following theorem is useful in linear algebra and system theory
The Cayley-Hamilton theorem states that the matrix A satisfies its own characteristic
polynomial, i.e., such that
An + pn An−1 + · · · + p2 A + p1 I = 0 (1.42)
Proof The prof is stated only for the case in which the eigenvector matrix M of A
is non-singular. An eigenvalue decomposition of A gives that A = M ΛM −1 where Λ
is a diagonal matrix with the eigenvalues λi ∀ i = 1, . . . , n on the diagonal. Putting
this into (1.42) gives
λni + pn λn−1
i + · · · + p2 λi + p1 = 0 ∀ i = 1, . . . , n (1.44)
1.4 Eigenvalues and eigenvectors 7
We will in this section study a method which can be used to compute the coefficients,
p1 , · · · , pn , in the characteristic polynomial of a n × n matrix A. This method is
referred to as Krylovs method, Krylov (1931).
If we multiply Equation (1.42) from right with a vector b ∈ Rn , then a linear
system of equations can be defined as
p
z }| {
Cn
p1
z }| { p2
b Ab · · · An−1 b . = −An b. (1.47)
.
.
pn
This equation, Cn p = −An b, can be solved with respect to the vector p of coefficients.
We have that
p = −Cn−1 An b (1.48)
if the vector b is chosen in such a way that the matrix pair (A, b) is controllable,
i.e.. in this case in such a way that the controllability matrix Cn is invertible (non-
singular).
An arbitrarily random vector b is here usually sufficient. Note that the solution
p generally is independent of the choice of b as long as the matrix Cn is invertible.
Note also that (1.42) can directly be written as the linear system of equations
Ap = −vec(An ) (1.49)
where
2 ×n
vec(An−1 ) ∈ Rn
A= vec(I) vec(A) · · · . (1.50)
1.5 Similarity Transformations and eigenvectors 8
B = T −1 AT (1.52)
Λ = M −1 AM (1.53)
where Λ is the eigenvalue matrix of the system (matrix A). The eigenvalue matrix
Λ os a diagonal matrix with the eigenvalues on the diagonal. This can equivalently
be written as
AM = M Λ (1.54)
where
M= m1 m2 · · · mn (1.55)
Am1 = λ1 m1
Am2 = λ2 m2
.. (1.56)
.
Amn = λn mn
If the matrix A and the eigenvalues λ1 , · · · , λn are known, then, the eigenvectors
and eigenvector matrix (1.55) can be found by solving the linear equations (1.56).
1.6 Time constant 9
Example 1.2 (Time response of a 1st order system and the time constant T )
In connection with the Time Constant consider a transfer function model of a 1st
order system y(s) = hp (s)u(s) where the transfer function is
K
hp (s) = . (1.61)
Ts + 1
The corresponding continuous state space model description is
1 K
ẋ = − x + u, (1.62)
T T
where K is the steady state system gain and T is the Time Constant.
The solution of the state eq. (1.62) is then given by the general solution in eq.
(1.10), i.e.
Z t
t−t t−τ K
− T0
x(t) = e x(t0 ) + e− T u(τ )dτ, (1.63)
t0 T
where t0 is the initial time. For simplicity of illustration assume that a unit step
u = 1 ∀ t0 ≤ t is feed into the system, initial time t0 = 0, the system gain K = 1
and zero initial state x(t0 ) = 0. The solution of eq. (1.63) is then
1 t − t−τ 1
Z
t−τ t
x(t) = e T dτ = [T e− T ]t0 = 1 − e− T (1.64)
T t0 T
We observe that the final state at time t = ∞ is x(∞) = 1 and that the value of the
state at time equal to the Time Constant, i.e. t = T is
x(T ) = 1 − e−1 ≈ 0.63. (1.65)
I.e. the value x(T ) of the state after t = T time units is equal to (the common) 63%
of the final value of the state x(∞) = 1. see Figure 1.1 for illustration of the step
response.
1.6 Time constant 10
Unit step response of 1st order system with T=10 and K=1
1
0.9
0.8
0.7
1−e−1
0.6
x(t)
0.5
0.4
0.3
0.2
0.1
0
0 10 20 30 40 50 60
Time 0 ≤ t ≤ 6T
T
Note also that the connection with the eigenvalues in a discrete time system
xk+1 = φx + δu, (1.68)
and the continuous equivalent
1
ẋ = − x + bu, (1.69)
T
then is given by
1
φ = e− T ∆t (1.70)
which gives that
∆t
T =− . (1.71)
ln φ
Methods in system identification can be used to identify discrete time models from
known input and output data of a system. Usually there are the parameters φ and
δ which are estimated (computed). The relationship (1.71) is therefore very useful
in order to find the time constant of the real time system.
1.7 The matrix exponent and the transition matrix 11
We have earlier in this section shown that that the transition matrix are involved
in the exact solution of a linear time invariant dynamical system. Consider the
autonomous system
ẋ = Ax (1.72)
with known initial value x0 = x(t0 = 0). Then the solution is given by
As we see, the problem of computing the transition matrix Φ(t), is the same problem
as computing the matrix exponent
F = eA . (1.75)
Let f (A) be an analytical matrix function of A which also should contain the eigen-
value spectrum of A. A more general formulation of the similarity transformation
given in (1.52) is then defined as
Assume now that we want to compute the matrix exponent eA . As we have shown
in Equation (1.53 the matrix A can be decomposed as
A = M ΛM −1 (1.77)
when the eigenvector matrix M is invertible. Using (1.77), (1.76) and f (A) = eA
gives
eA = M eΛ M −1 (1.78)
As we see, when the eigenvector matrix M and the eigenvalue matrix Λ of the matrix
A are known, then the matrix exponential eA can simply be computed from (1.78).
Equation (1.78) can be proved by starting with the autonomous system
ẋ = Ax (1.79)
with known initial state vector x(0). This system has the solution
ż = Λz (1.81)
1.7 The matrix exponent and the transition matrix 12
with initial state z(0) = M −1 x(0). The canonical (transformed) system (1.81) have
the solution
because we in this case do not explicitly have to compute the matrix inverse M −1 .
For some problems M is not invertible. This may be the case for systems which
have multiple eigenvalues. We are referring to Parlet (1976) for a more detailed
description of matrix functions and computing methods.
It can be shown, Parlet (1976), that the matrix exponent F = eA and the system
matrix A commutes, i.e. the following is satisfied
F A = AF (1.85)
If the matrix A has a special structure, e.g., upper or lower triangular, then Equation
(1.7.2) can with advantage be used in order to compute the unknown elements in
the transition matrix.
Note that the matrix exponential of an upper triangular matrix
a11 a12
A= , (1.86)
0 a22
is given by
ea11 f12
F = eA = . (1.87)
0 ea22
The unknown coefficient f12 can then simply be found from equation ().
ẋ = Ax, (1.88)
F = eAt (1.90)
We now have to find the unknown constant f12 in the transition matrix. This can
be done from the equation system
AF = F A. (1.92)
This gives four equations but only one of them gives information of interest,
e λ1 t − e λ2 t
f12 = α (1.94)
λ1 − λ2
As we see, this method can simply be used for system matrices which have a tri-
angular structure, and in which the eigenvalues are distinct and not identical to
zero.
ẋ = Ax, (1.97)
1.8 Examples 14
where the initial state x0 = x(0) is given and the system matrix is given by
0 α
A= . (1.98)
0 0
The transition matrix for this system is simply found from the two first terms of
the Taylor series (1.96) because A is so called nil-potent, i.e., we have that A2 = 0,
A3 = 0 and so on. We have
1 αt
Φ(t) = I + At = . (1.99)
0 1
1.8 Examples
ẋ = ax (1.100)
Let us now plot the solution in the time interval 0 ≤ t ≤ 25. Note that the state
will have approximately reached the steady state value after 4T (four times the time
constant). The solution is illustrated in Figure 1.2.
Autonom respons
1
0.9
0.8
0.7
0.6
0.5
x
0.4
e−1=0.37
0.3
0.2
0.1
0
0 5 10 15 20 25
Tid [s]
T=5
Autonom respons
1
0.9
0.8
0.7
0.6
0.5
x
0.4
e−1=0.37
0.3
0.2
0.1
0
0 5 10 15 20 25
Tid [s]
T=5
The eigenvalue matrix Λ and the corresponding eigenvector matrix can be shown to
be as follows
1 1 −1 0
M= , Λ= (1.103)
2 −1 0 −4
F M = M eΛ (1.104)
which gives
e−1 0
f11 f12 1 1 1 1
= (1.105)
f21 f22 2 −1 2 −1 0 e−4
Taking element 1, 1 minus element 1, 2 on the left hand side of Equation (1.106)
gives
Putting the expression for f12 into element 1, 2 on the left hand side gives f11 , i.e.,
which gives
1
f11 = (e−1 + 2e−4 ) (1.109)
3
Taking element 2, 1 minus element 2, 2 on the left hand side of (1.106) gives
Putting the expression for f22 into e.g., element 2, 2 gives f21 . This gives the final
result
−1
e + 2e−4 e−1 − e−4
A 1
F =e = (1.111)
3 2e−1 − 2e−4 2e−1 + e−4
Note that the transition matrix could have been computed similarly, i.e.,
−t
e + 2e−4t e−t − e−4t
At Λt −1 1
Φ(t) = e = M e M = (1.112)
3 2e−t − 2e−4t 2e−t + e−4t
ẋ = Ax, (1.113)
where the initial state x0 = x(0) is given and where the system matrix is given by
λ1 α
A= . (1.114)
0 λ2
The transition matrix Φ(t) = eAt will have the same upper triangular structure as
A and the diagonal elements in Φ(t) is simply e−λ1 t and e−λ2 , i.e.,
λt
e 1 f12
Φ(t) = . (1.115)
0 eλ2 t
The unknown element f12 can now simply be computed from Parlets method, i.e.,
we solve the equation
or equivalent
ΦA = AΦ. (1.117)
1.8 Examples 17
Example 1.8 (Set of higher order ODE to set of first order ODE)
Consider a system described be the following couple of coupled differential equations
ÿ1 + k1 ẏ1 + k2 y1 = u1 + k3 u2
ẏ2 + k4 y2 + k3 ẏ1 = k6 u1
where u1 and u2 is defined as the control inputs and y1 and y2 is defined as the
measurements or outputs
We now define the outputs and if necessary the derivatives of the outputs as
states. Hence, define the states
x1 = y1 , x2 = ẏ1 , x 3 = y2 (1.121)
This gives the following set of 1st order differential equations for the states
ẋ1 = x2 (1.122)
ẋ2 = −k2 x1 − k1 x2 + u1 + k3 u2 (1.123)
ẋ3 = −k5 x2 − k4 x3 + k6 u1 (1.124)
y1 = x 1 (1.125)
y2 = x 3 (1.126)
ẋ = Ax + Bu (1.127)
y = Dx (1.128)
1.9 Transfer function and transfer matrix models 18
Using (1.129) and the definition (1.130) in the state space model
For single-input and single-output systems then H(s) will be a scalar function of
the Laplace variable s. In this case we usually are using a small letter, i.e., we are
putting h(s) = H(s). Note also that we have included a direct influence from the
input u to the output y in the measurement (output) equation. This will be the
case in some circumstances. However, the matrix or parameter E is usually zero in
control systems, in particular E = 0 in standard feedback systems.
Note also that when the eigenvalue decomposition A = M ΛM −1 exists then we
have that the transfer matrix can be expressed and computed as follows
Finally note the following important relationship. The properties of a time de-
pendent state space model when t → ∞, i.e. the steady state properties, can be
analyzed in a transfer function Laplacian model by putting s = 0. The transient
behavior when t = 0 is analyzed by letting s → ∞.
For Single Input and Single Output (SISO) systems we often write the plant
model as
ρ(s)
hp (s) = D(sI − A)−1 B + E = , (1.139)
π(s)
where ρ(s) is the zero polynomial and π(s) is the pole polynomial
1.10 Poles and zeroes 19
For a Single Input Single Output ( SISO) system we may write the transfer function
model from the control input, u, to the output measurement, y,as follows
π(s) = 0. (1.142)
The zeroes of the system is given by the roots of the numerator zero polynomial, i.e.
ρ(s) = 0. (1.143)
Remark that the n poles is the n roots of the pole polynomial π(s) = 0 and
that these n poles is identical to the n eigenvalues of the A matrix and that the
pole polynomial also may be deduced from the system matrix A of an equivalent
observable and controllable state space model, i.e.,
For the poles to be equal to the eigenvalues of the A matrix the linear state space
model ẋ = Ax + Bu and y = Dx have to be a minimal realization, i.e., the model is
both controllable and observable.
A time delay (or dead time) in a system may in continuous time domain be described
as follows. Suppose a variable y(t) is equal to a variable x(t) delayed τ ≥ 0 time
units. Then we may write
Notice that the exponential e−τ s is an irrational function and that we can not do
algebra with such functions, and that rational approximations to the exact delay
have to be used if a delay should be used in algebraic calculations.
Numerous approximations exist and may be derived from the series approxima-
tion of the exponential.
1.12 Linearization 20
1.12 Linearization
In many cases the starting point of a control problem or model analysis problem is
a non-linear model of the form
∆x = x − x0 , (1.150)
∆u = u − u0 . (1.151)
Putting (1.149), (1.150) and (1.151) into the state equation (1.147) gives the
linearized state equation model
˙ = A∆x + B∆u + v,
∆x (1.154)
where
Usually the points x0 and u0 is constant steady state values such that
Now defining
y0 = g(x0 , u0 ) (1.159)
∆y = y − y0 (1.160)
∂g
D = (1.161)
∂xT
x ,u
0 0
∂g
E = (1.162)
∂uT
x0 ,u0
x := x − x0 , (1.164)
u := u − u0 . (1.165)
Hence, a linear or linearized state space model, given by (1.157) and (1.163), is
usually written as follows.
ẋ = Ax + Bu, (1.166)
y = Dx + Eu. (1.167)
One should therefore note that the variables in a linearized model may be deviation
variables, but this is not always the case. One should also note that only linear
models can be transformed to Laplace plane models. Note also that the initial state
in the linearized model is given by ∆x(t0 ) = x(t0 ) − x0 .
from this definitions we have that ẋ1 = θ̇ = x2 which gives the state space model
ẋ1 = x2 , (1.171)
g b
ẋ2 = − sin(x1 ) − x2 , (1.172)
r mr2
which is equivalent to a non-linear model
ẋ = f (x) (1.173)
ẋ = Ax, (1.175)
Note that the linearized model could have been obtained more directly by using that
sin(x1 ) ≈ x1 for small angles x1 .
ẋ1 = x2 , (1.178)
g b
ẋ2 = − sin(x1 ) − x2 , (1.179)
r mr2
with g = 9.81, r = 5, m = 8 and b = 10 can be simply simulated in MATLAB by
using an ODE solver, e.g.,
Here sol is an object where sol.x is the time axis and sol.y is the states. The ode15s
function simulate the pendulum model over the time horizon t = t0 : h : tf , i.e.
from the initial time t0 = 0 and to the final time tf = 50 with step length (sampling
interval) ∆t = 0.1. Try it! The file fx pendel is an m-file function given in the
following
1.12 Linearization 23
function fx=fx_pendel(t,x)
% fx_pendel
% fx=fx_pendel(t,x)
% Modell av pendel.
fx=zeros(2,1);
fx(1)=x(2);
fx(2)=-b*x(2)/(m*r^2)-g*sin(x(1))/r;
This may for instance be done by using an approximation to the derivative, e.g.
as the simple approximation (or similar)
f (xi + h) − f (xi )
A(:, i) ≈ ∀ i = 1, 2, ..., n (1.183)
h
where A(:, i) is MATLAB notation for the entire i − th column of the A matrix.
The cost of this procedure for numerically calculating the Jacobian matrix are n + 1
function evaluations. This numerical procedure to calculate the Jacobian matrix is
implemented in the following MATLAB jacobi.m function.
1.12 Linearization 24
function A=jacobi(fx_fil,t,x)
%JACOBI Function to calculate the Jacobian matrix numerically
% A=jacobi(’fx_file’,t,x)
% PURPOSE
% Function to calculate the Jacobian matrix A=df/dx of the nonlinear
% function fx=f(t,x), i.e. the linearization of a possible non-linear
% function fx=f(t,x) around values t and x.
% ON INPUT
% fx_file - m-file to define the function fx=f(t,x) with
% syntax: function fx=fx_file(t,x) where fx is,
% say m dimensional
% t - time instant.
% x - column vector with same dimension as in the function
% fx=f(t,x), say of dimension n
% ON OUTPUT
% A - The jacobian matrix A=df/dx of dimension (m,n)
h=1e-5;
n=length(x);
xh=x;
fx=feval(fx_fil,t,x);
m=length(fx);
A=zeros(m,n);
for i=1:n
xh(i)=x(i)+h;
fxh=feval(fx_fil,t,xh);
xh(i)=xh(i)-h;
A(:,i)=(fxh-fx)/h;
end
% END JACOBI
>> A=jacobi(’fx_pendel’,0,[0;0])
A =
0 1.0000
-1.9620 -0.0500
>>
1.13 Stability of linear systems 25
• The discrete time linear system described by Eq. (1.187) is stable if the eigen-
values of the system matrix A is located inside the unit circle in the complex
plane. This is equivalent to check wether the eigenvalues has magnitude less
than one, i.e., |λi | < 1 ∀ i = 1, . . . , n.
1.14 State Controllability 26
• If one (or more) of the eigenvalues have magnitude equal to one, we have an
integrator (or integrators) in the system (if the eigenvalue are real).
The eigenvalues of the system matrices are simply given by a complex conjugate
pair of eigenvalues, i.e., λ1,2 = −α ± βi. This system is then stable for all α > 0.
The eigenvalues may simply be found as the elements on the diagonal of the A
matrix for this example, but in general as the roots of the characteristic equation
det(λI − A) = λ2 + 2αλ + α2 + β 2 = 0.
The transfer function model is y = h(s)u with
s+α
h(s) = D(sI − A)−1 B = (1.190)
s2 + 2αs + α2 + β 2
The question of how we can (and if there is possible to) find a suitable control
input u(t) that will take the system from an initial state x(t0 ) to any desired final
state x(t1 ) in a finite (often very small) time, is answered by the theory of state
controllability.
There exist a few algebraic definitions which can be used for the analysis of state
controllability. Such a theorem is defined via the so called controllability matrix.
Cn = B AB A2 B · · · An−1 B
(1.191)
rank(Cn ) = n. (1.192)
Note that for single input systems, i.e., r = 1, then Cn ∈ Rn×n which implies that
Cn should be invertible and that det(Cn ) 6= 0 in order for the system to be state
controllable.
1.15 State Observability 27
ż = Λz + M −1 Bu (1.193)
y = DM z + Eu (1.194)
where Λ is a diagonal
matrix with the eigenvalues λi ∀ i = 1, . . . n of A on the
diagonal and M = m1 · · · mn is the corresponding eigenvector matrix. Note
the relationship Ami = λi mi between the ith eigenvalue, λi , and the ith eigenvector,
mi .
The system is controllable if no rows in the matrix M −1 B is identically equal to
zero.
One should also note that there also is a dual phenomena, observability. The
system is observable if no columns in the matrix DM is identically equal to zero.
The pair (D, A) is observable if and only if the observability matrix Oi for i = n has
rank n, i.e. rank(On ) = n.
If rank(D) = rD ≥ 1 and n − rD + 1 > 0, then we have that the pair (D, A) is
observable if and only if the reduced observability matrix On−rD +1 have rank n. For
single output systems we use i = n and On ∈ n × n.
4
ẋ = Ax, (1.196)
y = Dx (1.197)
1.15 State Observability 28
y = Dx (1.198)
ẏ = DAx (1.199)
2
ÿ = DA x (1.200)
..
. (1.201)
(n−1)
y = DAn−1 x (1.202)
(n−1) (n−1)
dn−1 y
where y denotes the n − 1th derivative of y, i.e., y =
dtn−1
. From these n
equations we define the following matrix equation
y0|n = On x (1.203)
where
y
ẏ
ÿ
y0|n =
..
(1.204)
.
(n−1)
y
and where On ∈ Rn×n observability matrix as defined in the above definition, Equa-
tion (1.195). If the observability matrix, On , is non-singular then we can compute
the state vector x(t) as
yk = Dxk (1.208)
yk+1 = DAxk (1.209)
2
yk+2 = DA xk (1.210)
..
. (1.211)
n−1
yk+n−1 = DA x (1.212)
yk|n = On xk (1.213)
1.15 State Observability 29
where
yk
yk+1
yk|n = yk+2 (1.214)
..
.
yk+n−1
and where On ∈ Rn×n observability matrix as defined in the above definition, Equa-
tion (1.195). If the observability matrix, On , is non-singular then we can compute
the state vector xk as
Canonical forms
2.1 Introduction
• System identification. If we want to fit a model to real system input and output
data, then it may be more easy to find the best model parameters such that
the model output is as similar to the real output data, if we have as few free
2.2 Controller canonical form 31
We are in the following not considering diagonal and block diagonal forms, i.e.,
so called eigenvalue canonical form. The most common canonical forms in system
theory are as follows:
Only single input single output (SISO) systems are considered in this section. In
order to illustrate the controller canonical form consider a transfer function model
with n = 3 states, i.e.,
b2 s2 + b1 s + b0
G(s) = (2.1)
s3 + a2 s2 + a1 s + a0
y(s) = G(s)u(s) (2.2)
In order to show this we can write down a block diagram for the system based on the
two model representations and show that the resulting block diagram is the same.
Another method for proving the equivalence is to compute the transfer function
model from the state space model.
The above state space model realization is not unique. For instance rows and
columns in the model matrices can be interchanged. This can be easily done by a so
2.2 Controller canonical form 32
It should be noted that it this last state space form which is referred to as controller
canonical form.
Those two canonical forms, i.e., the formulation given by (2.54) and (2.4) and the
formulation given by (2.12) and (2.7) are essentially identical state space canonical
forms.
b1 s + b0
G(s) = (2.8)
s2
+ a1 s + a0
y(s) = G(s)u(s) (2.9)
The simplest is to prove this by taking the Laplace transformation of the state space
model Eq. (2.11).
2.3 Controllability canonical form 33
If the system is controllable, then a non singular trnaformation matrix can be ob-
tained directly from the controllability matrix. Define the transformation matrix
T = Cn (2.18)
2.4 Observer canonical form 34
The method described above will often also work for systems with multiple inputs.
Note that the controllability matrix, Cn , is an (n × nr) matrix. A transformation
matrix T can often be taken directly as the n first columns in Cn . However, a
problem which may occur is that the n first columns is linearly dependent and
that the transformation matrix T thereby becomes singular. However, when the
system is controllable then we can obtain n linearly independent columns from the
controllability matrix Cn ∈ Rn×nr , and take the transformation matrix T as those
columns.
Remark 2.1 It is worth noticing that for SISO systems, a controllable canonical
form state space model can be obtained by first constructing the extended controlla-
bility matrix
Cn+1 = B AB · · · An−1 B An B
(2.20)
Given the transfer function model as presented in the above Section, 2.2.1, i.e.,
b2 s2 + b1 s + b0
G(s) = (2.22)
s3 + a2 s2 + a1 s + a0
y(s) = G(s)u(s)
2.4 Observer canonical form 35
A state space model on observer canonical form can be developed from the transfer
function model as presented in the following. Equation (2.22) can be written as
follows
y(s) b2 s−1 + b1 s−2 + b0 s−3
=
u(s) 1 + a2 s−1 + a1 s−2 + a0 s−3
by multiplying the denominator and nominator in Equation (2.22) with s−3 . This
gives
y(s) = (b2 u(s) − a2 y(s))s−1 + (b1 u(s) − a1 y(s))s−2 + (b0 u(s) − a0 y(s))s−3 (2.23)
Putting the definitions, (2.24)-(2.26), into the expression given by Equation (2.23)
gives that y(s) = x1 (s), as is exactly the same as the definition, Equation (2.27).
This means that the model given by the definitions, Equations (2.24)-(2.26), is an
equivalent representation of the original transfer function model, Equation (2.22).
Transforming the model given by Equations (2.24)-(2.27) to the state space (inverse
Laplace transformation) gives
ẋ1 = −a2 x1 + x2 + b2 u
ẋ2 = −a1 x1 + x3 + b1 u
ẋ3 = −a0 x1 + b0 u
y = x1
The last state space model can simply be written on so called observer canonical
form, Hence we have
−a2 1 0 b2
ẋ = −a1 0 1 x + b1 u
−a0 0 0 b0
y = 1 0 0 x (2.28)
of the sinusoid process. The sinusoid time domain description of the process can in
the Laplace plane be written as follows, see e.g. (se Edgar et al (1989), s. 47)
ω
y(s) = u(s)
ω 2 + s2
where u(s) = 1, is an unit impulse at time t = t0 , e.g. at time t0 = 0. This Laplace
formulation can be written as
here, we define
s2 y(s) = s2 x1 ⇒ y = x1
sx2 = ωu(s) − ω 2 y(s) ⇒ ẋ2 = ωu(t) − ω 2 y(t)
s2 x1 = sx2 ⇒ ẋ1 = x2
s sin(φ) + ω cos(φ)
y(s) = u(s)
s2 + ω 2
Using (2.11) gives an equivalent state space model
0 1 0
ẋ = x+ u (2.34)
−ω 2 0 1
y = ω cos(φ) sin(φ) x (2.35)
where u(t) is a unit impulse. In this example we have used the results in Example
2.1.
2.5 Observability canonical form 37
Hence, eq. (2.43) is a 2nd order (n = 2 states) state space model on observer
canonical form.
T = OL (1 : n, :)
when this choice is non singular. This will always hold for SISO observable systems.
Step 2: An observability canonical form state space model is then given by
where
Oc = OL T −1 (2.48)
Note that Oc = I for single output systems. This is not the case for multiple output
systems.
This Algorithm 2.5.1 works for multiple output and multiple input (MIMO)
systems. The critical step is step 1. For systems with multiple outputs it is not sure
that the n first rows in OL is linearly independent. In such cases one have to search
through OL in order to obtain n linearly dependent rows, and use this rows as a
basis for T .
s2 y = −a0 y − a1 sy + b0 u (2.50)
| {z }
sx2
| {z }
s 2 x1
s2 x1 = sx2 ⇒ ẋ1 = x2
sx2 = −a0 y − a1 sy + b0 u ⇒ ẋ2 = −a0 x1 − a1 x2
s2 y = s2 x1 ⇒ y = x1
2.6 Duality between canonical forms 39
From this we find the following 2nd order state space model on observability canonical
form
0 1 0
ẋ = x+ u (2.51)
−a0 −a1 b0
y = 1 0 x (2.52)
x1
where x = is the state vector.
x2
The simplest way to prove this is to go from the state space form (2.55) to the
transfer function model (2.53).
We are in the following going to discuss the principle of duality between canonical
form and state space representations. The importance of this is that it normally
is enough to learn one method of how to transform a given state space model to
canonical form. The reason for this is because the duality principle can be used to,
e.g., transform an observer canonical form to a controller canonical form. There is
a duality between the observer and controller canonical forms.
A closer study of the controller and observer canonical forms, and the controllability
and observability canonical forms, shows that those are what we call dual canonical
forms.
Let xc be the state vector for the system in controller canonical form, (index c
for controller form) with realization (Ac , Bc , Dc ), i.e.,
ẋc = Ac xc + Bc u (2.56)
y = Dc xc (2.57)
Tc = Cn M (2.58)
2.6 Duality between canonical forms 40
where M is an upper triangular Toeplitz matrix formed from the coefficients in the
characteristic polynomial.
Similarly, let xo be the state vector for a system on observer canonical form,
(index o for observer form) with realization (Ao , Bo , Do ), i.e.,
ẋc = Ao xo + Bo u (2.59)
y = Do xo (2.60)
The transformation matrix, T , that transforms a given realization (A, B, D) to so
called observer canonical from is then given by
To = On−1 (M T )−1 (2.61)
where M is the Toplitz matrix.
Comparing the two canonical forms we find the following connections:
In the same way, there is a duality between controllability and observability canonical
forms.
As we have shown,
Tco = Cn (2.63)
where Cn is the controllability matrix of the system, is the transformation matrix
which transform a given realization (A, B, D) to controllable canonical form, given
by
ẋco = Aco xco + Bco u (2.64)
y = Dco xco (2.65)
where index co denotes controllability form. In the same way
Tob = On−1 (2.66)
is the transformation matrix x = T xob which transforms a given realization (A, B, D)
to so called observability canonical form, given by
2.7 Examples
u = −G(xs − x) + us (2.71)
G = g1 g2 (2.72)
in such a way that the closed loop system has the eigenvalues (poles) given by s1 and
s2 .
Solution: The closed loop system is described by
us
ẋ = (A + BG)x + B − GB (2.73)
xs
−a − 1 + g1 −a2 + g2
A + BG = (2.74)
1 0
Note that the closed loop system matrix, A+BG, also is on controller canonical form.
An expression for the eigenvalues can be found from the characteristic equation, i.e.
s + a1 − g1 a2 − g2
|sI − (A + BG)| = = s2 + (a1 − g1 )s + a2 − g2 = 0 (2.75)
−1 s
If the eigenvalues of the closed loop system should be s1 and s2 then the closed loop
characteristic equation must be være
a2 − g2 = s1 s2 (2.77)
a1 − g1 = −(s1 + s2 ) (2.78)
This gives the coefficients g1 and g2 in the controller as a function of the prescribed
eigenvalues s1 and s2 and the system parameters a1 and a2 . We have
g2 = a2 − s1 s2 (2.79)
g1 = a1 + s1 + s2 (2.80)
ẋ = Ax + Bu (2.81)
y = Dx + Eu (2.82)
2.7 Examples 42
where
−4 3 2 1
A = 2 −6 1 B= 2
(2.83)
1 2 −8
3
D = 2 −1 1
We will in this example compute all the four canonical forms which are described in
this section. Nota that the results would have been the same if the given state space
form had been a discrete time system. A MATLAB script for the computations of
the canonical forms is given in Example 2.9. Running the script within MATLAB
gives the following results.
Controller canonical form (cof ):
−18 −94 −113 1
Akrf = 1 0 0 Bkrf = 0
(2.84)
0 1 0 0
Dkrf = 3 58 279
Akof = ATksf T
Bkof = Dksf T
Dkof = Bksf
(2.88)
Akef = ATkrf T
Bkef = Dkrf T
Dkef = Bkrf
2.8 Summary
It is worth noticing that the problem of computing canonical forms is sensitive for
numerical errors. This is mostly a problem in MIMO systems. Even for controllable
and observable systems, the transformation matrix, T , constructed from independent
columns in the controllability matrix (ore rows in the observability matrix) may be
close to singular.
Note also that the system must be controllable for the controller and controllable
canonical forms to exists. Similarly, the system must be observable for the observer
and observability canonical forms to exists.
The parameters in a canonical form may be very sensitive to perturbations. This
can results in a poor choice for using the canonical form in a prediction error system
identification method. In some circumstances there may be impossible to find a
canonical form. This problem may occur for MIMO systems and is usually not a
problem for SISO systems.
2.8 Summary 44
There exists other essentially unique state space model realizations with good
numerical properties. The most common is balanced realization, input normal real-
ization and output normal realization. Those realizations are computed through a
singular value decomposition. This is not a topic here.
Part II
r - i e- u- y -
hc (s) hp (s)
−6
Figure 3.1: Standard feedback system. Plant described by a transfer function model
hp (s) and controller transfer function hc (s).
In Figure 3.1 y is the measured plant output assumed for simplicity to be equal
to the desired output. Often in the feedback path there is an implementation of the
function ym = hm (s)y where ym is the measurement of the desired output y. Here
we assume, as explained, that the measurement system is exact and that hm (s) = 1
and that ym = y. In Figure 3.1 r is the specified reference for the plant output. The
error difference e = r − y is the input signal to the controller represented by the
transfer function hc (s). Here the true plant is represented with a transfer function
model hp (s). In the following we will study this standard feedback system.
3.3 Standard feedback systems with disturbances 47
r - i e- u- ? y
hc (s) hp (s) - i -
−6
Figure 3.2: Standard feedback system with disturbance v at the output. Plant
described by a transfer function model hp (s), disturbance model hv (s) and controller
transfer function hc (s).
Hence, the plant may be influenced both from the control input u and an external
disturbance v. The plant is illustrated with the dashed
v box in Figure 3.3.
Plant ?
HH
H hv (s)
r - i e- u- y-
hp (s) - i
?
hc (s)
−6
Figure 3.3: Standard feedback system with disturbance v at the output. Plant
described by a transfer function model hp (s), disturbance model hv (s) and controller
transfer function hc (s). Plant indicated with the dashed box.
We will in this section present a simple and direct method for PID controller tun-
ing and design. The method is very simple and intuitive and leads to a practical
and robust method which also give very good results. The method is based on an
approximate model of 1st or 2nd order with time delay or inverse response. If the
3.4 Simple PID tuning rules 48
v
Plant Measurement
HH ? HH w
H
H hv (s)
r - i e- u- y - ? ym
hp (s) - i hm (s) - i -
?
hc (s)
−6
Figure 3.4: Standard feedback system with disturbance v at the output. Plant
described by a transfer function model hp (s), a disturbance model hv (s) and con-
troller transfer function hc (s). Plant indicated with the dashed box. The actual
measurement ym is related to the desired output y as ym = hm (s)y + w where w is
measurement noise.
process is approximated with a 2nd order model with time delay then a PID con-
troller is the result, but if a 1st order model with time delay is used a PI controller
is the result. Hence, the resulting controller is defined by the starting point which
is the approximate model. Only stable models is considered,
Consider an approximate 2nd order model with time delay given by the following
transfer function
e−τ s
hp (s) = k . (3.1)
(1 + T1 s)(1 + T2 s)
or with inverse response as follows
1 − τs
hp (s) = k , (3.2)
(1 + T1 s)(1 + T2 s)
Note that (3.2) is an approximation of the exact time delay model (3.1) because,
e−τ s ≈ 1 − τ s. (3.3)
The method can still be used if the second time constant, T2 = 0. Then we have
an approximate model of the form
e−τ s 1 − τs
hp (s) = k ≈k . (3.4)
1 + T1 s 1 + T1 s
If the starting point is a more complicated higher order model or you have
identified a higher order model from data by system identification methods such as,
e.g. DSR, then a 1st or 2nd order model approximation can be constructed by model
reduction techniques. System identification methods can possibly also be used to
construct a lower order model directly.
In the above low order models the parameter τ represents the effective time delay
or the inverse response time and the time constant T1 ≥ T2 ≥ 0 is the dominant time
constant. Note that many higher order models with time delay can be approximated
by a 1st or 2nd order model with time delay. A method for model reduction which
is to be used in this section is the half-rule.
3.4 Simple PID tuning rules 49
As an introductory example of the half-rule consider the system (3.1) or (3.2) and
assume that this system do not have dominant 2nd order dynamics, then this model
can with advantage be approximated with a 1st order model with inverse response
as given in the following model (3.5).
1 − τs
hp (s) = k , (3.5)
1 + T1 s
where we from the half rule find the parameters
T1 := T1 + 12 T2 , (3.6)
1
τ := τ + 2 T2 . (3.7)
The half rule says that the neglected smallest time constant T2 is distributed evenly
over the remaining time constant T 1 and the time delay or inverse response time τ .
The model (3.5) is a very good starting point for the tuning of a PI controller.
If the system has dominant 2nd order dynamics in such a way that it is not wise to
neglect T2 , then we use a 2nd order model of the form (3.2) and designing a PID
controller.
T1 := T1 , (3.13)
1
T2 := T2 + T3 , (3.14)
2
1
τ := τ + T3 + T4 . (3.15)
2
3.4 Simple PID tuning rules 50
e−5s
h1a
p (s) = 2 , (3.17)
1 + 8s
i.e., the time constant is T = 6 + 21 4 = 8 and the time delay is τ = 12 4 + 2 + 1 = 5.
e−5s
Remark: a better 1st order approximation at high frequencies will be h1a
p (s) = 2 1+10s .
e−2s
h2a
p (s) = 2 , (3.18)
(1 + 6s)(1 + 5s
0.5
−0.5
−1
−1.5
0 5 10 15 20 25 30 35 40 45
Time
Figure 3.5: Step response of model hp (s) and the 1st and 2nd order model approx-
imations in Example 3.2 The time delay is approximated with an inverse response
term in the responses, i.e. e−τ s ≈ 1 − τ s.
Let us specify the response from the reference signal, r, to the measurement output,
y, as follows
y 1 − τs
= . (3.19)
r 1 + Tc s
3.4 Simple PID tuning rules 51
r e u y
hc (s) hp (s)
Figure 3.6: Standard feedback system with process hp (s) and controller hc (s).
here Tc is a user specified time constant for the set-point response. The choice for
Tc will be discussed later but it is natural to chose it related to the time delay
or inverse response time τ . It is nothing to do with a transport delay or inverse
response phenomena in a process (when the process already is designed), hence the
time delay ore inverse response must also be in the set point response yr . This is the
reason for the numerator polynomial 1 − τ s in (3.19).
We also know from the block diagram in Figure 3.6 of the control system that
y hp hc
= , (3.20)
r 1 + hp hc
where hc (s) is the transfer function for the controller, which at this stage is unknown.
Solving for the controller gives
y
1 r 1 1
hc (s) = y = 1 . (3.21)
hp (s) 1 − r hp (s) y −1
r
Putting the transfer functions (3.19) and (3.2) (or (3.5)) into the expression (3.21)
for the controller, hc (s). This gives the following controller
1 T1 1 + T1 s
hc (s) = (1 + T2 s). (3.22)
k Tc + τ T1 s
This is a so called cascade formulation of a PID controller.
1 + Ti s
hc (s) = Kp (1 + Td s), (3.23)
Ti s
where the parameters in the cascade PID controller are given by
1 T1
Kp = , (3.24)
k Tc + τ
Ti = T1 (3.25)
Td = T2 . (3.26)
Derivative action is usually only recommended for systems with dominant 2nd order
dynamics, i.e. with a large time constant T2 , say large relative to the time delay and
in case where T2 > τ is a rule of thumb. Notice also in connection with this that in
case of high frequent noise on the output, it make sense to skip derivative action in
order not to amplify noise on the control action and to the system.
Note that if we instead have used (3.5)) in (3.21) then a PI controller
1 + Ti s
hc (s) = Kp , (3.27)
Ti s
3.5 PID controller for oscillating process 52
with parameters as given in (3.24) and (3.25) have been the result.
At this stage the only unknown parameters in the controller settings is the time
constant Tc for the set point response. We can for many processes chose Tc equal
(ore grater) then the time delay or the inverse response time τ . Hence, a simple
choice is simply
Tc = τ. (3.28)
3.4.3 Choice of Tc
Locking at the formula (3.27) for Kp shows us that it may be natural to force the
term TcT+τ
1
to be positive. Hence we must chose Tc + τ > 0. This means that Tc can
be chosen relatively within wide ranges −τ < Tc < ∞. However, an optimal setting
for Tc will be a trade of between:
2. Stability and robustness and using a small amount of control u. This is favored
by a small value of Tc .
Tc ≥ τ. (3.30)
e−τ s
hp (s) = k , (3.32)
τ02 s2 + 2τ0 ξs + 1
where ζ is the relative damping, τ0 = ω1 determines the speed of response, and where
ω is the natural frequency. Remark that when ζ = 1 we have two real poles/time
constants and a pole polynomial τ02 s2 + 2τ0 ξs + 1 = (τ0 s + 1)2 .
3.6 ID controller for systems with no damping 53
Note that ξ < 1 gives oscillating process dynamics. The poles of the system is
given by
p
−ξ ± ξ 2 − 1
s= . (3.33)
τ0
We see that the poles becomes complex when ξ 2 − 1 < 0 and that the dynamics may
be oscillating in this case. It is possible with oscillating dynamics when ξ is negative
and with |ξ| < 1 but in this cases we must have τ0 < 0 in order for the system to be
stable.
The period time of the oscillations, Pu , is given by
2π
Pu = p τ0 . (3.34)
1 − ζ2
Ti = 2τ0 ξ (3.37)
τ0
Td = (3.38)
2ξ
Hence, as we see (3.35) is an ideal PID controller.
Notice that the above PID controller is valid for under-damped processes where
the relative damping is 0 < ξ < 1. When xi = 1 we have two real poles and both a
PI and a PID controller may be used. The case without damping, i.e. when xi = 0
needs to be analyzed separately as in the next subsection.
In this section we study pure oscillating systems, that is systems with no damping
and where ξ = 0. This could be the case for a spring or a pendulum without friction.
A linearized process model for such a process could be
e−τ s
hp (s) = k . (3.39)
τ02 s2
+1
Putting (3.39) and (3.19) into (3.21) gives the following controller
1 τ02
hc (s) = + s, (3.40)
k(Tc + τ )s k(Tc + τ )
3.7 PI Control of first order process 54
Kp
hc (s) = Kp + + Kp Td s, (3.41)
Ti s
where the proportional gain is as in (3.36) and
Kp 1
= , (3.42)
Ti k(Tc + τ )
τ02
Kp Td = (3.43)
k(Tc + τ )
Hence, this result is consistent with the above result for systems without damping
and ξ = 0.
In some simple cases the process may be modeled by a 1st order process
1
hp (s) = k , (3.44)
1 + Ts
where k is the gain and T the time constant.
For such processes one may add a fictive time delay, τ , due to un-modeled effects
and time delay due to sampling, and it make sense to add a time delay τ ≥ ∆t2 where
∆t is the sampling interval.
However, we will in this section use the simple controller tuning method directly
from the 1st order model (3.44).
Let us specify the closed loop response as
y 1
(s) = , (3.45)
r 1 + Tc s
where Tc is a user specified time constant for the closed loop response from r to y.
Putting (3.44) and (3.45) into (3.21) gives the following controller
T 1 + Ts 1 + Ti s
hc (s) = = Kp (3.46)
kTc T s Ti s
which is a PI controller with
T
Kp = (3.47)
kTc
Ti = T (3.48)
3.8 Integrating process with time delay 55
e−τ s
hp (s) = k , (3.49)
s
which is an integrator process with time delay. Note that we may approximate Eq.
(3.49) as an inverse response with τ ≥ 0. Using the method for a process y = hp (s)u
leads to a P-controller with proportional gain
1 1
Kp = = , (3.50)
k(Tc + τ ) 2kτ
Figure 3.7: Standard feedback system with disturbance at the input. Plant described
by a transfer function model hp (s) and controller transfer function hc (s).
A P-controller will give set-point error for disturbances at the input, i.e. for
systems y = hp (s)(u + v) because the response from the disturbance to the output
then is given by
y y
r
(s) v
(s)
z }| { z }| {
hc hp hp
y= r+ v. (3.51)
1 + hc hp 1 + hc hp
Locking at the response from the disturbance, v, to the output, y, for a process
−τ s
hp = k e s and a P-controller, i.e., hc = Kp gives,
−τ s
y ke s
(s) = −τ s . (3.52)
v 1 + Kpk e s
3.8 Integrating process with time delay 56
1
y=r+ v. (3.53)
Kp
Table 3.1: PI-controller settings for an integrating plus time delay process hp (s) =
−τ s
k e s with gain, k, and time delay τ ≥ 0. Setting 1 is the Skogestad IMC (SIMC)
setting. Settings 2 is suggested by Haugen and settings 3 are proposed in this note.
The process model, hp , used for the derivation of the settings and the corresponding
relative damping factor ζ used are indicated in the table for completeness.
Kp Ti hp (s) ζ
1 k
1 2kτ 8τ s 1√
1 k 2
2 2kτ 4τ s √2
1 3
3 2kτ 6τ k 1−τ
s
s
2
In practice, for the reason of eliminating load disturbances v at the input, i.e., for
systems y = hp (s)(u + v) and in case of un-modeled effects we use a PI controller
for integrating processes. The Skogestad PI settings are
1
Kp = , Ti = 4(Tc + τ ) (3.54)
k(Tc + τ )
and with the time constant for the setpoint response, Tc = τ we obtain the SIMC
settings
1
Kp = , Ti = 8τ. (3.55)
2kτ
This may be proved as follows. Consider a 1st order system with time delay, and
with a large time constant, T , i.e. we may write the model as
By comparing the coefficients in the pole polynomial and the corresponding coeffi-
cients in the standard second order polynomial we may find relations between Kp
and Ti . We have
Ti
τ02 = , 2ζτ0 = Ti (3.60)
Kp k
1
Ti = 4ζ 2 (3.61)
Kp k
where k 0 is the gain and T the time constant in the 1st order process. Note that the
0
slope is k = kT in case of an integrating process. Hence we have
Ti = 4ζ 2 (Tc + τ ). (3.63)
Ti = 4τ (3.64)
√
This setting gives a Buttherworth pole polynomial π(s) = τ02 s2 + 2τ0 s + 1 with
τ0 = 2τ .
3.8 Integrating process with time delay 58
Instead of neglecting the time delay as in the derivation of the SIMC PI settings we
will in this section deduce alternative settings for the integral time constant Ti .
Let us study the disturbance response in case of a PI controller. We have
−τ s
y hp ke s kse−τ s
(s) = = −τ s = Kp k
(3.65)
v 1 + hc hp 1 + Kp 1+T is e
Ti s k s s2 + Ti (1 + Ti s)e−τ s
Approximating the delay as an inverse response term we get
y ks(1 − τ s) Ti s(1 − τ s)
(s) = Kp k
= Ti 2
(3.66)
v s2 + + Ti s)(1 − τ s) Kp Kp k s + (1 + Ti s)(1 − τ s)
Ti (1
The poles are given by the roots of the pole polynomial, i.e.,
Ti 2 1
π(s) = s + (1 + Ti s)(1 − τ s) = Ti ( − τ )s2 + (Ti − τ )s + 1
Kp k Kp k
= τ02 s2 + 2τ0 ζs + 1 (3.67)
Comparing the coefficients with the standard second order form polynomial we find
Ti 1
τ02 = − Ti τ = Ti ( − τ) (3.68)
Kp k Kp k
and
2τ0 ζ = Ti − τ (3.69)
Hence, from 4ζ 2 τ02 = (Ti − τ )2 we find the following 2nd order polynomial for the
relationship between Ti and Kp as a function of the relative damping coefficient ζ,
i.e.,
1
Ti2 − (4ζ 2 ( − τ ) + 2τ )Ti + τ 2 = 0. (3.70)
Kp k
1
With the setting Kp = 2kτ for the proportional gain we obtain τ02 = Ti τ . Re-
quiring ζ = 1 gives
4Ti τ = (Ti − τ )2 (3.71)
and
Ti2 − 6τ Ti + τ 2 = 0 (3.72)
with the positive solution
√
32
6+ √
Ti = τ = (3 + 2 2) ≈ 6τ. (3.73)
2
This gives very good set-point and disturbance responses.
√
2
Putting ζ = 2 gives
√
Ti = (2 + 3) ≈ 4τ, (3.74)
which is approximately the same setting as in Eq. (3.64).
3.8 Integrating process with time delay 59
e−τ s
hp (s) = k , (3.75)
s
with gain k = 1 and time delay τ = 1. The results by using a PI controller with
settings as in Table 3.1 are illustrated in Figure 3.8, which shows set-point and
disturbance rejection responses after a unit step in the reference, r = 1 at time
t = 0, and a unit step in the disturbance from v = 0 to v = 1 at time t = 40.
The simulations is done by the MATLAB m-file function ex3b half.m. As we
see the SIMC settings gives a relatively slow response from both the set-point and
the disturbance. The Buttherworth setting (2) results in the fastest responses but
have small oscillations. The settings derived in this note (3) results in nice, smooth
response approximately as fast as the response of the Butterworth settings.
2.5
1.5
0.5
0
0 10 20 30 40 50 60 70 80
Time
−τ s
Figure 3.8: PI control of integrating pluss delay process, hp (s) = k e s . PI-controller
hc (s) = Kp 1+T is
Ti s with settings as in Table 3.1.
y ks 1−αs
1+αs Ti s 1−αs
1+αs
(s) = Kp k
= Ti 2
. (3.78)
v s2 + Ti (1
1−αs
+ Ti s) 1+αs Kp Kp k s + (1 + Ti s) 1−αs
1+αs
y Ti s(1 − αs)
(s) = Ti 2
, (3.79)
v Kp Kp k s (1 + αs) + (1 + Ti s)(1 − αs)
and
y Ti s(1 − αs)
(s) = T 1
. (3.80)
v Kp α K k s + Ti ( K k − α)s2 + (Ti − α)s + 1
i 3
p p
We will instead for the sake of increased robustness in the resulting feedback system
chose ζ = 1 and three multiple real time constants, i.e. a prescribed pole polynomial
Ti 1
τ03 = α , 3τ02 = Ti ( − α), 3τ0 = Ti − α. (3.84)
Kp k Kp k
Interestingly, from this, by using that 3τ03 = Ti ( K1p k − α)τ0 we find the linear ex-
pression for Ti , i.e.,
1 1 1
3α =( − α) (Ti − α), (3.85)
Kp k Kp k 3
α( K10p k + α)
Ti = 1 . (3.86)
Kp k −α
3.9 Re-tuning to avoid oscillations 61
1 1
Let us use the standard SIMC setting for the proportional gain, Kp = k(Tc +τ ) = 2kτ
for the simple choice Tc = τ . We find
41 τ
Ti = τ ≈ 6.83τ, α = . (3.87)
6 2
This setting is approximately the same as we found by using the approximation
e−τ s ≈ 1 − τ s. Furthermore using the Balchen approximation we find
20 + π2 2τ
Ti = τ ≈ 9.64τ, α = . (3.88)
π−1 π
This integral time setting gives better margins, i.e., a gain margin GM ≈ 3, a
phase margin P M = 49.3 and a maximal time delay error dτmax ≈ 1.68. The
corresponding SIMC PI settings with Ti = 8τ gives GM ≈ 2.96, P M = 46.86 and
dτmax ≈ 1.58.
Some feedback loops are wrong tuned so that the plant output is influenced by
inherent oscillations. Suppose the PI controller parameters Kpold , Tiold is specified
by the operator and that the feedback loop have inherent oscillations. We will in
the following suggest how to re-tune the PI controller to avoid oscillations.
From eq. (3.61) we have that
4 Kp Ti
= . (3.89)
k ξ2
Using eq. (3.89) for two different PI controller tunings Kpold , Tiold and Kpnew , Tinew
we obtain
ξ2
Kpnew Tinew = new Kpold Tiold . (3.90)
ξ2
old
It make sense to chose the relative damping in the re-tuned feedback loop as ξnew ≥
1 to avoid oscillations. Hence, we have to ensure
1
Kpnew Tinew ≥ Kpold Tiold . (3.91)
ξ2
old
The method for standard controller design presented in this section may be used
directly for simple processes.
3.11 Examples
u = Kp (r − y), (3.95)
where r is the reference signal for y and Kp is the proportional constant. The closed
loop system is therefore described by.
y hp (s)hr (s) Kp (1 − s)
= hcl (s) = = , (3.96)
r 1 − (−1)hp (s)hr (s) (1 − Kp )s + 1 + Kp
where we have used negative feedback. As we see, the closed loop system also have a
zero at s = 1. Hence, the open loop zero is not influenced by the feedback as expected.
Zeroes are not influenced by feedback. However, the pole for the closed loop system
is
1 + Kp
scl = − . (3.97)
1 − Kp
It is natural to demand that the closed loop system is stable, i.e., scl < 0. Hence we
have that
This means that the speed of response is limited. In this example we got problems
with the inverse response for large values of Kp , since the system is non-minimum
3.11 Examples 63
phase. The system have an inverse response since the gain at time zero (t = 0) is
given by
−Kp
hcl (s = ∞) = =→ −∞ når Kp → 1 (3.99)
1 − Kp
In addition, the system have a positive steady state gain given by
Kp
hcl (s = 0) = (3.100)
1 + Kp
This means that the inverse response goes to infinity as Kp → 1. However, the
response got faster since the pole of the closed loop system got more negative, i.e.
scl → −∞ as Kp → 1.
The problem is here that we can not get both fast response and a small inverse
response. This is illustrated in Figure 3.9. We also se from Figure 3.10 that the
amount of control signal u increases to infinity when Kp → 1.
−5
−10
−15
−20
−25
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
Continuous time
1−s
Figure 3.9: Step response simulation of a system with hp (s) = 1+s and u = Kp (r−y)
for varying proportional coefficient 0.8 < Kp < 0.96. Note that symbols g = Kp and
r = y 0 is used in the figure.
Example 3.5 (Inverse response in state space and transfer function models)
u
20
15
10
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
Continuous time
the two time constants T1 = − s11 = 1 and T2 = − s12 = 12 . Hence, the loop transfer
function is with Ti = T1 = 1 given by
1 − 2s 1 + Ti s Kp 1 − 2s
h0 (s) = hp hc = Kp = , (3.106)
(s + 1)(s + 2) Ti s Ti s(s + 2)
where we have chosen Ti = 1. We can now find expressions for Kp by demanding
the closed loop system to be stable. The system from the reference, r, to the output,
y, must be stable. The transfer function from the reference r to the output y in a
feedback system (with negative feedback) is given by
Kp
1−2s p K
y h0 Ti s(s+2) Ti (1 − 2s)
= = K 1−2s
= K Kp
(3.107)
r 1 + h0 1 + Tip s(s+2) s2 + 2(1 − Tip )s + Ti
We have simulated the closed loop system for different values of Kp after a posi-
tive and unit step change in the reference r. The results are presented in Figure 3.11.
As we see, the response got more oscillations and overshot for increasing values of
Kp < 1. At the same time the response got a larger inverse response starting at time
t = 0. Inverse responses is typical when controlling non-minimum phase systems
with zeroes in the right half plane.
As we see it is difficult to at the same time obtain fast response, small overshot
and small inverse response. the reason for this problems is the zero in the right half
plane.
Some trial and errors gives the following reasonable choice
Kp = 0.42, Ti = 1. (3.110)
This PI controller settings gives a gain margin, GM = 2.8 [dB], and a phase margin
P M = 71◦ .
K =0.9
p
2
1.5
1
K
p
0.5
K =0.1
p
0
−0.5
−1
−1.5
0 2 4 6 8 10 12 14 16 18 20
Continuous time
Figure 3.11: Unit step response (in the reference) simulation of a control system with
1−2s
process model, hp (s) = (s+1)(s+2) , and PI-controller hc (s) = Kp 1+T is
Ti s with Ti = 1
and for varying proportional coefficients in the interval, 0.1 ≤ Kp ≤ 0.9. The Figure
is generated by the MATLAB script siso zero ex.m.
√
1 + 4ω 2
|hp (jω)| = √ √ . (3.114)
1 + ω2 4 + ω2
The phase crossover frequency (critical frequency), ω180 , is then given by the fre-
quency where the phase is −180◦ , i.e., ∠hp (jω180 ) = −π. The critical gain, Kcu , is
then the gain such that Kcu |hp (jω180 )| = 1. The parameters Kcu and ω180 can for
example be found by using the MATLAB function margin. We obtain
Example 3.8 (Inverse response and model reduction with the half rule)
Given a system described by the transfer function model y = hp (s)u where the trans-
fer function is given by
1 − 2s 1 − τs
hp (s) = =k , (3.120)
(s + 1)(s + 2) (1 + T1 s)(1 + T2 s)
where
1 1
k = , τ = 2, T1 = 1, T2 = . (3.121)
2 2
A good 1st order reduced model for PI controller synthesis is
1 − τs
hp (s) = k , (3.122)
1 + T1 s
1
where k = 2 and τ and T1 is found by using the half rule, i.e.,
1 1 9
τ := τ + T2 = 2 + = , (3.123)
2 4 4
1 1 5
T1 := T1 + T2 = 1 + = . (3.124)
2 4 4
A good PI controller setting is then obtained from the Skogestad (2002) method by
5
Ti = T1 = ≈ 1.25, (3.125)
4
and
1 T1 5
Kp = = ≈ 0.56. (3.126)
2 kτ 9
Simulation results of the set point responses for the various PI control tunings
are shown in Figures (3.12) and (3.13).
1
0.8
2
0.6
3
0.4
y
−0.2
−0.4
−0.6
0 2 4 6 8 10 12 14 16 18 20
Time t [sec]
1−2s
Figure 3.12: PI control of 2nd order process, hp (s) = 0.5 (1+s)(1+0.5s) . PI-controller
hc (s) = Kp 1+T is
Ti s with parameters as in Example 3.8. The figure is generated with
the MATLAB script main piex2.m.
2.2
2
1
1.8
2
1.6
1.4
u
3
1.2
0.8
0.6
0.4
0 2 4 6 8 10 12 14 16 18 20
Time t [sec]
1−2s
Figure 3.13: PI control of 2nd order process, hp (s) = 0.5 (1+s)(1+0.5s) . PI-controller
hc (s) = Kp 1+T is
Ti s with parameters as in Example 3.8. The figure is generated with
the MATLAB script main piex2.m.
3.11 Examples 69
− T11 1
0
T1 0
ẋ = 0 − T12 1
T2 x+ 0 u (3.128)
1 k
0 0 − T3 T3
y = x1 (3.129)
Ti = T = 10.5 (3.130)
1 10.5
Kp = Tτ = ≈ 1.91 (3.131)
2k 5.5
where T and τ is the parameters in the reduced model, i.e. a first order model with
inverse response
1 − τs
hp (s) = k (3.132)
1 + Ts
The parameters in the reduced model is obtained from the half rule, i.e.
1
T = T1 + T2 = 10.5 (3.133)
2
1
τ = T2 + T3 = 5.5 (3.134)
2
In order to compare the the Skogestad tuning with other PI control tuning rules
we chose the PI control tunings in Table 9.3 in Balchen et al (2003). The Balchen
tunings are
Ti = T1 = 8 (3.135)
1 8
Kp = T1 T2 = 2 = 3.2 (3.136)
k 5
Skogestad PI tuning
1
y
0.5
0
0 10 20 30 40 50 60 70 80 90
Time t [sec]
k
Figure 3.14: PI control of 3rd order process, hp (s) = (1+8s)(1+5s)(1+3s) . PI-controller
hc (s) = Kp 1+T is
with parameters as in Example 3.9. The figure is generated with
Ti s
the MATLAB script main piex1.m.
4.5
3
Skogestad PI tuning
u
2.5
1.5
Kp=1.3
Ti=10.5
1
0.5
0 10 20 30 40 50 60 70 80 90
Time t [sec]
k
Figure 3.15: PI control of 3rd order process, hp (s) = (1+8s)(1+5s)(1+3s) . PI-controller
hc (s) = Kp 1+T is
with parameters as in Example 3.9. The figure is generated with
Ti s
the MATLAB script main piex1.m.
Chapter 4
1. Choosing
Kp
z= e(s) =⇒ u(s) = z(s) + Kp e(s), (4.5)
Ti s
gives the following continuous state space model formulation
Kp
ż = e, (4.6)
Ti
u = z + Kp e. (4.7)
4.1 The PI controller 72
2. Choosing
Kp 1
z= e(s) =⇒ u(s) = z(s) + Kp e(s), (4.8)
s Ti
gives the following continuous state space model formulation
ż = Kp e, (4.9)
1
u = z + Kp e. (4.10)
Ti
3. Choosing
1 Kp
z = e(s) =⇒ u(s) = z + Kp e, (4.11)
s Ti
gives the following continuous state space model formulation
ż = e, (4.12)
Kp
u = z + Kp e. (4.13)
Ti
Hence, three different continuous state space formulations for the PI controller can be
formulated. Alternative one given by (4.6) and (4.7) is the most common alternative
since the controller state, z, has a more intuitive explanation because z = u in steady
state. In steady state, that is when t → ∞ and the system is stable then we have
that ż = 0 which gives e = r − y = 0 and hence z = u. The approach of assuming
stability and putting the derivatives of the states equal to zero when t → ∞ is a
very simple way of steady state analysis of a system.
Using that the solution of a linear differential equation is as presented in Eq.
(1.10) we may also formulate the PI controller by using the that the solution of the
differential Eq. (4.6) is
Kp t
Z
z = z(t0 ) + edt, (4.14)
Ti t0
and then
t
Kp
Z
u = Kp e + u(t0 ) + edt, (4.15)
Ti t0
Example 4.1 (Inverse response and model reduction with the half rule)
Given a system modeled by the transfer function model y = hp (s)u where
1 − 2s
hp (s) = (4.19)
(s + 1)(s + 2)
Simulate the system with a PI feedback system with settings Kp = 0.56 and Ti = 1.25.
Write a MATLAB script for the solution.
% ex1_pi.m
% Purpose: Illustrate the implementation of a PI controller for
% controlling the process, h_p(s)=(1-2s)/(s+1)(s+2)
%
h_p=tf([0,-2,1],[1,3,2]); % Process transfer function
sys=ss(h_p); % State space model
A=sys.a; B=sys.b; D=sys.c;
where the reaction rate coefficients are given by k1 = 50, k2 = 100, k3 = 10. The
concentration of the by-product into the reactor, v, is treated as an unknown constant
or slowly varying disturbance with nominal value v s = 10. Choosing a steady state
control us = 25 gives the steady states xs1 = 2.5 and y s = xs2 = 1.
A linearized model gives the transfer function model y = hp (s)u where
1 − τs
hp (s) = K (4.23)
(1 + T s)2
2 1
with gain K = 125 , inverse response time constant τ = 250 and a double time
1
constant T = 125 .
We want to use a PI controller so we are approximating the 2nd order model
with a 1st order time delay model (using the half rule for model reduction)
1 − τs
hp (s) = K (4.24)
1 + Ts
where the new model parameters are T := T + 12 T = 250
3 1
≈ 83.3 , new inverse response
1 1
time constant τ := τ + 2 T = 125 and the gain K is unchanged.
The SIMC PI controller parameters using the simple choice Tc = τ gives Kp =
1 T 1
2K τ ≈ 62.5 and Ti = T = 75 .
The chemical reactor is controlled with a PI controller with these tuning param-
eters and implemented in the following MATLAB m-file. Se Figure 4.1 for a step
response simulation.
% main_reacsim_pid.m
% Function to simulate PI control of a non-linear
% chemical reactor model using the explicit Euler method.
% Purpose: Supplement to Exercise 3
clear all
global u
% Nominal variables
u=25;
x=[2.5;1];
% PI controller parameters
Kp=62.5; Ti=1/125;
Kp=46.9; Ti=1/83.3; % SIMC tuning rules
Td=Ti/3;% Test
% The PI controller
e=r-y;
u=Kp*e+z - Kp*Td*(y-y_old)/dt; y_old=y;
z=z+dt*Kp*e/Ti;
U(k,1)=u; % Save u
Y(k,1)=y; % Save output y
X(k,:)=x’; % Save the states
R(k,1)=r; % The reference r
% Plotting results
figure(2)
subplot(311), plot(t,U), grid, title(’Control input u’)
subplot(312), plot(t,X(:,1)), grid, title(’State x_1’)
subplot(313), plot(t,Y,’-r’,t,R,’b’), grid, title(’Output y=x_2 and reference r’)
xlabel(’Continuous time 0 \leq t \leq t_f’)
% END main_reacsim_pid.m
Control input u
27
26.5
26
25.5
25
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
State x1
2.65
2.6
2.55
2.5
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
1.02
0.98
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
Continuous time 0 ≤ t ≤ t
f
Figure 4.1: Simulated responses from the chemical reactor example in Example 4.2.
The Figure is generated by the above m-file main reacsim pid.m
Note that the cascade formulation (4.27) is equivalent to the ideal form PID con-
troller with transfer function
1
hc (s) = Kp0 (1 + + Td0 s). (4.29)
Ti0 s
in which
Ti + Td Td
Kp0 = Kp = Kp (1 + ) (4.30)
Ti Ti
Td
Ti0 = Ti + Td = Ti (1 + ) (4.31)
Ti
Ti 1
Td0 = Td = Td (4.32)
Ti + Td 1 + TTd i
Often the derivative time, Td , is much smaller than the integral time, Ti . Hence, in
this case Kp ≈ Kp0 , Ti ≈ Ti0 and Td ≈ Td0 .
4.3 Anti windup and constraints 77
The ideal form of the PID controller output can be written as follows
Kp
u(s) = Kp e(s) + e(s) + Kp Td se(s), (4.33)
Ti s
where e(s) is the controller input, usually e = r − y. Choosing
Kp
z= e(s), (4.34)
Ti s
gives the time domain description of the PID controller
Kp
ż = e (4.35)
Ti
u = Kp e + z + Kp Td ė (4.36)
In practical implementations of the PI and PID controller there may be reasons for
handling constraints on the control input, u. These constraints may be physical
4.3 Anti windup and constraints 78
limitations of the controller organ. Hence, the practical and physical control input,
u(t), should lie within hard bound constraints as
When the controller output, u(t), is within the bounds (4.41) then we are using the
controller state equation
u = Kp e + z + Kp Td ė (4.42)
Kp
ż = e. (4.43)
Ti
However, when the controller are saturated, i.e. when the controller output, u, are
outside bounds, i.e. when
u = umin (4.45)
ż = 0, (4.46)
and when
u = umax (4.48)
ż = 0, (4.49)
in order not to integrate z when the controller are saturated. Note that the control
input, u, is computed at all time instants by Equation (4.42) and checked if it is
within bounds. This is the principle of Anti windup and it is implemented in the
computer with pure logic.
Given the same system as in Example 4.2. In this example we have the additional
constraints that
0 ≤ u ≤ 1.75 (4.50)
% ex1_pi_anti.m
% Purpose: Illustrate the implementation of a PI controller for
% controlling the process, h_p(s)=(1-2s)/(s+1)(s+2)
% -Implementation of Anti-Windup
%
4.3 Anti windup and constraints 79
up=u+v;
x=x + Dt*(A*x+B*up); % Puting the control to the process
end
U_max=u_max*ones(size(t’));
subplot(311), plot(t,Y), grid, xlabel(’Time’), ylabel(’y(t)’)
title(’Output response of PI controlled system’)
subplot(312), plot(t,[U U_max]), grid, xlabel(’Time’), ylabel(’u(t)’)
subplot(313), plot(t,Z), grid, xlabel(’Time’), ylabel(’z(t)’)
4.4 Bumpless transfer 80
The problem or need for a bumpless transfer between manually process operations
and closed loop feedback control is of practical importance. This topic will be
discussed in this section. It is important to make sure that the manually setting for
the control coincide with the controller output at the time of switching.
Suppose that the process is operating manually in open loop with a control input,
uoperator , specified by the operator, i.e. the process input is
u = uoperator (4.51)
and that at a specified time instant, t = ton , we want to switch to closed loop
feedback PID control.
u = Kp e + z + Kp Td ė (4.52)
Kp
ż = e (4.53)
Ti
As we have seen, the PI and PID controllers need an initial value for the controller
state, z. The change from manually to feedback control will be bumpless if the
initial controller state is computed by
z = uoperator − Kp e − Kp Td ė (4.54)
when t = ton and switching to closed loop PID feedback control. At time instants
ton < t we use the controller equations (4.58) and (4.59).
In order to switch bump-less from manually to automatic control we can use the
following scheme.
if t = ton
u = uoperator (4.55)
z = uoperator − Kp e − Kp Td ė (4.56)
(4.57)
else
u = Kp e + z + Kp Td ė (4.58)
Kp
ż = e (4.59)
Ti
% ex1_pi_bump.m
% Purpose: Illustrate the implementation of a PI controller for
% controlling the process, h_p(s)=(1-2s)/(s+1)(s+2)
% -Implementation of Anti-Windup
%
4.4 Bumpless transfer 81
u_max=1.75; u_min=0;
x=xs; % Initial values for the states
for k=1:N
y=D*x; % The measurement output
e=r-y; % The controller input 9
up=u+v;
x=x + Dt*(A*x+B*up); % Puting the control to the process
4.4 Bumpless transfer 82
end
U_max=u_max*ones(size(t’));
subplot(311), plot(t,Y), grid, xlabel(’Time’), ylabel(’y(t)’)
title(’Output response of PI controlled system’)
subplot(312), plot(t,[U U_max]), grid, xlabel(’Time’), ylabel(’u(t)’)
subplot(313), plot(t,Z), grid, xlabel(’Time’), ylabel(’z(t)’)
Time delay
where hot stands for “higher order terms”. Equation (5.3) may be proved by series
expansion of (1 + b1 θ)/(1 + a1 θ) by using long division and combining this with a
series expansion for eθ . This gives the error
1 + b1 θ
ε = eθ − = c1 θ + c2 θ + c3 θ3 + hot (5.4)
1 + a1 θ
If we chose c1 = 0 and c2 = 0 in Equation (5.4) we deduce Equation (5.3). We
assume that there eqists a1 and b1 which gives c1 = 0 and c2 = 0.
Putting (5.1) in the left hand side of Equation (5.3) and multiplying on both
sides with 1 + a1 θ gives,
1 1
(1 + a1 θ)(1 + θ + θ2 + θ3 + hot) = 1 + b1 θ + c3 θ3 + a1 c3 θ4 + hot (5.5)
2 6
This last expression may be written as a polynomial, i.e. with terms of θ, θ2 , θ3 ,
and so on, Vi får
1 1 1
(1 + a1 − b1 )θ + ( + a1 )θ2 + ( + a1 − c3 )θ3 + hot = 0 (5.6)
2 6 2
where we have included the term a1 c3 θ4 in the hot term. We may now find three
equations by putting the coefficients in front of θ, θ2 and θ3 equal to zero. This
gives the three equations
1 + a1 − b1 = 0 (5.7)
1
+ a1 = 0 (5.8)
2
1 1
+ a1 − c3 = 0 (5.9)
6 2
which gives
a1 = − 12 b1 = 1
2
1
c3 = − 12 (5.10)
we will in this section present an alternative development of the 1st order Padé
approximation. Assume that eθ are to be approximated with
1 + b1 θ
eθ ≈ (5.12)
1 + a1 θ
5.1 Padé approximations to the exponential for eθ 85
b1 − a1 = 1 (5.16)
1
a1 (a1 − b1 ) = (5.17)
2
1
a21 (b1 − a1 ) + c3 = (5.18)
6
Which gives a1 = − 21 , b1 = 1 + a1 = 12 and c3 = 61 − a21 = − 12
1
. Note that we have
used Equation (5.15) in order to find the coefficient c3 in the error term. The result
is
1 + 12 θ
eθ ≈ Φ1,1 (θ) = (5.19)
1 − 12 θ
1 + 12 θ
ε = eθ − = c3 θ3 + hot (5.20)
1 − 12 θ
where the main error is (1/2 − a)θ2 = −1/2θ2 . Φ1,0 (θ) is referred to as a (1, 0) Padé
approximation, because the approximation have a 1st order denominator and a 0
order nominator polynomial in θ.
We will in this section introduce the notation Φs,t (θ) as a short for an (s, t) Padé
approximation to the exponential eθ , i.e., a t-order nominator polynomial and a
s-order denominator polynomial. Hence, in general we may express eθ as
where
1 + b1 θ + · · · + bt θt
Φs,t (θ) = (5.29)
1 + a1 θ + · · · + as θs
Note that the approximation to the transition matrix we have found by using implicit
Euler method is identical to a use (1, 0) Padé approximation to Φ.
Trapes metoden:
Vi benytter Trapes metoden for diskretisering og får
xk+1 − xk 1
≈ (−axk+1 − axk ) (5.39)
∆t 2
Dette gir
∆t
1− 2 a
Φ1,1 = ∆t
(5.42)
1+ 2 a
1 − 12 τ s
e−τ s ≈ (1. ordens Padé approksimasjon) (5.43)
1 + 12 τ s
1 − 12 τ s + 1 2 2
12 τ s
e−τ s ≈ (2. ordens Padé approksimasjon) (5.44)
1 + 21 τ s + 1 2 2
12 τ s
1 − π2 τ s
e−τ s ≈ (1. ordens Balchen approksimasjon) (5.46)
1 + π2 τ s
3 1 2 2
−τ s 1− 2π τ s + π2
τ s
e ≈ 3 1 2 2 (2. ordens Balchen approksimasjon) (5.47)
1+ 2π τ s + π2
τ s
Feedback systems
v
Prosess
?
Hd w
Måling
ys
d +? +?
r - m - u y- m y - m y-
m
Hc - H
p
- H
m +
+ − +
6
Figure 6.1: Standard feedback system. A model description of the control is included
in Hp . Normally H : m = I in this section. r, is the reference, u is the control, v
is the disturbance, y is the process output, w is measurements noise and ym is the
process output measurements.
We are in this section going to investigate and describe the fundamental prop-
erties of a feedback system. The description is given for multiple input and output
(MIMO) systems. We are normally using capital letters for transfer matrices in
MIMO (multivariable) systems and lowercase letters for transfer functions in SISO
(monovariable) systems.
Consider a system described by the linear continuous time system state space
model
ẋ = Ax + Bu + Cv (6.1)
y = Dx (6.2)
However, note that v may contain variables not used as control variables. v may
contain both measured and unmeasured variables.
The measurement, ym , of the process output, y, is described by
ym = y + w (6.3)
This model with Hm = I is illustrated in Figure 6.1. Comparing the notation used
in Figure 6.1 (i.e. y = y d + y s ) we find that
y d = Hp u (6.5)
s d
y = H v (6.6)
d s
y = y +y (6.7)
As we see, the process output y can be divided into two parts, or influenced from
two contributions. One contribution y d from the manipulable control variables u
and one contribution y s driven from the disturbances v. y d may be defined as the
deterministic (known) contribution to y, i.e. the contribution driven from the known
control variables u. y s is denoted the stochastic (high frequency) contributions to y,
i.e. contributions driven from unmeasured and measured stochastic disturbances v.
Figure 6.1 is also illustrated a controller of the form
u = Hc (r − ym ) = Hc (r − y − w) (6.8)
y = yd + ys
= Hp Hc (r − y − w) + Hd v
⇓
(I + Hp Hc )y = Hp Hc r + Hd v − Hp Hc w (6.9)
where we have marked the central closed loop system transfer matrices, T , and S.
6.1 Description of feedback systems 92
We see that S is the closed loop transfer function (matrix) from y s = Hd v to the
output y. y s is the output from the disturbance model Hd and the contribution
to the output y which is influenced from the disturbance v. y s have a direct and
additive influence on the process output y. It is natural to demand S to be small in
order for the disturbance v to have a small influence on the process output.
T is the closed loop transfer function (matrix) from the reference r to the output
y. For good tracking behavior it will be natural to demand T ≈ I. Then we will
have that y ≈ r when S ≈ 0.
It is important to note the following relationship between S and T , i.e.,
S+T =I (6.12)
y = T r + Sy s − T w (6.13)
Ideally we want S small in order to have a small influence upon the output y
from the disturbance y s . We also usually want T small in order for the influence
from the noise w upon the output y to be small. We see from the identity (6.12) that
this hardly may be fulfilled. Those demands is in conflict with each other because
we have that S + T = I.
It is common practice to demand the feedback system to have good properties
to reduce the influence from the disturbances y s = Hd v upon the output y which
is the case when S ≈ 0). We also want good tracking properties. This means that
we usually want S ≈ 0 og T ≈ I. From the identity S + T = I we see that this is
possible, at least for some frequencies. However, there are at the same time difficoult
to reduce the influence on y from measurements noise. In steady state, when s = 0,
it is usually easy to obtain S = 0 and T = I. See Figure 6.2 for typically amplitude
and phase behavior of H0 , S and T as a function of the frequency ω. Nothe that
s = jω.
Remark 6.1 Let us have a look on the expression for the control u which influences
the system. We have from Figure 6.1 that
u = Hc (r − y − w) (6.14)
y = T r + SHd v − T w (6.15)
u = Hc Sr − Hc SHd v − Hc Sw (6.16)
Remark 6.2 Note that if the system is monovariable (i.e. when y, r, v, w and u
are scalar variables) then we have that
T S
z }| { z }| {
hp hc 1 hp hc
y= r+ hd v − w (6.17)
1 + hp hc 1 + hp hc 1 + hp hc
Note that all terms have the same nominator 1 + hp hc . We define the character-
istic equation of the system as
1 + hp hc = 1 + h0 = 0 (6.18)
The characteristic equation describes the stability properties of the system, here the
stability of the closed loop system. The term 1 + h0 = 0 gives us a polynom in the
Laplace operator s, the characteristic polynomial. If h0 (s) contains transprt delay
terms of the type e−τ s then we can use approximations to the exponential. The
roots of this characteristic polynomial is the poles of the closed loop system. The
closed loop poles should lie in the left part of the complex plane in order for the
closed loop system to be stable.
6.1 Description of feedback systems 94
This indicates that stability is a property of the system and not influenced of
the external signals r, v and w. The reason for this is that there only is the process
model hp and the controller hc which influences the characteristic polynomial and
thereby the stability.
Remark 6.3 Note the following alternative expressions for the complimentary sen-
sitivity function given in (6.11). Equation (6.11) is rewritten for the sake of com-
pleteness.
T = (I + Hp Hc )−1 Hp Hc (6.19)
−1
T = Hp Hc (I + Hp Hc ) (6.20)
−1
T = Hc (I + Hc Hp ) Hp (6.21)
Equation (6.20) can be proved as follows: from Figure 6.1 we have )with v = 0,
w = 0 and Hm = I)
e = r − y = r − Hp Hc e
⇓ (6.22)
e = (I + Hp Hc )−1 r
Putting this into the expression y = Hp Hc e gives
T
z }| {
y = Hp Hc (I + Hp Hc )−1 r (6.23)
Equation (6.21) can be proved as follows: From Figure 6.1 we have that (with v = 0,
w = 0 and Hm = I)
u = Hc e = Hc (r − y) = Hc r − Hc Hp u
⇓ (6.24)
u = (I + Hc Hp )−1 Hc r
Putting this into the expression y = Hp u we obtain
T
z }| {
y = Hc (I + Hc Hp )−1 Hp r (6.25)
Remark 6.4 As shown above, the output y of a linear system can be divided into
two contributions. This can also be shown from the state space model given in (6.1)
and (6.2).
deterministisk part stochastisk part
z }| { z }| {
ẋd = Axd + Bu ẋs = Axs + Cv
y d = Dxd y s = Dxs (6.26)
x= xd+ xs
y = yd + ys
This follows from the properties of linear systems.
Remark 6.5 In some circumstances symbols N (s) for S(s) is used and M (s) for
T (s) is used.
6.1 Description of feedback systems 95
0 T S
10
−1
10 S
−2
10 −2 −1 0 1
10 10 10 10
0 T
−100 H_0
−200
−300 −2 −1 0 1
10 10 10 10
Frequency (radians/sec)
Figure 6.2: The figure shows typical amplitude and phase frequency plot for S,
T og H0 . The frequency response is obtained by putting s = jω in the transfer
function. The process model used here is hp (s) = 3(1 − 2s)/(5s + 1)(10s + 1), with
PI-controller hc (s) = Kp (1 + Ti s)/(Ti s) with Ti = 12.7 and Kp = 1.136 (Ziegler-
Nichols parameters). The feedback system has negative feedback.
6.2 Reasons for using feedback 96
There may be different reasons for using feedback control and some particular im-
portant reasons for using feedback is as listed in the following items:
1. Unknown disturbances.
3. Unstable processes/systems.
Unknown (and not measured) disturbances are commonly in the process industry.
Such process disturbances may be slowly varying trends and drifts, but more high
frequency types of disturbances which are filtered through the process may also be
present. Such process disturbances may be viewed as a stochastic disturbance ys on
the process output y (se Figure 6.1). This contribution is additive for linear systems.
Slowly varying process disturbances may e.g. be caused from different properties
of raw products, changes in the process environments as temperature and pressure
etc.
The influence of unknown process disturbances may be a great problem. Distur-
bances may lead to saturations in the manipulable control variables u. Even with
feedback and in case of unknown slowly varying disturbances, it may happen that
the best one can achieve is that the process output y are varying around the refer-
ence r. This may be satisfactory because some times it is the mean one earn money
from, i.e. a satisfactory mean quality. However, great variations in quality should
be avoided.
Usually we only have approximate process models hp and these models are never
perfect. With perfect models y = hp u we can use feed-forward control and notice
that y = r gives an ideal feed-forward controller u = h1p r. Such an ideal feed-forward
controller is unrealistic due to modeling errors and the solution is to use feedback
control (or a combination of feedback and feed-forward control).
Feedback is a grate tool to stabilize unstable processes and systems and some
times such feedback solutions are remarkably simple and effective.
Chapter 7
(1 + T1 s)(1 + T2 s)
hc (s) = k (7.2)
T3 s
We will now show that the cascade form controller (7.2) may be written as an ideal
PID controller. From Equation (7.2) we have
1 + (T1 + T2 )s + T1 T2 s2
hc (s) = k
T3 s
T1 + T2 1 T1 T2
= k( + + s)
T3 T3 s T3
T1 + T2 1 T1 T2
= k (1 + + s) (7.3)
T3 (T1 + T2 )s T1 + T2
Comparing Equation (7.3) with the ideal form PID controller (7.1) shows that the
two formulations are equivalent if
T1 + T2
Kp = k (7.4)
T3
Ti = T1 + T2 (7.5)
T1 T2
Td = (7.6)
T1 + T2
7.1 On the PID controller formulations 98
This means that a cascade controller given by Equation (7.2) is identical to an ideal
PID controller as in Equation (7.1) if the PID controller parameters Kp , Ti and Td
are chosen as in (7.4)-(7.6).
We will now show that under certain circumstances there are possible to find the
controller parameters T1 , T2 and T3 in the cascade formulation as a function of the
controller parameters Kp , Ti and Td in the ideal PID controller.
From (7.4) and (7.5) we have directly that
k
T3 = Ti (7.7)
Kp
T2 = Ti − T1 (7.8)
T1 (Ti − T1 )
Td = (7.9)
Ti
This last expression may be written as a 2nd order equation for T1 . We have that
T12 − Ti T1 + Ti Td = 0 (7.10)
This equation have two solutions. It seams reasonable to chose the solution with
the largest value in order also to avoid an negative value on T1 . Hence,
p
Ti + Ti (Ti − 4Td )
T1 = (7.11)
2
In order to obtain a real solution we must have that Ti − 4Td ≥ 0.
Remark 7.1 (Ideal and cascade PID controllers) Hence, the conclusion is then
that an ideal PID controller given by Equation (7.1) may be written as a cascade PID
controller as in Equation (7.2) if Ti ≥ 4Td . Hence, there are an exact relationship
between the ideal PID (7.1) and the cacscade PID (7.2) when Ti ≥ 4Td .
Remark 7.2 (Approximation between the ideal and cascade PID controllers)
The following approximation between the cascade and ideal PID controllers
1 (1 + Ti s)(1 + Td s)
hc (s) = Kp (1 + + Td s) ≈ Kp (7.12)
Ti s Ti s
may be used when
Ti Td (7.13)
7.2 Controlling a static (steady state) process 99
T3 = Ti = 10 (7.16)
where we have put k = Kp . We then have the following exact relationship between
the ideal PID controller and the cascade PID controller.
1 (1 + 8.873s)(1 + 1.127s)
hc (s) = Kp (1 + + s) = Kp (7.17)
10s 10s
static function of u, i.e. y = g(u) where g(·) is a function describing the behavior of
the valve.
y hp hc (s) k T1i s k
(s) = = 1 = T s+k (7.18)
r 1 + hp hc (s) 1 + k Ti s i
hc (s) = Kp 1+T
Ti s
is
PI controller
hp = k static process model
and
y kKp (1 + Ti s) 1 + Ti s
(s) = = T (1+kK )
(7.22)
r Ti (1 + kKp )s + kKp 1 + i kKp p s
7.3 Control of a non-minimum phase process 101
where T1 > 0 is an inverse response time constant and T2 > 0 is the time constant
in the process. The transfer function from the reference r to the output y is given by
1−T1 s
y hp hc (s) Kp k 1+T 2s
(s) = = (7.27)
r 1 + hp hc (s) 1 + Kp k 1−T 1s
1+T2 s
This gives
y Kp k 1 − T1 s
(s) = (7.28)
r 1 + Kp k 1 + Tc s
We see that the closed loop system have a pole s = −1/Tc . In order to ensure
stability of the closed loop system we may demand the pole to be negative. The
closed loop system is therefore stable if Tc > 0. If we assume that the denominator
in the expression for Tc , i.e., 1 + Kp k > 0 (which gives a lower limit −1/k < Kp )
we obtain the following demand for ensuring stability.
T2 1
Kcu = (7.31)
T1 k
Hence, if T1 is large then we must chose a small value on Kp , and if T1 is small
then Kp may be chosen larger. A limit solution is obtained when T1 → 0, hence
The zero in the right half complex plane given by s = 1/T1 , gives constraints for the
choice of Kp . We may conclude and state that the stability properties of the closed
loop system is influenced strongly by the process zero in the right half plane. This is
usually always the case when controlling non-minimum systems with standard PID
feedback controllers.
hc (s) = Kp 1+T
Ti s
is
PI controller
hp (s) = k 1−T1s
1+T2 s non-minimum phase process
7.4 Controlling of lead-lag systems 103
where T1 > 0 and T2 > 0. The transfer function from the reference, r, to the output,
y, is given by,
Hence, the zero in the right half plane, s = 1/T1 , gives limitations to the size of
the proportional constant Kp . The stability properties of the closed loop controlled
system is limited by the positive zero in the rhp. Note that another choice than
putting Ti = T2 may have been used in the above discussion.
The transfer function from the reference r to the output, y, is given by the compli-
mentary sensitivity function T (s).
This gives
y(s) Ti T1 s2 + (T1 + T2 )s + 1
= T (s) = (7.42)
r(s) Tc2 s2 + 2Tc ξs + 1
If we now are specifying values for the time response parameters Tc and ξ then we
will obtain two equations for finding the PI controller parameters Kp and Ti .
ξ is the relative damping of the closed loop system. If ξ < 1 then the system is
under damped and the poles will be complex conjugate. If ξ < 1 then we will obtain
oscillations in the response from r to y. Tc = 1/ωn where ωn is referred to as the
undamped resonance frequency. We are finally referring to tables which shows the
relationship between Laplace functions and time domain descriptions for an exact
time domain equivalent to T (s).
Chapter 8
8.1 Introduction
Feed-forward control is maybe the most intuitive way of controlling a process. Con-
sider a process to be controlled and that the process is given by the model
y = hp (s)u (8.1)
and that we want the output, y, to follow a specified reference, r. We will in this
case obtain perfect control, i.e. y = r by the feed-forward controller
1
u= r (8.2)
hp (s)
y = Hp u + Hd v (8.3)
Assume that vi in addition to normal feedback from the output want a feed forward
controller from the reference. A control input to the process can in this case be
generated by
u = Hc (r − y) + uf (8.4)
where Hc is the controller transfer function (ore transfer matrix). The signal uf is
the feed forward which is a function of the reference signal. The feed forward control
is specified to be
uf = Hfr r (8.5)
where Hfr is the transfer function/matrix from the reference to the feed forward
signal.
Putting the control given by (8.4) into (8.3) gives
y = Hp Hc (r − y) + Hp uf + Hd v (8.6)
Ideally we want y = r. Putting this into equation (8.6) gives the following expression
for the feed forward signal, uf .
r = Hp uf + Hd v
⇓ (8.7)
uf = Hp−1 r − Hp−1 Hd v
where we have assumed that the transfer function model is invertible, i.e. we have
assumed that Hp−1 exists. The ideal feed forward controller from the reference is
therefore expressed by
where we have assumed that the process model is non-singular, i.e. Hp−1 exists.
As we see, we have also derived the ideal feed forward control from the distur-
bance, v, i.e., Hfv = Hp−1 Hd . Another assumption for using it is that the disturbance
is measured and known, ore estimated. We will in the following only analyze the
feed forward control
uf = Hp−1 r (8.9)
Note that even if the process model Hp (s) can be inverted theoretically, it is not
sure that the inverse Hp−1 is a rational and implementable function. However, one
can often use a realizable approximation to the inverse Hp−1 . This will be further
studied lather.
8.2 Feedback with feed forward from the reference 107
Example 8.1
Given a stable process described by
k
hp (s) = (8.14)
1 + Ts
The ideal feed-forward from the reference is then given by
1
hrf (s) =
(1 + T s) (8.15)
k
This solution is impractical due to the derivative term which will amplify high-
frequent measurement of process noise. A more realistic and practical solution is
to instead use the approximation
1 1 + Ts
hrf (s) = (8.16)
k 1 + Tf s
where Tf may be locked upon as a filter time constant. This approximation to the
ideal feed-forward control is known as a lead-lag feed-forward controller.
8.3 Feed-forward from the disturbance 108
Remark 8.1 The static feed-forward control (8.23) may off-course also be used
if the feedback part of the controller is dynamic instead of static. A linearized
controller with dynamic feedback part and feed-forward control may be described
by the state space model
ż = Au z + Bu (r − y), (8.26)
u = Du z + Eu (r − y) + uf , (8.27)
8.4 Ratio control 109
So called ratio control is a special type of feed-forward control which is widely used
in for instant the process industry. An example is for example a chemical reactor
where it is important to feed the reactor with two substances, say substance A and
substance B, in a specified ratio so that the feed to the reactor is blended with the
correct ratio.
In ratio control the objective is for instance to hold the ratio of two variables
close to or at a specific value. Consider as an example a process with two mass flow
variables, qA , and qB , and that we want to hold the ratio
qB
k= (8.28)
qA
constant or close to constant also for varying qA and qB . Hence, the problem is to
hold the ratio, k, constant instead of the two individual variables qA and qB . In
industry, usually flow variables and flow controllers are involved when using ratio
control. Hence we want qA = kqB where k is the a constant ratio.
There are some common solutions to the problem of ratio control. We will discuss
two solutions to ratio control:
Method 1. One standard solution to ratio control problem is the use one flow
controller, for say flow qB , and letting the set-point to this flow controller be
taken as rB = kqA , i.e., as a factor k of a measurement of flow qA . The entire
ratio control system is then influenced by manipulating the valve for the qA
flow manually. This solution is illustrated in Figure 8.1.
Method 2. A safer solution Method 1 above is to modify the method by using two
flow controllers where the entire ratio control system is influenced from one
set-point, rA , to a flow controller for flow qA , and the set-point for the flow
controller of flow qB is taken similar as in Method 1 above, i.e. rB = kqA .
The reader should with advantage sketch block diagrams for the above methods for
ratio control.
Example 8.2 (Feed-forward control with steady state models) Consider a bi-
nary distillation column for the separation of two products A and B. The steady state
mass balances are
F = B + D, (8.29)
F xF = BxB + DxD . (8.30)
8.4 Ratio control 110
kqA uB
hc (s)
−
qB
qB
P lant
k
uA
qA qA
qA
where the feed flow rate F and the fraction of product A in the feed flow rate is xF
are considered as disturbances (ore load variables). The flow rate of distillate is D
and the composition of product A in D is xD , similarly, the flow rate of the bottom
product is B and the composition of product A in B is xB .
Consider the case in which all variables are measured. Then we may, e.g., solve
for the distillate flow rate, D, as
xF − xD
D=F . (8.31)
xD − xB
Also the following rules regarding calculus of exponentials are use-full. Given two
scalars φ1 and φ2 . Then
e φ1
= eφ1 −φ2 . (9.8)
e φ2
The frequency response of a system describes how the output of a system behaves
after a sinusoid signal with frequency ω [rad/s] is feed into the input of the system.
Assume that a sinusoid signal
is feed into the system. Here u0 is the magnitude of the input signal, ω [ rad
s ] is a
specified frequency and α is a constant.
It can be shown that if this sinusoid input signal is exciting the system for long
time, i.e. to all transients has died out and that there is steady state behavior
(t → ∞), then the output response of the system will be described by
It can be shown that the ratio y0 /u0 between the magnitude of the output, y0 ,
and the magnitude of input signal, u0 , can be defined directly from the frequency
response h(ω) of the system, i.e.,
y0
u0 = | h(jω) | (Magnitude. No: amplitudeforholdet)
(9.12)
φ = ∠h(jω) (Phase angle. No: fasevinkelen)
From the theory of complex numbers we can show that the frequency response h(jω)
can be written as
Note that, uy00 =| h(jω) |, is the system gain at frequency ω, i.e. the system gain
if the system is excited with a sinusoid signal with frequency ω). In particular, at
low frequencies, i.e. when (s = jω = 0 or ω = 0, we have that the steady state gain
is given by uy00 =| h(j0) |.
As we see, the magnitude | h(jω) | and the phase angle (or phase shift) ∠h(jω)
depend on the frequency ω. This dependency, i.e. the magnitude | h(jω) and the
phase shift ∠h(jω), may be plotted in so called Bode plots.
The most important results is summed up in the following Theorem.
y = h(s)u (9.14)
where h(s) is the transfer function of the system. If we feed a time varying sinusoid
signal at the input of the system, i.e. an input given by
where
φ = ∠h(jω) (9.17)
The magnitude | h(jω) | and the phase shift (phase angle) ∠h(jω) is defined from
the frequency response of the system as follows
−s + 4 1 − 14 s
h(s) = = 0.5 (9.19)
s+8 1 + 18 s
where
1 + ( ω4 )2
p
| h(jω) |= 0.5 p (9.21)
1 + ( ω8 )2
9.2 Frequency response 114
ω ω
∠h(jω) = arctan(− ) − arctan( ) (9.22)
4 8
Assume that the system input, u, is excited with a signal
From the frequency response theory we have that the stationary output response for
the frequency ω = 0.3 [rad/s] is given by
1 u(t)
0.8
0.6
y(t)
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1
0 10 20 30 40 50 60 70 80 90 100
Time [sec]
Figure 9.1: The Figure shows the output response y(t) for a system h(s) = (s −
4)/(s + 8) excited with a sinusoid input signal u(t) = sin(ωt) where the frequency is
ω = 0.3 [rad/s]. Se Example 9.1 for details.
9.3 Gain margin and Phase margin 115
1 u(t)
y(t)
0.8
0.6
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1
Figure 9.2: The Figure shows the output response y(t) for a system h(s) = (s −
4)/(s + 8) excited with a sinusoid input signal u(t) = sin(ωt) where the frequency is
ω = 10 [rad/s]. Se Example 9.1 for details.
The following definitions are important in the theory of frequency analysis and design
of feedback control systems
The starting point for defining the gain margin and phase margin is the loop
transfer function H0 (s) = H0 (jω). We are only locking for the case when s takes
the values along the imaginary axis, i.e. we are putting s = jω.
Gain margin
ω180 is defined as the phase crossover frequency. The definition of ω180 is as follows
where solω [f (ω) = 0] means solving the function f (ω) = 0 with respect to ω.
Phase Margin
where ωc is the gain crossover frequency, i.e. the frequency where the magnitude of
the loop transfer function is equal to one, i.e. | H0 (jωc ) |= 1.
| H0 (jωc ) |= 1 (9.32)
where solω [f (ω) = 0] means the solution of the function f (ω) = 0 with respect to ω.
The gain Margin, GM , is a measure of how much the system gain can be in-
creased at the phase crossover frequency, ω = ω180 , before the system becomes
unstable. Such an increase of the system gain can be the result of an increasing
proportional constant, Kp , in a PID controller or an uncertain process gain.
The Gain Margin, GM , is often presented in decibel [DB] units. For a given
absolute value of the Gain Margin we get it in decibel by the conversion
0 1/GM
Gain dB
−20
w_c w_180
−40 −2 −1 0 1
10 10 10 10
Frequency (rad/sec)
−90
Phase deg
PM
−180
−270
w_c
−360 −2 −1 0 1
10 10 10 10
Frequency (rad/sec)
Figure 9.3: Bode plot for H0 (s) = 0.5(1 − s)/((1 + 0.1s)(1 + s)). The Gain margin
GM and the Phase Margin P M is indicated. For this system we have GM = 2.2,
P M = 49.34◦ , ωc = 0.4899 [rad/s] and ω180 = 1.095 [rad/s]. The figure shows
the magnitude in [dB] and 1/GM is illustrated. Transformation to [dB] is done by
1/GM = −20 · log(GM ) [dB]. Here the MATLAB Control System Toolbox function
marginis used.
9.3 Gain margin and Phase margin 118
hc = Kp , (9.39)
1 −τ s
hp = e . (9.40)
s
Note that it is usually sufficient to use a P controller in order to control integrating
processes. However, a PI controller may also be used if there are modelling errors.
This gives the following loop transfer function
1
h0 (s) = Kp e−τ s (9.41)
s
We will in the following derive the magnitude and the phase of the frequency response
of the system. The frequency response of the process is defined by putting s = jω in
the transfer function h0 (s), i.e.,
1 −τ jω
h0 (jω) = Kp e (9.42)
jω
The magnitude and phase is given by
Kp
| h0 (jω) | = (9.43)
ω
π
∠h0 (jω) = −( + τ ω) (9.44)
2
This means that the frequency response, h0 (jω), can be written in polar form as
follows
Kp −j( π +τ ω)
h0 (jω) =| h0 (jω) | ej∠h0 (jω) = e 2 (9.45)
ω
9.3 Gain margin and Phase margin 119
Remark 9.1 Assume that there are an uncertainty, dτ , in the transport delay, τ ,
which is used in the process model. Let τp = τ + dτ be the true transport delay in
the process. Hence, τ is the modelled transport delay and dτ the uncertainty (or
the error in the transport delay). The Phase Margin (PM) can be used to identify
how much uncertainty, dτ , which can be tolerated before the closed loop feedback
system becomes unstable.
If P M is the Phase Margin computed with respect to the model with transport
delay τ , and P Mp is the Phase Margin for the real process with transport delay τp ,
then we have that
P Mp = P M − dτ ωc (9.55)
9.3 Gain margin and Phase margin 120
0 1/GM
w_c
−50 −1 0 1 2
10 10 10 10
Frequency (rad/sec)
0
w_180
−90
Phase deg
−180 PM
−270
−360 −1 0 1 2
10 10 10 10
Frequency (rad/sec)
Figure 9.4: Bode plot for H0 (s) = 0.5e−2s /s. The Gain Margin (GM ) and the
Phase Margin (P M ) are indicated in the Figure. The closed loop feedback system
has an GM = π/2, P M = π/2 − 1 = 32.7◦ , ωc = 0.5 [rad/s] and ω180 = π/4 [rad/s].
Nothe that the figure presents the magnitude in [dB] but that we have illustrated
1/GM . Consistent transformation to dB is that 1/GM = −20 · log(GM ) [dB]. We
have used the MATLAB Control System Toolbox function margin. Using Equation
(9.57) we find that this system are tolerating an uncertainty dτ = 0.726[s]in the
transport delay, τ , before the system becomes unstable.
9.3 Gain margin and Phase margin 121
0 T S
10
S
−1
10
−2
10 −1 0 1
10 10 10
0 T
−100 h_0
−200
−300
−1 0 1
10 10 10
Frequency (radians/sec)
Figure 9.5: The figure shows magnitude and phase shift plot of S, T and H0 for
data as given in Example 9.5. Process hp (s) = 2e−s /(4s + 1), PI-controller Hc (s) =
Kp (1 + Ti s)/(Ti s) with Ti = 4 and Kp = π/2. This system have GM = 2 and
P M = 45◦ . The closed loop system have negative feedback.
h0 (s) 1
y= r+ ys (9.69)
1 + h0 (s) 1 + h0 (s)
where negative feedback is assumed and r is the reference signal and y s the distur-
bance. We have earlier shown that the stability of a feedback system is given by the
characteristic equation which is defined from
1 + h0 (s) = 0 (9.70)
Step response for (1) Z−N tuning and (2) GM=2, Ti=4 tuning
1.4
Ziegler−Nichols tuning
1.2
0.8
0.6
0.4
0.2
−0.2
0 1 2 3 4 5 6 7 8 9 10
Time [sec]
Figure 9.6: The figure shows the closed loop time response in the output y after a
positive unit step response at time t = 0 in the reference. The process and data
is as in Example 9.5, i.e. the process is hp (s) = 2e−s /(4s + 1) and PI controller
hc (s) = Kp (1 + Ti s)/(Ti s). Negative feedback is used. Two PI controller parameter
settings are shown. The first is a Ziegler-Nichols settings. The critical gain and
frequency is found to be Kcu = 3.467 and ωcu = 1.715. The ultimate period is then
Pu = 2π/ωcu . This gives the Z-N PI controller parameters Kp = Kcu /2.2 = 1.576
and Ti = Pu /1.2 = 3.052. The closed loop system with Z-N settings have the
margins GM = 1.91 and P M = 38.6. The other PI settings are simply found by
putting Ti = T = 4and cancelling a pole in the loop transfer function, and thereby
computing Kp so that GM = 2. This gives Ti = 4 and Kp = π/2 . The closed
loop system with this settings have a phase margin P M = 45◦ . As we see, the
Z-N setting gives more overshot on the output compared to the second PI controller
setting. The second setting is therefore to be chosen. Se Figure 9.7 for the response
in the control input, u.
9.4 Bodes stability criterion 124
Response in input for (1) Z−N tuning and (2) GM=2, Ti=4 tuning
2.5
Ziegler−Nichols tuning
2
1.
1.5
u(t)
0.5
2.
0
0 1 2 3 4 5 6 7 8 9 10
Time [sec]
Figure 9.7: The figure shows the closed loop time response in the input u after a
positive unit step response at time t = 0 in the reference. The process and data
is as in Example 9.5, i.e. the process is hp (s) = 2e−s /(4s + 1) and PI controller
hc (s) = Kp (1 + Ti s)/(Ti s). Negative feedback is used. Two PI controller parameter
settings are shown. The first is a Ziegler-Nichols settings. The critical gain and
frequency is found to be Kcu = 3.467 and ωcu = 1.715. The ultimate period is then
Pu = 2π/ωcu . This gives the Z-N PI controller parameters Kp = Kcu /2.2 = 1.576
and Ti = Pu /1.2 = 3.052. The closed loop system with Z-N settings have the
margins GM = 1.91 and P M = 38.6. The other PI settings are simply found by
putting Ti = T = 4and cancelling a pole in the loop transfer function, and thereby
computing Kp so that GM = 2. This gives Ti = 4 and Kp = π/2 . The closed
loop system with this settings have a phase margin P M = 45◦ . As we see, the Z-N
setting gives more overshot on the input and more control energy compared to the
second PI controller setting. The second setting is therefore to be chosen. Se Figure
9.6 for the response in the control input, y.
9.4 Bodes stability criterion 125
Assume now that the frequency response of the loop transfer function in a point (i.e.
for a given critical frequency ω = ωcu ) has magnitude equal to 1 and phase shift
equal to −180◦ . Hence | h0 |= 1 and ∠h0 = −π). This means that
h0 (jω) = 1 · e−jπ (9.72)
Putting this into the denominator in the transfer function T (jω) = h0 (jω)/(1 +
h0 (jω) we find that
h0 (jω) + 1 = 1 · e−jπ + 1 = 1 · cos(−π) + 1j · sin(−π) + 1 = −1 + 0j + 1 = 0(9.73)
This means that the output response of the closed loop system y = T r+Sy s becomes
undefined, and the system becomes unstable if the phase of the loop transfer function
becomes −180◦ and the magnitude of the loop transfer function becomes 1. This
means that the closed loop feedback system becomes unstable if |h0 (jω180 )| = 1,
which also is equivalent that the system becomes unstable for a Gain Margin, GM =
1. On this basis we formulate the Bodes stability criterion as follows
Remark 9.2 The Bode stability criterion have two assumptions. The first one
is that the Bode stability criterion only is valid for open loop stable systems, that
means that the process hp (s) is stable. The second assumption is that Bodes stability
criterion only is valid for systems where the phase shift ∠h0 (jω) passes −180◦ once.
If ∠h0 (jω) passes −180◦ several times or the open loop system is unstable, then
Nyquists stability criterion may be used.
Remark 9.3 A great advantage with Bodes stability criterion is that it can be used
for stability analysis of systems with transport delays. Bodes stability criterion can
handle transport delay terms of the type e−τ s in the transfer function. We does
not need Padé approximations to e−τ s which is the case when we are to compute
the roots of the characteristic equation, ore the eigenvalues of the corresponding A
matrix (for continuous systems).
e−jω
h(jω) = 2k (9.76)
1 + j4ω
This can be written on polar form, expressed in terms of the magnitude and the
phase shift
e−jω 2k
h(jω) = 2k p =p e−j(ω+arctan(4ω) (9.77)
1 + (4ω)2 ej arctan(4ω) 1 + (4ω)2
As we see, the proportional constant, k, does nor exists in the phase characteristic.
This is typically also the case for systems controlled by P , P I or P ID controllers.
We will first compute the phase crossover frequency, ω180 . Hence, we have to
solve
with respect to ω. This can for instance be done by the Newton-Raphsons method
for the solution of non-linear equations f (ω) = 0. here a trial and error method is
used.
⇒ φ = −2.91 180 ◦
ω = 1.5 π = −166
ω = 1.7 ⇒ φ = −3.12 π = −179◦
180
◦ (9.80)
ω = 1.715 ⇒ φ = −3.141 180
π = −179.96
⇒ φ = −3.146 180 ◦
ω = 1.72 π = −180.2
The system is at the stability limit when the magnitude, | h(jω) |), is equal to one
at the frequency ω = ω180 . The critical and largest gain, k, this system can tolerate
before being unstable is therefore given from
2k
| h(jω) |) = p = 1. (9.82)
1 + (4ω)2
Note that the result only says something about the magnitude of the gain k.
9.5 Ziegler-Nichols method for PID-controller tuning 127
Remark 9.4 The Bode stability criterion is often used to compute the critical gain
Kcu at the critical (phase crossover) frequency ω180 .
The critical gain Kcu and the phase crossover frequency ω180 is the basic pa-
rameters for using the Ziegler-Nichols method for the PID controller settings. In
particular, the Ziegler-Nichols methog gives the following PI controller parameters
in terms of Kcu and ω180
Kcu 2π Pu 2π 1 1
Kp = , Pu = , Ti = = ≈ 5.25 (9.85)
2.2 ω180 1.2 1.2 ω180 ω180
where Pu is the oscillating period, ore ultimate period. Hence, Pu is the periode
time of an oscillation in the output y(t). Note that the symbol ωcu sometimes is
used instead of ω180 , when the magnitude is 1 at the same time.
Remark 9.5 Note also that when the gain of the system is identical to Kcu then
the gain crossover frequency, ωc , will be equal to the phase crossover frequency ω180 .
Hence, the frequency in which ωc = ω180 is referred to as the critical frequency.
The Ziegler-Nichols (ZN) method for PID controller tuning can be used both as an
experimental and as an analytical model based method for PID controller tuning.
We will here start by presenting the model based ZN method.
The Ziegler-Nichols method for PID controller tuning is then a function of the
parameters Kcu and ω180 . Note also that the ultimate period is given by
2π
Pu = (9.89)
ω180
9.6 Minimum-phase and non-minimum-phase systems 128
Controller Kp Ti Td
Kcu
P 2 ∞ 0
Kcu 2π 1
PI 2.2 1.2 ω180 0
3Kcu Pu
PID 5 2 0.12Pu
Minimum-phase system
It can be shown that among all systems with frequency response, h(jω), which have
the same magnitude | h(jω) | there exist one system with the smallest negative
phase shift ∠h(jω). This system is called a minimum phase system.
A necessary and sufficient condition for a system to be a minimum-phase system
is that all zeroes and poles of the transfer function, h(s), lies in the left half plane,
i.e. to the left of the imaginary axis in the complex plane.
Non-minimum-phase system
Zeroes in the right half plane (RHP) and transport delay terms gives more phase
shift to the transfer function h1 (s) compared to a transfer function h2 (s) without
zeroes in the RHP and without transport delay terms. At the same time the transfer
function h1 (s) may have the same magnitude as h2 (s). If the transfer functions h1 (s)
and h2 (s) have the same magnitude for all frequencies ω where s = jω, then the
system represented by h1 (s) will be a non-minimum-phase system.
An example is the system (or process) h1 (s) = e−τ s which have magnitude
| h1 (jω) |= 1 and phase shift ∠h1 (jω) = −τ ω. This system have the same magnitude
as the system h2 (s) = 1 which has zero phase shift, i.e. ∠h1 (jω) = 0. Hence, h1 (s)
is a non-minimum phase system.
Another example is the system h(s) = a−s
a+s which have a zero s = 1 in the right
half of the complex plane. The magnitude is | h(jω) |= 1 and the phase shift is
∠h(jω) = −2 arctan(aω). This system is a non-minimum phase system because the
system h(s) = 1 have the same magnitude but less phase shift, i.e. ∠h1 (jω) = 0.
A non-minimum-phase system is often recognized because the output, y(t), from
such a system have an negative inverse response (or time delay) after a positive unit
response is feed into the input, u(t). See Figure 9.8 for an illustration of the output
response of a non-minimum-phase system. It should be remarked that it usually is
”harder” to control a non-minimum-phase system compared to a minimum-phase
system.
9.7 The bandwidth of a feedback control system 129
1.5
h_1(s)
1
Amplitude
0.5
h_2(s)
0
−0.5
0 5 10 15 20 25 30
Time (secs)
Figure 9.8: Unit step response plot of a minimum-phase system h1 (s) = 2/(4s + 1)
and a non-minimum-phase system h2 (s) = 2e−5s /(4s + 1). The response of the
non-minimum-phase system is recognized from the negative inverse response. The
MATLAB Control Systems toolbox function step is used.
take care of a disturbance y s with frequency ω then we must have that | S(ω) |< 1 at
this frequency, otherwise the disturbance influence on the output would have been
amplified. From Figure 6.2 we see that | S |< 1 for frequencies somewhat less than
ωc . For the system as illustrated in Figure 6.2 and most common control systems
we have that the exact bandwidth is somewhat less than ωc . Hence we have that
the bandwidth is
ωB < ωc (9.90)
This means also that the control system is not effective if the system is excited by
disturbances with a frequency greater than the bandwidth ωB . An upper limit for
the bandwidth of a control system is therefore ωc .
Chapter 10
10.1 Introduction
we have already discussed discrete time versions of continuous time models and
in particular discrete time versions of the standard PID controller as discussed in
Chapter 4. However, we will in this section discuss and present the deviation form of
the PID controller. Often incremental form or velocity form of the PID controller is
used instead of deviation form. The point is that only the deviation ∆uk is computed
at each new sample at time, k, and then use uk = uk−1 + ∆uk as the actual control
signal. This version of the PID controller have some advantages and is usually the
version implemented in practice and commercial PID controllers.
ẋ = f (x). (10.1)
One should here note that the explicit Euler method may be numerically unstable
and that there is an upper limit for the step length (sampling time) parameter, ∆t.
The explicit Euler method is a good choice when the step length parameter is chosen
”small” and is accurate enough for most control systems analysis and design.
10.3 Deviation form of the PI controller 132
On the other hand the implicit methods are numerically stable for all choices of
step length parameter, ∆t. However, the solutions may be inaccurate for large step
length parameters ∆t.
The PID controller may in discrete time be formulated on so called deviation form.
Also incremental form or velocity form is used on this version of the discrete PID
controller. We have that the PID controller may be expressed as
where ∆uk is the computed control deviation (increment) which usually is computed
as
where g0 , g1 and g2 are related to the PID controller parameters Kp , Ti and Td . One
should noe that different methods for discretization gives different formulas for g0 ,
g1 and g2 .
Note also that the computed control deviation in (10.14) is based on known
present and past variables and that ek = rk − yk and ek−1 = rk−1 − yk−1 .
u = Kp e + z + Kp Td se (10.15)
where
Kp Kp
z= e, ⇒ sz = e. (10.16)
Td s Ti
Inverse Laplace-transformation gives
u = Kp e + z + Kp Td ė, (10.17)
Kp
ż = e. (10.18)
Ti
It make sense to put e(t0 ) = r − y = 0 and ė(t0 ) = 0 at startup. We then have that
the initial value for the controller state may be chosen as
z(t0 ) = u0 , (10.19)
where u0 is a nominal control or working point for the process when turning on
the controller system in automatic mode . The nominal control may be found by
analyzing the steady state behavior of the process. We have
y0 = ku0 = r, (10.20)
10.4.2 Deviation form of the PID controller using the explicit Euler
method
We have two possibilities for implementing the derivation ė. The first possibility is
to use
ek − ek−1
ė ≈ . (10.22)
∆t
the second possibility and the most common choice is to not take the derivative of
the reference signal, i.e. using
yk − yk−1
ė = −ẏ ≈ − . (10.23)
∆t
using the last choice and the explicit euler method for discretization of the controller
state space model (10.18) gives
Kp Td
uk = Kp ek + zk − (yk − yk−1 ), (10.24)
∆t
Kp
zk+1 = zk + ∆t ek . (10.25)
Ti
r0
with initial value z0 = u0 = k.
This discrete state space model for the PID controller may be used directly.
However, a formulation on deviation form may be derived as follows (compute the
deviation ∆uk = uk − uk−1 ). This gives
Kp Td
uk − uk−1 = Kp ek + zk − (yk − yk−1 )
∆t
Kp Td
− (Kp ek−1 + zk−1 − (yk−1 − yk−2 )) (10.26)
∆t
which may be written as
Kp Td
uk − uk−1 = Kp ek + zk − zk−1 − Kp ek−1 − (yk − 2yk−1 + yk−2 ) (10.27)
∆t
Using Eq. (10.25) we have that
Kp
zk − zk−1 = ∆t ek−1 . (10.28)
Ti
This gives
∆t Kp Td
uk = uk−1 + Kp ek − Kp (1 − )ek−1 − (yk − 2yk−1 + yk−2 ) (10.29)
Ti ∆t
Hence, this is of the form
uk = uk−1 + g0 ek + g1 ek−1 + g2 (yk − 2yk−1 + yk−2 ) (10.30)
where
∆t Kp Td
g0 = Kp , g1 = −Kp (1 − ), g2 = − . (10.31)
Ti ∆t
The PID controller written on the form in Eq. (10.30) with parameters as in Eq.
(10.31) is denoted the velocity form, deviation form or incremental form, and often
used in practical implementations.
10.5 Discussion 135
Using the trapezoid method for integrating the controller state space model (10.18)
gives
zk+1 − zk 1 Kp 1 Kp
= ek + ek+1 (10.32)
∆t 2 Ti 2 Ti
As we see, it is not possible to formulate an implementable dicrete state space model
for the PID controller of the same form as when the Explicit Euler method was used,
as in Equations (10.24) and (10.25). The reason for this is that we do not know
ek+1 = rk+1 − yk+1 which in this last case is needed in order to compute and update
the controller state zk+1 .
However, we may use the trapezoid method in order to formulate the PID con-
troller on deviation (incremental) form. Using that
∆t Kp
zk − zk−1 = (ek−1 + ek ) (10.33)
2 Ti
and putting this into (10.27) gives
∆t ∆t
uk = uk−1 + Kp (1 + )ek − Kp (1 − )ek−1
2Ti 2Ti
Kp Td
− (yk − 2yk−1 + yk−2 ) (10.34)
∆t
This gives the controller formulation
where
∆t ∆t Kp Td
g0 = Kp (1 + ), g1 = −Kp (1 − ), g2 = − . (10.36)
2Ti 2Ti ∆t
10.5 Discussion
We have in this chapter discussed the deviation form of the discrete time PID con-
troller. This form of the PID controller may with advantage be used when im-
plementing the PID controller in practice. This form of the controller also have
some advantages, i.e., the controller is insensitive to constant offset values on the
control action due to the fact that only the deviation ∆k = uk − uk−1 matters.
Anti-Windup is also not a topic in the deviation form of the controller because the
controller integrator state is eliminated from the controller.
Chapter 11
We will in this section discuss systems with possibly time delay. Assume that the
system without time delay is given by a proper state space model as follows
and that the output of the system, yk , is identical to, yk− , but delayed a delay τ
samples. The time delay may then be exact expressed as
Discrete time systems with time delay may be modeled by including a number
of fictive dummy states for describing the time delay. Some alternative methods are
described in the following.
We will include a positive integer number τ fictive dummy state vectors of dimension
m in order for describing the time delay, i.e.,
x1k+1 = Dxk + Euk
x2k+1 = x1k
.. (11.4)
.
xτk−1
xτk+1 =
yk = xτk (11.5)
(11.4) have defined a number τ m fictive dummy state variables for describing the
time delay.
Augmenting the model (11.1) and (11.2) with the state space model for the delay
gives a complete model for the system with delay.
x̃k+1 Ã x̃k B̃
z }| { z
}| { z }| {
z }| {
x A 0 0 ··· 0 0 x B
x1
D 0 0 ···
0 0 x1
E
x2
= 0 I 0 ···
0 0 x2
+
0 uk
(11.6)
.. .. .. .. . . .. .. .. ..
. . . . . . . . .
xτ k+1
0 0 0 ··· I 0 xτ k
0
x̃k
z }| {
x
D̃
x1
z }| { x2
yk = 0 0 0 ··· 0 I .. (11.7)
.
xτ −1
xτ k
hence we have
where the state vector x̃k ∈ Rn+τ m contains n states for the process (11.1) without
delay and a number τ m states for describing the time delay (11.3).
With the basis in this state space model, Equations (11.8) and (11.9), we may
use all our theory for analyse and design of linear dynamic control systems.
The formulation of the time delay in Equations (11.6) and (11.7) is not very com-
pacter. We will in this section present a different more compact formulation. In
some circumstances the model from yk− to yk will be of interest in itself. We start
by isolating this model. Consider the following state space model where yk − ∈ Rm
s delayed an integer number τ time instants.
xτk+1 Aτ xτk Bτ
z }| { z }| { z }| { z }| {
x 1 0 0 0 ··· 0 0 x 1 I
x2
I 0 0 ··· 0 0 x2
0
3
x 0 I 0 ··· 0 0 x3
= + 0 yk− (11.10)
.. .. .. ..
.. .. .. .. ..
. . . . . . . . .
xτ k+1 0 0 0 ··· I 0 xτ k 0
11.1 Modeling of time delay 138
xτk
z }| {
x
Dτ
x1
z }| { x2
yk = 0 0 0 ··· 0 I .. (11.11)
.
xτ −1
xτ k
where xτk ∈ Rτ m . the initial state for the delay state is put to xτ0 = 0. Note here that
the state space model (11.10) and (11.11) is on so called controllability canonical
form.
Combining (11.12) and (11.13) with the state space model equations (11.1) and
(11.2), gives an compact model for the entire system, i.e., the system without delay
from uk to yk− , and for the delay from yk− to the output yk .
x̃k à x̃k B̃
z
}| { z
{ z }| { z }| {
}|
x A 0 x B
= + uk (11.14)
xτ k+1
τ
B D A τ τ
x k Bτ E
x̃k
D̃
z }| {
z }| {
x
yk = 0 Dτ (11.15)
xτ k
Note that the state space model given by Equations (11.14) and (11.15), is identical
with the state space model in (11.6) and (11.7).
A simple method for modeling the time delay may be obtained by directly taking
Equation (11.3) as the starting point. Combining yk+τ = yk− with a number τ − 1
fictive dummy states, yk+1 = yk+1 , · · · , yk+τ −1 = yk+τ −1 we may write down the
following state space model
xτk+1 Aτ xτk Bτ
z }| { z
}| { z }| { z }| {
yk+1 0 I 0 ··· 0 0 yk 0
yk+2 0 0 I ··· 0 0 yk+1
0
.. .. .. .. .. yk+2 .. −
yk+3 =
.. + . yk (11.16)
. . . . . .
.. ..
. 0 0 0 ··· 0 I .
0
yk+τ 0 0 0 ··· 0 0 yk+τ −1 I
11.2 Implementation of time delay 139
xτk
z
}| {
yk
Dτ yk+1
z }| {
yk = I 0 0 ··· 0
yk+2
(11.17)
..
.
yk+τ −1
where xτk ∈ Rτ m .
The initial state for the time delay is put to xτ0 = 0. Note that the state space
model (11.16) and (11.17) is on observability canonical form.
The state space model for the delay contains a huge number of zeroes and ones when
the time delay is large, ie when the delay state space model dimension mτ is large.
In the continuous time we have that a delay is described exact by yk+τ = yk− . It
can be shown that instead of simulating the state space model for the delay we can
obtain the same by using a matrix (array or shift register) of size nτ × m where we
use nτ = τ as an integer number of delay samples.
The above state space model for the delay contains nτ = τ state equations which
may be expressed as
−
x1k = yk−1
x2k = x1k−1
..
. (11.18)
xτk−1 = −2
xτk−1
τ −1
yk = xk−1
where we have used yk = xτk . This may be implemented efficiently by using a matrix
(or vector x. The following algorithm (or variants of it) may be used:
1. Put yk− in the first row (at the top) of the matrix x.
2. Interchange each row (elements) in matrix one position down in the matrix.
3. The delayed output yk is taken from the bottom element (last row) in the matrix
x.
11.3 Examples 140
yk = x(τ, 1 : m)T
for i = τ : −1 : 2
x(i, 1 : m) = x(i − 1, 1 : m)
end
x(1, 1 : m) = (yk− )T
11.3 Examples
Abstract
Methods for the adjustment of PID control parameters, such that the loop transfer
function, the sensitivity transfer function or the complementary sensitivity transfer
function is tuned to a prescribed amplitude and phase, are presented.
Keywords: PID control parameters; automatic tuning.
12.1 Introduction
Many good methods for on-line identification of process parameters needed for tun-
ing PID controllers are available.
A method for the adaption of PID controller parameters in closed loop systems
has been presented in Balchen et al (1989). The method is based on an algorithm
where the phase angle ∠N (jω) is prescribed, and the corresponding frequency and
amplitude of the sensitivity transfer function N (jω) are estimated. The propor-
tional gain is adjusted by an integral controller with setpoint equal to a prescribed
amplitude of N . The integral and derivative times are adjusted proportionally to
the inverse of the frequency ω.
A different scheme has been presented in Schei (1991), where the amplitude of the
complementary sensitivity transfer function M (jω) and the frequency of oscillation
are estimated from a describing function approach. The phase angle is fixed to
∠M (jω) = −90◦ . The controller parameters are updated at each oscillation period
in such a way that the amplitude of the loop transfer function h0 (jω) attains a
specified value. The integral and derivative times are adjusted in the same way as
in Balchen et al (1989).
1
This chapter is based on the paper
Di Ruscio (1992). Adjustment of PID control parameters. Modeling, Identification and Control,
Vol. 13, No. 4, pp. 189-197.
12.2 Main Results 142
However, the methods for the adjustment of the proportional gain in these works
may be improved.
This note is concerned with the problem of adjusting the PID controller param-
eters in such a way that some process performance specifications are reached. Such
specifications may be prescribed values on the amplitude and phase of the loop,
sensitivity or the complementary sensitivity transfer function.
The paper is organized as follows: Section 2 presents the main results. Two
examples are presented in Section 3 and some concluding remarks follow in Section
4.
The main results in this section are stated in Subsection 2.1, 2.2 and 2.3. Subsec-
tion 2.1 deals with the loop transfer function h0 (jω), Subsection 2.2 considers the
sensitivity transfer function N (jω) and Subsection 2.3 is considered with the com-
plementary sensitivity transfer function M (jω) for the adjustment of PID controller
parameters. All methods are based on the idea that the integral time Ti , and the
derivative time Td are functions of the frequency, ie. Ti = Ti (ω) and Td = Td (ω).
Ti and Td are usually set proportional to ω −1 . The problem is then reduced to the
adjustment of the proportional gain Kp .
12.2.1 Method 1
The following iteration formula for the adjustment of Kp such that the amplitude
of the loop transfer function h0 is tuned to a prescribed value |hs0 | is proposed.
|hs0 | |hs | − |hn |
Kpn+1 = Kpn n = Kpn + Kpn 0 n 0 (12.1)
|h0 | |h0 |
where n is the index of iteration. The formula, Equation (12.1), has a quadratic
convergence rate near the solution. This can be seen by using the Newton method
for solving
f¯(Kp ) = |hs0 | − |h0 | (12.2)
to zero, which results in the following iteration scheme,
∂ f¯ −1 ¯
Kpn+1 = Kpn − ( ) fn (12.3)
∂Kp n
where the gradient of f¯ with respect to Kp is given by
∂ f¯ ∂|h0 | 1
=− =− |h0 | (12.4)
∂Kp ∂Kp Kp
Substituting Equation (12.4) into Equation (12.3) gives the iteration formula, Equa-
tion (12.1).
The adjustment formula, Equation (12.1), can be shown to be the same as the
procedure for adjusting Kp described in an unclear and complicated way in Schei
(1991).
12.2 Main Results 143
12.2.2 Method 2
A method for the adjustment of Kp such that the amplitude of the sensitivity transfer
function N is tuned to a prescribed value |N0 | can be derived as follows.
An iteration formula for tuning
to zero, is
∂|N | −1
Kpn+1 = Kpn + ( ) fn (12.6)
∂Kp n
The gradient of the amplitude of N with respect to Kp can be shown to be
∂|N | 1
=− |N |(1 − <e(N )) (12.7)
∂Kp Kp
See the Appendix for a proof. Substituting Equation (12.7) into Equation (12.6)
gives the iteration formula
|N0 | − |N n |
Kpn+1 = Kpn − Kpn (12.8)
|N |(1 − <e(N n ))
n
A problem with this formula is that the gradient (12.7) may be zero in the frequency
range considered. This difficulty is avoided by the following approximation.
|N0 | n
n |N0 | − |N |
Kpn+1 = Kpn = Kp
n
+ Kp (12.9)
|N n | |N n |
This iteration scheme is found to be reasonable during simulations, and will hereafter
be referred to as Method 2. Equation (12.9) is found from Equation (12.8) with
<e(N ) = 2. Other approximations, with different convergence properties, may be
proposed by fixing <e(N ) to a constant near the singular point.
12.2.3 Method 3
A method for the adjustment of Kp such that the amplitude of the complementary
sensitivity transfer function, M , is tuned to a prescribed value |M0 | can be derived
from the same procedure as Method 2. We have the iteration formula
|M0 | − |M n |
Kpn+1 = Kpn + Kpn (12.10)
|M n |(1 − <e(M n ))
where we have used that the gradient of the amplitude of M with respect to Kp can
be shown to be
∂|M | 1
= |M |(1 − <e(M )) (12.11)
∂Kp Kp
and that the iteration formula, Equation (12.10), is a Newton method for tuning
Remark 1
All proposed methods for the adjustment of Kp may be modified to
∂ fˆ −1 ˆ
Kpn+1 = Kpn − λn ( ) fn (12.13)
∂Kp n
Remark 2
Assume a PID controller with Ti = Ti (ω) and Td = Td (ω) and that ∠N (ω, Kp )
and |N (ω, Kp )| are estimated or determined from a model. ω and Kp may then be
determined directly by tuning the following set of equations to zero
f1 (ω, Kp ) = ∠N0 − ∠N (ω, Kp ) (12.14)
f2 (ω, Kp ) = |N0 | − |N (ω, Kp )| (12.15)
where ∠N0 and |N0 | are prescribed phase and amplitude of the sensitivity transfer
function, respectively. A Newton method of the same form as Equation (12.13) may
be used, ie.
∂f −1
θn+1 = θn − Λn () f (12.16)
∂θ n n
T T
where θ = ω Kp and f = f1 f2 . The matrix Λn is introduced to
improve the convergence. The Jacobian matrix is given by
" ∂f ∂f1
# " ∂∠N ∂∠N #
∂f ∂ω
1
∂Kp ∂ω ∂K
= ∂f2 ∂f2 = − ∂|N | ∂|Np| (12.17)
∂θ ∂ω ∂Kp ∂ω ∂Kp
∂∠N 1
= |N | sin(∠N ) (12.20)
∂Kp Kp
A proof of Equation (12.20) is given in the Appendix. The partial derivatives of
∠N and |N | with respect to ω may be adjusted numerically during the iterations,
or determined analytically if the process model is known.
12.3 Examples 145
12.3 Examples
12.3.1 Example 1
Assume that |N | and ω are estimated, the phase angle ∠N (jω) prescribed, and that
the following parameters are specified.
4
|N0 | = 1.5, ∠N0 = 30◦ , Ti = (12.22)
ω
Tuning results for Methods 2 and 3 are shown in Figure (12.1). The final results are
Kp = 1.94, Ti = 3.4 and ω = 1.18. For this example Method 1 did not converge.
b 8 b
1.5
c 6
1
c
4
0.5
2
0 0
0 5 10 15 0 5 10 15
Iterations Iterations
b b
1.5
c 1
c
1
0.5
0.5
0 0
0 5 10 15 0 5 10 15
Iterations Iterations
For this example, Figure (12.1) shows that Methods 2 and 3 have approximately
equal rates of convergence. Now, assume that |M | and ω are estimated, the above
specifications are then identical to
4
|M0 | = 0.81, ∠M0 = −111.7◦ , Ti = (12.23)
ω
12.3 Examples 146
Simulation results based on Method 3 for estimation of |M | and Method 2 for esti-
mation of |N | are shown in Figure (12.2).
0 0
0 5 10 15 0 5 10 15
Iterations Iterations
b c
1.5
1 b
1 c
0.5
0.5
0 0
0 5 10 15 0 5 10 15
Iterations Iterations
12.3.2 Example 2
Assume that |N | and ω are estimated, the phase angle ∠N (jω) prescribed, and that
the following parameters are specified.
5
|N0 | = 2, ∠N0 = 0◦ , Ti = (12.25)
ω
Tuning results for Methods 1, 2 and 3 are shown in Figure (12.3). All methods
converged for this example. The final results are Kp = 1.24, Ti = 5.52 and ω = 0.91.
12.4 Concluding Remarks 147
Note that the rate of convergence is considerably faster than for Example 1. This
example indicate faster convergence for processes with a time delay, because the
frequency, ω, is nearly constant during the adaption of the controller parameters.
Compare with Example 1.
1 5
b
0.5 c
0 0
0 2 4 6 0 2 4 6
Iterations Iterations
0 0
0 2 4 6 0 2 4 6
Iterations Iterations
Three methods based on gradient informations for the adjustment of the propor-
tional gain in an PID controller are presented. The integral time constant, and the
derivative time constant, are set proportional to the inverse of the frequency.
A method for the determination of PID parameters presented in an unclear and
complicated way in Schei (1991) is shown to be a simple Newton method for the
adjustment of Kp such that the amplitude of the loop transfer function h0 (jω) is
tuned to a specified value.
Simple analytical expressions for the gradient of the amplitude of the sensitivity
transfer function N (jω) and the complementary sensitivity transfer function M (jω)
with respect to the proportional gain Kp are presented. These expressions are the
basis for two Newton methods for the adjustment of the proportional gain.
It is shown that the proportional gain should be adjusted from gradient infor-
12.5 References 148
12.5 References
Schei T. S. (1991). A New Method for Automatic Tuning of PID Control Param-
eters. Proceedings 1th ECC - European Control Conference, Grenoble, July
2-5, 1991, pp. 1522 - 1527.
12.6 Appendix
Define h = |h0 (jω)|, φ = ∠h0 (jω) and h0 (jω) = hejφ to simplify the notation. We
have
1 1 + he−jφ 1 + he−jφ
N (jω) = = = (12.27)
1 + hejφ (1 + hejφ )(1 + he−jφ ) 1 + h(ejφ + e−jφ ) + h2
1 + hcos(−φ) + jhsin(−φ)
N (jω) = = <e(N ) + j=m(N ) (12.28)
1 + h2 + 2hcos(φ)
h sin(−φ)
tan(∠N ) = (12.41)
1 + h cos(−φ)
The partial derivative of the right hand side of Equation (12.41) with respect to Kp
is given by
∂ tan(∠N ) 1 tan(∠N )
= |N | (12.42)
∂Kp Kp cos(∠N )
The chain rule on the left hand side of Equation (12.41) gives
∂ tan(∠N ) 1 ∂∠N
= 2
(12.43)
∂Kp cos (∠N ) ∂Kp
∂∠N 1
= |N | sin(∠N ) (12.44)
∂Kp Kp
13.1 Introduction
The Smith predictor is frequently used for controlling processes with long-dead times.
Unfortunately, the Smith predictor cannot compensate for load disturbances upon
an integrator processes with a long dead time.
When working with a course in process control the author constructed a modified
Smith predictor for controlling an integrator process with long dead time. We will
in this chapter discuss the Smith predictor and the necessary modifications in order
to control an integrator processes with a long dead time.
Assume that a process model transfer function hm (s) is available for the true process
hp (s). The process model can be factorized into the product of a rational part
(which can be inverted) h− +
m (s) and a non-rational part hm (s) (non-invertible part,
e.g. transport delay). We have
hm (s) = h− +
m (s)hm (s) (13.1)
Consider the Smith predictor in Figure (13.1). The transfer function model from
the two inputs, i.e. the reference and disturbance signals, to the process output is
where
(1 + hc (h−
m − hm ))hv
hd (s) = − , (13.3)
1 + hm hc + (hp − hm )hc
13.2 The Smith Predictor 153
d - hv (s)
+?
r - m - m - h (s) u - h (s) - m y -
c p
+ 6− + 6− +
+ ?
- h− (s) - h+ (s) - m
m m
−
Figure 13.1: The Smith predictor for controlling processes with long dead times.
and
hc hp
hr (s) = . (13.4)
1+ h−
m hc + (hp − hm )hc
Assume that the disturbance (load) transfer function hv (s) is equal to the process
transfer function hp (s) = hm (s). I.e. consider a process:
1
hp (s) = hm (s) = hv (s) = e−τ s . (13.5)
s
The Smith predictor is constructed by putting:
1
h−
m (s) = , (13.6)
s
−τ s
h+
m (s) = e . (13.7)
The transfer function from the disturbance d to the process output is:
(1 + hc (h−
m − hm ))hv
y(s) = d(s) (13.8)
1 + h−m hc
Inserting gives
(1 + hc ( 1s − 1s e−τ s )) 1s e−τ s
y(s) = d(s) (13.9)
1 + 1s hc
(1 + hc ( 1s − 1s (1 − τ s + 21 τ 2 s2 + · · · ))) 1s e−τ s
y(s) = d(s) (13.10)
1 + 1s hc
13.3 Modified Smith predictor 154
From this we conclude that the off-set error is different from zero and that the error
is large when the time delay is large. Hence, the Smith predictor cannot compensate
for constant load changes when the process is a pure integrator with dead time.
The Smith predictor cannot reject load disturbances for processes with integration
(process with integrator and time delay).
Consider a process with a pure integration with time delay, i.e.
kp −τ s
hp (s) = e . (13.17)
s
The process model is specified as:
hm (s) = h−
m (s)e
−τ s
. (13.18)
kp
Instead of putting h−
m (s) = s the rational part of the process model is specified to
be
k
h−
m (s) = . (13.19)
s+a
It can now be shown that
lim y(t) = 0 (13.20)
t→∞
The problem is now to shape the transfer function M (s) so that HD (s) rejects
(steady state) load disturbances, i.e.,
It is also of interest to chose M (s) so that to remove the non-rational term e−τ s
from the denominator term of HD (s), in order to increase the bandwidth of the load
response.
The following transfer function with three adjustable parameters, k1 , k2 and k3
is proposed:
k4 + 1s k3
M (s) = (13.25)
1 + k1 + 1s k2 + s12 k3 − ( 1s k4 + s12 k3 ) − ( 1s k4 + 1
k )e−τ s
s2 3
where k4 = k2 + kr τ .
With this choice, the load (disturbance) response is given by
d Process
r + ũ + u ?+
y
- k kp −τ s
s e
- - - - -
+
6− 6−
dˆ
1
s
M (s)
6e
ŷ -
y
- e−τ s
− +
Figure 13.2: The Modified Smith predictor for controlling processes with an inte-
grator and long dead time proposed by Åström et al. (1994).
The modified Smith predictor, Figure 13.2, have a feedback from the load (distur-
bance) estimate. It is of interest to compare this strategy with a model based control
strategy. I.e. by using a state estimator. The states could be y and d where the
load d is modeled by a pure integrator.
From Figure 13.2 we have that the estimate of y is taken as
k −τ s
ŷ = e r (13.28)
s+k
In the time domain we have
ŷ˙ = −k ŷ + kr (13.29)
where we for simplicity has neglected the time delay.
Using a state estimator (Kalman filter) we would have used the following esti-
mator for the output y.
ŷ˙ = u + dˆ + K1 (y − ŷ) (13.30)
which can be written as
ŷ˙ = −K1 ŷ + u + dˆ + K1 y (13.31)
where K1 is the Kalman filter gain. We want to compare the two estimators, Equa-
tions (13.29) (13.31). When are they similar ?
From Figure 13.2 we have that
ũ = u + dˆ (13.32)
sk
Ũ (s) = R(s) (13.33)
s+k
13.4 Modified Smith Predictor by Åström 157
Intuitively, the estimator for y used in the modified Smith predictor is similar to a
state estimator (Kalman filter) updated from the steady state values of the inputs
to the estimator.
Part IV
Multivariable control
u1 - y1-
Hp
r2 - - h u2 - y2-
c22
−6
We will in this section study the control of systems with two control input vari-
ables, u1 and u2 and two output measurements variables y1 and y2 . Such a system
is referred to as a (2 × 2) MIMO control system, where MIMO stands for Multiple
Input and Multiple Output. Often only MIMO systems are used to denote such a
control system.
The process described in Figure 14.1 is described by the transfer matrix model
y = Hp u (14.1)
When studying the transfer function from u1 to y1 we see that there is a cross
coupling from u2 represented by the transfer function h12 . If h12 = 0 then we see that
there is no cross coupling and the relationship between u1 and y1 is decoupled from
u2 . In the same way we see that there is a cross coupling from u1 to y2 , represented
with the transfer function h21 . I.e., u1 is influencing the transfer function from u2
to y2 .
For a 2 × 2 multivariable control system we have four possible pairings of inputs
and outputs variables. Those possible pairings are defined as follows:
For a 2 × 2 MIMO control system we have four different single input and single
output control system strategies, which are defined as follows
We will in this section study two problems of interests in connection with control of
MIMO systems. These problems are defined below.
The solution to the pairing problem is therefore to chose the two best control strate-
gies.
We are using the system illustrated in Figure 14.1 as the starting point.
14.1 Interaction and pairing of variables 161
We will in this section derive the results described in Section 14.1.1. The starting
point is Figure 14.1 with loop u1 − y1 open and loop u2 − y2 closed. The process is
described by
We know get the transfer function for the closed loop from Equation (14.17), i.e.,
T22
z}| {
h21 h22 hc22
y2 = u1 + r2 . (14.18)
1 + h22 hc22 1 + h22 hc22
The resulting transfer function from u1 to y1 is obtained by putting Equation (14.18)
into (14.16). This gives
h21 h22 hc22
y1 = h11 u1 + h12 hc22 (r2 − u1 − r2 ), (14.19)
1 + h22 hc22 1 + h22 hc22
which gives
h12 h21 hc22 h12 hc22
y1 = (h11 − )u1 + r2 . (14.20)
1 + h22 hc22 1 + h22 hc22
Equation (14.20) can be described as
h12 h21 h12 hc22
y1 = h11 (1 − T22 (s))u1 + r2 , (14.21)
h11 h22 1 + h22 hc22
14.1 Interaction and pairing of variables 163
where T22 (s) is the complementary sensitivity function for the closed loop u2 − y2 ,
i.e.,
h22 hc22
T22 (s) = . (14.22)
1 + h22 hc22
The system in Figure 14.1 is to be controlled by two single loop controllers. The
four possible control strategies is as shown in 14.6. In the same way as the develop-
ment in Section 14.1.2 and the result in Section 14.1.1 we can develop the following
expressions, ∆11 is represented for the sake of completeness.
T22
z }| {
h12 h21 h22 hc22 h12 h21
∆11 (s) = , ∆11 (s) ≈ . (14.23)
h11 h22 1 + h22 hc22 h11 h22
T11
z }| {
h21 h12 h11 hc11 h12 h21
∆22 (s) = , ∆22 (s) ≈ . (14.24)
h22 h11 1 + h11 hc11 h11 h22
T21
z }| {
h22 h11 h12 hc21 h22 h11
∆21 (s) = , ∆21 (s) ≈ . (14.25)
h21 h12 1 + h12 hc21 h21 h12
T12
z }| {
h11 h22 h21 hc12 h11 h22
∆12 (s) = , ∆12 (s) ≈ . (14.26)
h12 h21 1 + h21 hc12 h12 h21
We have here assumed that the controllers hc,i,j have integral action. This means
that Ti,j (s = 0) = 1 and that Ti,j (s) ≈ 1 at low frequencies. This is the background
for the above approximations. Note that ∆11 (s = 0) = ∆22 (s = 0) and that ∆21 (s =
0) = ∆12 (s = 0).
We form the following matrix of interactions
∆11 (s) ∆12 (s)
∆(s) = (14.27)
∆21 (s) ∆22 (s)
Foe s = 0 we have the following steady state interaction matrix, ∆(s = 0), i.e.,
∆11 ∆12 ∆11 ∆12
∆(s = 0) = = (14.28)
∆21 ∆22 ∆12 ∆11
This last expression is often valid approximately also in the dynamic case, i.e. if
1/hc,i,j 1), and at low frequencies when s ≈ 0. From the elements in the interac-
tion matrix ∆ we can find the pairings which make sense
14.1 Interaction and pairing of variables 164
u u2
1
y1 ∆11 ∆12
(14.29)
y2 ∆21 ∆22
We are now assuming that the transfer function Ti,j (s) ≈ 1 and we therefore are
taking the approximative expressions for ∆ij (s) as the starting point. We have
the following rules for pairing of variables in single loop control of MIMO systems,
Balchen (1988).
Remark 14.1 The above rules for pairing of input and output variables is generally
valid when the elements ∆ij (s) varies with s, i.e. as a function of the frequency ω
where s = jω. A good approximation is that the transfer functions Ti,j (s = jω) ≈ 1
for frequencies less than the bandwidth of the system. For a 2×2 system it therefore
is sufficient to study the magnitude for
h12 h21
∆11 (s) = ∆22 (s) = (14.30)
h11 h22
and
h11 h22
∆21 (s) = ∆12 (s) = (14.31)
h12 h21
Remark 14.2 One should always first study ∆ under stationary behavior, i.e. first
put s = 0. Such an analysis is sufficient for most systems. Loosely spoken, this is
the case for systems which is easy to control. For a 2 × 2 system it normally holds
to study
h12 h21
∆11 (0) = ∆22 (0) = (s = 0) (14.32)
h11 h22
and
h11 h22
∆21 (0) = ∆12 (0) = (s = 0) (14.33)
h12 h21
14.2 Relative Gain Array (RGA) 165
Remark 14.3 The above rules for defining the pairings of input and output vari-
ables is valid also for m × m MIMO systems, i.e. for systems with m inputs and m
outputs. We are referring to Balchen (1988) for a description.
From the elements hi,j in the steady state transfer matrix Hp (s = 0) we have that
h12 h21
∆11 (0) = ∆22 (0) = (s = 0) ≈ 1.02 (14.36)
h11 h22
and
h11 h22
∆21 (0) = ∆12 (0) = (s = 0) ≈ 0.98 (14.37)
h12 h21
We are now forming the following table from the interaction matrix ∆, i.e.,
u u2
1
y1 1.02 0.98
(14.38)
y2 0.98 1.02
the starting point is a linear system described by the transfer matrix model
y = Hp u (14.40)
1. Chose the pairing uj → yi for which the corresponding RGA element λij is
positive and so close to 1 in magnitude as possible.
2. The pairing uj → yi must be avoided if the RGA element is negative, i.e. when
λij < 0.
The RGA matrix have a number of properties. First we note that Λ is a sym-
metric matrix. It can also be shown that the elements in each row or column in Λ
sums to 1, i.e.
m
X
λij = 1 for i = 1, · · · , m. (14.43)
j=1
The reason for that one should not use pairings which coincides with negative
RGA elements is that such a pairing strategy is structural unstable. There may exists
stable control structures which corresponds to negative RGA elements. However,
the total system may be unstable if one of the control loops are broken ore put in
manual. Such a control system is defined to be structural unstable.
It is of importance to denote this difference of a structural unstable control
system and a unstable control system, in connection with pairing of variables by
using RGA analysis ore Balchen index analysis, for single loop control of MIMO
systems.
Consider a 2 × 2 system. In this case we have the following relationship between the
elements in the RGA matrix and the elements in the ∆ matrix.
1 h12 h21
λ11 = , ∆11 = (14.46)
1 − ∆11 h11 h22
1 h11 h22
λ12 = , ∆12 = (14.47)
1 − ∆12 h12 h21
1 h22 h11
λ21 = , ∆21 = (14.48)
1 − ∆21 h21 h12
1 h12 h21
λ22 = , ∆22 = (14.49)
1 − ∆22 h11 h22
Note that λ11 = λ22 , λ12 = λ21 , ∆11 = ∆22 and ∆12 = ∆21 . The pairing uj → yi
should be avoided if λij < 0. The similar should be avoided when ∆ij > 1.
Chapter 15
We will in this section discuss the case in which we have multiple inputs (manipulated
variables, control inputs) and only one output (one measurement) to be controlled.
In this case we have a redundant number of input manipulable variables.
A common situation is a standard feedback system of a SISO system with one
input u1 and one output y and where the input (and/or the output) becomes sat-
urated. This means e.g. that the input is bounded as umin 1 ≤ u1 ≤ umax
1 . In
this situation it may be useful and/or necessary to add an extra input u2 (or more
inputs) in order to overcome the saturation and in order to achieve the goal y = r
where r is a desired specified reference for the output y. A strategy could then be
to use u1 for control when y ∈ [ymin , y1 ] and a second manipulable input u2 when
y ∈ [y1 , ymax ]
In the split-range control strategy there are multiple controllers which acts in
parallel rather than in series as in the cascade controller strategy.
If a model of the MIMO system is available, an optimal controller strategy, with
e.g. integral action, is believed to be very useful in this situation.
References
Åström, K. J., Hang, C. C. and B. C. Lim (1994). A new Smith predictor for con-
trolling a process with an integrator and long dead time. IEEE Transactions
on Automatic Control, Vol. 39, No. 2.
Appendix A
Laplace Transformations
In practice we need only a few basic rules about Laplace transformations and the
relationship to differential equations. Some of these will be described in this ap-
pendix.
where we assume that a ≥ 0 is a positive scalar number. The solution to Eq. (A.1)
is
we find from the laplace transformation of the solution Eq. (A.2) and Eq. (A.4)
that the Laplace transformation of the exponential is given by
1
L(e−at ) = . (A.6)
s+a
A.2 Laplace transformation of triogonometric functions 171
1 s + jω s ω
L(ejωt ) = = 2 2
= 2 2
+j 2 . (A.7)
s − jω s +ω s +ω s + ω2
Using and comparing with the Laplace transformation of the Euler formula
we find that
s
L(sin(ωt)) = , (A.9)
s2 + ω 2
ω
L(cos(ωt)) = . (A.10)
s2 + ω2
Using the identity
gives
cos(φ)s + ω sin(φ)
L(sin(ωt + φ)) = . (A.12)
s2 + ω 2