Control Systems U5 (TEL306)
Control Systems U5 (TEL306)
Control Systems
Unit 5
Digital and
Computer-based
Control
Contents
Unit overview 1
Unit outcomes 2
Introduction 3
Classification of signals 4
Introduction 34
Summary of Unit 5 76
Course summary 78
References 80
Unit Overview
Congratulations on entering Unit 5. This will be the last unit that we
will study together. I hope that what we have gone through so far has
benefited you to understand control systems which include yourself as
one of the important systems!
The previous four units presented the classical control theory for
continuous, linear, time-invariant and Single-Input-Single-Output (SISO)
systems. Comprehending the classical control theory is essential to
gain the analytical skills to support the learning of advanced control
systems. A practical complex system may have many input and output
(I/O) parameters, and these I/O parameters may be interrelated in a
complicated manner. One of the solutions as discussed in Unit 4 is by
decoupling the I/O parameters to decompose a Multi-Input-Multi-Output
(MIMO) system to a set of SISO systems. The system analysis and the
controller design could then be easier to accomplish. However, when
the conditions of decoupling of I/O parameters are not met, a MIMO
control system should be designed. State space control algorithm to
be introduced later in this unit is one of the methods to handle MIMO
systems.
The real world systems may also exhibit non-linear behaviours. Linear
analysis would be a sensible approach to linearise the governing equations
based on a set of proper assumptions. In the case where the linearisation
is not permitted, one might need to derive the process model expressed
in the form of non-linear equations. However, deriving a good analytical
model of a non-linear process may not be time and cost effective, if not
impossible, to work on a particular industrial control system. The Artificial
Intelligence (AI) technologies offer alternative methods to deal with the
non-linear process control. We will demonstrate the design of a Fuzzy
logic controller as an example of AI based control algorithms in this unit.
Unit Outcomes
By the end of Unit 5, you should be able to:
Classification of signals
Having clear understanding on the differences between a continuous-
time signal and a discrete-time signal is crucial to avoid any confusion
for the rest of this topic. The signals discussed in the previous units have
been continuous-time signals. This means that the signals are defined
over a continuous range of time and can change value at any fraction of
time smoothly. An example of the signal is shown as e(t) in Figure 5.2 (left
graph). Discrete-time signals are defined only at certain instants in time
and can change value only at those instants. The signals are produced
by sampling the continuous-time signals at a sampling period of T. The
example of discrete-time signal is illustrated in Figure 5.2 (centre graph)
denoted as e(kT). The discrete-time signal is normally passed through
the zero-order-hold (ZOH) circuit to produce a regulated signal h(T) as
shown in Figure 5.2 (right graph). It could be considered as a buffered
signal so that the ADC has sufficient time to process the sampled value.
Clock
(T)
Analogue signal
Sensor
conditioning
Quantisation
level
(Code)
Sample
intervals
Successive
Approximation
Subranging/Pipelined
Flash
Signal Bandwidth Converted
Clock
(T)
[
Vo = Vref D0
1
2n
+ D 1
1
2n − 1
+ D 2
1
2n − 2
+ ... + D n−1
1
2 ]
where D is a binary digit and equals a 1 or a 0. Do is also defined as the
least significant bit (LSB) and Dn − 1 the most significant bit (MSB).
Activity 5.2
Figure 5.8 shows a 5 bits adder type DAC. If the shift registers
s1 and s4 are ON and the others are OFF, determine the voltage
output if the reference voltage, Vref is 10 V.
Reading
There are also eBooks and websites that provide details on signal
conversion such as below:
3. ADC:
https://en.wikipedia.org/wiki/Analog-to-digital_converter
4. DAC:
https://en.wikipedia.org/wiki/Digital-to-analog_converter
The digital controllers can also be designed from the continuous controllers
in the s-domain. This could be done by using proper approximations of
the continuous functions such as integration and the derivation.
Example 1
U(s) 1 + ats
=
E(s) 1 + ts
The differential equation relating u(t) to e(t) could be obtained from the
transfer function as:
du(t) de(t)
u(t) + t = e(t) + t
dt dt
t T + at at
u(k) = u(k − 1) + e(k) − e(k − 1)
T+t T+t T+t
Derive the difference equation for the analogue PI controller with the
transfer function given below to realise the digital implementation
of the controller. Use ZOH method to approximate the integral and
derivative analogue functions.
U(s)
E(s) [
= Kp +
Ki
Ti s ]
Example 2
x(k) = [1, 3, 2, 0, 4, 0, 0, 0]
Solution
x(k) = {
1 for k = 0
0 for k > 0 }
Obtain the z-transform function for the unit impulse input.
Solution
x(k) = { }
0 for k < 0
1 for k ≥ 0
Solution
1
= 1 + x + x2 + x3 + ...
1−x
1 z
X(z) = 1 + z−1 + z−2 + z−3 + ... = =
1 − z−1 z − 1
Example 5
x
= 0 + x + 2x 2
+ 3x 3
+ ...
(1 − x)2
Hence,
z−1 Tz
X(z) = T(0 + z + 2z + 3z + ...) = T
−1 −2 −3
=
(1 − z−1)2 (z − 1)2
Example 6
The discrete-time signal for the following instants are described as:
By defining m = k − 1, then
Since x(m) = 0 for m < 0, we may change the lower unit of the summation
from m = −1 to m = 0.
Hence:
Example 7
Solution
Web Reference
For more z-transform pairs, you may refer to the following website:
https://lpsa.swarthmore.edu/LaplaceZTable/LaplaceZFuncTable.
html
Obtain the pulse transfer function, G(z) for the above phase lead
compensator.
One of the main reasons to derive the pulse transfer function, G(z), is
to determine the stability of the discrete-time system. A general pulse
transfer function, G(z), can be expressed as follows:
Example 8
where y is the output and x is the input. Plot the system poles and zeros
on the z-plane and determine the main characteristics of the system
response.
p1,2 = ±0.8
Activity 5.5
z+1
G(z) =
z2 + 0.3z + 0.02
Feedback
Activity 5.1
Vref 10
Resolution = = = 0.391
2n 28
4
The equivalent digital level of 4V = ≈ 102
0.391
Activity 5.2
The 5 bit DAC is with the reference voltage, Vref of 10 V. If the shift
registers s1 and s4 are ON and the others are OFF, the voltage
output could be calculated as:
Vo = Vref D0 [ 1
2n
+ D 1
1
2n − 1
+ D 2
1
2n − 2
+ ... + D n − 1
1
2 ]
Vo = 10 0[ 1
+
1
25 24
+ 0
1
23
+ 0
1
22
+ 1
1
2 ]
Vo = 10 1[ 1
24
+ 1
1
2 ]
= 5.625 V
U(s)
E(s) [
= Kp +
Ki
Ti s ]
1 Ki
U(s) = KpE(s) + E(s)
s Ti
Ki
sU(s) = KpsE(s) + E(s)
Ti
du(t) de(t) Ki
= Kp + e(t)
dt dt Ti
U(k) = U(k − 1) + Kp + [ Ki
Ti ]
T E(k) − Kp E(k − 1)
Activity 5.4
Activity 5.5
CE = z2 + 0.3z + 0.02 = 0
p1 = −0.1 p2 = −0.2
Plotting the roots on the z-plane, it is observed that the poles are
within the unit circle, hence the system is stable.
ẋ x(t) +
+
u(t) B +
+ ∫ C y(t)
Figure 5.16 A general state space open loop control system structure
The state variables, x(t), are the smallest possible subset of system
variables that can represent the entire state of the system at any given
time. For example, in the liquid heating system as shown in Figure 5.17,
the input variable, u(t), is the heater power and the output variable, y(t),
is the measured liquid temperature. What about the state variable? The
state variable, x(t) is the temperature of the liquid at any point within the
container, other than the measured point. Those temperatures may or may
not be the same as the measured temperature, y(t). Those unmeasured
temperatures are known as state variables, x(t).
For a linear time invariant (LTI) MIMO system, the general state space
model is written as:
where x(t) is the state vector, u(t) is the input vector, y(t) is the output
vector, A is the system matrix, B is the input matrix and C is the output
matrix. In most of the systems, the D matrix is null. It is to be noted that
the variables are expressed in the form of vector for a MIMO system. We
will demonstrate the application of state space model for a two outputs
one input system in the following example.
Example 9
10 1
G(s) = H(s) =
s+2 s + 100
B(s)
Sensor
Solution
The measured temperature, C(s), and the voltage signal, B(s) are set as
the outputs, Y(s), hence the system transfer functions are:
C(s) 10
= G(s) = → sC(s) + 2C(s) = 10 E(s)
E(s) s+2
B(s) 1
= H(s) = → sB(s) + 100B(s) = C(s)
C(s) s + 100
E(s) = R(s) – B(s)
dc(t)
= ċ(t) = – 2c(t) + 10e(t)
dt
db(t)
= ḃ(t) = −100b(t) + c(t)
dt
Since the input u(t) is given as r(t), the state space model could be
expressed as follows:
[ ][
ẋ 1(t)
ẋ 2(t)
=
−2 −10 x1(t)
1 −100 x2(t)][ ] [ ]
+
10
0
u(t)
Given the measured temperature, c(t), and the voltage signal, b(t) are
the outputs, y(t), hence:
[ ] [ ][ ] [ ]
c(t)
b(t)
=
1 0 x1(t)
0 1 x2(t)
0
+ u(t)
0
Solution
Transform the 3rd order differential equation into three 1st order differential
equations. Let:
x1(t) = y(t)
dy(t)
x2(t) = = ẋ 1(t)
dt
d 2y(t)
x3(t) = = ẋ 2(t)
dt 2
Arrange the three 1st order differential equations into state space format:
[ ][ ][ ] [ ]
ẋ 1(t) 0 1 0 x1(t) 0
ẋ 2(t) = 0 0 1 x2(t) + 0 u(t)
ẋ 3(t) −4 −3 −2 x3(t) 5
[ ]
x1(t)
y(t) = [1 0 0] x2(t) + [0]u(t)
x3(t)
Example 11
d 2(t) g
+ (t) = u(t)
dt 2 L
d(t)
x2(t) = , give a state space representation of the above system.
dt
Solution
d 2(t) g
Given: + (t) = u(t)
dt 2 L
d(t)
By setting x1(t) = (t) and x2(t) = , we have:
dt
d(t)
ẋ 1(t) = = θ̇(t) = x2(t)
dt
d 2(t) g
ẋ 2(t) = = � x1(t) + u(t)
dt 2 L
[ ] [ ][ ] [ ]
0 1
ẋ 1(t) x1(t) 0
= −g + u(t)
ẋ 2(t) 0 x (t) 1
L 2
y(t) = [1 0] [ ]
x1(t)
x2(t)
+ [0]u(t)
d 2y(t)
M + ky(t) = u(t)
dt 2
k
the mass. Derive the state space model by setting w2 = , y(t) =
M
dy(t)
x1(t) and = wx2(t).
dt
Consider a nth order SISO linear system with the state space model as
follows:
By taking the Laplace transform of the state space model with zero initial
conditions:
Therefore, the relationship between the output, Y(s), and input, U(s), can
be derived as follows:
Y(s) CB
= C[sI − A]−1B =
U(s) sl − A
where A and C are the matrix from the state space model, n is the number
of rows of the matrix and T is the transpose of the matrix.
State controllability:
where A and B are the matrix from the state space model and n is the
number of rows of the matrix. The system is deemed to be controllable if
the Ms matrix has full rank or the determinant of Ms matrix is non-singular
(det|Ms|≠ 0).
where A, B and C are the matrix from the state space model and n is the
number of rows of the matrix. The system is deemed to be controllable if
the Mo matrix has full rank or the determinant of Mo matrix is non-singular
(det|Mo|≠ 0).
Example 12
Calculate the transfer function of the system and analyse the stability
of the system.
[ ] [ ][ ] [ ]
ẋ 1(t)
ẋ 2(t)
=
−2
0
1 x1(t)
1 x2(t)
+
0
1
u(t)
y(t) = [1 0] [ ]
x1(t)
x2(t)
→ y(t) = Cx(t)
p() = |I – A| = 0
p() = |[ ] [
0
0
–
−2 1
0 1
=0 ]|
= |[ +2
0
−1
−1 ]|
= ( + 2)( − 1) = 0
Y(s) CB
= C[sI − A]−1 B =
U(s) sI − A
= (1 0)
0[
s+2
s−1 1 ] []
−1 −1 0
[ ]
1 1
= (1 0)
s+2
0
s + s2 − 2 0
1 1 []
s−1
Y(s) 1 1
= =
U(s) s + s2 − 2 (s + 2)(s − 1)
Activity 5.7
There are two ways of designing a closed loop system for the state space
system. Based on the analysis of the system controllability as discussed
in the previous section, if the system is state controllable, we can then
design a state feedback control system.
Figure 5.20 Block diagram of an open loop state space control system
Substituting the state feedback controller equation into the open loop
state space equation yields:
Ax = [A + BK]
Substituting the output feedback controller equation into the open loop
state space equation yields:
y(t) = Cx(t)
ẋ (t) = Ax(t) + BKCx(t) + Br(t)
ẋ (t) = [A + BKC]x(t) + Br(t)
Ay = [A + BKC]
d 2y(t)
m = c1y(t) + c2i(t)
dt2
where m = 0.02 kg, c1 = 2 N/m and c2 = 0.4 N/A.
dy(t)
1. By setting x1 = y(t) and x2 = and u(t) = i(t), they provide a
dt
state space representation of the system.
5. Determine the value of r(t) so that the final value of y(t) is 0.01m.
Solution
x1 = y
ẋ 1 = x2
d 2y c1 c2
ẋ 2 = 2 = x1 + i = 100x1 + 20u
dt m m
hence
[][ẋ 1
ẋ 2
=
0 1 x1
100 0 x2
+
0
][ ] [ ]
20
u
y = [1 0] []
x1
x2
= [ 0
20
20
0 ]
Since det(Ms) ≠ 0 and full rank, the system is state controllable.
Output controllability: Mo = [CB:CAB] = [0 20]
u = Kx + r
= k 1x 1 + k 2x 2 + r
ẋ = (A + BK)x + Br
Ax = A + BK = [ 0
100
1
0
+ ] [ ]
0
20
[k1 k 2]
= [ 0
100 + 20k1
1
20k2 ]
= |
−100 − 20k1 |
−1
− 20k2
=0
−20k2 > 0
−20k1 − 100 > 0
Hence
k2 < 0
k1 < −5
4. The gain K if the closed-loop poles are set at −10 and −20 in
the left-half complex plane:
u = −15x1 − 1.5x2 + r
x1 = y
ẋ 1 = x2
ẋ 2 = 100x1 + 20(−15x1 − 1.5x2 + r)
= −200x1 − 30x2 + 20r
0 = −200(0.01) + 20r
r = 0.1
Activity 5.8
[ ][
ẋ 1(t)
ẋ 2(t)
= ][ ] [ ]
−1 −1 x1(t)
0 −1 x2(t)
1
+ u(t)
0
y(t) = [1 0] [ ]
x1(t)
x2(t)
A B Z=A+B
0 0 0
1 0 1
0 1 1
1 1 1
Figure 5.24(a) Truth table for OR gate
Figure 5.25
Source: https://www.mathworks.com/help/fuzzy/foundations-of-fuzzy-logic.
html
1.69m 1.72m
In the steam turbine process, the input, u(t), parameter is the setting of
throttle at the inlet of the turbine and the output, y(t), are the temperature
and the pressure of the steam. This is a MIMO process with two outputs
and one input parameters. Designing a classical control for such a
process could be very challenging. We will now demonstrate how a fuzzy
logic controller could be designed for this system.
Setpoint, r(t) e(t) e(kT) Digital u(kT) u(t) Steam Output, y(t)
+ ADC DAC
� controller turbine
Clock
(T)
Analogue signal
Sensor
conditioning
Assuming that the experimental data are collected and the specification
of the steam turbine process is depicted in Table 5.2, the I/O parameters
can be mapped into fuzzy sets as depicted in Figure 5.29. For instance,
the fuzzy set of the temperature could be constructed as follows:
4. Label the classes as Cold, Cool, Nominal, Warm and Hot for
the range of temperature error from T0 at �400°C to T9 at
+400°C.
The procedures could also be applied to construct the fuzzy sets for
pressure error and the throttle setting over the ranges accordingly.
Table 5.3 Calculation for temperature fuzzy set based on temperature error
Figure 5.29 Fuzzy sets for two inputs and one output fuzzy controller
For example, if the temperature error of �200°C and the pressure error of
�10 bar are fed from the sensors to the controller, the temperature input
will be tagged to “cool” state and the pressure input will be tagged in the
“low” and “ok” states. Hence, Rules 2 and 3 will be triggered as illustrated
in Figure 5.31. The two outputs from two rules are then combined and
defuzzified using centroid defuzzification method as depicted in Figure
5.32. The fuzzy controller then produces an output of opening +25%
to adjust the throttle of the steam turbine. As the fuzzy logic controller
design is an empirical method, fine tuning of the controller parameters
is expected to improve the performance for a given process.
+25%
Feedback
Activity 5.6
d 2y(t) k 1
+ y(t) = u(t)
dt2 M M
d 2y(t) 1
= �w 2
y(t) + u(t)
dt 2
M
dy(t)
Since = wx2(t), therefore:
dt
d 2y(t) 1
= wẋ 2(t) = �w2y(t) + u(t)
dt 2
M
w2 1
ẋ 2(t) = � y(t) + u(t)
w wM
1
ẋ 2(t) = �wx1(t) + u(t)
wM
dy(t)
ẋ 1(t) = = wx2(t)
dt
We can now arrange the first order equations into the state space
format:
[ ][ ][ ] [ ]
ẋ 1(t) 0 w x1(t) 0
= + u(t)
ẋ 2(t) −w 0 x2(t) 1
wM
y(t) = [1 0] [ ]
x1(t)
x2(t)
y(t) = Cx(t)
Activity 5.7
[ ][
ẋ 1(t)
ẋ 2(t)
=
�1
0 ][ ] [ ]
�1 x1(t)
�1 x2(t)
+
1
0
u(t)
y(t) = [1 0] [ ]
x1(t)
x2(t)
A= [ �1
0 ] []�1
�1
,B=
1
0
, C = [1 0]
AB = [ ][ ] [ ]
�1
0
�1 1
�1 0
=
�1
0
Ms = [B [ ]
AB] =
1
0
�1
0
det(Ms) = | | 1
0
�1
0
=0
Mo = [CB CAB]
CB = [1 0] []
1
0
=1
CB = [1 0] [ ]
�1
0
= �1
Mo = [1 �1]
Y(s)
= C[sI � A]�1B
U(s)
[sI � A]�1 = {[ ] [
s
0
0
s
�
�1
0
�1
�1 ]} [
�1
=
s+1
0
1
s+1 ] �1
=
1
[
(s + 1)2
s+1
0
�1
s+1 ]
[ ]
1 �1
s+1 (s + 1)2
=
1
0
s+1
[ ]
1 �1
Y(s)
U(s)
= C[sI � A]�1B = (1 0)
s+1
0
(s + 1)2
1 []
0
1
s+1
Y(s) 1
=
U(s) s + 1
u = k x1 + r
Adding the state feedback controller into the closed loop system:
ẋ = (A + BK)x + Br
where
K = [k 0]
Ax = A + BK = [ �1
0
�1
�1 ] []
+
1
0
[k 0]
= [ �1 + k
0
�1
�1 ]
The characteristic equation of the system can be obtained by:
= | +1�k
0
1
|
+ 1
=0
= ( + 1 � k)( + 1) = 0
= 2 + (2 � k) � k + 1 = 0
p1 = k � 1
p2 = �1
k�1<0
Hence
k<1
Activity 5.9
u=ky+r
Since
y = Cx
Adding the output feedback controller into the closed loop system:
ẋ = Ax + BKCx + Br
ẋ = [A + BKC]x + Br
where
K = [k]
C = [1 0]
Ay = A + BKC = [ �1
0
�1
�1] []
1
+ [k][1
0
0]
= [ �1 + k
0
�1
�1 ]
74 TEL 306/05 Control Systems
The characteristic equation of the system can be obtained by:
= | +1�k
0
1
+1
=0|
= ( + 1 � k)( + 1) = 0
= 2 + (2 � k) � k + 1 = 0
p1 = k � 1
p2 = �1
For a stable system, all the poles must be on the left hand side of
the s-plane, i.e. must be negative poles. Therefore,
k–1<0
Hence
k<1
s2 1 1�k
s1 2 � k
s0 1 � k
1�k>0
Hence,
k<1
Summary
1. This unit introduces the digital control, the state space control
and the fuzzy logic control as the advanced control methods.
Summary
For every beginning, there is an end. This section marks the end of
this course but it is the beginning of the exploration to the practical
implementation of the knowledge and skills that you acquired
throughout the course, which can be summarised as follows:
The topics above may enrich you with some of the engineering
knowledge and analytical skills in confronting problems in your
journey. The real world is always full with new and unforeseen
challenges. Stay humble and you will continue to learn more from
those experienced practitioners.
Zain, Z., Taib, M., & Baki, S. (2007). Hot and humid climate: prospect
for thermal comfort in residential building. Desalination, 209, 261 – 268.
COURSE COORDINATOR
Dr. Magdalene Goh Wan Ching
PRODUCTION
In-house Editor: Ms. Jeanne Chow
Graphic Designer: Ms. Valerie Ooi
Wawasan Open University is Malaysia’s first private not-for-profit tertiary institution dedicated to
adult learners. It is funded by the Wawasan Education Foundation, a tax-exempt entity established
by the Malaysian People’s Movement Party (Gerakan) and supported by the Yeap Chor Ee Charitable
and Endowment Trusts, other charities, corporations, members of the public and occasional grants
from the Government of Malaysia.
The course material development of the university is funded by Yeap Chor Ee Charitable and
Endowment Trusts.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or
transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise,
without prior written permission from WOU.