0% found this document useful (0 votes)
86 views84 pages

Control Systems U5 (TEL306)

This document provides an overview of digital and computer-based control systems. It discusses: 1. The key components of a digital control system including analog-to-digital converters (ADCs), digital-to-analog converters (DACs), a digital controller, and a clock. ADCs and DACs are needed to interface between analog signals from the real world and digital signals used by the computer controller. 2. Classification of signals as either continuous-time or discrete-time signals, depending on whether they can change value continuously or only at discrete time intervals. Discrete-time signals are produced by sampling continuous-time signals. 3. Conversion between analog and digital signals, where ADCs convert discrete
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views84 pages

Control Systems U5 (TEL306)

This document provides an overview of digital and computer-based control systems. It discusses: 1. The key components of a digital control system including analog-to-digital converters (ADCs), digital-to-analog converters (DACs), a digital controller, and a clock. ADCs and DACs are needed to interface between analog signals from the real world and digital signals used by the computer controller. 2. Classification of signals as either continuous-time or discrete-time signals, depending on whether they can change value continuously or only at discrete time intervals. Discrete-time signals are produced by sampling continuous-time signals. 3. Conversion between analog and digital signals, where ADCs convert discrete
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

TEL 306/05

Control Systems

Unit 5
Digital and
Computer-based
Control
Contents
Unit overview 1

Unit outcomes 2

5.1 Digital control system 3

Introduction 3

Classification of signals 4

Conversion between analogue and digital signals 5

Discrete time transformation and analysis 12

Suggested answers to activities 30

5.2 Advanced control systems 34

Introduction 34

State space representation 34

State space analysis 42

State space controller design 48

Artificial Intelligence in control systems 57

Fuzzy logic controller 58

Example of fuzzy logic controller 62

Suggested answers to activities 68

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 5 Digital and computer-based control 1


The introduction of the first digital computer in the early 1940s initiated
the revolution of the control systems from analogue oriented to digital
oriented (Copeland, 2006). Digital controllers are commonly found
nowadays in the form of computers or microcontrollers in many different
applications. There are several reasons that lead to the popularity of the
digital control systems such as cost and time effective, adaptable and
less prone to variations in the environment conditions. In the following
section, we will study several aspects of implementing a digital control
system.

Unit Outcomes
By the end of Unit 5, you should be able to:

1. Describe the structure of digital and computer based


control.

2. Analyse the performance of digital control system.

3. Represent systems in state space format.

4. Analyse the characteristics of state space systems.

5. Elaborate other advanced controllers using Artificial


Intelligent (AI) algorithm.

2 TEL 306/05 Control Systems


5.1 Digital Control System
Introduction
A typical structure of a digital control system is shown in Figure 5.1.
Comparing to the structure of the analogue control system, a digital
controller requires additional components which are:

1. An Analogue to Digital converter (ADC) to convert analogue


inputs measured from real world process to machine readable
digital format.

2. A Digital to Analogue converter (DAC) to convert controller


outputs in digital format to analogue signal that could be
executed in the real world process.

3. A program in the digital controller that executes the digital


function by manipulating the measured data.

4. A clock that regulates the timing of ADC and DAC conversions.

In contrast to an analogue control system with variables that can change


at any infinite time smoothly, the variables of a digital (also denoted
as discrete-time) control system can change only at discrete instants
of time, T. We shall denote these instants as kT (k = 0, 1, 2, ...). The
notation of signal in (t) represents continuous-time signal, such as e(t)
and the notation in (kT) represents the discrete-time signal, e.g., e(kT)
after converted by ADC.

UNIT 5 Digital and computer-based control 3


There are two approaches to design a digital control system, which are:

1. Perform a continuous design, then digitise the resulting


analogue controller.

2. Direct digital controller design on the basis of a digitised


process model.

In this section, we will focus on the first approach.

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.

Setpoint, r(t) e(t) e(kT) Digital u(kT) u(t) Output, y(t)


ADC DAC Process
controller

Clock
(T)

Analogue signal
Sensor
conditioning

Figure 5.1 Block diagram for a digital control system

4 TEL 306/05 Control Systems


Figure 5.2 Signal sampling using ZOH

Conversion between analogue and digital signals


The real world system communicates through analogue signals but the
computer world communicates by means of digital signals. To bridge
the both worlds, ADCs and DACs are necessary. Subsequent to the
sampling process discussed previously, the discrete-time signal is then
converted by an ADC to a series of binary codes that represents the
amplitude of the discrete-time signal as demonstrated in Figure 5.3.
The binary codes are then fed to the digital computer for programme
execution. The performance of the ADC is determined by two factors,
namely the sampling rate and the resolution.

1. The sampling rate (x-axis of Figure 5.4) defines the frequency


of sampling the continuous-time signal. Increasing the sampling
rate will result in more samples within a timeframe, hence a
closer approximation of the changes of continuous-time signal
from the real world.

UNIT 5 Digital and computer-based control 5


2. The resolution of the ADC defines the accuracy in measuring
the amplitude of the continuous-time signal. It is determined by
the number of bits of the converter. For example, a 2 bits
converter will have 22 = 4 quantization levels as illustrated in
the y-axis of Figure 5.4. The higher the number of bits, the
more quantization levels are available. Hence the amplitude of
the continuous-time signal could be closely approximated.

Figure 5.3 Conversion of discrete-time signal into binary codes

Quantisation
level
(Code)

Sample
intervals

Figure 5.4 Resolution and sampling period

6 TEL 306/05 Control Systems


The choice of sampling rate and resolution for an ADC is application
dependent. Higher sampling rate and resolution of course result in more
accurate approximation of the real world analogue signal, but need to
be supported by a powerful digital processor. A general guideline for
a suitable sampling rate could refer to the Nyquist-Shannon sampling
theorem, which is at least twice of the highest frequency signal. There
are different ways of implementing an electronics ADC such as a flash
converter, a delta-sigma converter, a counter ADC, etc. Each ADC
possesses different allowable sampling rate (bandwidth) and resolution
as depicted in Figure 5.5 due to the different operating mechanisms.
For instance, in the application which requires high bandwidth such
as video broadcasting, a flash ADC is normally adopted. However, the
flash ADC imposes higher cost of implementation as more comparators
are needed as shown in Figure 5.6. The flash ADC circuit consists of a
resistive divider network, a set of op-amp comparators and an encoder.
The analogue input voltage is compared with each of the node voltages
and the comparator output is encoded into the binary output for the
digital controller. The conversion takes place simultaneously rather than
sequentially, hence allowing a high sampling rate. The resolution of the
flash ADC, however, is normally low as a trade-off for the high sampling
rate based on a limited processor power. The flash ADC is one of many
ways of implementing the electronics analogue to digital conversion.
Other ways of conversion could be found in the list of Reading and Web
reference sections.

UNIT 5 Digital and computer-based control 7


Sigma Delta
Conversion Resolution

Successive
Approximation

Subranging/Pipelined

Flash
Signal Bandwidth Converted

Figure 5.5 Performance comparison of ADCs


Encoder

Figure 5.6 A flash ADC

8 TEL 306/05 Control Systems


Activity 5.1

The error signal, e(t), as shown in Figure 5.7 is configured in the


range of 0 to 10V in a digital control system. Given the flash ADC
is with an 8-bit register, determine the resolution of the conversion.
What is the digital value that represents a value of 4V?

Setpoint, r(t) e(t) Flash Digital u(t) Output, y(t)


DAC Process
ADC controller

Clock
(T)

Figure 5.7 Flash ADC in the digital control system

The digital controller produces binary output signal by executing the


programme using the converted signal fed by the ADC. To make the
binary output signal meaningful to the real world process, a translation
of binary signal into equivalent analogue signal is required. This is
accomplished by using the digital to analogue converter (DAC). The DAC
is sometimes considered as a decoding device which is a process of
taking a value represented in digital code and converting it into a voltage
or current which is proportional to the digital input value. A simple adder
type DAC is illustrated in Figure 5.8. The analogue output signal, Vo, from
the DAC could be calculated as follows:

[
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).

UNIT 5 Digital and computer-based control 9


Figure 5.8 A 5 bits adder type DAC

Similar to the flash ADC, the concurrent conversion of digital input to


analogue output undoubtedly allows high speed operation. However,
small microcontrollers may not have a lot of I/O pins to support the
operation. One of the solutions is by using Pulse Width Modulation
(PWM) technique to perform the DAC function. A PWM operates by
turning only a single output pin on/off within a specific time-period as
depicted in Figure 5.9. The mark to space ratio (duty cycle) forms an
effective analogue voltage when filtered. The successful implementation
of the PWM should be with the switching frequency of high enough not
to affect the load. It is particularly suited for operating inertial loads such
as heaters and motors, which are not as easily affected by the high speed
discrete switching.

10 TEL 306/05 Control Systems


Figure 5.9 PWM as a DAC

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

As the focus of the unit is on the digital controller design, only a


brief coverage on signal sampling and conversion is included to
make the unit self-contained. Readers who are enthusiastic to
know details of the signal sampling and conversion could refer
to the following book:

Curtis, D. J. (2014). Process Control Instrumentation Technology


(8th ed.). Essex, England: Pearson Education.

UNIT 5 Digital and computer-based control 11


Web Reference

There are also eBooks and websites that provide details on signal
conversion such as below:

1. William, C. D. (2006). Introduction to Instrumentation, Sensors,


and Process Control, Norwood, MA: Artech House:
http://www.books24x7.com.neptune.wou.edu.my/marc.
asp?bookid=14819

2. ZOH and first order hold:


https://en.wikipedia.org/wiki/Zero-order_hold

3. ADC:
https://en.wikipedia.org/wiki/Analog-to-digital_converter

4. DAC:
https://en.wikipedia.org/wiki/Digital-to-analog_converter

Discrete time transformation and analysis


The analogue systems discussed in previous units are modelled by means
of differential equations and Laplace transfer functions. In digital systems,
the signals only exist at the sampling instants and consequently the
differentials are indeterminate. Difference equations are used to model
the digital systems, or commonly known as discrete-time systems. An
example of the difference equation is:

u(k) = u(k − 1) + e(k)

12 TEL 306/05 Control Systems


where k represents the sampling instants, u is the output from the digital
controller and e is the error signal input to the digital controller. The
difference equation suits well in programming a digital controller. For
example, the equation above could be implemented as follows:

1. Initialise output u to zero

2. Read ADC and store the e value as e(k)

3. Calculate the new value of y using the computer programme


where u(k) = u(k − 1) + e(k)

4. Send new value of u(k) to DAC

5. Wait until sampling time, T, seconds have elapsed

6. Repeat from step 2.

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

The design of a continuous phase lead compensator has been elaborated


in Unit 4 and the transfer function could be expressed as:

U(s) 1 + ats
=
E(s) 1 + ts

where α and τ are constants. We will now derive a difference equation


based on the transfer function above for the digital implementation.

UNIT 5 Digital and computer-based control 13


Solution

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

Using ZOH method (backward difference method) to approximate the


differential equation and replacing the continuous-time element, t, with
the discrete-time element, k, give:

u(k) − u(k − 1) e(k) − e(k − 1)


u(k) + t = e(k) + at
T T

where T is the sampling period. Rearranging to give the current value


of the compensator output, u(k), yields the difference equation for the
phase lead compensator as:

t T + at at
u(k) = u(k − 1) + e(k) − e(k − 1)
T+t T+t T+t

The above difference equation could be conveniently programmed into


a digital controller with calculated values of constants a and t, at the
predefined sampling period, T.

14 TEL 306/05 Control Systems


Activity 5.3

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 ]

The difference equation provides a convenient way of programming


the digital controller as the I/O relationship of the discrete-time signals
are presented clearly. However, in dealing with the analytical works, the
difference equation might not be in a proper form to support. Therefore,
z-transform is needed to convert the difference equation into the pulse
transfer function, G(z). This is an analogy to the analogue system. The
differential governing equation of an analogue system gives intuitive
insights to the operating principle of the systems, but unsuitable for
performance analysis. Hence Laplace transform is needed to convert
the differential equations into transfer functions for the analysis purpose.

The z-transform is a method to transform difference equations into pulse


transfer functions, G(z). Given a discrete-time signal:

x(k) = x(0), x(1), x(2), ...

the z-transform of x(k) is written as the infinite power series in terms of


the complex variable, z:

Z[x(k)] = x(0) + x(1)z−1 + x(1)z−2 + ...


Z[x(k)] = X(z) = ∑ ∞k = 0 x(k)z−k

UNIT 5 Digital and computer-based control 15


It is a good practice to represent the discrete-time variables using the
lower case, x(k), while the z-transform variables using the upper case,
X(z) to avoid confusion in the notation. This is similar to representing
Y(s) in the Laplace transform function and y(t) in the time domain
function for analogue system. Practise makes perfect! We shall now
practise z-transform on different types of discrete-time signals to learn
by examples.

Example 2

z-transform on casual sequence of discrete-time signal

The sampled data, x(k), collected from the ADC at a sequence, k, of


sampling time is given as follows:

x(k) = [1, 3, 2, 0, 4, 0, 0, 0]

Obtain the z-transform function for the discrete sequence, k.

Solution

Z[x(k)] = x(0) + x(1)z−1 + x(1)z−2 + ...


Z[x(k)] = X(z) = 1 + 3z−1 + 2z−2 + 4z−4

16 TEL 306/05 Control Systems


Example 3

z-transform on a unit impulse input

The unit impulse discrete-time function as shown in Figure 5.10 can be


described as:

x(k) = {
1 for k = 0
0 for k > 0 }
Obtain the z-transform function for the unit impulse input.

Figure 5.10 Discrete impulse input

Solution

Z[x(k)] = x(0) + x(1)z−1 + x(1)z−2 + ... = ∑ ∞k = 0 x(k)z−k


Z[x(k)] = X(z) = 1

UNIT 5 Digital and computer-based control 17


Example 4

z-transform on a unit step input

The unit step discrete-time function as shown in Figure 5.11 can be


described as:

x(k) = { }
0 for k < 0
1 for k ≥ 0

Obtain the z-transform function for the unit step input.

Figure 5.11 Discrete step input

Solution

Z[x(k)] = x(0) + x(1)z−1 + x(1)z−2 + ... ∑ ∞k = 0 x(k)z−k


Z[x(k)] = X(z) = 1 + z−1 + z−2 + z−3 + ...

We may also express the sequence as the binomial expression as follows


since all the discrete-time values are 1 when k ≥ 0.

1
= 1 + x + x2 + x3 + ...
1−x

18 TEL 306/05 Control Systems


Hence,

1 z
X(z) = 1 + z−1 + z−2 + z−3 + ... = =
1 − z−1 z − 1

Example 5

z-transform on a unit ramp input

The unit ramp discrete-time function as shown in Figure 5.12 can be


described as:

x(k) = { 0 for k < 0


t for k ≥ 0 }
Obtain the z-transform function for the unit ramp input.

Figure 5.12 Discrete ramp input

UNIT 5 Digital and computer-based control 19


Solution

Z[x(k)] = x(0) + x(1)z−1 + x(1)z−2 + ... ∑ ∞k = 0 x(k)z−k


Z[x(k)] = X(z) = 0 + kTz−1 + kTz−2 + kTz−3 + ...
Z[x(k)] = T∑ ∞k = 0 kz−k = T(z−1 + 2z−2 + 3z−3 + ...)

In order to evaluate this series in a closed form, the expression for

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

z-transform on discrete-time signal at any instant

The discrete-time signal for the following instants are described as:

x(k − 1), x(k − n), x(k + 1), x(k + 2) and x(k + n)

Obtain the z-transform function for the discrete-time signals above.

20 TEL 306/05 Control Systems


Solution

For x(k − 1), the z-transform is given by:

Z[x(k − 1)] = ∑ ∞k = 0 x(k − 1)z−k = z−1 ∑ ∞k = 0 x(k − 1)z −(k − 1)

By defining m = k − 1, then

Z[x(k − 1)] = z−1 ∑ ∞k = 0 x(m)z−m

Since x(m) = 0 for m < 0, we may change the lower unit of the summation
from m = −1 to m = 0.

Hence:

Z[x(k − 1)] = z−1 ∑ ∞m = 0 x(m)z−m = z−1X(z)

For x(k − n), similarly the z-transform could be obtained as:

Z[x(k − n)] = z−1 ∑ ∞m = 0 x(m)z−m = z−nX(z)

For x(k + 1), the z-transform is given by:

Z[x(k + 1)] = ∑ ∞k = 0 x(k + 1)z−k = ∑ ∞k = 0 x(k)z−k + 1 = z∑ ∞k = 0 x(k)z−k − x(0)

Z[x(k + 1)] = zX(z) − zx(0)

For x(k + 2), similarly the z-transform could be obtained as:

Z[x(k + 2)] = z2X(z) − z2x(0) − zx(1)

UNIT 5 Digital and computer-based control 21


For x(k + n), similarly the z-transform could be obtained as:

Z[x(k + n)] = z nX(z) − z n x(0) − z n − 1 x(1) − z n − 2 x(2) − ... zx(n − 1)

Example 7

Obtain pulse transfer function by z-transforming difference equation

The open loop time response of a first order discrete-time system is


given by the following difference equation:

y(k) = 0.2y(k − 1) + 0.3x(k − 1)

Obtain the pulse transfer function, G(z) by z- transform on the above


equation.

Solution

z-transforming each terms of the given difference equation:

Y(z) = 0.2z−1Y(z) + 0.3z−1X(z)

Arrange in the format of pulse transfer function:

Y(z) 0.3z −1 0.3


= G(z) = =
X(z) 1 − 0.2z−1 z − 0.2

The ability to manipulate z-transform manually is important to understand


the concept of z-transform. However, the controller designer sometimes
would prefer to refer the z-transform table as shown in Table 5.1 to speed
up the analytical works.

22 TEL 306/05 Control Systems


Table 5.1 Common pairs of signals expressed in different domains

Web Reference

For more z-transform pairs, you may refer to the following website:

https://lpsa.swarthmore.edu/LaplaceZTable/LaplaceZFuncTable.
html

UNIT 5 Digital and computer-based control 23


Activity 5.4

The difference equation for the phase lead compensator could


be simplified as:

u(k) = 0.1u(k − 1) + 0.3e(k) − 0.2e(k − 1)

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:

Y(z) b0 + b1z + ... + bm z m


= G(z) =
X(z) a0 + a1 z + ... + an zn)

Similar to the Laplace transfer function, the characteristic equation of the


pulse transfer function is defined by the denominator. The importance of
roots of the characteristic equation and their influences on the transient
response of the system apply equally to the discrete-time systems. The
poles and zeros obtained from the characteristic equation can be plotted
into the z-plane for further analysis. The z-plane is a complex plane
with a real axis and an imaginary axis as shown in Figure 5.13. A more
comprehensive information on relationship between pole locations and
the transient responses is illustrated in Figure 5.14. It can be observed
that the discrete-time system becomes unstable when any of the poles
are located outside of the unit circle, regardless of left or right side of the
z-plane. As a general guideline, the stability of the discrete-time system
could be interpreted as follows:

24 TEL 306/05 Control Systems


1. Stable if all the poles, p, are within the unit circle, i.e., p < 1

2. Marginally stable if any pole, p, lies on the unit circle, i.e.,


p=1

3. Unstable if any pole, p, appears outside the unit circle, i.e.,


p>1

Figure 5.13 z-plane

UNIT 5 Digital and computer-based control 25


Figure 5.14 Location of poles and transient responses

Example 8

Obtain a pulse transfer function for the following difference equation:

y(k) = 0.64[x(k-2) – y(k-2)]

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.

26 TEL 306/05 Control Systems


Solution

z-transforming each terms of the difference equation:

Y(z) = 0.64z−2X(z) − 0.64z−2Y(z)


Y(z) + 0.64z−2Y(z) = 0.64z−2X(z)
Y(z)[1 + 0.64z−2] = 0.64z−2X(z)

Arrange in the format of pulse transfer function, G(z):

Y(z) 0.64z −2 0.64


= G(z) = =
X(z) 1 + 0.64z −2 z 2 − 0.64

The poles of the system are found to be:

p1,2 = ±0.8

Plotting the poles on the z-plane is shown in Figure 5.15. Comparing


the locations of the poles to Figure 5.14, the response of the system is
expected to be attenuating to the value of zero. Hence the system is
stable.

UNIT 5 Digital and computer-based control 27


Figure 5.15 Locations of poles on z-plane

Activity 5.5

A pulse transfer function, G(z), is given as follows:

z+1
G(z) =
z2 + 0.3z + 0.02

Determine if the system is stable.

28 TEL 306/05 Control Systems


Summary

Digital control systems are commonly found in many applications


nowadays subsequent to the advancement in digital processor
technologies that provide cost effective solution. The general
structure of a digital control system consists of a real world
process, an ADC, a DAC, a digital controller and sensors. ADCs
and DACs are required to interface the analogue real world process
with the digital computer world. The accuracy of the conversions
between the analogue and digital signals depends on the sampling
rate and the resolution.

The digital controllers can be obtained by converting the


continuous controllers expressed in the s-domain. This could be
done by using proper approximations of the continuous functions
such as integration and the derivation. The difference equation
provides a convenient way of programming the digital controller
but the analytical works of a digital control system need to use
the pulse transfer function, G(z). The z-transform is a method to
transform difference equations into pulse transfer functions. The
stability of the digital control system can then be determined.

UNIT 5 Digital and computer-based control 29


Suggested answers to activities

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

30 TEL 306/05 Control Systems


Activity 5.3

From the transfer function of the PI controller:

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

Inverse Laplace to derive the differential equation:

du(t) de(t) Ki
= Kp + e(t)
dt dt Ti

UNIT 5 Digital and computer-based control 31


Using ZOH method to approximate the derivative analogue
function, we obtain the difference equation as follows:

U(k) − U(k − 1) E(k) − E(k − 1) Ki


= Kp + E(k)
T T Ti

Hence the difference equation for the PI controller can be obtained


as:

U(k) = U(k − 1) + Kp + [ Ki
Ti ]
T E(k) − Kp E(k − 1)

Activity 5.4

z-transforming each terms of the given difference equation:

U(z) = 0.1z−1U(z) + 0.3E(z) + 0.2z−1E(z)

Arrange in the format of pulse transfer function:

U(z) 0.3 + 0.2z −1 0.3z + 0.2


= G(z) = =
E(z) 1 − 0.1z−1 z − 0.1

Activity 5.5

The stability of the system is determined by the characteristic


equation (CE) of the system, where:

CE = z2 + 0.3z + 0.02 = 0

32 TEL 306/05 Control Systems


The poles of the CE could be obtained from the roots of the CE as:

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.

UNIT 5 Digital and computer-based control 33


5.2 Advanced Control
Systems
Introduction
Real world systems usually involve many I/O parameters and are
defined as Multi-Input-Multi-Output (MIMO) systems. The systems may
also exhibit non-linearity behaviours. The analytical methods and the
controller designs that we learnt in the previous units are only applicable
for linear Single-Input-Single-Output (SISO) systems. Therefore, more
advanced methodologies namely state space control method and
Artificial Intelligence (AI) method are introduced here. The details of the
state space and AI control methodologies could be very complicated.
However, the content of the unit will be kept at an entry yet informative
level to spark your interest for further study.

State space representation


Figure 5.16 illustrates a general structure to represent a state space
control system. In state space representation, a physical system can be
described using a set of input, u(t), output, y(t), and state, x(t) variables.
The input and output variables have been clearly defined in the previous
units. How about the state variables?

34 TEL 306/05 Control Systems


D

ẋ 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:

ẋ (t) = Ax(t) + Bu(t)

y(t) = Cx(t) + Du(t)

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.

UNIT 5 Digital and computer-based control 35


Figure 5.17 Variables of a liquid heating system

Example 9

The liquid heating system in Figure 5.17 could be represented in block


diagram as shown in Figure 5.18 with the process transfer function, G(s),
and the sensor function, H(s). The output of the process is the actual
temperature at the measured point, C(s), and a voltage signal, B(s), is
produced by the temperature sensor. Given the transfer functions, G(s)
and H(s) are as follows:

10 1
G(s) = H(s) =
s+2 s + 100

Derive a state space model to include both the measured temperature,


C(s), and the voltage signal, B(s) as the outputs, Y(s) and the setpoint,
R(s), as the input, u(t).

36 TEL 306/05 Control Systems


R(s) E(s) C(s)
+ Boiling process

B(s)
Sensor

Figure 5.18 A liquid heating system with two output variables

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)

The differential equations resulting from the transfer functions are:

dc(t)
= ċ(t) = – 2c(t) + 10e(t)
dt

Since e(t) = r(t) – b(t), hence:

ċ(t) = −2c(t) + 10[r(t) − b(t)]

ċ(t) = −2c(t) − 10b(t) + 10r(t)

db(t)
= ḃ(t) = −100b(t) + c(t)
dt

UNIT 5 Digital and computer-based control 37


Select the state variables as x1(t) = c(t) and x2(t) = b(t), the differential
equations could be rewritten as:

ċ(t) = ẋ 1(t) = −2x1(t) − 10x2(t) + 10r(t)


ḃ (t) = ẋ 2(t) = −100x2(t) + x1(t)

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

which is now in the general form of:

ẋ (t) = Ax(t) + Bu(t)


y(t) = Cx(t) + Du(t)

The example above demonstrated the derivation of a simple MIMO state


space model. The state space model could be also implemented for a
SISO system. This could be done by transforming the nth order differential
equation of the SISO system into n number of 1st order differential
equation.

38 TEL 306/05 Control Systems


Example 10

A 3rd order differential equation is given as follows:

d 3y(t) d 2y(t) dy(t)


+ 2 + 3 + 4y(t) = 5u(t)
dt 3 dt 2 dt

Obtain the state space representation for the differential equation.

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

d 3y(t) d 2y(t) dy(t)


= ẋ 3 (t) = −2 − 3 − 4y(t) + 5u(t)
dt 3 dt 2 dt
∴ ẋ 3(t) = −2x3(t) − 3x2(t) − 4x1(t) + 5u(t)

Arrange the three 1st order differential equations into state space format:

ẋ (t) = Ax(t) + Bu(t)


y(t) = Cx(t) + Du(t)

UNIT 5 Digital and computer-based control 39


where:

[ ][ ][ ] [ ]
ẋ 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

A mechanical crane, which is used to displace a mass, m, from one


location to another, is illustrated in Figure 5.19.

Figure 5.19 Mechanical crane process

The model of the mechanical crane is similar to that of a simple pendulum


of length, L, with an angular displacement, , and is given by:

d 2(t) g
+ (t) = u(t)
dt 2 L

40 TEL 306/05 Control Systems


Where u(t) = F/m and F is the force acting on the mass and g is the
acceleration due to gravity. By setting the output, y(t) = x1(t) = (t) and

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

Hence the state space model could be expressed as:

[ ] [ ][ ] [ ]
0 1
ẋ 1(t) x1(t) 0
= −g + u(t)
ẋ 2(t) 0 x (t) 1
L 2

→ ẋ (t) = Ax(t) + Bu(t)

y(t) = [1 0] [ ]
x1(t)
x2(t)
+ [0]u(t)

→ y(t) = Cx(t) + Du(t)

UNIT 5 Digital and computer-based control 41


Activity 5.6

A spring mass system can be approximated by the equation of


motion of the mass as follows:

d 2y(t)
M + ky(t) = u(t)
dt 2

Where y(t) is the displacement of the mass M from the equilibrium


position, k is the spring constant and u(t) is the force applied to

k
the mass. Derive the state space model by setting w2 = , y(t) =
M
dy(t)
x1(t) and = wx2(t).
dt

State space analysis


It has been demonstrated that a state space model could be obtained
from the transfer function and the differential equation. Conversely, a
transfer function could also be derived from the state space model. Here
is the proof:

Consider a nth order SISO linear system with the state space model as
follows:

ẋ (t) = Ax(t) + Bu(t)


y(t) = Cx(t) + Du(t)

42 TEL 306/05 Control Systems


As D matrix in most of the cases is null, we may rewrite the state space
model as:

ẋ (t) = Ax(t) + Bu(t)


y(t) = Cx(t)

By taking the Laplace transform of the state space model with zero initial
conditions:

sX(s) = AX(s) + BU(s)


Y(s) = CX(s)

Therefore, the relationship between the output, Y(s), and input, U(s), can
be derived as follows:

sX(s) − AX(s) = BU(s)


X(s) = [sI − A]−1BU(s)
Y(s) = CX(s)
Y(s) = C[sI − A]−1BU(s)

Where I is the identity matrix necessary for matrix manipulation. The


transfer function could be expressed as:

Y(s) CB
= C[sI − A]−1B =
U(s) sl − A

The conversion of the state space model to the transfer function is


important for the stability analysis since the location of the poles could
be found from the characteristic equation. Examine the transfer function
obtained from the state space model, the characteristic equation is
described by the denominator, which is [sI – A]. Hence, the stability of the
system could also be determined from the eigenvalues of the A matrix.
Eigenvalues are calculated from |I – A| = 0 where  are the eigenvalues

UNIT 5 Digital and computer-based control 43


of A matrix. The eigenvalues are equivalent to the poles of the system
transfer function for SISO systems and are roots of the denominator in
the transfer function matrix for MIMO systems.

Observability and controllability are another two important properties of


the state space control system. Observability is concerned with whether
without knowing the initial state, one can determine the state of a system
by observing the output, while controllability is concerned with whether
one can design a control input to drive the state to arbitrary values.

A system is said to be observable if and only if the system state, x(t),


can be determined from observation of the output, y(t), over a finite time
interval. To check the observability, the following formula is given:

N = [CT: ATCT: ... : (AT)n − 1BCT]

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.

The controllability can be further classified into:

State controllability:

A system is said to be state controllable if and only if an input vector,


u(t), is able to transfer the state of the system from any initial condition
to any final condition in a finite time interval. To check the controllability,
the following formula is given:

Ms = [B: AB: … : An − 1B]

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).

44 TEL 306/05 Control Systems


Output controllability:

A system is said to be output controllable if and only if an input vector,


u(t), is able to transfer the output of the system from any initial condition
to any final condition in a finite time interval. To check the controllability,
the following formula is given:

Mo = [CB: CAB: … : CAn � 1B]

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).

Identifying whether a system is state or output controllable is important


so that an appropriate controller could be designed.

Example 12

A dynamical system is described by the following state space equations:

ẋ 1(t) = −2x1(t) + x2(t)


ẋ 2(t) = x2(t) + u(t)
y(t) = x1(t)

Calculate the transfer function of the system and analyse the stability
of the system.

UNIT 5 Digital and computer-based control 45


Solution

The system can be written in matrix form as:

[ ] [ ][ ] [ ]
ẋ 1(t)
ẋ 2(t)
=
−2
0
1 x1(t)
1 x2(t)
+
0
1
u(t)

→ ẋ (t) = Ax(t) + Bu(t)

y(t) = [1 0] [ ]
x1(t)
x2(t)
→ y(t) = Cx(t)

To analyse the stability, we compute the eigenvalues, , of A. The


characteristic equation is given by:

p() = |I – A| = 0

p() = |[ ] [
 0
0 

−2 1
0 1
=0 ]|
= |[ +2
0
−1
−1 ]|
= ( + 2)( − 1) = 0

The poles of the system are found at −2 and 1. Consequently, we have


one pole on the right hand side of the complex plane. Therefore, the
system is unstable.

46 TEL 306/05 Control Systems


The transfer function of the system is as follows:

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

A dynamic system is given by the following differential equations:

ẋ 1(t) = −x1(t) − x2(t) + u(t)


ẋ 2(t) = −x2(t)
y(t) = x1(t)

1. What is the order of the system? Also, give the number of


actuators and sensors involved.

2. Determine whether the system is state and output controllable.


Explain why state and output controllability are important
properties in control system design.

3. Calculate the transfer function of the system and analyse


its stability. What is the order of the transfer function obtained?
Comment on the result obtained.

UNIT 5 Digital and computer-based control 47


State space controller design
The open loop control system could be represented in the following
general state space equations and block diagram in Figure 5.20.

ẋ (t) = Ax(t) + Bu(t)


y(t) = Cx(t)

The system is open loop because it is without a setpoint which represents


the desired output. The positive feedback loop with the A matrix is merely
a transition of state, x(t).

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.

u(t) ẋ (t) x(t) y(t)


B +
+
 C

Figure 5.20 Block diagram of an open loop state space control system

Figure 5.21 illustrates the general structure of a state feedback control


system. There is a setpoint, r(t), which defines the desired outcome. The
state, x(t), of the system is fed back to a comparator so an appropriate
input, u(t) could be produced. The state space equation for the state
feedback control system can be derived as follows:

48 TEL 306/05 Control Systems


The open loop state space equation is given as:

ẋ (t) = Ax(t) + Bu(t)

Observing Figure 5.21, the equation of a state feedback controller is:

u(t) = Kx(t) + r(t)

Substituting the state feedback controller equation into the open loop
state space equation yields:

ẋ (t) = Ax(t) + B[Kx(t) + r(t)]


ẋ (t) = Ax(t) + BKx(t) + Br(t)
ẋ (t) = [A + BK]x(t) + Br(t)

Hence, a new transition matrix, Ax, is obtained as:

Ax = [A + BK]

Therefore, the state feedback control system equations are:

ẋ (t) = Axx(t) + Br(t)


y(t) = Cx(t)

The performance of the state feedback control system could be analysed


based on the newly obtained state space equations.

UNIT 5 Digital and computer-based control 49


r(t) u(t) ẋ (t) x(t) y(t)
+
+ B +
+
 C

Figure 5.21 Block diagram of a state feedback control system

Meanwhile, if the open loop system is found output controllable, we


may design an output feedback control system. Figure 5.22 illustrates
the general structure of an output feedback control system. The only
difference as compared with the state feedback is that now the output,
y(t), is fed back to the comparator instead of the state, x(t), of the system.
The state space equation for the output feedback control system can
be derived as follows:

The open loop state space equation is given as:

ẋ (t) = Ax(t) + Bu(t)

Observing Figure 5.22, the equation of an output feedback controller is:

u(t) = Ky(t) + r(t)

Substituting the output feedback controller equation into the open loop
state space equation yields:

ẋ (t) = Ax(t) + B[Ky(t) + r(t)]


ẋ (t) = Ax(t) + BKy(t) + Br(t)

50 TEL 306/05 Control Systems


Since,

y(t) = Cx(t)
ẋ (t) = Ax(t) + BKCx(t) + Br(t)
ẋ (t) = [A + BKC]x(t) + Br(t)

Hence, a new transition matrix, Ay, is obtained as:

Ay = [A + BKC]

Therefore, the state feedback control system equations are:

ẋ (t) = Ayx(t) + Br(t)


y(t) = Cx(t)

The performance of the output feedback control system could be


analysed based on the newly obtained state space equations.

r(t) u(t) ẋ (t) x(t) y(t)


+
+ B +
+
 C

Figure 5.22 Block diagram of an output feedback control system

UNIT 5 Digital and computer-based control 51


Example 13

A magnetic ball is suspended by an electromagnet in a levitating system


as shown in Figure 5.23. The position of the ball, y(t), is controlled by the
current of the electromagnet, i(t).

Figure 5.23 A levitating system

The governing equation to levitate the ball is given by:

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.

2. Check the state and output controllability of the system.

52 TEL 306/05 Control Systems


3. The position of the ball, y(t), will be controlled so that it hangs
at a fixed position in the air. Design a state feedback of the
form u(t) = Kx(t) + r(t) to achieve the desired outcome.

4. Calculate the value of the gain K so that the closed-loop poles


of the system are set at −10 and −20 in the left-half complex
plane.

5. Determine the value of r(t) so that the final value of y(t) is 0.01m.

Solution

1. The state space representation of the system could be derived


as:

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

UNIT 5 Digital and computer-based control 53


2. The state and output controllability:

State controllability: Ms = [B: AB]

= [ 0
20
20
0 ]
Since det(Ms) ≠ 0 and full rank, the system is state controllable.
Output controllability: Mo = [CB:CAB] = [0 20]

Since Mo is full rank, the system is output controllable.

3. The size of the matrix is 2 by 2, means K should contain k1 and


k2. The state feedback controller design is given as:

u = Kx + r
= k 1x 1 + k 2x 2 + r

Adding the state feedback controller into the closed loop


system:

ẋ = (A + BK)x + Br

where the new state transition matrix, Ax is:

Ax = A + BK = [ 0
100
1
0
+ ] [ ]
0
20
[k1 k 2]

= [ 0
100 + 20k1
1
20k2 ]

54 TEL 306/05 Control Systems


The characteristic equation of the system can be obtained by:

p() = det|I − Ax| = |[ ] [



0
0


0
100 + 20k1
1
20k2 ]|
=0

= | 
−100 − 20k1 |
−1
 − 20k2
=0

= ()( − 20k2) − (−1)(−100 − 20k1) = 0


= 2 − 20k2  − 20k1 − 100 = 0

Using Routh criterion, we get

−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:

2 − 20k2  − 20k1 − 100 compared with ( + 10)( + 20)


2 − 20k2  − 20k1 − 100 = 2 + 30 + 200
hence,
−20k2 = 30 → k2 = −1.5
−20k1 − 100 = 200 → k1 = −15

Therefore, the controller function is:

u = −15x1 − 1.5x2 + r

UNIT 5 Digital and computer-based control 55


5. The value of r(t) so that the final value of y(t) is 0.01m:

The system with state feedback is obtained as:

x1 = y
ẋ 1 = x2
ẋ 2 = 100x1 + 20(−15x1 − 1.5x2 + r)
= −200x1 − 30x2 + 20r

Since y = 0.01m as given and to be maintained at this position,


hence:

0 = −200(0.01) + 20r
r = 0.1

The state feedback controller is


u(t) = −15x1(t) − 1.5x2(t) + 0.1

Activity 5.8

An open loop state space control system is described by the


following equations:

[ ][
ẋ 1(t)
ẋ 2(t)
= ][ ] [ ]
−1 −1 x1(t)
0 −1 x2(t)
1
+ u(t)
0

y(t) = [1 0] [ ]
x1(t)
x2(t)

It is required to design a state feedback controller of the form u(t)


= kx1(t) + v(t). Give the conditions on the values of k such that the
closed-loop system is stable.

56 TEL 306/05 Control Systems


Activity 5.9

Based on the same open loop control system in Activity 5.8,


design an output feedback controller of the form u(t) = ky(t) + r(t).
Give the conditions under which the closed loop system is stable.

Artificial intelligence in control systems


Artificial intelligence (AI) is referred to as the intelligence of a man-made
system. It is sometimes called the machine intelligence. The history of AI
could be back dated to 1940s and was founded as an academic discipline
in 1950s (McCarthy, 1989). It remained as academic and research oriented
for many decades and had limited practical implementation. With the
advancement in the CPU processing power and the Internet facilities,
AI turns feasible in the recent years and blooms tremendously to meet
the demands in many fields such as E-commerce, industrial control and
automation, automotive, robotics, home security, etc.

AI in control engineering focuses mainly on the intelligence exhibited by


the machine or the digital controller. Intelligent control involves solving the
complex real world problems by mimicking the intelligence of mankind.
The complexities could be due to unforeseen changes in environment,
unmeasurable disturbances, non-linearity, changing process behaviours,
varying performance criteria and component failure (Kumar & Mani,
1994). There are several AI algorithms widely adopted in the intelligent
control, namely fuzzy logic, neural-network, genetic algorithm, finite
state machine, expert system, etc. This unit will elaborate the design of
a fuzzy logic controller as an example of the intelligent control.

UNIT 5 Digital and computer-based control 57


Fuzzy logic controller
In writing ladder diagrams for a programmable logic controller (PLC), we
frequently use truth tables as guidelines for the programmes. A truth table
shows a logic circuit based on the Boolean logic output in the state of
either “TRUE” or “FALSE” in response to all of the input combinations as
shown in Figure 5.24(a), in which “1” represents TRUE and “0” represents
FALSE.

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.24(b) OR gate circuit

A truth table undoubtedly is an efficient tool for digital programming, but


the real world problems are often more than just being TRUE or FALSE.
For example, in a research on the thermal comfort of residential buildings
in Malaysia, Zain proposed that the best temperature to stay comfortably
in a building is at 28.69°C (Zain, Taib, & Baki, 2007). Based on the
proposed temperature, is it appropriate to define 29°C as uncomfortable
and 28°C as comfortable? This demonstrates the shortfall of the Boolean
logic of TRUE or FALSE, hence a fuzzy logic is introduced.

58 TEL 306/05 Control Systems


Fuzzy logic was first proposed by Zadeh in addressing the shortfall of
the Boolean logic (Zadeh, 1965). The term “fuzzy” refers to vagueness of
the logic state that cannot be expressed as the “totally TRUE” or “totally
FALSE” but rather as a combination of “degree of TRUE” and “degree
of FALSE”. A comparison of the fuzzy logic with the Boolean logic is
illustrated as follows (Mathworks, 1999):

Figure 5.25
Source: https://www.mathworks.com/help/fuzzy/foundations-of-fuzzy-logic.
html

To choose a tall person from a population, a reference line is drawn on a


wall as indicated in Figure 5.25. Any person that is taller than the reference
line will be regarded as a tall person. In this case, only one person can
be classified as “tall” using Boolean logic. The degree of membership is
either 1.0 or 0.0 as depicted in Figure 5.26. Assuming that the reference
line is 1.7 meter, a person with the height of 1.69 meter will be regarded
as “not tall” in Boolean logic. This definition is perfectly fine for a digital
world but not so appropriate in the sense of the analogue real world.

Fuzzy logic algorithm mimics the decision making process of a human


being. When we judge the height of a person by naked eyes, we will say
that the person is tall, very tall, relatively tall, etc., rather than saying the
person has a height of 1.72m. To mimic this decision making process,
the truth of any statement becomes a matter of degree in fuzzy logic.
For example, a person with the height of nearly 1.7 meter is classified

UNIT 5 Digital and computer-based control 59


as “definitely a tall” person. For a person with 1.5 meter, he/she could
be tagged as “really not very tall at all”, instead of “not tall” as shown in
Figure 5.27. The degree of membership is smoothly spread in the range
of 0.0 to 1.0 in Figure 5.27 instead of a sharp-edged as shown in Figure
5.26.

1.0 tall (  = 1.0)


sharp-edged
membership
degree of function for
membership,  TALL

0.0 not tall (  = 0.0)


height

1.69m 1.72m

Figure 5.26 Boolean logic membership


Source: Mathworks

1.0 continuous definitely a tall


membership person (  = 0.95)
degree of function for
membership,  TALL
really not very tall
at all(  = 0.30)
0.0
height
1.5m 1.7m

Figure 5.27 Fuzzy logic membership


Source: Mathworks

60 TEL 306/05 Control Systems


Judging the height of a person by naked eyes definitely will make the
height classification process very fast without the need of measuring each
person using a ruler. The accuracy of the decision, however, is depending
on the experience of the judge. The same concept is adopted in fuzzy
logic controller. The ability to handle the imprecise information (as by
naked eyes) is the major advantage of the fuzzy logic algorithm in terms
of processing speed and the simplicity of implementation. In reality, this
means that the fuzzy controller would be able to tolerate poorer signals
from lower cost sensors and inaccuracy of the process models. This
results in quick and lower cost of implementation.

Handling imprecise information promotes also linguistic labelling


of variables such as “really not very tall at all”, and contributes to
another advantage of the fuzzy logic algorithm, which is the linguistic
programmability. The linguistic programmability allows the program
reasoning (inference) to be more intuitive. Human experiences could be
therefore conveniently incorporated as part of the controller to improve
its practicability for the specific application. For example, in finding a
good candidate for a marathon runner, the following rule-base could
be established for fuzzy logic control system with some advices from a
marathon expert:

1. If the person is “Very Tall” and “Light”, then he is a “Good”


candidate.

2. If the person is “Tall” and “Heavy”, then he is a “Poor” candidate.

3. If the person is “Not Very Tall” and “Light”, then he is a


“Moderate” candidate.

With proper configuration of the fuzzy logic algorithm, it is possible to


achieve a reasonably fast and accurate performance especially to solve
complex problems. Fuzzy controllers have been developed extensively in
Japan in many applications (Noboru, 1991). To name a few, an industrial

UNIT 5 Digital and computer-based control 61


air conditioner designed by Mitsubishi uses 25 heating rules and 25
cooling rules. A temperature sensor provides input, with control outputs
fed to an inverter, a compressor valve, and a fan motor. Compared to the
previous design, the fuzzy controller heats and cools five times faster,
reduces power consumption by 24%, increases temperature stability by
a factor of two, and uses fewer sensors. Hitachi washing machines use
fuzzy controllers to automatically set the wash cycle. Based on the input
information from the load sensor, selected fabric mix, and dirt sensors,
the controller provides optimal use of power, water and detergent. In the
following example, we will demonstrate the design of a fuzzy controller
for a steam turbine operation (Wikipedia, 2011).

Example of fuzzy logic controller


In most of the applications, fuzzy logic controllers are implemented in a
digital system. Similar to the digital control system as we studied earlier,
a fuzzy control system for the steam turbine could be represented in the
block diagram as depicted in Figure 5.28. It is remarked that the only
difference as in comparison with the classical digital control system is
that the digital controller is now replaced with a fuzzy logic controller.

Although many research works have been conducted to solidify


the theoretical support of the fuzzy algorithm, most of the practical
applications are still designed based on the empirical method for the
specific problem. In general, the procedures to design a fuzzy controller
can be listed as follows:

1. Identify the I/O parameters of the process.

2. Collect experimental data of the process for a given I/O range


of operation.

3. Establish the fuzzy sets for the I/O parameters as illustrated in


Figure 5.27.

62 TEL 306/05 Control Systems


4. Develop the rule-base and decide the inference method.

5. Determine the defuzzification method for the output parameter.

6. Test, fine tune and validate the fuzzy control system.

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

Figure 5.28 Block diagram of fuzzy steam turbine control system

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:

1. Define the setpoint of the temperature as the nominal


temperature (assuming is 500°C).

2. Calculate the temperature error by subtracting the measured


temperature with the nominal temperature as tabulated in
second row of Table 5.3.

UNIT 5 Digital and computer-based control 63


3. Choose a suitable membership functions (MF) to represent
the temperature errors for each classification. Triangular MFs
and trapezoidal MFs are used in this example.

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.

Input parameter Output parameters


Throttle opening ± 90% Temperature 100°C to 900°C
Pressure 100 bar to 200 bar
Table 5.2 Range of I/O parameters

Temperature (°C) 100 300 500 700 900


Temperature error (°C) -400 -200 0 +200 +400
MFs labelling COLD COOL NOMINAL WARM HOT

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

64 TEL 306/05 Control Systems


With the information of the I/O fuzzy sets, we can now construct the
rule-base for the controller. For a two inputs and one output controller,
with five MF labels for each input fuzzy set, the controller supposing will
have 25 = 32 rules to define the possible combinations. Processing all
the 32 rules during the operation could be very heavy for the processor.
Many rules could be meaningless for the operation. The advantage of the
fuzzy logic algorithm is the ability to incorporate the expert knowledge/
experience into the system. Hence, we may seek advices from the expert
of the steam turbine to eliminate those meaningless rules. With the
advices, assuming that only four rules are important for the operation,
the rule-base of the system could be defined as follows:

Rule 1: If temperature IS nominal AND pressure IS weak THEN


throttle ISP2
Rule 2: If temperature IS cool AND pressure IS low THEN throttle
ISP2
Rule 3: If temperature IS cool AND pressure IS ok THEN throttle
ISZ
Rule 4: If temperature IS warm AND pressure IS strong THEN
throttle ISN2

With the rule-base ready, an appropriate inference mechanism could be


decided to specify the relationship between the mappings of two input
parameters. The controller accepts the inputs and maps them into their
membership functions and truth values. These mappings are then fed into
the rules as shown in Figure 5.30. If the rule specifies an AND relationship
between the two input parameters, the MIN of the two is used as the
combined truth value. If an OR is specified, then the MAX is used.

UNIT 5 Digital and computer-based control 65


Figure 5.30 Fuzzy inference mechanisms

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.

66 TEL 306/05 Control Systems


Figure 5.31 Rules evaluation

Output: Throttle setting


Centroid defuzzification
using Max-Min inference

+25%

Figure 5.32 Output defuzzification

UNIT 5 Digital and computer-based control 67


Summary

Artificial Intelligence (AI) gains its practicability with the advanced


CPU processing power and the Internet facilities. Adopting AI
in control system aims to solve real world problems with the
complexities such as non-linearity, inaccuracy of the process
model, unmeasured disturbances, etc.

In contrast to the Boolean logic with “absolute TRUE” or “absolute


FALSE”, a fuzzy logic defines a state as a combination of “degree
of TRUE” and “degree of FALSE”. This flexibility offers appealing
behaviours for the fuzzy logic controller to handle imprecise
information and linguistic programmability. As the fuzzy logic
controller is designed based on empirical method, fine tuning of
parameters is expected to improve the performance. This section
demonstrated the design of a fuzzy logic controller for a steam
turbine process.

Suggested answers to activities

Feedback

Activity 5.6

The differential equation of the system can be written as:

d 2y(t) k 1
+ y(t) = u(t)
dt2 M M

68 TEL 306/05 Control Systems


k
Substitute 2 = into equation, we get:
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

Substitute y(t) = x1(t) into the equation, we get:

1
ẋ 2(t) = �wx1(t) + u(t)
wM

Since y(t) = x1(t)

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

UNIT 5 Digital and computer-based control 69


 ẋ 1(t) = Ax(t) + Bu(t)

y(t) = [1 0] [ ]
x1(t)
x2(t)
 y(t) = Cx(t)

Activity 5.7

1. The order of the system is 2 (number of state variables in the


system).

Number of actuators = Number of inputs = 1 (inputs can


influence the dynamics of the system, that is why they are
seen as actuators)

Number of sensors = Number of outputs = 1 (outputs are the


state variables that we are actually measuring, that is why
they are seen as sensors)

2. The differential equations can be arranged in the state space


format as follows:

[ ][
ẋ 1(t)
ẋ 2(t)
=
�1
0 ][ ] [ ]
�1 x1(t)
�1 x2(t)
+
1
0
u(t)

y(t) = [1 0] [ ]
x1(t)
x2(t)

70 TEL 306/05 Control Systems


Hence,

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

since the determinant of Ms is 0 and the rank of matrix is not


full, the system is not state controllable.

To check the output controllability, the formula is given by:

Mo = [CB CAB]

CB = [1 0] []
1
0
=1

CB = [1 0] [ ]
�1
0
= �1

Mo = [1 �1]

The rank of M o is full. Therefore the system is output


controllable. From the analysis, we can only design an output
feedback control system as the system is output controllable
but not state controllable.

UNIT 5 Digital and computer-based control 71


3. The conversion of state space model to transfer function is
given by:

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

The system is stable as shown on the pole location. The order of


the transfer function is 1. This means that there must have been
some pole-zero cancellation. Also we can see that the second
equation does not depend on the first variable (x2 is not coupled
with x1). This also explains why the system is not state controllable.

72 TEL 306/05 Control Systems


Activity 5.8

State feedback controller design is given as:

u = k x1 + r
Adding the state feedback controller into the closed loop system:

ẋ = (A + BK)x + Br

where

K = [k 0]

The new state transition matrix, Ax, is therefore:

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:

p() = det|I � Ax| = |[ ] [



0
0


�1 + k
0
�1
�1 ]|
=0

= | +1�k
0
1
|
+ 1
=0

= ( + 1 � k)( + 1) = 0
= 2 + (2 � k) � k + 1 = 0

The poles of the closed loop system are:

p1 = k � 1
p2 = �1

UNIT 5 Digital and computer-based control 73


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

Activity 5.9

Output feedback controller design is given as:

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]

The new state transition matrix, Ay, is therefore:

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:

p() = det|I � Ax| = |[ ] [



0
0


�1 + k
0
�1
�1 ]|
=0

= | +1�k
0
1
+1
=0|
= ( + 1 � k)( + 1) = 0
= 2 + (2 � k) � k + 1 = 0

The poles of the closed loop system are:

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

Alternatively, we may use Routh’s criterion to find the condition


for a stable system, where:

s2 1 1�k
s1 2 � k
s0 1 � k

The critical condition for a stable system is to ensure:

1�k>0

Hence,
k<1

UNIT 5 Digital and computer-based control 75


Summary of Unit 5

Summary

1. This unit introduces the digital control, the state space control
and the fuzzy logic control as the advanced control methods.

2. Implementation of a digital controller requires ADC and DAC


for the conversion of signals between the analogue real-world
with the digital computer world. The control algorithm
is written in the form of a program and loaded into the
digital controller. A clock is used to provide sampling period
for synchronising the timing of the conversion. The accuracy
of the conversion is determined by the sampling rate and the
resolution of the converters.

3. Difference equation offers a suitable format for programming


a digital controller, but analysis work of the digital control
system requires pulse transfer function. Conversion of
difference equation into the pulse transfer function could be
done by using z-transform.

4. State space control system is classified as a modern control


system which can handle Multi-Input-Multi-Output (MIMO)
process. A state space model constitutes a set of first order
differential equations which are represented in the matrix
format. The unit demonstrated an example of state space
modelling for a two output and one input boiling process.

5. Analytical works on stability, controllability and observability


are important to determine the feasibility of the state space
controller. An example of levitating system is discussed to
illustrate the design of a state space controller.

76 TEL 306/05 Control Systems


6. Artificial Intelligence (AI) is an interesting topic and has
gained much attention in the control community. Most of the
AI control systems are designed based on empirical method.
With the appropriate choice of algorithms and configurations,
the AI control system would be able to perform reasonably
well within limited resources such as insufficient information
for a complicated process and poor quality of signals. The
unit elaborated the design of a fuzzy logic controller for a
steam turbine control system.

UNIT 5 Digital and computer-based control 77


Course Summary

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:

1. In Unit 1, you have learnt the ways to derive analytical


models of various processes and presenting the systems in
block diagrams and signal flow graphs.

2. The transient and steady state behaviours of the systems are


then analysed in Unit 2. The unit introduced also the concept
of disturbances to improve the practicability of the analysis.

3. The stability of the system is then examined in Unit 3 by


using different methods, namely the root locus, the Routh-
Hurwitz stability criterion and the Bode plot. Estimating
the stability of the system is crucial for a successful design
of a controller.

4. In Unit 4, three types of analogue controllers are introduced.


The unit started with the design of a simplest discrete-state
controller, to PID controllers and the phase compensators.
The purpose of the controllers is the main concern of this
unit, which is to improve the performance of the system.

78 TEL 306/05 Control Systems


5. The real world, however, is always much more complicated
than what we learnt. Unit 5 introduced the concept of state
space controllers to deal with MIMO systems and Fuzzy logic
controllers to handle non-linearity in the systems due to
imprecise sensory feedback information. The unit elaborated
also on the realisation of digital control systems.

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.

UNIT 5 Digital and computer-based control 79


References
Copeland, J. (2006). Colossus: The Secrets of Bletchley Park’s
Codebreaking Computers. Oxford: Oxford University Press, 101 – 115.

Crevier, D. (1993). AI: The Tumultuous Search for Artificial Intelligence.


New York, NY: Basic Books.

Kumar, V. R. & Mani, N. (1994). The application of artificial intelligence


techniques for intelligent control of dynamical physical systems.
International Journal of Adaptive Control and Signal Processing, 8(4),
379 – 392.

Mathworks. (1999). Foundations of fuzzy logic. Retrieved from https://


www.mathworks.com/help/fuzzy/foundations-of-fuzzy-logic.html

McCarthy, J. (1989). Artificial Intelligence, Logic and Formalizing


Common Sense. Richmond Thomason: Philosophical Logic and Artificial
Intelligence.

Noboru, W. (1991). Fuzzy control and neural networks: Applications


for consumer products. International Joint Conference on Artificial
Intelligence, 97 – 105.

Richard, C. D. & Robert, H. B. (2011). Modern control systems (12th ed.).


Boston: Pearson.

Russell, S. J. & Norvig, P. (2009). Artificial Intelligence: A Modern Approach


(3rd ed.). Upper Saddle River, New Jersey: Prentice Hall.

Wikipedia. (2011). Fuzzy control system. Retrieved from https://


en.wikipedia.org/wiki/Fuzzy_control_system

80 TEL 306/05 Control Systems


Zadeh, L. A. (1965). Fuzzy sets. Information and Control, 8(3), 338 – 353.

Zain, Z., Taib, M., & Baki, S. (2007). Hot and humid climate: prospect
for thermal comfort in residential building. Desalination, 209, 261 – 268.

UNIT 5 Digital and computer-based control 81


COURSE TEAM
Course Team Coordinator: Dr. Magdalene Goh Wan Ching
Content Writer: Dr. Robin Tan Leong Ping
Instructional Designer: Ms. Jeanne Chow
Academic Member: Dr. Mohd Hezri Bin Marzaki

COURSE COORDINATOR
Dr. Magdalene Goh Wan Ching

EXTERNAL COURSE ASSESSOR


Associate Professor Dr. Yeap Kim Ho, Universiti Tunku Abdul Rahman

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.

© 2019 Wawasan Open University

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.

Wawasan Open University [DU013(P)]


Wholly owned by Wawasan Open University Sdn. Bhd. (700364-W)
54, Jalan Sultan Ahmad Shah, 10050 Penang.
Tel: (604) 2180333 Fax: (604) 2279214
Email: [email protected]
Website: www.wou.edu.my

You might also like