Computer Systems For Automation and Cont
Computer Systems For Automation and Cont
Automation and
Control
The 1st Edition of the book has been published in 1992 in English by Prentice-Hall
International and in 1993 in German by Hanser Verlag, München together with
Prentice-Hall. This manuscript is the basis for the 2nd Edition in English.
Abbreviations .............................................................................................................. xi
Preface ...................................................................................................................... xv
1 Introduction ......................................................................................................... 1
1.1 Computers in Process Control .................................................................... 1
1.2 A Bit of History ............................................................................................ 4
1.3 Systems ...................................................................................................... 6
1.4 Some Typical Applications of Computer Control Systems ......................... 8
1.5 A Guide for the Reader............................................................................. 10
iii
iv Computer Systems for Automation and Control
xi
xii Computer Systems for Automation and Control
„Computer Systems for Automation and Control“ deals with the principal aspects
of computer applications in system control, with particular emphasis on industrial and
process automation. The description is not limited to the hardware and software
components of process control computers but covers additional topics such as
systems modeling, signal processing, digital control and data communication. The
accent is put on the integration of the different components, as well as of the
computer system in its operating environment, including the interface with the human
user.
The book is intended for readers with different backgrounds. Some of them may
have process-related experience and know quite a lot about traditional control
methods, and still feel insecure about the use of digital technology. Other readers
may be computer experts, entirely at home with software but less so with process
control. A third group of readers could be project managers who need a broad
picture of the subject without getting too involved with specific details. Therefore the
topics have been selected and presented in such a way as to integrate the reader’s
knowledge with computer-oriented or application-oriented information, depending on
his or her particular needs.
Automation is a very broad concept and as such can mean everything and
nothing. Many of the textbooks in this area promise a lot in their title, while in fact
they focus only on a much more restricted field, usually either mathematical control
theory or practical programming issues. Yet the Nyquist stability criterion is of no use
in programming binary control sequences, as little as Boolean algebra in the
dimensioning of a feedback control circuit. In the following, automation will be
presented as an integrated concept by treating the major issues of each related field
of knowledge singularly as well as in relation to the others. Each chapter is self-
contained to allow an easy selection of the desired topics and presents the key
theoretical issues together with practical details. Particular emphasis is given to
standard components and methods accepted by both the industry and
standardization organizations, as technical solutions oriented to generally accepted
standards stand the best chances of success in the future. Moreover, standards
support modularity - one of the most important factors in the systems approach.
Process control can be realized in many different ways and with different
technologies, from specifically-built integrated circuits to system boards and to large
turnkey systems. This book focuses on design from board level upwards, because in
practice system integration at different levels is the most common way to work. The
Authors do not claim to teach how to design perfect systems, but rather how to look
for acceptable and reasonable solutions using readily available components.
Research on real-time computing has been carried out at the Department of
Automatic Control of the Lund Institute of Technology since the end of the 1960s.
Based on this experience, from the early 1980s a new course in computer
applications in control could be offered. The purpose of the course is to combine
theoretical and practical issues and present a broad view of computer and control
engineering. Thanks to the traditionally close ties between industry and universities
in Sweden, the course has profited largely from industrial field experience. Prime
movers in the development of the course were Hilding Elmqvist, Leif Andersson,
Sven-Erik Mattsson, Johan Wieslander and Gustaf Olsson.
xv
xvi Computer Systems for Automation and Control
The course was not only appreciated by the students but also by professional
engineers, one of which was the Co-Author Gianguido Piani. This was his first
contact with the Department in Lund, and after some years spent in different
European countries he returned, this time as guest lecturer for the course. In the
spring of 1992 this course was offered in the frame of a Swedish-Baltic cooperation
at the Polytechnical Institute in Kaunas (Lithuania), the first engineering course held
there in English.
The Authors hope that automation technology will increasingly help in the
practical solution of many of today’s most pressing problems such as resource
conservation, environmental control and improving the living standards for the
populations of the world’s poorest countries.
Acknowledgements
A number of people have contributed in different ways to the preparation of this
book. They include Gunnar Lindstedt, Ulf Jeppsson, Bo Peterson, Sven-Göran
Bergh, Anders Peltomaa and Dr. Jaroslav Valis at the Department of Industrial
Automation, Lund Institute of Technology. Leif Andersson, with his broad experience
in real-time programming has provided several valuable hints.
The first draft of the manuscript, written in a combination of „Swenglish“ and
„Italiese“ (i.e. an English strongly influenced by Swedish and Italian), was read by
Professor Otto J.M. Smith at the University of California in Berkeley, by Professor
John F. Andrews at Rice University in Houston, by Dr. Robert „Bob“ Hill, City of
Houston, by Walt Schuk in Cincinnati and by Professor Don Wiberg at the University
of California in Los Angeles. Their comments and suggestions have decisively
contributed to the preparation and improvement of the text.
Further „feedback“ was provided by Dag Brück, Ola Dahl, Prof. Viktor Denk,
Ingvar Ekdahl, Richard Franz, John Lawrence, Dr. Krister Mårtensson, Mike
Neumann, Klas Nilsson, Prof. Odd Pettersen, Tomas Schöntal, Bengt Simonsson
and Mike Thompson.
Several of the proposed ideas were iterated in endless discussions with many
friends, among them Helena Rosenlind, Stefano Castelli and Cornelia Verbeek.
Many companies have also supported this work by providing information and
materials and by providing the opportunity to discuss current trends in technology
with their engineers. Finally, the Authors wish to thank many others who in different
ways helped us in this initiative and in particular Klas Nilsson for the computer
simulations to prepare the graphics contained in the text and Lena Somogyi at the
Department, who gave lot of practical support.
Contact via Internet
http://iea.lth.se
At the same site can be found current information about all courses offered by
the Institute and the related didactical materials. In particular, for the course that
uses this book as main reference current and earlier test examples are available, as
well as all materials related to the practical laboratory exercises, computer simulation
examples, and more. Also copy of all technical and research reports produced at the
Institute are now available on-line at the same address. Please notice that part of the
materials is in English and part in Swedish.
The Authors would be happy to receive feedback from the readers about this
book. They can be contacted at the following addresses:
xvii
About the Authors
Gianguido Piani (1958) is currently with ABB Energy Information Systems, where
he deals with business development of power network control systems in Russia. His
main fields of interests are computer applications for energy management and the
integration of automatic control equipment in work environments. He was earlier
visiting lecturer at the Lund Institute of Technology.
xviii
1 Introduction
The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain or
in the petals of a flower. To think otherwise is to demean the Buddha, which is to
demean oneself.
[Robert M. Pirsig, Zen and the Art of Motorcycle Maintenance]
1
The term „process“ can be used to describe transformation of matter and energy as well as a
program in execution. In general there should be no problem in understanding from the context what
process is referred to. Where there might be doubt, we will use the term „physical process“ or
„technical process“ to indicate a transformation of matter/energy and program module or task for the
other meaning of the term.
2 Chapter 1: Introduction
Energy input Added heat or cooling Added heat or cooling Fuel to power the
engines
Energy output Heat from the reaction Heat radiation The aircraft movement
environment
disturbances
material material
input physical/ output
technical process
energy energy
input output
information information
input output
information information
input computer output
environment
disturbances
material material
input physical/ output
technical process
energy energy
input output
information information
input output
output input
computer
The situation is different for process computers. Here the computer does not
have full control of the execution flow but instead must follow the pace at which
things happen in the outside world. The computer must be able to react sufficiently
fast to external events. Computer control systems must continuously process the
input data, very often without the possibility of changing the amount and rate at
which they are received. At the same time they might have to perform other
functions, for instance, information exchange with human operators, data
presentation on displays and reaction to particular signals. This mode of data
processing is so important that it has received its own name: real-time.
meant that the process necessarily had to be very complex, as in the case of large
chemical plants. Another key issue was - and remains - the structuring of the control
problem as prerequisite for the application of computers.
Economy was not the only problem. Hardware reliability was low because of the
electronic tubes. Software was written in Assembly language and not a single bit of
the scarce memory available was left unused. Still these pioneering efforts were
supported by many computer manufacturers who saw a great potential market for
these new applications.
Computer control is an area where an unusually constructive interaction between
theory and practice has taken place. As described later in the book, computer control
has special features of its own. Conventional mathematical methods based on
continuous time analysis cannot be used directly for the design of control loops that
have to be implemented in computers. For this reason, computer control indicated
early on the necessity for a special theory of sampled control, at the same time
providing the foundation for its development. A fortunate coincidence was the
development of the US space program in the 1960s and especially the Apollo
project, that acted as catalyst for the theoretical and practical aspects of computer
control.
An important step was taken in 1962, when ICI (Imperial Chemical Industries) in
England introduced the concept of direct digital control (DDC). Basically, the idea
was to replace several conventional analog control loops with a central computer. A
large and expensive control panel with hundreds of analog controllers and recorders
could be replaced by some computer terminals. The computer simulated numerically
the analog controllers in a way that was not much different from today’s solutions.
The basic idea of DDC is still applied in many of today’s industrial computer
systems. A reason for its success is that the control problem had already been
defined and structured to allow the use of analog techniques. There were therefore
less risks than in pioneering implementations where the objectives of computer
control were not fully understood and adequately defined. The obvious drawback
with DDC was that system reliability critically depended on the central computer.
However, for an additional investment a second computer could be installed to take
over, should the first fail. The computer of 1962, a Ferranti-Argus, was considerably
better than the 1959 generation. Addition and multiplication times had already
improved by a factor of 10, and also reliability had increased an order of magnitude.
The advent of the transistor in the 1960s led to notable progress for computer
applications. The introduction of the transistor-based minicomputer in the mid 1960s
brought the price for computing power to an order of magnitude less than for
mainframes, even though the price tag of a typical minicomputer was still higher than
US $ 100,000. Anyway, computer control began to be considered for smaller and
less complex applications. Minicomputers could be installed close to the process and
therefore became popular in small automated production and testing units. The three
factors: better computer hardware, simpler processes and a more developed control
theory, acted in combination to accelerate the success of computer control.
Every decade seems to bring a new computer technology with considerable
advantages in performance and price over the preceding one. Powerful card-
mounted microprocessors have been available since the mid 1970s and today even
the most simple process control units can be economically realized with digital
techniques. Current personal computers are more powerful than the minicomputers
of the 1960s and 1970s, typical performance includes a central processing unit with
16 or 32 bit word length, some Megabytes of primary memory, Gigabytes of
6 Chapter 1: Introduction
secondary storage, and all at costs already much lower than for the earlier
computers.
Computer applications that are largely popular in industrial control are the open
buses. Here the accent is put not on specific components, but on the interface (the
bus) between operational modules. The hardware modules in a bus system are
selected to fit the intended application without leaving any resources unused.
On the other hand, computing power is not everything. The efficiency of a
system does not depend only on its control computers. The on-board computer of
the first lunar spaceship, Apollo 11 in 1969 had 64 kbyte of primary memory and of
course no disk unit. Today, nobody would give a second look at such a machine, but
the lesson to learn by considering what that computer helped accomplish, it is that
attention has to be given to the goals of the technical process on its whole rather
than just to the size of computer hardware. High computing power should therefore
not be a sales argument in itself; computer power should instead be considered in
relation to the dynamics and complexity of the process under control. A slow
computer can very well control a slow (e.g. a chemical or biological) process.
In a digital control system it is comparatively easy to try new control strategies
since a digital computer may completely change the way it works when its programs
are modified, without having to redesign and recable the whole system. Thus digital
control systems offer not just a new way to implement established principles for
control, but an entirely new technique that has greater flexibility and opens new
possibilities. Process knowledge, system dynamics and control theory are necessary
ingredients for a computer control project to be successful, but they represent only
half of the picture. The structuring of the entire solution in terms of hardware units,
software modules and communication remains a major challenge.
The one-sided concentration of our attention on computer technology can also
distract our attention from other basic problems. Yet also the following should be
considered. After about thirty years of computer usage, we now have enough
experience to ask ourselves about the real advantages they brought in industry and
administration. In the 1950s and 1960s, before computers became so widespread,
one income-producing person could support a whole family including paying housing
mortgages. In the typical family of today, at least two people must work full time to
keep up with a satisfying, yet more demanding, lifestyle. What a couple of decades
ago was painted to become a kind of Golden Age thanks to computers and
automation turns out now to be less golden than expected if new problems, from
unemployment to the environmental situation, are taken into the picture. A similar
case might be today’s overrating of Internet and „network companies“. Without
disregarding anything of their merits and advantages, they still do not provide a
reliable and effective tool to solve real-life problems. The intense focus on computer
use, for example with fancy pictures and sounds, may distract attention from where
the real problems are.
1.3 Systems
Processes and their control systems consist of different parts interacting in
complex ways. The components are connected together so that matter, energy and
information are exchanged in order to obtain a certain result. It is not easy to give a
general definition of a „system“, but the following important aspects can be identified:
1.3: Systems 7
• The idea of a system is a mental aid to interpret and understand the function of
any complex structure where different components interact with each other.
• There are many ways to divide a system in order to describe it. Any of its
components can be further divided into smaller parts, or the divisions may take
a different form. It is important to always select the right level of detail.
• It is usually not necessary to know the internal workings of an element to
foresee the global functions of the system it belongs to. It is sufficient to know
its input/output relations (the black box principle).
• The goal of a system is to reach a result quantitatively or qualitatively higher
than the sum of the results of the single components taken alone. The system
adds „something more“, to justify its function (synergy principle). This
„something more“ is not the result of a single system component, but rather of
the way the single parts interact.
Systems may be of many different types, e.g. electrical, chemical, mechanical or
biological. A computer is a system built with the basic functional components: central
processing unit (CPU), memory and peripheral devices. Taken alone, these units do
not do anything. Put together with the operating software, the result is a computer
that can accomplish many things. The human body is an extremely complex system
built with organs that serve different functions. The body is able to fulfill its basic
goal, to sustain its own life, because each organ functions together with the others.
Different mathematical methods can be used to describe systems and their
elements. Although strongly emphasized in most textbooks, such methods can be
applied only where all the elements of a system as well as its external environment
can be described in form of quantitative relations. We will see in Chapter 3 that
mathematical descriptions are not the only ways to describe systems. When they can
be used, they obviously have the advantage of the correctness of their formalism.
An important aspect of systems knowledge is system dynamics, i.e. the
prediction of future system behavior and the selection of appropriate control actions
in order to influence that behavior. System dynamics is particularly tricky because of
the many interactions among the different system components that have to be taken
into consideration. It happens often that the evolution of a system seems to lead in
the „wrong“ direction or at least against „intuitive“ expectations. Every car driver
knows instinctively what system dynamics is. The driver plans to increase or reduce
the pressure on the gas pedal at the sight of a hill, so that the car speed remains
constant. The car behavior is normally known and predictable, but might turn to be
unpredictable if not altogether uncontrollable if the road is wet or icy. Similar
problems are encountered every day in the control of technical processes.
In large applications, one of the major problems is how to structure the system.
Many people must cooperate, some technical components must be gradually
exchanged and new facilities added. In the approach to complex systems it is
important to have both deep and broad views.
Problems cannot usually be solved at one level only, instead they must be put in
the right perspective and focused on at the right level. This does not mean having to
know all the details of any given situation, but rather that one should be able to
investigate specific details whenever this is necessary. A solution found at the wrong
level is often not a solution at all; it could even make things worse. It does not help to
check a program for bugs for a missed printout, if the printer is switched off. Every
engineer may tell some own anecdotes in this respect.
8 Chapter 1: Introduction
analog digital
signals data
A/D and D/A
converters
sensors and network
actuators interface
digital
signals
communication
network or bus
system
The physical process is monitored with sensors, i.e. devices that convert
physical variables such as temperature, pressure or position into electrical variables
that can be measured directly, such as resistance, current or potential difference.
Examples of sensors are thermistors (temperature sensors), end position switches
and ultrasound microphone pickups. Conversely, a process can be influenced with
help of actuators. Actuators transform electrical signals in physical actions, principally
movement (displacement and rotation) that can be used to other purposes, e.g. to
open a valve. Examples of actuators are servo motors, hydraulic valves and
pneumatic positioners.
A digital control system works only on information in numerical (digital) form, so
that the collected electric variables must be transformed via analog to digital (A/D)
converters. The inverse operation is less problematic because the computer can
control directly actuators like motors and valves through electric signals.
Information from different source points distributed in space is brought to the
central unit through communication channels. The central control unit interprets all
incoming data from the physical process, takes decisions on the base of program
instructions, sends control signals, exchanges data with the human operators and
accepts their commands.
Not unexpectedly, the manufacturing industry provides good ground for many
applications of digital computers. Numerically controlled (NC) machines produce
high-precision mechanical parts following well determined sequences of operations.
NC machines are built for different types of applications; their operations depend on
the stored software, which can be changed at comparatively little time and cost. The
flexibility and sophistication of industrial robots is mainly owed to computer control.
When a machine alone cannot process a part, flexible manufacturing systems (FMS)
can take over in a work cell or a section of a plant. In FMS the operations of each
machine, the mutual interactions and the transport of components from one machine
to the other are all controlled by computers.
The process industry, including chemical, metallurgical and the paper and pulp
industry, offers several challenges. The different unit processes are often
interconnected and large material flows continuously circulate between them. In
addition, the processes mostly operate around the clock, so reliability is a key factor.
The number of measurement variables is large, timescales range all the way from
seconds to days and the physical size of the plants is considerable. The capital and
material costs are usually extremely high, so that even small changes in operating
conditions and quality have an impact on the economy and competitiveness of a
plant. The quality of a computer control system is therefore of decisive importance.
Electrical power systems range among the most complex systems ever built.
They include the primary power sources, such as hydroelectric plants, steam boilers
and nuclear reactors, as well as large transmission and distribution networks. To
describe the interconnected power system of a medium size country, thousands of
equations for generators, turbines, power lines, loads, etc. are needed. Electrical
power cannot be economically stored in large quantities and has to be produced in
the same moment as it is consumed. The control of power generation and
transmission must be extremely fast and accurate, in order to identify power load
changes and match them in time by changing the generation levels or the exchanges
with other producers. Power utilities need to keep track of working hours for the
industry and in some cases even of the beginning and end of popular television
programs.
10 Chapter 1: Introduction
Book Outline
The single chapters present each different parts or aspects of a computer
control system. The Chapters 2 through 6 are dedicated to theoretical aspects in
modeling and control (though with many references to practical issues and existing
equipment), while Chapters 7 through 11 deal with modern hardware equipment and
software methodology in the construction of process control systems.
In Chapter 2 the concepts of real-time programming and computer process
control are defined. The idea of concurrent processes is illustrated through a simple
example. Different process control problems are then classified with respect to their
character and to their complexity. The identified problem areas act as pointers to the
later chapters of the book.
In Chapter 3 different system descriptions and concepts are illustrated, with
emphasis on the description of dynamic systems, first with continuous and then with
time-discrete models. Further we present some approaches for the description of
physical processes that deliver insufficient information.
Measurement, data acquisition and signal transmission are discussed in Chapter
4. Basic operating principles for sensors and actuators are described together with
the issues related to electrical noise, disturbances and signal conditioning.
Chapter 5 deals with signal processing - principally filtering - to limit the effect of
noise and disturbances; both analog and digital filtering are treated. The sampling
theorem about the conversion of analog signals to digital and vice versa represents
the main subject of this chapter. In addition some methods for basic signal testing
are described.
Chapter 6 describes the computer implementation of regulators. Different control
structures are described together with the related digital controller implementations in
order to give a taste of their possibilities as well as of their limitations.
Chapter 7 deals with sequencing control and its implementation in
programmable logical controllers (PLCs), i.e. simple, self-contained computers that
12 Chapter 1: Introduction
Further Reading
The quote at the beginning of this chapter is taken from one of the classic books
of the 1970s [Pirsig 1974]. Many of its comments about technology and how to deal
with it are still worth considering. Yet the author warns: „Don’t use this book as a
reference guide for the oriental doctrine Zen. It is not very factual on motorcycles,
either.“
The masterwork of the 1980s about complex structures, information,
communication and artificial intelligence is most probably [Hofstadter 1979].
Countless connections between music, art, old languages, biology and computers
develop naturally in the narration and constantly lead the reader to look at things
under new perspectives.
Numerous good articles have been published in Scientific American about
process control and its technological implications, e.g. [Spector 1984] and [Ginzberg
1982]. For an highly qualitative description of the possibilities offered by software,
check [Kay 1977, 1984].
2 Process Computers’ Application Issues
Aim: To familiarize the reader with the basic issues and requirements for
computer systems in process automation and control
Overview
This chapter is an introduction to the typical problems encountered in process
automation and how these can be tackled with computer control systems. Each
problem or part of a problem will show the necessity for the respective solution and
act as introduction to the material that is presented in later chapters. To exemplify
the problems encountered in practice and the way they are approached, two case
studies are described in detail, the electrical drive system and the control of
biological wastewater treatment plants. These case studies will be referred to
throughout the book as they provide a wealth of practical examples to illustrate the
theory. These particular case studies were chosen because of their different
timescales and because they embody many of the problems that are experienced in
other control applications.
The problem of real-time operation from the point of view of computer
programming is examined in Section 2.1. Section 2.2 illustrates typical process
control applications and in Section 2.3 are described the main problem areas in
computer control, with reference to their further treatment in the text. The case
studies (the electrical drive system and the control of biological wastewater treatment
plants) are presented in Section 2.4.
The other main peculiarity in computer process control is that the execution
order of a program cannot be determined beforehand. External signals may interrupt
and change the program sequence, so that this will be different for every new
execution run. In addition, the resources of real-time computer systems must be
14 Chapter 2: Process Computers’ Application Issues
used effectively and the timing constraints must be respected. To achieve these
results special programming methods are required. To make things more
complicated, the lack of a predictable execution order makes testing much more
difficult in real-time systems than in conventional computer systems.
One important property of the real world is the parallel operation. All things
around us, ourselves, and physical processes of virtually any kind can be considered
as consisting of numerous „sub-processes“ that operate in parallel. This property has
the important consequence that a computer connected to such a process for the
purpose of interacting with it, or control it, must take into account - and in some
situations behave - according to this parallel nature. The natural consequence of this
parallel behavior is that the computer itself must be able to conduct parallel
operations. This is different from the operation of a general purpose computer, in
which a sequential mode of operation is natural.
heat control
temperature
molten plastic
pulse train
pulse process
counter computer
pressure
cylinder
move
move right
left
command
start
measure temperature
calculate heat power need
set variable heat_time
heater contact on
C=0
C=C+1
wait
yes 1 second
C = heat time ?
no
no
C = 10 ?
yes
heater contact
off
Figure 2.3: Flow diagram for temperature control in the plastic extruder
Each of the two different tasks can be solved straightforwardly with sequential
code. However, it is no longer trivial to combine the two tasks into one single
program. Waiting loops cannot be used, since computer resources do not allow long
time delays, and one activity cannot wait for the other. In principle it is possible to
design a code without waiting loops. The program would however have to jump all
the time between the two tasks and check what to do next. The code would soon
become cumbersome and difficult to analyze. The forced serial disposition of
instruction blocks which must actually be executed in parallel introduces strong ties
between functions which should rather remain separated from each other.
2.1: Real-time Process Control 17
start
no
end position
reached?
yes
stop piston
move piston to the left
n = 0 [number of pulses]
no new incoming
pulse ?
yes
n=n+1
n = pulse ref
no
yes
stop piston
Figure 2.4: Flow diagram for piston movement control in the plastic extruder
start
measure temperature
calculate heat power need
set variable heat_time
heater contact on
wait command
wait_time (heat_time) sec
clock interrupt (it resumes
program execution)
heater contact
off
wait command
wait_time (10-heat_time) sec
clock interrupt (it resumes
program execution)
Figure 2.5: Use of time-driven interrupts for temperature control in the plastic extruder
In a similar way, the piston sequencing control waits for two interrupts, one from
the right end position sensor and the other that signals the arrival of a new pulse that
indicates movement (Figure 2.6). The interrupts are related to instructions of the type
„wait_interrupt(x)“, where x indicates the channel where the interrupt signal is
2.1: Real-time Process Control 19
start
stop piston
start piston movement
to the left
n=0
n=n+1
no
n = pulse ref ?
yes
stop piston
Figure 2.6: Use of interrupts for piston movement control in the plastic extruder
The interrupt feature gives the possibility to switch the execution from one
program task to another as a consequence of external events; this is all that is
needed to solve the control problem in an elegant and straightforward way. If each
20 Chapter 2: Process Computers’ Application Issues
program module is independent of the others, new features can be added to the
system without endangering the existing structure. The problems related to
multiprocessing and the methods for real-time programming are treated in Chapter
10.
component #1 in component #2 in
coolant out
C
D E
product out
T P
mixer
hot fluid cold fluid
input input
Many computer control applications are based on logical statements like those
described here. The control computer input and output data are binary, which means
that sensors indicate two state or limit values such as valve open or closed, indicator
activated or deactivated, button pushed or released, etc. The controls given by the
computer have a similar form, like for example motor start/stop, heater on/off, etc.
When the control task consists only of binary decisions, the computations are
particularly simple. There are computers, called programmable logical controllers
(PLC), that are specifically built to carry out this type of tasks. These computers are
treated more in detail in Chapter 7.
temperature
(reference value) control signal
controller tank
to heater
element
temperature
(actual value)
control computer
reference control
value signal
reference value controller technical
calculation process
measurement value
control computer
A system that follows a particular reference signal (setpoint value) so fast and so
precisely as possible is called servomechanism, or briefly servo. In servo systems
the setpoint value can be either calculated or be available in tabulated form. For
example in robot control a trajectory describes the movement of a mechanical arm
as functions of time. The trajectory is computed as a curve in space (called path or
contour) and stored as a table together with the desired times in the computer
memory. In this way a sequence of reference values for the arm joint position
controllers is available all the time. In many cases the trajectory must be calculated
on-line while the robot arm is moving. This generates a heavy computing load
because of the complex geometry of a robot arm.
When a new reference position is defined, it is first compared with the current
position. The computer can then send correction signals to the motors that control
the mechanical joints. The inverse operation, to find the arm position from the angles
of the joints, may also have to be performed. Both computations are resource-
intensive and time critical.
process computer
human
operator user interface
reference value
calculation
controllers
technical
process
reaction to
alarm states
sequencing control
binary signals
alarm indications
Yet, because of their simplicity (at least compared with non-linear descriptions)
linear models provide very useful approximations of physical systems. Linear and
non-linear models will be discussed in Chapter 3.
An important kind of non-linearity is the saturation of magnetic materials in
electrical machines. The magnetization of the armature is not even a single-valued
function, but depends on the „history“ of the motor, i.e. how the actual operating
state was reached (hysteresis effect). Bringing an electric motor from zero to half-
speed is not the same as reducing from full to half speed. The design of a control
system must take also such factors into consideration.
Non-linearities play a role not only in the physical processes, but also in the
interface to the computer, i.e. in sensors and actuators. An on/off valve is a typical
case, its state can be only fully open or fully closed. A computer might indicate on the
base of sophisticated mathematics that the optimal input flow to a process is 46 per
cent or 107 per cent of the full scale value, but still the valve may only be able to
operate at either 0 per cent or 100 per cent of its flow range. In addition, fast and
changing control signals to such a valve might lead to wearout and should therefore
be avoided.
Varying environmental conditions appear for instance in aircraft dynamics. An
aircraft behaves differently at low altitudes than at high altitudes because of the
different air pressures. The response to a wing flap movement is stronger at low
altitudes where air is denser. Consequently an autopilot has to take the altitude -
together with dozens of other factors - into consideration to control the aircraft under
varying conditions.
A power boiler is an example of a process with varying dynamical behavior. Due
to inherent non-linearities it responds quite differently at low and high power levels.
This means that the controller parameter settings must depend on the power level at
which the boiler is working. The operating parameters can be stored in a table as
function of power, in a method known as gain-scheduling control.
26 Chapter 2: Process Computers’ Application Issues
Time delays or dead times are a big problem in control. They result in the
controller taking decisions on the basis of old data, up to the point that it might
generate the wrong commands. Time delays are present in all processes where
some values cannot be measured directly. For example, to control the concentration
of a fluid, the concentration value is measured downstream along a pipe and fed
back to a control valve. Due to the delay for the flow to reach the measuring point,
the information is late and this may cause instability, i.e. difficulty in reaching and
maintaining the desired value. Not only long pipes create time delays. Many types of
sensors may need a long time before they deliver the exact measurement value,
leading to delayed control actions which may be cause for instability.
The consequence of signal transmission delays can be illustrated by a
suggestive experiment, shown in some science museums. You speak into a
microphone and listen to your own voice in a headphone. If the signal from the
microphone is delayed for more than a few fractions of a second, you get confused
very soon and cannot keep talking. This demonstrates the instability caused by time
delays. A similar effect is sometimes encountered when talking on the phone via
satellite circuits. The time delays may lead to difficulties for the talkers to coordinate
their conversation.
A controller in a system with time delays has to „remember“ old control actions,
i.e. it must store the value of control output values and use it in later calculations.
There are controllers that can compensate for time delays. They contain in some
form a model of the process under control and in some way estimate the current
value for variables that cannot be measured directly without delay. Controllers of this
type are discussed in Chapter 6.
Internal couplings and interactions add a lot of complexity to a process, even
when this would be basically simple. An example in this sense is the temperature
control of the rooms in a building. If a window is opened in one room, the
temperature will change not only locally, but to some extent also in the neighboring
rooms. Internal system couplings where each one input influences several outputs
can be illustrated in block diagram form (Figure 2.12).
disturbances
technical process
the requirements on responsiveness and reliability are extremely high. There is much
more than one could imagine behind the availability of electric power at any outlet,
with constant voltage and frequency and without interruptions all year around!
Effective control of large systems such as the electric power network can only be
realized with the help of computers.
Measurement Filtering 3, 5
disturbances Type of processing
Table 2.1: Some of the problem areas in computer process control. Aspects of the technical
process to be controlled that are reflected in the type of solution.
28 Chapter 2: Process Computers’ Application Issues
System Complexity
The complexity of the technical process is reflected in the complexity of the
process computer. The number of sensors and actuators is an indication for the
number of necessary input and output ports and means in general higher processing
power, internal and external memory capacity, etc. The process hardware - sensors,
actuators and bus systems - are treated in Chapter 4 and 8.
The couplings between the internal process variables and the input and output
data of the technical process determine the complexity of the controller software.
Real-time programs are much more difficult to test than conventional sequential
programs, so the code has to be so well structured that most errors can be identified
2.3: General Problem Areas of Computer Control Systems 29
Localization of Information
Complex monitoring and control systems are built out of several computers
connected together; in many cases these computers build hierarchical structures.
The communication between computers is therefore a central issue in modern
process control systems. In order to use the available capacities rationally, it is
necessary to determine the type and amount of information that has to be
exchanged between computers. Not all computers must know everything that is
going in the technical process. Communication reliability is very important, and
solutions must be devised so that the data always reaches the right destination and
is not distorted or lost.
Communication also raises the question of standardization. Obviously cables
and contacts have to fit, signal levels must be compatible and the computer software
must understand the same meaning in the exchanged signals and messages.
Communication issues are dealt with in Chapter 9.
Ease of Utilization
A process computer or process control system may work unattended but still it
does not work for itself, there is always some communication to be exchanged with
the human user. The process operator must receive information from the computer
and be able to input commands.
Graphical interfaces on computer terminals become more and more
sophisticated. Modern displays offer a fantastic potential to show complicated
information for the user. Colors, shapes, pictures, curves and other graphical
representations can be used to inform the operator about the current state of the
process. However, all these types of presentations require computing power, and
when the operator communication competes with other tasks, the human operator
may have to wait for the information. On the other hand, not all information can be
kept waiting, as alarms and other important messages must be given priority.
Therefore the software has to be selective and choose what information is
appropriate for the operator and compatible with the current requirements and
computing capacity. This subject is further dealt with in Chapter 11.
per cent of its traffic. The reason was an undetected error, or „bug“, in a very
complicated computer program.
We will discuss some realistic aspects of how to influence system reliability, in
part by defining hardware structures that are relatively insensitive to component
failures and in part by structuring the real-time code so that at least predictable errors
are avoided from the beginning.
suspended micro-
organisms and substrate
(activated sludge)
influent clarified water
wastewater output
sedimentation
aerator unit
solid / liquid
separation
concentrated
airflow input sludge
To keep the aerator environment rich in oxygen, air must be pumped into the
aerator. The air flow rate is of primary importance for the overall process efficiency. If
the dissolved oxygen concentration is below a certain minimum (in the range of 1-2
mg/l), the microorganisms will not be able to metabolize („eat up“) the pollutants at
the normal rate and the process is slowed down. On the other hand, pumping air
costs energy. The choice of the dissolved oxygen concentration determine the type
of organisms that will dominate and consequently how the pollutants will be removed
from the wastewater.
Wastewater can also contain toxic substances that may either inhibit the growth
of some microorganisms, or even kill them. From the point of view of process control
this means that depending on the changed operating conditions new types of control
actions must be selected. Diagnostic or estimation methods must be used to identify
the current state of the process.
Simple models to describe the dynamics of biological systems are described in
Chapter 3. The measurement problems are discussed in Chapter 4 and control
schemes are treated in Chapter 6.
2.5 Summary
The programming of process computers operating under real-time conditions
cannot be carried out with conventional programming methods because of particular
requirements like:
• a real-time system does not only consist of one but of several programs, each
specialized for a particular task
• the execution order of real-time programs can not be determined in advance
• the execution order can be changed by external signals (interrupts).
A computer may be used for both sequencing and feedback control. In many
systems these tasks are integrated. The capacity of a computer control system
2.5: Summary 33
depends on many factors such as the number and type of the input and output
signals of the technical process, the number and type of sensors and actuators,
internal process couplings, process dynamics and controller complexity. A process
computer system must continuously ensure the correct operation of the technical
process; the coordination and synchronization of several, dedicated simple tasks is
therefore especially important.
Data exchange among different computers is a central issue in process control
systems. Data communication encompasses both the connection between the
computer and the physical process, the computer-internal data exchange, the
connection between different process computers and the interface to the human
user.
Further Reading
The example of the plastic extruder in Section 2.1 has been inspired by [Hassel /
Tuvstedt 1978].
Software reliability is the theme of the article [Littlewood / Strigini 1992]. The
failure in the US telephone system in January 1990 was widely reported in the press,
see for example [Newsweek 1990].
Journals
The list of specialized journals that address the no-man’s land between theory
and practice in automation and control is not as long as it should be.
Control Engineering and the ISA Journal (published by the Instrument Society of
America) are dedicated to new applications of automatic control with attention to
practical, on-field issues. Interesting articles on industrial automation are also found
in Chemical Engineering and in IEEE Spectrum. Important scientific publications -
but somewhat too abstract and theoretical for common practical applications - are
Automatica, the IEEE Transactions on Systems, Man and Cybernetics, the IEEE
Transactions on Industry Applications, the IEEE Transactions on Robotics and
Automation and the IEEE Transactions on Power Systems.
Two good German journals are „at“ („Automatisierungstechnik“) and „atp“
(„Automatisierungstechnische Praxis“), published by Oldenbourg Verlag in Munich
(Germany).
3 System Description and Modeling
Overview
A system description - or model - contains condensed knowledge of a
physical/technical process. A model of the process is often needed for its control, to
enable the control computer produce appropriate commands to the process on the
basis of the collected measurement information. The model indicates how the
technical system will react to a particular control action or to an external disturbance
and, conversely, what control action is needed to reach a particular system state.
Yet, models are not always needed: for simple control tasks like opening a valve to
fill a tank or automatically switch on a lamp when it is dark, a model would be
superfluous. Other control tasks are much more complex and an elaborate
quantitative model of the process is therefore needed for control. For example, in
robot technology an explicit model of the movement dynamics and of the path to
follow is indispensable for control.
The basic aspects of dynamic models are described in Section 3.1. There are
two main ways to develop models, either starting from basic physical principles or by
using measurement data. Some examples of the application of these principles are
presented in Section 3.2 and in Section 3.3 it is shown how general descriptions of
continuous dynamic systems can be formulated by following these examples; in this
section are also introduced the state-space and the input/output descriptions. The
time discretization of systems is of fundamental interest for computer control, and the
basic related principles are described in Section 3.4.
If the collected measurement data is used in context with system knowledge, it is
possible to calculate process variables that could otherwise not be measured. The
procedure of reconstruction or estimation of state quantities is the consequence of a
basic system property called observability. Observability indicates whether the
available set of measurements is adequate to give information about the system. A
related property is system controllability. This property gives an indication on whether
the system parameters that can be influenced by actuators are sufficient to control
the process as desired. Observability and controllability are treated in Section 3.5.
Some uncertainties are always connected to process models; in some cases
they can be described, which simplifies their treatment. In Section 3.6 uncertainty
factors are described both in statistical terms and with linguistic expressions, as for
example in fuzzy systems. The general principles for the analysis of sequencing
networks, that are widely used in process control, are described in Section 3.7.
We will refer to dynamic or sequencing models throughout the whole book.
Particularly important are models in measurement technology (Chapter 4), signal
processing (Chapter 5), the definition of control algorithms (Chapter 6) and
sequencing control (Chapter 7).
A word of warning must also be mentioned about the use - and abuse - of the
term „system“. It is one of those general words that mean everything or nothing,
depending on the context. This chapter is mainly devoted to methods for analysis
and description of physical systems, i.e. the processes we want to control. Chapter
34
3.1: Models for Control 35
control tasks have already been solved at the lower levels. The problem at the cell
timescale is whether a machine is correctly supplied with material, if the robot is free
to pick up a new component, etc. At an even higher level the entire production is
planned, i.e. what parts to produce and with what specific characteristics. Such
decisions may take days or weeks, and in comparison the dynamics of a single
machine is considered to be instantaneous.
Another example of different timescales within the same technical system is
found in biological wastewater treatment. Compressed air is injected in the aeration
tank to keep aerobic microorganisms (that need oxygen) alive; this operation takes a
few minutes. Concentration changes due to disturbances in the input wastewater
flow appear only after a few hours, while for a change in the metabolism of the
microorganisms are necessary some days or even weeks. In a study of weekly
changes in the metabolism, the hourly phenomena can be considered to be
instantaneous. On the other hand, in order to control the air supply it is necessary to
measure the dissolved oxygen concentration on a minute-to-minute basis, while in
this timescale microorganism compositions and concentrations are considered to
remain unchanged.
The relevant timescale of a dynamic model depends also on the user, where
also an automatic controller can be considered as a kind of „user“. A plant operator
could check the state of the technical process and make control decisions in a
timescale of minutes to hours. A process engineer or logistics supervisor may be
interested only in daily production rates or process changes, and would thus need
still another timescale for the process description. The plant manager, finally, may
want to look at completely different aspects of the plant operation, such as variations
of plant productivity or seasonal demand changes. Each perspective and action has
its own timescale.
equations. This methodology will be presented in Section 3.2 with help of some
simple examples. The other possibility to build a dynamical model is from
experimental data. The technical process is disturbed (excited) on purpose with
different types of input signals, and the input and output data series are analyzed in
a procedure known as parameter identification. If the analysis is made online as
the experiment progresses, the procedure is called recursive estimation.
Most often modeling practice is a combination of physical modeling and
parameter identification. With more insight into the fundamental properties of the
process it becomes easier to obtain an accurate dynamic description. Still, even the
most elaborate models based on physical insight have to be verified by
experimentation.
Many processes and systems are spatially distributed. For example, the
concentration of a liquid in a tank may not be homogeneous but be distributed in
space and change with time. The physical balance relations to describe such
systems must then be expressed in form of partial differential equations. In process
control applications such systems are mostly approximated by finite differences in
space, so that the system can be described by ordinary differential equations.
m F
J
Tω
1 torque
d 2ω 2
0.8
0.6
d1ω
0.4
d0
0.2
0
0 0.2 0.4 0.6 0.8 1
ω
Figure 3.3: The torque of a motor as function of the angular speed
In summary, the total load torque can be expressed as the sum of the named
load torque and of an external load TL0 :
TL = d 0 ( sgn(ω )) + d 1 ⋅ ω + d 2 ⋅ ω 2 + TL 0
C
v v
in out
(
v o (t ) = v i 1 − e − t T )
In Figure 3.5 the transient responses of the RC circuit are shown for different
values of the time constant T = RC . The response becomes slower for larger
values of T .
voltage
1
T=0.1
0.8 0.2
0.6 0.5
0.4 T=1.0
0.2
0
0 0.2 0.4 0.6 0.8 1
time
Figure 3.5: Capacitor voltage of the RC circuit for different values of T = RC for a input
voltage step
where Vi is the peak amplitude. The output capacitor voltage also becomes
sinusoidal a short time after the input signal has been applied.
The output signal has the same frequency as the input signal, but a different
amplitude and phase:
v o (t ) = Vo ⋅ sin(ωt − φ )
This simple capacitor circuit illustrates the two major methods for the description
of a linear system, the time-domain analysis and frequency-domain analysis. The
time-domain analysis illustrates the time behavior of the system, e.g. its response to
a particular input signal - the step - in course of time. The frequency-domain analysis
focuses on the system behavior under excitation by different frequencies.
When a magnetic field varies in course of time, an electric field is produced. This
is stated by Faraday’s law, also known as the induction law, which is one of the
44 Chapter 3: System Description and Modeling
Maxwell’s equations. According to the induction law, the induced voltage e at the
terminals of an ideal coil (i.e. only with windings and no resistance) is equal to
dΨ
− =e
dt
where Ψ is the flux linkage through the coil windings (the flux linkage is the
magnetic flux Φ intercepted by the coil multiplied by the number of windings N ).
The flux linkage Ψ for a current I flowing in the coil and for an inductance L is
Ψ = L ⋅ I . In other words, in a coil or inductance energy is stored in a magnetic field.
The differential equations for the capacitance and inductance represent the
basis for the description of electric and magnetic circuits. Other relations of algebraic
nature can be derived from these basic equations. The relation between the flux
density B [ V ⋅ s ⋅ m -2 , Tesla] and the magnetic field intensity H [ A ⋅ m -1] is a property
of the material:
B = µ⋅H
where µ is the magnetic permeability. In a ferromagnetic material the total
permeability is not constant and for large values of H the value of the flux Φ , that is
proportional to B , will saturate. The relation between the magnetic flux and the
current generating the field intensity is shown in Figure 3.6.
In the description of magnetic circuits hysteresis phenomenona must often also
be taken into consideration. Because of the hysteresis effect the flux density is not a
direct function of the input current, but depends also on the previous magnetization
history.
Φ positive
saturation
iΦ
+
u linear
area i
- Φ
negative
saturation
N
(a) (b)
Figure 3.6: (a) Simple magnetic circuit; (b) typical magnetization curve without hysteresis
stator
speed ω
N pole S pole
torque Tm
The windings are arranged in such a way that the rotor field is always
orthogonal to the stator field. It is known that whenever two magnetic fields are at
an angle between each other, the result is a torque that forces them to become
parallel. This is the operating principle of the compass needle: if it is not parallel to
the earth’s magnetic field lines, it turns until it becomes parallel. While the rotor
turns in order to bring its magnetic field parallel to the stator field, the rotor
windings are switched mechanically by the commutator, changing in this way the
orientation of the rotor field. In this way, the result is that the rotor field orientation
is always kept fixed in space and orthogonal to the stator field. The torque is
therefore kept constant for all rotor angles.
The torque generated by the motor is proportional to the stator magnetic flux
density and to the rotor current i . Since in this example the magnetic flux density
is considered to be constant, the motor torque Tm is
Tm = km ⋅ i
where km is a constant that depends on the motor. By now considering also
the load torque TL , the mechanical part can be described as follows (see Section
3.2.1):
d (J ⋅ ω )
= k m ⋅ i − TL
dt
where J is the total (motor and load) moment of inertia. As a result of the
rotation of the rotor windings through the stator magnetic field, an induced voltage
e is formed. With constant stator field, this voltage is proportional to the rotational
speed ω :
e = kg ⋅ ω
where k g is a constant. If the units are consistent and losses are neglected,
then k g = km = k . According to Lenz’s law it follows that the magnetic flux
46 Chapter 3: System Description and Modeling
generated by the induced voltage e will be oriented against the flux generated by
the original current flowing in the conductor.
The electrical circuit of the rotor is represented by its resistance R and
inductance L . Assuming that L is constant, the induction law defines the voltage
across the circuit as:
dΨ d ( L ⋅ i ) di
= = L⋅ = v − R ⋅i − k ⋅ω
dt dt dt
where i is the rotor current and v the applied voltage. The motor dynamics is
illustrated in Figure 3.8. The applied voltage results in a rotor current that
generates a motor torque. The torque drives the mechanical rotor that begins to
turn at a certain angular speed. The induced voltage acts like a feedback from the
mechanical rotor to the electrical circuit of the rotor.
mechanical load
v rotor
voltage load angular
torque -T velocity ω
L
i
∫ ∫
1 1
+ + km +
L J
motor
torque T
-Ri m
-v -R
i
rotor
current
-k
induced g angular
voltage velocity ω
q out
ci in
q out, c
(
c(t ) = ci ⋅ 1 − e −t T )
It is intuitively clear that the concentration will change more slowly if the inflow
rate is small compared to the volume V (this corresponds to a large value of T ).
The behavior of the component mass balance has therefore the same dynamic
properties as a low-pass filter.
In principle, the analysis of the tank system could be carried out in frequency
domain, similarly as for the electric low-pass filter. In such way the influent
concentration would have to be varied (modulated) like a sinusoidal function and
the frequency response of the effluent concentration be then observed. This is
however not very practical in chemical processes, because the time constants may
be of the order of hours. Such an experiment would then last for many days.
dc
dt
( )
= α ⋅u cs − c − R
sedimentation
aerator unit
airflow input
The mass balances of substrate and microorganisms in the aerator are written
in the form:
accumulated mass = influent mass - effluent mass + growth - consumption
Microorganisms with the concentration c xr are recycled from the
sedimentation unit. The growth rate of the microorganisms is modeled by µ· c x ,
where the specific growth rate µ [ h -1 ] depends on the substrate concentration
s
µ = µ ⋅
K+s
where K is a constant parameter. The growth is quite limited for small values
of s and approaches a maximum value µ for high concentrations of substrate.
The microorganism concentration decreases due to cell decay and is proportional
to the organism concentration, b ⋅ c x . The microorganism mass balance equation
has the following aspect:
50 Chapter 3: System Description and Modeling
dc x
V⋅ = Qr c xr − (Q + Qr ) ⋅ c x + V ⋅ (µc x − bc x )
dt
The substrate enters the aerator via the influent flow and the sludge recycle
stream. Since the substrate is assumed to be dissolved, its concentration is the
same in both aerator and sedimentation tank. The substrate in the aerator is
consumed because of the microorganism metabolism. The corresponding
substrate utilization rate is µ ⋅ C x Y , where the variable Y is called the yield factor.
The equation for substrate mass balance can then be written in the form
ds µ
V⋅ = Q ⋅ si + Qr ⋅ s − (Q + Qr ) ⋅ s − V ⋅ ⋅ c x
dt Y
The system dynamics is here obviously non-linear. The specific growth rate µ
depends on the substrate concentration and the flow variables are multiplied by
the concentration values.
q1
(R )
1
q2
T (R )
2
uq (W)
Figure 3.12: A system in thermal equilibrium. Ta is the ambient temperature and T is the
tank temperature.
Technical processes are in most cases very complex and non-linear. The
feedback of processes variables began to be carried out in a standard fashion during
the 1940s; a controller based on the proportional-integral-derivative (PID) concept
was developed. The frequency response method proved to be powerful when it was
used for the analysis of linearized versions of process dynamics.
During the 1950s several researchers returned to system descriptions by
ordinary differential equations as a basis for process control. The American and
Russian space programs stimulated this development, since ordinary differential
equations represent a natural form to describe the dynamics of a spacecraft. The
development was also supported by the introduction of the digital computers, as
calculations that until then were not practical and time-consuming could now be
performed straightforwardly. The digital computer required also a new mathematics.
The engineers did not work directly with the frequency form or the characteristic
equations, but with the differential equations in state form. New fundamental issues
could then be addressed, such as controllability, observability and state feedback.
Variational calculus was extended to handle the optimization of flight trajectories.
In chemical and mechanical engineering it is natural to derive differential
equations models from the physical properties of a system. This approach is realistic
also in advanced control applications, even if PID controllers are still used in many
technical realizations. Therefore the use of both differential equations and of
frequency descriptions is common. Descriptions in the frequency domain are still
common in electrical and electronic engineering and quite natural for many
applications. Complex systems are instead preferably described in terms of ordinary
differential equations.
evolution of the system. It is not necessary to know the previous history, i.e. how the
actual state was reached. In other words, the state is the minimum amount of
information about the system that is needed to predict its future behavior.
The state x can be described as a column vector with the state variables as its
components
x = ( x1 x 2 2 x n )
T
It is seldom possible to measure all the state variables directly. They are internal
variables that cannot always be observed via sensors. For this reason the state-
space description is also called internal description. The output values, i.e. the
measurements, are denoted by y 1, y 2 ,…, y p , and are described by a vector y :
(
y = y1 y 2 2 y p )T
In general the number of sensors p connected to the technical process is less
than the number of state variables n . It is therefore not trivial to calculate x from y .
We consider here systems that are influenced by input signals. There are two
kinds of inputs to technical systems: signals that can be controlled either manually or
automatically via some kind of technical equipment and signals that it is not possible
to manipulate. The first signals are called control signals or control variables u 1 ,
u 2 ,…, u r and are denoted by the vector u :
u = (u 1 u 2 2 u r )
T
Other input signals can influence the system, but cannot be controlled. Their
values represent environmental influence on a system like e.g. load changes or
disturbances that are caused by temperature, radiation, undesired magnetic
couplings, etc. These signals are collectively indicated with the vector v :
v = (v 1 v 2 2 v m )
T
reference or output or
control measurement
variables variables
(internal)
u x state variables y
x = (z v ) ; u = F ; y = z = (1 0) x
T
dxn
= an1 x1 + + ann xn + bn1u1 + + bnr ur
dt
where the parameters a ij and b ij are constants. Since the equations are linear
differential equations with constant coefficients they have many attractive properties.
It is for example always possible to find an analytical solution of x(t ) given arbitrary
control signals u(t ) . The initial conditions are defined by n constants:
x(0) = ( x10 2 x n0 )
T
x 20
There is a linear relationship between the internal state variables x and the
measurements y . Sometimes there is also a direct coupling from the control
variables u to the output variables y :
y 1 = c11x 1 + + c1n x n + d 11u 1 + + d 1r u r
y p = c p1x 1 + + c pn x n + d p1u 1 + + d pr u r
or in vector-matrix notation:
y = C⋅ x + D ⋅ u (3.2)
where
c11 c12 2 c1n d 11 2 d 1r
C= D=
c d
p1 c p 2 2 c pn p1 2 d pr
If there is only one output variable, then C consists of a single row. Usually there
is no direct coupling from the input to the output variables, so that the matrix D is
zero.
A linear system has many attractive properties (compare for example with some
of the properties of non-linear systems mentioned in Section 2.3.7). The most
important property of linear systems is the superposition principle. This means for
example that if for a specific change of the input signal amplitude ∆u the output
signal change is ∆y , then for an input amplitude change that is twice as large
( 2 ⋅ ∆u ), the change in the output will be 2 ⋅ ∆y .
In linear systems the contributions from different input signals are additive, i.e. if
the input signal u 1 brings the output signal y 1 and u 2 leads to y 2 , then the total
output for an input u 1 + u 2 will be y 1 + y 2 . As a consequence the influence of the
control input signal and of a disturbance signal can be analyzed separately.
It is quite attractive to look for linearized descriptions of dynamic systems. It must
however be asked whether this is a realistic approach, since most technical
processes are basically non-linear. If the non-linearities are „smooth“, i.e. do not
present any stepwise changes, then under certain conditions a non-linear system
can be considered as a linear one. A linear description is then valid for small
deviations around an equilibrium point.
Many process variables in industrial systems must be kept around some steady
state value; the purpose of control systems is to bring the process variables to their
reference values. As long as the deviations from the reference are small, the linear
description is adequate. If, however, the deviations are too large, then more
elaborate models may be needed since the non-linear terms will be most significant.
related data can often be collected experimentally, so that a useful system model is
obtained directly. For this reason the frequency response method is often used for
the description of complex systems such as feedback amplifiers and many
electromechanical devices and systems.
If only the relation between the input and output signals of a system is described,
some of the internal variables and their couplings remain hidden; the system
representation becomes more compact and has fewer parameters than the state-
space description. Since only the input and output variables are included in the
model, it is called external description, as opposed to the internal state-space
representation. Many controllers, like for example the PID controller described in
Chapter 6, are tuned on the basis of a input/output model of the technical process.
In the internal description of Equations (3.1, 3.2) the state variables x can be
eliminated and the system dynamics takes the following form:
dny d n − 1y d nu d n − 1u
+ a1 + + an y = b0 + b1 + + bn u
dt n dt n − 1 dt n dt n − 1
where the coefficients a i and b i can be derived from the A , B , C and D
matrices. In systems with many input and output variables there is an input/output
relation between every input/output variable pair (in the following we shall restrict our
discussions to systems with only one input u and one output y ). From the n th order
differential equation can be obtained the Laplace transform:
( s n + a1 ⋅ s n − 1 + ) ( )
+ a n ⋅ Y ( s ) = b 0 ⋅ s n + b1 ⋅ s n − 1 + + b n ⋅ U( s )
where s is the Laplace variable and Y ( s ) and U( s ) are the Laplace transforms
of y (t ) and u (t ) respectively. The advantage of this method is that the complex
variables s that represent differentiation operators can in this way be manipulated by
algebraic methods. Here it is assumed that the initial condition of all the states is
zero.
The input/output relationship of a linear system can be expressed by its transfer
function G( s ) . This function is defined as the ratio between the Laplace transforms
of the output and the input signals of the system:
Y(s) b s n + b1s n − 1 + + b n
G( s ) = = 0 (3.3)
U( s ) s n + a1s n − 1 + + a n
The transfer function can also be calculated directly from the internal state-
space description (Equations 3.1, 3.2). The following relation holds:
Y(s) −1
G( s ) = = C ⋅ ( sI − A ) ⋅B+ D (3.4)
U( s )
where I is an identity matrix of order n . The derivation is quite straightforward
and is described in most control textbooks. In a system with only one input and one
output the C matrix consists of single row and the B matrix of a single column, while
A is a n ⋅ n matrix. Usually D (which then is a 1⋅ 1 „matrix“) is zero. In this case G
becomes a scalar. For several inputs and outputs G( s ) is a matrix with elements
G ij ( s ) , indicating the transfer function from each input u i to each output y j .
3.3: Continuous Time Dynamic Systems 57
where Z ( s ) and F( s ) are the Laplace transforms of the position z and of the
force F respectively. The state equations were derived in Example 3.11. The
transfer function can also be calculated directly from the state equations (see also
Equation 3.4):
−1
−1 s −1 0 1
G ( s ) = C ⋅ ( sI − A ) ⋅ B = (1 0) =
0 s 1 m ms 2
Since the input/output description contains fewer coefficients than the internal
state-space description, it is always possible to derive an input/output description
from the internal one; the opposite does however not hold uniquely. This is quite
natural, since the state variables x can be expressed in different coordinate systems
and units, while y and u depend on the physical nature of the process and are
therefore defined from the very beginning.
The denominator of the transfer function is also called characteristic equation.
The roots of the characteristic equation are called poles and are of great
importance. The values of the poles are identical with the eigenvalues of the A
matrix. The roots of the numerator of the transfer function are called zeros. By using
the notation z1,…, z m for the zeros and p1,…, p n for the poles (with n > m ) the
transfer function (Equation 3.3) can be written in the form:
K ⋅ ( s − z1) ( s − z m ) α1 αn
G( s ) = = + +
( s − p1)( s − p n ) s − p1 s − pn
where α i are real or complex constants. This means that the output y can be
written as a sum of exponential functions called modes:
y (t ) = c1 ⋅ e − p1 ⋅t + + c n ⋅ e − p n ⋅t + [terms that depend on u (t ) ]
58 Chapter 3: System Description and Modeling
then the pole pair corresponds to a term of the transient response in the
following form:
c k ⋅ e −σt ⋅ σin(ωt )
The poles (or the eigenvalues of the A matrix) of a linear system completely
determine whether the system is stable or not. If the real parts of the poles are
negative, then the transient answer for a limited signal u is also limited, i.e. the
system is stable.
The zeros determine the size of the coefficients of the exponential functions in
the transient answer, but otherwise do not influence the stability of the system. If a
pole is located close to a zero, then the corresponding mode is small. If the zero
coincides with the pole, the corresponding mode is cancelled.
input
signal u
Figure 3.15: Changes of the dissolved oxygen concentration in an aeration tank for a
stepwise change of the airflow (input variable) at a time t = 0 . Different
values are shown for the input variable: (a) ±2%, ±4% and ±8%; (b) ±20%.
The systems described above have „smooth“ non-linearities, i.e. the systems still
behave linearly for small inputs. Many systems need more accurate descriptions
than linear differential equations for large deviations from some equilibrium point, so
that non-linear terms have to be added. It is the purpose of the model that ultimately
warrants whether a linear description is adequate or not.
dx n
= f n ( x1, x 2 , 2, x n , u 1, 2, u r )
dt
where n states and r inputs have been defined. Also this type of system can be
written in a compact vector form (the state vector x and the control vector u are
defined in Section 3.3.2):
dx
= f( x, u) (3.5)
dt
The function f is a vector where each component is a function, i.e.
f = (f1 f2 2 fn )
T
When the system is in steady state, then the derivatives of f are zero. Assuming
that the equilibrium state is x with the corresponding constant control signal u , the
condition at steady state is
f ( x, u ) = 0 (3.6)
y 1 = g 1( x 1, x 2 , 2, x n , u 1, 2, u r )
y p = g p ( x 1, x 2 , 2, x n , u 1, 2, u r )
(
g = g1 g 2 2 g p )T
Usually there is no analytical solution to non-linear systems. The solutions must
be obtained numerically, which in most cases is adequate. It is important to find the
state equations of a system in order to derive a model from them. Once a model is
given in differential equation form there are always methods to find the solution.
dx (t ) x (t + h ) − x (t )
≈
dt h
and the solution is
x (t + h ) ≈ x (t ) − ha ⋅ x (t ) = (1 − ha) ⋅ x (t )
In Figure 3.16 it is shown what happens for different choices of the step size
h . For larger values of h such that 1 − ha > 1, i.e. h > 2 a , the solution x will
oscillate with alternating sign and with an increasing amplitude. The problem of
oscillations due to a too long integration step is called numerical instability. This
instability has nothing to do with the system itself and is only caused by a too raw
approximation in the computation of the solution.
1 1
h=0
0.8
h=0 0.8
h=0.05 h=0.1
0.6 0.6
h=0.4
0.4 0.4
0.2 0.2
0 0
0 0.5 1 1.5 2 0 0.5 1 1.5 2
time time
(a) (b)
Figure 3.16: Numerical solutions of a simple first order difference equation for different
values of the step size h : (a) h = 0.05 , (b) h = 0.1 and 0.4 .
There are many integration methods with their merits and drawbacks; particularly
widespread are the Runge-Kutta methods. Most of the integration techniques have a
variable step length that is automatically adjusted to satisfy a predefined error
criterion.
Today are available several commercial simulation packages for the solution of
non-linear differential equations. By „solution“ it is intended here that the transient
response of the state variables can be obtained by numerical integration of the
differential equations, given appropriate initial conditions and with the input signals
specified as functions of time. With such programs the user has to formulate the
differential equations and then some conditions about the numerical integration
method, the step size, the presentation form of the output variables (printout or
graphic plot), etc. A good simulation program must at least be able to:
• Check out the equations to examine if they are consistent
• Sort the equations into an appropriate sequence for iterative solution
• Integrate the equations
• Display the results in the desired form (tables or graphical diagrams)
3.3: Continuous Time Dynamic Systems 63
i.e. that the system includes a sample-and-hold circuit. The discrete time system can
then be written in the matrix form:
x[(k + 1)h ] = Φ ⋅ x (kh ) + Γ ⋅ u(kh ) (3.9)
where Φ is an n ⋅ n matrix and Γ an n ⋅ r matrix. The exact relations between
the A and B matrices and the Φ and Γ matrices are
Φ = e Ah = I + hA +
( hA ) 2 + 2
2!
Ah 2
Γ = Ih + + 2 ⋅ B
2!
The conversion between the matrices in time-continuous and in time-discrete
form can be carried out with standard software. The finite difference approximations
Φ ≈ I + h ⋅ A and Γ ≈ h ⋅ B approach the exact solution for small values of the
sampling interval h . The measurement data are however collected only
intermittently, for this reason in the time-discrete case Equation (3.2) is valid only at
the sampling instances:
y( kh ) = C ⋅ x( kh ) + D ⋅ u( kh ) (3.10)
With a digital computer the solution of the discrete system is possible in a simple
way. After the formulation of the difference equations the computer generates the
solution of successive values of x step by step.
With help of the shift operator, difference equations can be changed in algebraic
equations that are easier to manipulate and solve; the principle is similar as the use
of Laplace transformations with the complex variable s in order to simplify the
manipulation of differential equations.
The backward shift operator q −1 shifts the time function one sampling interval
backwards:
q −1 ⋅ z ( kh ) = z[ ( k - 1) h ] (3.12)
In general, the shift operator q can operate several times on a discrete time
function:
q n ⋅ z ( kh ) = q ⋅ q ⋅ ⋅ q ⋅ z ( kh ) = z[ ( k + n ) h ]
66 Chapter 3: System Description and Modeling
The shift operator q can also be applied on a vector x( kh ) , which simply means
that it acts on each vector component.
If a process description is available in time-discrete internal state-space form
(Equations 3.9 and 3.10), by eliminating the state vector x and rearranging
algebraically the terms, the relation between process input and output can be
expressed as:
[ ] [ ]
y ( k + n )h + a1 ⋅ y ( k + n − 1)h + ⋅ + an ⋅ y ( kh ) = b0 ⋅ u [ ( k + n ) h ]++ bn ⋅ u ( kh )
We have seen in Chapter 3 how the input/output relation of a linear system can
be described by the transfer function G( s ) , defined as the ratio of the Laplace
transforms of the output vs. the input signals of the system. An analogous
description can be obtained with the shift operator q and discrete systems. The
discrete transfer operator H (q ) is defined from Equation (3.13) as follows:
y ( kh ) b0 ⋅ q n + b1 ⋅ q n − 1 ++ bn
H (q ) = = (3.14)
u ( kh ) q n + a1 ⋅ q n − 1 + ⋅ + a n
The expression of Equation (3.13) may be shifted n sampling periods
backwards, which is equivalent to multiplying both sides of the equation by q − n . The
input/output relation is then expressed as:
[ ] [ ]
y ( kh ) + a1 ⋅ y ( k − 1)h + ⋅ + an ⋅ y ( k − n )h = b0 ⋅ u ( kh )++ bn ⋅ u ( k − n )h[ ]
By using the backward shift operator q −1 explicitly, the relation gets a simpler
expression:
If the numerator and denominator in Equation (3.15) are multiplied with q n , the
( )
result is Equation (3.14), i.e. H * q −1 = H(q ) .
The discrete transfer operator can be derived directly from the state-space
description (Equations 3.9, 3.10). Here is just stated the main result, the proof is
reported in common control theory books. The relation between the discrete transfer
operator and the state-space matrices is:
( )
H (q ) = H * q -1 =
y (kh )
u (kh )
= C ⋅ (q ⋅ I - Φ ) -1⋅Γ + D (3.16)
3.4: Discrete Time Dynamic Systems) 67
1 h 2 / 2m h h / 2
Γ = Ih + Ah 2 +... ⋅ B = =
2 h/m m 1
The sampled model for the mechanical system becomes:
1 h h h / 2
x[(k + 1)h ] = ⋅ x(kh ) + u (kh )
0 1 m 1
The transfer operator can now be calculated by using Equation (3.16). Note
that we treat q as if it were a complex number. Then
−1
q − 1 −h h 2 / 2m h 2 q + 1
H (q ) = (1 0) =
0 q − 1 h / m 2m (q − 1) 2
This can be rewritten in the form
m 1
(q 2 − 2q + 1)y (kh ) = (q + 1)u (kh )
h2 2
which is interpreted as
m
h2
[ y [(k + 2)h ] − 2y [(k + 1)h ] + y (kh )] = [u [(k + 1)h ] + u (kh )]
1
2
or analogously:
m
h2
[ y (kh ) − 2y [(k − 1)h ] + y [(k − 2)h ]] = 21 [u [(k − 1)h ] + u [(k − 2)h ]]
68 Chapter 3: System Description and Modeling
This is the sampled model of the mechanical system. For comparison, let us
make a simple difference approximation of the continuous time model as initially
described in Example 3.2, Section 3.2.1. A backward difference approximation
yields the following result:
m
h2
[ y (kh ) − 2y [(k − 1)h ] + y [(k − 2)h ]] = u (kh )
and for a forward difference approximation the result is:
m
h2
[ y [(k + 2)h ] − 2y [(k + 1)h ] + y (kh )] = u (kh )
The approximations calculated with forward and backward differences are
similar, apart from the shift in time 2h. For small values of h the time-discrete state-
space description gets closer to the difference approximations.
Assume that h is very small, so that the product ah is close to zero. Then ϕ is
just below 1. Physically this means that the system state changes very little between
each sampling instant. If, on the other hand, h is large, then ϕ becomes close to
zero. This means that the system will „remember“ very little between two sampling
instants. It is therefore obvious that the sampling time h is related to the size of the
coefficient a and has to be chosen with great care in order to avoid the introduction
of an instability factor in the system. The selection of the sampling time is further
discussed in Chapter 5.
Stated differently, the eigenvalues λ of A correspond to the eigenvalues e λh of
Φ . In the first order example above we saw that a negative real eigenvalue ( −a ) of
the continuous system may lie anywhere on the negative real axis for the system to
be stable. The corresponding location for the discrete system ( e − ah ) is on the real
axis between 1 and 0.
3.5: Controllability, Estimation and Observability 69
such case the associated states would follow their natural behavior. A similar
reasoning can be made also for time-discrete systems.
Similarly as for a continuous system, also a time-discrete system can be written
in diagonal form as long as the eigenvalues are separate from each other, i.e.
λ1 0 0 β1
0 λ2 0 β
x [(k + 1)h ] = x(kh ) + 2 u
0 0 λn β n
Exactly like the continuous system, all the β i have to be non-zero in order for
the system to be controllable.
The controllability of time-continuous and time-discrete linear systems can be
tested with mathematical methods. However, no mathematical method can replace
the control engineer’s physical understanding of the process. For example it often
happens that some modes are controllable only up to some degree (which
corresponds to small values of the related β i coefficient). Also when a mathematical
test indicates the controllability of a system, certain modes might be so weakly
controllable that no regulator could be designed and used for practical purposes.
[ ] [ ]
x (k + 1)h = Φ ⋅ x (kh ) + Γ ⋅ u(kh ) + K ⋅ y(kh ) − C ⋅ x (kh ) (3.17)
The D matrix (Equation 3.10) is in most cases zero. If the system has only one
sensor, then K is a vector, otherwise it is a matrix. In a „perfect“ estimation x is
equal to x and the last term in Equation (3.17) is zero, since y = C ⋅ x . The
estimated value would then obey the same dynamical equation as the true state x
(Equation 3.9). As long as x is different from x , the last term, i.e. the difference
between the true measurement y and the estimated measurement C ⋅ x is used for
3.5: Controllability, Estimation and Observability 71
error correction. The error is weighed by the matrix K and contributes to the
compensation of the correct (unknown) x and the estimated value x . The estimator
is illustrated in Figure 3.17, where it is shown how the model output C ⋅ x is
continuously corrected with the true measurement values y . If K is properly chosen,
then x can approach x .
technical process
u x y
process process
input Φ,Γ C output
x - y
Φ,Γ -C +
estimator
K
computer
Figure 3.17: Estimator of the same order as the technical process (full-order estimator)
The process drawn in the upper box represents the technical process, while the
estimator is an algorithm for the realization of Equation (3.17) in a computer. In other
words, the estimator is nothing else than the computer simulation of the technical
process that is regularly corrected with the actual measurement data. To examine
the convergence of the estimator the estimation error ~ x can be used:
~
( )
x kh = x kh − x kh ( ) ( )
By subtracting Equation (3.17) from Equation (3.9) and inserting Equation (3.10),
it results
[ ]
~ (k + 1)h = Φ ⋅ x
x [
~(kh ) − K ⋅ y − C ⋅ x (kh ) =
]
(3.18)
~(kh ) − KC ⋅ x
= Φ⋅x ~(kh ) = (Φ − KC) ⋅ x
~(kh )
sensed outputs y . The observability also guarantees that a suitable matrix K can be
x( kh ) converges to zero arbitrarily fast. Unobservability means that
found so that ~
some state or subsystem are physically disconnected from the process output and
therefore do not appear in the measurements. If the system is described by its
transfer operator, the system is observable if the nominator and the denominator
have no common factors.
d 2ε dε
JL ⋅ = Tm − k ⋅ ε − c ⋅
dt 2 dt
Tm ε, ω
Figure 3.18: Electric drive consisting of motor and load connected by an elastic shaft
[ ]
x 1 (k + 1)h ≈ x 1(kh ) + h ⋅ x 2 (kh )
[ ]
x 2 (k + 1)h ≈ x 2 (kh ) −
hk
JL
⋅ x 1(kh ) −
hc
JL
⋅ x 2 (kh ) +
h
JL
⋅ Tm (kh )
3.5: Controllability, Estimation and Observability 73
where k = 0,1,2,.…
velocity value
true / estimated
6
5
4 true value
3
2 (c)
estimation (a)
1
0
-1
-2 jump in velocity
value at t=5
-3 (b)
-4
0 5 10
time (s)
Figure 3.19 Velocity estimation on the basis of exact position measurements for different
values of the estimator K . The real velocity value is shown in bold and the
estimations are dotted. The parameters of the estimator vector are: (a)
K1 = 0 , K 2 = 0 , (b) K1 = 3 , K 2 = 3 and (c) K1 = 3 , K 2 = 15 . The
estimates in (b) and (c) converge rapidly; their value coincides with the true
value after about 2 seconds. Note how the estimates (b) and (c) initially have
opposite sign.
74 Chapter 3: System Description and Modeling
Once the estimator has reached the true value (i.e. the estimation error has
converged to zero) the estimated and the true value remain identical, even if the
input torque Tm changes; in a sense the estimator „knows“ the input function.
In a real system the velocity could be simply obtained by taking the derivative
of the position value. However, this is often a complicated operation in practice,
since the signal is usually noisy and the derivative of a rough signal usually gives
poor information.
If the model of the physical system is not accurate, the error dynamics is no
longer governed by Equation (3.18). However, K can often be chosen in such way
that the system remains stable despite the error and the estimation error is
acceptably small, even with small errors in the process model or when disturbances
distort the measurements. These aspects will be illustrated more in detail in the next
section.
the amplitude of the random numbers is normally distributed, so that mean value and
standard deviation completely characterize the disturbances.
In presence of measurement noise the estimation procedure that was described
in Section 3.5.2 must be carried out with particular care. Equation (3.19) is used
instead of Equation (3.10) to calculate the error. The structure of the estimator is
changed to:
[ ] [ ]
x (k + 1)h = Φ ⋅ x (kh ) + Γ ⋅ u(kh ) + K ⋅ y(kh ) − C ⋅ x (kh ) =
(3.20)
[ ]
= Φ ⋅ x (kh ) + Γ ⋅ u(kh ) + K ⋅ C ⋅ x(kh ) + e(kh ) − C ⋅ x (kh )
velocity value
true / estimated
6
5
4 true value
3
2
1 estimation (a)
0
(b)
-1
-2 jump in velocity
value at t=5
-3
-4
0 5 10
time (s)
Figure 3.20 Estimation of the velocity value from noisy position measurements; the
estimation is faster in (b), but also more sensitive for disturbances. The values
of the estimator vector K are the same as for the example of Figure 3.19: (a)
K1 = 3 , K 2 = 3 ; (b) K1 = 3 , K 2 = 15 .
In order to find the best values for K with noisy measurements more
sophisticated methods have to be used. The best choice of K often changes in
course of time. Typically K can be large as long as the difference between the real
measurement y( kh ) and the estimated measurement y ( kh ) = C ⋅ x ( kh ) is large
compared to e( kh ) . When the error becomes smaller, its amplitude is comparable
with the noise e( kh ) , and K has to be decreased accordingly.
The process variables themselves may contain disturbances that cannot be
modeled in any simple deterministic way. Thus, a noise term to describe the
modeling error or the influence of process noise can be added to the difference
equation (Equation 3.9). A typical application might be the measurement of the level
of the liquid surface of a large tank that is not smooth because of wind and waves,
causing random variations of the measured level. Another example is the
measurement of the torque in an electrical motor that may show small pulsations due
to the operation of the frequency converter. Such variations can be modeled as
random numbers v( kh ) that are added to the state:
temperature of 25°C can be regarded as „hot“ while 24.9°C would still be „cold“, to
which a temperature controller would react consequently.
Fuzzy logic, on the contrary, works by turning sharp binary variables (hot/cold,
fast/slow, open/closed) into soft grades with varying degrees of membership
(warm/cool, moderately fast/somewhat slow). A temperature of 20°C can for example
be both „warm“ and „somewhat cool“ at the same time. Such a condition is ignored
by traditional logic but is a cornerstone of fuzzy logic. The degree of membership is
defined as the confidence or certainty - expressed as a number from 0 to 1 - that a
particular element belongs to a fuzzy set.
Fuzzy systems base their decisions on inputs in the form of linguistic variables,
i.e. common language terms such as „hot“, „slow“ and „dark“. The variables are
processed via „if-then-else“ rules, producing in this way one or more responses
depending on which rules were asserted. The response of each rule is weighed
according to the confidence or degree of membership of its inputs values.
There are some similarities between the „if-then“ rules of artificial intelligence
(AI) and fuzzy logic. Yet, artificial intelligence is a symbolic process, while fuzzy logic
is not. In artificial intelligence neural networks represent data and decisions in special
structures. Each data input is assigned a relative discrete weighing factor. The
weighed data are combined in the network in a precise way to produce decisions.
The weighing functions in fuzzy logic, on the contrary, are defined as continuously-
valued functions with their membership values.
Fuzzy logic often deals with system variables that are observed rather than
measured. Fuzzy control has however also another important difference in respect to
traditional control. In traditional control, system modeling is based on a mathematical
model of the system, where a detailed knowledge of all relevant variables is
assumed. Fuzzy modeling deals with input/output relationships, where many
parameters are lumped together. In fuzzy control a preprocessing of a large range of
values into a small number of membership grades helps reduce the number of
values that the controller has to deal with. Because fewer values have to be
evaluated, fewer rules are needed, and in many cases a fuzzy controller can solve
for the same output faster than an expert system with its set of „if-then“ rules. In
some prototyping realizations fuzzy logic has proven to be a good way of starting
with little information.
An automatic controller for the speed of a train vehicle provides a simple
illustration of the application of fuzzy set theory. The criterion for the controller is to
optimize travel time within certain constraints. The current speed, acceleration and
the distance from the destination are the input data, and the controller operates on
the motor power.
The membership functions assign linguistic variables to the measurement values
(Figure 3.21). In the present state the acceleration is „decelerating“ due to a steep
hill. The velocity belongs to the membership „slow“ (weight 0.8) and „too slow“
(weight 0.2), while the distance is „close to destination“ with a weight 0.65.
A few rules can give some flavor for the control logic:
• if speed is „too slow“ and acceleration is „decelerating“, then increase power
greatly
• if speed is „slow“ and acceleration is „decelerating“, then increase power slightly
• if distance is „close“, then decrease power slightly.
78 Chapter 3: System Description and Modeling
1
degree of
membership too slow slow optimal fast too fast
0
actual state: speed
too slow=0.2, slow = 0.8
1
degree of
membership deceleration constant speed acceleration
0
actual state: acceleration
deceleration = 1.0
1
degree of very
membership close distant
close
0
actual state: distance from
very close = 0.65; close = 0.35 destination
0
controller output
Which rule should be selected? The output has also a confidence level that
depends on the confidence level, i.e. the weights of the inputs. In this case the final
selection is to increase the power slightly. Even if the speed is almost „too slow“, the
vehicle is already close to the destination.
There is no guarantee that fuzzy logic can deal with complex systems
successfully. A controller based on fuzzy logic is in practice an estimator of the
system state that is not based on a particular model. It is very difficult to prove the
stability of such a controller.
Fuzzy logic has become extremely popular for control system design, particularly
in Japan, while it has not caught the same interest in the United States where it was
first devised, or in other Western countries. Products based on fuzzy logic, all of
them Japanese, include autofocussing cameras, air conditioners, washing machines,
vacuum cleaners, elevator controllers and controllers for the speed in subway
systems.
3.7: Combinatorial and Sequencing Networks 79
[ ]
y (t ) = f u (t ) (3.22)
This type of control network can for example be used to check if a particular
manual control action is allowed or not. During the manual start-up of a complex
process the control computer would check all logical conditions that have to be
satisfied before a certain actuator is switched on or off.
In a sequencing network the output depends on both the present and the earlier
values of process states and inputs. A sequencing system has a memory and the
concept of state is used. In a simple sequencing network the execution proceeds as:
Step 1 ⇒ Step 2 ⇒ … ⇒ Step n
When the transition from one step to the next is determined by logical conditions
the sequence is called asynchronous. In a synchronous sequence instead the state
transition is triggered by a clock pulse. In industrial applications the asynchronous
transition is more common.
Some concepts can be illustrated by a simple example, the coordination of
machines in the manufacturing of discrete parts. Two machines M1 and M 2 are
connected together in a transfer line (Figure 3.22). The buffer B between them can
contain either no parts or one part.
The buffer has two discrete states, „full“ or „empty“. An empty buffer becomes full if
the machine M1 produces some parts (with a production rate µ 1 ⋅ ∆t ). A full buffer
can only become empty if M 2 consumes for its operation the stored parts (with a
production rate µ 2 ⋅ ∆t ). Since the states are discrete, it is possible to describe them
with binary digits (0 or 1):
State Buffer M1 M2
s000 0 0 0
s001 0 0 1
s010 0 1 0
s011 0 1 1
s100 1 0 0
s101 1 0 1
s110 1 1 0
s111 1 1 1
Table 3.1: Definition of the discrete states in the transfer line
The machine M1 can complete its operation only if the buffer is empty; otherwise
it must wait. The machine M 2 can produce only if the buffer contains a part;
otherwise it also has to wait. Thus, the operation of each machine is influenced by
the state of the other. A machine is said to be „blocked“ if it is prevented from
continuation because it lacks some resource (in this example a part or free space in
the buffer).
The operation of the machines can be illustrated by a state graph or an
automaton (Figure 3.23), described by the eight states s 000 ,…, s111.
The system can be in only one state at a time. The transfer rate between the
states is defined by the probabilities that a machine will complete its operation within
a specified time, or that it fails, or that it is repaired. Let us assume for example that
the system is in state s101; in this state M1 is idle and M 2 can produce, since the
buffer is full. The system can leave this state in three ways:
• If M 2 breaks down: go to state s100
• If M1 gets repaired: go to state s111
• If M 2 works regularly: go to state s 001
By modeling the machine system in this way it is possible to simulate the
different state transitions. In fact, with this model can be estimated the probability
that a certain state will be reached. Production rates and repair rates have an effect
on the total result of how well the system as a whole can produce.
3.7: Combinatorial and Sequencing Networks 81
r
2
s 100 s 101
f2
r2
µ2
s 000 s 001
f2
f r1 f r
1 f r f r 1 1
1 1 1 1
r
2
s s
010 011
f2 µ1
µ1 r µ2
2
s 110 s
111
f2
Figure 3.23: State graph for the transfer line with two machines and a buffer
An optimal system does not let the machines be blocked or starved and will
show a small failure rate. State graph modeling of this type is a tool for the
systematic analysis of such systems and is therefore widely used in the design of
industrial applications.
A process where the transition to a different state depends only on the current
state and input signals is called a Markov process. In a sense a Markov process
resembles the differential equations in Section 3.4. There is however a fundamental
difference between time-discrete dynamic systems and sequencing systems. In the
first case, each state variable has a continuously varying amplitude (like e.g.
temperature or pressure values), but is sampled and processed only at discrete time
instances. A sequencing system like the Markov process „jumps“ instead between a
finite number of distinct states.
The state graph can be considered to be an information structure of the
automation process. It does not say anything about the practical implementation. In
Chapter 7 it will be shown how switching elements and PLCs can be used to realize
such systems.
82 Chapter 3: System Description and Modeling
3.8 Summary
Models are descriptions of the physical processes that must be controlled. In this
chapter were considered four classes of mathematical models:
• Continuous dynamic systems described by linear or non-linear differential
equations
• Time-discrete (sampled) dynamic systems represented by linear or non-linear
difference equations
• Discrete event, or sequencing systems, described by finite states
• Systems with uncertainties that are expressed either by statistical or by
linguistic methods
A dynamic system must be represented in time-discrete form to make it suitable
for computer control. This representation can be either in state-space form (internal
representation) or in input/output form (external representation). The choice of the
representation form depends on the controller structure to be designed. Linear
models are very attractive from the point of view of system analysis, but in computer
control there are no restrictions about linearity. Examples of non-linear systems have
also been presented in this Chapter. Software tools for the analysis of linear dynamic
systems are available on the market. The analysis of non-linear systems is however
very complex and can rarely be carried out analytically; simulation software provides
therefore an important support for system analysis.
In this Chapter have been described two important structural properties of
systems, controllability and observability. Controllability indicates whether the input
signals are sufficient to bring the system state anywhere in the state-space.
Observability indicates whether the set of measurement variables is adequate in
order to find all the values of the internal state of the system. If a technical process is
observable it is possible to indirectly measure the state variables that are not
collected with sensors via an estimation function. If the process or the measurements
are corrupted by noise, then the estimation procedure needs also to contain a model
of the disturbances; this model is often based on statistical properties of the
disturbances.
Many industrial processes can also be controlled without a quantitative
mathematical model. The mental models of the operators are often sufficiently
sophisticated for the control even of complex processes. When this type of control
actions are automated in a process computer, the related control schemes must be
formalized in linguistic terms. Fuzzy algebra has shown to be an adequate
methodology to describe mental models with inherent uncertainties.
Sequencing systems and discrete event descriptions are very common in
industrial process control. Some processes can be controlled by relatively simple
combinatorial networks, while others need to be controlled by systems that take in
consideration also previous states of the process. In this Chapter were shown some
ways for the systematic modeling of sequencing systems.
Further Reading
There are many books that deal with the different aspects of modeling dynamic
systems; not too difficult introductions are [Luenberger 1979] and [Ljung / Glad
1994]. The areas of process identification and parameter estimation have been
mentioned briefly in this Chapter, also on these subjects there are several good
textbooks. [Söderström / Stoica 1989] and [Ljung 1987] are recommended
3.8: Summary 83
Aim: To give a basic understanding of the most important issues related to the
connection of a physical/technical process to a control computer, in particular to
sensor and actuator technology, signal transmission and signal conditioning
Overview
This chapter is dedicated to the interface between the physical/technical process
and the computer input and output. In order to physically connect the computer to
the process many technologies have to be applied. Without necessarily having to
become an expert in all the related fields, it is important that the process computer
engineer is aware of the different problems in signal interfacing.
The chapter begins with an introduction to the components of the process-
computer interface. Measurement and sensor technology is of vital importance for
computer control. Sensors have to accurately represent the physical variables of the
technical process under both steady-state and transient conditions. Instrumentation
technology is a vast topic in itself and a few examples are presented here to give the
flavor of the measurement problems and possibilities (Section 4.1). The general
properties that characterize the operation of sensors are described in Section 4.2.
Measurement devices that deliver only on/off signals, binary sensors, are discussed
in Section 4.3. A brief survey of different analog sensor types is made in Section 4.4.
Because of their importance in process control applications, particular emphasis is
given here to flowmeters.
The transmission of signals between the sensors, the control computer and the
actuators is another wide subject in itself. The signals that are delivered by the
sensors have to be conditioned in order to fit both the measurement device and the
computer input. It is here very important to take precautions against the many
different kinds of electrical disturbances that can influence and distort the original
measurement signal. The disturbance pattern often determines the most suitable
type of signal to carry sensor information, i.e. whether the transmission will be by a
voltage, current or optical signal. The issues related to signal transmission are
discussed in Section 4.5.
The computer output signals must be converted to mechanical movement or
other type of power output in order to control the technical process. This is the
function of actuators. This is again a very wide field, in which a particular position is
covered by electrical drive systems, integrated devices for the conversion of
electrical to mechanical energy. Binary actuators (for so-called on/off control) are
treated in Section 4.6; Section 4.7 gives an introduction to electrical drive systems
technology and finally in Section 4.8 the operation of valves is briefly described.
84
4.1: The Components of the Process Interface 85
human user
physical/
technical process
process
computer
Chapter 4 Chapter 5
The conceptual simplicity does not mean that practical realization is also simple.
As Murphy would put it, „if everything seems to be going well, you have obviously
overlooked something“.
4.1.1 Sensors
For most physical quantities there is a wide variety of measurement technologies
characterized by the produced signals as a function of the physical variables being
measured. The measuring device or sensor consists of two parts, the sensor head
and the transducer, as illustrated in Figure 4.2. These terms are sometimes
erroneously used interchangeably; in this book will be understood as sensor the
complete measuring unit built out of both sensor head and transducer.
sensor
The signal being measured is felt as the „response of the sensor head element“
and is converted by the transducer into an electrical quantity that is then transmitted
on a conductor. The output of a measuring device or sensor is therefore actually the
output signal of the transducer. In control system applications, this output is typically
- and preferably - an electrical signal, but also applications with pneumatic sensors
are not uncommon in the process industry. The principal advantage of electrical
86 Chapter 4: Physical Process Input and Output
sensors is the flexibility and multitude of ways in which the signals can be processed.
In addition, electrical signals can be transported over large distances with little
energy. In comparison to electrical sensors, pneumatic sensors are usually quite
cheap, small, simple and insensitive to disturbances. Moreover, for applications in
environments with possible fire or explosion hazards, pneumatic sensors are usually
safer than electric sensors.
Three categories of sensors can be recognized:
• analog sensors that generate continuous analog signals
• digital sensors that produce a pulse train or binary word
• binary sensors that produce digital on/off (0/1) signal levels
4.1.2 Actuators
An actuator is a device that converts electrical energy to a mechanical or
physical quantity in order to influence a technical process. In an industrial robot the
motors of the mechanical joints are the actuators. In a chemical process, the final
control elements may be valves for the control of the reagents flows. It should be
observed that actuators usually influence only indirectly the variables in the physical
process that are measured by sensors. For example, a sensor may measure such
variables as temperature, position or chemical concentration, but actuators control
directly heating, movement and chemical reagents feed flows. It depends on the
dynamics of the physical system how the measured quantities change under the
control of the actuators.
An actuator system can be divided into two elements, the transducer and the
amplifier, as shown in Figure 4.3. The transducer carries out the conversion in a
mechanical or physical quantity, for instance an electric motor converts electrical
power into a rotational movement. The amplifier portion of the actuator system
amplifies the low level control signal from the computer output interface to a level
high enough to affect the transducer. In some cases both the transducer and the
amplifier portion of the actuator system are mounted in a single unit. In this way
some of the final control elements can operate as a self-contained control system;
the computer output is the reference value (setpoint) to the final control element.
actuator device
The requirements for the actuators - such as operating power, motion resolution,
repeatability and operating bandwidth - can differ significantly, depending on the
particular application. Similarly as for sensors, the proper selection of actuators is of
crucial importance for the control of a process.
Compressed air is often used to position valves as final control elements. When
large forces are needed, hydraulic actuators can be used. The electrical signals from
4.1: The Components of the Process Interface 87
the computer control then the production of compressed air or oil pressure by
appropriate conversion equipment. The physical control variable can also be an
on/off value produced by electromechanical relays or electronic switches.
value
(a) time
value
(b) time
value
(c) time
value
(d) time
The figures 4.4(a) and (c) represent biased measurements. The standard
deviation or variance between individual measurements is a measure of precision. A
90 Chapter 4: Physical Process Input and Output
sensor with good reproducibility (or small random errors) has good precision but
does not necessarily deliver the right output value, since bias may distort the result,
i.e. its accuracy is poor. The measurements in Figures 4.4 (c) and (d) are precise,
but only the measurements of Figure 4.4 (d) are also accurate.
Mp
1.4
1.2
0.8
0.6
0.5
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10
T0 Td Tp Ts Time
• Settling time: the time it takes for the sensor step response to settle down
within a certain percentage (e.g. ±5%) of the steady-state value.
• Percentage overshoot: the difference between the peak value and the steady-
state value, indicated as percentage of the steady-state value.
• Steady-state error: the deviation of the actual steady-state value from the
desired value or the offset. It can be corrected by calibration.
In a real situation some of the requirements are always in conflict to others, so
that all the parameters cannot be minimized simultaneously.
4.2.4 Non-linearities
Many sensors have a non-linear behavior. For example, when the sensors reach
their upper range limit they show saturation effects, so that their output signal is
limited even if the input value increases. Examples of non-linearities include:
• Non-linear deformation in mechanical springs
• Coulomb friction
• Magnetic saturation in transformer parts
• Flow rate measurements (e.g. in open channel measurements there is a non-
linear relation between the measured level h and the flow rate F such as
F = (constant ) ⋅ h a
• A thermistor shows a non-linear resistance change as a function of temperature
R = R 0 ⋅ e β ( 1/ T − 1/ T0 ) , where T is the temperature in Kelvin and R 0 , T0 and β
are constants.
Particular problems appear for backlash in gears and other loose components,
and for hysteresis in magnetic circuits. The output signal of sensors that operate on
these principles is a multivalued function of the input and depends on the direction of
change of the physical value to be measured.
Consider a standard electrical quadripole with its two ports. The output
impedance Zo is defined as the ratio of the open-circuit (no-load) voltage at the
output port, i.e. with no current flowing at the output port, to the short-circuit current
at the output port. The input impedance Z i is defined as the ratio of the rated input
voltage to the corresponding current through the input terminals while the output
terminals are kept open (Figure 4.6).
G
+ Zo
v Zi v o= G · v i
i
-
Figure 4.6: Schematic representation of the input and output impedances in a quadripole.
G is the gain and v o the open-circuit voltage.
When a load is connected to the output port, the voltage across the load will be
different from v o due to the presence of a current through the output impedance. If
the quadripole is isolated, it is then possible to relate the input and output voltages
under open circuit conditions by a gain G :
vo = G ⋅vi
where v i is the input voltage.
Zi 2
vi2 = ⋅ v o1
Z o1 + Z i 2
v o2 = G2 ⋅ v i 2
The combination of the gains gives the overall gain:
Zi 2
v o 2 = G1G 2 ⋅ ⋅vi
Zo1 + Z i 2
This expression can become close to the gain G1G 2 if the output impedance of
the first quadripole is much smaller than the input impedance of the second
quadripole. In other words, the frequency characteristics of the device with the two
amplifiers in cascade will not be significantly distorted if the proper impedance
matching is done, i.e. the output impedance of the first device is much smaller than
the input impedance of the second.
94 Chapter 4: Physical Process Input and Output
G1 G2
+ Z o1 + Zo2
vi Z i1 v o1 vi2 Zo2 v o2
− −
Normal position
(non actuated)
Actuated position
output
voltage vo switch
closing
vo
single-pole, 5V
single-throw
(SPST) switch
< 5 ms time
(a) (b)
bouncing
The closure of a mechanical switch usually causes problems since the switch
bounces for a few milliseconds before closing altogether (Figure 4.9.b). When it is
important to detect only the first closure, such as in a limit switch, the subsequent
opening and closing bounces need not be monitored. The use of a circuit introducing
a brief delay in the output signal is one means of overcoming the effects of switch
bouncing.
A change over switch, also called single-pole double-throw (SPDT) can be
either of the type „break-before-make“ (BBM) or „make-before-break“ (MBB) (Figure
4.10). In the first case (BBM-type switch) both contacts are open for a short moment
during the switching operation. In a MBB-type switch a current flows briefly in both
contacts during a switch operation.
96 Chapter 4: Physical Process Input and Output
normally closed
normally open
normally open
normally closed
actuation
(a) (b) actuation
Figure 4.10: Change over switches, (a) break-before-make contact (BBM), (b) make-before-
break contact, bridging (MBB)
v o 2 = K ⋅ v ref ⋅ cos θ
respectively, where θ is the angular position of the rotor.
rotor coil
stator coils
vo1
vo2
Figure 4.11: Operating principle of the resolver
It can be said that v ref is modulated by the angle value θ to produce the
output signals v o1 and v o2 . By using only one output signal, only angles between
0° and 90° can be measured unambiguously. By using both signals it is possible to
measure between 0° and 360° without ambiguity.
The resolver output is a trigonometric function of the angle. This non-linearity
is however not always a drawback. For example, in torque control in robots are
required trigonometric functions of angular values. The output signal of a resolver
can be used directly for control, without need for real-time trigonometric
conversions that would place a load on the control computer.
A resolver has usually good resolution and high accuracy. Its output signal
level is high and the output impedance low. The bandwidth of a resolver depends
on the frequency of the supply voltage source. Only the brushes connected to the
rotor may cause some problems, such as wear-out, noise and mechanical load.
Resolvers are available in solid, self-contained units.
4.4: Analog Sensors 101
N S
vo
Figure 4.12: Operating principle of the d.c. tachometer
Torque and force sensing is useful in many applications, including control of fine
motions (such as manipulation and gripping in robotics) and the measurement of
transmitted mechanical power in motors and drive systems. Torque can be
measured as strain or also as actual deflection. From the twist angle of an axis
measured by an angular displacement sensor, a torque can be determined. In
Example 3.5 we have seen that the torque of a d.c. motor is proportional to the rotor
current, so the current allows an indirect measurement of torque.
Pressure can be measured by mechanical deformation, for example, by bending
a tube, or the deformation of a membrane. The membrane is connected to a quartz
crystal, to the electrode of a capacitor or to a differential transformer (Figure 4.13).
Due to the piezoelectric effect, a quartz crystal under pressure generates a potential
difference. The capacity change in the capacitor connected to the membrane can be
measured with electrical methods. The electric signal output is in both cases in
relation to the amount of stress and sensor head deformation.
v out
differential
transformer primary coil
differential
moving transformer
ferromagnetic core
v out
secundary coils
vin pressure
membrane
pressure movement
A A
T1 T1
Al Cu
Al Fe
B C
T2 T2
T2 Cu V Cu
B
Figure 4.14: Operating principle of the thermoelement
If the temperatures at the points A and B are different, a current circulates in
the closed circuit. The right drawing shows a practical circuit for the
measurement of this current. Point A is the „hot“ junction and B, C represent
the cold junction. B and C must be at the same temperature.
R / R 0 = 1 + aT + bT 2 +2
where a is the resistance temperature coefficient and b a positive or negative
constant (Figure 4.15, (a)). For platinum, typical parameter values are a = 0 .004
per °C and b = 0 .59 ⋅ 10 −6 per ° C −2 .
R/R
0
3
(b) thermistor
(a) RTD
2
0
0 20 40 60 80 100
temperature (°C)
RTDs are available for a number of standardized resistances. The most used
type of RTD has a resistance of 100 Ω at the reference temperature (0°C or 273 K)
and is so common that is has got its own name, Pt-100.
The sensitivity is very small for the RTD sensor, and any current i used to
detect the change in resistance will also heat up the sensor itself, thus changing
the measurement by an amount proportional to i 2 . The resistance output is often
measured in a bridge configuration.
The slope of the R-T curve (Figure 4.15, (b)) corresponds to the temperature
coefficient a that is itself a function of the temperature:
1 d( R / R0 ) − b
a= =
( R / R0 ) dT T2
The value of coefficient a lies typically between -0.03 and -0.06 K −1 at 25°C
(298 K).
Due to the resistance of the thermistor, a current passing through it will
generate heat. The power dissipated in the thermistor at 25°C is typically of the
order of 0.002 mW. With a dissipation constant of about 1 mW/°C the sensor
temperature will rise by 1°C (in air) for each milliwatt of power dissipated.
The thermistor is not an accurate temperature sensor. Due to its sensitivity,
however, it is used to measure small temperature changes. It is also quite robust,
both mechanically and electrically. The non-linear output voltage of the thermistor
has to be changed to a linear function of temperature. This can be done either by
analog electronics or with software. In particular with help of software it is quite
straightforward to define a calibration table or an inverted function of the thermistor
characteristic function. Linear characteristics can also be achieved with a few
electronic components connected to the thermistor. Thermistors can be used for
temperature measurements up to 500 - 600 °C.
Many fluids of technical and economic interest, however do not have constant
density, or this density can be determined only with difficulty. An example is crude oil,
that on leaving the well is actually a mixture of petroleum (that is itself a complex
mixture of liquid and solid hydrocarbons), water, sand, other contaminating
substances and dissolved air and natural gas bubbles. Most flow rate measurement
techniques indicate the volumetric flow rate. We will briefly examine some of these in
the following, together with a method to measure mass flow rate. In many cases not
only the instantaneous flow rate value is of interest, but the integrated value of how
much fluid already passed the metering point (e.g. for billing purposes). In this case
the measuring device is called flowmeter.
4.4: Analog Sensors 107
membranes
differential
transformer
P
1
P2
P P2
1
(a) (b)
pressure sensors
Figure 4.16: Flow rate measurement by difference pressure: (a) general principle with a pipe
constriction; principle of the Venturi pipe
In the constriction there are always some frictional losses, that can however be
minimized with a streamlined hydrodynamic design. This is done for example in the
Venturi pipe (Figure 4.16.b). Venturi pipes have a nozzle to increase the flow velocity
followed by an expanding section for recovery of kinetic energy by reducing the
formation of vortices. Venturi pipes are commonly used to measure large flow rates
108 Chapter 4: Physical Process Input and Output
in open channels; their price is however usually higher than for normal pressure
differential flowmeters.
A flow rate can be measured with a turbine and a rotational speed meter,
because the flow rate is in proportion to the rotation speed. A common application of
this principle is in flowmeters that deliver a pulse for each predefined quantity of
liquid flowing through the turbine. A turbine can only be used for clear flows because
any solid particles in the fluid would interfere with its movement.
A simple method for volumetric flow rate measurement is based on the
properties of the movement of ultrasound waves in a fluid. The result of ultrasonic
measurement is the average velocity for the fluid as determined by travelling
ultrasound waves. Under the assumption that this velocity is the same as the actual
average velocity of the fluid (the average velocity is taken because the fluid has a
velocity profile, and turbulencies change the velocity from one point to the other),
then the volumetric flow rate is obtained by simple multiplication of the obtained
velocity by the section area of the pipe.
Ultrasonic measurement is carried out by using two piezoelectric converters
placed at the opposite sides of the pipe at a distance of at least 100 mm from each
other and at an angle; they can operate in either direct mode or reflection mode
(Figure 4.17).
piezoelectric converters
(transmitter/receiver)
piezoelectric reflector
converter (receiver)
(a) direct mode (b) reflection mode
There are two principal operation modes for the ultrasonic measurement, one
based on the wave travel time in the fluid, the other on the frequency shift. In the first
method is measured the difference in the travel time of a pulse train in the fluid (the
sound speed depends on the fluid; it is 344 m/s in air at room temperature and 1483
m/s in water). In an alternate fashion one piezo converter generates a pulse burst
and the other receives it, then they change function, the second converter operates
as sender and the first as receiver. In the first case, the component of fluid velocity
v ⋅ cos α is added to the travel time, in the second case it is subtracted. From the two
detected times it is possible to determine the average fluid velocity v .
A second method is based on the measurement of the frequency difference
between the radiated and the received pulse burst. The component v ⋅ cos α of the
fluid velocity influences the wavelength of the pulses, which means that their
frequency increases in one direction and decreases in the other. From the frequency
difference is derived the average fluid velocity. Both methods have the advantage
4.4: Analog Sensors 109
that the result does not depend of the particular value of the speed of sound in the
actual fluid and no special calibration is therefore necessary, as the measures in the
different directions compensate each other. However, in both cases the
measurement is influenced by irregularities in the fluid like small bubbles or particles.
Ultrasonic measurement has the advantage that the sensors can be installed
easily on the pipe (even devices for portable use are available), no modifications are
required in the pipe and the fluid dynamics characteristics are left unchanged, i.e.
there is no pressure loss after the measuring location. The precision of the
measurement is the same as for the other types of sensors, in the range of 0.5-1% of
the measured value.
Magnetic flow sensors operate according to Faraday’s law of electromagnetic
induction, which states that when a conductor is moved through a magnetic field, a
voltage is induced in it. The magnitude of the induced voltage is directly proportional
to the strength of the magnetic field and to the velocity of the conductor; its spatial
direction is perpendicular to the directions of both the magnetic field and the
conductor movement. In magnetic flow measurements, the conductor consists in the
ions of the electrically conductive liquid in movement; the flow conductivity must
therefore be at least 0.1 µS cµ . The magnetic field is generated by two coils placed
at opposite sides of the pipe and supplied with a.c. or pulsating d.c. current. The
voltage induced in the liquid is detected with two insulated electrodes; this voltage is
proportional to the flow rate. It can be shown that the voltage generated between two
opposite points on the inner pipe wall is largely independent of the velocity profile of
the liquid. Since the pipe cross section area is assumed to be constant, the output
voltage is proportional to the flow rate.
A further method for the determination of the flow rate in a pipe is based on the
von Karman effect. If a body of a determined shape is placed in a stream, vortices
are formed in its wake as the fluid separates on the sides of the body. These vortices
cause areas of fluctuating pressure that can be detected by a sensor. The frequency
of vortex generation is directly proportional to the fluid velocity. Because of the very
complicated relationship between flow rate and pressure changes and the influence
of other factors (e.g. temperature), vortex flowmeters require special processing
circuitry that is usually mounted together with the sensor.
With the exception of the magnetic flow measurement, all other volumetric flow
rate methods are based on the observation of some fluid dynamic property of the
flow. The measure is more accurate if the flow movement is laminar and not
turbulent. To avoid influence of other components in the hydraulic circuit (pumps,
bends, fittings, etc.) all methods require that before and after the sensor there must
be a compensating section of straight pipe with a length equal at least 10 times the
pipe diameter. This section should of course not contain any elements like valves,
restrictions, or the like. This pipe section is needed to allow the fluid take a more
laminar profile and compensate for turbulencies.
applications, the mass flow measurement using the gyrostatic principle and the
influence of the Coriolis acceleration or Coriolis force.
When a mass moves radially in a system that is under rotation about an axis, a
force is generated (Coriolis force). The direction of this force is perpendicular to both
the rotation axis of the reference system and the direction of the mass movement;
this force is proportional to the rotational speed and to the radial velocity of the mass.
Coriolis mass flow meters based on this principle work very well and deliver accurate
mass flow measurements without need for pressure and temperature compensation.
A straight pipe is excited into resonance at its natural frequency or at one of its
harmonics with help of an electromagnet. At the inlet and the outlet of the pipe,
pickups are placed symmetrically to the electromagnet in order to detect the phase of
the pipe oscillations. When no mass flows in the pipe, the two signals are in phase.
Any fluid particle that flows into the pipe will undergo a lateral acceleration. Because
of the inertia of the particle, the vibration at the inlet of the pipe will be attenuated. As
the particle passes through the pipe, it transmits the absorbed energy into the pipe
and the oscillation at the output will be intensified. The signals detected by the two
sensors at pipe inlet and outlet will therefore indicate different phases; the phase
difference is directly proportional to the mass flow rate. Coriolis flow sensors cause
very limited pressure drop in the system.
A Coriolis flowmeter can also be used to measure the density of a liquid. In this
case is determined the natural frequency of the filled test pipe; the natural frequency
is in inverse relation to the liquid density.
Coriolis flowmeters are by no means simple and need complex conditioning and
processing circuitry. This is not only a disadvantage, because flexibility is also
increased; the same device can for example be used for mass rate and density
measurements. Other advantages are that Coriolis mass flowmeters do not need
compensation pipe sections and their accuracy is high (0.5% of measured value). On
the other hand, Coriolis flowmeters are sensitive to vibrations and there are
restrictions to how they can be mounted; they are also quite expensive.
There are many types of sensors for the measurement of values such as the
concentration of organic carbon, of nitrogen compounds, phosphorus compounds,
etc. Many of those measurements are based on some kind of chemical laboratory
test that is carried out automatically by special-purpose equipment. Devices of this
type are usually very complex and therefore expensive. They operate offline, as the
tests may require quite some time, and make use of samples of the substance; the
results can be transferred to a computer via a data interface link. Maintenance
becomes a vital part of the operation of such equipment, and still it cannot be
counted on full satisfactory reliability.
-
vi
vo
-vs
The output voltage v o is the difference between the two input voltages v i + and
vi− :
v o = G ⋅ (v i + − v i − )
where G is the gain. Even a very small difference between the two input
potentials is sufficient to cause a large change in the output voltage. In this form, the
operational amplifier is the simplest form of a comparator, because already a small
difference between the input voltages brings the amplifier output into positive or
negative saturation.
Since the voltage gain is large but unpredictable, the operational amplifier is
never used as an amplifier without some type of negative feedback. At low
frequencies (less than about 20 kHz) most of the feedback configurations can be
realized by different passive components like resistors and capacitors built around
the operational amplifier. The inverted amplifier has the simplest feedback
architecture for an operational amplifier (Figure 4.19.a). The voltage gain (i.e. the
ratio of the output to the input voltage) is:
vo R 1
=− 2⋅
vi R1 1
1+
β ⋅G
where β = R1 / ( R1 + R 2 ) and G is the gain of the operational amplifier. The
gain decreases with the signal frequency but as long as β ⋅ G >> 1 , the voltage gain
depends only on the value of the resistors in the feedback circuit. Generally, for an
ideal operational amplifier the gain can be expressed by the ratio of the feedback
impedance to the input impedance.
A voltage follower, also called impedance transformer, is realized by the
feedback coupling presented in Figure 4.19.b. The gain of the voltage follower is
about equal to 1. If a voltage follower is connected in cascade to a sensor transducer
with high output impedance, the new system will still have the same response
characteristics of the original system sensor-transducer, but its output impedance will
be low. In some cases the signal will have to be amplified before it is further
transmitted or processed.
4.5: Signal Conditioning and Transmission 113
- -
vi
+ vo + vo
vi
(a) (b)
Figure 4.19: Schematic representation of (a) an inverted amplifier and (b) a voltage follower
R2
R1
vi1 -
vi2 + vo
R1
R2
The operational amplifier shown above represent the basic building blocks for
signal conditioning applications. Additional functionality, like e.g. the enhancement or
attenuation of specific frequencies, can easily be obtained by changing the
configuration of the passive components mounted around the amplifier. This
argument will be further treated in Chapter 5.
line impedance Z0
signal termination
source impedance ZL
Figure 4.21: Signal wave reflection in case of incorrect impedance matching between a
transmission line and its termination, Z 0 ≠ Z L
transmitted long pulse trains, in case of incorrect impedance matching the signals
can be reflected and mix, so that they can no longer be correctly interpreted by the
receiver. Impedance matching at end of a transmission line is realized with
termination impedances, also called termination networks. Practical examples of
termination networks will be shown in Section 8.2.3 in relation to bus systems and
in Section 9.5.4 in relation to data communication.
Z1 Z2
When both wires in a line carry current and the currents have the same
amplitude but are 180° out of phase, the line is said to be balanced. In an
unbalanced circuit current flows only in one wire, while the other serves as
reference ground. (The latter does not exclude that also this line is carrying a
current.)
There are basically two types of electrical conductors: twisted pair and coax
cable. As the name indicates, a twisted pair consists of two insulated copper
conductors twisted together, and represents thus a cheap and simple electric
communication medium. The wide use of twisted pair and coax cables in telephony
and television distribution has made these cables and their ancillary components
such as connectors and tools, widely available at low cost.
The electrical circuit of the twisted pair cable can be either balanced or
unbalanced. The advantage of the balanced circuit is that it is less sensitive to
external interferences; conversely this circuit irradiates less energy because the
induced electromagnetic fields have the same intensity but opposite polarity, so that
they tend to cancel out each other. On the other hand, a balanced circuit is such only
if it is properly trimmed and maintained. An unbalanced twisted pair cable is much
more sensitive to disturbances than a balanced cable but requires almost no effort to
116 Chapter 4: Physical Process Input and Output
be installed and operated. A cable with four twisted conductors is even more
insensitive to inductive disturbances (see Section 4.5.3).
Coax cables are made of an electric conductor isolated with a plastic coat and
surrounded by a conducting wire mesh, the shield. Because of their geometry, coax
cables are intrinsically unbalanced. The shield is held at ground potential and
prevents energy from irradiating from the central conductor, which at high
frequencies would represent an important disturbance factor. Conversely, the shield
hinders external interferences from reaching the central conductor. Coax cables are
denominated by the value of their distributed impedance; common values are 50Ω
(the cable is commonly known as RG-58 type) and 75Ω (RG-59). The importance of
coax cables is due to their use in high-frequency applications and communication
technology (see Section 9.3).
Resistive couplings
When different electronic systems are connected to a common power supply
and are also connected to a common earth ground, disturbances due to resistive
coupling may arise. Other common noise sources may be poorly shielded motors
and frequency converters with semiconductor switches. One way to avoid this type of
problem is to connect the sensitive electronic equipment to a different power supply
source than the rest of the circuits. Another possibility is the galvanic separation of
power units and devices. In this case there is no direct electrical connection between
the different power supply units and the electrical equipment.
4.5: Signal Conditioning and Transmission 117
S1
+
vi vo
-
S2
Capacitive couplings
Between two conductors and/or between a conductor and a disturbance source
there are almost always capacitive couplings. A capacitive coupling is characterized
by the fact that a variable voltage induces in the conductor a current i proportional
to the voltage time derivative, i = C ⋅ ( dv / dt ) , where C represents the capacitance
value. Capacitive couplings should be reduced to a minimum. They become smaller
the more the conductors (or the noise source and the influenced circuitry) are located
far from each other.
A good way to decrease capacitive couplings is to build an electrostatic shield
around the conductor to be protected in order to break the disturbance path. The
shield must be grounded so that its potential is zero. This measure provides good
protection, although there may be problems at the cable ends where the conductor is
connected on one side to the sensor and on the other side to the electronic circuitry,
e.g. a computer input board. The reason is that in those positions the shield does not
completely surround and protect the conductor. At the small, non-protected endings
there might be small capacitive couplings. It is therefore important to keep these
connections as short as possible.
• In case of connection to several sensors, use of one twisted pair cable for each
sensor
• Separation of power cables and signal wires; signal cables should be kept at
adequate distance from disturbance sources
• Low-voltage and high-voltage cables must cross at right angles (90°).
connecting cable
+
+
v voltmeter
s
-
-
+ -
vg
P P
1 2
chassis
power supply
signal ground ground
System ground,
safety ground
A separate power unit ground is recommended for relays, motors and other
devices that draw large currents. Finally, all chassis must be connected to a separate
ground, and this again to the safety ground.
The shields of measurement signal cables are usually also connected to ground.
In order to avoid ground current loops, the shield has to be connected to ground only
at one point, either in proximity of the signal source (the sensor) or to the electronic
equipment. The first configuration gives however the best disturbance reduction
(Figure 4.26).
sensor amplifier
shielded cable
output
signal
Figure 4.26: A system with a sensor and a differential amplifier. The cable shield is
grounded in proximity of the sensor.
• Keep the grounds for digital and analog circuitry separate from each other.
When the digital circuits change their logic state, the „digital ground“ can carry
large voltage spikes. Since analog circuits are usually very sensitive for
disturbances, they should have separate grounds in order to reduce the effect
of resistive couplings.
Voltage signals
Every cable has a certain resistance per unit length. If the input impedance of
the last circuit block (the signal processing circuitry) is not infinite, a current will flow
in the cable and a voltage drop will result. If the signal amplitude changes, some
current will also flow between the conductors because of the distributed capacities. It
is therefore realistic to always calculate some voltage drop along the transmission
line. The requirements for a high input impedance of the signal processing circuitry
makes it very sensitive to disturbances. Consequently, voltage signals are not much
suitable for transmission in those cases where disturbances may be significant.
A different connection possibility for voltage signals is realized with three
conductors (Figure 4.27). In a wire flows a constant current to feed the sensor, the
second wire brings the measurement signal from the sensor to the electronic
conditioning and processing circuitry and the third wire represents the common
return. The advantage of this solution lies in the fact that variations in the resistance
of the measurement signal wire, e.g. because of changes in temperature, do not
influence the signal itself, as no current flows in this wire and therefore there cannot
be any voltage drop. The sensitivity to external disturbances remains however
unchanged.
amplifier with high
input impedance
measurement signal
connection
constant
measurement current constant current
resistor generator
common return
The principal reason for the popularity of voltage signals lies on the one hand in
their intrinsic simplicity and on the other hand in the wide availability of devices for
122 Chapter 4: Physical Process Input and Output
amplification, filtering and other data processing. The simplicity of the operation is
reflected also in system applications: if the same signal has to be delivered to
several circuits, it is sufficient to connect these circuits in parallel (within the limits
related to the input impedances). Otherwise voltage signals are not used very much
in industrial applications, because usually long distances must be bridged and the
influence of disturbance sources may soon become significant.
The most important voltage levels for signal transmission have been
standardized (standard IEC 381):
+1 to +5 V
0 to +5 V
0 to +10 V
-10 to +10 V
Current signals
Current is a better choice than voltage for the transmission of signals over long
distances. The reason is that current remains constant along the cable while voltage
drops with the distance because of the cable resistance. At the end of the cable
circuit, the current signal can be transformed to a voltage signal with help of a high
precision shunt resistor (Figure 4.28).
voltage to current
converter R
twisted pair
+ cable
R
vi 4-20 mA -
At constant current and with ideal isolation, all the current generated from the
source reaches the receiver (the signal processing circuit) so that the cable
resistance has no influence. For alternating currents the influence of capacitive
effects will become more and more evident, and some current will be lost along the
cable, either to the return conductor or to ground. The international standard IEC 381
recommends a range of 4 - 20 mA for current transmission. The minimum signal
level is defined as 4 mA to have a possibility to detect if the loop is broken (0 mA).
Current transmission has the advantage that both the power supply for the
sensor and the voltage/current converter as well as the output signal can be carried
over the same two wires. This can be done under the condition that the current
drawn by the sensor and the converter remains constant, so that each change in the
loop current is clearly due to changes in the sensor output. In comparison, voltage-
based signal transmission requires three cables, as illustrated earlier.
To sum up, a measuring system based on current signals and a probe which is
galvanically isolated from the output signal has several advantages:
• It functions satisfactorily with long transmission lines
• It allows a simple operational check, since a current of 0 mA means that the
sensor is off-line or the line is interrupted
• It gives good protection from interference
• It needs only two transmission wires, thereby reducing costs.
from output signals of digital logic circuits. This makes their control from computers
particularly easy.
Different types of controlled switches can be used for low and medium power
switching. Integrated circuits with transistor outputs can be used up to a voltage of
about 80V and to a current of 1.5 A; they can be controlled from the computer output
signal. When the computer output is higher than +2.4V a current controlled by the
electronic switch flows through the actuator, while for outputs under +0.4V the
transistor is off and no current flows through the actuator. In this configuration, the
transistor operates as a simple saturated amplifier.
When higher powers must be controlled, the switch design can be based on
discrete power transistors or MOSFETs (metal oxide field effect transistor). Typically
such circuits can carry 5-10A and stand a potential difference of more than 100V.
Because of their internal resistance the transistors dissipate some power when a
current flows through them. They must therefore be mounted adequately for cooling,
otherwise they would overheat.
In the control of high powers (> 100 W), there should be no direct electrical
connection between the computer output port and the electronic power switch. The
switch is namely often a source of electrical noise, which could affect the operation
of the computer if there is a common electrical connection with the switch. In
addition, in case of switch failure, the high voltage to power the actuator could reach
and damage the computer via the direct electrical connection. To avoid this problem,
the control can be made via galvanic isolators, i.e. circuits that bridge the control
signal optically with a LED and phototransistor mounted in proximity and without any
direct electric connection.
Thyristors are an important class of semiconductor switches. Important
examples are Triacs (from TRIode AC semiconductor) and the silicon-controlled
rectifier (SCR). These semiconductors are also known as solid-state controlled
rectifiers.
Once a thyristor is „fired“ (switched on from a control impulse) it will remain on as
long as a current flows through it. In other words, unlike a power transistor or power
MOSFET, the thyristor does not turn itself off when the control signal is turned off.
The thyristor doesn’t even switch off when the supply voltage drops to 0 V. The
thyristor turns off only when the switched voltage changes sign (forced
commutation). Thyristors are very often used to switch alternating current because
the change of polarity at regular intervals, at most after one cycle, allows the thyristor
to shut off if no firing signal is present (natural commutation).
Thyristors can handle considerably more power than transistors or power
MOSFETs. When a thyristor is conducting, its internal resistance is virtually zero.
Consequently also the voltage drop across the thyristor and heat production are
minimal and can often be neglected for practical purposes.
time time
Figure 4.29: Voltage spikes that can occur in an inductive actuator when a switch is opened
inductive free-wheeling
load diode
+
power
supply
-
switch
Figure 4.30: Use of a free-wheeling diode to dampen the voltage spikes generated by
switching off inductive loads
positioners, robot arms, etc. For example, a common compact disc player contains a
controlled drive system for the rotational speed of the disc and one for the
positioning of the arm carrying the laser reading sensor; both rotation velocity and
track positioning must be controlled with high precision. In this section the most
important aspects of precision control of electrical drives are treated.
phase-to-phase 600
voltage
400
200
-200
-400
-600
0 0.01 0.02 0.03 0.04 0.05
time in seconds
Figure 4.31: Envelope of the resulting voltage during a PWM (pulse width modulation)
cycle.
The voltage is switched between three constant levels (0, positive high, negative
low). The sinusoidal curve shown is the simulated result of the effective voltage
applied to a power load.
motor load
-1
torque value
-1
speed value
-1
position value
The position control system shown here could be used e.g. for the longitudinal
position control of the laser sensor arm in an compact disc drive. In many actuators it
is important to control the angular velocity instead of a position, for example in the
rotational drive of a compact disc reader. In this case the outer loop for position
control can be removed from the cascade control system. The reference angular
velocity is passed directly to the speed controller as reference value.
If the position control system is implemented with analog technology the control
computer must generate analog signals; this can be done e.g. with digital/analog
converters (Section 5.2). The velocity may be measured with a tachometer (Example
4.3, Section 4.4.1) and the position with a potentiometer.
Another approach is to combine analog and digital control techniques. In this
case the velocity control is implemented with help of analog electronics, while the
control of the position is implemented digitally in the computer (Figure 4.33). This
control structure has been used since the early 1960s.
The angular position sensor is an incremental shaft encoder (see Example 4.1 in
Section 4.3.4) which generates a fixed number of pulses per motor revolution. When
the shaft rotates, a train of pulses is generated and the pulse rate is proportional to
the angular speed. The computer sends out position pulses that are added up in the
pulse counter. The pulses from the shaft encoder are instead subtracted from the
counter. The difference in the number of pulses corresponds to the position error;
this value is sent to a digital/analog converter to produce an analog voltage signal to
be used as reference value for the velocity. The computer receives and generates
only pulse signals, as if it were to control a stepping motor and not a d.c. motor like in
reality.
The servo control loop can also be realized completely with digital technology.
The shaft encoder provides the measurement information for both position and
velocity. Circuit boards that contain the necessary digital servo loops are available for
many microcomputer systems. Controllers of this type are also available in
combination with servo amplifiers.
130 Chapter 4: Physical Process Input and Output
+ im
up/down position D/A- +
counter controller converter Σ
- -
pulses to decrease the angular
angular position speed
tachometer
position feedback position
encoder
digital analog
The advantages of stepping motors prevail however in many cases over their
disadvantages, so that these motors are used in a great number of applications
where low power is sufficient.
On the minus side the a.c. motor has a lower starting torque than a d.c. motor
and needs a more complex control circuitry. However, the advantages of a.c. drive
systems are such that they can challenge the d.c. motor in robots, manipulators and
other industrial servo systems.
The wider use of a.c. motors as servomotors has been made possible by the
development of power electronics in combination with new control methods. With
microelectronic drive systems the frequency of the applied voltage can be suitably
controlled. The motor torque cannot be measured as easily as in a d.c. motor, but
can still be estimated on-line. Because of the strict time requirements, in this type of
control must be used processors with a special architecture for very fast
computations, digital signal processors (DSP).
132 Chapter 4: Physical Process Input and Output
0.8
square root
0.7
0.6
0.5 linear
0.4
0.3 equal
percentage
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1.0
valve opening %
(stem position)
f (x ) = x (square root)
f ( x ) = A ( x − 1) (equal percentage)
(the design constant A has typically a value equal to 20-50). These
characteristics are shown in Figure 4.34. Notice that perfect equal percentage valves
in theory do not close fully. In practice they are designed to approach linear
characteristics at low openings and hence close fully.
4.9 Summary
The measurements of physical process variables takes place with analog, digital
or binary sensors. The type of sensor output signal (analog, binary, pulse train, etc.)
must be chosen properly with respect to the application and its control. Every sensor
must satisfy different requirements, such as:
• the output should vary linearly with the measured variable
• the output signal should be of sufficiently high level
• the sensor itself should not distort the measured value
• the sensor should have small power consumption
• the sensor should be insensible to external effects and disturbances
• the output signal in relation to any given measured value should be the same
and not depend on past sensor operation; consequently, the measured value
shall be univocally determined by the sensor output signal
• the sensor must have an adequate rise time in order to faithfully represent
transients
Some examples of sensors for binary on/off states and for continuously varying
physical variables have been surveyed in this chapter.
For adequate signal transmission the impedances and signal levels along the
line have to be matched so that loading effects are avoided and the full
measurement range is accurately represented.
The principal causes for noise and disturbances on electric lines have been
described, such as
• resistive couplings
• capacitive couplings
• inductive or magnetic couplings
Different ways of eliminating or reducing their effects have been indicated, such
as:
• proper shielding and earthing
• galvanic isolation
4.8: Control Valves 135
Further Reading
There are many good general books on measurement and instrumentation
technology. [Doebelin 1990] is an outstanding reference with detailed descriptions of
most sensor types. Other good texts are [Alloca / Stuart 1984] and [Barney 1988].
For sensor and actuator applications in computer process control [de Silva 1989]
is an excellent textbook. [Derenzo 1990] describes several introductory laboratory
exercises for computer interfacing and represents a well suited reference for a
course on this subject. [Sargent / Shoemaker 1995] has since long become a
„classic“ for the PC interface technology and is recommended for everybody who
wants to do more with a computer than just write programs.
The measurement of force is described in [Norton 1989] and the principle of
Coriolis sensors in [Vögtlin / Tschabold 1990]. [Pessen 1989] offers a good survey of
binary sensors, actuators and circuits in both electric and pneumatic technology; this
textbook also contains several further references to this area. Photoelectric sensors
are described in detail by [Juds 1988].
Also actuators represent a whole discipline in themselves. [Fitzgerald / Kingsley /
Umans 1990] is a standard book on electrical machinery. [Leonhard 1985] gives a
more specific treatment of the control of electric drive systems and [Kenjo /
Sugawara 1994] represents a key reference on stepping motors. A modern and
comprehensive treatment of power electronics and its application for motor control is
[Mohan / Undeland / Robbins 1995].
Operational amplifiers are such important circuit components that there is a large
number of specialized literature on the subject. Among others will be mentioned
[Glasford 1986], [Hufault 1986], [Irvine 1994] and [Jones 1986]. The techniques for
grounding and shielding are described further in [Morrison 1986] and [Ott 1988].
[Wilson / Hawkes 1989] gives a good survey on optoelectronics.
5 Signal Processing
Aim: Description of the basic issues in signal conversion between analog and
digital form and of the fundamentals of analog and digital signal processing
Overview
The generation of measurement signals by sensors and their transmission in
analog form on a conductor were discussed in Chapter 4. The present chapter is
dedicated to how the collected data is fed to and processed by the control computer.
The different components in the computer input and output interface are presented
in Section 5.1. The key question of this chapter is signal sampling, i.e. how to
represent analog signals, that as such cannot be processed by a computer, in a
series of values at discrete points in time. This section deals also with the
components for sampling, i.e. the sample-and-hold circuit and the multiplexer. The
conversion of analog signals to digital and of digital signals to analog form represents
the principal problem of the interface between the computer and its sensor and
actuator environment. This is the argument of Section 5.2.
Before any continuous signal can be sampled, it must be ensured that it contains
only frequencies that are relevant with the actual measurement and that all irrelevant
or undesired frequency components (like e.g. high-frequency noise) are removed or
attenuated. Analog filters are used for this purpose; they are examined in Section
5.3.
After the analog signal has been converted to digital form, digital filtering
provides a further means to extract interesting information from the signal (Section
5.4). With help of digital filtering the non-relevant components of the input signal can
be reduced. Some preliminary tests of the measurement signal after its conversion in
digital form are necessary in order to guarantee the quality and consistency in the
measurement values. The most important of such tests are drawn up in Section 5.5.
136
5.1: The Sampling of Analog Signals 137
be used for further processing in the computer, additional tests have to be carried
out to make sure that the value is acceptable and makes sense in relation to the
physical process.
process computer
input signal digital additional output signal
test filtering processing test
multiplexing
analog analog
filtering filtering
signal signal
conditioning conditioning
5.1.2 Multiplexers
In many situations different components have to share a limited resource like the
input interface of a computer or a long measurement cable. This is also the case
when several input signals from different sensors must be transmitted on the same
physical channel. With multiplexing, the computer selects which signal has to be
fetched and read at any time. Simply stated, the multiplexer is a switch that
connects the computer with only one sensor at any given time (Figure 5.2).
Multiplexing is not limited to measurement signals but also plays - albeit in a different
way - an important role in communication (Section 9.4.2).
A multiplexer can be either electromechanical or electronic and operates more or
less like a switch. The switching order is usually sequential, but can also follow other
principles. An electromechanical multiplexer built with reed relais is a durable,
138 Chapter 5: Signal Processing
reference
clock
analog
multiplexer
measurement output
40
value (sampled) signal
sampled values
30
input signal
20
h
sampling
10 interval
0
0 1 2 3 4 5 6 7 8 9 10 time
H
+
-
- S
vi + vo
mode
control
0.5
-0.5
-1
0 1 2 3 4 5 6 7 8
time
0.5
-0.5
-1
0 1 2 3 4 5 6 7 8
time
Figure 5.5: If the sine wave is sampled six or three times per cycle, the observed
frequency is equal to the true frequency
0.5
-0.5
-1
0 1 2 3 4 5 6 7 8
time
Figure 5.6: If the sine wave is sampled five times in four cycles, then a sine wave at
much lower frequency than that of the original wave is observed.
We notice the following effect: if the sampling frequency is too small in relation to
the frequency components of the original signal, then a false frequency (the alias
frequency) appears in the reconstruction of the original signal, as shown in Example
5.1.a. The observed (alias) frequency fo is the difference between the sampling
frequency f s and the real frequency f :
fo = fs − f
142 Chapter 5: Signal Processing
observed f0 /fs
frequency
f [Nyquist frequency]
N
0.5
Figure 5.7: The apparent frequency fo as function of the true frequency f for a sinewave
signal sampled at the frequency f s . The apparent frequency is equal to the true
frequency only if f / fs < 0.5 , i.e. f s > 2 ⋅ f .
It appears that for a sampling frequency f s lower than twice of the original
frequency f the real frequency can no longer be reconstructed from the sampled
values. The limit frequency f = f s / 2 is called Nyqvist frequency, f N :
fN = fs / 2 (5.1)
If the continuous signal contains any frequencies above f N = f s 2 , these high
frequency components will appear in the sampled data sequence as waves of lower
(alias) frequency. Frequency aliasing is avoided only if the original signal is sampled
at a frequency at least twice as high as the highest frequency component in the
signal. This is the essence of the sampling theorem.
In practice the sampling frequency has to be higher than what the sampling
theorem states. The sampling theorem is based on the assumption that the original
signal is periodic and is sampled for an infinite time. Since this is obviously not the
case in a real control system, a higher sampling frequency is needed to collect
enough information to adequately describe the signal for its later reconstruction.
Moreover, there is no theorem that gives a lower limit for the sampling rate when the
signal is not periodic. Some practical rules for the selection of sampling frequency in
closed-loop control systems are discussed in Section 6.5.2.
Analog signals usually contain high-frequency noise components. The sampling
frequency must then be selected in relation to the highest frequency component
present in the original signal. All frequencies above the Nyqvist frequency must be
removed from the signal before sampling, otherwise they will appear as alias
frequencies in the sampled signal. This principle is sometimes stated so that all
frequencies of interest must be lower than the Nyqvist frequency. This is obviously
5.1: The Sampling of Analog Signals 143
not correct, because all frequencies above the Nyqvist frequency contribute to
aliasing, independently of whether they are of interest or not. If high-frequency noise
signal is superimposed to a low-frequency signal, sampling at a frequency that has
been defined in relation only to the low frequency signal will produce distorted values
because of the aliasing effect between the unwanted component and the sampling
signal. The higher frequency components can be attenuated or removed with an
analog low-pass filter (called anti-alias filter), as described in Section 5.3.1 and 5.3.2.
fN + ∆f = 5f 8 + 3f 8 = f (real frequency)
After sampling, there is no way to correct the collected data, so that frequency
f cannot be distinguished from its alias frequencies f + n ⋅ f s . Thus any of the alias
frequencies
f s − f , f s + f , 2 ⋅ f s − f , 2 ⋅ f s + f ,2 (5.2)
may appear, if the frequency f of the original signal is higher than the Nyqvist
frequency f N = f s 2 .
relative
concentration
1.0
0.5
10 20 30 40 50 60 time,
minutes
Figure 5.8: Measured concentration values for the settled sludge in a sedimentation unit
1
original signal
0.5
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
time
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
time
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
time
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
time
It appears clearly that the D/A converter delivers only discrete output values; the
resolution is equal to v ref ⋅ 2 − n .
2R
1 n-1
2
sn 0
R
2R
1 2n-2
s 0
R n-1 R
vref = 2R -
1
s 21 + vo
R 2 0
2R
1
s 20
2R 1 0
One functional aspect to take in consideration is that if the input word changes
value and the corresponding bit switches in the D/A converter do not change state all
at the same time, an unwanted transient spike at an incorrect value may occur in the
analog output (glitch). A possibility to avoid this problem is to cascade the D/A
converter with a sample-and-hold circuit that holds the output constant until the
switches settle (deglitcher).
The most important properties of the D/A converter that should be considered in
its selection or design are the following.
• Linearity: to what extent the relation between the digital input and the output
voltage is linear, alternatively the amount of the deviation due to non-linearity.
• Offset error: the value of the output voltage when the digital input is zero. It
should always be possible to adjust this value e.g. with a potentiometer or
under software control.
• Settling time: the time necessary for the output voltage to settle to a new
constant value.
• Slew rate (expressed in V / µs ): the maximum rate of change of the output
voltage. The slew rate depends on the settling time.
- logical circuit /
+ code conversion
R
-
+
digital
output
v in R -
+
=
vref R -
+
R comparators
Figure 5.11: Schematic drawing of an A/D converter with parallel comparation circuits
+
digital counter
-
comparator
digital
output
v
in
analog output
D/A converter
(a) = vref
Figure 5.12: A/D converter operating by incremental approximation. (a) Schematic drawing;
(b) function principle.
5.2: Conversion between Analog and Digital Signals 149
R2
100%
Ri
vi -
max vref
+ vo
min
R1
0%
-vref
(a) (b)
Figure 5.13: (a) The full range of the A/D converter (0-100%) should be used. (b)
Adjustment of the offset voltage with R1 and of the amplification gain with
R2 .
In order to exploit the full range of the A/D converter, both the gain and the offset
voltage of the input analog signal have to be adjusted. This can be done with an
operational amplifier (Figure 5.13.b). The offset voltage is adjusted with the variable
resistor R1 so that the d.c. amplifier output level corresponds to the minimum input
level of the converter when the input signal also is at minimum level. The variable
resistor R 2 is used to adjust the gain, so that the amplifier output level for the
maximum input signal is the same as the maximum input value for the A/D converter.
When 4-20 mA signal current transmission is used, a broken connection can be
detected by a 0 mA signal (Section 4.5.5). An A/D converter can also be used to
indicate if a sensor is out of operation. If the A/D converter is calibrated in such a
away that the maximum input signal (e.g. 20 mA) is represented by say 4000 instead
of 4095 in a 12-bit converter, then the highest values of the output word can be used
to indicate exceptional operational and error states. This requires however some
extra electronic circuitry and processing capacity.
A simple method to recognize when a sensor is disconnected is realized with a
switch and a constant voltage source. The voltage must be somewhat higher than
the maximum sensor output voltage or, in case of a current loop, higher than the
voltage level corresponding to the current value 20 mA. The switch is placed before
the multiplexer (Figure 5.14).
150 Chapter 5: Signal Processing
switch
sensor 0-1 V
channel 1
1
sensor 0-1 V
channel 2
2
multiplexer A/D
converter
sensor +1.1 V
channel n
n
= external
voltage source 1.1V
In the ON position the multiplexer input is connected to the sensor and the
terminal resistor, the input signal corresponds therefore to the measurement value.
In the switch OFF position the multiplexer input is connected to the external voltage
source. When the sensor is not operating (e.g. during service or calibration) the
switch is turned OFF and the A/D converter output will exceed the normal range. The
process computer can identify this situation as an indication that the sensor is off-
line.
fc log f
R2
vi -
R vo
1
+
Figure 5.16: Operational amplifier with RC-feedback. Under ideal conditions this circuit
operates like a first-order low pass filter.
The frequency dependence is the same as for the passive filter, but the
amplitude gain can be chosen by resistors R1 and R 2 . In practice, however, an
active filter based on an operational amplifier is not a perfect first order filter. The
reason is the limited slew rate of the amplifier, i.e. the maximum rate of change of
the amplifier output voltage for stepwise changes of the input voltage. This means
that very fast signals may slip through the filter, because the operational amplifier
does not react to them fast enough. A more practical solution is to filter the signal in
a passive low pass filter first (see Figure 3.4) and to amplify it later on.
vi R vo
R1R2 1
where fc1 = and fc2 = . If the corner frequencies are
2π (R1 + R2 ) ⋅ C1 2πR 3 C 2
equal (fc = fc1 = fc 2 ) , then the magnitude of G is:
R3 / (R1 + R2 )
G =
1 + ( f / fc )
2
154 Chapter 5: Signal Processing
R3
vi -
R1 R2 vo
+
C1
R4
C1
R R
vi -
vo
+
C2
Figure 5.19: A Sallen-Key second-order low pass filter with gain factor = 1
This circuit will block low frequencies and let through high frequencies, as shown
in the frequency diagram (Figure 5.21).
C R
vi R vo vi L vo
(a) (b)
Figure 5.20: (a) Passive RC high pass filter; (b) passive RL high pass filter
corner frequency
log vo
fc log f
The corner frequency fco is the frequency at which the amplitude drops by a
factor 1 2 compared to the high frequency gain. The expression for fco is fco =
1 / ( 2πRC) = 1 / ( 2πT ) (Hz). The voltage gain can be written as
G =
(f / fco )
(5.8)
1 + ( f fco )
2
156 Chapter 5: Signal Processing
In the same way as for the active low pass filter, also an active high pass filter
can be realized by feedback around an operational amplifier (Figure 5.22).
C R2
vi -
R vo
1
+
The frequency-dependent voltage amplification ratio of the active high pass filter
is the ratio between the feedback and the input impedance:
− jω ⋅ R 2 C ω ⋅ R 2C
G = =
1 + jω ⋅ R1C
1 + (ω ⋅ R1C)
2
The corner frequency is fco = R ( 2πL) = 1 2πT (Hz). By using this definition of
fco , the voltage gain can be written as Equation (5.8).
5.4: Digital Filtering 157
[ ] [ ] [ ]
y (kh ) = −a1 ⋅ y (k − 1)h − a2 ⋅ y (k − 2)h −2−an ⋅ y (k − n )h +
(5.9)
[
+ b0 ⋅ y (kh )+2+ bm ⋅ y (k − m )h ]
where h is the sampling interval, y the filtered output and y the input
measurement value. Note that the argument kh is a time value but can also be
considered as a simple integer pointer ( k ) to the input value sequence. If all the
coefficients a i are equal to zero, the filter is called Moving Average (MA) with a
finite impulse response. This means that if a whole y -sequence is equal to zero, and
only one y is different from zero at a certain time interval, then the filter output will
be different from zero only during m time intervals. If some or all of the coefficients
a i are nonzero, the filter is called autoregressive (AR) and has an infinite impulse
response. In other words, an input that is always zero and different from zero only at
one time interval will produce an output different from zero for a very long time
(infinite time). The general filter of Equation (5.9) is called Auto-regressive Moving
Average (ARMA).
Filters can be causal or non-causal. A causal filter calculates an output value
based on earlier input data (at any time t 0 can only be considered input values for
t ≤ t 0 . For this reason all on-line filters are causal. The filtered, output time series
will lag somewhat in time if compared with the original time series. If the data is
processed off-line, for instance in the analysis of a measurement data series that has
already been collected, a non-causal filter can be used. In this way in the calculation
a measurement value for time t can be processed together with both past ( t ≤ t 0 )
and future ( t > t 0 ) values.
The two most important types of low pass filters are the Moving Average (MA)
and the exponential smoothing. Low pass filters used in the process industry are
almost always implemented following one of these types of simple filters.
[ ]
y (kh ) = α ⋅ y (k − 1)h + (1 − α ) ⋅ y (kh ) (5.10)
[ ] ( [
y (kh ) = y (k − 1)h + (1 − α ) ⋅ y (kh ) − y (k − 1)h ])
This representation leads to another interpretation. The exponential filter
corrects the filtered output value as soon as a new input measurement is available.
The effect of the correction is small and becomes smaller for values of α close to 1;
in this case the filter acts sluggish. This will reduce the noise components of the
output signal but at the cost of poor agreement with real changes in the input signal.
If α is close to 0, the correction gain is large. Consequently there will be less
5.4: Digital Filtering 159
reduction of the noise level but the filter will track real signal changes more correctly.
For α = 0 the filter output is identical with the signal input. The effect of the selection
of α is illustrated by the different responses to an input step signal superimposed
with noise (Figure 5.23).
[ ]
y (kh ) = α ⋅ y (k − 1)h + (1 − α ) ⋅ y (kh ) =
[ ] [
= (1 − α ) ⋅ y (kh ) + α ⋅ (1 − α ) ⋅ y (k − 1)h + α 2 ⋅ y (k − 2)h = ]
= (1 − α ) ⋅ y (kh ) + α ⋅ (1 − α ) ⋅ y [(k − 1)h ] + α 2 ⋅ y [(k − 2)h ] + α 3 ⋅ y [(k − 3)h ] =2 =
y
1.0
0.5 α=0
0.5 α=0.5
0.5 α=0.9
0.5 α=0.95
0.5 α=0.98
program exponential_filter
var in_signal, alpha: real;
y_filtered, y_old: real;
next_time, delta_time: real;
begin
next_time := 0;
while true do (* repeat forever *)
begin
wait_until(next_time);
in_signal := AD_input (ch#1);
y_filtered := alpha*y_old + (1-alpha)*in_signal;
y_old := y_filtered;
DA_output (ch#2, y_filtered);
next_time := next_time + delta_time;
end; (* while true loop *)
end; (* exponential_filter *)
162 Chapter 5: Signal Processing
[ ]
y 1(kh ) = α ⋅ y 1 (k − 1)h + (1 − α ) ⋅ y (kh )
where y is the real measurement value, y 1 the output of the first filter and y 2
the output of the second filter. The filter operation can be defined by setting the
parameter α . The second-order digital filter can also be written in the following form
without the term y 1( kh ) :
[ ] [ ]
y 2 (kh ) = 2α ⋅ y 2 (k − 1)h − α 2 ⋅ y 2 (k − 2)h + (1 − α ) ⋅ y (kh )
2
The effect of the second order filter on the same signal as in Figure 5.23 is
shown in Figure 5.24. The second order filter is more efficient for attenuating high
frequencies, so that a smaller value of α can be selected. The output of this filter
follows the real signal changes better than the first order filter.
With a higher order filter (Equation 5.9) the operation can be further improved.
The price to be paid lies in a greater complexity for the filter, but data processing is
not expensive. Moreover, while in analog filters the addition of passive electronic
components to a filter circuit would mean additional energy losses in the signal, this
problem does not exist with data processing.
y
1.0
0.5 α=0
0.5 α=0.5
0.5 α=0.9
0.5 α=0.95
0.5 α=0.98
Figure 5.24: Effect of a second-order exponential low pass filter for different values of the
parameter α
164 Chapter 5: Signal Processing
y y
1.0 1.0
0.5
0.5 0
-0.5
0 -1.0
y y
1.0 0.5
α=0 0 α=0
0.5
0 -0.5
y y
1.0 0.5
α = 0.95 0 α = 0.95
0.5
0 -0.5
Figure 5.25: Effect of a first-order high pass filter on a input signal. Figure 5.26: Effect of a high pass filter on a sinusoidal signal with
The upper diagram shown unfiltered data. The diagram in overlying noise.
the middle shows the output for α = 0 and the lower The filter output (middle diagram) retains only the high
diagram for α = 0 .95 . frequency variations. In the lower diagram is shown the
output for α = 0 .95 , where the low frequency
component is let through with attenuation.
5.5: Basic Measurement Data Processing 165
with α defined as in Equation (5.12). The discrete filter equation can also be
derived analytically from Equation (5.14); the result is that α is given by Equation
(5.13) and its value must lie between 0 and 1. With α = 0 , the filter is a pure
difference builder. It should be noted again that h T has to be small for the
difference approximation and Equation (5.12) to hold.
The filter sensitivity at higher frequencies is determined by the value of α . A
small α leads to a greater sensitivity, which corresponds to a high corner frequency
for the high pass filter.
The operation of an high pass filter will be illustrated here with help of some
examples. The same step input signal superimposed with noise of Figure 5.23 shall
be used again as input in Figure 5.25. The middle diagram shows the output of a
pure difference builder ( α = 0 ). It contains a spike at t = 50 , as the filter detects the
sudden change in the input signal. With α = 0 .95 , the spike at t = 50 becomes
wider as shown in the lower diagram.
In Figure 5.26 the filter input is a sinusoidal wave with superimposed high
frequency noise. The output of the high pass filter retains the high frequency
variations, while the slower sinusoidal oscillations have been reduced or eliminated.
If a step change is added to the sine wave with noise, the high pass filter output
displays a peak that results from the step change (Figure 5.27).
y
2.0
1.5
1.0
0.5
0
0.5
• Test of the validity of the raw measurement value with respect to the allowed
minimum and maximum values for the sensor range and rate of change of the
sensor signal. If the value lies outside the foreseen range, then alarm
messages or other indications for the operator should be generated.
• Calculation of an average value from the raw measurement signals (values
„outliers“ that differ too much from the other measurements should possibly be
rejected)
• Digital filtering
• Storage of the filtered measurement value.
signal
1 2
hysteresis
band
hysteresis
band
time
Averaging
Erroneous measurement values can be reduced from the very beginning by
using simple averaging. For example the A/D converter might be programmed to
sample the measurement signal 10 times faster than needed and the „raw“
measurement value could then be obtained by averaging those values. In addition,
one or two extreme measurement values, at too high or too low value, could be
discarded. This method is useful in those cases where the input signal remains
constant during the time interval in which the averaging operation takes place and
the variations in the input signal are caused by noise with zero average value.
Plotting
With simple plots of signals as functions of time or as cross-functions of other
signals can be revealed interesting details, such as:
• Exceptional and unusual disturbances
• Missing measurement values
• Periodic oscillations
For this reason, plot facilities for signals in different timescales and in cross
relation with other data are an essential utility in any process computer system.
Analysis Software
There are many software packages to perform data series analysis and filtering.
One package widely used in academic as well as scientific environments is
MATLAB®. MATLAB is a technical software package for numeric computation and
visualization that integrates into a common environment routines for numerical
analysis, matrix computation, signal processing and graphical representation.
MATLAB can be extended with optional toolboxes to provide application-specific
capabilities. Some of these toolboxes can for example be used for filtering. The
signal processing toolbox adds commands for digital signal processing (time series
analysis) and includes functions for the design and analysis of digital filters. The
system identification toolbox adds commands for parametric modeling and system
identification. Among many model structures, also the ARMA models are available in
MATLAB.
5.6 Summary
The sampling rate for continuous signals is of fundamental importance for the
processing of measurement data in computer control systems. Ideally, this rate
should be at least twice as high as the highest frequency component of the original
measurement signal; in practice the sampling rate must be higher to allow for the
correct signal reconstruction in a finite time. In addition, if the sampling rate is not
sufficiently high and high-frequency noise is superimposed to the original signal, alias
frequency distortion will take place and false frequencies will appear in the sampled
signal. After sampling it is impossible to separate this false information from the
original, „correct“ data.
For the conversion of the analog signal to digital form it must be ensured that the
converters are sufficiently fast, that the accuracy is relevant for the envisioned
application and that the conversion range is used to full capacity.
High frequency components in a signal are usually due to noise and
disturbances and should be eliminated or dampened before sampling. Analog low
pass (anti-alias) filters are used to remove all frequency components above half of
the sampling rate.
Analog filters can be designed to attenuate either high frequencies (low pass
filters) or low frequencies (high pass filters). Very often these filters are implemented
with operational amplifiers, they have therefore to be used with precaution since the
operational amplifiers have only finite bandwidth and do not respond to very high
frequencies, either to filter them out or to let them pass unfiltered.
Digital filtering is an useful method to extract the needed information from a
signal. In this chapter we have seen how to implement low pass and high pass filters
of lower order. In practice simple Moving Average and digital exponential (low pass)
filters of first order are commonly used. Higher order filters can easily be
implemented on a digital computer. Finally, several basic tests should be performed
170 Chapter 5: Signal Processing
Further Reading
Analog filters are treated in detail in [Glasford 1986], [Irvine 1994] and [Jones
1986]. [Derenzo 1990] describes many practical aspects of multiplexing,
analog/digital conversion and filtering. More details on A/D and D/A conversion are
contained in [Sheingold 1986].
The sampling theorem is explained in [Åström / Wittenmark 1990]. This book
also presents in detail time-discrete dynamic systems, of which digital filters are a
special case. Digital filtering is further treated by [Stearns / David 1988]. For the
analytical description of noise and disturbances are recommended the two works
[Bendat / Piersol 1986, 1993] as well as [Ljung 1987] and [Söderström / Stoica
1989].
6 Control Structures
Aim: Presentation of the most common controller structures and their analog and
digital implementations for process control applications
Overview
This chapter deals with controllers in both continuous and discrete time
description. The reader should become familiar with different control structures, so as
to be able to understand and estimate their properties, their performance and
therefore their practical use. It is outside the scope of this textbook to go into the
details of controller analysis and design or into the different methods for controller
tuning. The reader should already be acquainted with the basics of control theory and
understand how controllers can improve some of the systems’ properties, like e.g.
system stability. The classical textbooks of control theory deal in detail with the
mathematical methods for control circuit analysis but tend often to be weaker in the
practical aspects, how controllers are actually designed, built and operated. This
chapter will focus not only on the theory but also on the practical aspects of the
design of controller structures and their implementation on digital computers in order
to reach the desired control goal.
Controllers can be realized on the basis of either continuous or time-discrete
process models, and the design principles are presented in Section 6.1. On/off
controllers are quite common in the process industry and are briefly discussed in
Section 6.2. In Section 6.3 it is shown how simple continuous controllers can be used
in feedforward and feedback configurations to reach particular system performance.
The proportional-integral-derivative (PID) controller is the dominating controller
type in process applications and will therefore be treated in depth in several sections
of this chapter. Its basic properties are discussed in Section 6.4. The time-
discretization of the PID controller and other aspects related to its implementation on
a digital computer are the subject of Section 6.5. Different controller structures on the
basis of PID controllers are described in Section 6.6. Despite their wide acceptance,
PID controllers are not suitable for all types of control problems, for example they
cannot be used satisfactorily in processes with delays and dead times. The limits of
the application of PID controllers are discussed in Section 6.7.
The general discrete linear controller is presented in Section 6.8. This type of
controller is particularly important for two reasons: on the one hand, it can be
immediately realized on a digital computer, on the other hand many other controller
types (e.g. the PID controller) can be considered as special cases of the general
controller. The practical realization of the general controller is treated in Section 6.9.
Dynamical system models can also be defined in state-space form. A state-space
model is for example useful to describe multi-input, multi-output linear processes.
When a process model in state-space form is available, then a controller structure
based on state feedback can be used. Its properties are briefly described in Section
6.10.
171
172 Chapter 6: Control Structures
control it is also possible to follow a different way, namely to start with a discrete
dynamical model for the technical process (Section 3.4) and then design the
controller directly on the basis of this model.
In general, if a controller is first designed in analog form and discretized
afterwards, this usually leads to shorter sampling interval (which means a higher
computing load) than if it were directly developed in digital form. The discretization of
analog controllers is therefore not to be particularly recommended, but since most
PID controller design takes place in this way, it will also be treated in this chapter.
Digital controllers developed directly from a time-discrete process description
look similar to the analog controllers after their discretization, but have different
coefficients. This means that also the computer code looks similar. This means also
that a general controller can be programmed on the process computer, leaving to a
later time the selection and the tuning of the controller parameters. This approach will
be shown in Section 6.8 and 6.9.
The analysis of time-continuous and time-discrete linear systems is quite similar.
Many concepts can also be explained from a continuous as well as from a discrete
point of view. Simple controller structures will be treated in the following from a
continuous standpoint, later on the same concepts will be transferred to the time-
discrete case.
In this chapter it is assumed that all linear discrete controllers with one input and
one output signal can be represented in the following general form:
u (kh ) = −r1 ⋅ u [(k − 1)h ] − − rn ⋅ u [(k − n )h ] +
uc e u y max
Σ technical
process
min
-1
-e 0 0 e0 error
(a) (b)
Figure 6.1: (a) Use of the on/off controller; (b) function of the on/off controller with
deadband
external
disturbances
Uc E U Y
technical
Σ GREG
process
-1
controller
It is reasonable to think that the more parameters a complex controller GREG (s)
contains, the more degrees of freedom it has. With help of these parameters that can
be changed at wish, the behaviour of the closed loop transfer function can also be
changed more arbitrarily. In the following it will be illustrated how complex a controller
needs to be in order to achieve the desired performance.
where U F1 is the feedforward part of the control signal and U FB the feedback
part. The controller has two inputs Uc (s ) and Y (s ) and can thus be represented by
the two transfer functions GF1 (s ) and GR (s ) (Figure 6.4).
G FF
Uc E U
Σ G FB Σ
Y
-1
Figure 6.3: A regulator made up by a feedforward loop from the command signal and a
feedback loop from the process output
technical
controller process
Uc UF1 U Y
GF1 Σ G
-UFB
-GR
Since the controller of Equation (6.4) has more coefficients that can be tuned
than the simple controller of Equation (6.3) it is reasonable to assume that the closed
loop system can work better. The transfer function of the total control loop can be
obtained from Figure 6.4:
[G F1( s ) ⋅ U c ( s ) − GR ( s ) ⋅ Y ( s )] ⋅ G( s ) = Y ( s )
This can be simplified as follows:
Y (s ) G F1 ( s ) ⋅ G ( s )
Gc ( s ) = = (6.5)
U c ( s ) 1 + G ( s ) ⋅ GR ( s )
The poles of the feedback system can be changed with the controller GR ( s ) ,
while the feedforward controller G F1( s ) adds new zeros to the system. It follows that
the total system can react quickly to reference value changes if GF1 (s ) is properly
chosen.
178 Chapter 6: Control Structures
technical
controller process
Uc (s) T(s) UF1 U(s) B(s) Y(s)
Σ
R(s) A(s)
-UFB
S(s)
R(s)
Figure 6.5: Controller built with a feedforward and a feedback control part (this controller
corresponds to that of Figure 6.4)
The closed loop transfer function has many degrees of freedom. The coefficients
of the polynomials A and B are fixed by the process design and therefore cannot be
changed. These coefficients could be in part unknown and their estimation might also
be quite difficult. It is not at all a trivial task to obtain an accurate model of the
system! On the other hand, all the parameters in the polynomials R , S and T can
be tuned. The coefficients in T and R belong to the feedforward part of the
controller. The setting of these parameters influences the closed loop system
response to a change of the reference (setpoint) value. Similarly, the S and R
coefficients are related to feedback performance. By tuning S and R the
performance of the controller system can be changed to react after a load change or
some other disturbance that has influenced the output signal y (t ) .
In order to compute the regulator parameters, the transfer function (Equation 6.8)
is usually compared with the desired transfer function G m ( s ) :
Y (s ) B (s )
Gm (s ) = = m
Uc (s ) Am (s )
Am (s ) = A(s ) ⋅ R (s ) + B(s ) ⋅ S (s )
If the order of R , S and T is sufficiently high, i.e. if there are enough „knobs“ to
turn, the closed loop transfer function (Equation 6.9) can be changed within wide
limits. The order n of the controller must be the same as that of the original physical
process. In particular, by changing R and S the denominator of the closed loop
system transfer function can be changed arbitrarily. Theoretically, this means that the
poles of the closed system can be moved to any location of their complex plane
representation. In practice, the maximum amplitude and rate of change of the control
signal limit the extent to which the poles can actually be changed. In Section 3.3.4 it
was shown how the poles determine the type of transient response of the system, so
that its dynamics can be chosen arbitrarily. In particular a physical system that is
instable because of a pole with positive real part can be stabilized by a control
system.
180 Chapter 6: Control Structures
In Section 3.3.4 it was also described how the zeros determine the relative size
of the different terms in the transient response. There is no possibility to change the
values of the zeros. It is however possible to insert new zeros or to remove a zero by
cancellation, i.e. by placing a pole in the same location so that a zero and a pole
would cancel out each other.
The zeros of the numerator in Equation (6.9) are the same as the zeros of the
polynomials T and B . New zeros can be added by the T polynomial. The zeros of
B , however, are fixed and cannot be moved. Only if a pole is placed in the same
location, the zero will be cancelled. Such an operation has to be made with great
caution. For example, if a zero of the polynom B is located in the right half plane (in
what is called a non-minimum phase system), then the pole for the cancellation
must also be placed in the right half plane. The result is an unstable system, but with
the zero exactly chosen to cancel the unstable mode. If the cancellation is not exact
(which it rarely is!) the closed loop system will be truly unstable. (This is an example
that not every theoretically correct mathematical manipulation also leads to the
desired result in practice.) In other words, if the physical system has a zero in the
right half plane, this zero represents a system property that cannot be removed by a
controller. Its influence can however be minimized by appropriate selection of the
control structure.
Non-minimum phase systems are characterized by a behavior that in some
sense goes against expectations, often due to some kind of delay in the answer. An
example of non-minimum phase system is given by the economic life cycle of a
product. In Figure 6.6 is shown the profit curve for a product during its whole life
cycle. In the early phase, before any products are sold, investments and
development costs cause a negative profit. After some time the product – hopefully –
will generate a profit. This property lies in the nature of the thing and cannot be
changed. However, a product manager acting as a very simple controller could just
look at the momentary value of the profit and make the decision to stop the
development right at the beginning because the profit is negative. From this example
it can be seen how some future prediction of the success of the product is necessary
in order to continue the operation. A regulator in control of a non-minimum phase
system requires the same type of feature, as it needs in some way to predict the
future behavior of the system and act accordingly.
The polynomials R( s ) , S( s ) and T ( s ) cannot be chosen arbitrarily. All the
controller transfer functions (see Figure 6.5) must be physically realizable. This
means in practice that the order of the denominator polynomial must be larger than
that of the numerator, i.e. the order of R( s ) has to be larger than that of both S( s )
and T ( s ) , otherwise the controller cannot be physically built. The physical process
itself must be controllable (Section 3.5.1). This means that A( s ) and B( s ) cannot
have any common factors.
6.3: Continuous Controllers 181
1.0
0.5
-0.5
-1.0
0 1 2 3 4 5 6 7 8 9 10
time
Figure 6.6: Profits during the life cycle of a product. At the beginning, development costs
cause a negative profit. Any control action taken on the basis of momentary
values and without consideration of the full curve would probably be incorrect.
There are also other limitations related to how far the controller parameters can
be changed. If the „control knobs“ are turned too much, e.g. by reducing the process
response time by a large factor, then the control signals would probably saturate and
the system would no longer be linear. In other words, since the signal amplitudes are
limited, the closed loop system response cannot be changed arbitrarily.
All types of feedforward are based on some assumptions about the future
behavior of a system and must therefore have so-called predictive capabilities. In
other words, the feedforward controller must contain a model of the technical system
dynamics. How this can be achieved will be shown in the following.
The use of feedforward requires that the load change and/or the disturbances
are measured. In many cases this is however not possible or feasible. If the
disturbance cannot be measured directly, its value must be either estimated or a
different indirect measurement must be used.
The typical aspect of a complex control structure with feedforward from both
disturbance and setpoint change and feedback is shown in Figure 6.7. In principle
the feedforward controller must produce a control signal that will act on the actuator
in such a way so that the disturbance will not influence the process.
The disturbance W ( s ) influences the process via the transfer function GW ( s ) ,
i.e. there is a dynamic relationship between the disturbance and the output Y ( s ) :
Y ( s ) = GW ( s ) ⋅ W ( s )
disturbance feedforward
control sensor W
-GF2 Gt
-UF2
G
W
setpoint feedforward technical
control actuator process
Uc UF1 U Y
G F1 Σ Gv GP Σ
sensor
-UFB
-GR Gm
feedback control
Figure 6.7: Block diagram of the general controller structure with feedforward from the
setpoint, feedforward from a disturbance and feedback control
All the transfer functions on the right hand side of the equation are fixed by the
process design, so that there are no parameters that can be changed. In other
words, the feedforward signal is completely determined by the system model. If the
model is inaccurate, then also the feedforward signal will not be able to completely
cancel out the effect of a disturbance. In practice, however, the feedforward controller
may do a good job, even if the disturbances cannot be cancelled out completely.
In the transfer function of a real physical system the degree of the numerator is
smaller than the degree of the denominator. For GF2 (s ) in Equation (6.10),
however, the numerator usually has a larger order than the denominator. This means
that the disturbance signal has to be differentiated one or more times.
The differentiation of the disturbance value means qualitatively that its slope is
calculated, so that its future value can be extrapolated. The effect of the disturbance
on the technical process can therefore be computed with some precision in advance,
as it has been shown in the earlier examples. Because the precise differentiation of a
continuous signal cannot be done in practice, also feedforward control must be
approximated. In the computer, derivatives can be approximated by finite differences,
so that the control signal to cancel out a disturbance becomes a function of both the
present and the previous values of the disturbance value.
The feedforward part of the control signal can be written in the form:
V (s )
U F 2 ( s ) = - G F 2 ( s ) ⋅ Gt ( s ) ⋅ W ( s ) = - 1 ⋅ W (s )
R3 (s )
where V1( s ) and R 3 ( s ) are the numerator and denominator polynomials of the
feedforward transfer function from the disturbance to the control signal. It should be
noted that in this case the sensor dynamics is considered as part of the sensor.
184 Chapter 6: Control Structures
A controller can be structured in such a way to include both feedforward from the
reference value and from process disturbances and feedback information from the
process output. Since all the partial systems can be considered to be linear, their
6.3: Continuous Controllers 185
signals can simply be added (Section 3.3.3). Referring to Figure 6.7, the control
signal for the physical process U is composed of three terms, the feedforward signal
from the reference value U F1 , the feedforward from the measured disturbance U F2
and the feedback from the output value U FB :
U ( s ) = U F 1 ( s ) - U FB ( s ) - U F 2 ( s )
= GF 1 ( s ) ⋅ U c ( s ) - GR ( s ) ⋅ Gm (s ) ⋅ Y ( s ) - GF 2 ( s ) ⋅ Gt ( s ) ⋅ W ( s )
T1 ( s ) S ( s) V ( s)
= ⋅ U c ( s) - 1 ⋅ Y ( s) - 1 ⋅ W ( s)
R1 ( s) R2 ( s ) R3 ( s )
The transfer functions can also be expressed with a common denominator:
T (s ) S( s ) V (s )
U (s ) = ⋅ Uc ( s ) - ⋅ Y (s ) - ⋅ W (s ) (6.11)
R( s ) R( s ) R( s )
where R (s ) = R1 ⋅ R2 ⋅ R3 , T (s ) = T1 ⋅ R2 ⋅ R3 , S (s ) = S1 ⋅ R1 ⋅ R3 and
V (s ) = V1 ⋅ R1 ⋅ R2 . In analogy to Equation (6.7), this can also be expressed in the
form:
R( s ) ⋅ U( s ) = T ( s ) ⋅ U c ( s ) − S( s ) ⋅ Y ( s ) − V ( s ) ⋅ W ( s )
where V ( s ) is defined by the process dynamics. The transfer function of the
feedback system in Figure 6.7 can be computed in a simple way. Without showing
the argument s , it is obtained:
[GF1 ⋅ Uc − Gm ⋅ GR ⋅ Y − GF 2 ⋅ Gt ⋅ W ] ⋅ Gv ⋅ GP + Gw ⋅ W =Y
The signal W ( s ) was cancelled and does not appear in the transfer function
anymore. For this reason a disturbance w(t ) would not have any influence on the
process output value y (t ) .
There is a similarity with the controller of Equation (6.5). In the equation
presented here the actuator dynamics Gv was modeled in separated components,
so that Gv ⋅ G P corresponds to G in Equation (6.5). Similarly the sensor dynamics
G m is presented here so that G m ⋅ GR corresponds to GR in (6.5).
186 Chapter 6: Control Structures
up
max
slope K
min
0 e
e u
K⋅e
t0 time t0 time
(a) (b) (c)
Figure 6.9: Step response of a continuous PI controller. (a) A stepwise change of the error
value takes place at the time t 0 . (b) The integral part of the controller increases
linearly with time as long as the error remains constant. (c) Symbol of the PI
controller in process diagrams
1
= K ⋅ 1 + + Td ⋅ s E (s ) (6.13)
Ti ⋅ s
1 + Ti ⋅ s + Ti ⋅ Td ⋅ s 2
= K E (s )
Ti ⋅ s
188 Chapter 6: Control Structures
[ ]
Ti ⋅ s (1 + Tf ⋅ s ) dU (s ) = K ⋅ Ti ⋅ s ⋅ (1 + Tf ⋅ s ) + 1 + Tf ⋅ s + Ti ⋅ Td ⋅ s 2 ⋅ E (s )
T 1 1 K
S( s ) = T ( s ) = K ⋅ 1 + d ⋅ s 2 + K ⋅ + ⋅ s +
Tf Tf Ti Ti ⋅ Tf
As already mentioned, a controller like the one of Equation (6.7) can move all
system poles and therefore change the dynamic properties of a closed system. Due
to the fact that the PID controller is a second-order system, it can successfully
change the dynamics of second-order systems as desired.
To be sure, most industrial processes are of higher order than two, but PID
controllers can in most cases still be used successfully also with these processes.
The reason is that many processes, although they actually have a higher order
dynamics, behave approximately like second-order systems. In systems that cannot
be approximated by second-order equations the use of PID controllers is not
appropriate. Examples of such systems are for instance mechanical systems with
several oscillation modi.
controller, that also suggests the symbol often used in process control schemes
(Figure 6.10).
e u
K⋅e
t0 time t0 time
(a) (b) (c)
Figure 6.10: Step response of a PID controller. (a) A stepwise change of the error value
takes place at the time t 0 . (b) The derivative part of the controller is the cause
for the large impulse in the output signal value. (c) Symbol of the PID
controller in process diagrams
In order to avoid the derivative kick in the PID controller, the derivative term can
be computed on the base only of the process output measurement y (t ) . The
derivative of the error is written:
de du c dy
= -
dt dt dt
Changes in the setpoint value are therefore not considered by the derivative part
of the controller. The ideal PID controller then becomes:
1
τ
δy
δu (τ ) = K ⋅ e( τ ) + ∫ e( τ )δτ − Tδ
(6.16)
Ti
0
δτ
The derivative is again approximated by a first-order system with time constant
Tf :
1 Tδ s
δU ( s ) = K ⋅ 1 + ⋅ E(s ) - K ⋅ ⋅ Y (s ) (6.17)
Ti s 1 + Tf s
This method for eliminating the derivative kick has become a standard feature in
most commercial controllers.
δU( s ) 1
GPI ( s ) = = K1 ⋅ 1 +
E( s ) Ti ⋅ s
while a PD controller is represented as follows:
dU( s ) T ⋅s 1 + (Tf + Td ) ⋅ s
GPD ( s ) = = K 2 ⋅ 1 + d = K2 ⋅
E( s ) 1 + Tf ⋅ s 1 + Tf ⋅ s
The PID controller in serial form then becomes:
dU( s ) 1 1 + (Tf + Td ) ⋅ s
GPID ( s ) = = K1 ⋅ K 2 ⋅ 1 + ⋅
E( s ) Ti ⋅ s 1 + Tf ⋅ s
The transformation from the parallel to the series form is possible only if:
Tf << Td << Ti
The controller gain as function of frequency is shown in Figure 6.11. At high
frequencies the gain approaches the value
K1 ⋅ K 2 ⋅ (Tf + Td )
.
Tf
|G |
PID
Figure 6.11: Bode plot of the gain of a PID controller in series form as function of the
frequency
From the graph of Figure 6.11 it appears that the PID controller can be
considered as a combination of a low pass filter in series with a high pass filter (see
Section 5.3). This configuration is also called lead-lag filter.
where Ti is the integral time constant and Ti > T2 > T3 . The value of T3 is
usually selected to be equal to the resonance period (i.e. the inverse of the
resonance frequency) of the physical process to control. The gain as function of
frequency is shown in Figure 6.12.
|G |
PID
Figure 6.12: Bode plot of the PIPI controller gain as function of the frequency
[ ]
u I (kh ) = u I (k - 1)h + K ⋅
h
Ti
⋅ e(kh ) = u I [(k - 1)h ] + K ⋅ α ⋅ e (kh ) (6.22)
u D (t ) = K ⋅ N [ − y (t ) + x D (t )] (6.26)
where
−1
hN Td
β = 1 + = (6.28)
Td Td + hN
194 Chapter 6: Control Structures
Note that the backward difference approximation is numerically stable for all Td .
Using Equation (6.27) together with (6.26) the derivative part of the PID controller
can be expressed as
where
∆y (kh ) = y (kh ) - y [(k - 1) ⋅ h ]
From a computing point of view, the calculations are quite simple. Floating-point
operations in single precision are normally sufficient for these operations. With the
incremental form of the controller there are also no problems due to windup (see
Section 6.5.4). In switching from manual to automatic mode the incremental
controller does not require any initialization of the control signal ( u 0 in the position
form, Equation 6.20). The actuator can be placed in the desired setting during the
start-up of a process under either manual or automatic control.
A minor disadvantage of the incremental form of the algorithm is that the integral
term must be included. The setpoint value is cancelled out in both the proportional
and derivative terms, starting from the second sampling interval following a setpoint
6.5: The Practical Realization of the PID Controller 195
change. Therefore, if the incremental form of the controller is used without the
integral term it is likely that the controlled process will drift away from the setpoint.
controllers. Other rules for the selection of the sampling rate are reported in the
specialized literature.
1.5 y
uc
1.0
0.5
0 u
-0.5
1.5 y
uc
1.0
0.5
0 u
-0.5
1.5
uc
1.0
y
0.5
0 u
-0.5
Figure 6.13: Illustration of integral windup problems for a position servo with PI control.
In Figure (a) is shown the step response in the case without control signal
limitation, so that no windup takes place. The control parameters are K = 0.4,
h*K/Ti = 0.04. In Figure (b) the control signal is limited to 0.1; the parameters
K and Ti are the same as for the first controller; no integral windup prevention
mechanism. In (c) is shown the effect of windup prevention according to
Equation (6.35); the added parameter Tt is = 5.
From this figure also appears clearly the difference between the time-
continuous measurement signals and the discrete control signals of the
regulator.
One way to limit the action of the integral part is by conditional integration.
Basically, when the error is sufficiently large the integral part is not needed in the
formation of the control signal. The proportional part is sufficient for control. The
integral part, that is used to remove stationary errors, is needed for control only when
the error is relatively small. With conditional integration the integral part is considered
in the final sum only if the error value is smaller than a predefined threshold. For
198 Chapter 6: Control Structures
large errors the PI controller acts like a proportional controller. The choice of the
threshold for the activation of the integral term is by far not a trivial matter. In analog
controllers the conditional integration can be realized with a Zener diode. This diode
is coupled in parallel to the capacitor in the feedback loop of the operational amplifier
in the integration part of the controller. With this circuit the contribution from the
integral signal will be limited.
In digital PID controllers there is a better way to avoid integral windup. The
integral part can be adjusted at each sampling time so that the controller output
signal does not exceed its limits. The procedure is straightforward. The desired
control signal u d is first computed with a PI controller algorithm and then it is verified
whether or not the actual controller output u exceeds the defined limits:
u = u min if u d < u min
u = u max if u d ≥ u max
After the limitation of the output signal the integral part in the controller is reset.
An example of PI controller with an anti-windup feature can be described by the
following Pascal code. As long as the control signal remains within the preset limits,
the last statements in the program code will not affect the integral part.
(*initial calculation*)
c1:=K*h/Ti;
...
(*controller*)
…
e:=uc-y;
Ipart:=Ipart+c1*e;
ud :=K*e + Ipart; (*calculation of the desired control signal*)
if (ud < umin) then u:= umin (* limiting function *)
else if (ud < umax) then u := ud
else ud := umax;
Ipart:=u-K*e; (*anti-windup correction of the integral part*)
…
1
t 1
t
u d (t ) = u P + u I = K ⋅ e(t ) + ∫ e(t )dt +
Tt ∫
[u (t ) − u d (t )] dt
Ti
0
0
transfer will take place smoothly. The obvious drawback of this method is that it may
require too long time, depending on the process.
The PID controller in incremental form (Equation 6.30) does not need to be
initialized as described here when its operation mode is changed. The operator sets
the actuator to a position corresponding to the setpoint before switching from manual
to automatic mode. Then the controller does not generate any output signal for the
actuator until there will be an error between setpoint value and process output. It is
often important to store the actual control signal also when the controller in
incremental form is used, as these values might have later to be checked.
In digital PID controllers there is still another way to perform bumpless transfer.
The control algorithm is executed even when the controller is in manual mode. The
process output measurement y is read into the computer and the control error is
calculated, but without the controller output actually influencing the process. In this
way the integral part is constantly updated. If the controller is then switched into
automatic mode, and provided that the setpoint value is equal to the actual process
output, the operation mode transfer will be bumpless.
The main feature in all bumpless transfer procedures is the update of the integral
part of the controller to such a value, that the control signal remains the same
immediately before and after the mode switching.
A further problem arises in case of parameter changes in the PID controller.
Immediately before the change the regulator output signal can be written as follows
(compare with Equation 6.20):
u (t -) = u 0 + u P (t -) + u I (t -) + u D (t -)
and immediately after the parameter change the output is:
u (t +) = u 0 + u P (t +) + u I (t +) + u D (t +)
The change of one or a few parameter will influence all of the regulator terms.
The bumpless transfer from one set of parameters to another will only take place if
the controller output does not change, u (t -) = u (t +) , where t denotes the time for
the parameter change. The value of either the integral part or of the derivative part
must be changed, so that at the transfer time no abrupt change of the controller
output will take place. For example the change of the integral part has the following
form:
u I (t +) = u P (t -) + u I (t -) + u D (t -) - u P (t +) - u D (t +)
A bumpless transfer is achieved if the difference u (t +) - u (t -) is equal to zero.
Uc
Uc E lim 1 UL
Σ
s
UL
-1
time
(a) (b)
Figure 6.14: (a) Circuit for the limitation of the rate-of-change of a signal. In (b) is shown
the typical response to a sudden change of the reference (set-point) value.
The manual control signal that should act as setpoint value u c (t ) is compared
with the allowed control signal u L (t ) . The difference is first limited between the
values uemin and uemax . The resulting value is then integrated, where the integral is
approximated as a finite sum. The algorithm of the rate-of-change limiter can be
written as follows:
…
ue(kh) = uc(kh) -uL(kh);
if (ue < uemin) then uelim:= uemin (* Limiting function *)
else if (ue < uemax) then uelim := ue
else uelim := uemax;
uL(kh) = uL((k-1)h) + h*uelim(kh);
…
where
K ⋅h h
c1 = ; c2 = (6.38)
Ti Tt
The integral term can be computed in advance with forward differences. The
derivative term (Equation 6.29) can be written as:
202 Chapter 6: Control Structures
T
[ [ ]]
u D ( kh ) = β ⋅ u D [ ( k - 1)h ] - K ⋅ d ⋅ (1 - β ) ⋅ y ( kh ) - y ( k - 1)h =
h
T T
= - K ⋅ d ⋅ (1 - β ) y ( kh ) + β ⋅ u D [( k - 1) h ] + K ⋅ d ⋅ (1 - β ) y [( k - 1) h ]
h h
which can also be expressed in the form:
u D (kh ) = - c 3 ⋅ y (kh ) + x[(k - 1)h ] (6.39)
where
T
c 3 = K ⋅ d ⋅ (1 − β ) (6.40)
h
and
T
x[ (k − 1)h ] = β ⋅ u D [ (k − 1)h ] + K ⋅ d ⋅ (1 − β ) ⋅ y [ (k − 1)h ] =
h
= β ⋅ u D [ (k − 1)h ] + c 3 ⋅ y [ (k − 1)h ]
[ ]
= β ⋅ -c 3 ⋅ y (kh ) + x[ (k - 1)h ] + c 3 ⋅ y (kh ) = (6.41)
= β ⋅ x[ (k - 1)h ] + c 3 ⋅ (1 - β ) ⋅ y (kh )
done only when some of the controller parameters K , Ti , Td and Tf are changed.
The control algorithm is executed at each sampling time; the code also contains an
anti-windup feature in the integral term. The core instructions of the PID algorithm
have the following aspect:
A commercial digital PID controller is shown in Figure 6.15. On the front panel of
the controller the reference and the current process output values are displayed. The
pushbuttons allow the simple switching between manual and automatic mode. Other
keys are used for increasing/decreasing the setpoint value and setting other
controller parameters.
Alfa Laval
ECA60 ISP L
t/h
100
90
80
70
100
60
80
50
40 60
30
40
20
20
10
0 0
PV SP OUT
Figure 6.15: An industrial PID controller (courtesy Alfa Laval Automation, Sweden)
PID 20
R.21 ON AUTO
UEXT
R.22 REF
R.23 R.29
FB U
R.68
R.24 HI AO 30
R.25 LO K SW 50
Ti Td
S1
0.2 2.0 0.3
R.59 output
R
S2
PID 40
ON AUTO max min CH
R.41 UEXT
1.0 0.0 4
R.42 REF
R.43 R.49
FB U
R.44 HI
R.45 LO K Ti Td
0.1 3.0 0.4
Figure 6.16: Block diagram symbol of two PID controllers connected to a selection switch
and an analog output unit
6.6: Control Structures Based on PID Controllers 205
The diagram shows two PID controllers connected to a switch. One of the two
regulator outputs is selected via a binary signal to the switch; this output value is then
sent to the analog output unit. The AUTO-input is a binary variable for the selection
between manual and automatic mode. The reference setpoint value is fed to the
input REF and the measurement value from the process output is connected to the
point FB, feedback. The limits for the control signal are marked by the two
parameters HI(gh) and LO(w). The controller tuning parameters K , Ti and Td
(denoting controller gain, integral time constant and derivative time constant) are
displayed below each controller symbol. The analog output circuit is defined by its
channel number and operating range.
In addition to sequential control functions many software packages for industrial
process control also contain programmed controller blocks. Complete blocks for
standard solutions can be contained in program libraries, either ready to be called as
subroutines or in source-code form to be further modified by the user. In addition, the
user may define own blocks with special algorithms. Some of the most common
software packages allow more flexibility than what PID controllers alone can offer. In
this way quite complicated software structures can also be developed at
comparatively little expense.
setpoint value and then generate the appropriate voltage for the correction of the
motor velocity. Such a controller, however, would have to take a large number of
factors in consideration and would therefore be extremely complex and impractical.
A cascade structure for the solution of this control problem is shown in Figure
6.17. The velocity controller GR1 computes an output signal corresponding to the
torque needed to accelerate the motor to the desired speed. The current I ref that
is necessary for the motor to produce this torque is calculated from a mathematical
model of the motor. This model is represented here simply by a gain factor KT ,
which is adequate for d.c. motors.
speed Ω ref
reference
speed
Σ G R1 control
torque T
reference ref
current-torque
KT model
rotor current
-1
Figure 6.17: Block diagram for cascade control of the angular velocity in an electrical
drive system
The inner control loop controls the current needed to produce the torque. The
output of the controller GR2 is the control signal for the power electronics unit to
produce the necessary supply voltage for the motor.
Let us calculate the transfer function from the rotor current setpoint I ref to the
actual rotor current I . The power electronics and the electrical circuitry in the
motor are represented by the transfer functions G A and GM1 respectively (the real
system is actually not linear, but these more simple functions are sufficient for a
qualitative illustration of the principle). The transfer function G I of the inner loop is:
I (s ) GR 2 ⋅ G A ⋅ GM1
GI (s ) = =
I ref (s ) 1 + GR 2 ⋅ G A ⋅ GM1
If the gain of GR2 is large, then the transfer function G I will approach the
value 1 and will therefore become quite insensitive to variations in the transfer
6.6: Control Structures Based on PID Controllers 207
The cascade structure is suitable also for the commissioning (i.e. first startup) of
a control system. The inner control loop is tuned first. Since the inner loop simplifies
the dynamic behavior of the outer loop, also this tuning can be performed more
easily. The inner loop parameters do not need to be changed when the outer loop is
tuned. In some cases, like e.g. the position control of a motor axis, another loop is
added outside the velocity control loop (see Figure 4.32). The tuning of this position
loop can then proceed in the same manner.
In summary, the cascade structure has two distinctive features:
• The output signal of the primary (master) controller serves as a setpoint for the
secondary (slave) controller.
• The two feedback loops are nested, with the secondary loop located inside the
primary control loop. The dynamics of the secondary loop has to be significantly
faster than that of the primary loop.
The windup effect requires special attention in cascade control systems. The
anti-windup for the secondary (internal, slave) controller can be realized as shown in
Section 6.5.4. To avoid integral windup in the primary controller, however, one has to
know when the secondary controller saturates. In some systems, when the
secondary controller saturates the primary controller is set to manual mode. Because
of their different speeds, the control loops can work with different sampling rates,
where the sampling rate for the secondary controller could be much higher than that
of the primary control loop. The program code for the primary regulator will deliver an
updated setpoint value for the secondary controller. The primary (outer) loop
controller can receive its setpoint from the operator or from another program.
One type of selector device delivers as output the highest, or lowest, of two or
more input signals (on instrumentation diagrams the high selector is denoted by HS
and the low selector by LS ). This type of selector can for instance be used to
choose the maximum out of several temperature measurements as input to a
controller or for representation in an alarm display. Another type of selector
calculates the average from several input signals. In this way a temperature could be
not only indicated by one single sensor, but calculated as average from several
signals, thereby increasing the quality and reliability of the measurement.
One example of selective control operation is found in district heating networks.
A control principle is to regulate the speed of the feeder pumps so that the pressure
difference from the pump output to the network periphery is always above a certain
minimum value. The location in the district heating network where at any given time
the pressure difference is lowest is taken as reference for control. Because this point
can shift in space depending on the time and the operating conditions, signals are
collected from several locations in the network periphery. A selector then connects
the pressure sensor that is delivering the lowest differential value to the pump speed
controller.
The use of high or low limits for process variables is another type of selective
control, called override. When a signal reaches any of these limits, the normal
controller operation is turned off and alarm procedures are carried out instead. The
anti-windup feature in controllers is in a certain sense a particular type of override.
y
concentration
1.6
process with
1.4 time delay
1.2 reference
concentration
1
0.8
0.6
0
0 T=3 5 10 15 20 25 30
time
Figure 6.18: PI control of a chemical process with and without time delay (3 time units).
The controller parameters are the same in both cases.
Y (s ) GR ⋅ G P ⋅ e − sT
=
Uc (s ) 1 + GR ⋅ G P ⋅ e − sT
where GR is the regulator transfer function, G P the process transfer function
and e − sT the transfer function of the measurement time delay.
It is difficult to control the system with a simple controller. In the shown
example, the concentration is found to be too low at time t = 0 . The controller then
increases the dosage to correct the concentration. Any change due to the control
action at time t = 0 will not be seen until time t = 3 . Since the controller for t < 3
does not record any change in the concentration value, it further increases the
dosage. The result of the change made at t = 0 is first observed at time t = 3 . If
the gain of the controller is large, the change of the concentration in the meantime
may also become very large. Consequently, the controller will decrease the
dosage, but the result of this change will be observed only at time t = 6 , so that
the control action between t = 3 and t = 6 may further deteriorate.
210 Chapter 6: Control Structures
The difficulty with system delays is that necessary information comes too late
and creates stability problems. The problem of controlling systems with time delays
was solved as early as 1957 by Prof. Otto Smith in Berkeley. He suggested a
controller that includes a model of the system (Figure 6.19). This controller is
consequently called a Smith predictor.
technical
controller process
Uc E U Y
Σ Σ GR e-sT GP
process
model
-1+e- sT GPM
-1
The controller contains a model of both the process and the time delay. The
transfer function of the predictor G PM is a model of the technical system and is not
necessarily the same as the process transfer function G P . If G PM were a perfect
model of the technical process, so to be identical with G P , straightforward
calculations show that the transfer function of the closed loop system would become:
Y (s ) GR ⋅ G P ⋅ e − sT
=
Uc (s ) 1 + GR ⋅ G P
where GR is assumed to be a regular PID controller, G P the process model and
e − sT the time delay. With the Smith predictor, the denominator of the closed loop
system is the same as if the time delay did not exist. In other words, with the
predictor the closed loop system transient response looks exactly the same as
without the time delay, but is delayed by time T .
The controller equation can be written explicitly. Without the predictor, the
control signal is:
U ( s ) = GR ( s ) ⋅ E ( s )
With the predictor we obtain (in the following the argument s will not be shown)
(Figure 6.19):
[
U = GR ⋅ E + GPM ⋅ e − sT ⋅ U − GPM ⋅ U ]
The first term is the normal controller output signal that is computed as function
of the control error. The second term is a correction factor related to a previous
control signal u (t - T ) multiplied with a model G PM of the process. The last term is
based on the actual control signal. It follows from this structure that old control values
6.7: The Performance Limits of PID Controllers 211
have to be stored. The implementation of the predictor was difficult at the time when
Smith suggested the idea, since only analog technology was available and it was
therefore not possible to store analog values for a long time. In a digital computer,
however, storing old values is trivial.
The necessity for storage of old control signals can be understood also from an
intuitive point of view. Again, consider the example of Figure 6.18. If the controller
stores the control signal at time t = 0 and „knows“ that the result will appear only at
a time t = 3 , it is then plausible that u ( 3 ) should be also a function of u ( 0 ) . With a
Smith controller and without changing the controller tuning, the same process as in
Figure 6.18 will perform considerably better. The transient answer of the feedback
system is the same as if there were no time delay; it is only delayed by the time T
(Figure 6.20). The Smith predictor can also be included in a more general discrete
regulator (Section 6.8).
concentration
1.2 reference
concentration
1
0.8
process with time
delay; actual
0.6 concentration
0.4
0.2
0
0 T=3 5 10 15 20 25 30 time
Figure 6.20: Control of chemical dosage with the Smith predictor. The controller parameters
are the same as in Figure 6.18.
If the predictor model reproduces exactly the real technical process, then the
controlled output is identical to that for the process without delay, but with a
time shift. In practice, the predictor model is always approximate to some extent
and consequently also the controlled output may not follow the same envelope
as for a controlled system without delays.
212 Chapter 6: Control Structures
oxygen
transfer rate
Figure 6.21: Typical behavior of the oxygen transfer rate (from gaseous to dissolved
oxygen) as function of the air flow rate
The sensitivity of the term k L a to air flow changes is high for small air flow
rates and decreases if the air flow rate is increased. Consequently the controller
gain needs to be higher for high air flow rates. In addition, the oxygen saturation
represents a further non-linearity. Since both the air flow rate and the dissolved
oxygen concentration can be measured, the process gain for different operating
conditions can be modelled and stored in a table. The controller gain for a
particular operation is then immediately at disposal.
If the value of the process gain is known at different operating points, the
controller parameters can be calculated in advance and stored in a table. This
procedure is called gain-scheduling and is commonly used for many applications,
for example in steam boiler control (the control settings change at different power
levels) or in aircraft control (the aircraft behaves differently depending on the
altitude), etc.
design parameter
calculations estimation
regulator
parameters
technical
reference regulator process
signal controlu output y
signal signal
In the estimation part of the controller the process input and output signals are
continuously measured. From these data, an algorithm for regulator design
computes and updates the controller parameters. In fact the adaptive controller
consists of two control loops: one fast control loop for the actual control function and
a slower loop with the parameter update procedures.
There are several variants of this general scheme. Instead of updating the
process parameters, the controller parameters could be updated directly. Even if the
basic algorithms are quite simple from a programming point of view, an adaptive
control system requires a large safety network of rules to avoid misuse. It is
commonly believed - but is not true - that the adaptive controller solves all difficult
control problems. However, if the adaptive controller is used with caution and
knowledge, it offers wide possibilities for solving complex control tasks. The
controller part of the adaptive controller can be a general discrete controller, as
described in next section. Several types of adaptive controllers are available on the
commercial market.
214 Chapter 6: Control Structures
+ t 0 ⋅ u c ( kh ) + t 1 ⋅ u c [ ( k - 1) h ] + + t n ⋅ u c [ ( k - n ) h ] (6.42)
- s 0 ⋅ y ( kh ) - s1 ⋅ y [ ( k - 1) h ] - - s n ⋅ y [ ( k - n ) h ]
where u is the controller output, u c the reference value and y the process
output. y ( kh ) represents a discrete measurement data sequence delivered by a
sampling unit. The parameters ri , s i and t i must be found in order to reach the
desired regulation performance.
This controller corresponds to the general analog controller of Equation (6.7). In
the same way that an analog controller of order n can change all poles of a system
of the same order, a time-discrete controller can change at will the dynamics of a n -
order discrete system. And again similarly as for the analog controller, also the
general discrete controller can be extended to include a feedforward control
component.
+ t 0 ⋅ u c ( kh ) + t 1 ⋅ q -1 ⋅ u c ( kh ) + + t n ⋅ q - n ⋅ u c ( kh ) (6.43)
- s 0 ⋅ y ( kh ) - s1 ⋅ q -1 ⋅ y ( kh ) - - s n ⋅ q - n ⋅ y ( kh )
6.8: The General Linear Discrete Controller 215
[1 + r1 ⋅ q -1 + + rn ⋅ q - n ] u (kh) =
= [ t 0 + t 1 ⋅ q -1 + + t n ⋅ q - n ] u c (kh ) - [ s 0 + s1 ⋅ q -1 + + s n ⋅ q - n ] y (kh )
With the introduction of the polynomials R , S and T the notation is even more
simplified:
( )
R * q −1 = 1 + r1 ⋅ q −1 + + rn ⋅ q − n
S * (q −1) = s 0 + s1 ⋅ q −1 + + s n ⋅ q − n (6.44)
T * (q −1) = t 0 + t 1 ⋅ q −1 + + t n ⋅ q − n
( )
R(q ) = q n ⋅ R * q −1 = q n + r1 ⋅ q n − 1 + + rn
S(q ) = q n ⋅ S * (q −1 ) = s 0 ⋅ q n + s1 ⋅ q n − 1 + + s n (6.45)
T (q ) = q n ⋅ T * (q −1 ) = t 0 ⋅ q n + t 1 ⋅ q n − 1 + + t n
and also:
T (q ) S(q )
u ( kh ) = ⋅ u c ( kh ) − ⋅ y ( kh ) = u F1( kh ) − u FB ( kh ) (6.47)
R(q ) R(q )
The multiplication with q n simply means that the time argument in Equation
(6.42) is shifted for n sampling periods:
u[ ( k + n ) h ] = - r1 ⋅ u[ ( k + n - 1) h ] - - rn ⋅ u ( kh )
+ t 0 ⋅ u c [ ( k + n ) h ] + t 1 ⋅ u c [ ( k + n - 1) h ] + + t n ⋅ u c ( kh ) -
- s 0 ⋅ y [ ( k + n ) h ] - s1 ⋅ y [ ( k + n - 1) h ] - - s n ⋅ y ( kh )
There is a formal similarity between the Equation (6.47) and the continuous
controller (Equation 6.6). Both controllers contain two terms, the feedforward parts
U F1( s ) and u F1( kh ) and the feedback parts U FB ( s ) and u FB ( kh ) respectively. The
transfer function is T R for the feedforward part and S R for the feedback part.
The process is described with the time-discrete process transfer operator H(q )
(see Section 3.4.2):
y ( kh ) B(q )
= H (q ) =
u ( kh ) A(q )
where the polynomials A and B are defined as:
A(q ) = q n + a1 ⋅ q n − 1 + ... + a n
B(q ) = b 0 ⋅ q n + b1 ⋅ q n − 1 + ... + b n
w(kh)
technical
controller process
u c (kh) T(q) u(kh) B(q) y(kh)
Σ Σ
R(q) A(q)
S(q)
R(q)
Figure 6.23: The general time-discrete controller with feedforward control and feedback
from the process output
With the general controller of Equation (6.46) the input/output relationship for the
total closed loop control system in Figure 6.23 can be expressed as follows:
TB AR
y ( kh ) = ⋅ u c ( kh ) + ⋅ w( kh ) (6.48)
AR + BS AR + BS
In this equation the first term denotes the transfer operator from the setpoint
value to the output y (via the feedforward and feedback loops) and the second term
the transfer operator from the disturbance w also to the output y (via the feedback
loop, compare with the continuous case of Equation 6.9).
The parameters A and B depend on the technical process and are therefore
considered fixed, while the R , S and T parameters can be tuned as in the
continuous case. By changing the R and S parameters the poles of the closed loop
system can be changed arbitrarily, provided that the process is controllable, i.e. that
the polynomials A and B have no common factor. This means among other aspects
that an unstable, but controllable, system can be stabilized with a controller.
We have seen that the poles can be changed arbitrarily in both the continuous
and the discrete cases. The condition, however, is that the control signal amplitude is
not limited. Therefore, in a physical system there is a practical limit how much the
poles can be relocated. The poles determine the modes (i.e. the time constants) of
the system response. The zeros determine the relative weight between these modes.
From Equation (6.48) we see that the B polynomial still remains in the nominator, so
the zeros are not changed. However, by the T polynomial new zeros can be added
in the closed control loop.
6.8: The General Linear Discrete Controller 217
The discrete controller can be extended by a term for the cancellation of any
measured disturbance. The structure presented in Figure 6.7 can be related also to
the time-discrete case (Figure 6.24). Contrary to the continuous case, the variables
are here time functions and not their Laplace transforms. The transfer operator H(q )
indicate the discrete version of the transfer function G( s ) in Figure 6.7.
disturbance feedforward
control sensor w
-HF2 Ht
-u F2
H
w
setpoint feedforward technical
control actuator process
uc T(q) u F1 u y
Σ Hv HP Σ
R(q)
sensor
-u
FB
S(q)
Hm
R(q)
feedback control
Figure 6.24: Block diagram of the general discrete controller. The structure is similar to that
of the general continuous controller (Figure 6.7)
In order to compensate for the effect of the disturbance w on the process output
y , the time discrete controller for feedforward cancellation of disturbances must
have the following form:
H w (q )
H F 2 (q ) =
H t ( q ) ⋅ Hv ( q ) ⋅ H P ( q )
which represents an analogy to equation (6.10). The direct part of the control
signal for feedforward compensation can be expressed as follows:
u F 2 ( kh ) = H F 2 (q ) ⋅ H t (q ) ⋅ w( kh )
disturbance feedforward
control w(kh)
V(q)
R(q)
-uF2 (kh)
-u FB (kh)
S(q)
R(q)
feedback control
Figure 6.25: General digital controller with feedforward control of setpoint and disturbances
6.8: The General Linear Discrete Controller 219
[ ]
R ⋅ u ( kh ) = T ⋅ u c ( kh ) − y ( kh ) = T ⋅ e( kh ) (6.51)
This should be exemplified with the PID controller, and in fact the discrete PID
controller is a special case of the general discrete controller. Another important case
is the compensation for delays; also the Smith controller can be realized in the form
of a general discrete controller.
i.e., R(q ) = 1, s 0 = K , t 0 = K .
A PID controller can be written in the following form:
u (kh ) = - r1 ⋅ u [ (k - 1)h ] - r2 ⋅ u [ (k - 2)h ]
K ⋅α ⋅ q
u I ( kh ) = ⋅ e ( kh )
q −1
In a similar way, the derivative action (Equation 6.29) can be written as follows:
T
u D ( kh ) = β ⋅ q -1u D ( kh ) - K ⋅ d (1 - β ) (1 - q -1) y ( kh )
h
where β is as defined in Equation (6.28). Solving for u D ( kh ) , we get:
T (1 - β )(q - 1)
u D ( kh ) = -K ⋅ d ⋅ ⋅ y ( kh )
h q-β
Since 0 ≤ β < 1 , the system is always stable. Thus the complete PID controller
can be formed from the proportional part (Equation 6.21), the integral and the
derivative parts that have just been calculated:
q T (1 - β )(q - 1)
u (kh ) = K ⋅ 1 + α ⋅ e (kh ) - K ⋅ d ⋅ ⋅ y (kh )
q - 1 h q-β
220 Chapter 6: Control Structures
By eliminating the denominator, the PID controller can also be written in the
following form:
T
(q - 1) (q - β ) ⋅ u ( kh ) = K (q - β ) (q - 1 + αq ) ⋅ e ( kh ) - K ⋅ d (1 - β ) (q - 1) 2 y ( kh )
h
with
e( kh ) = u c ( kh ) − y ( kh )
[q 2 − (1 + β ) ⋅ q + β ] ⋅ u (kh) =
= [ K ⋅ (1 + α ) ⋅ q 2 − K ⋅ (1 + β + αβ ) ⋅ q + K ⋅ β ] ⋅ u c (kh ) −
− [ K ⋅ (1 + α + γ ) ⋅ q 2 − K ⋅ (1 + β + αβ + 2γ ) ⋅ q + K ⋅ ( β + γ )] ⋅ y (kh )
with
Td
γ = (1 − β ) (6.53)
h
TPID (q ) = K ⋅ (1 + α ) ⋅ q 2 − K ⋅ (1 + β + αβ ) ⋅ q + K ⋅ β (6.54)
SPID (q ) = K ⋅ (1 + α + γ ) ⋅ q 2 − K ⋅ (1 + β + αβ + 2γ ) ⋅ q + K ⋅ ( β + γ )
[ ]
- K ⋅ (1+ α + γ ) ⋅ y (k + 2)h + K ⋅ (1+ β + αβ + 2γ ) ⋅ y [( k + 1)h ] - K ⋅ ( β + γ ) ⋅ y (kh )
By shifting the time two sampling intervals backwards, the expression for the PID
controller can be rewritten in the following form:
[
u (kh ) − (1+ β ) ⋅ u[(k − 1)h ] − β ⋅ u (k − 2)h = ]
[
= K ⋅ (1+ α ) ⋅ u c (kh ) − K ⋅ (1+ β + αβ ) ⋅ u c [(k − 1)h ] + K ⋅ β ⋅ u c (k − 2)h − ]
[
− K ⋅ (1+ α + γ ) ⋅ y (kh ) + K ⋅ (1+ β + αβ + 2γ ) ⋅ y [(k − 1)h ] − K ⋅ ( β + γ ) ⋅ y (k − 2)h ]
(6.55)
With regard to computer implementation, it is clear that the controller has to
store old control signals as well as old setpoint and measurement values.
6.8: The General Linear Discrete Controller 221
[ ]
− K ⋅ (1 + α ) ⋅ y (kh ) + K ⋅ y (k − 1)h = (6.56)
1 N
J lq = ∑
N k = 1
[ ]
u c (kh ) − y (kh ) + ρu 2 (kh )
2
If the control signals are large, the quadratic cost function J lq quickly reaches
high values. The control law that minimizes J lq is called a linear quadratic control
law; the related controller can be expressed in the terms of the general controller.
In principle, all the regulators that have been mentioned here, including adaptive
controllers, can be formulated in the general controller form of Equation (6.45). From
a software structure point of view, the general controller remains the same
independently of the chosen control strategy and controller complexity. First a control
strategy and its quality criterion must be selected, and from these the parameters for
the general controller are defined.
TPID (q ) = K ⋅ (1 + α ) ⋅ q 2 − K ⋅ (1 + β + αβ ) ⋅ q + K ⋅ β (=6.54)
SPID (q ) = K ⋅ (1 + α + γ ) ⋅ q 2 − K ⋅ (1 + β + αβ + 2γ ) ⋅ q + K ⋅ ( β + γ )
where
−1
h hN Td Td
α= , β = 1 + = , γ = (1 − β )
Ti Td Td + hN h
(=6.23, 6.28, 6.53)
The parameters for the general discrete controller are computed from the
following polynomials:
r1 = −(1 + β ) r2 = β
s0 = K ⋅ (1 + α + γ ) s1 = −K ⋅ (1 + β + αβ + 2γ ) s 2 = K ⋅ (β + γ )
t 0 = K ⋅ (1 + α ) t1 = −K ⋅ (1 + β + αβ ) t2 = K ⋅ β
( ) ( ) [ ( )]
u d (kh ) = T * q −1 ⋅ u c (kh ) − S * q −1 ⋅ y (kh ) + 1 − R * q −1 ⋅ u (kh ) (6.57)
( ) ( ) ( ) [ ( ) ( )]
A0* q −1 ⋅ u (kh ) = T * q −1 ⋅ u c (kh ) − S * q −1 ⋅ y (kh ) + A0* q −1 − R * q −1 ⋅ u (kh )
A0* (q −1) is a polynomial called observer that defines how fast the integral
windup is corrected. The general controller with a compensation for windup is then
written in the following form:
224 Chapter 6: Control Structures
( ) ( ) ( ) [ ( )
A0* q −1 ⋅ u d (kh ) = T * q −1 ⋅ u c (kh ) − S * q −1 ⋅ y (kh ) + A0* q −1 − R * q −1 ⋅ u (kh )( )]
(6.58)
This can be interpreted as follows:
u d (kh ) = - a01 ⋅ q -1 ⋅ u d (kh ) - - a0 n ⋅ q - n ⋅ u d (kh ) +
where
x[(k - 1)h ] = - r1 ⋅ u[(k - 1)h ] - - rn ⋅ u[(k - n )h ]
[
The value x (k − 1)h ] was computed already before the time kh , so that
processing delays in the computation can be minimized. As soon the control signal
u (kh ) is computed it is also possible to update the value of x . In this way its new
value is already available for the computation of a new control signal at the following
sampling time instance (Figure 6.26).
6.9: The Practical Realization of the General Discrete Controller 225
begin
vect_protect := 1;
The program instructions wait and signal (Section 10.4.1) protect the vectors
R_vect, S_vect, T_vect and V_vect, which as common variables are system
resources. In general, only the controller routine has access to these variables, so
that in practice there should be no processing delays. Should a different process
access the controller coefficients, as is the case to update them, then the controller
routine must wait to avoid conflicts. In multitasking operations the controller task gets
higher priority than the task for parameter update. The variable next_time is used to
avoid timing and synchronization errors (Section 10.6.5).
As already mentioned several times, the polynomial coefficients in the general
controller do not have any immediate relation to the physical properties of a control
loop. In some simple cases, however the relation between the coefficients and the
loop physical properties has apparent meaning.
In a P-type controller all coefficients are equal to zero with the exception of s 0
and t 0 . The number of coefficients s i and t i that are different from zero gives the
order of the discrete equation. A PID controller is of second order, therefore the first
three coefficients in the polynomials R , S and T are non-zero, while all the others
are zero (Equation 6.52). In the feedforward from disturbances to the process some
6.9: The Practical Realization of the General Discrete Controller 227
of the coefficients of the polynomial V are non-zero, the same holds for the
feedforward from the reference signal and the polynomial T .
In the case of the Smith controller for the compensation of time delays in the
technical process the coefficients of the R polynomial vector differ from zero, so that
older control signals are stored a number of intervals that corresponds to the delay
time Tdelay of the process plus the order n of the system.
If the sampling time is changed, then also the dimension of the polynomial
vectors R , S , T and V must be changed, so that the sampled data in course of
time are regularly shifted backwards and are later available for the computation of a
new control signal.
A program for the input of new PID parameters, their conversion in R , S and T
polynomial coefficients and their online update, i.e. without interruption of the
controller operation, can have the aspect indicated here. In the procedure
„parameter_input“ only the local variables are defined. For the other variables hold
the definitions from the program „general_controller“.
procedure parameter_input
(* online input of the controller parameters in PID form
and conversion to parameters for the polynomials R, S and T *)
begin
while true do (* program loop with no end *)
begin
writeln („Please input the following values“);
input „Gain K ?“, K;
input „Integration time Ti ?“, Ti;
input „Derivative time Td ?“, Td;
input „Filter factor N ?“, N; (* Equation 6.15 *)
input „Sampling interval h“, sample_h;
T_vect[2] := K * C_beta;
S_vect[0] := T_vect[0] + K * C_gamma;
S_vect[1] := T_vect[1] - 2 * K * C_gamma;
S_vect[2] := T_vect[2] + K * C_gamma;
signal(vect_protect); (* release of the controller polynomials *)
end; (* while true loop *)
end; (* parameter_input *)
controller
uc u
M Σ technical
process
x
-L
Assuming that all states are measurable and known, the closed loop system with
state feedback is described by the following equation:
x[ (k + 1)h ] = Φ ⋅ x(kh ) + Γ ⋅ [M ⋅ uc (kh ) − L ⋅ x(kh )] =
(6.62)
= (Φ − Γ ⋅ L ) ⋅ x(kh ) + Γ ⋅ M ⋅ uc (kh )
6.11 Summary
Feedback is of fundamental importance in any type of process control. All the
principal related issues are the same for continuous and time-discrete systems. The
structures of the continuous and time-discrete linear controllers are similar and differ
only in the parameter values. From the point of view of the computer implementation,
many different linear controller types can be realized as particular cases of a single
general controller.
A controller to be implemented on a computer can be designed in two different
ways:
• The controller is first designed in continuous form and discretized afterwards; or
230 Chapter 6: Control Structures
The first method was the main approach of this chapter. It has the drawback that
the obtained sampling intervals generally tend to be smaller than if the design were
performed in discrete form directly.
Feedforward is an important concept. This control structure helps to expand and
improve the properties of a controller. For example, in high-performance servos the
reference value can be followed more precisely with a feedforward control design. In
process control it is very important to compensate as early as possible for
measurable disturbances and load changes. In principle the transfer function from
the setpoint to the output value should have a high gain for all relevant frequencies,
while the transfer function from a disturbance to the plant output should have as low
a gain as possible.
The PID controller is the dominating controller structure in industrial process
control. The reason why this controller type is so successful is that a majority of
processes can be approximated by low-order dynamics. The PID controller with its
second order dynamics represents a practical and inexpensive solution, yet allows
wide flexibility in the definition of closed loop performance. A time-discrete version of
the PID controller, that can even be more versatile than the continuous version, has
also been shown. For example, in the discrete controller it is easier to include
features for anti-windup and bumpless transfer, and to obtain adequate filtering for
the derivative action. The control signal and its rate of change can also be easily
limited in the digital controller, if it is necessary. PID controllers can be used in
cascade when several variables interact in complex form.
In systems with more complex dynamic properties, PID controllers are no longer
adequate. The most apparent problems arise in systems with dead times and delays,
with highly oscillatory behavior or with parameters that change in course of time. The
general discrete controller can handle these problems and even satisfy higher
requirements. The code for the general discrete controller can be programmed
straightforwardly; the actual control problem lies rather in finding the necessary
parameters. The general discrete controller can include both feedback from the
process output and feedforward from the reference value and the measurable
disturbances that influence the process.
When the parameter variations in the process are known in advance, it is
possible to use gain-scheduling techniques. Adaptive controllers are in many cases
adequate for the control of processes with unknown parameter variations. If the
system dynamics is of low order, auto-tuning PID controllers can be employed
successfully.
Further Reading
A complete introduction to control theory with particular attention to the state-
space description and digital sampling is given in [Kuo 1995]. Chemical process
control and the application of control structures is discussed in detail in [Seborg /
Edgar / Mellichamp 1989] and [Stephanopoulos 1984]. [Shinskey 1996] describes
process control problems from a more practically-oriented point of view.
Time-discrete control is extensively described in [Åström / Wittenmark 1990] and
in [Franklin / Powell / Workman 1990]. These books contain practical guidelines and
6.11: Summary 231
suggestions for the selection of sampling rates in PID controllers. The controller with
dead-time compensation was first described in [Smith 1957].
Adaptive control has been the focus of extensive research during recent
decades. [Åström / Wittenmark 1995] presents a comprehensive description of the
theory and applications of adaptive controllers. [Åström / Hägglund 1988] is a
practical and well understandable description of the function of autotuners.
7 Combinatorial and Sequencing Control
Overview
Binary combinatorial and sequencing control is the object of this chapter. In the
process industry and in industrial automation there is a wealth of applications of
switching circuits for combinatorial and sequencing control. This type of control was
already mentioned in other sections of this book. For example, simple sequencing
networks were shown in Chapter 2, and in Section 3.7 were discussed some
modeling principles with help of sequencing control. Switching theory, that provides
the foundation for binary control, is used not only in automation technology but is
also of fundamental importance in many other fields. This theory provides the very
principle on which the function of digital computers is based. In general, binary
combinatorial and sequencing control is simpler than conventional feedback (analog
and digital) control, because both the measurement values and the control signals
are binary. However, also binary control has its specific properties that have to be
considered in more detail.
Logical circuits have traditionally been implemented with different techniques;
until the mid of the 1970s most circuits were built with electromechanical relays and
pneumatic components. During the 1970s programmable logical controllers (PLCs)
became more and more commonplace, and today sequencing control is almost
exclusively implemented in software. Despite the change in technology, the symbols
for the description of switching operations, known as ladder diagrams that derive
from earlier relay technology are still used to describe and document sequencing
control operations implemented in software. Another important type of description
language that can be used not only for programming but also as documentation tool
are function charts.
The fundamentals of switching theory and the basic logical gates are presented
in Section 7.1. Ladder diagrams as a means for description of combinatorial and
sequencing control operations are discussed in Section 7.2. Section 7.3 is dedicated
to the use and technology of PLCs. In Section 7.4 are introduced function languages
and function charts, as they provide an important notation to describe binary
sequences. Function languages and function charts can also be used for the
description of concurrent (i.e. parallel) processes. The chapter is concluded with a
practical example about the application of function charts in the solution of an
industrial control problem.
232
7.1: Elementary Switching Theory 233
Switching theory provides a model for the operations of binary elements, i.e.
those that can be only in one of two possible states. There are several examples of
binary components. Binary circuit components like switches, relays and two-position
valves to be used in logic circuits are designed to operate in two states only. A
transistor is a linear, i.e. not binary, component, but it can also operate as a binary
element, if only the states „conducting“ and „not conducting“ are considered. Binary
sensors and actuators have been described in Chapter 4.
The state of a binary element is indicated by a binary variable that can
consequently only take two values, conventionally indicated as „0 “or „1“. For a
switch contact, relay contact or a transistor (in the following all labeled X) the
statement X=0 means that the element is open (does not conduct current) and X=1
means closed (it conducts a current). For a push button or a limit switch, X=0 means
that the switch is not being actuated, while X=1 indicates actuation.
A binary variable can also correspond to a voltage level in a practical circuit
implementation. In the so-called „positive logic“ the higher voltage level corresponds
to a logical „1“ and the lower level to logical „0“. In TTL (transistor-transistor logic),
binary „0“ is usually defined by a voltage level between 0 and 0.8 V and binary „1“ by
any voltage higher than 2 V. Similarly, in pneumatic systems X=0 may mean that a
line is at atmospheric pressure and X=1 that the line is at higher pressure.
For the representation of logic (combinatorial and/or sequencing) circuits are
used standardized symbols that are independent of the practical implementation
(with electric or pneumatic components). This type of representation is called
function block. In this chapter are used for the logic symbols the international
standards IEC 113-7 and IEC 617; many other national standards are also defined
on their basis.
I O
I 1 O
0 1
1 0
Figure 7.1: Logic symbol and function table (truth table) for the NOT function (inversion,
negation)
I1
I1 I2 O
I1
≥1
1 O O 0 0 0
I2 0 1 1
I2 1 0 1
1 1 1
Figure 7.2: Switch connection, logic symbol and function table (truth table) for the OR
function
Output 11111101
If the two normally open switch contacts A and B are connected in series, the
operation is called Boolean multiplication and the function is an AND operation. In
this case the output is X=1 only if both A and B are equal to 1, otherwise X=0. The
operation is expressed as follows:
X = A·B
The multiplication sign in the Boolean expression is often omitted, just as in
ordinary algebra. Similarly as for the OR function, also the AND gate can have more
than two inputs, since any number of switches can be connected in series. Adding a
third switch results thus in X=ABC. The logic symbol and the function table for the
AND gate are shown in Figure 7.4.
7.1: Elementary Switching Theory 235
I1 I2 I1 I2 O
I1
&
1 O O 0 0 0
0 1 0
I2 1 0 0
1 1 1
Figure 7.4: Switch connection, logic symbol and function table (truth table) for the AND
function
Also the logical AND operation between two bytes is carried out on each pair of
bytes and also this function is called masking (Figure 7.5). One byte is given as input
while the other is used to select the bits of interest. Only where the masking byte
contains „1“s the original bit of the input byte is passed to the output, otherwise the
corresponding bit takes the value „0“.
Output 01001000
Some important theorems hold for Boolean functions of a single binary variable,
such as for example:
X+X= X
X⋅X=X
X + X =1
X⋅ X=0
The theorems indicated above can be used for simplifying complex binary
expressions, which in turn can help save some components in the practical
implementation. Another advantage in reducing the complexity of a circuit is that it
becomes less sensitive for malfunctions, because the number of components that
could fail is smaller.
This shows that the NOR gate can be constructed from the combination of an
OR and a NOT gate (Figure 7.6); the circle at an input or output line of the symbol
represents Boolean inversion.
I1 I2 I1 I2 O
I1
≥1
1 O O 0 0 1
0 1 0
I2 1 0 0
1 1 0
Figure 7.6: Switch connection, logic symbol and function table (truth table) for the NOR
function
X = A + B = A ⋅B = A ⋅B
A ≥1
0 A
≥1
O
B ≥1
0 B
The related circuit does not conduct if both A and B are actuated; if only one
switch is actuated the circuit remains closed via the other switch (Figure 7.8).
Similarly to the NOR gate, also the NAND gate is universal, i.e. with this gate all the
other logical functions can be realized.
I1
I1 I2 O
I1
&
1 O O 0 0 1
I2 0 1 1
I2 1 0 1
1 1 0
Figure 7.8: Switch connection, logic symbol and function table (truth table) for the NAND
function
The NAND and NOR operations are called complete operations, because all
other logical functions can be formulated by using - if one so wishes - exclusively
either of those types of gates. No other gate or operation has the same property.
In Figure 7.9 is shown a circuit built with two switches, each with double contacts
(one contact is normally open and the other normally closed). This function is called
exclusive OR (XOR), and its output is defined by:
X = A ⋅ B + A ⋅B
I1 I2
I1 I2 O
I1
=1
1 O O 0 0 0
0 1 1
I2 1 0 1
1 1 0
Figure 7.9: Switch connection, logic symbol and function table (truth table) for the XOR
function
The circuit conducts a current only if either A=1 or B=1, but if both A and B have
the same value „0“ or „1“, then the output is X=0. For example, such a logical circuit
can be used to control the light in a room from two different switch locations A and B.
In digital computers XOR circuits are important for performing binary addition.
An exclusive OR (XOR) operation between one input byte and one masking byte
will copy the „1“s of the input to the output only in correspondence to those bits
238 Chapter 7: Combinatorial and Sequencing Control
where the masking byte contains „0“. Where the mask bit is „1“, the bit of the first
operand is inverted. In other words, in the positions where the operand bits are equal
the result is „0“, while in those cases where the operands are not equal, the result is
a „1“ (Figure 7.10). This operation can be used to check whether two bytes are
equal; the XOR operation of a byte with itself must namely produce a „0“ in output.
Output 10110101
& O4 ≥1
I2
O2
I1
NOT I 1 O I O
O=I
I1 I1
OR ≥1 O O O = I1 + I 2
I2 I2
I1 I1
AND & O O O = I1⋅ I 2
I2 I2
I1 I1
NOR ≥1 O O O = I1 + I 2
I2 I2
I1 I1
NAND & O O O = I1⋅ I 2
I2 I2
I1 I1
XOR =1 O O O = I1⋅ I 2 + I1⋅ I 2
I2 I2
I I
Lock & O O O = I1⋅ I 2 ⋅ S
7.1.4 Flip-flops
Hitherto we have described combinatorial networks, i.e. where the output X
depends only on the present combination of input signals. Combinatorial networks
have so to say no memory and represent static systems. In a sequencing network
instead it is possible to store signal values and states and to use them later in the
course of another operation. The memory function can be realized with flip-flop
240 Chapter 7: Combinatorial and Sequencing Control
elements, or bistable switches. The flip-flop has two stable output states (from which
the term bistable) that depend not only on the present state of the inputs but also on
the previous state of the flip-flop output.
The basic type of flip-flop is the SR (Set-Reset) flip-flop. The two inputs S and R
can be either logical 0 or 1, they are however not allowed to be both 0 or 1 at the
same time. The output is called y, and usually also the inverted output y is available
on integrated circuits. If S=1, the output changes to y=1 ( y = 0) and the flip-flop
becomes set. If S returns to 0 then the flip-flop „remembers“ that S had previously
taken the value 1 and keeps the output y=1. If R now takes the value 1, and
assuming that S=0, the flip-flop is reset, and y=0 ( y =1). Similarly as before, R can
return to 0 and y remains 0 until a new signal S=1 is given. If the states at
consecutive times are denoted y n and y n+1, the operation can be written as:
y n + 1.= R ⋅ (S + y n )
A SR flip-flop can be realized by two logical elements (Figure 7.13).
R
≥1 Y
≥1
S
& Y
R
≥1 Y
S
S
≥1 Y
R
&
S Y
R Y
Figure 7.13: Three different realizations of a flip-flop gate; IEC symbol for the flip-flop
circuit
There are other important types of flip-flop circuits. The delay (D) flip-flop or latch
has two inputs, one for data (D) and one for clock pulses (CP). For each clock pulse
the output y takes the value that the D input had before the clock pulse. The D input
is therefore delayed by one clock pulse in the output. The new state y n+1 is always
independent of the old state.
By introducing a feedback with a time delay from the flip-flop output to the input,
the resulting circuit is a trigger or toggle (T) flip-flop. The T flip-flop has only one
input, T. For each new input pulse on the port T, the output y changes to the other
state. The T flip-flop is often used in counting and timing circuits as a frequency
divider.
All three types of flip-flops are integrated in the JK (Master-Slave) flip-flop, with J
being the set signal and K the reset signal. This flip-flop has also an input for a timing
7.1: Elementary Switching Theory 241
(clock) signal. Depending on the input signals the JK flip-flop can operate like a SR
flip-flop, a latch or a trigger and represents therefore a kind of universal flip-flop
circuit.
I I I I
1 2 3 4
1 1 1 1 Input buffer with inversion
OR matrix
&
&
&
&
&
&
&
&
AND matrix
≥1 ≥1 ≥1 ≥1
O O O O
1 2 3 4
(a)
(b)
(c)
Figure 7.16: Symbols for (a) a normally open contact, (b) a normally closed contact and (c) a
relay coil in the ladder diagram
I1 I12 O3
Relais
I2 O2 O4 outputs
I1 O2
O4
Figure 7.17: The combinatorial circuit of Figure 7.11 in form of ladder diagram
The input switch contacts have usually negligible resistance and can be for
instance pushbuttons, limit switches, pressure or temperature sensors. The output
element (the ring) could be any resistive load (e.g. a relay coil) or a lamp, motor or
any other device that can be electrically actuated. Each „rung“ of the ladder diagram
must contain at least one output element, otherwise a short circuit between power
supply and ground would take place.
7.2: Representation of Logical Functions with Help of Ladder Diagrams 245
S R Y
Step 1 :
condition last step step 2 step 1
step 1
(self-holding)
Start
Step n :
step n
(self-holding)
In practical execution, Step 1 is initiated with a start button or, in case of a closed
execution loop, automatically after execution of the last step. When the last step is
active and the condition for the jump to the first step is satisfied, then the Step 1 coil
is activated, and the self-holding relay keeps it set also after the first condition no
longer holds. The output of the first step activates also the input contact „Step 1“ that
is connected in series with the contact for the condition for Step 2. As soon as this
condition is satisfied, the relay Step 2 latches Circuit 2 and at the same time opens
the Circuit for Step 1. The following steps are carried out in the same fashion.
Obviously, in order to ensure a repetitive sequence, the last step has to be
connected to Step 1 again.
This type of execution is called asynchronous. In switching theory is also
considered the synchronous execution, in which the state changes are controlled by
a time clock. An asynchronous system is thus known as event-based, while a
synchronous system is time-based. In industrial automation applications,
asynchronous control is much more common, since the operation of most machines
and equipment (and thus their state changes) depends rather on a set of conditions
than on a stiff time plan. In the design of control sequences it is also important to
consider that the conditional input signals must keep their logical level for the full
duration of the corresponding operation. If this is not the case, then it must be
provided for their buffering or intermediate storage.
7.3: Programmable Logic Controllers (PLC) 247
PWR
NC A1 A1
INPUT Alfa Laval NC A2 A2
NC A3 A3
NC A4 A4
00 00 40 40
Transistor outputs 41
01 01 12-48V 0.8A 41
02 02 42 42
03 03 43 43
04 04 44 44
05 05 45 45
06 06 46 46
07 07 47 47
08 08 C + (C40-47) 48 48
09 09 0V(00-07) 0V (C40-47) 49 49
10 10 50 50
11 11 51 51
12 12 52 52
13 13 53 53
14 14 54 54
15 15 55 55
16 16 56 56
17 17 57 57
18 18 C + (C50-57) 58 58
19 19 0V(10-17) 0V (C50-57) 59 59
20 20 60 60
21 21 61 61
22 22 62 62
23 23 63 63
24 24 64 64
25 25 65 65
26 26 66 66
27 27 67 67
28 28 C + (C60-67) 68 68
SD24D
29 29 0V(20-27) SattCon05-Slimline 0V (C60-67) 69 69
OUTPUT
Figure 7.20: Example of compact PLC for industrial use. The I/O cables are connected
directly to the unit (courtesy Alfa Laval Automation, Sweden).
00 Program 20
01 memory 21
02 22
03 23
04 24
05 25
06 26
07 27
Processor
10 30
11 31
12 32
13 33
14 34
15 35
16 Data 36
memory
17 37
Figure 7.21: Basic structure of a Programmable Logic Controller (the figures indicate
different input and output channels)
ld, ldi Loading of a value from one input port into the accumulator,
direct (ld) or inverted (ldi)
and, ani AND or inverted AND instruction between the value in the
accumulator and the value of a input channel; the result is stored in the accumulator
or, ori An OR or inverted OR instruction between the value in the
accumulator and the value of a input channel; the result is stored in the accumulator
out The content of the accumulator is copied to the output port and
controls the output signals. The value is retained also in the accumulator so that it
can be further processed or sent to other output ports.
Example 7.4 PLC Programming with ladder diagram and instruction list
The logical control instructions for the PLC can be expressed in form of a
ladder diagram as well as with an instruction list (Figure 7.22). The gate y11 is
used to give memory capability to the relay A11 (self-holding capability).
Figure 7.22: PLC control instructions in form of ladder diagram and as instruction list
Example 7.5 Using a ladder diagram and the PLC-internal stack memory
(1)
In Figure 7.23 is shown a ladder diagram. The related operations can also be
coded with the following program instructions:
I1 I2 O1
I3 I4
Figure 7.23: Example of the use of a stack memory in form of a ladder diagram
Example 7.6 Using function blocks and the PLC-internal stack memory
(2)
In Figure 7.24 is represented a logical circuit in form of function block. Also in
this case the corresponding operations can be described in form of an instruction
list:
ld x1 The value from channel 1 is read into the accumulator (main
register, A)
and x2 The result of the AND operation is stored in A
ld x3 The content of A is stored on the stack. The value from channel 3 is
read into A.
and x4 AND-operation of the values from channel 3 and 4; the result is
stored in A
ld x5 The content of A is stored on the stack. The value from channel 5 is
read into A.
and x6 AND-operation of the values from channel 5 and 6; the result is
stored in A
orb OR operation between the accumulator A and the last value stored
on the stack. The result remains in the accumulator A, while the
temporary element of the stack is eliminated.
anb Operates on the last element in the stack (i.e. the result of the AND
operation between the inputs of channel 1 and 2) and the content of
the accumulator A. The result is stored in A. The last element of the
stack is removed.
out Y1 Output of the value in A on Channel 1
252 Chapter 7: Combinatorial and Sequencing Control
I1 &
I2
I3 & &
O1
I4
≥1
I5 &
I6
demand for high-level language programming becomes more and more important as
the complexity of the PLC operations increase.
The new standard IEC 1131-3 (earlier called IEC 65A (SEC) 67) defines five
language possibilities for PLC programming:
• Instruction List (IL)
• Function Block Diagram (FBD)
• Ladder Diagram (LD)
• Sequential Function Chart (SFC)
• In addition the language type „Structured Text“, with a syntax similar to that of
the programming language Pascal has been defined.
The structured text and the instruction list represent algorithmic formulations in
clear text. The function block diagram, the ladder diagram and the sequential
function chart are instead graphical representations of the function and the structure
of logical circuits. The international standard IEC 1131-3 should therefore guarantee
a wide application spectrum for PLC programming.
The function diagram is correspondingly divided in two parts (Figure 7.25). The
„sequence“ part describes the order between the major control steps (left part of
Figure 7.25, with the five boxes). The sequence part does not describe the internals
of the actions to be executed. These are described by the „object“ or „control“ part of
the diagram that consists of the boxes to the right of the sequence steps. Every
254 Chapter 7: Combinatorial and Sequencing Control
Function Comment
1 Tank empty
4 Heater off
Wait time = „time out“ The waiting time is „time out“
Figure 7.25: Function chart for the control of a batch tank process
7.4: PLC Programming with Help of Function Charts 255
The use of function charts will be illustrated with the example of control of a
batch process (Figure 7.25). A tank is to be filled with a liquid. When the tank is full,
its content must be heated up to a predefined temperature. After a specified time the
tank is then emptied, and the process starts all over again.
The indication „Empty“ signals that the tank is empty and can be filled again.
This indication is connected to the „Start“ signal, so that the sequence can be
initiated. In Step 2 the bottom valve of the tank is closed and the filling pump is
activated. The indication „Full“ signals when the highest level has been reached. The
program flow proceeds with Step 3 (transition), so that the pump is switched off and
the heater turned on. The heater remains active until the preset temperature has
been reached (indication „Temp“). At this point there is a jump to Step 4. The heater
is then switched off and a timer starts counting. When the waiting time has elapsed
(„time_out“) there is a transition to Step 5, where a command is given to open the
outlet valve. The full sequence can then be repeated from the beginning.
In the function charts syntax a step at any given time can be either active or
inactive. „Active“ means that this step is currently being executed. The initial step is
represented in the function chart by a double-framed box. An „action“ is a description
of the commands that have to be executed at each step. A logical condition can be
associated with a step, so that the related commands are executed only when the
step is active and the condition is fulfilled. The association with a condition
represents therefore a security control.
Several commands can be associated with a step. These commands can be
simple controls but also represent more complex functions like timer, counters,
regulators, filtering procedures or commands for the external communication. As we
have already seen, in the function chart there is also a function for transition, i.e. a
kind of obstacle between two steps to which only a new active step can follow. After
a transition a new step becomes active and the earlier one inactive. The transition is
controlled by a logical condition and takes place only when the condition is satisfied.
The function chart syntax allows much more than just the iterative execution of
the same control instructions. The three functional blocks initial step, step(s) and
transitions can be interconnected in many different ways, thus allowing the
description of a large number of complex functions.
Three types of combinations are possible:
• simple sequences
• execution branching (alternative parallel sequence)
• execution splitting (simultaneous parallel sequence)
In the simple sequence there is only one transition after a step and only one step
after a transition. No branching takes place. In the alternative parallel sequence
(Figure 7.26) there are two or more transitions after one step. In this way the
execution flow can take alternative ways depending on external conditions. Often this
is an if-then-else condition and is useful to describe e.g. alarm situations.
In the alternative parallel sequence it is very important to verify that the condition
for the selection of one of the program execution branches is consistent and
unambiguous; in other words the alternative branches should not be allowed to start
simultaneously. Each branch of an alternative parallel sequence must always start
and end with logical conditions for a transition.
256 Chapter 7: Combinatorial and Sequencing Control
if...then else
6 8
7 9
10
Figure 7.26: Alternative parallel paths. Selection of one out of two alternative execution
paths; only one of the paths is executed.
In the simultaneous parallel sequence (Figure 7.27) two or more steps are
foreseen after a transition, and these steps can be simultaneously active. The
simultaneous parallel sequence represents therefore the concurrent (parallel)
execution of several actions.
The double horizontal lines indicate the parallel processing. When the condition
for the transition is satisfied, both branches become simultaneously active and are
executed separately and concurrently. The transition to the step below the lower
double horizontal line can take place only after the execution of all concurrent
processes is terminated. This corresponds to the simultaneous execution of control
instructions and is comparable with the notation cobegin-coend (Section 10.1.3).
The three types of sequence processing can be also used together, only one
should act carefully in order to avoid potential conflicts. For example, if two branches
of an alternative execution sequence are terminated with the graphic symbol for the
end of parallel execution (the two horizontal bars) then the further execution is
locked, since the computer waits for both branches to terminate their execution,
while only one branch was started because of the alternative condition. Also the
opposite error is possible. If parallel branches that have to be executed
simultaneously are terminated with an alternative ending (one horizontal bar), then
many different steps may remain active, so that further process execution might no
longer take place in a controlled way.
7.4: PLC Programming with Help of Function Charts 257
11
12 14
13 15
16
Figure 7.27: Simultaneous parallel paths. Begin of two time concurrent execution paths. This
function is similar to the instruction cobegin...coend (see Figure 10.3).
Buffer Robot
Machine 3
Machine 1
Machine 2
At the cell level are not considered the specific control loops of the machines or
of the robot; they are handled by separate control systems. The focus lies instead on
the coordination of their operations. A cell computer sends control signals to the
machines; its task is the control of the operations of each machine and of the robot
and the synchronization of the activity of the machines and the robot. The control
task is a combination of sequencing control and real-time synchronization of the kind
described in Chapter 10. Here it will be shown how these operations can be
expressed in function chart form. The actual implementation of the function chart
operation is left to the process computer and its compiler.
The part to be processed must be handled in the three machines in a predefined
order, like on an assembly line. The task of the robot is to deliver new parts to each
machine and to move semi-processed parts between the machines.
The synchronization of the machines is done by a „scheduler“ graph with the
structure shown in Figure 7.29.
Scheduler
The scheduler communicates with each machine and with the robot and
determines when they can start their operation or when the robot must move a part.
The function of the scheduler is similar to that of the scheduler in a real-time
operating system (Chapter 10), although they are actually different things. Also the
scheduler for the manufacturing cell operation must divide a common resource, in
this case the robot, as efficiently as possible among the machines in the cell. The
scheduler must guarantee that the robot does not block any operations. If for
example the robot has picked up a finished part from a machine and has nowhere to
place it, then the operation of the cell will stop. Consequently, the scheduler has to
match the requests from the machines with the available resources (robot and buffer
capacity).
The scheduler graph for the control of the manufacturing cell contains different
parallel branches, one for each machine, for the robot and for the buffer. Since all
the devices are operating simultaneously, the scheduler has to control all of them
concurrently by exchanging synchronization signals of the type „Start“ and „Ready“.
When a machine receives a start command from the scheduler, it must perform the
task described in its function chart. When the machine has terminated the execution,
it sends a „Ready“ signal to the scheduler.
In Figure 7.29 it is shown that no machine communicates directly with the robot.
Instead all the communication signals are transmitted via the scheduler. The signals
operate as conditions for transition in each branch of the function chart. By
structuring the function chart in this way, it is possible for example to add new
260 Chapter 7: Combinatorial and Sequencing Control
machines to the cell without having to reprogram any of the sequences of the other
machines. Only the control sequence for the robot has to be modified with the
operations required to serve the new machine.
A good function chart implementation supports the hierarchical structuring of the
control problem. The total operation for the manufacturing cell consists in the
operations for the control of the single machines, and also these operations can be
divided again in more detailed parts.
The sequencing control for each machine can be defined in a separate function
chart. The sequence for the drill is indicated for example in Figure 7.30.
21 Drill in up position
Drill at work piece & NOT max time Drill at work piece & max time
Figure 7.30: Beginning of the function chart sequence for the drill
The start_drill condition is a global variable and represents a signal from the
scheduler. If the drill has not acknowledged the start order within the time tim_1, then
an alarm is activated and the graph is directed into an alternative parallel branch.
Likewise, if the drill has not reached the workpiece within a given time another alarm
is activated. The graph for the individual drill machine may seem to be lengthy, but it
7.5: Summary 261
7.5 Summary
Binary control is a fundamental part of many automation applications. It is based
on switching theory. An important practical aspect demonstrated by this theory is that
with few fundamental gates (NOR, NAND) all other combinatorial networks can be
realized.
There are two classes of sequencing systems, combinatorial and sequencing
networks. Combinatorial networks have no memory and the output is a logical
function of the current input values. Sequencing networks instead have memory
capabilities, so that it is possible to carry out a sequence of steps in time. The control
of the sequence execution can be either synchronous or asynchronous. In most
industrial automation applications, the control systems operate asynchronously, i.e.
the execution flow is controlled by external events and conditions and not by periodic
clock signals.
Logic elements can be realized with different technologies: hard-wired
components, integrated circuits, programmable array logic (PAL) or in software by
programming process computers or programmable logic computers (PLC). PALs and
PLCs are gaining more and more importance for the implementation of logical
networks or control sequences.
The description of a sequencing network can be done with either logical circuit
drawings at gate level or ladder diagrams. However, these methods are not suited for
the representation of complex control sequences, so that for the structured
description of complex systems should be used more powerful tools. A good
description language must allow for the hierarchical structuring of the code. In this
chapter has been used the function chart description according to the IEC 848
standard in order to demonstrate some principles in sequencing control.
Further Reading
Switching theory is described in numerous specialized textbooks; [Lee 1978] and
[Fletcher 1980] are suitable introductions to the subject. [Pessen 1989] contains a
good overview of sensors, actuators and switching elements in both electric and
262 Chapter 7: Combinatorial and Sequencing Control
Aim: To present bus systems as open computer architectures, define their basic
operations and describe some current types in order to provide the necessary
background to evaluate, select and configure bus applications
Overview
Bus systems are in common use in automation applications; they allow the
selection of the optimal hardware combination for any given control task. The
approach to the study and the application of bus systems is quite different than to
usual computer systems. In the latter, the central processing unit is at the center of
the design and of the operations. In bus systems, the way the data is exchanged, i.e.
the bus itself, is in the center and the internal processing details for the single boards
connected to the bus bear less importance.
About a dozen or so of bus systems are commonly used in industrial
applications. These buses cannot be compared with each other directly without
qualifications as each bus reflects the technology and expectations of the time it was
designed. A few designs are proprietary of some company, others are supported by
standardization organizations and open for everybody to use. The importance of
having few bus architectures, independent of a specific processor model and under
the control not of a particular manufacturer but of recognized standards
organizations is generally agreed upon.
This chapter begins with a general background introduction to the bus concept
and operations (Section 8.1). Bus operations are described in more detail in Section
8.2, in which some practical indications about the construction of bus systems are
also included. The most important bus types in industrial automation are the VMEbus
and PCI; in particular a more in-depth description of VMEbus (Section 8.3) has been
included as reference and as extension of the general bus description in the earlier
section. This material is principally of interest when actually using this type of bus
and may be omitted without loss of continuity. Finally, in Section 8.4 is presented a
brief overview over other important bus systems, such as EISA, PCI and others.
1 Original equipment manufacturers, companies that build complete system applications, e.g. test
units, using basic components delivered by other manufacturers.
263
264 Chapter 8: Bus Systems
Other manufacturers followed later the example of the company DEC with its
PDP computers and defined new bus standards. The possibility of selecting and
configuring the most appropriate hardware for control applications was instrumental
in the success of bus systems.
To appreciate the innovation brought by open bus systems, one should begin by
taking a look at the basic computer structure. A computer system is normally built
around a central processing unit (CPU) to which are connected peripheral units to
perform different functions: keyboard, video interface, disk driver and input/output
(I/O) boards (Figure 8.1). In this configuration, the peripheral units may communicate
directly only with the CPU and only one peripheral unit at a time may be active
exchanging data.
printer
design where the peripheral units have added computing capacity and are more
independent from each other is generally more effective.
bus
office. In practice this means that PC technology may be used in many cases also for
industrial control application, often at sensible cost advantages, but it must be kept in
mind that it was not optimized and thought for that purpose. Strange as it might
seem, today the industrial market can hardly compete with the home and office PC
user market (there is still more money to be made with videogames and multimedia
than with process control).
The first buses were designed around specific processors and their lines were
basically extensions of the processors’ pins, appropriately buffered in order to
increase their power output. The CPU controlled directly data exchange operations
and timing. More modern buses are instead designed to be processor independent:
their data and address formats and their communication protocols, i.e. particular sets
of rules to on how data exchange must take place, do not depend on a particular
processor architecture. In order to modify a system it is not necessary to explicitly
design it anew, but it is sufficient to change or add components with the new desired
functionality, provided the new components follow the same protocol as the rest of
the system. The design of any subsystem interface is not made toward other system
components but toward its electrical interface and its protocol. This concept will be
illustrated in this and the following chapters.
In defining a new bus standard, there is much compromising on the physical
dimension of the circuit boards. The dimension of the card implicitly defines the
amount of logic circuitry that will fit on it. Thanks to the integrated circuits able to
execute more and more functions with smaller components, the size of function
boards for industrial applications has progressively been reduced down to typical
board dimensions of about 15x30 cm. Larger boards may contain more functions,
but they will also be more expensive. Smaller boards facilitate the selection of the
right mix for a specific application and will be cheaper, but will use up slot space
faster; in addition they will load the bus with more frequent data transfer requests. As
CPU power is becoming more affordable, it is economically feasible to build
intelligent boards each with its own dedicated processor and local memory. The bus
structure represents therefore a rational and modular frame for the joint operation of
different CPUs and peripherals.
Buses support modularity, which in turn gives greater flexibility for new
applications. This is a key feature, especially when considering how often partial
changes are required during the development of a new design. A bus allows
resource sharing: several independent processors might, for instance, use the same
memory or other units such as disks or printers. In this way a system is used more
efficiently and its operation becomes therefore more economic.
In the theory of bus operation, data communication, operating systems and
distributed system operations there are a few common basic concepts. Particularly
important is resource protection: the resource can be thought in a wide sense, as a
computer bus, CPU time, occupation of a communication channel, a variable in
memory, etc. The methods to solve the problem of resource protection present
notable similarities. The fundamental problem will be examined in detail in Section
10.3.1, while in the present Chapter are presented those issues directly related to the
technology and operation of parallel bus systems.
8.2: Bus Structure and Operation 267
It is not possible to compare different bus systems only in the light of these
parameters. A bus is a system solution and its analysis makes sense only if its many
aspects are considered together.
The most important parameters to describe a bus are the address and data
width and the data transfer rate. The latter is usually given in MByte/s and shows
the maximum rate, that is the physical limit of a bus operating under extreme
conditions. The actual data transfer rate, or throughput, of a system may be much
lower, as it depends on many other factors. It must be considered under which
assumptions the given figures are valid. A high data transfer rate could be a „burst
rate“, reached using special test programs under particular conditions, while in
normal operation fetching single data items could turn out to be much slower.
268 Chapter 8: Bus Systems
When the data transfer rate is indicated in words it must be considered that the
word does not have a fixed length in bits, but it is usually considered as the bus data
path width. The data transfer rate is also sometimes called the bandwidth of the data
bus. However, this definition is not consistent with the meaning of bandwidth, as for
example in measurement technology and in communication (see also Section 4.1.3
and 9.3.1). In the following, the term data transfer rate will be used.
Figure 8.3: 19“ VMEbus rack with 21 slots (courtesy of Schroff, Germany)
The most popular type of board size is known as the „Eurocard“ or „euroboard“
format (the name has to do with the fact that this board type was initially used
extensively in Europe). This board size is now normed in the United States as IEEE
1101 standard, in Europe as IEC 297-3 and in Germany as DIN 41494, Part 2. The
smallest commonly used board, „single height Eurocard“, has dimensions (height x
width) 100 x 160 mm. The board height may increase in 133.35 mm steps and the
width in 60 mm steps. For example, the „double height Eurocard“ board has
dimensions 233.35 x 160 mm. The 19" and the Eurocard formats are used for
different bus systems, as for example VMEbus and Compact PCI.
The actual bus electrical conductors are realized on printed circuit paths on a
backplane, shown in Figure 8.4, on which are also mounted the connectors for the
insertion of the boards containing the electronic circuitry.
8.2: Bus Structure and Operation 269
Two types of connectors are used for the connection of boards to buses: the
edge connector and the plug-in connector. The edge connector (Figure 8.5) was
used in earlier bus standards and is popular today particularly for personal computer
applications due to its simplicity and low cost. However, edge connectors have a risk
of poor electrical contact, which may lead to errors.
edge connector
Figure 8.6: 96-pin plug-in connector of type DIN 41612-C installed on a termination
network for the VMEbus (courtesy of Schroff, Germany)
+ Vcc
Q1
inputs
Q4 D1
Q3 output
Q2
0V
ground
Figure 8.7: Internal structure of a TTL NAND gate. The transistors Q1 and Q2 and the
diode D1 form the totem-pole output.
Figure 8.7 also shows the typical TTL input. In order to input a logical „0“, the
input pin must be held at a voltage level of 0-0.5 V with respect to ground, but to do
this it is required that some current circulates out of the input and to the ground. A
TTL input is therefore equivalent to a load connected to the power source; the TTL
output transistor Q2 must be able to sink this current from the cascaded inputs. For
this reason the TTL logic is also called current sinking logic. A typical sink current
value is 1.6 mA at a power supply voltage of +5 V. The TTL output circuits are
usually designed to drive up to ten other TTL gates, that is, the output transistor Q2
must be able to sink at least 16 mA.
Two totem pole outputs should never be connected together directly, otherwise if
one output is high and the other is low at the same time, the power source is short-
circuited to ground via the two gates (Figure 8.8). The gates may be damaged and
the power spikes can induce noise and lead to erratic operations in the electronic
logic.
A different type of TTL output is the open collector. This output is obtained by
cascading the TTL output with a transistor, the emitter of which is connected at
ground level, while the collector represents the new output (Figure 8.9.a). When the
transistor is closed and conducts, the output is at ground potential. In the other state
the output level is indefinite, as it is insulated from the ground via a high impedance.
To insure that the output voltage is at power supply level when the transistor is in
open state, a pull-up resistor is connected to the output (Figure 8.9.b).
Several open collector outputs can be connected together in the wired OR
configuration (Figure 8.10). The line level is high only if all transistors are open, i.e.
they do not conduct any current. When one or more outputs are at a low level, the
common line is also at low level. The wired OR configuration is used when the
boards must communicate something general to be understood by all the others, e.g.
that all the boards are ready to operate. Every board may pull the line low, for
example to indicate that it is not yet ready for an operation. All boards also constantly
272 Chapter 8: Bus Systems
monitor the line. It is sufficient for one board to pull the line low so that the others can
detect it. Due to its simple operating principle, open collector logic in wired OR
configuration was widely used in earlier bus systems.
The wired OR configuration has a drawback in high-speed operations because it
is sensitive to the capacitive load of the line. The pull-up resistor R to drive the high
state forms a serial RC circuit with the distributed line capacitance C. The
consequence is that the transition from the low to the high state tends to be
somewhat slow and is limited by the time constant that results from the parameters R
of the pull-up resistor and C, which is fixed. R cannot however be reduced at will in
order to limit the rise time, because the higher currents would overload the interface
transistors.
+ Vcc
Q1
Q1
D1 D1
Q2
Q2
0V
Figure 8.8: Short-circuit connection of two totem pole outputs. One output is at logic level
„1“ (Q1 and D1 conducting) and the other output at logic level „0“ (Q1 closed,
Q2 conducting).
+Vcc
(a) (b)
pull-up resistor
output output
TTL-level TTL-level
input input
0V 0V
Figure 8.9: Open collector output. (a) The output voltage is either 0 V or undefined; (b) use
of a „pull-up“ resistor to get a defined output voltage in both states (0-1).
8.2: Bus Structure and Operation 273
+Vcc
pull-up resistor
wired OR line
Q1 Q2 Q3 Qn
0V
Figure 8.10: Example of wired OR connection. If at least one transistor is closed and
conducting, the common line is set at ground potential.
Open collector also has a problem when more than one transistor is conducting
in a wired OR configuration. When the transistor that is conducting most of the
current is turned off a glitch propagates down the signal line until another transistor
starts conducting. This effect is called “wired OR glitch”.
Modern bus systems are based on tristate logic, see Figure 8.11. Two states
are the logic „high“ and „low“, the third state is a high-impedance output. In the third
state the interface circuitry does not influence the bus lines, but the state of the lines
is reported to the internal circuitry of the boards.
logic data
input
amplifier
Tristate logic is used mainly for the exchange of data and the indication of
addresses. One board drives the bus with the usual high/low levels and all other
units keep their output in the high impedance state, while at the same time
monitoring the bus signals. Tristate logic outputs can be connected together without
any risk. The basic state is the high impedance input, and only with explicit assertion
274 Chapter 8: Bus Systems
the tristate interface will take one of the output states. Such assertion is given only
when the board is enabled to control the bus lines.
Modern buses combine tristate logic interfaces to exchange data and addresses
and wired OR interfaces to indicate readiness to send or accept data, coordinate
operations and send interrupt requests. In high-speed buses tristate logic is used
also instead of the wired OR interface in order to overcome the limitations of the
latter with the signal rise time.
At the high frequencies at which a bus operates, each conductor behaves as a
transmission line with distributed impedance. As shown in the description of electrical
conductors in Section 4.5.2, the characteristic impedance of all connected units and
at both ends of each line must match, otherwise the signals might be reflected back.
If the level of the reflected signals is high, they can interfere with normal operations.
To avoid signal reflections, termination networks with impedance equal to the
line impedance are connected at both ends of a bus conductor (Figure 8.12). The
termination networks dampen out spurious oscillations caused by fast transients.
Termination networks can either be built directly on the bus backplane or installed on
boards that are inserted in connectors at both bus ends (Figure 8.6).
+Vcc
+Vcc
330Ω 0.1µF
0V
Data lines carry data to and from the addressed locations. Similar to address
lines, their number has increased from 8 in earlier buses to 32 or 64 in more modern
applications.
Control lines are used to carry service signals, as for example the type of
operation read / write, indication of readiness to send or receive data, or interrupts to
request special handling by one of the processing units. Normally, one line carries a
clock signal at a defined frequency to be used as general synchronization reference.
Most boards do not have autonomous power supply and draw their power from
the bus. Power lines are then used to carry voltages typically at ±5 V and ±12 V
levels. Power and ground are normally connected to several pins in order to
distribute the current load of multiple boards among several conductors.
Spare lines are not connected at all; they are reserved for additional functions in
future revisions of the bus standard. They might also be explicitly left free for the
user’s own applications.
Not all types of lines are present on all buses. Address and data sizes vary, the
number of handshake lines depends on the data exchange protocol, and interrupts
are supported differently from one bus to the other. Some of the bus lines carry their
original meaning when they are at a high voltage level (active high) and some when
they are at ground level (active low). To avoid confusion, a line is said to be either
asserted or negated, independently of whether the asserted state is at a high or low
logical level. Active low lines are indicated in bus data sheets with an asterisk (*)
following the name or with a line above the name, for instance NACK* or NACK .
Active low lines often operate according to the wired OR principle; they are used
when all boards must indicate readiness for an operation at the same time. If a board
is not ready for operation, it just pulls the common line low so that the other boards
can detect it.
cycles. Asynchronous buses operate according to the principle of cause and effect.
An operation may be carried out only after the previous operation is terminated. In
asynchronous buses there is no synchronization clock and some handshake lines
are used to carry different acknowledgments and indicate readiness for operation. In
synchronous buses readiness is implied by the clock: at a certain bus cycle all
boards must be ready for operation.
There are trade-offs between the two techniques. Synchronous buses are
somewhat less complex, but are defined on the basis of the technology available at a
certain time and offer comparatively little room for improvement. Asynchronous
buses allow for greater flexibility due to the fact that boards operating at different
speeds can be installed on the same bus and operate together. If a board built with
new components can operate at higher speed, it can nevertheless be immediately
integrated in an asynchronous bus. The more complicated circuitry required by
asynchronous buses is usually not perceived as a problem since large scale
integration allows the costs for the interface logic to be kept low.
address address
(from master)
address valid
(from master)
data
(from slave) valid data
clock
(from master) 1 2 3 4 5 6 7 8 9 10 11 12
In a data read operation (Figure 8.14) the master unit begins by putting the
destination address on the bus and shortly thereafter confirms the address by
asserting the ADDRESS VALID line. An additional line indicates that the operation is
a data READ. With ADDRESS VALID asserted, all boards decode the address. The
addressed board puts the requested data on the bus and confirms the operation by
asserting the DATA READY line. The master unit acknowledges data reception with
the DATA ACKnowledge line. Now the slave may negate the DATA READY line and
reset the bus drivers; in reply the master negates its DATA ACKnowledge line. The
data read operation is completed.
In some types of asynchronous buses the lines for address validation and for
operation control are organized in a different way. For example, MEMORY WRITE
asserted indicates at the same time that the address is also valid. With this
organization, one line is needed for each one of the possible operations.
The data write operation is similar to data read. In this case the master unit
writes on the bus the destination address and the data. After the correct bus signal
levels have been reached, the necessary lines are asserted to indicate that the
operation is WRITE and that address and data are VALID. At this time all boards
read and decode the address; the addressed board also reads the data and when
the storage operation is terminated, it signals this by asserting the DATA
ACKnowledge line. The master board can then release the DATA READY line to
indicate that data and addresses are no longer valid. The slave unit releases its
DATA ACKnowledge line and the operation is terminated.
278 Chapter 8: Bus Systems
time
execution of the service routine is terminated, the original process may resume its
previous operations (see also Section 10.6.4).
An interrupt indicates that an event asynchronous (i.e. not related in time) to the
current program flow has taken place. It might be that new data is present on a
communication channel, a button is pressed or an operation is completed and the
interrupting device requires processor attention. By their very nature, interrupts can
take place at any time.
In bus systems interrupts are used principally as indication that a board needs
service. A board generates an interrupt by asserting an interrupt request line; most
times the interrupt is directed to the current master unit. When the bus master is
ready to service the interrupt, it signals this on the interrupt acknowledge line. The
generating board then negates its interrupt request.
When several boards request interrupts it is necessary to differentiate between
them according to some precedence order, as only one board at a time may receive
attention. Most bus systems have therefore several interrupt request lines and every
line has a predefined priority. Interrupts are serviced according to the priority of the
line on which the request is made. The board servicing the interrupt writes the
interrupt number on the bus so that the requesting board can recognize when its
request is being answered. This requires that only one line be used for the
acknowledgement of the interrupt request, as the data lines are used for the
differentiation.
Another approach is represented by shared interrupts, where each interrupt
line is shared by several boards. As each interrupt line may be asserted by more
than one board, the service board must find where an interrupt originated by polling
all the boards connected to the same line. The first board that acknowledges the
request is then serviced. Note that with this methods potential conflicts cannot be
avoided when several board generate the same interrupt at the same time.
A different method for the sharing of interrupt lines is known as daisy-chain
connection, Figure 8.15. A common “daisy-chain” interrupt line passes through all
boards that can act as possible interrupt sources. Each board can halt the
propagation of a signal with an electronic switch.
decreasing interrupt
servicing priority
Normally, each board keeps the connection closed. When a board requests
attention, at the same time its logic circuitry prevents the acknowledge signal to be
carried further to the following boards in the case they also requested an interrupt at
the same time. On receiving an acknowledgment from the interrupt handler, the
board writes an identification code on the bus. Two pins are needed on the bus
connector for each daisy-chain line. When no board is inserted, the pins related to
daisy-chain conductors must be short-circuited with a jumper.
With daisy-chaining the boards installed closer to the master servicing unit have
an advantage because they control whether or not an acknowledgment signal is
carried further. A disadvantage of daisy-chaining is that it takes time to transfer the
acknowledgment signal along the chain.
Interrupt handling becomes complicated when several CPUs are installed in a
system and not only the source but also the destination of an interrupt has to be
determined. Because of this, in the most recent bus designs interrupts are
considered as messages and sent from the source to the destination board like any
other data.
the bus was normed as IEEE 1014). The VMEbus has several features that make it
a powerful and flexible system bus for industrial applications. Its main features are:
• address length 16/24/32/64 bits
• data word length 16/32/64 bits
• data transfer rate: theoretical maximum: 80 MByte/s, practical 60-70 MByte/s
• seven interrupt levels, daisy-chained
• support for multiprocessor systems, four priority levels for bus allocation
• data block transfer, maximum block length 2048 Bytes.
The VMEbus is available in single and double height backplane formats, with
one and two DIN connectors, respectively (in the VMEbus standard the connectors
are called J1 and J2). The single-height format supports 32 bit data transfer and 40
bit addresses ( 2 40 Byte, i.e. 1 TByte address space), and the double-height format
supports 64 bit data and 64 bit address ( 16 ⋅ 10 6 TByte address space). Single and
double height cards can be mixed in the same system and data transfers may take
place alternatively with 8, 16, 32 and 64 bits, depending on which boards are
currently addressed.
VMEbus has a maximum length of 500 mm, so that the maximum signal
propagation delay allows up to 21 boards to be inserted on the bus by considering
the place taken by each slot and the signal propagation delay along the bus.
Particularly important in a VMEbus system is the card in the first slot, which must
perform some system-wide functions, e.g. master arbitration in multiprocessing
operations. The VMEbus consists of four sub-buses for data, arbitration, priority
interrupt and general utility (Figure 8.16).
VMEbus device
interrupt
arbitration
utility signals
possible only via the additional pins of the connector J2 of the double-height
backplane. Data words of 8, 16, 24, 32 and 64 bit length can be transferred on the
bus; the data length is dynamic, which means that it can be changed at any time.
Data transfer on the VMEbus is oriented to the support of a multiprocessor
environment. VMEbus includes six „address modifier“ lines (AM0 to AM5) which are
set in parallel to the address. The bus uses these lines to indicate whether the data
transfer takes place in „supervisor“ (=privileged) or non-privileged mode, whether the
addressed location corresponds to data or programs and the number of address bits.
These indications can be used by the operating system and application software as
an additional protection feature, for instance to lock a protected data section from
unauthorized access via the bus. Some of the address modifier codes are free to be
defined by the user.
VMEbus supports data transfer in blocks of up to 256 cycles (block or burst
transfer mode). In block transfer, master and slave units automatically increment the
addresses and transfer the new data word; the address placed on the bus is not
changed during the process. A block transfer operation cannot be interrupted. Any
unit wishing to get bus control has to wait until the transfer is completed. In one
mode of block transfer operation the address lines are used to increase the data
width to 64 bits.
In the VMEbus is defined a read-modify-write cycle in order to prevent data
from being written over by an unit while it is used by another unit. The read-modify-
write cycle is similar to the function of the test_and_set bit that prevents
modification of data being accessed by several programs in a multitasking
environment (see Section 10.3.2). In the read-modify-write cycle the operations of
read and write by the master occur in immediate succession and no other unit is
allowed to access the data item being processed.
the disposition of the boards on the bus and the master selection principle with
related parameters in the operating system.
Although technically the IBM PC was no better than other machines then already
present on the market, it immediately enjoyed large success thanks to the size and
strength of the company producing it, as well as the widespread expectations that
made of the IBM PC a self-fulfilling prophecy.
The first IBM PC and its following model XT were based on the Intel 8086/8088
CPU and had up to 640 kByte usable RAM memory. The CPU was connected to the
bus and controlled it directly (no multiple bus masters were allowed); on the
motherboard were installed eight edge connectors to insert peripheral cards. The
IBM PC bus was built around the control signals of the 8086 CPU. It had 62 parallel
lines, the data path was 8 bits and the address path 20 bits wide, which allowed the
direct addressing of 1 MByte. The interfaces for floppy and hard disk, screen and
external printer were built on boards that occupied a few slots; in the end about five
slots remained free for the user.
The IBM PC bus had six interrupt lines each with different priorities. The users
quickly learned the hard way how the TTL-type interrupt signals could not be used for
several boards at the same time. Two cards generating the same interrupt could not
be used together on the bus, and the reconfiguration of the controller interrupts not
always was possible. Many a board was purchased and installed not thinking about
the hard-coded interrupts on the other boards.
Despite what its importance might lead to believe, the IBM PC bus does not
have an official standard. The bus is described in the IBM-PC Technical Manual, but
there has never been an official commitment by IBM to abide to it.
8.4.2 ISA
In 1984 the personal computer IBM AT (Advanced Technology) was introduced.
This PC was based on the Intel 80286 CPU with word length of 16 bits and address
width of 24 bits (16 MByte addressable). The IBM AT bus used the same connector
as the PC together with an additional 36-pin connector. Other interrupt and
handshaking lines had also been added. Boards designed for the IBM PC bus could
also be used in the AT bus, but they would not offer the extended addressing and
data transfer capabilities.
Also for this bus there is no official and published standard. The IBM AT bus is
also known as the Industry Standard Architecture (ISA). The name „ISA“ was defined
by a group of companies, other than IBM, to indicate what they meant by „IBM
standard“.
In later years the more powerful processors Intel 80386 and 80486 have
replaced the older types 8086 and 80286 in a new generation of personal
computers. When a reference is made to a „80386 computer“ or a „80486 computer“,
if the bus type is not explicitly mentioned, then ISA (i.e. IBM AT) is intended.
Because of its low flexibility and low speed, an IBM PC-based system is hardly
of interest for industrial applications. However, the PC should not be written off
entirely. Its main asset is the low cost of both central unit and peripherals together
with a wide choice of interface cards, not to mention the huge amount of available
software. For data collection applications with no special speed requirements, the
IBM PC bus may be the most cost-effective solution.
The advanced performance of the 80386 and 80486 processors makes them
much more interesting for demanding applications. The increasing performance of
interface cards and the availability of new control software will push computers
based on these processors more and more toward the factory-floor for applications
286 Chapter 8: Bus Systems
like machine control, data collection and communication, at least when no strict
multiprocessing by heterogeneous boards is required.
8.4.3 EISA
The EISA (Extended Industry Standard Architecture) standard was defined by a
company consortium which included Compaq, Intel, Hewlett-Packard, Olivetti and
others. The stated goal of EISA is to have a well specified, high-performance bus
standard for advanced PC systems which is independent of the control of only one
company (read: IBM).
EISA is based on the existing ISA architecture. Physically the EISA connector is
similar to the ISA, with the pins for the new EISA functions and extended data and
address paths placed between the pins of the ISA connector. EISA is therefore
downward compatible to ISA, which means that an ISA board can operate on an
EISA bus (the opposite is obviously not true).
EISA is a synchronous bus with a 32-bit word length (word lengths of 8 and 16
bits for the older PC and AT boards are supported) and a 32-bit address length
(4 Gbyte addressable). The maximum data exchange rate is 33 MByte/s in burst
data transfers.
The hybrid nature of EISA appears clearly from the interrupt handling scheme.
EISA uses the same interrupt lines as ISA, but defines them as open collector,
shareable lines. The consequence is that EISA boards can share interrupt lines,
while ISA boards connected on the same bus cannot because of their TTL-type
interface. Consistently with modern bus specifications, EISA supports multimaster
functions, board identification with hard-coded information and bus auto-
configuration.
8.4.4 PCI
PCI (Peripheral Component Interconnect) is a new standard for high-
performance personal computers designed by several computer manufacturers
under the leadership of Intel. The PCI bus is synchronous and processor-
independent. Its normal transfer rate is defined as 132 MByte/s with a word length of
32 bit and a 33 MHz bus cycle. The bus can also operate with a 64-bit word and at
66 MHz speed, bringing the maximum data transfer rate to 528 MByte/s.
As it is the case for other bus systems from the PC world, PCI is not optimized
for use in industrial systems with their typical requirements in interrupt handling and
multimaster operation. It is therefore necessary to analyze beforehand whether a
PCI-based solution really fulfills the envisioned process control requirements,
especially in consideration of the fact that any increase in technological performance
always leads to higher requirements by the users.
8.5 Summary
Bus systems are fundamental in control system applications most of all because
they allow for flexibility and modularity. The most appropriate hardware for a specific
application can be selected and assembled together. The evolution in the structure
of bus systems is due to increasingly sophisticated requests by the customers and to
the decline in the cost of computing power.
8.5: Summary 287
Bus systems are first designed and proposed by one or maybe a few
cooperating industries. If the customers react positively to their market introduction
and the number of manufacturers for bus-related components increases, there
comes a time when an established and independent organization assesses and
produces specific bus description documents, i.e. the bus standards. The role of
standardization committees is not to invent anything new, but rather to structure and
define without ambiguity existing bus know-how.
To integrate and get a bus system to work satisfactorily may be quite easy but
also turn out to be a major effort. In practice, every board may have to be configured
with help of jumpers or switches and more often than not some system software
parameters have to be adjusted. Therefore, to get an application running usually
requires several trial-and-error steps.
The current trend in bus architectures is to hard-code basic identification
information on each board. At start-up time, the system software polls all connected
boards and configures itself accordingly without direct programmer intervention. This
is the case of PCI and EISA. The trade-off lies in the higher complexity of the
additional control logic that must be installed on each board; the most capable
systems not surprisingly lie on the high-cost side of the bus spectrum. Moreover,
smaller boards in a sense mean more flexibility since it is easier to select the right
mix for an application; with larger boards there is always a risk that many of the
provided functions are not used.
The most important industrial bus systems have been described in this chapter.
It is important to point out again that there is no „best“ system and that different
buses only have different degrees of functionality. The real challenge lies in the
selection of the right bus for a specific application, taking into consideration technical
as well as economical constraints.
Other aspects of buses that are widely accepted today are address and data
fields lengths of at least 32 bits and standard norms such as Eurocard for form factor
and board dimension, and DIN 41612 for the electrical connectors. Important bus
standards for industrial applications are VMEbus and Compact PCI.
Further Reading
[Lawrence / Mauch 1987] is an excellent introduction to board and bus system
applications. It strongly emphasizes system thinking and the relationship between
hardware and software. [Tanenbaum 1990] is dedicated to the structure of digital
design all the way up from gates to complex computers. Relatively little space is
dedicated to bus operations, but the book is recommended for a broader view on the
operations of bus-based systems. [Peterson 1989] gives a comprehensive
description of the VMEbus operations, balancing theory with practical examples.
Basic information about bus systems is found in the original documentation from
the manufacturers and of the standards organizations. IEEE for example distributes
the specification of all its normed systems. As mentioned, the various IBM buses and
the EISA standard are not in the control of a public interest organization and are
therefore not published for free use. An alternative for the missing official
documentation is however offered by the numerous articles appearing in the
specialized press on the operations and performance of bus systems. Also many
books are available on the subject. Also many manufacturers produce and distribute
qualitative information to support their bus products, which are often based on
standard designs.
9 Digital Communication in Process Control
Overview
Communication - or information transfer - is fundamental to the function of any
organized system; process control also relies heavily on it. This chapter is dedicated
to the technology of communication by means of electrical signals. It does not
pretend to be exhaustive. The issues related to communication are so many, the
standards so numerous and the equipment so manifold that a somewhat
comprehensive approach would require hundreds and hundreds of pages. Instead, in
the beginning the focus will be on basic concepts and later some of the most
commonplace technologies and solutions of interest in process control will be
described more in detail.
Communication in industrial applications can deal with very simple technology
and protocols (data transfer rates of 50 bit per second are still used in some cases)
up to the most sophisticated equipment available, operating at speeds of about 100
Mbit/s, a range of 2 million times (!) The industrial automation engineer will therefore
probably face more heterogeneous applications and devices than his colleagues
working on „pure“ communication technology like office internetworking and
distributed computing systems. A basic understanding of the basic physical principles
of communication is therefore particularly important to work with industrial
applications.
Section 9.1 presents a general physical model for communication. The open
system interconnection (OSI) scheme, which serves as a reference for the
development of standards in communication, is introduced in Section 9.2. The OSI
framework is then taken as a reference throughout the chapter to examine other
standards. Section 9.3 is dedicated to the physical channels, Section 9.4 to
communication protocols and Section 9.5 to local area networks (LAN). In these
sections the reader will recognize some known standards, e.g. the ubiquitous
computer interface EIA-232. Section 9.6 deals with the information flows in process
control and among other aspects treats interconnectivity (i.e. openness) in industrial
communication. Section 9.7 is dedicated to the Fieldbuses, a type of local networks
for communication in process environments. Public data networks are included in this
chapter (Section 9.8) because some knowledge of the related concepts is useful also
in industrial applications.
288
9.1: Information and Communication 289
the ratio of length and time 1. Information is an intrinsic property (any structure
contains information about itself), and can be transmitted at little energy expense: the
drawings of a house contain as much structural information as the house itself, but
are easier to carry around. A remarkable and very important property of information is
that it can be duplicated at will without degrading.
Mathematically, information is defined as the measure of the state of order of a
set composed of different entities. A symbol can represent the state of an entity in
abstract form. For example, a figure 0-9 represents ten different entities. If an entity
can assume any of a certain number of states, learning its current state is equivalent
to getting some information about it. The more states an entity can assume, the more
information we get by learning its current state.
The information I associated with the knowledge of one out of N possible states
that a variable can take is the logarithm of N . If the logarithm is calculated in base 2,
the resulting measure is in bits:
I = log 2 N bits (9.1)
If an entity, or a variable can assume only two states, its information content is
I = log2 (2) = 1 bit . The information content of a decimal figure 0-9 is
I = log2 (10) = 3.32 bits . The logarithms can be expressed also in other bases. For
logarithms in base e the information unit is the nit and for logarithms in base 10 the
dit or Hartley. Logarithm bases different than base 2 are however seldom used in
practice. Equation (9.1) holds under the assumption that the probabilities for the
different states are equal.
The bit as a unit of information is very practical in digital logic, where it is easily
represented by two different power levels in an electric circuit. To transport or store
the information related to a variable, a number of elementary circuits, or switches,
equal to or greater than the associated information is necessary. In the case of a
figure 0-9 with an information content of 3.32 bits, at least four such switches are
required. With four switches it is possible to represent 2 4 = 16 different states; three
switches would be sufficient only for 2 3 = 8 states.
According to the above definition a continuous variable, i.e. a variable that can
assume infinite values in a given range, has an infinite information content. In digital
applications only quantized values are used; the related loss of information, like for
instance in the sampling and digital conversion of an analog signal (see Section 5.1.
and 5.2), is accepted. For example, in the digital representation of a voltage level
varying between 0 and 10 V, an approximation to 0.1 V means that 7 bits are
sufficient for the description of the 100 resulting states ( 2 7 = 128 ).
The use of the logarithm as a metric for information is justified by a number of
reasons:
• it is an increasing function of the number of possible states
• when only one state is possible, the value of the logarithm is zero, i.e. the
information content of a constant is zero
1
The basic units in the CGS system (absolute measure system) are length [cm], mass [g] and
time [s]. The international measurement system SI (in French: Système Internationale) that covers all
fields of physics and engineering is based on seven basic dimensions: length [m], mass [kg], time [s],
current intensity [A], temperature [K], quantity of a chemical substance [mol] and light intensity [cd].
Information is still not considered to be a basic dimension.
290 Chapter 9: Digital Communication in Process Control
9.1.2 Communication
Communication takes place when information is moved in space.
Communication plays a fundamental role in all organized systems. As a basic natural
process, communication takes place within living entities via chemical and electrical
signals. External communication through speech and vision helps sustain life in the
surrounding environment. In developed societies communication is supported by a
developed technological infrastructure with the telephone network, the press and
television.
Communication theory is an important tool in many fields. The marketing expert
who tries to convince a large number of people to buy a certain product uses
concepts similar to those of the communication engineer who designs radio links.
And of course, communication is a central issue also in control systems: information
about the state of a system continuously moves from the sensors to a central
processor and control signals move from the processor out to the actuators.
Communication theory was first born as an engineering topic to solve
transmission problems, but moved later to other non-technical fields such as
psychology and linguistics. Here new results were found, to be later fed back to
engineering. The basic issues and results are quite similar and led to generalized
models. For a long time, engineers were more interested in „low level“ information
transfer while linguists and psychologists paid more attention to the purpose of the
communication process, i.e. how to reach a goal. Now, the different aspects are
gradually converging so that in engineering also the semantic (meaning-related) and
pragmatical (purpose-related) aspects of communication are no longer overlooked.
Data transmission is then designed not as a goal in itself, but a means of achieving
specific purposes.
the message and makes it difficult for the receiver to detect the changes and
understand the message correctly.
Noise
Object Object
Message
Code Code
Channel
Sender Receiver
In most cases the message deals with something external to the communication
process, but sometimes it can be related to some of the communication entities. A
familiar example is the „hello“ of phone conversations, which is in fact a message
about the channel itself. Its purpose is to test whether the channel is open and
operating correctly and indicate to the receiver that a conversation is about to begin.
The basic issue in data communication is to move in a given time a message
from a location A to a location B and minimize the influence of noise, or alternatively
recover and reconstruct a message corrupted by noise. The question may be also
put another way: how to let the receiver at B fulfill the purpose for which A is sending
the message (this concept was mutuated from advertising, where it is obviously has
its importance). In automation systems an unit A either wants to pass information to
another unit B, or A wants B to do something.
Note that in Example 9.4 the distance between the source and the destination is
not relevant, assuming that the mail service requires the same time to deliver the
correspondence independent of the destination. In fact, in communication distance
plays a role only in those cases where the propagation delay is of the same
magnitude order as the time constant of the technical process. The real issue of
communication is not the length but the width, i.e. the capacity, of a channel. In Local
Area Networks, however, the length of the physical connection has an indirect effect
over channel capacity due to the temporal coordination of access to the
communication medium by different units, because in this case the propagation
speed and the attenuation of electrical signals along the channel must also be taken
into consideration.
model, examined more in detail in the next Section, offers a structure to identify and
separate between the different parts of the communication process. In addition, OSI
comprises some hundreds of standards defined in strict accordance to the basic
scheme. OSI is strictly independent from the actual implementation and refers to the
communication process only in abstract terms.
In practice, the basic OSI scheme does not indicate what voltage levels, which
transfer speeds or which protocols need to be used to achieve compatibility between
systems. It says that there has to be compatibility for voltage levels, speed and
protocols as well as for a large number of other factors. The practical goals of OSI
are interoperability and interchangeability. Interoperability means that data can be
exchanged between different points without disproportionate expense for data
conversions. Interchangeability indicates that devices produced by different
manufacturers to fulfill the same communication function must be able to be
exchanged without any problems, provided of course that they operate according to
the same principles and rules.
The conceptual simplicity of OSI does not mean that its description is also
simple: the related documents are several thousands (!) pages long. OSI was initially
published by the International Standards Organization (ISO) in 1984, in a document
set called ISO 7498. The other major international standards organization, the ITU-T
(International Telecommunication Union), formerly called CCITT (Comité Consultif
International de Télégraphie et Téléphonie), published in the same year a
comparable recommendation called X.200. The recommendation was redefined, with
only minor changes, in 1988 and is scheduled for revisions every four years.
Computer #1 Computer #2
Layer #
7 Application Message Application
6 Presentation Presentation
5 Session Session
4 Transport Transport
3 Network Network
1 Physical Physical
Physical channel
Service Service
Virtual connection
Layer n Layer n
Procedure Procedure
call Service call Service
Virtual connections
(intermediate layers) (intermediate layers)
Procedure Procedure
call Service call Service
Physical connection
Layer 1 Layer 1
before it is passed to the lower layer, all according to the protocol used at that
particular level. Each layer has its own communication protocol and adds therefore
the related data to the original message. The result looks somewhat like Russian
„matrjoshka“ dolls, each one placed inside a larger one (Figure 9.4). The smallest
doll corresponds to the original message, i.e. the application data; the largest doll
represents what is actually transmitted on the physical link. The protocols and the
procedure calls are described in the OSI documents and the related standards with a
particular syntax for each function and its corresponding parameters.
Other protocol data may be exchanged between peers at different layers for
operational signaling, for instance to establish or bring down a link. Signaling
information is transmitted separately from application messages.
Not all layers require direct exchange of data. Figure 9.4 gives an indication of
the basic concept, but reality need not be this complicated. Protocols that require
active data exchange are needed only for some of the peer layers and
interconnectivity can function even if some of the layers are bypassed - of course
provided that all the communicating partners do the same.
Layer Headers
7 - Application #7 data
6 - Presentation #6 #7 data
5 - Session #5 #6 #7 data
4 - Transport #4 #5 #6 #7 data
3 - Network #3 #4 #5 #6 #7 data
Figure 9.4: General aspect of layered communication protocols. CRC is the Cyclic
Redundancy Check or checksum.
For each of the OSI layers there are one or more sets of standards issued by the
major standardization organizations (see Appendix „Standards and Standardization
Organizations“). At the physical and data link level some earlier standards were
incorporated in OSI. For the other levels new protocols have been defined following
the indications of the OSI model.
The full OSI compatibility between the different layers suggests that, in principle,
it should be possible to put together a working application by mixing products from
different sources. As usual, reality looks rather different. OSI intermediate levels are
not sold as separate software products, and manufacturers and software developers
offer instead complete packages for layers 3-4 to 6-7. The internal interfaces do not
need to follow the OSI requirements, and in practice that is not very important either.
9.2: The Open Systems Interconnection (OSI) Model 297
(monochrome, 24x80 characters) had a specific control character set for operations
like text scrolling, cursor positioning, switching on blinking or reverse video, etc. Many
programs could generate these control characters and a large number of computer
terminals, also those made by the competition, could be preset to understand them.
In this way at least a minimum level of compatibility between programs and terminals
was ensured. In more recent times the multi-windowing system X-Windows, which is
actually a protocol description, also operates as a kind of virtual terminal. More about
X-Windows in reported in Section 11.6.
A major advantage of the virtual device concept is that new devices may be
added to an already functional system without having to change existing application
programs. It is sufficient to provide each new physical device with a software
interface to the virtual one. The application program does not even need to know that
a different physical device is being used.
An important virtual device supported under OSI is the virtual filestore, with
protocols called File Transfer Access and Management (FTAM). FTAM applications
are important not only in process control but also in distributed databases, as in
financial transaction systems or airline seat reservation systems. In FTAM file
properties like creation date, access control, and many others are described with
help of an abstract notation and operations are supported in a multitasking
environment with functions like open/close, read/write, set locks, etc. The mapping
software between FTAM and the specific file system hardware is part of the operating
systems provided by the computer manufacturers.
Physical
device type #1
Application
program #1
Physical
device type #2
Application
program #2
Physical
device type #3
(a)
Interface Physical
Application device type #1 device type #1
program #1
Application
program #2 Interface Physical
device type #3 device type #3
(b)
This relation is close to the issue of signal sampling and reconstruction described
in Section 5.2. Enough information about a signal with bandwidth W can be
collected by sampling the signal at a frequency 2 ⋅W ; sampling at higher frequencies
would not add anything to the information that is needed to reconstruct the original
signal from the samples. The issue is here about limit values, in practice the sampling
frequency is higher than the Nyquist frequency in order to simplify the reconstruction
of the original signal.
In the technical literature the concepts of channel capacity and bandwidth are
sometimes confused, because the same name is used for two different things.
Channel capacity is a general concept valid for every kind of channel and every type
of communication and is not restricted to specific physical channels. The bandwidth
300 Chapter 9: Digital Communication in Process Control
of a channel, on the other hand, has only to do with the frequency range for which
electromagnetic signals are carried with a specified maximum attenuation. Taken
alone, bandwidth does not imply anything about channel capacity.
In binary data transmission, V = 2 and the logarithm term of Equation (9.1) is =1.
From here derives the popular misconception that the capacity of a channel in bits
per second is equal to twice its bandwidth in Hertz. According to Equation (9.2) there
is no limit to the amount of information that a channel can carry, provided that a
sufficiently large number of symbols is used.
An important factor that negatively influences communication is noise. Noise is a
hard reality of the real world and constitutes an intrinsic factor of the communication
channel. On an electrical channel noise is caused by the random thermal movement
of electrons; its power is proportional to the bandwidth of the channel. Noise can also
be picked up from the environment by electrical conductors, which also act as
receiving antennas. The noise on a line is considered in relation to the power level of
the transmitted signals. Noise can be just a negligible nuisance, but if its power level
is too high compared with the power level of the original signal, this might be
distorted to the point that the original message becomes unintelligible. The receiver
might decode the message wrongly and take an action other than the one envisioned
by the transmitter. If the voltage levels for the different symbols are many and close
to each other, they become difficult to separate and identify univocally. The smallest
voltage spike on the line due to noise would erroneously be interpreted as a different
level and thus as a different symbol. Noise protection and the recovering of corrupted
data are therefore very important issues in communication. In dimensioning
communication channels, noise is the issue about which most compromises have to
be made. In principle, noise can be eliminated but at great expense; in practice there
are ways to cope with it and make it sufficiently harmless.
The problem of communication in the presence of noise was studied by the
American mathematician Claude Shannon. In 1948, in a publication that is still
considered as the foundation of communication theory, Shannon proposed a relation
to describe a channel with bandwidth W [Hz] under the influence of noise. In
Shannon’s relation the levels of the original signal and of the noise on the channel
are expressed by the parameter signal-to-noise ratio, or in short S/N ratio. This is the
quotient between the average power level of the original signal and that of the noise.
The S/N ratio is usually expressed in the logarithmic units decibel [dB].
According to Shannon, the maximum capacity Rmax [ bit ⋅ s −1 ] of a channel with
bandwidth W [Hz] and as a function of the S/N ratio is equal to:
Rmax = W ⋅ log 2 (1 + S N) (9.3)
Shannon’s relation shows the maximum data rate that can be transmitted without
errors in presence of a certain amount of noise. This maximum value is to be
considered as a fundamental physical limit that is impossible to reach in practice. The
concept is equivalent to the thermodynamic limit on the conversion of heat into work.
Yet, as in thermodynamics, Shannon’s relation is a good reference to define how well
a real communication process operates.
In fact it is very difficult to even approach Shannon’s limit; a data rate of one third
of the maximum one is generally considered to be more than satisfactory. To go
above that limit, special multilevel signal coding is needed, which requires time to be
processed. (This method should not be confused with data compression, which
reduces the number of symbols to be transmitted.) In the end, what is gained in
9.3: Physical Links (OSI Physical Layer) 301
transmission rate may be lost again in signal coding and decoding in the transmitter
and the receiver. If data is put on a channel at rates above Shannon’s limit, the errors
due to noise will distort the signal in such a way that it is impossible for the receiver
to decode it correctly.
An analysis of Shannon’s equation indicates that the maximum data rate can be
increased by increasing the bandwidth, increasing the signal power level or
decreasing the noise level. Given a fixed (unchangeable) noise level, an increase in
bandwidth is more effective than an increase in the power level and therefore in the
S/N ratio. In fact, all modern developments in communication technology are
focussed on providing higher bandwidths rather than operating at high power levels.
Attention should be paid to the fact that Equation (9.2) is not a special case of
Equation (9.3) in absence of noise (i.e. for S/N → ∞). Nyquist’s relation expressed by
Equation (9.2) is function of the number of coding symbols and leads to a
theoretically infinite capacity for all channels. Shannon’s relation is a function of the
S/N ratio. According to Equation (9.3), in absence of noise and for any bandwidth
W > 0 it is possible to carry as much information as desired, provided that the
coding is chosen appropriately. In the case of a telephone link with bandwidth 3000
Hz and a typical S/N ratio of 30 dB (corresponding to a power ratio of 1000), the
Shannon limit is about 30 kbit/s. Nyquist’s relation indicates that a coding scheme
with V = 32 different levels must be used to carry this amount of information.
The data rates indicated by the Shannon’s relation may seem to be very small
compared to what is today commonplace and necessary for example for full
graphical workstations running data-intensive applications like multimedia. The
difference lies in the used communication media. A workstation in an office
environment is usually connected all the way by high-capacity links to the server
computer. On the contrary, in many process and industrial control applications the
physical media has limited capacity and noise acts as an additional limiting factor.
In conclusion, in the realization of any communication link the major limiting
factors are the available bandwidth and the S/N ratio. Bandwidth must be available
and be in relation to the required data communication capacity. If bandwidth is not
available, even the best communication equipment will not help.
sequence of alternating 0’s and 1’s to give the correct timing. But there still would be
a risk of the receiver to lose synchronization with the transmitter during data transfer,
leading to a false interpretation of the incoming data. Finally, the distributed capacity
of the electrical communication line easily leads to d.c. potential buildup if the data
pulses always have the same polarity.
u 1 0 1 0 0 0 1 1 0 1 u 1 0 1 0 0 0 1 1 0 1
t t
(a) (d)
u 1 0 1 0 0 0 1 1 0 1 u 1 0 1 0 0 0 1 1 0 1
t t
(b) (e)
u 1 0 1 0 0 0 1 1 0 1
(c)
Figure 9.6: Digital coding techniques. (a) Binary direct, non-return to zero (NRZ); (b)
binary direct, return to zero (RZ); (c) three-level, return to zero; (d) Manchester
coding and (e) differential Manchester coding. Knowledge of the reference
(zero) level is relevant only for the three-level coding; in the other schemes the
absolute signal levels are not relevant for the identification of the related data.
+5V
Input
signal
+2V
0V
Logical „1“
Output
signal
Logical „0“
All these problems are solved with Return to Zero (RZ) coding (Figure 9.6.b). In
the RZ coding the original data are combined with a synchronization signal. Like in
the direct coding, also in RZ coding are defined two potential levels, one of which
corresponds to logical „0“ and the other to logical „1“. Each bit starts at its defined
potential level and in the middle of each pulse there is a transition to the zero level;
the transition edge is used to synchronize the receiver. In a different type of RZ
coding are defined two opposite polarities with respect to zero (Figure 9.6.c). RZ
coding requires twice as much bandwidth as NRZ, and the required interface
electronics is also more complicated, but its advantages definitely offset the
disadvantages.
A different and widely used solution is the Manchester coding, also known as
biphase-level or BiΦ-L. In Manchester coding each bit is coded with two voltage
levels and a transition in the middle of each pulse. In straight Manchester coding, bit
„0“ is represented by a transition from a low to a high voltage level and bit „1“ from a
high to a low level (Figure 9.6.d). A similar scheme is the differential Manchester
coding in which bit „0“ is represented with a level transition at the beginning of each
new period and bit „1“ with the absence of a transition (Figure 9.6.e). In differential
Manchester the coding for a bit depends therefore on the level of the second half of
the preceding bit.
Manchester and differential Manchester coding contain the synchronization
reference and offer better noise immunity than RZ coding. As for RZ coding, even the
Manchester schemes require twice as much bandwidth compared to NRZ coding. An
advantage of Manchester coding is that it works with two voltage levels instead of
three and the processing hardware is simpler than for RZ coding. Manchester coding
is widely used in local area networks, as for example in Ethernet.
Several other coding schemes are used, but they are more important in long
distance and satellite communication than in industrial control and will not be dealt
with here.
performance in relation to disturbances, i.e. for the same S/N ratio on the
communication line, disturbances have a smaller influence on a PSK-modulated
signal than on a ASK- or FSK-modulated signal.
Carrier modulation does not need to strictly follow the pattern of a digital input
signal. A change in some carrier parameter may be associated with a sequence of
several bits and not just one bit, so that it is possible to carry more information at the
same carrier frequency. For example, in phase modulation can be used the direct
relation bit 0 - 0° phase shift and bit 1 - 180° phase shift. Alternatively, the bit
sequences 00, 01, 10, 11 could be associated with phase shifts of 0°, 90°, 180° and
270° respectively, so that the same signal ends up carrying twice the amount of data.
An even more sophisticated technique is the quadrature amplitude modulation
(QAM), in which amplitude and phase modulation are combined to carry several bits
for each change in the envelope of the carrier signal.
The number of times per second at which the carrier changes some of its
parameters is called signaling or Baud rate. There is often confusion between bit rate
and Baud rate. They are the same only when a change in a modulation parameter
corresponds to one bit, i.e. when the carrier may take two states only and each state
represents a „0“ or a „1“. In QAM modulation, where for example a combined change
in amplitude and phase may correspond to four bits, the bit rate is four times the
Baud rate. The Baud rate is not suitable as a practical unit for transmission speed,
because the coding method should be also always specified at the same time and
the bit rate is what is actually of interest.
The added data transport capacity with multibit encoding and QAM technique is
not for free, however. Referring to Equation (9.2), what is being done is to increase
the number of symbols V from 2 to 4 when four phase shifts are employed. To
process the related signals, more complicated circuitry is needed and the transmitted
signals become more sensitive for noise. For a given line with a known bandwidth
and a constant noise factor and for a particular carrier frequency, there is an optimum
data rate. Trying to exceed that rate does not improve the throughput of the channel
because data correction information has to be carried along together with the original
data and additional processing is needed in both transmitter and receiver. But as
long as progress in technology allows the construction of more complex - and
cheaper - processing circuitry, increased use is made of combined modulation
techniques in order to make the best use of the available physical channels. The
theoretical maximum transmission speed for a channel, however, does not depend
on technology and is only function of the channel bandwidth and of the S/N ratio
(Equation 9.3).
speed - in order to identify correctly the incoming signals. Moreover, the receiver
must recognize the limits between the single bits and adapt its own timing
accordingly. If some of the communication parameters are set differently at
transmitter and receiver, the receiver can either not synchronize on the incoming
data stream or easily lose synchronization (Figure 9.8).
Synchronous
transmission
Asynchronous
transmission
Time reference
length may be increased. The definition of the pin signals and protocols of EIA-232-D
follows the ITU-T V.24 recommendations. Some pin signals are used as indication of
readiness to send or receive data.
The signals in EIA-232-D have been defined to interface with a modem
connected to a communication line and some of the signals are not relevant in other
applications. To connect other equipment directly and without going over an external
communication line, so called „null modem“ cables are used. There are different
types of null modem cables. In one solution the pins are connected so that the
control signals from the communicating devices can handshake directly. A different
configuration is to connect the handshake pins to a constant voltage, so that they are
permanently asserted. In this way the equipment at one end of the line assumes that
the one at the other end is always ready to exchange data.
The standard EIA-232-D does not imply anything about the type of transmission,
which can be asynchronous as well as synchronous (two circuits are defined to carry
the transmission and reception synchronization signals). The digital data may use
any kind of coding.
The major drawback of EIA-232-D is the limitation of its maximum operating
speed at less than 20 kbit/s. To overcome this limitation a new standard was defined,
EIA-449 (formerly RS-449), which extends the functions of EIA-232. EIA-449 defines
more comprehensive signaling than EIA-232-D in order to exploit new capabilities of
public data network services. EIA-449 has two connectors, one 37-pin connector for
the basic circuits and an optional 9-pin connector for the secondary channel.
EIA-449 does not directly specify electrical signal levels. It refers to two other
documents: EIA-422 for balanced and EIA-423 for unbalanced transmission; these
standards deal only with electrical specifications and not with the rest of the
functional requirements for a complete communication interface. The main connector
of EIA-449 provides two additional pins for the return circuits of balanced
transmission. In EIA-422 is defined a data rate of up to 2 Mbit/s, while using
unbalanced circuits and a common return line the maximum is 20 kbit/s. The highest
data rate for EIA-423 (asymmetrical connection) is 20 kbit/s, which is the same as for
EIA-232. Provisions are made in EIA-449 for interoperability with EIA-232-D by using
relatively uncomplicated equipment. So far, few devices make use of the EIA-449
interface standard.
balanced cable
R Load R Load
Transmitter -
Transmitter Receiver receiver
The interface operation is similar to bus tristate logic (Section 8.2.3). The
generators can be in active or passive state. In passive state they present a high
impedance to the network, in active state they drive the network with a differential
voltage, measured between the two output pins, between 1.5 V and 5.0 V. Binary „0“
is related to one polarity, one output pin is positive with respect to the other, and
binary „1“ has reversed polarity in comparison to level „0“. The differential threshold
for the receivers is set at 0.2 V, with an allowed range of input voltages from -7 V to
+12 V with respect to receiver ground. In this configuration no conductor is at ground
potential. Reversing the connections from a generator or to a receiver is equivalent to
inverting the bit values.
The input impedance of a receiver and the output impedance of a generator in
passive (idle) state is measured in unit loads, that are exactly defined in the standard.
A generator must be able to drive up to 32 unit loads and the two terminating
resistors at a total equivalent line load of 54 Ω. The generators must also be able to
withstand the power dissipated when two or more generators are active, some
sourcing and some sinking current at the same time.
combines the indications of bandwidth and distance, which are in inverse relation one
to the other, and gives a maximum performance limit in MHz⋅km. For any given fiber
link, the longer the length, the narrower becomes the transmittable bandwidth.
Because optical fiber channels are immune to electromagnetic disturbances, noise
has a very low influence (high S/N ratio) and the bandwidth can be used in full.
transmitter receiver
electronics electronics
Optical fiber
LED or laser photodiode
diode
In brief, optical data transmission is suitable to carry large amounts of data over
long distances (>1 km). The principal reason for using optical signal transmission in
industrial environments is primarily motivated not by data-carrying capacity but by
immunity against disturbances. Step index multimode fibers are becoming more and
more common in LANs because of their high data-carrying capacity.
Public mobile telephone companies in some cases also offer the possibility to
carry data traffic. Basically, data transmission takes place in digital bursts that are
coordinated together with the remaining traffic. The data exchange is under control of
a central computer connected to a master antenna, so that several users can share
transmission capacity in TDMA mode (Time Division Multiple Access, Section 9.4.2).
Also in this case the data interface for the user is a standard communication port.
Contrary to what is the case with dedicated frequencies, digital packet radio is
most cost-efficient in urban, populated areas because the services are usually
offered by one or more operators at competing rates. Digital packet radio is the
solution of choice for data collection from energy distribution networks (e.g. for
electricity and gas) when no fixed channels are available, or for communication with
vehicles moving around in an area.
User #1 User #1
... ...
User #n User #n
Bandwidth
(a)
Time
Bandwidth
Frequency band for User #4
Time
Figure 9.12: (a) Time Division Multiplexing (TDM); (b) Frequency Division Multiplexing
(FDM)
1 0 1 0 0 0 1 1
(c)
The parity bit is used as a simple error detection method. In even parity check
the total number of mark „1“ bits in the original Byte plus the parity bit must be even;
for odd parity the sum must yield an odd number. For parity=none, the state of this bit
is disregarded. On detection of a parity error the receiver communicates it to the
higher control layers where it is decided whether to request retransmission of the
Byte. Of the different combinations of number of bits, parity type and length of stop
bits the protocol 8N1 (8 bit, No parity, 1 stop bit) is widely used. Because parity is
disregarded, no error check takes place at this level.
Character-oriented, asynchronous transmission is uncomplicated but also
inefficient because of the bits that are added to each Byte increasing the length of a
bit sequence by more than 25% and also because of the idle periods between the
single characters. Asynchronous transmission is used in practice only at speeds up
to 20 kbit/s.
the original data pattern. The „0“ is obviously not inserted during the transmission of
the start and end flags, to allow their univocal identification by the receiver.
The address field is relevant only when several units can receive the same
message. This is the case in local area networks, where all units are connected to
the same link and must identify which messages are specifically addressed to them.
The HDLC control field indicates the type of message: information, supervisory
and unnumbered. An information frame carries user data; its control field indicates
the current frame number in sequence and whether more frames are going to follow.
This is the case when long messages must be split up in different blocks. The
supervisory frame is used for coordination between transmitter and receiver, for
example to request retransmission of lost information frames if there has been a
mismatch in the numbering sequence. Unnumbered frames are used for link
initialization and status reporting.
The data field may have any length and the checksum field is computed with a
CRC-CCITT polynomial. The end flag contains the pattern 01111110 similarly to the
start flag.
The structure of the HDLC frame follows the layered protocol structure shown in
Figure 9.4. The start and end flags are necessary at the physical and data link layer.
The address, control and checksum fields are related to the operation of Layers 2
and 3. The transmitted data is application-oriented and belongs to Layer 7.
The general HDLC format allows the implementation of different communication
protocols and provides the means for full duplex communication with error control.
For example, in one scheme the sender may keep transmitting frames without
waiting for their acknowledgement, in another the receiver might have to
acknowledge all of them, in still another it might be necessary to indicate only what
frames need to be retransmitted. All these schemes can be realized on the basis of
the HDLC format.
Figure 9.14: Example of high-level data link control (HDLC) frame structure
the character-oriented protocols in UART format with the bit-oriented format of HDLC
type.
In IEC 870 communication takes place by telegrams consisting of Byte
sequences of 8 bits each. Each Byte is transmitted following the UART format in a 11
bit sequence (1 start bit, 8 data bits, 1 parity bit, 1 stop bit). The octets are
transmitted serially in each telegram according to the following sequence:
• header (1 or 4 Bytes)
• user data (variable length, up to 253 Bytes)
• Checksum (1 Byte)
• End of message character (1 Byte)
Figure 9.15: IEC-870 telegram. (a) variable length; (b) fixed length
9.4: Communication Protocols 319
The header Byte indicates what type of telegram is about to follow, a short
message or a variable-length telegram. A short message (Figure 9.15.b) has a total
length of six Bytes. In a variable-length telegram the header contains the start Byte
followed by the telegram length. The first four Bytes in the user data part are used as
address and function indication; the user data is immediately followed by a checksum
Byte and by a stop character. In the four header Bytes the start character and the
message length are repeated as safety measure, because these Bytes are not
included in the computation of the checksum.
The standard IEC 870 foresees several types of messages in order to implement
efficient control schemes, for example message acknowledgement to the central
control unit or to the remote stations, downline loading, etc.
Thanks to the simplicity of its operation and the wide availability of cheap
integrated components for UART transmission, the IEC 870 protocol can be easily
implemented in many devices. This protocol is therefore at the basis of many
industrial solutions that allow for compatibility and interconnectivity, when
components from different vendors are integrated in the same system.
Byte sequences transmitted in bursts, like in file transfers or long data telegrams. For
those applications that do not require high speed and where the characters are sent
one at the time, like the connection of a terminal to a computer or of a computer to a
printer, asynchronous transmission is usually adequate and therefore widely used.
encompass also the Chinese Kanji characters) are contained in the 2-Byte BMP
(Basic Multilingual Plan) code, which is also part of ISO 10646.
OSI Layer 7 (Application) covers several fields related to the utilization of the
transmitted data. The concepts of the virtual device with its hardware-independent
commands and the File Transfer Access and Management (FTAM) protocol, an
abstract notation to describe the different features of a file as for example its creation
date, access control, protection passwords, multiple access information, etc. Another
of the Layer 7 specifications is the Message and Handling System (MHS), standard
CCITT X.400. This is a set of procedures for electronic mail transfer in form of
messages. The Virtual Terminal (VT) concept with hardware-independent commands
to control terminal output (Section 9.2.3) is also part of Layer 7.
the investments made in a solution. TCP/IP is therefore here to stay, at least for a
good while.
Despite the fact that TCP/IP was initially offered together with UNIX, it does not
mean that it is confined to that operating system. On the contrary, TCP/IP has been
designed for operation among different operating systems, hardware platforms and
network types. For example, a file on a station can be copied to a different station
with the services provided by TCP/IP; if necessary, during the copy process the file is
automatically converted into the proper data format. TCP/IP is currently available on
all major computer platforms.
To draw a parallel with OSI, TCP/IP can be considered as a structure with five
layers, three of which are actually covered by the Internet Protocol Suite
specifications (Figure 9.17). In the figure it is also indicated how the units of
information are called at the different levels. As a result of the layered structure,
TCP/IP datagrams are formed in a way similar to OSI. Also the concept of peer
routines is similar as that defined in OSI.
layer
1 Application
(NFS, FTP, etc.)
message
2 UDP TCP
datagram segment
3 IP
datagram
4 datalink
frame
5 physical interface
bits
physical channel
Figure 9.17: The basic structure of the TCP/IP protocol or Internet Protocol Suite (IPS).
Layers 1 and 2 are not part of the TCP/IP specifications.
(virtual terminal protocol), the File Transfer Protocol (FTP) and the Network File
System (NFS) and a few more.
The Network File System (NFS), originally called Open Network Computing
(ONC) is an addition to the set of TCP/IP protocols made by the company Sun
Microsystems. NFS conveys information about the directory and file structure of
computers that are connected to a network in the presentation form that is typical of
each machine. For example, on a Windows computer NFS shows files located on
other computers connected to the same network in the same tree-like format as for
the local files. On a UNIX system, each remote directory is shown as an additional
directory.
The File Transfer Protocol (FTP) provides a simple means to move files from one
computer system to another; it also provides facilities for managing files on remote
systems with common file operations like change directory, copy file, delete file,
rename file, etc. FTP only operates on complete files and does not deal with their
content: for example, under FTP there is no provision for opening a file to access
individual records. Each file is treated just as a stream of bytes.
The fifth TCP/IP layer cannot be compared to the OSI layers 5 to 7 as it does not
encompass protocols for communication, but instead includes specific application
programs that make use of the TCP/IP facilities. In particular, TCP/IP lacks the
presentation layer (OSI layer 6) with its definition of coding for characters and
symbols.
TCP/IP represents today a popular choice as protocol for data exchange in
industrial automation solutions, where several servers and workstations are
connected to one or more networks. The principal reason is again represented by the
fact that TCP/IP exists, is a mature product, its functionality has been tested, it runs
on different types of hardware and operating systems and is not unreasonably heavy
or requires too many resources and computing overhead.
TCP/IP was developed by users to be simple and practical. The simplicity of the
approach has meant its fortune. In comparison, the only standards developed
following the OSI models that have gained wide acceptance are the X.400 Mail
Service and the X.500 Directory Service. OSI will however play an increasingly
important role in the definition of new services, while TCP/IP will stay on, at least until
it will no longer be viable for the solution of those problems that will arise in the
future. For contained industrial communication problems TCP/IP will in many cases
represent the most feasible solution.
ring free /
mashed
star
bus
tree /
hierarchical
higher layers
Medium Access
Control (MAC)
Due to the fact that with LANs several stations can exchange messages, it is
necessary to introduce an addressing mechanism to uniquely identify the originator
and especially the destination of any message. The MAC sublayer of IEEE 802.2
specifies a standard for board addressing.
Each interface board connected to a LAN has an address with the fixed length
48 bits (6 Bytes). This address is used to identify the „source“ or „destination“ in the
messages exchanged between stations. MAC addresses are programmed into the
hardware of network interface boards at manufacture, normally on programmable
read-only memory. These addresses are supposed to be unique; on some systems
328 Chapter 9: Digital Communication in Process Control
the user has however the possibility to select and program a different address. An
explicit and unique board address is often referred to as a unicast address, as it
specifies a single station connected to a LAN.
Boards attached to a LAN will only accept and process data packets with a
destination address corresponding to their unicast MAC address. In addition are also
accepted broadcast and multicast addresses. A broadcast MAC address has all 48
bits set to „1“s. As the name indicates, a broadcast message will be accepted by all
receiving boards. Multicast addresses refer to groups of LAN cards that are related in
some way via their address structure. The LAN cards must be configured to be
identified as members of a particular multicast group.
A LAN is by no means a transparent medium to which the communicating
stations are simply connected to. It represents instead a system that has to be
specifically tuned in order to fulfill its function efficiently and satisfactorily. The
operation and performance of a LAN in terms of general throughput and average
delay before a transmission can take place depends principally on the type of MAC
procedure and the tuning of the related parameters. The importance of this work
should not be underestimated, because the wrong selection of the network
parameters can lead to overloads and bottlenecks, thus hindering proper operation.
The correct selection and definition of the operational parameters of a LAN is in
part a theoretical, in part a practical action. In particular special analysis- and
measuring instruments, called network analyzers, can be used to monitor the
network operations. Network analyzers present statistical values, like for example the
average data throughput, average and highest wait times, together with many others.
A network analyzer offers also the possibility to follow the structure and the path of
specific messages. The user must test different settings of the network parameters to
find an acceptable solution for each particular type of requirements.
station #2
wiretap wiretap
station # 1 station#3
The maximum length between the most remote nodes is about 2500 m; the IEEE
specifications suggest not to exceed 500 m. An unrestricted number of stations can
in principle be connected to Ethernet, a practical maximum is about 100. In general
the efficiency of the network drops with the number of connected transceivers.
The capacity of ThinWire Ethernet is less than ThickWire, however the first has
the advantage of minor cost and greater simplicity. The maximum length is 185 m
and the number of connected stations should be less than 30.
A new part of the IEEE 802.3 standard addresses the use of fiber optic cable as
Ethernet medium; the conductor is indicated as 10BASE-F. Also Twisted Pair cabling
is foreseen for short connections and is denoted as 10BASE-T.
Ethernet does not have a unit or device in control of the network and all devices
must decide independently whether they can access the medium. Consequently,
being the line entirely passive, there is no single-failure point. Ethernet supports
communication at different speeds on the same physical network, as the connected
units do not need to decode messages that they do not recognize to be explicitly
directed to them. The maximum data transfer rate is 10 Mbit/s.
At the data link layer (OSI layer 2, LLC sublayer), in Ethernet is defined a packet
format similar to the HDLC packet (Section 9.4.5). The Ethernet packet (Figure 9.21)
starts with a 8 Byte preamble with a 010101... pattern, then follow the destination
address and the source address, each 6 Byte long according to the MAC format. The
destination address may cover only one destination (unicast), a defined subset
(multicast), or all the stations connected to the network (broadcast). After the
destination address follows a 2-Byte type field, the definition of which does not follow
particular requirements and depends on the actual system implementation.
330 Chapter 9: Digital Communication in Process Control
The IEEE 802.3 frame has the same format as the Ethernet frame. The 16-bit
field immediately following the source MAC address represents the type field in
Ethernet and the length field in IEEE 802.3. The length field contains the number of
Bytes of data following the length field itself and before the checksum. A station
receiving a valid packet therefore examines the 2 Bytes immediately following the
source address. If this value is less than 1501 (hex 05DD) the packet must be of
IEEE 802.3 type, as that is the maximum allowed length for the data. To ensure
consistency with this definition, the minimum value for the type field in Ethernet
packets is hex 0600. A further difference between the Ethernet and the IEEE 802.3
frames is that in the latter the 8 Bytes following the length field are used for additional
protocol information to allow non-OSI packets to operate over OSI data link layers.
The actual user data begins after all this preliminary information. The length of
the data field is between 46 and 1500 Byte long; messages shorter than 46 Bytes are
padded with empty characters (the minimum length is required to ensure collision
detection). The packet terminates with a 4-Byte checksum. The minimum length of 46
Bytes for the data has been chosen so that a full Ethernet packet from the destination
address and including the checksum counts at least 64 Byte. Considering also the
start flag, the total packet length varies thus between 72 and 1526 Bytes.
The method used in Ethernet for medium access coordination is called
CSMA/CD (Carrier-Sensing Multiple Access / Collision Detection). This method
permits operation without a controller for medium access. According to the CSMA/CD
protocol, a station that intends to initiate a transmission has only to check that the
line is not occupied at that moment by another transmitting unit (Carrier Sensing); if
the line is free, a new transmission can begin (Multiple Access). The transmitting unit
controls constantly the quality of the signal on the line, comparing its own output
signal to what is on the line. If any other unit had attempted transmission at the same
time, after having also sensed a free channel, both units detect that their signals are
garbled (Collision Detection) and immediately stop transmitting. To ensure that all
units detect that a message collision has taken place, after the interruption both
transmitters put a short noisy jam signal on the line.
The time needed for an electric signal to travel the maximum cable length is
about 50 µs; in Ethernet operations this time is called time slot. If a transmitting unit
does not detect a collision for the duration of the first time slot, it is on the safe side
and can continue transmitting without any problems.
9.5: Local Area Networks 331
If two units must wait after a signal collision, they do it for a random period of
time of 0 or 1 time slots (0 or 50 µs) before they attempt a new transmission. The
probability for a new collision is now 50%. If a new collision occurs, the range from
which the waiting period is selected at random is increased by powers of two to 0-1-2
slots, then 0-1-2-3-4 slots and so on, up to a maximum of 0 to 1023 time slots (about
50 ms). In the case that a collisions still takes place, the units assume that the
problem has a different cause and report the situation to the higher communication
layers.
Another situation where error handling is not included in the transmission
protocol but left to higher layers is when the checksum computed by the receiver
does not match the one received with the message. A commonly used strategy is to
issue a request for retransmission only of those packets found to be faulty; if there is
no such request, it means implicitly that the received packet was OK. A different
operational strategy is the explicit acknowledgement of reception and acceptance of
each message. In order to avoid a competition between acknowledgement messages
and normal network traffic, the first time slot after a successful transmission is
reserved for an immediate acknowledgement from the receiver to the transmitter.
The Ethernet concept is flexible and open. The medium itself is cheap and it
does not have active parts like servers or network control computers, which could
break down or act as a bottleneck and tie up communication capacity. A
disadvantage of a network based on the CSMA/CD principle is that the probability for
collision increases with the number of connected units and with the length of the line.
Along with the probability for collisions increases also the time that is lost in trials.
This means in practice that there is no upper bound to the time it may take to access
the medium and transfer a message successfully. This is a drawback for industrial
real-time applications, where in some cases it is necessary to exactly know in
advance the worst-case performances.
Ethernet operates effectively when the packets are short and contain relatively
brief messages. Software applications that involve larger overheads, like client-server
applications or X-terminal connections require typical throughputs for which the
capacity of Ethernet is no longer adequate. In principle a long message can be split
in a several shorter packets, but this would substantially increase the load on the
network. Other solutions, based on higher-capacity media, must be used in such
cases. Some companies offer complete Ethernet-based communication packages
that also implement higher layer services in the OSI hierarchy.
which the token is passed makes the Token Bus a logical ring, although its physical
topology is a bus.
token
A B C
physical medium
D E F
Figure 9.22: The Token Bus operating principle. The stations A-F circulate the token. A
station can communicate only when it holds the token.
The devices connected to the Token Bus can be active or passive. Active - or
master - devices circulate the token and may transmit whenever they hold it. The
passive - or slave - stations may issue messages only when they are addressed by
an active station; their reply or acknowledgement must be immediate. Active devices
usually have computing capacity, they might for example be process computers,
robot controllers, programmable logical controllers (PLC) and other advanced
equipment. Passive units are sensors and other devices close to the physical
process which do not need to deliver information unless explicitly requested to do so.
The Token Bus specification has provisions for network management that
require the active participation of all devices. A new token must be generated when
the full system is powered-on, or in the case that the station which currently holds the
token should crash and destroy it. Other examples of network management functions
are configuration changes, addition and removal of stations, recognition and isolation
of faulty stations, etc. The length of the time slot, i.e. the time during which each unit
is allowed to communicate, can be selected.
Compared to Ethernet, the Token Bus has a computable worst-case waiting time
for a unit to gain access to the medium. This worst-case delay corresponds to the
total amount of time for the token to circulate around the units and for these to keep it
as long as they are allowed to as well as the maximum length of the messages. In
order to keep the worst-case time low, the time slots must then be kept short. On the
other hand, the allotted transmission time when holding the token becomes in this
way also limited, so that longer messages must be split up and sent in separated
blocks. With a short time slot, the network can be accessed faster, but the total
throughput performance becomes slower. Short messages get through faster, while
longer messages take longer because they must be splitted and sent in different
blocks. In the selection of the time slot must then be considered several factors like
the number of connected stations and the type, frequency and priority of the data to
be communicated in order to reach maximum efficiency.
The advantage of the Token Bus concept in applications with tight timing
requirements is that all parameters of the communication process are deterministic
and not probabilistic, so that the worst-case performance can be known with
precision in advance. On the contrary, Ethernet allows a transmission to be initiated
with no delay as long as the medium is free, but does not guarantee that this may
happen all the time, especially if the number of connected units is large.
9.5: Local Area Networks 333
Station 2
Token
Station 1 Station 3
Station 4
Figure 9.23: The Token Ring operating principle. The token is circulated among the stations.
A station can send messages only when it holds the token. Each station
recognizes the messages directed explicitly to it and relays further the others. A
message is passed further on until it reaches the station that originated it.
334 Chapter 9: Digital Communication in Process Control
9.5.7 FDDI
The new network standard FDDI (Fiber Distributed Data Interface) has been
defined by the ANSI subcommittee X3T9.5 to provide a framework for the application
of optical fiber technology in LAN applications. FDDI encompasses the first two
layers of the OSI model.
At the FDDI physical level are foreseen the use of different media in relation to
the distances to bridge: multimode optical fiber cable for distances up to 2 km and
monomode cable up to 40 km. Even twisted pair cable is foreseen as physical
medium, yet limited to distances of less than 100 m. The FDDI topology is dual ring
and communication takes place in both directions. The maximum number of stations
is 500, each one connected to both rings. The data transfer rate specified in FDDI is
100 Mbit/s.
The data is transmitted through one of the rings, defined as primary ring. In the
event of a physical disruption on the primary ring, the other one is used as backup,
whereby the data flow direction is reversed. If both rings are broken at a certain point
because of a full cable split the packets are routed on the remaining portions of the
ring. The same holds in the case of failure of a station. Should the cable be severed
at several points, each section can operate autonomously, thus providing at least
partial communication capability. In large FDDI applications additional links may be
installed between single stations as additional backup.
Network access is based on token passing, similarly to Token Ring operation.
The FDDI operation protocol provides for the autonomous recognition of the
connection status and functionality and the adaptivity to new situations, e.g. in the
occurrence of a network fault.
FDDI and Ethernet use the same addressing scheme for the connected stations,
so that the two networks can be easily interconnected via bridges.
FDDI is the first standard that provides a comprehensive reference for optical-
fiber based, high speed LAN applications in the 100 Mbit/s range.
Repeaters
The repeater is a signal regenerator, operating on two or more network
connections. Any signal received on the entry port is regenerated and retransmitted
on the output port or ports. A repeater operates at the physical level and does not
concern itself with the content of the data it relays. Repeaters are normally used to
increase the maximum operative length of line segments, for example to extend
Ethernet to over 500 m and to interface different types of mediums, like coax cable
and optical fiber cable, provided no changes in the packet format are required.
Due to the fact that repeaters do not verify the content of the data they relay, it
can happen that interference is understood as incoming data, so that the repeater
may generate and transmit further nonsense data.
Repeaters cannot be cascaded indefinitely, among other reasons because they
delay the signal along the path, so that limits are specified to the maximum number
and type of repeaters that can be installed in different network configurations and
operating together with other network communication devices. For specific details
one should refer to the standards and the technical literature provided by the
equipment vendors.
9.5: Local Area Networks 335
Bridges
Bridges operate at a higher level (level 2) in the OSI hierarchy. They connect
different bus sections together and provide for signal regeneration as repeaters do; in
addition they filter traffic by Media Access Control (MAC) Addresses. To do so a
bridge analyzes the packet headers for the sender and receiver addresses. If sender
and receiver are located on the same line segment, the bridge does not pass the
packet over to the other segments. If sender and receiver are located on different
sections, then the bridge regenerates and relays the packet. In this way, bridges
contribute to reduce the amount of traffic on each separate portion of the network.
Bridges usually are able to configure themselves automatically, by analyzing the
traffic on each line segment and determine which stations with what addresses are
located on what segments. The station connection topology can thus be changed
without need to reprogram the bridges. Bridges can furthermore be programmed for
specific filtering of messages to determined addresses.
When used in an Ethernet-type network, where the probability of the line being
busy is an exponential function of the number of connected stations and their
average communication load, bridges may sensibly help to increase line availability
and thus the total data throughput. Also fault tolerance of the system is increased, as
a interruption on one line segment would not interfere with operations on other
segments.
For a bridge to be effective, it is necessary to divide a network in several
segments, so that stations that need to communicate more intensively are located on
the same segment and their traffic remains localized.
Routers
Routers are comprehensive communication computers used to link together
networks sections. Routers operate at OSI level 3. They recognize the addresses
contained in the message headers and forward the packets correspondingly along
the network. Routers can even provide for protocol conversion and thus be used to
join networks operating with different physical, data link and network protocols (OSI
level 1, 2 and 3).
The difference between bridges and routers is that the first only „see“ a part of
the network, namely their connected links, while routers must contain a model of the
full network or at least an algorithm for the selection of a path for each data packet.
Special algorithms and strategies can be used to find an optimum path across a
network, for example the shortest path, the fastest, the least expensive or any other
that is selected and optimized according to specific criteria.
The differences in the communication devices are constantly changing as their
functionality is increased. In particular the borderline between bridges and routers is
progressively blurred, as bridges are built with more and more functions that
originally belonged to routers.
Gateways
Gateways operate on all seven functional layers of the OSI model. While bridges
and routers work only on the basis of the header information of data packages,
gateways also operate on the data content, for example to convert it from one
presentation format to another. Gateways are therefore used when it is necessary to
interface not only between networks of different types, but also between applications.
336 Chapter 9: Digital Communication in Process Control
In e-mail systems, for instance, gateways can ensure that messages encoded
following a standard used by a specific word processor can be understood without
loss of information by another e-mail program and another different word processor
operating on another computer. The same can apply for process-related real-time
information, if application programs follow different standards for encoding user data.
Depending on the specific case, however, it might be necessary to develop a specific
gateway system to interface among heterogeneous applications, if these do not
strictly and fully comply with open communication and data format standards.
together to carry out a certain production, there is a high horizontal exchange of data
(i.e. within the same level), to coordinate the operations of different machines, but
less vertical exchange to the higher levels. In fact, only the materials parts and
energy (material flows, energy flows) in input and output from the cell are of interest
for the higher levels. At production control level, the activity of several cells is
coordinated to reach an uniform material or energy flow (the output of a cell is the
input of another). Finally, at management control level are taken the global decisions
that affect the whole plant.
Table 9.1: Typical requirements for process data (all entries to be understood as orders of
magnitude)
Although necessarily very general, the hierarchical model offers a useful frame
for the analysis and structuring of control systems. The model is not necessarily
restricted to a manufacturing plant; equivalent levels are found in all complex control
systems. For example, in an aircraft autopilot the regulation loops for the
aerodynamic surfaces and for the engines are at the lowest hierarchical level; where
to fly is a „management“ decision left to the pilot. Moreover, the structuring in
different operational levels is by far not only academic. The design of data exchange
between real-time and administrative management systems is a necessary operation
for plant or process control logistics and represents a complex technical challenge.
management management
computer computer
management
control level
field control
level sensors S S S S S A A A A A actuators
Local processors or process interface modules are in direct contact with the
physical process and collect the process data via sensors and A/D converters. The
local processors also control the process via the actuators. The function of the local
processors may be exerted also by PLCs, local controllers or other types of units
connected to the process, like e.g. NC-machines.
9.6: Communication in Process Monitoring and Control 339
There are basically three methods to collect the process data from the sensors
and transmit it from the local controllers to the higher computers in the hierarchy and
to the central control unit.
A first method for data collection is used in telemetry. Telemetry is the preferred
mode of data reporting from the periphery to the central unit when handshaking and
communication in two directions is unfeasible or impossible altogether (e.g. in
spacecraft). In telemetry, all data is reported continuously in a predetermined form.
After a cycle is completed, a new one starts. The address of a parameter is its
position in the incoming data flow.
At the process control level data is collected by polling. A process computer
checks in an endless loop the current state of sensors, so that the data is periodically
updated in its internal database. With polling, the sensors or other peripheral units or
the local processor are periodically asked about their state and must reply to the
requesting unit. In this way it is guaranteed that the data is periodically updated.
Polling is the usual method carried out by the local processors with the
connected sensors, but sometimes it is also used by the central control units to
update their databases.
A third method is to report only the variables which changed their value with
respect to the preceding cycle. Digital variables are reported at each change, while
for analog variables is defined a transition band (see also Section 5.5.1). Only when
the value of an analog variable has changed by some percentage in comparison to
the last reported value, the new information is sent to the central unit. More
sophisticated methods include reporting data when the integral of the change of a
local variable has reached a certain threshold value.
Computers at each level must analyze, organize, process mathematically and
store the collected data before this is passed to the next higher level. The most
common mathematical operations on a set of process data are to find the minimum
or maximum value, the average, some statistical parameter or filtering, as illustrated
in Chapter 5. In this way the quantity of data to pass to the higher levels can be
reduced. In particular, he central processor and the communication channels should
preferably not be overloaded with the logging and transmission of static, i.e. non
changing, data.
In industrial automation systems is used a combination of the second and the
third method, a periodical and an event-driven update method, to report the data from
the sensors to the central control unit. Process values are reported whenever they
change; in addition a general update takes place at longer intervals, e.g. every few
minutes. In this way it is insured that the centrally stored data is reasonably
consistent. An example of industrial equipment for data collection, to be used at
process control / cell control level is shown in Figure 9.25.
In general, the choice of a data collection philosophy requires a careful analysis
of normal operations as well as of the special cases. When only changes of sensor
data are reported, the amount of data to communicate depends obviously on the
state and the operation of the technical process. For a long time there might be no
need to report anything, if a process is in a stable state. A sudden change in the
process, for instance following a change in some reference value, could lead to the
generation of such an amount of data to effectively clog the network. If the changed
process data is not buffered, some state information may be lost, and at the end the
central system may end up operating on wrong information.
340 Chapter 9: Digital Communication in Process Control
Figure 9.25: Field computer equipment for data collection [system ABB Advant OCS] to
operate at process control level (left picture) and at cell control level (right
picture) (courtesy of ABB Automation Products AB, Sweden)
The main advantage of the combined periodical and event-driven data collection
and update method is that the central unit and the communication channels are not
overloaded with the transmission of static data. On the other hand, if many monitored
values change at the same time, the communication channels of the distributed
systems can be overloaded.
The dimensioning of the channel and of the data processing units is a
fundamental aspect. There must be enough capacity to process the required quantity
of data and at the same time provide for safety margins. A simple rule of thumb is to
oversize the minimal required capacity with a factor of 3 to 10 times.
least 100 kbit/s. If a total of 15 units is connected to the FEP and produces an
equivalent amount of data, the total quantity that has to be carried is 360,000 bit/s.
Considering safety margins and processing overhead, a backbone network of
capacity 5 to 10 Mbit/s should be used.
The amount of data to carry to the higher levels may be reduced if the local
processors operate a selection of the input data. The local processors could for
example relay only one out of ten values for each measuring point, or the average
of these values, which would consequently reduce the total volume of data traffic
by a factor of ten.
control
computer
Front-End
Processor
backbone network
remote links
Fieldbus
Fieldbus
sensors
S S S S S
Figure 9.26: Data collection via Fieldbus controllers and a Front-End Processor
standards, even if it is technically feasible, is not consistent with the MAP scheme.
For example, a solution where Ethernet is used instead of Token Bus for the data link
and physical connection would not be a MAP application. However, MMS combined
with Ethernet works and also finds support in the industry.
At physical level, MAP can be implemented with different media and signal
types. The initial requirements by General Motors to transport data at 10 Mbit/s
require two adjacent channels with 6 MHz bandwidth if broadband AM-PSK is used.
For baseband-based MAP two data capacities are specified and FSK modulation is
used. For a capacity of 5 Mbit/s the FSK frequencies are 5 and 10 MHz; for 10 Mbit/s
the frequencies are 10 and 20 MHz.
A scheme similar to MAP but more suitable for integrated process-oriented and
administrative data communication is the Technical and Office Protocol (TOP). TOP
follows the same structure of MAP and is for the most part equivalent to it, referring to
the same standards as MAP. At the OSI layers 1 and 2 MAP uses the Token Bus
local area network, while TOP is based on Ethernet. At Layer 7, TOP is richer in the
choice of application interfaces: the Virtual Terminal (VT), the Message Handling
Systems (MHS) and the File Transfer Access and Management (FTAM) protocol.
The TOP concept has been supported by Boeing Corporation, which for long time
has had an Ethernet-based solution to connect their plant equipment with their
production planning system. The basic issues related to MAP and TOP are quite
similar.
MAP has been specifically developed to be used in factory environments with
real-time processing requirements. The reason behind the selection of particular
standards for MAP, and most of all for the choice of the broadband network and the
Token Bus medium access method, was that these had already been tested in real
plants and that Token Bus devices were already available. Token Bus has also a
specified and computable worst-case time limit for message transmission, which
Ethernet lacks. Some real-time applications cannot be designed with this uncertainty
factor. Not surprisingly, MAP and TOP were supported by companies with quite
different requirements because of the way their production is organized. General
Motors has production lines with the cars proceeding at a determined speed on the
assembly line, while at Boeing aircraft is assembled at fixed positions; the related
timing requirements are widely different. Compatibility at higher levels ensures the
interconnectivity of MAP and TOP applications.
In factory automation there are, generally speaking, three operational levels:
general management, process control or production line control and field control.
MAP supports the central levels of communication, it coordinates the operations of
multiple cells on a production line and of several lines at plant level. MAP is not apt
for communication and control down to the sensor level. MAP is a very „heavy“
product because of all the involved layers with the related protocols and does not
match the need for simple, fast and cheap technology that is required at the lowest
factory automation levels. Here a different technique, the Fieldbus, is used (Section
9.7). MAP is also not apt for management support at the highest levels where
strategic factory decisions are made. The software tools to use at that level do not
have to satisfy special real-time requirements and may be developed with the normal
programming techniques for statistical processing and the analysis of large data
quantities. However, MAP remains the key concept for the practical realization of
Computer-Integrated Manufacturing (CIM) applications.
344 Chapter 9: Digital Communication in Process Control
collected, or stored, at any time. The independence of the VMD of historical data to
be collected by the client and the specification that all requests be always
acknowledged by the VMD help avoid errors and inconsistencies due to lost or
delayed messages.
client device
MMS
MMS language
interface
network request
answer
MMS language
interface
virtual device
(server)
real device
operations on the
technical process
9.7 Fieldbuses
9.7.1 A Solution for Low-level Plant Communication
The emphasis given by OSI and MAP to interconnectivity at several levels with
all the necessary protocols to accomplish this goal does not always go hand in hand
with the requirements for fast, effective, and - not seldom - financially affordable
communication that is needed in industrial real-time applications. As already pointed
out in relation to the OSI model, not every layer is needed for all applications. When
all communicating units are located in a closed workcell and are connected to the
same physical bus there is no need for multiple end-to-end transfer checks as if the
data were routed along international networks. For the connection of computers in
the restricted environment of a factory plant, the data exchange definition of OSI
346 Chapter 9: Digital Communication in Process Control
layers 1 and 2 and an application protocol as that provided by MMS are more than
sufficient. There is little use for other layers, so that they can be skipped altogether.
In industrial applications, the largest share of the work (and of the costs) for data
collection and processing is not due to the central processing, but comes from the
field level, where the devices are installed. In order to reap the advantages of digital
technology, there is a growing request in the industrial world for a new digital
standard for low-level communication; this standard is known as Fieldbus. There is
no single Fieldbus yet, but different solutions have been presented by the industry
and by research institutions. In course of time, what has been proposed and is
operating in the field will crystallize around one or few technologies that will then
become part of a more general Fieldbus standard.
A Fieldbus standard must gain wide acceptance, as it has been the case with the
4-20 mA current loop. With an accepted standard, costs are kept down and problems
with incompatible components are minimized. In the same way as with the MAP
standard, a Fieldbus standard must guarantee the interoperability of different devices
that are connected to the same physical medium. An obvious advantage of digital
versus analog technique is the saving in the amount of cabling: a single digital loop
can replace a large number of 4-20 mA conductors.
The possibilities opened by Fieldbuses are considerable. A large share of the
intelligence required for process control is moved out to the field. Sensor
maintenance becomes much easier because operations like test and calibration can
be remotely controlled and require less direct intervention by maintenance personnel.
And of course, the quality of the collected data influences directly the quality of
process control.
Several standardization organizations, like e.g. the International Electrotechnical
Commission (IEC), are working on an international Fieldbus standard. National
projects have already started in different countries to define the aspect of a future
standard. A final agreement has not been reached yet, but nobody wants to wait until
a general standard is introduced. Some companies have already defined their
products and are marketing them. In particular, projects have been carried out in
France and in Germany to define national Fieldbus standards. In the end, all
experiences and proposals may come together into a single and widely accepted
standard, but it might turn out that the different, already existing, proposals will live
their own, parallel, lives.
In this Section will be briefly examined the main features of the industrial Bitbus
developed by Intel as well as the Fieldbus PROFIBUS from Germany.
9.7.2 Bitbus
Bitbus has been introduced by Intel in 1984; many industrial products of other
companies are based on it. Bitbus consists of the two first OSI layers: physical (OSI
layer 1) and data link (OSI layer 2).
At physical level, Bitbus uses twisted pair cable according to the RS-485
standard. A maximum of 28 devices can be connected to a single bus and several
buses can be joined together with help of repeaters. Transmission speeds are 62.5,
375 kbit/s and 2.4 Mbit/s. At the lowest speed (62.5 kbit/s), the distance between
repeaters can be up to 1200 m.
Bitbus is structured hierarchically. One of the connected devices acts as master,
all other devices are slaves. The master is always in control of the communication
process. The communication protocol is strictly causal: the master sends a message
9.7: Fieldbuses 347
to a slave device and the slave must reply; a slave cannot initiate communication on
its own, but must wait for a request from a master. A slave must reply to a master
request within a specified time. If the slave fails to respond, the master can try again
for a number of times. If still no answer is received, the master considers the slave
station to be unreachable and virtually disconnects it from operation. When several
Bitbuses are in operation and interconnected via a network, the master units act also
as network communication units. The Bitbus protocol does not foresee multiple
masters and there is therefore no arbitration method to transfer master right. In
general, a „strong“ unit (like e.g. a process computer) will act as master and the
slaves will be devices with simpler electronic circuitry.
The strict division in master and slaves has an advantage in real-time operations,
as it makes reaction times exactly computable in advance. The Bitbus packets follow
the general HDLC structure (Section 9.4.5); they are handled and sent as intertask
messages between the programs on the master unit and those on the slave units.
The application programmer, however, will not work directly at the packet level
because the bus functions can be accessed via predefined procedures in the Bitbus
support software. These procedures include functions to read and write from the
master unit in the memory of local units (and thus to and from the process to be
controlled), to down-load tasks and data, to start and stop tasks in the local units, and
so on.
Bitbus is a mature industrial product supported by several companies. It is a
good solution for smaller production cells or processing units with relatively limited
data traffic, where there is no need for several masters to control communication, yet
the real-time requirements can still be quite strict. In larger-scale applications, the
master units can be connected together via high-speed local area networks and
transfer the concentrated data to a central process computer at higher levels.
9.7.3 PROFIBUS
The PROFIBUS (Process Fieldbus) is supported by a group of German
manufacturers and institutions. PROFIBUS was initially developed under the
coordination of the German Federal Ministry of Research and Technology and is now
a German and European standard (DIN 19245 and EN 50170 respectively). Similarly
to the other Fieldbuses, PROFIBUS combines specifications at the OSI layers 1, 2
and 7 (physical medium, data link and application). PROFIBUS follows existing
standards at the different layers and attention has been paid to retaining compatibility
with hardware that is already in use. The most important bus operations do not
require specialized processors but can be carried out with programs running on
common CPUs.
The PROFIBUS physical medium is a screened twisted pair cable according to
the RS-485 specifications, with a maximum length of 1200 m (up to 4800 m may be
reached with the help of repeaters). Data transmission speeds are 9.6 kbit/s, 19.2
kbit/s, 187 kbit/s and 500 kbit/s. More recent realizations make use of optical fiber
cables and can therefore reach higher speeds.
PROFIBUS can operate with a single master always in control of the bus as well
as in multi-master configuration. Medium access is coordinated with a hybrid version
of the IEEE 802.4 token-bus model with master and slave stations. Up to 127
stations, divided in active and passive, can be connected to the bus. Active stations
circulate the token and may transmit when they hold it. Passive stations do not
circulate the token and must be addressed by an active station to be able to reply
with a message (Figure 9.28).
348 Chapter 9: Digital Communication in Process Control
token
A B C H
D E F G
Figure 9.28: The PROFIBUS operating principle. The master stations B, C, E, F and G
circulate the token and can communicate only when they hold it. The slave
stations A, D and H are not allowed to transmit spontaneously but must answer
to the requests of a master station.
The use of a public network to transfer data may also be determined by other
conditions. In some types of industries, e.g. power companies, the data must be
collected over a wide geographical area, like in the monitoring of power lines or water
and gas distribution grids. In some situation it might be unpractical for the company
to build its own communication line to see what happens at a transformer station
located 100 km from a power plant. This is a typical situation where the services of
an external communication provider can be of use.
The following description is a brief introduction to the main features of public
networks from the point of view of the user interface to the networks. It will not
describe the internals on how public networks operate.
A common interface between the computer or terminal and the modem is the EIA-
232-D (Section 9.3.6).
Modems operating with sophisticated coding schemes reach today about half of
the maximum theoretical speed as indicated by Shannon’s equation (Equation 9.3).
In presence of noise, their performance drops quickly and the need for error
correction schemes makes their throughput data rate actually less than for slower
modems. Typical current modems for dial-up lines operate between 1200 and 9600
bit/s, some reach up to 28800 bit/s on good lines with an high S/N ratio. Fast
modems can automatically switch back to a slower speed if poor line quality and little
available bandwidth require it. The speed of 28800 bit/s represents an upper practical
limit for transmission on conventional phone lines and will most probably not be
further increased. The trend today goes toward replacing analog lines with high-
capacity digital links altogether.
A solution that helps increase data transmission speed and is used in some
modems is data compression. For instance, instead of sending 100 „0“’s in a row, it is
more efficient to send a control code followed by a message specifying that the next
100 characters are „0“. The efficiency of data compression depends on the nature of
the data. It can bring notable gains in data with redundancies, but does not help if
input data is non-repetitive and follows a random-like pattern.
Circuit Switching
Circuit switching is a different denomination for the use of modems on the phone
network. A phone link is dialed up and remains connected for the whole duration of
the communication. The operational costs depend on the time of establishment and
duration of the connection.
Leased Lines
A leased line is a permanently open connection between two fixed points. Lines
leased for data transmission are normal, analog lines that have been conditioned, i.e.
especially calibrated and shielded in order to offer more bandwidth and a better S/N
factor, which gives higher data transmission capacity. The rental costs for leased
lines is fixed per month or year and does not depend on the amount of voice or data
traffic. For data transmission on leased lines are used modems with typical speeds
from 19.2 kbit/s, 56 kbit/s and higher.
used in telex and for e-mail transfer, but is in general of no interest in industrial
automation applications.
A particular type of message switching network is Internet, which has won
worldwide reputation in the last years. Internet is an extremely flexible message-
switching network that has been technically built on all possible combinations of
digital networks connecting mainframe computers, mainly located at universities and
large corporations. The use of the TCP/IP protocol and routing scheme allow users to
exchange messages and interact worldwide.
It must be kept in mind, however, that Internet does not guarantee any type of
performance, neither that a message actually reaches its destination nor that it does
it within a predefined time. Internet cannot therefore be considered as a means for
real-time, process data communication. If it is necessary to monitor an object located
far away, some kind of digital communication link must be provided anyway to
connect that site with the nearest Internet server computer, from which messages
would be relayed to the central processing system. In such case, one can ask the
communication service provider to relay the digital messages directly to their
destination, without having to make a detour via Internet.
Companies with strong public-relations needs, like power utilities or chemical
industry, might want to establish Internet sites to present themselves to an interested
public or even allow to follow in real-time some basic aggregated processing
parameters (e.g. the instantaneous power production and consumption balance in a
power utility). This data is however not critical for operation of the system, and any
fault in Internet communication would have no negative consequences. Internet is no
suitable alternative for any type of process communication with defined quality and
timing requirements.
Packet Switching
The state of the art in digital communication is packet switching, which offers a
virtual network connection between the communicating nodes. The data from the
sender is divided in packets of limited length (up to some hundreds of Bytes each).
Each packet contains protocol information like destination address and sequence
numbering. The packets in the network are routed toward their destinations on virtual
channels. Each packet is routed independently of the others, so that it happens that
packets addressed to the same destination actually take different physical routes.
Under particular network load conditions, some packets could even reach their
destination before other packets that had been sent earlier. Thanks to the sequential
numbering, the last network node before destination can keep track of the right order
and reorganize the packets before forwarding them to their destination.
Packets from different users are multiplexed on long-distance channels, so that
network capacity is used more effectively than with direct connections and circuit
switching. The network can also be more evenly loaded because digital users do not
require full transmission capacity all the time, but transmit high-capacity data bursts
for short time periods. In this way, the users tend to compensate for each other on
loading the channel. Another important advantage of packet switching is that, in case
of a node crash, packets can be routed on a different path without the end users
noticing it and having to intervene. Thanks to these features, packet switched
networks normally show high availability factors. The costs for utilization of packet
networks depend usually from the total duration of the virtual connection (reflecting
the fact that equipment is ready to transfer the data) and the quantity of the
9.8: Communication over Public Networks 353
routed like conventional phone calls and is not limited to fast point-to-point
connections. As physical medium for Broadband ISDN optical fibers are used.
The two channels of the basic service have been introduced for marketing
reasons. With ISDN, a normal customer only interested in voice services would
notice a better signal quality and a faster connection time compared with the
conventional, analog voice network, but this alone is hardly a sales argument. The
advantage of providing two services at the same time, as would be the case with
voice and FAX, is for many users the deciding factor. Another argument in favor of
ISDN is that it does not need the rewiring of the end user connections; the
connection to new digital toll exchanges can be implemented via the older cabling.
With ISDN no special data networks would be necessary, as ISDN is a digital
network on its own. Thanks to the fact that ISDN was defined in detail before its
implementation began, all telecommunication administrations from different countries
can build ISDN following the same guidelines, thereby keeping compatibility
problems for equipment and network to a minimum. The industry produces ISDN
hardware for a world market and does no longer have to support several different
versions of the same product to use in different countries, as it has been the case
until not long ago.
9.8.4 ATM
ATM (Asynchronous Transfer Mode) represents a very fast switching technology,
developed to integrate heterogeneous types of digital traffic, including digitized voice
and video signals, which require high bandwidth together with no sensible delays in
transmission. In ATM it is not distinguished between the type of traffic, but all
information is conveyed in packets of 53 Bytes length, called cells. Each cell contains
a 5-Byte header with protocol information and 48 Bytes of user data. The fixed-length
definition is necessary for the design of high-speed, high performance switching. The
packet length may appear strange and is actually the result of a compromise
between two different sets of requirements. Short cells are more suitable for voice
and video transmission, while long cells fit best for data transmission. In course of the
definition of the standard the compromise was found at the intermediate length of 48
Bytes. In ATM, data packets longer than 48 Bytes are split in cells at the first node
and reassembled at the last node, similarly as for network packet switching of X.25
type or ISDN communication. Communication paths are virtual, but on establishing
communication all network devices are pre-programmed with routing information so
that, once communication is started, the cells can be immediately forwarded to their
destination without an analysis of the header information each time.
The ATM standard provides for different types of service, depending on the
application. Basically, it can be chosen between a constant bit rate between source
and destination, or a variable bit rate. The first service is necessary for applications
like voice transmission, where no random delays are acceptable. The second service
is suitable for e-mail and file transfer applications, where some delay between
transmission and reception is acceptable, especially if it helps to lower the
communication costs.
The most known standard interface to ATM is SONET (Synchronous Optical
Network), providing for 622 Mbit/s data transfer rate on optical fiber and 155 MBit/s
on twisted pair cable. Other standards are available for lower data rates, down to 1,5
Mbit/s, while other standards for higher speeds are expected to be defined in the
future.
9.9: Summary 355
9.9 Summary
Communication plays a central role in the operation of complex systems, where
different components must exchange data. The importance of communication in a
production or processing plant is shown by distributed control systems, that fully
depend on the data exchange among the different components.
The key parameter to describe communication capability is the capacity (in bit/s
or some multiple) of the communication channel. The capacity is function of the
channel bandwidth, of the noise on the channel and of the used coding method.
The Open Systems Interconnection (OSI) scheme has been introduced to bring
order in what is meant by „communication“ and „compatibility“. In OSI are defined
seven layers for the different aspects of communication, from the physical layer
(cabling, plugs and electric signal levels) to the application layer, where programs
can exchange information on predefined objects (files, production equipment) using
standardized descriptions. Several communication standards have been defined on
the basis of OSI.
Some solutions at physical medium and data link level are particularly important
in industrial automation and process control. Twisted pair, coax cables and optical
fibers are used to carry data. Important electrical interfaces are EIA-232-D, UART
and RS-485; all of them were treated in this Section. Widely used data transmission
protocols are HDLC and other protocols based on it (e.g. the Ethernet protocol) and
the TCP/IP protocol. The latter was initially developed for data transmission along
complex, interconnected networks but has been shown to be a sound product also
for self-contained networking application in industrial environments.
Two comprehensive concepts for information exchange in industrial processes
are MAP (Manufacturing Automation Protocol) and TOP (Technical and Office
Protocol). They are oriented to different aspects of industrial processes (production
vs. administration) and are also largely compatible with each other. Both MAP and
TOP are resource-intensive products and support the interconnection of a large
number of devices in medium-size to large plants.
Communication solutions used in low-level (or „factory-floor“) industrial
automation usually implement the OSI layers 1, 2 and 7. Fieldbuses cover those
levels with products especially designed to operate in industrial environments. The
development of LAN technology as well as the availability of low-priced, flexible and
standardized communication equipment are the reasons for the success of digital
technology at all levels of industrial automation, down to the sensor and actuator
levels. Thanks to new digital solutions like those provided by the Fieldbuses, sensors
and actuators can incorporate some processing capabilities and communicate
directly with data processing equipment, without the need for analog signal
conditioning and processing.
There is no field like communication where the issue of standardization is so
important. When a new technology must be used, but the related standards are still
missing or not fully formalized, it is suggested to use equipment by one single and
recognized manufacturer. This must however be committed and take responsibility to
provide the means for the future integration of his products in new frameworks
eventually provided by new standards.
356 Chapter 9: Digital Communication in Process Control
Further Reading
The classic reference for the foundations of communication theory is [Shannon /
Weaver 1949], a collection of their famous articles about the statistical analysis of the
communication process.
[Tanenbaum 1996] tells almost everything that is to be told about computer
communication, at a very high level and yet not boring, while [Tanenbaum 1995]
deals with computer communication networks as fundamental components in
distributed computer systems. Both books are strongly recommended, as
Tanenbaum is one of the few authors who can provide a very solid technical
foundation, breaking established writing patterns to provide new insights, yet never
leaving safe ground.
[Black 1989] is a modern and comprehensive guide to communication at large,
dealing with data transmission as well as with data and voice communication
technology as operated by telecom companies. The text contains also quite detailed
specifications about communication protocols. [Held 1989] describes data
communication by focussing on the equipment (modems, multiplexer, interfaces). It is
quite advanced reading, illustrating in detail the communication via public data
networks. The TCP/IP protocol is described at detail and with a good balance
between theoretical principles and practical issues in [Washburn / Evans 1996]. This
book provides a good perspective also on networking issues more at large.
A general introduction to PROFIBUS is given by [Bender 1990]. The complete
standard is available as DIN (German standardization organization) document (DIN
19245, Part 1 and 2). An overview of the proposals and expectations for a general
Fieldbus standard is given in [Wood 1988]. The issues related to open
communication for Fieldbus devices is treated in [Warrior / Cobb 1988].
[Kaminski 1986] describes the major ideas behind the MAP concept. In a parallel
article in the same journal issue, [Farowich 1986] introduces the TOP protocol. Some
other books about MAP and TOP have been published meanwhile.
The September 1991 issue of the journal Scientific American provides a good
introduction to the current state of things in communication technology. Together with
articles by American experts on data technology and artificial intelligence, the then
Senator and now US vice-president Al Gore makes a point for data superhighways
for the whole USA [Gore 1991].
Documentation about all the mentioned norms and standards can be ordered at
the national standardization organization. Some addresses are reported in the
Appendix „Standards and Standardization Organizations“.
10 Real-time Programming and Operating System
Support
Overview
The control of industrial processes is a complex task that is usually carried out
by several computers linked together and with different specializations; this concept
was presented in Section 9.6. The way the computers are programmed depends
mostly on the required response speed. Computers at the highest hierarchical level
usually run programs for database management and statistical analysis. These
programs might run e.g. once per day and therefore there are no strict requirements
on the response time; they are developed with the usual techniques used for
administrative systems, which are amply described in programming textbooks. The
case of computers at the lowest level is different; these are directly in control of the
physical processes. Here the timing requirements are usually so strict that special
programming methods and techniques must be used. These methods are the
subject of this chapter.
Hardware is as important as the software for building efficient real-time computer
systems. In a sense, hardware and software are logically equivalent; many solutions
can be realized with hard-wired circuits as well as with program instructions. In
general, hardware capacity must be available and the software has to exploit it. But
there are situations in which the software seems to fight against all the possibilities
the hardware can offer.
The purpose of this chapter is to present what real-time programming looks like
in practice. Ideally, a programmer is not supposed to leave the protected
environment of a programming language from which - according to language
handbooks - everything can be done. In the real world, programmers work with direct
calls to the operating system, write resident code and mix languages. In this chapter
it is not taken a stand for or against certain programming techniques, but rather on
the background of operating systems theory it will be shown how some problems can
be solved in practice.
Section 10.1 deals with the basics about programs and processes and Section
10.2 introduces some basic operating systems concepts, for one-processor as well
as distributed systems. Sections 10.3 and 10.4 treat the problems of resource
protection and mutual exclusion and introduce constructs for their solution (e.g. the
semaphore). Section 10.5 deals with interprocess communication and Section 10.6
with practical methods for real-time programming. A presentation of some languages
and operating systems for real-time programming in Section 10.7 concludes the
chapter. The material is formal-theoretical in the first five sections and practice-
oriented in the last two.
357
358 Chapter 10: Real-time Programming
In most cases it is not possible to build real-time systems using the normal
methods for sequential programming. In real-time systems different program
modules or tasks have to be active at the same time, that is, operate in parallel
where each task is assigned to a specific function. This kind of programming is
known as concurrent programming to lay stress on the cooperation among the
different program modules. Concurrent execution may take place on the same
machine or on several CPUs connected via a network in distributed systems. In this
Chapter will be examined the principal issues related to both cases.
higher memory
addresses
stack
stack pointer
the stack expands
toward lower
work area addresses
(heap)
data area
(constants and
variables) data pointer
code pointer
program area (program counter)
lower memory
addresses
cobegin
x := 1;
x := 2;
x := 3;
coend;
write (x);
The execution of the instructions between the keywords cobegin and coend is
parallel (Figure 10.3). This instruction corresponds also to the generation of threads
on multitasking systems. The instruction cobegin does not impose conditions on the
relative order of execution for the different processes and the instruction coend is
reached only when all processes within the block are ended. If the execution were
sequential, then the final value for x would be 3. With concurrent processes it is not
possible to predict the final result with certainty; the tasks are executed, at least from
10.2: The Management of System Resources 361
an external viewpoint, at random. The final value of x in the example shown can
equally well be 1, 2 or 3.
cobegin
s1 s2 ....... sn
coend
operating system presents the user with such a homogeneous structure that the
underlying hardware is no longer recognizable. The user can place commands at will
and the operating system will determine the most appropriate way and location to
execute that command.
Distributed systems are used in computer control systems because the type of
application is inherently distributed and therefore there is an immediate match of
hardware and software in the distributed system and the control application.
An example in this sense was shown in Section 9.6. A complex technical
process can be organized in different levels and the client system matches these
levels with computer for data collection, organization and transmission at higher
levels. This type of distributed systems satisfies the principles listed above: it is more
economic than if a single CPU that would do everything (provided it could be built); it
is safe in the sense that - assuming that the system is well structured - the failure of
one component does not hinder the operation of the others and can be built to match
the process requirements.
The issue of safety is itself not immune from problems. In a distributed system,
processes running on different hardware depend on each other and on the network
operations. If a process on any machine, or the machine altogether, crashes, or if the
communication does not work properly, then not only the involved processes would
stop but also any other processes depending on them, for example because they
wait for answers that do not arrive.
Distributed systems need radically different software than centralized systems
do, because they are intimately connected with the network. A network operating
system must deal with machine resources as well as with network resources. The
operating system functions therefore cannot be decoupled from corresponding
network functionality. The operation of the network has a notable influence on the
operation of a distributed system. In fact, network operating systems are structured
in a layered way similar to communication protocols (see Section 9.2).
The major difference in single-processor vs. distributed system architectures is
the way to communicate among the processes. This operation is one of the most
important in multiprogramming and real-time programming and is going to be treated
more in detail later in this Chapter. Basically, when processes exchange data on a
single-processor system, they can do it by writing these data in some memory
location from where other processes can read it. A multitasking operating system can
manage the orderly writing in and reading from memory.
In a distributed system instead there is no common memory as such and
interprocess communication takes place by exchanging messages. When a process
has something to communicate to another, it builds a message and calls an
operating system routine to forward the message to its destination.
This communication principle is at the base of one of the most important
concepts in distributed operating systems: the client-server model. In this model, a
procedure or program (the client) may either request services from another program
or (the server) provide services to other programs. The „services“ consist of self-
contained operations like carrying out a computation, fetching external data or
performing an operation on a device, as for example painting a figure on a computer
screen. In a sense, the client-server model can be looked at as a more extensive
type of subroutine call, in which the server plays the role of a subroutine or system
procedure.
The client-server model is based on the exchange of messages between
programs. If the client and the server run on different machines and the messages
10.2: The Management of System Resources 363
must be routed along a data network, then the computer system operation is
distributed.
The more server and client procedures have computing capacity and can run
advanced functions independently, the more the number of network messages and
thus the load on the network is reduced. In fact it is an important advantage of
distributed systems that resource-intensive computations can be performed locally,
and that the different computers need exchange less data, although at an higher
abstraction level. In other words, in a well-designed system the messages
exchanged among machines contain information about the goals to reach („setpoint
is x=78.2“) and not about all intermediate steps to perform in order to reach that goal
(„what is x now?“, „x=63“, „increase with 16“. „What is x now?“, „x=79“, „decrease by
1“, etc.). The intermediate steps are taken care of by the addressed computer,
provided the software is designed accordingly.
machine #1 machine #2
machine #3
resulting network load, that may reduce the performance of a system, if not hinder its
operation altogether.
Examples of operating systems used in distributed environments are UNIX,
OSF/1 and Windows NT. They will be treated more in detail in later Sections of this
Chapter.
process nr.
time
(a)
process nr.
(b) time
Figure 10.5: The principle of multitasking: (a) macroscopic effect; (b) CPU time division
366 Chapter 10: Real-time Programming
The macroscopic effect of the CPU time division among the processes is the
parallel execution of n processes. When n processes run in parallel in the system,
then each one of them „sees“ a fully dedicated CPU of capacity 1 n (that is, n times
slower) compared to the original, physical CPU. The execution of several tasks on
the same CPU or on different CPUs are two different realizations of the same logical
principle. In the first case the processes are distributed spatially, in the second case
they are distributed in time. Apart from overhead due to scheduling and intertask
communication, if n processes run on k processors, each process is ideally
assigned to a processor of capacity k n compared to the original one.
A basic multitasking system on a single-processor computer consists of a
procedure to save the context of a process on the stack or at defined memory
locations and restore the context of another process to continue its execution where
it was halted. A system program called scheduler selects, usually by means of some
priority mechanism, the next process to execute from among the loaded processes.
The scheduler runs itself as a process that is automatically restored after every
interruption of a running process.
The process switch operations are time critical and must be realized with
maximum efficiency. In processors that were not designed from the beginning for
multiprogramming, the process switch procedure must save on the stack the content
of all registers and other context parameters and then save the pointers to the stack
in a protected data area. Some processor types have been originally designed to
support multiprogramming and have compact instructions to save and recall the
content of all the registers and other context variables.
When the context of a process is saved, it is not necessary to also save the
values of the process variables. These are namely located in the process memory
area that is usually already protected by the operating system against changes by
other processes. The same does of course not hold for the CPU registers, which are
shared by all processes and whose content is changed all the time.
To be able to halt CPU execution at regular intervals in order for a different
process to be executed, a timing device external to the CPU is needed. A system
timer sends interrupt signals called „ticks“ to the processor at defined intervals, a
typical rate is one tick every 1 ms. At each tick, the CPU briefly suspends its
operations to check whether the current process has to be interrupted and a new one
loaded. The action that forces a running task to halt its execution in order to allow
another task to run is called preemption.
The minimal time interval assigned to each process before it is interrupted is
called time slice; it has the length of a few ticks. The length of the time slice
influences the performance of the system. If the time slice is short (~10-20 ms), the
system is quick to react to external events such as interrupts or terminal input, but
the process scheduling overhead gets an important share of the total CPU time. With
a longer time slice, the processes execute more effectively with less overhead, but
the reaction time gets slower.
The tick interrupt is not the only way to stop a process and transfer execution to
another. A process can stop on its own either because it has reached the end or
because it is idle waiting for an event, such as an I/O operation with a physical
device and that would take several ticks to complete.
A process executed in a multitasking environment can be found in different
states. These states are commonly shown with the help of a diagram (Figure 10.6);
they are defined as follows:
10.2: The Management of System Resources 367
waiting
4
1 2
removed ready running
6 3
In Figure 10.6 it is also shown what changes from one state to another are
possible:
1. From „removed“ to „ready“. The process is loaded from disk to central RAM
memory, with relocation of all the relative addresses and assignment of the
work areas (code, data, heap, stack) with the related pointers.
2. From „ready“ to „running“. The process is selected by the scheduler to run and
is assigned CPU control via the process switch procedure.
3. The opposite change, from „running“ to „ready“, is controlled by the same
process switch procedure when it is time to let another process run. This may
be initiated by the running process itself, that for example must wait for a slow
I/O operation, or by the scheduler or another system program that forces the
interruption of the execution of the running process (preemption).
4. From „running“ to „waiting“. The process enters an idle state to wait for an
external event, that is often an I/O operation with units much slower than the
CPU. In some cases the process must wait for a determined period of time
because of an explicit program instruction.
5. From „waiting“ to „ready“. When the awaited event has occurred or the required
time has elapsed, the process is not immediately executed but is put instead in
„ready“ state. The scheduler will later determine when the process can be
executed again.
6. When the end instruction of a program is reached, the operating system may
eliminate a process from central memory.
368 Chapter 10: Real-time Programming
secondary memory (hard disk) and are loaded to RAM only when they are needed.
This is acceptable for time-sharing and batch jobs when differences of a few
milliseconds or even seconds to start an execution are not very important, but not for
real-time systems in which there must be no delays in execution. For this reason, in
real-time systems the processes are usually always loaded in RAM ready for
execution. However, disk memory support could still be necessary in real-time
systems because the central memory is not always large enough to fit all programs
and their data.
To be able to utilize more central memory than what is physically available, on
middle- and large-sized computers the virtual memory management technique is
used. Virtual memory works on the assumption that the total size of processes and
data may be larger than the RAM space at disposal. A mass memory unit (e.g. a
disk) that allows fast data exchange with central memory is used. The mass memory
unit must be large enough to hold the total memory space required by all processes.
The operating system copies form the disk to RAM memory only those parts, called
pages, of a process and of its data area that are currently being referred to during
execution, while leaving the rest on external memory. Optimization strategies are
used to load the pages identified to be the most frequently used and to reduce the
number of disk accesses. With virtual memory, a process may address a space
larger than the one actually at disposal in central memory. On the other hand, virtual
memory adds notable overhead and slows down system operations because of the
repeated disk accesses.
The main reasons for the use of virtual memory and disks in real-time systems is
mainly economic. The central memory is more expensive per unit of stored
information than secondary mass memory. Another important aspect is operation
safety. In case of a system crash, it is possible to restore operations almost to the
point where the crash occurred if a constant copy of the processes and their data is
stored on disk. If a crash or a power failure occurs when the whole system is only
loaded in RAM, then all processes and their data would be wiped out, with no
possibility to restore them.
In real-time systems virtual memory is of interest only when it is fast and
efficient. To ensure fast reaction to external signals, the related service routines must
be permanently stored in central memory. Another important consideration related to
the use of secondary memory in real-time applications is whether it can be used in
the operating environment. Hard disk and floppy drives cannot be used in
environments with strong vibrations, shocks or intense magnetic fields.
One of the major differences between multi-user and real-time operating
systems lies in file management. The most important issues in multi-user systems
are directory structure and file protection. The management and protection of
directories, with the related controls and verifications at each access, impose an
overhead that is seldom acceptable in real-time systems. However, these activities
are usually not necessary in real-time systems because the mass memory storage is
mainly used for logs and reports, and moreover all processes belong to the same
owner. For all these reasons the need for a complex file system is usually not
warranted in real-time systems.
The most sophisticated operating systems allow the tuning of CPU and memory
management parameters to achieve optimal performance. The process priorities, the
length of the time slice, the page size in virtual memory and other operating system
parameters must be selected and combined in order to maximize the desired
performance.
370 Chapter 10: Real-time Programming
that accepts as input from other processes the names of the files or other data
objects, organizes them according to some precedence criteria and sends them one
at a time to the requested unit.
Data networks are still faster hardware resources that on the one hand must also
be protected from concurrent access, but on the other hand must be shared among
many users. Methods for the access to data networks have been shown in Section
9.5. These methods have many similarities with the methods for resource protection
used in programming. Still other methods are used for the protection of resources
with very short access time and which are continuously referred to by different
processes, as for example variables in central memory, records in a file or I/O
interfaces on a data bus. This section is mainly devoted to such methods and will
show different approaches together with their consequences.
The goal of a correct coordination of resource access is to define procedures
and methods so that at least one process, but only one at a time, can access the
resource. In the definition of such procedures one should avoid defining the limits too
narrowly, otherwise execution would no longer be parallel and the processes would
depend too much on each other.
The principal rule for resource protection is that a process must never change
the state of a shared resource while another process has access to it. Or more
generally: a process should never access a resource currently used by another
process, independently of whether or not it is going to change its state. The second
rule is more restrictive but simplifies practical control operations because it is not
necessary to keep track of what operations each process is going to perform on the
resource.
A first, elementary, method to guarantee resource protection is to disable
interrupts while a resource is accessed. This effect is achieved by blocking the
reaction of the processor to the interrupt signals. As process switching is initiated via
an interrupt, disabling the interrupt prevents process switching as well. A process is
then guaranteed to work without interruptions when it accesses a shared resource.
Obviously, this is not a good solution. Interrupts should normally be enabled all
the time to ensure quick reaction to special conditions that require immediate
attention. In a control system part of the program modules are controlled by
interrupts and disabling them can inhibit the processor from reacting to fully
legitimate requests. If interrupts are not buffered after they have occurred and
handling is disabled, they may remain unserviced.
Interrupt disabling should then be used with extreme care and only when no
other solution is feasible. It should also be limited to a few code instructions.
The above statements relate to the two correctness properties safety and
liveness. Safety means that access limits have to be respected, so that a protected
resource is not accessed by more than one process at the time. Liveness indicates
that a program at some time will do what it is supposed to, or, in other words, that it
will not stop and wait indefinitely. Safety is a so-called static and liveness a dynamic
property. Safety can always be obtained by giving up some or all concurrency
between the processes. In fact the safest programs are strictly sequential, because
no parallel access to a resource from different parts of the program is possible
altogether.
A practical and common method to manage access to resources is to use
protection variables. A straightforward protection method is based on the use of one
binary variable, f1. This variable is changed by both processes so that one of them
has access to the protected resource when f1=true and the other when f1=false.
begin
f1 := true;
cobegin
coend;
end. (* protect_example *)
This solution satisfies the mutual exclusion principle: the two processes control
the value of f1 and enter the critical region only when f1 takes different values. A
process in the critical region may be assumed to be the only one there.
On the other hand, this solution introduces new problems. The slowest process
determines the total execution speed. It does not matter if A runs faster than B or
vice versa, because every process must wait until the other has changed the value of
f1 before it can run again. In addition, should a process stop execution for any
10.3: Mutual Exclusion and Deadlock 373
reason, even the other would have to stop, at most after one loop. Moreover, the
continuous test loops on f1 are a waste of CPU power.
These problems are a consequence of the introduction of the control variable f1,
which creates unnatural bonds among the processes in order to synchronize them.
Modules that should in principle be independent are tied together by f1, which
actually makes a sequential process out of the two modules. The same result would
be obtained by eliminating f1 and executing both processes in succession in a single
loop.
In a different solution, the protection variable f1 is reset after the test on its value
and before accessing the protected resource:
In this case the processes are disjoint (and thus the liveness condition is
satisfied), but the solution is not correct either. If the interrupt for process exchange
halts process A after the test f1=true but before the assignment f1=false and process
B does a similar check on f1, then both processes are enabled to access the
protected resource against the safety property. The use of only one protection
variable for a particular resource leads to the need for protecting the variable, which
has now become a common resource itself.
Some solutions based on the use of several protection variables have been
proposed, but basically they can be considered as curiosities of little practical
importance. In conclusion, it is better not to introduce new variables for
synchronization of parallel processes because they bring new bounds and become
themselves common resources.
To circumvent the problem, some computers have an instruction called
test_and_set (TAS) which combines the check of the state of a boolean variable
and its setting in one operation which cannot be interrupted. The importance of the
test_and_set variable is due to the fact that other synchronization and resource
protection procedures can be built on it. The fact that the test on a variable and its
modification are unified operations is sufficient to ensure protection.
The test_and_set instruction is functionally equivalent to the
read_modify_write cycle in the VMEbus system (see Section 8.3.2). In both cases,
it is necessary to be able to count on the indivisibility of the two operations, read and
write. If the instruction test_and_set - or a similar one - is not present in the used
programming language or in the microprocessor instruction set, it can be realized if it
is possible to disable the interrupts for the brief time of its execution.
The practical realization of critical regions and mutual exclusion in a distributed
system presents particular problem of its own. To begin with, there is no direct
equivalent of the test_and_set variable because here is not just one processor. In
principle, a central coordinator could be assigned to every resource. Any process
wishing to access the resource would first ask the coordinator, which then grants
permission to the requesting processes one at the time. However, this solution is
much less straightforward than it seems. The central coordinator process acts as a
single point of failure, if it crashes the resource remains either blocked or
374 Chapter 10: Real-time Programming
10.3.3 Deadlock
The deadlock is the state when some or all processes in a system are halted
and wait for something to happen. If for each process this „something“ can only be
initiated by another of the waiting processes, then all processes end up waiting
endlessly in a deadlock condition (Figure 10.7).
B C
wait for „A“ B
wait for „B“
(a) (b)
Figure 10.7: The deadlock. (a) Mutual deadlock; (b) circular deadlock.
A different case of deadlock is when one or more processes still run but fail to
make any progress. This situation is called starvation; this is for example the case
when running processes continuously test the value of a condition variable which is
not going to be changed because the other processes are also busy testing. In other
words, deadlocked processes are in the „waiting“ queue (i.e. they are blocked) while
starving processes are „ready“ or „executing“, but do not make any progress.
Deadlock and simultaneous access to a protected resource are two symmetrical
problems related to extreme situations. In one case each process waits for the others
to move first, in the other many processes move together.
10.3: Mutual Exclusion and Deadlock 375
greater than 0, it is decreased by 1 and the process calling the wait instruction can
proceed. If the semaphore has value 0, the wait is halted at the wait instruction until
the value of the related semaphore is increased again by another process with a
signal operation. Only then is it possible for wait to decrease the value of the
semaphore and proceed with execution.
It is very important is that the operations of test and decrement of the wait
function are executed in one step only. The operating system is not allowed to break
the execution of wait after the test on the value and before the decrement operation.
The semaphore wait has the same operational significance as the function
test_and_set.
If several processes are waiting for the same signal, only one of them may
continue its execution when signal is given. Depending on the implementation, the
processes may wait in an ordered „First In, First Out“ queue or be selected to
proceed either at random or according to their priorities. The semaphore function
alone does not imply a given wait and execution order.
The names of the functions signal and wait have mnemonic meaning: signal is
associated with a „go“ to a process and wait is self-explanatory: if the semaphore
has value 0, the process must wait for a signal. In the literature are also used other
names for the functions signal and wait, although the function is basically the same.
With the introduction of semaphores, the resource protection problem of Section
10.3.2 gets a straightforward solution:
begin
P1 := 1;
cobegin
coend;
end. (* sem_example *)
378 Chapter 10: Real-time Programming
With the use of semaphores, the two processes can access the common
resource in an ordered manner. No unnatural bonds are introduced: if one process
runs faster than the other one, it will just access the resource more often in a given
time interval. A process is forced to wait for the other one only when the latter is in
the protected area. Liveness is also guaranteed. If a process should for any reason
stop running, provided this happens outside the protected area, the other is not
hindered from continuing its execution.
The use of semaphores alone does not guarantee protection against deadlock,
because this depend on how the semaphores are used. If two processes use the
semaphores like this:
wait(P1) wait(P2)
wait(P2) wait(P1)
... ...
(* protected resource *) (* protected resource *)
... ...
signal(P1) signal(P2)
signal(P2) signal(P1)
then there still is a risk for deadlocks. If the interrupt for a process change arrives
between the two wait instructions of the first program, and the second program
executes its wait instructions, deadlock is the result, because each program waits for
the other to release the semaphore. The problem lies in the fact that although the
semaphore guarantees the uninterrupted operations of testing and setting the value,
it remains a protected resource. In the shown example, the principle of ordered
allocation is openly violated, so that deadlocks may result.
The semaphore can help in the synchronization of related activities. For
instance, if a process has to operate on data only after this has been read from an
external port, the code can have the following aspect:
This solution separates the operation of data read from data processing. If new
data is available but the data processing algorithm is not yet ready to execute, the
presence of the data is indicated with a semaphore value higher than 0. Under the
assumption that the new data is stored and saved, the processing routine can then
catch up with processing at a later time. In real-time systems this is a common way
to separate routines that must react quickly (as for example fetching data from an
external port) from other processes.
For the protection of critical sections, which by definition can be entered only by
one process at the time, binary semaphores, also called mutex („mutual exclusion“)
should be used. Normal semaphores are not suitable in this case because their
value can be higher than 1 and therefore several programs could gain access to the
10.4: Process Synchronization: Semaphores and Events 379
10.4.2 Events
A frequently encountered situation is that several processes access common
data and that each one of them must operate on that data only if some condition is
satisfied (which may or may not have to do with the data), and this condition may be
different for each process. The condition may for example be the arrival of new data
to an input port. All processes have the following structure:
begin
wait until condition;
modify data;
end
The code is divided in two major parts. First it is checked whether the condition
is satisfied, and then the operations on the data take place. The checking whether
the condition is satisfied does not modify the data and therefore does not need any
special access protection, but the access to the data must be coordinated among the
processes.
One solution based on semaphores would make use of two such variables, one
to control access to the protected region with the data and the other one to indicate a
change in the common data, so that it is worth repeating the test.
The use of the first semaphore is straightforward, while the second leads to a
particular problem. It is namely necessary to keep track of the number of waiting
processes and provide that when the condition changes all the processes are
released to check the new condition, which means to generate a number of
semaphore signals equal to the number of waiting processes. This solution is not
380 Chapter 10: Real-time Programming
satisfying because of the waste of CPU time due to all the tests. It is also easy to
make errors in the code.
To solve this particular kind of problem, a new synchronization variable has been
defined, the event with the associated operations await and cause (other names are
used in the literature and in operating systems). A process that reaches the
await(event) instruction remains waiting until the value of event changes. This
change is controlled via the function cause. On a change of cause(event) all the
processes waiting for it are released, and not only one process as in the case of
semaphores. An event function can be implemented with a binary variable as well as
with a counter, but even if its definition differs, the basic principles remain the same.
Contrary to the semaphore, an event variable cannot be used to protect a critical
section from the concurrent access of several processes, just because by definition it
releases all the waiting processes. The earlier illustrated problem is solved with the
help of event and semaphore variables if all the programs have the following aspect:
At each change in the event value, all processes test condition and only the
processes for which condition is verified are allowed to proceed. Access to the
common resource is then protected with the semaphore mutex. Here only one
process at the time is allowed to proceed. This solution is simpler than the one based
only on semaphores. It is also more efficient because the processes perform the
condition tests only when it is worth doing it, i.e. after the value of the related
variables has changed.
An important type of event in real-time systems is associated with external
interrupts. The processing routine, i.e. the interrupt handler, waits for an interrupt.
When this takes place, program execution is resumed.
structured data exchange: a process might write fields one by one and another
process read whole data blocks at a time.
When programming at machine level, common memory areas are located at
known addresses in primary memory. In high level languages global variables
accessed by several subprocesses are used instead. This happens for example with
the „threads“, because by definition their variables are global and function as
common memory areas. In case of potential conflicts in the access to the common
areas, these must be protected by semaphores.
10.5.2 Mailboxes
A different communication method that allows data exchange and process
synchronization at the same time is the mailbox. A mailbox is a message-oriented
data structure, in which the messages can be deposited and collected (Figure 10.8).
Several mailboxes may be defined within the same system to allow the exchange of
different types of messages.
mailbox
In many operating systems mailboxes have the aspect of logical files and the
access procedures are similar to the ones to access physical store devices. The
allowed operations on mailboxes are creation, opening, message writing, message
reading, closing, deleting. Some convenience operations like reporting the number of
messages and „peeking“ at a message without actually deleting it from the mailbox
are also offered by some systems.
Mailboxes are located in central memory or on disk, and exist only as long as the
system is powered up and operating. If they are physically located on disk, mailboxes
are classified as temporary files, to be deleted at system shutdown. Mailboxes do not
have generic identifiers or names like real files; they are labeled with logical
identifiers defined when they are created. All processes that use mailboxes address
them with their logical identifiers.
To create a mailbox, the operating system defines pointers to a memory area for
read/write operations and the associated variables for access protection. The main
implementation methods are either a buffer area with size defined at creation time or
a linked list structure which in principle does not put any limits on the number of
messages that the mailbox can hold.
In the most common implementations, a process intending to send a message
writes it in the mailbox in a way similar to writing in a file:
10.5.3 Pipes
A pipe represents a data channel between two processes of which one writes
and the other reads characters. Pipes were first developed in the UNIX environment
as a means to redirect the input and output of a process. According to the initial
concept, hardware devices with possibility for data input/output are considered to be
equivalent to files and to the input and output of programs. Each program has a
standard input and output (e.g. keyboard and terminal screen), but this can be
redirected or chained, so that for example the input and output of a program may
consist in files. When the output of a program is redirected to the input of another
program, the communication link is provided by the pipe (in operating systems the
pipe character („|“) is used as indication of this redirection). Pipes are used in the
operating systems UNIX, OS/9 and Windows NT as a method for interprocess
communication.
Pipes can also be considered as a particular type of mailbox. The difference
between pipes and mailboxes lies in the organization of data to be exchanged. While
mailboxes operate with messages, pipes are principally character-oriented and do
not require any particular structure for the messages. In some operating system it is
however possible to define a structure for the transmitted data. Normally a process
that executes a read operation from a pipe will wait for new data to read and until the
operation is complete. Current operating systems usually provide methods (flags or
functions to „peek“ in the pipe) in order to avoid to lock a program if this is
undesirable from the program logic.
The operations on pipes are equivalent to those to read and write physical files
with functions as define, open, put/write, get/read, close, delete. Extra operations
may allow for example the setting of mode flags, the definition of buffer size and
more.
Due to their uniformity of treatment of input/output for files, physical I/O devices
and other processes, pipes are a natural methods for interprocess communication in
client-server systems. UNIX pipes may in some cases be dependent on the TCP/IP
communication protocol, while pipes in Windows NT operate under any transport
protocol. The simplicity of the pipe-supported I/O-channeling should not distract from
the risk of generating overhead in the execution phase, especially on networked
systems (see Section 10.2.3 and 10.6.7).
10.5: Interprocess Communication 383
In distributed systems there is always a risk that messages get lost on the
network. If the networking system is configured to check that the transmission was
successful and there are provisions for retransmission of lost messages, then the
application program does not need to implement an extra verification. As the result of
lower-level operating system and network interface calls is usually reported with a
success (or error) code at higher levels, the application program only needs to check
this result code to see whether the attempt was successful or not, and possibly
repeat it.
If no check is provided, for example because a service like the network Internet
Protocol (IP) is used without the TCP facilities (Section 9.4.9), then the application
program is responsible for its own verification of the results of the transmission
operation. This is a trickier operation than it seems. An acknowledgement message
can be used to confirm reception of a message, but there is no way to guarantee that
the acknowledgment does not get lost in its turn, prompting the sender to initiate a
new transmission. This problem does not have a general solution; message-passing
strategies must instead be defined on a case-by-case basis. A solution can be to
label and number each message, so that sender and receiver can determine if the
passing order is respected. This method is also used in some types of
communication protocols (see Section 9.4).
Despite the importance of the factor time in real-time programs, this should not
be understood just that the processes must run fast. Real-time processes must be
fast enough to react within the required constraints to input data and signals by
generating the appropriate outputs, but do not necessarily need to be faster. A „slow“
real-time system can very well control a slow process. The execution speed of real-
time programs must therefore be considered in relation to the process to control or to
the speed at which answers must be produced. In general, a guaranteed response
time of 1 ms is required in typical process automation system applications, in some
cases even 0.1 ms may be necessary. For this reason, particularly important in real-
time programming are considerations on the efficiency and reaction time of
programs. Program development is therefore closely related to the definition of
operating system parameters and, in distributed systems, also of the LAN network
parameters.
The particular aspects of real-time programming require the use of special
techniques and methods, which are not necessary in sequential programming. These
techniques are mainly related to control of program execution flow from the external
environment and in relation to time. The most important of them are interrupt
interception, exception handling and the direct use of operating system functions. In
addition, the methodologies for multiprogramming and client-server programming are
also used in real-time programming, because a dedicated process or thread is
usually assigned to each self-contained part of a major task.
For example, the tasks for the control of a robot arm could be organized as
follows:
• read path data from disk
• compute next arm position (reference value)
• read actual position from sensors
• compute appropriate control signal for positioning
• execute control action
• verify that reference and actual positions are within the allowed range
• accept data from operator
• stop on emergency (asynchronous command, interrupt driven, e.g. via a „panic“
pushbutton).
Another example was shown in Section 2.1. The plastic extruder was controlled
by two tasks driven by interrupts. In the problem analysis it appeared clearly how a
solution based on a single program would not be acceptable.
The principal feature of real-time programs is that they must always be ready to
run and never terminate their execution. If they are not currently running and
processing data, they stay idle in the waiting list, ready to be scheduled for execution
following an interrupt or event, or also after a period of time has elapsed. Real-time
programs are sequential programs with the aspect of closed loops that repeat
indefinitely. At some point in the code there is an instruction to make the loop wait for
an external event or for a given time. The code is often structured in such a way that
the end instruction is never reached:
In interrupt management the response time is a very important factor, and this
time must obviously be as little as possible. The response time is the sum of the time
needed by the CPU to react to the interrupt, called interrupt latency, and the time
needed for a context switch until the interrupt handler is actually running. The typical
system load also plays a role. If the CPU has to service many interrupts at the same
time, new ones will have to be queued until the CPU is available.
Interrupt service routines should be as compact and short as possible. If a
complex action that requires more CPU time (like for example calculations or
database access) is needed after an interrupt, it is better if the action is performed by
a regular process. The interrupt service routine should do only the minimum
necessary, like reading the input data, formatting it in a message and then passing it
to the other routine, signaling that an interrupt has occurred and further service is
requested. In addition, it is always good practice to write reentrant code for interrupt
handlers. In this way, conflicts are avoided in case a handler is interrupted and the
same code is called to service a new interrupt before its execution within the first
context was terminated.
A problem similar to interrupt servicing is the reaction to exceptions. These are
unusual conditions that result when the CPU cannot properly handle the execution of
an instruction and that hinder the normal continuation of a process. Examples of
exceptions are division by zero and addressing a non-existing memory location.
Names for different kinds of exceptions are also traps, faults and aborts.
The common handling of exceptions by an operating system is the termination of
process execution and indication of the error situation with messages written in clear
text on the device used for the output messages. While acceptable in interactive
multi-user sequential processing, in real-time systems the abrupt halt of a process
must be absolutely avoided. It cannot be allowed that a microprocessor-controlled
fly-by-wire or car automatic braking system (ABS) halt because of an unexpected
„divide-by-zero“ exception. In real-time systems all possible exceptions must be
analyzed beforehand and appropriate handling routines be defined.
A very tricky aspect of exception handling is the verification that an exception
does not arise again after having been processed. Put another way, exception
handling must address the cause and not the symptoms of the abnormal situation. If
an exception is not handled correctly, it may arise again prompting the processor to
jump to its specific handling module. For example, the divide-by-zero exception
handler must check and modify the operands and not just resume operations to the
point before the fault took place. This would lead to an indefinite loop.
The effective memory addresses of the program modules are known only after
their loading. At system start-up, a module writes the memory addresses where the
interrupt handlers are loaded in the interrupt service table. The interrupt routines are
then accessed by referencing this table.
and
390 Chapter 10: Real-time Programming
When one of these functions is executed, the operating system puts the process
in a waiting queue. After the requested time has elapsed, the process is moved from
the waiting queue to the „process ready“ queue.
A common, but often unsuitable, method to solve a „time-waiting“ problem is to
introduce a closed loop to check the system time variable in the so-called busy-wait:
repeat (* do nothing *)
until (time = 12:00:00);
In general, these active waiting loops are nothing else but a waste of CPU time
and should be avoided. But there are cases where reality looks different. In a system
where an A/D conversion takes 20 µsec and a process switching operation 10 µs, it
is more economic to run busy waiting for the 20 µsec before new input data is
fetched than to start the task exchange procedure implicit in a „well-behaved“ wait
operation. Each case must be judged on its own; this obviously requires advanced
system knowledge and the right feeling.
An important aspect of processes that are started periodically (such as filtering
or regulation algorithms) is the accumulated time error. This depends on the fact that
a process is not executed immediately after it is moved out of the waiting queue but
has to wait for an additional, random time interval in the queue of executable
processes until its execution turn arrives (Figure 10.9.a). The requested and the real
execution time are not the same.
wait T wait T
0 1T 2T 3T 4T time
(a)
wait
until 3T
process process process process process
wait wait wait
until T until 2T until 4T
0 1T 2T 3T 4T time
(b)
Figure 10.9: (a) The wrong way to execute periodic tasks (it leads to accumulated time
errors);
(b) the correct solution (it does not lead to accumulated time errors).
10.6: Methods for Real-time Programming 391
Accumulated time errors can take place if the running time for a new activity is
computed as:
In this way a relative time condition is changed into an absolute time condition.
Therefore in practice two instructions are necessary:
The principle is illustrated in Figure 10.9.b, where the nominal times are drawn
on the x-axis. When the absolute time is taken as reference, accumulated time errors
are avoided.
include extreme values, like for example data that lies outside their allowed range.
The module to be tested must recognize and process correctly these data.
In multitasking systems, at the beginning the program modules are tested
separately. During this testing it must be ensured that each code line of each
process is executed at least once. That is, if the program module contains branch
instructions such as „if..then..else“, then the condition data during testing should lead
first to the execution of the one branch „then“ and then of the other „else“.
In this testing phase, debug programs are very useful. They allow direct
verification and manipulation of the CPU registers and of the memory locations while
running the actual machine code. When debuggers are used, breakpoints are
introduced in the code. At each breakpoint it is possible to check the state of the
registers and of the variables and compare them with the values required by the logic
of the process. However, with increasing complexity of operating systems and
reliance on system calls (whose code is usually unknown for the programmer) the
use of a debugger may prove of little use. Also in multitasking operations,
conventional one-step-at-a-time debug programs cannot be used, because the
interactions between parallel processes cannot be fully foreseen. Debuggers are
however useful and necessary tools for program development in Assembler at
processor level.
Only after all the modules have been separately checked and all detected errors
have been corrected, the modules can be run in parallel to observe their interaction.
The multiple interactions between program modules may lead to system errors even
if the single modules operate correctly. The general system operation (interrupt
reaction time, performance under loading conditions) is checked on the basis of the
reference documents. Particular attention has to be paid to the functions that are
necessary for system safety.
If a system has been designed to handle interrupt signals and features internal
exception management, the correctness of the related reactions must be checked.
Error situations will be provoked on purpose to check the outcome of the processing.
The results of each separate test and of the common operations are reported in
the test document and on its basis are taken the required correction actions. It
should not be forgotten that errors are much more difficult and expensive to correct
the later they are discovered. An investment in test procedures is not only an
investment in the quality of a system, but also in its general economy. Further
considerations about software reliability are reported in Section 12.3.4.
tasks, defined as entities with parallel and independent execution, each task on a
dedicated logical (virtual) processor. Tasks can be related to specific interrupts and
exceptions and therefore operate as their handlers.
A new concept introduced in ADA is the package, a module with its own
definitions of data types, variables and subroutines, and where it is explicitly
indicated which of the routines and variables are accessible from outside. Packages
can be compiled separately and later linked together in the same executable
program. This feature supports modular program development and the creation of
application libraries. At the beginning of the 1990s ADA has been extended by new
functions for real-time and object-oriented programming.
Low level, machine-level programming is not effectively supported in ADA, a
consequence of the assumption that all kinds of operations should be dealt with at
high level only. For example, for input/output in ADA are used application packages
with predefined functions for hardware interface management and access to external
data.
The main disadvantage of ADA is its complexity, which makes the language
difficult to learn and to use. The existing compilers are expensive products and
require powerful CPUs. So far, ADA has not reached the popularity initially
envisioned, and it is doubtful if it ever will.
C++ is a much more powerful language than C, from which it is derived. C++
offers greatly improved data abstraction through the class concept, similar to the
abstract data type with its distinction between data and operators. The C++ class is
much easier to use in practice than similar concepts in other languages, as C++
supports object-oriented programming and the stepwise refinement of data types.
The main strength of C++ is its ability to support the design and implementation
of easy-to-use program libraries. Real-time programming is not directly implemented
in the C++ language, but can be supported via specially developed program modules
and class libraries.
10.7.4 BASIC
BASIC is the easiest to learn among the high level programming languages. The
language was originally developed in 1964 to support interactive program
development with teletypes. Because of its simplicity, BASIC is often criticized by
expert programmers and there is no doubt that this language is not a good choice for
the construction of large structured systems. On the other hand, small applications
can be developed in much shorter time in BASIC than in other languages. Moreover,
BASIC is available on almost all mini and microcomputers.
BASIC can be compiled but is most often interpreted, that is, each instruction is
translated in machine code only at the moment of its execution. BASIC is particularly
important for the development of small application tasks to be run within a larger
system. BASIC should not be used for larger applications (in the order of more than
500-1000 lines of code). Still, BASIC is the optimal choice for non-professional
programmers who need to solve specific problems quickly. Command languages
based on BASIC are available in many industrial automation systems to write simple
control procedures without having to resort to more complex facilities for program
development, compilation and loading.
10.7.5 FORTRAN
FORTRAN was the first high level programming language and probably
contributed more than any other to the diffusion and practical use of computers.
Released in 1957, it is still largely used especially for numerically oriented
computations. In general, FORTRAN has limited possibilities for type definition, a
quite complicated way of dealing with non-numeric data and in general lacks too
many of the important features of real-time languages to be seriously considered for
this purpose. Newer FORTRAN versions have imported features from other
languages and support more advanced data structures. In this sense, the difference
between FORTRAN and other languages is becoming smaller.
Due to its established use in scientific application, it is not seldom that data in
real-time systems is processed with existing FORTRAN programs or that new
programs for analysis and statistics are written in FORTRAN. In such cases, the real
issue is to coordinate the data transfer between a real-time database where the data
is collected and application modules written in FORTRAN. Coordination of this type
of data transfer under real-time conditions is the responsibility of the operating
system. FORTRAN is not recommended for other applications, such as writing
device drivers or other modules at operating system level, because other languages
are better suited to this purpose.
398 Chapter 10: Real-time Programming
that only the machine language kernel is written anew. This means that UNIX can
run on many different computer hardware systems with an identical system interface.
The UNIX kernel lacks a well thought-out structure. This is the consequence of
its swift success and diffusion, as each new version must still be compatible with the
earlier ones. UNIX was initially developed for multi-user operations and not for real-
time applications. As a consequence of the fact that operating system routines run
as user processes but with highest (system-assigned) priority, it is not possible to
interrupt even those system calls that take long time to execute, so that the reaction
time for a system can become quite long. This is a major drawback in real-time,
interrupt-controlled processes. The UNIX process context description is very
comprehensive, which adds up time for process switching. Due to the fact that in
UNIX the pipe writing and reading operations make use of process switches, the use
of pipes for interprocess communication may lead to timing problems in real-time
applications.
Standard UNIX processes are time-sharing processes. To give all processes a
chance for execution, priority allocation is dynamic. When a process is scheduled for
execution it is first assigned its nominal priority. The value of this priority is decreased
in course of time, until it becomes less than the priority of another of the waiting
processes; this process is then selected for execution. In this way processes with
higher initial priorities get a larger share of the CPU time, but still all processes are
periodically executed. System calls operate synchronously to the calling process: this
must wait until the requested operation has been executed and control is returned to
it.
An important feature introduced with UNIX is the similarity between devices.
External I/O devices are treated as files. This aspect notably simplifies programs that
must operate flexibly, as it is simple to redirect I/O between files or external devices
like a local terminal, a printer or a remote terminal connected via a network without
any changes to the program itself. This feature is also important for program
portability.
A common and founded critic to UNIX is its unfriendly user interface. In fact, the
older and most cryptic commands are still in use, or have been changed with other
commands with names and abbreviations at least as unnatural as the previous ones.
On some systems, user-interfaces with windows and menus are available just to
„translate“ the selected actions into original UNIX commands. A positive feature of
UNIX commands is that, thanks to the I/O standardization and the piping
mechanism, they are very short and can be concatenated on the same line, where
the output of a command is understood as the input to the next one. In this way
complex operations can be concentrated to few lines and do not require the writing of
long files.
Although in its beginning UNIX was a multitasking and not a real-time operating
system, because of its large diffusion in scientific and technical environments it was
all too obvious to try to adapt UNIX also to real-time environments. Therefore newer
releases support real-time functionality like semaphores, shared memory,
interprocess signals, priority-driven task management and the direct access to
external hardware.
POSIX is the portable operating system interface based on UNIX, defined by the
IEEE standard 1003.1-1988.
400 Chapter 10: Real-time Programming
In fact, one of the advantages of the IBM PC is that it allows programming from
scratch of all the chips in the machine and thus the construction of a new operating
system. (On the other hand, not everybody is too keen to write an operating system
anew just to be able to run a few routines in parallel.)
The most famous operating system running on top of MS-DOS is Microsoft
Windows; it is probably the most popular graphical user interface worldwide.
Windows allows the operation of several processes at the same time, although only
one of them can be active at any time exchanging data with the user. Some
processes for printer output and network communication can however be active in
background and operate in parallel with the active process. Due to the lack of
preemptive multitasking (i.e. the application cannot be stopped by other programs or
by the operating system) as well as of other real-time features, Windows can hardly
be used as the basis for a serious process control system. However, there are
several data collection and processing systems running under Windows.
The major advantage of Windows is that it imposes a certain consistency on the
application programs, that must follow a basic frame for the most important
commands, and which makes their learning easier. The Windows system also
contains a large number of device drivers for almost every type of personal
computer, very useful when porting applications among computers.
Windows NT („New Technology“) was introduced in 1993 and is available for
different hardware platforms. Like UNIX, also Windows NT is separated in a kernel
and system routines running as application programs. The machine-dependent,
hardware-specific part of Windows NT is called Hardware Abstraction Layer (HAL)
and is available for different architectures. Windows NT is backward compatible to
MS-DOS, Windows, OS/2 as well as UNIX with POSIX specifications. The Windows
NT user interface remains the same on all systems. Windows NT fully supports the
client-server abstraction also in network environments.
Windows NT has several features of interest for practical applications in process
control environments. Among these services are threads, events, semaphores and
asynchronous procedure calls. Communication among processes is realized with
pipes (the system offers several types of pipes with different features) and Remote
Procedure Calls. RPCs are treated as local calls, so that applications may remain
independent of transport protocols. Other features of Windows NT are directed
toward safe and fault-tolerant operations, like for example disk mirroring support.
10.7.10 OS-9
The operating system OS-9 was first developed in 1977 by the company
Microware for the Motorola 6809 microprocessor, and later offered also on other
CPUs, in particular in the series 68000-68040 CPUs. OS-9 is a popular system, with
several hundreds of thousands licenses sold.
On a brief look, the operating system seems quite like UNIX, with similar
commands, compatible system calls, tree structures, pipes and uniform I/O handling.
But despite the similarities, OS-9 is a different product. OS-9 is hardware- and real-
time-oriented; the goal of program development is usually to transfer later the
program to a target system and not to run it on the development system. OS-9 itself
is also modular so that the software to be run on a target system need only include
selected parts of the operating system.
402 Chapter 10: Real-time Programming
10.7.11 VAX/VMS
VMS is the operating system for the Digital Equipment computers of the 32-bit
processor VAX series. Its popularity in control applications is mostly due to the high
quality of the hardware on which it runs and to the large number of available
development tools. VMS can be used in both real-time and multi-user environments,
with the related security controls of the latter.
VMS offers a wide range of functions and a standard and clean interface for
direct calls from programs. In this way all languages can, at least in principle, be
integrated with all functions of the operating system. As real-time features VMS
offers mailboxes in form of logical, record-oriented files, the possibility of having
resident routines and interrupt handling. In VMS a process can control the conditions
of its own execution (priority, memory allocation) and can create and control the
execution of other processes. A hierarchical control feature hinders processes with
low priorities to modify the execution of processes with higher priorities.
As with all large operating systems, VMS has performance problems when tight
timing is concerned. For this reason, and because of the popularity of the VMS
system, a special version of VMS tailored for real-time applications, called VAX/ELN,
has been developed. VAX/ELN consists of two different products: a run time
environment to execute the application programs on the target machine and a
development package with compilers for different languages. System development
takes place on a large unit with all the necessary resources for preparing a system
that contains only the program modules required for a specific application. The final
system is then downloaded to the target machine.
10.8 Summary
An operating system offers the processes a logical environment consisting in
CPU time and memory space for their execution. Operating systems for multi-user
and real-time applications present many similar features, but programming is done in
practice in different ways. Real-time applications may require reaction times of the
order of 1 ms. In real-time programming functions are used to coordinate the work of
different processes; these functions are not necessary with conventional programs.
In addition, real-time programs are interrupt-driven and can refer explicitly to the
time.
10.8: Summary 403
Further Reading
[Tanenbaum / Woodhull 1997] is a highly authoritative work on operating
systems which presents both established and new ideas in a comprehensive way.
[Tanenbaum 1995] deals in detail with the theory and design of distributed operating
systems. A solid introduction to operating systems on the basis of the VAX
architecture is to be found in [Levy / Eckhouse 1980].
[Young 1982] describes theoretical computer language issues such as data
typing and constructs with attention to the development of ADA. It is very factual on
language issues but does not deal much with practical real-time problems. [Glass
1983] is a collection of different papers about real-time systems, with emphasis on
the management of development work. It is a good complement to other tutorial
books, even if some of the described cases feel now somewhat out-of-date.
The problems and solutions for resource protection and concurrent programming
are discussed in [Dijkstra 1968]; important multiprogramming concepts, like the
semaphore and the notation cobegin/coend, have also been first introduced in this
publication. Other classical textbooks about multiprogramming are [Ben-Ari 1990]
and [Brinch Hansen 1973]. The deadlock problem and avoidance methods are
discussed in [Coffmann / Elphick / Shoshani 1971] and [Coffmann / Denning 1973].
An overview of the specific aspects of software reliability is presented in [Littlewood /
Strigini 1992].
Handbooks and tutorials for programming languages number in the hundreds for
each language. For operating systems, with the exception of Windows and UNIX,
there is much less choice. The best (only) reference literature might be the original
system documentation delivered together with the software package or real-time
system; not always such presentations have been written to be understood by non-
specialists.
Information on Windows NT and its operation in network environments is
contained in [Sinha 1996]. [Loukides 1990] treats the problem of UNIX systems
performance also in real-time applications and how to improve it by system tuning.
11 The User Interface
Aim: Presentation of the most important concepts in the interaction between the
user and a technical system and their application in the design of user interfaces
Overview
The User Interface or Man-Machine Interface (MMI) is a fundamental component
in computer systems. As the name tells, the purpose of this interface is to allow the
exchange of information between the user and the machine (computer or technical
system) to be controlled. A well-designed user interface does not only make work
conditions more pleasant, it also helps to reduce errors and thus to limit the extent of
possible damages to the system under control. Moreover, a good user interface
enables the user to understand the function of the technical system.
The first Section of the chapter introduces the field of user interface design. In
Section 11.2 are treated the most important aspects - at least as they are known
today - related to how humans deal with information and in Section 11.3 is looked
further to the representation of complex systems and the mental models that users
may form about them. The idea of mental models also offers some clues about the
way the users interface should be designed. An overview of the hardware for user
interfaces is presented in Section 11.4, while in Section 11.5 are presented some
basic principles for User Interface design in form of brief and practical guidelines.
Section 11.6 provides a brief introduction to modern user interface application
products and to the X Window System protocol.
404
11.1: The User Interface as a Component in Process Control 405
The user wants to reach a certain result and to do this he uses the technical
system (tool). Therefore the tool acts as the interface between the user and the goal.
In an optimal case the tool must allow the user to concentrate on the goals and not
be distracted by the way the tool works; in other words, the tool must be transparent
to the task. Simple mechanical tools like the screwdriver and the hammer, that have
been developed and perfectioned in the course of centuries, fulfill their purpose
neatly. While fixing mechanical parts together one dedicates attention to those parts
and to the screws, not to the screwdriver.
406 Chapter 11: The User Interface
Figure 11.1: Interactions between the human user, the goals, and the technical system (tool)
Figure 11.2: Use of the process computer in the control of a technical system
The user still wants to reach a goal, but can reach it only indirectly, with the help
of the technical system. Yet also the technical system cannot be manipulated
directly, but only through the control equipment. Therefore the user ends up working
with a new, combined tool to reach its goal. If the control equipment or process
computer does not correctly match the technical system, this makes the operation
more difficult for the user, because he now has to conceptualize the technical system
itself, the control computer and also the way they interact. The control equipment
represents „the tool to use the tool“ and must therefore not be confused with the
process goal itself. For long time however, because of inadequate and not fully
mature computer technology, human operators not seldom had to dedicate more
attention to the computer systems than to the applications these computers were
intended to control. Yet ultimately the user wants to see the fulfillment of the goal and
does not want to concern himself with the control computer for its own sake. On the
11.1: The User Interface as a Component in Process Control 407
other hand, the user can only interact with the technical system via the control
computer. The interaction of all components must therefore be designed in such a
way that at the end the user remains in control of the goal.
If there is an intrinsic mismatch between the control computer and the technical
system to be controlled, for example because of a poor selection of sensors and
actuators, this will result in higher strain on the operator or a more complex user
interface. Therefore, the requirements of the technical system together with
knowledge of the cognitive capabilities of the user must provide the frame on which
the user interface is built.
The role of process operators has greatly changed with the introduction of
computers. The user of automation and process supervision equipment has gradually
moved the operators far from the very processes they run and into control rooms.
This effect is particularly important in supervisory systems (i.e. those that
combine process monitoring with automation functions). They have not always
necessarily brought a simplification in the work of process operators. Instead, the
concept of automated support has partially backfired, because designers who try to
eliminate operators still leave operators to do the tasks which the designers cannot
think how to automate. Operators have therefore not only to control the technical
process alone, but rather a technical process as understood by the designers of the
automation system. Process requirements and operators’ skills are in general not
weighted against each other in the design of the user interface and the emphasis is
usually put on the computer control hardware. On behalf of the designers it can be
said that they have acted with positive expectations about the role of automation and
have applied what they learned. The problem might also be a cultural and
educational one: the role of operators is seldom considered in engineering courses.
In conclusion, the operation of a technical system should be taken in account
and become part of the system design, and not be left as a separate aspect to be
dealt with after the system has been completed. The technical system and the user
interface must be designed in accordance to the operations to be performed by the
user and not to the internal function of the system.
of computer-controlled servo devices this type of feeling has been lost or replaced by
visual information, for example by lamps or symbols on a screen.
It is estimated that the total amount of information entering the body is 10 9 bit/s,
of which only about 100 bit/s are processed consciously. The brain tends to further
reduce the amount of information to process. If too much information is presented at
the same time, acting capacity is lost and the attention tends to concentrate only on
part of the input data.
The perception of colors is one of the most important factors in user interface
design. The human eye is most sensitive to green and least sensitive to the high-end
frequencies of the color spectrum, blue and violet. The eye focuses different colors at
different distances, so that if red and blue are close to each other, the eye tries to
focus them at different distances and unclarity may result. About 8% of the male
population and 0.5% of the female population in Europe and North America have
some kind of color blindness and do not recognize some colors or color contrasts.
In general, attention is higher for unexpected stimuli, but decreases when the
stimuli are repeated. Other factors that increase attention are intensity, size, contrast
and movement. The brain can „filter out“ pretty well a picture or a sound from a
mixture of colors or noises. For example, in observing a picture the eyes tend to
concentrate on the most important details. A similar effect takes place also in
hearing: one can hear several voices at once, yet only one message is perceived and
understood in what is called „cocktail-party“ effect.
given. For the trained car driver it is not a problem at all to observe and understand
the traffic patterns, shift the gear and engage in a conversation at the same time,
because the first actions are performed at the sensomotoric level and therefore do
not require particular attention. Skilled musicians do not read one note after the
other, but recognize immediately more complex patterns like phrases, intervals,
scales, arpeggios and execute then accordingly.
Action at the lowest level are the most effective, because no explicit thinking is
required and the reaction can immediately follow the stimulus. Actions at the rule
layer must be selected among several memorized action patterns and therefore can
take place with some delay, as the appropriate rule must be selected. And when new
action types must be defined for special situations, analytical thinking and
comparison with earlier knowledge and experiences are necessary, which costs even
more time and mental efforts.
The action model can help in the design of process interfaces. The division in
skill-based, rule-based and knowledge-based behavior permits the classification of
the work tasks and indicates what kind of support is needed at each level, to be most
effectively provided by the interface.
goals
Figure 11.3: Simplified illustration of the levels of human performance (action model), from
[Rasmussen 1983]
410 Chapter 11: The User Interface
rehearsal
perception (senses):
vision, hearing
short-term long-term
sensory storage memory memory
transfer
displaced (forgotten)
information
The information collected by the sense organs into the sensory storage is
transferred to short-term memory where the brain can consciously pay attention to it.
From the short-term memory, and in most cases only with a voluntary effort,
information is transferred to the long-term memory. Short-term memory represents
the consciousness, it holds whatever one thinks about at a given instant and provides
the person with a base for action. The storage capacity of the short-term memory is
however limited. Different studies have shown that in the short-term memory there is
place for about 7±2 information items, also called „chunks“ (this is known as the 7±2
rule). Chunks are not equivalent to information bits; in fact a chunk can be very
complex and rich in its information content. New incoming information will erase or
displace the existing chunks. Items not thought about decay quickly and are lost from
consciousness. The items in short-term memory are at about the same abstraction
level, or show at least some homogeneity.
Long-term memory has an almost infinite storage potential, but memorizing and
recalling takes longer. Information in long-term memory makes a person’s entire
knowledge and includes everything from the use of language to childhood’s
memories, from multiplication tables to the name of the King of Ruritania 1. Short-term
memory is fast to recall (and forget) from, all the information contained in it can be
„seen“ at the same time and quick reactions can follow on its basis. Information in
short-term memory has a retention time of seconds, in long term memory it can last a
lifetime.
The distinction between short-term and long-term memory has also a
physiological explanation. There is no „geographical“ separation in the brain between
1
Rudolph IV
11.2: Psychological Models 411
the two storage areas, but the whole brain is involved in both. The difference is in the
type of activity. Short term memory activity can be described in terms of an electrical
field distribution, while long-term memory consists in neuronal interactions and
connections of a more permanent, chemical, nature.
Human memory does not work with direct cell addressing as computers do (in
what state is your neuron #2023965 ?); it works rather on the base of analogies and
associations. In this respect the coding of the information to be stored plays a very
important role. Modern cognitive research indicates that are not memorized forms or
patterns, but rather concepts and associations. In other words, what is stored is the
meaning and not the form of a message or of symbols; for example, after reading are
remembered the concepts rather than the exact wording of the sentences from the
text or the typefonts in which the text was written. The transfer of information to long-
term memory does not simply take place as a voluntary effort, as any student under
preparation of an exam well knows.
Information storage is easier if the new data can be put into an existing „frame“,
i.e. if the data can be related to information already present in long-term memory.
Memorization of different facts works also better if these are not presented alone but
are put in causal relationships. Similarly, recalling is facilitated by „cues“ hinting at
some aspect of the data to be retrieved. There are experimental indications that
memorization is permanent. Forgetting something does probably not mean that the
information is lost forever, but rather that items already stored cannot be retrieved,
possibly because of wrong or missing cues.
Organization and relation with previous knowledge that is already stored in long-
term memory help to handle new information more easily. A key aspect in the
efficient use of short-term memory is therefore coding, i.e. how much „raw“
information to insert in a chunk. Take for example the number sequence
88123296306. It just looks like an arbitrary sequence of eleven figures. Most people
would not be able to recall such a sequence without some effort and would probably
quickly forget it. But regrouping the sequence as 8-812-329-6306 makes it more
manageable, and even more if it is identified as a St.Petersburg phone number (at
least by Russia residents). Regrouping has reduced the number of chunks from 11 to
4, an amount that most people can handle without major effort. Moreover, abstract
figures have been related to known concepts (a city name, a phone number). A
similar example is found with chess players: a master can remember the position of
20 pieces on the chessboard, the novice will remember much less. The reason is
probably that the novice sees this as 20 separated items, the master as one or two
chunks.
11.2.4 Errors
Errors are a natural aspect of all human actions and ways to cope with them
must be considered also in the design of the user interface. Errors can be considered
as actions that lead to an undesired result, if the involved person could have carried
out a different action according to the situation and the competence level. At least in
principle then errors could be avoided. A wrong action that was caused by the
situation or by insufficient competence for the task does not represent an error.
Two types of errors can be defined: the slips and the mistakes. Slips are
actions that intentionally are correct but are then not carried out. Mistakes are
correctly performed actions on the basis of inappropriate intentions.
412 Chapter 11: The User Interface
Slips and mistakes can be referred to the action model (Figure 11.3). Slips take
place at the lowest, sensomotoric level. Mistakes take place at higher levels, where
decisions are taken. An example of slip is a mistyping error on the typewriter or the
shift into the wrong gear in the car. A mistake can take place at the rule-level (e.g.,
wrong spelling of a word) or at the knowledge-level (use of a correctly spelled - but
contextually wrong - word). In car driving, an example of mistake is the wrong
estimation of a slope that leads to a shift into the wrong gear.
The user interface in a computer system should provide for means for error
management. A good user interface must obviously contribute to the reduction of the
number and the consequences of errors. Error management addresses therefore two
aspects: error avoidance and error correction.
Error avoidance requires that the controlled equipment in some way recognizes
an error situation, possibly even recognize the evolution toward an error situation,
and alarms the operator about it. The equipment would then not accept commands
with possible dangerous consequences.
Error correction means that the operator or the equipment recognizes that an
error has taken place and tries to correct it. A widely used solution used in computer
systems is for example the command „Undo“. The computer buffers all commands
before to proceed to their execution, but shows the result, as if they already were
carried out. For example a file would not be immediately erased from memory, but
only scheduled to be erased, and the erasure would take place later on. If the user
changes his mind after having given the command to delete a file, the action can be
reversed within a certain time, as long as the file has not been physically erased from
the system.
The „Undo“ function can obviously only operate when no change in the physical
process has yet taken place. Here there is no possibility to „buffer“ commands like in
the virtual environment of a computer. For this reason, in monitoring and control
systems errors should be avoided - as far as possible - from the very beginning. The
process control system should therefore include data about possible dangerous
states or even a simulation routine to foresee the outcome of an action.
Paradoxically, in complex systems errors should not be avoided altogether.
Errors represent namely a good experience source. It is no coincidence that an
important learning method is called „Trial-and-Error“. In a way similar to the process
of child development, experimenting on one’s own delivers a „feeling“ for carrying out
actions, most of all at the sensomotoric level. There is no way to substitute this
feeling with theoretical training.
When experimenting and „playing“ with the technical system is not desirable or
just impossible (as it would be the case in nuclear power plants), simulation routines
can help collect the necessary experiences without risk. A pilot who already crashed
several times on the simulator will probably be able to keep his aircraft in the air
better than the one who does not know the limits of his machine. In electrical utilities
simulators are routinely used to check beforehand the effects of power flow changes
and the outcome of different configurations and other operations without putting the
real system at risk.
11.3: Human Control of Complex Systems 413
2
„Reason“ by Isaac Asimov (1941)
414 Chapter 11: The User Interface
• People tend to think in causal series (i.e. that one event influences another), not
in causal nets (several events influence others in complex patterns).
• People tend to deal with those areas which don’t seem to offer them any
difficulty. These are usually the least problematic and therefore unimportant
areas.
• People tend to reduce the complexity of the problem they deal with to fewer and
fewer causes.
A mental model is built in course of time and can be modified and extended
continuously. At the knowledge-level in the action model, the mental model of a
process can have a formal-theoretical aspect, the necessary information can be
provided with training and courses and are built in general on basic facts from
chemistry, physics, electrotechnics. At the rule-level the model consists in IF-THEN
rules, that are apt for the control of the foreseen process operations. A model is also
present at the sensomotoric level; this model cannot be provided by theoretical
training and courses but has to be learned from practice. This is the so-called
„feeling“, e.g. that when a certain switch is activated, then something happens. An
ideal training program should encompass all three levels. The type of mental model
depends of course on the type of system to control: the „seat-of-the-pants“ feeling
that is so important for aircraft pilots does not belong to the action of a power plant
operator.
There is no general agreement about the importance of a mental model to carry
out control operations. And there is no indication that people with special theoretical
background can carry out operations better than other people without this knowledge.
In general, actions carried out at the sensomotoric level are faster and much more
effective than those that require more intensive thinking. On the other hand, high-
level thinking is necessary to explore new situations, for example to find the reason
for a particular equipment failure and devise ways to cope with it. Mental models for
the same technical system can also take different forms depending on their purpose.
The mental model of a mechanician about a car is different from that of the sports
driver. The driver probably could not do his job if he thought about everything that
might go wrong with the engine while pushing it to its maximum capabilities.
The industry, much more interested in practical aspects than in theory, has long
taken the approach that operators can do their job with comparatively little training
and thus with only partial and incomplete mental models. The personnel in charge of
many complex systems has received only little training about the processes, so that
they build their own mental models from other clues and from repetitive actions. In
industrial practice it is therefore generally expected that process operators build their
own mental models of the processes they run in the course of time from experience;
this knowledge is then periodically integrated with theoretical courses.
In addition, the operation of complex systems takes place in most cases via
predefined procedures. Normal operations as well as special situations are described
in the process technical handbooks and it is mostly not required that the operators
act on their own initiative. Because the procedures there contained have already
been identified in advance, operational handbooks reflect a rule-level approach.
11.3: Human Control of Complex Systems 415
should not be changed unless this is absolutely necessary; any changes must then
be plain and clear.
It happens often that people who know many details about a problem or a piece
of equipment, i.e. who possess syntactic information, or those with good
sensomotoric agility are regarded as experts, instead of people who know how to
approach a problem with creativity. This attitude is unfortunately also present in many
computer books: they promise semantic knowledge, but deliver mostly syntactic
information. They do not explain causes or deepest relationships or structures, just
give „how to do“ information. Syntactic information is no better or worse than
semantic knowledge, it just represents a different level of knowledge. The important
aspect is not to confuse between these two types of information and always know
which one is required.
Complexity reduction
The first goal of the process control system is the complexity reduction of the
technical process. In other words, the technical process „seen“ through the computer
interface must be simpler that the technical process seen through its conventional
instrumentation. The computer must not add complexity on its own and servicing it
must not represent an overload of the cognitive capacities of the process operators.
Control complexity leads to problems in system control, so that a reduction in
complexity makes the work easier. Here lies a great potential in the use of computers
in process control.
Control computers are most commonly used to replace process instrumentation,
but often still keeping the „one sensor - one display item“ approach. The main
advantage in their introduction lies therefore in the more comfortable organization of
the work place and in the automatic logging of process data. What is lost on the part
of the operator if compared with conventional instrumentation is the direct, „tactile“
perception of the equipment; on the screen, all devices and machines have the same
size. In reality, the difference between grams and tons, kilowatt and megawatt,
milliliters and liters is evident; in the virtual reality of the computer screen the
difference is often reduced to the position of a decimal point.
The first step in complexity reduction is an analysis of the process data that have
to be collected and analyzed by the user. The number of sensors and actuators to
monitor and control a process cannot be defined arbitrarily, but depends on the
nature of the process and the control goals (the issues of observability and
controllability were considered in Chapter 3). Also real-time operation is no absolute
concept, but makes sense only in relation to the time evolution of the technical
process.
Let us consider for example a chemical reactor. This may deliver some dozens
values like temperatures, flows, concentrations, etc. If every value is displayed on a
panel, written off manually and becomes part of some computation, this would
represent a notable workload on the user. What the operator is actually interested in,
i.e. the main goal, is whether all current values are close to their respective set-
418 Chapter 11: The User Interface
points. The comparison of hundreds of monitored data with the related set-point
values can be easily done by a computer several times per second. A Boolean
operation could then deliver a general indication, whether the reactor as a whole
operates correctly or not. The user is relieved of manual work, yet he is free to check
the actual data at the desired definition level, if required. A person can therefore at
the same time control several reactors. The computer can also take into account
special operational situations. For example, during transients there are differences
between actual values and their set-points, so that these differences do not need to
be considered as alarms. Similarly, alarm limits can be considered not just to be
fixed, but also in the context of the actual process and its state. All these automated
actions contribute to complexity reduction.
Complexity matching
The second main consideration together with the complexity reduction in the
user interface is complexity matching. Already at the hardware level, the user
interface must match the amount and the precision of the data that have to be
transferred. Amount and type of data ultimately determine the type of interface and
not the other way around.
If a process generates only a few events per hour and the number of the input
and output parameters is small, there is no reason why a small printing terminal or
control panel cannot be used for control. The installation of a process computer for
the control of a simple process would not contribute to complexity reduction but
rather to an increase, because the complexity of the control system would be added
to that of the technical process itself. If the technical process does not generate
enough data, a screen display acts boring and uninteresting.
An important aspect in the interface design is the user's decision scope. Here it
must be considered how much process operators have to follow predefined
guidelines and how much they should take their own decisions, and where the limits
go. The interface should therefore be oriented to the required user competence (rule-
or knowledge-level) and the type of actions to perform in the work. A complicated
interface must be evaluated against the necessity for training. Only when all
components in the chain goal-operator-machine fit together, then the goal can be
reached with the optimal approach of user and machine.
In conclusion, complexity cannot be considered alone, but only in a context
which includes the users of a system. Complexity and usability are conflicting aspects
that must be evaluated and weighed against each other. The difficulty to use more
complex screen layouts and abbreviated commands can be overcome when
extensive training is permitted. If in this case the additional complexity of the display
pages is due to the fact that they present more information or that the command
language is more synthetic (and thus more cryptic), this may still mean an advantage
in the speed of operations. This is for example the case with the operating system
Unix and the text editor "vi-editor". These systems are often accused to be all too
user-unfriendly, but usually once their users have reached a certain level of
competence, they would not change them with other products.
system complexity can only take place with an intelligent human effort. This effort can
be made by the plant designer, the process operator or the system programmer. The
process designer can take operational factors into consideration and develop a
system that is straightforward to use. The process operator must also deal with
complexity and form own structures and mental models. The system programmer is
responsible for the development of the user interface.
The amount and type of information from the technical process has to be
reduced and brought within the cognitive limits of the users of those data. This task
can be carried out either by the designers of the original technical process or by the
designers of the user interface. If process designers and programmers do not take
care of this aspect, it will be left to the operators. It is therefore advisable to early
structure the process data, possibly already in the design stage.
The most natural type of structure is hierarchic. In most applications it is possible
to define a hierarchy so that some units or elements can be organized together in a
structure described by common parameters. The hierarchical levels correspond more
or less to different decisions to take for the control of a process. In general, all
entities located at the same level have intensive mutual data exchange; the data
exchange between levels is usually reduced and not time-critical (refer also to
Section 9.6.2 „Data Collection and Information Flow in Process Control“).
For example, in a chemical plant a reactor can deliver a dozen monitoring data.
When the attention is focussed on the reactor alone, then the values of set-point and
actual temperatures, flows, concentrations, etc, are of interest. If the same reactor is
considered in the context of a broader processing chain, then only the influent and
effluent rates would be of interest, together with the knowledge, analyzed and
reported by the process computer, whether everything is OK or not. Only when the
computer reports a failure, it might make sense to look at more detailed data about
the reactor to find the reason.
The hierarchical structure simplifies the supervision of a large process, but hides
some data from view. For example, the output control signal of a regulator might
exceed the value it normally takes and could therefore be an indication for
malfunctioning of some part of the system, but this would not appear on the general
indication for the device, still „green“ as long as set-point and actual values are
similar.
The hierarchical model is necessarily very general, yet it offers a useful frame for
the analysis and structuring of control systems. The model is not necessarily
restricted to manufacturing or processing plants; equivalent levels are found in all
complex control systems.
A structuring scheme similar to that of display pages is also possible for
commands. Commands may be at a very low level, with the direct control over every
single actuator, or at a higher level, to perform complete functions. Commands at the
lower level are usually of scarce interest in complex installations where the
components are closely interconnected and interact in multiple ways. A good tradeoff
is to allow simple commands to be transmitted and executed and prepare
comprehensive command files consisting in several simple „atomic“ commands, to
perform more complex functions. These commands would then be oriented to major
operations.
A basis for the interface design is readily provided by the task analysis. This is
the analysis of the technical process and of the operations that are necessary for its
control. Task analysis is performed by looking at and identifying the following
aspects:
420 Chapter 11: The User Interface
memory storage that can be used, for an higher resolution with few colors or for
lower resolution and many colors. In process control applications in general only a
limited number of colors is required and desirable, so that the interface electronics
can be programmed to enhance the optical resolution in first place.
The keyboard is the most common computer input device. The alphanumeric
keys have almost everywhere the same meaning, besides some national-related
features. The definition of the control keys is instead not standardized, and also the
position of the keys differs depending on the keyboard design. On a new keyboard
the user must learn a new relation between keys and commands, which can lead to
difficulties and errors at the sensomotoric action level. Common screens and
keyboards are built for office use and are therefore sensitive in relation to typical
process environments with high levels of moisture, dust and vibrations. To use
keyboards, finger agility is necessary. Moreover, keyboards can be used only with
difficulties when wearing gloves. Special „rugged“ computer screens and keyboards
are available for use in industrial environments.
Although it may sound antiquated, a cheap and practical I/O device for the
monitoring and control of slow processes is the printing terminal or teletype. It is used
when information is exchanged at a low rate (1-2 events / minute) and each
information item is self-contained, i.e. not related to other information, so that the
user does not have to wait too long for the completion of a long printout in order to
get the complete picture of a situation. The printing terminal has the advantage that
the display medium (the paper) can also be archived as operational record with no
need for further processing.
Control panels were used mostly from the 1950s and through the 1970s, when
the process interface devices were wired one by one to their indicators and controls
located in central control rooms. Control panels have indicators like lamps and
needle instruments as data output and switches or keypads for data inputs. Control
panels can be used with a limited amount of data I/O and when the commands are
clearly identified, with only a few possible alternatives. When control panels are
mainly used as display device they are known also as mosaic boards or mimic
boards.
Mosaic boards still represent a viable alternative in the representation of
processes with a strong linear extension, as for example railway lines and pipelines.
The reason is that in many cases it is unnatural to look at such a system in pieces as
it would be on a screen monitor. Mosaic boards can be built to represent the overall
state of the technical system, while computer screens would provide more detailed
information about specific parts of the system. For example, in a railway control
system a large mosaic board in sight of the train dispatchers would show the linear
extension of a railway connection, indicate the position of the trains and the status of
the most important signals. The computer screens would present on request more
detailed information about specific track sections, trains and other equipment.
Special alarm situations can be shown with optical and acoustic devices on
control panels and under computer control. They are used to draw the immediate
attention of the user, who might be dedicated to a different task. In the case of
acoustic devices, some parameters (tone level, frequency, loudness) should be
adjustable by the operator. It is imperative that such devices have a quick and
practical reset command in order to avoid unnecessary annoyance, once an alarm
has been perceived.
The interest for direct pointing devices like lightpens and touchscreens is still
quite limited among users. The movement of the arm from the worktable to the
422 Chapter 11: The User Interface
screen and back is tiresome, requires time and the precision of the movement is
limited. Pointing to a screen with a finger or with a lightpen takes more time than by
using an indirect control device such as a mouse or a trackball. In the first case there
is also a „fingerprint effect“. Lightpen and touchscreen are however of interest when
the use of a full keyboard is not warranted or possible and the dialogues can be
organized in the form of menus with a small number of basic selections. But even
here, a small keypad could easily replace the touchscreen for input. Still,
touchscreens are quite popular in control systems for machines in the manufacturing
industry and in public information points, for example as remote banking systems. In
these applications the user is standing and the number of interactions is limited, so
that the ruggedness of such terminals is the most important design factor.
The mouse, the trackball and the joystick are indirect pointing devices for the
control of the position of a marker or pointer on the terminal screen. The selected
object or field is highlighted for immediate optical feedback. The selected option is
confirmed by pressing a key, for example one of the keys of the mouse. The
precision of movement is much higher than with touchscreens and lightpens. It will be
incidentally noted that devices like the joystick and then on the mouse were first
developed for use by children. It turned out later on that their simplicity was strongly
appreciated also by adults.
A mouse, a trackball and a joystick are cheap and simple input devices that can
be used for the fast control of processes with an immediate feedback: mouse and
trackball for pointing at objects on a computer screen, the joystick for the remote
control of a mechanical actuator (e.g. a robot arm). All these devices are quite
unprecise by themselves, but allow fast corrections. The human acts as „feedback
correction“ either from the visual input from the screen or by watching the position of
the mechanical actuator. The use of a joystick to control the set-point in a chemical
reactor would be a mismatch, because the device does not provide the required
precision and because the slow dynamics of a chemical process does not require the
use of a fast input device. A potentiometer or, for more precision, a digital input
represent much better choices for that type of control.
The computer industry has invested huge sums in the development of speech
recognition systems. For decades a solution seemed to be very close, but every time
it had to be admitted that it was not yet the case. The systems available today can
only recognize words that are pronounced singularly and match a prerecorded
pattern. Until a machine can reliable decode normal speech with different intonations
and accents, and especially in unfavorable settings like industrial environments with
loud background noises, the use of speech recognition interfaces will remain limited.
Speech generation is technically easier than speech recognition, and different
systems are available on the market. A drawback of speech generation is that their
messages can come at random, when the user does not expect them and therefore
pays no attention. Computer-generated voice simulates human voice remarkably
well, but they still lack intonation, modulation and accentuation, that represent an
important component in human language and convey much information themselves.
The description of the following section will assume the operation of an user
interface built with a computer screen with the possibility to highlight the presented
data, a keyboard with function keys and a pointing device like a mouse or a trackball.
This type of hardware is simple to obtain, inexpensive and very well widespread.
Many of the following considerations can however be used also in the design of
special terminals or control panels.
11.5: A Practical Approach to User Interface Design 423
Simplicity
Simplicity is the most important principle for all kinds of design. In process-
control applications where computer terminals are used every screen display page
shows a model of the physical process and its operation. Simplicity means that no
useless or irrelevant and excessive information is presented together with the
important data. On the other hand, simplicity should not mean an impoverishment in
the representation. As simplicity as such cannot be measured objectively, it can only
be taken as a general principle to be put in the context of other design and evaluation
methods.
Visibility
Visibility is the degree of transparency of a system in describing its own
operations. Ideally, the user should have the feeling to interact directly with the
technical process and not with the computer system. Visibility allows the recognition
of the purpose and function of a device from some visual clues (color, form, shape)
on the interface. Visibility must provide the link between the technical process, its
operations and the user’s mental model of the process. The monitoring and control
computer must support and enhance the visibility of the controlled process.
An example of simple and „visible“ display for process control applications is
shown in Figure 11.5. It is not necessary to read a numeric value or check in a
handbook to find out whether the displayed value is within the allowed range.
0 10 20 30 40 50 60 70 80 90 100
Consistency
Consistency means that the same representation is used for similar or analog
components in a system. In order to apply consistency in the description or
visualization of a system, it is first necessary to establish or create a structure.
Consistency can also be considered as visibility by analogy. Where visibility is
necessary to understand a concept the first time, consistency helps transfer existing
knowledge to new contexts.
Consistency is probably the most difficult feature of all to realize in a user
interface. In order to achieve consistency it is necessary to form classes of
similarities and differences and then apply the same rules (language, abbreviations,
colors) to qualify the related information. The classes requested by consistency
should be kept to a minimum. For example, if the key <F4> is used to load a file in a
part of a program, is should not be used to reset peripheral units in a different context
of the same program, while files are loaded with <F9> instead.
Consistency is more difficult to achieve when different people participate in the
same development project, as one programmer might like to write warning messages
all in capitals, another in lowercase. There is always a certain number of issues that
remains unaddressed in team projects, and the style of warning messages might be
one of those. But when they will be seen by the user, this will be led to draw
conclusions that in reality are unwarranted.
A difficulty in achieving consistency is when several conflicting rules apply for a
certain representation and it is not obvious what rule should hold. To overcome such
a situation, two methods can be used. One is that each consistency aspect is related
to one visual clue only (size, color, form, etc.), so that different conditions may be
indicated at the same time (e.g. via size and color). A second solution is to establish
a hierarchy, where a type of information overrides others.
An important potential for consistency is offered by the use of standardized
interfaces. The initial anarchy of many different products has evolved to a situation
11.5: A Practical Approach to User Interface Design 425
11.5.3 Coding
The human-computer interface must draw the user’s attention to important facts
and support a prompt and correct reaction on the basis of the presented information.
In this task, coding plays a crucial role.
As already examined in the Chapter about communication, coding is the change
of some property of a communication channel (Section 9.1). A code relates the type
and amount of change of the channel property with the information that has to be
transmitted. Several codes may act concurrently, changing different properties in
parallel and thereby conveying more information at the same time. Common visual
codes for items shown on a terminal screen are color, shape, dimension.
Psychological experiments have been carried out to test the human reaction
speed to information conveyed with symbols coded in different ways. These
experiments indicate that coding by color or by color and shape together lead to
faster reaction times in the observers than coding by shape alone. It follows that color
is the more important coding attribute.
Other experiments have addressed the issue of whether highlighting important
items on a display screen makes them easier or not to recognize. Again, highlighting
by color is perceived easier and faster than blinking and reverse video. Moreover,
highlighting can be of benefit at the beginning, but as the user gets more practice, he
generally knows the location of the searched information and highlighting becomes
more of a hinder. In particular, a text should never be let blink or scroll, because this
makes its reading more difficult. It is sufficient to let a small symbol blink near it.
Colors can provide clues when they display functional states. Green is generally
perceived as indication of security, permission or correctness (it may for example
indicate that a unit is in proper working order). Red is related to states of alarm,
danger and prohibition. Yellow is understood as a warning and can indicate the
presence of some minor problem.
Simplicity suggests that the number of colors, shapes and highlights in general
should be kept to a minimum. Moreover, only a few different colors or shapes can be
recognized if considered alone; when it is necessary to present several colors or
11.5: A Practical Approach to User Interface Design 429
shapes (like e.g. fill or raster patterns), then a graded comparison scale should also
be shown as a reference. Colors should be used sparingly; 4-5 colors are understood
with no major effort; there are indications that 7 different colors is an absolute
maximum to never exceed.
It is important not to rely only on colors as a means of showing important
information. A large number of people are blind to some colors and are therefore
incapable of recognizing them. Environmental factors like illumination and shadows
may make difficult the perception of some colors on a terminal screen. The
information to be shown should therefore present some kind of redundancy, for
instance with help of labels, texts or other graphical symbols, in order to ensure that
the conveyed meaning is understood.
The operation of devices may be represented on a computer screen or on a
control panel with symbolic or functional coding. For example, if a switch is used to
connect alternatively two devices (or a production line branches into two cells), the
switch position itself can be shown, or also which device (or cell) is connected,
identifying it with a different feature like an empty or framed symbol (Figure 11.6).
The functional representation does not require an explicit interpretation of the picture.
(a)
(b)
Consistency requires that a coding clue (color, shape, fill pattern) maintains its
meaning across the whole system and not be context-dependent, i.e. that the same
clue carries a different meaning on different screen pages. If red indicates an „alarm“
state in a screen picture, it should not indicate „hot“ in a different picture or „inflow“ in
a third one. In addition, coding must be natural, i.e. it must be processed
unconsciously and not require explicit interpretation. Coding „cold“ in red and „hot“ in
blue or also „OK“ in red and „ALARM“ in green is technically trivial, but would require
an effort to be understood because it is unnatural.
It might be argued that with training the operators will be able to tell when red
means „alarm“ and when it means „inflow“. This is true, but then an important
advantage of cognitive knowledge is missed. According to the action model (Section
11.2.2), the most efficient reactions are those at skill (sensomotoric) level and at rule
level. If an operator learns by training that red always means „alarm“, when he
perceives the color, there will be an almost immediate reaction. If a thinking effort is
needed, like to weigh the stimulus „red“ with information of the current display screen
and what red means in that specific context, the effort will be greater and the reaction
slower. Also the probability for errors is increased.
There will always be conflicts in the right choice of symbols. A process that is in
alarm state because its temperature is too low should be represented in red or in
blue? It depends on what has highest priority, whether to give an immediate feeling
430 Chapter 11: The User Interface
about the temperature or an indication of the functional state, where the natural color
for alarm is red. In any case, consistency should hold through all representations. It
does not matter what a code represents, as long as it always represents the same
thing.
management
level
production
control level
cell control
level
Figure 11.7: Structuring of the process representation in relation to the control levels
With modern windowing systems it is easy for the user to put together the
information that is needed exactly as wished (Figure 11.8). Nevertheless, each
window should still convey one basic concept; it is the user who organizes the
different windows on the screen as required.
In general, a good layout organization has the following characteristics:
• it is adequate for the purpose; it does not present more or less information than
necessary (simplicity);
• it is, as far as possible, self-explaining (visibility);
• it is consistent at more levels. The same coding, in symbols and colors, carries
the same meaning on different screen pages and the user knows what to
expect in different situations (consistency).
432 Chapter 11: The User Interface
Figure 11.8: Example of windowing system for the presentation of process data, for the
process control system ABB Advant OCS. Different levels of detail are shown
simultaneously on separate windows under the control of the user (courtesy of
ABB Automation Products AB, Sweden).
11.5: A Practical Approach to User Interface Design 433
In Figure 11.9 and 11.10 it is shown how structuring can help make a
representation much better understandable. The data shown is exactly the same, the
difference in the result is immediately apparent.
Figure 11.10:The same information as on the display page of Figure 11.9, in a structured
representation
434 Chapter 11: The User Interface
nonsense input data are: (1) to display the correct values as part of the background
information; (2) to provide a window menu selection of the possible values; (3) to
display a message if the input is not understood by the system.
The alternative (1) is not feasible when the number of possible commands is
large; it leads easily to cluttering the screen with too much static information.
Alternative (3) may cause delays, depending on the frequency of mistakes. The
solution (2) may be the optimal choice; it is the preferred method with windowing
systems and pull-down menus. A new value can be selected either by typing in it
explicitly, or at least some of its characters, or by pointing at it in the sub-menu with
help of the arrow keys or the mouse. The selection is then confirmed by an
<ENTER> command or a mouse click. One of the command alternatives - the
current, previous, most common, or safest one - could also be shown as default
selection for a command. The displayed value is then accepted by the system as
valid unless explicitly changed by the user.
Also the principle of complexity matching holds for the control interface from the
user to the machine. If the command input consists only of few bits, then keyboard
dialogues are superfluous. Why typing „SET DEVICE#2=ON“ when a simple switch
fulfills the same function? If the process is more complex and includes several
parameters, then the user of a keyboard is warranted („SET DEVICE#2=ON,
POWER=MID, SETPOINT=3224“).
Typing a command from the keyboard requires some thinking and can lead to
errors. It is good to ask for confirmation before execution of sensitive commands, for
example with a question of the kind „Do you really want to boot the system
[YES/NO]?“ Here it might however arise a problem, because once an action is
learned, it is carried out automatically at the skill-based (sensomotoric) level and
without further thinking. The question alone is no guarantee for the exact intentions of
the user, who might first type [YES] and then think about the question. Different
strategies might have to be defined.
In some technical systems, potentially dangerous commands are made
deliberately difficult to carry out. This is not necessarily a good approach. Special
commands (that probably have to be used only in particular emergencies) can
instead be protected with special passwords. A good control system should be at the
same time safe and easy to use. If a process simulation routine for the control system
and the technical process is available, potentially dangerous commands could be
accepted only after having been run in simulation and then letting the system pass
them further to the real technical process. Of course, this strategy is valid for certain
systems but not others, depending of the required speed for process manipulation.
It is important to have the possibility to stop a computer-controlled machine
immediately in case of an emergency. In such a situation, nobody would have the
patience to type in an ordered command sequence. A clearly marked emergency
OFF button should be installed within easy reach for the operator. It is common
practice to paint the button red on yellow background. „OFF“ buttons are usually
large enough to be operated with gloves on and without need for careful aiming.
It is advisable that help is available on line. Help should always be called from
the same key, which should be distinct and clearly marked. Modern systems offer
context-related help, that is, they recognize the current situation (the data or program
which is currently active) and offer help related to that situation.
436 Chapter 11: The User Interface
11.5.6 Menus
The principles of visibility and consistency required in screen and command
design must of course also be followed in the design of menus. In particular, the
following considerations can be made.
To begin with, the menu structure should become quickly clear to the user. Each
menu should be identified by a title or headline, possibly using the same text
indicated as choice in an higher-level menu.
The items in a menu should be at the same abstraction level: Functions like
„delete character“, „print file“ and „boot computer system“ do not belong to the same
menu selection. The menu items must not be placed randomly, but should follow
some logical principle. This ordering principle should also be easily recognizable. In
case no such principle is evident, alphabetic order will serve as a possible ordering
criterion.
Ideally, the number of items in a menu is not too large. With too many items on
the screen, one may have already forgotten the first ones by the time he is through
scanning the list. If a system has a very large number of action paths that can be
followed, a tradeoff must be made between the approximate number of choices in
every menu and the number of levels in the menu hierarchy.
Similar functions in different menus should be connected to the same keys
(consistency). A <BREAK> and <GO BACK> command should always be present,
possibly with its own dedicated key. It should be possible at any moment to interrupt
the current work and go back to the next higher menu level or even to jump to the
highest level, or root, menu. It should not be required to go through a series of
screens, or even reply to additional questions, just to leave the current menu or
dialogue page.
• Subjective satisfaction. How much did the users like using the system?
• Time to learn. How long does it take for the typical user to learn the most
important commands?
• Retention over time. How well do users maintain their knowledge after an hour,
a day or a week?
Of these goals, speed of performance, rate of errors and satisfaction can be
evaluated after a comparatively short time and therefore make a good choice of
testing benchmarks. The time to learn and retention over time require by their nature
a longer time for evaluation. Therefore, they cannot realistically be included among
the parameters for direct consideration. They could, however, play an important role
in the periodic re-evaluation of products that reach a larger market and are not limited
to one target user group only.
It is not possible to state in general that a good interface is easy to learn. Rather,
the actual goal in relation to the work task has to be considered: Is the interface
supposed to be easy to learn, flexible, understandable or else? Only the fulfillment of
the stated goal can give a measure of the quality of the interface.
It sounds like a paradox, but the best user interfaces are also the easiest to
forget. The reason is that if they appear to be natural, the user will not have to make
any special effort to memorize them and their commands.
11.7 Summary
The design of user-oriented process interfaces must be focussed on the human
cognitive capabilities. The computer must not be a substitute for those tasks that
people perform well, but instead enhance the performance of those tasks where
humans are less capable. In this respect, the process computer can be considered
as a kind of complexity interface. If the complexity required in the control of a
technical process is higher than what human capabilities allow for, the computer
must help reduce this complexity to a level where it becomes manageable. In
addition, the complexity must match the task to be solved.
A computer monitoring and control system is not „good“ or „bad“ on its own, but
must be considered in relation to the task to be accomplished. If the monitoring and
control system contributes to the reduction of the complexity of the object system,
then its use is warranted. A poor monitoring and control system has an high intrinsic
complexity which provides an additional burden on the human user, without really
helping in the control task.
That many systems, that many users. There is no standard user profile. Some
people are knowledgeable about computers, curious, show a positive attitude and
always want to learn more. Others are afraid of computers, or just unmotivated, and
don’t care much. Very often, and especially when a control system is built around an
already existing technical process, users are technicians with good knowledge of the
process under control. Not seldom they mistrust the computer programmers who
ignore the details of the technical process and at every occasion they air comments
about „their good old way of doing things“.
The designer has the machine in mind and the user the task to be accomplished
by the machine. The computer control system is accepted by the user when it is seen
as a tool not to disrupt but to enhance the plant control operations. The correct
design of the man-machine interface plays here a fundamental role. The ergonomic
aspects are particularly important with untrained users. Here a tradeoff must be
made, either assuming that the users do not know anything and that they will not
learn either, or require that the users learn something about the computer control
system. The second way requires more attention and planning but also has the better
payoff. Instruction is always a good investment: the trained user will in general be
more motivated and less likely to make mistakes.
Further Reading
Some basic knowledge of psychology is useful to understand the underlying
concepts in the design of user-friendly applications. An introduction to psychology
with comprehensive sections dedicated to perception, learning and the dual memory
theory is [Atkinson et al. 1990]. This is recommended for the reader interested in
background information. The dual-memory model is also described in [Atkinson /
Shiffrin, 1971]. A more in-depth consideration of cognitive aspects in psychology is
given by [Solso 1993].
[Sanders / McCormick 1993] is a comprehensive reference textbook about
different aspects of practical ergonomics; the book is recommended for the reader
interested in the broader view. [Salvendy 1987] collects contributions of different
authors and considers in particular the psychological and cognitive aspects in the
handling of complex systems.
440 Chapter 11: The User Interface
An excellent book to look at things from the point of view of the user is [Norman
1988]. This text contains several examples about how not to design devices and
tools: a captivating lecture about common sense in engineering. This book makes a
strong point about the principles of simplicity, visibility and consistency by giving
several practical examples of good and poor user-oriented design. Paradoxes in the
handling of machines by their users are described in [Bainbridge 1983].
[Shneiderman 1998] deals with software ergonomics with particular
consideration to the design of computer screen layouts and the definition of
interactive command languages, in particular for information search in databases.
General introductions to the problems of the user interface are [Norman / Draper
1986] and [Preece / Keller 1990]. The action model at the sensomotoric, rule and
knowledge levels was first introduced by [Rasmussen 1983]. Errors and their
consequences in complex systems are treated in [Rasmussen / Duncan / Leplat
1987].
Aim: To look at all the material presented in the book under the aspect of
interaction and integration of system components in order to build and operate
complex control systems
Overview
The ideas and concepts about the control of technical processes that have been
treated so far in this book must now be put into a general frame. In complex systems
everything has to fit together. It is enough if one part or component does not fit so
that the global performance of a system is jeopardized. There is no ready recipe on
how to build and structure a system. Mathematical analysis and modeling helps to
identify physical limits, yet at the end system design remains more an art and a craft
than a science. The best school is undoubtedly to learn the necessary dos and
don’ts from experience.
Process control systems are treated in Section 12.1 from the standpoint of their
historical development, while Section 12.2 deals with the integration of control
systems. The reliability of a system plays a very large role in its operation. Reliability
can be described with help of specially developed mathematical methods, which can
however only be used under particular situations; they are treated in Section 12.3.
The function of a process control system is the object of Section 12.4. The
materials previously treated in Chapter 7 (digital and sequencing control) and
Chapter 10 (real-time programming) are integrated and extended here with the
treatment of programming of real-time databases and software integration. Although
the description is oriented to large industrial systems, many ideas can be used for
smaller-scale applications.
Not only technical aspects are of importance in practical real-life applications,
actually also economical, organizational and psychological factors play a decisive
role for the acceptance of any complex technology - and therefore of automated
process control systems. These aspects are briefly treated in Section 12.5. At this
point, the reader should have got a sound and realistic view of the problems and the
possibilities in the automation field. The Authors hope that the reader looks at this
chapter more as an opening to new experiences than just as the final part of this
book.
441
442 Chapter 12: System Integration
computer memory of the spacecraft on-board computer (64 kByte) had to be utilized
to the last bit and the resulting programming task was enormous; at the end it turned
out to be almost 1000 man-years. Today even the cheapest computers have at least
hundred times as much memory, which is quickly used up by normal office
programs.
Two successful areas of process computer control in the early 1960s were
chemical process control and the control of power generation and transmission. In
the control of chemical plants the computer simply replaced the analog PID
controllers. The control strategy was already well understood and the computer
basically did the same as the previous controllers. Also in the power industry system
structuring had a long tradition. The engineers in the power utilities had a good
feeling for how to use computers in the analysis and design of power systems and
could therefore formulate adequate performance criteria and specifications, releasing
the computer manufacturers from this kind of responsibility.
The typical process engineer sees his plant in terms of partial systems and unit
processes. The computer programmer, who is often unfamiliar with the specific plant
application, would rather think in terms of computer structures, which usually are
organized hierarchically. And here lies the real issue. It is crucial that the process
structure is reflected into a proper computer structure; the computer and its software
must be adapted to the process and not the other way around.
Structuring is the most important issue in process control; it influences the
configuration of the hardware as well as the modular construction of the software. In
the chemical and power industries standards have been since long established. The
operators’ needs were initially quite obvious: to transfer the process control interface
from large panels and racks to computer terminals. The plant operators wanted to
see the same information as in the old PID controllers, the same curves as those
from the old plotters and the same process schemes as in the control rooms. This
led to the development of „fill-in-the-blank“ programming languages, in which the
controllers are described in parameterized form.
For logical circuits and sequencing networks the solution was obviously to
replace the old relays with computer technology (Chapter 7). The old ladder
diagrams could be translated to similar symbols on the computer screen, only now
the implementation of the logical operations is done in software. The first PLCs were
actually just replacements for relay technology, yet the increasing demand for
structuring has led today to constantly new added functionality for PLC and to the
availability of communication interfaces for the integration in larger control networks.
The requirements for structuring have also led to the development of sequencing
languages.
It was also recognized early that feedback control and sequential control should
be integrated. Some steps in this direction were actually already taken in the first
systems, although not yet in a methodical and structured way. Today’s industrial
control systems are integrated in a more structured way and contain building blocks
for both feedback controllers and logical circuits.
For some years a lot of attention has been paid to Computer Integrated
Manufacturing (CIM), yet few real CIM applications have so far seen the light of day.
Once more, an important reason for this is structuring. Unlike the chemical process
industry, the manufacturing industry has no established methodology to formulate
and structure the production process. In addition, the manufacturing industry is
extremely diversified, so that it is so much more difficult to formulate proper
performance criteria for integrated control. Today, only limited solutions are available
12.2: Integration of Computer Control Systems 443
as for instance for the control of NC machines, of robots and of production cells. The
overall control problem for a full manufacturing plant, however, remains in general
much less structured.
From the experiences gained so far the following can be derived. It is relatively
easy to build adequate hardware components or software modules for computer
control tasks. The real problems lie elsewhere, they have to do with the overall
objectives, with the difficulty in getting a unified view of the system and to structure
the control hardware and software in a relevant and goal-oriented way. This kind of
overall view has in fact been the Authors’ driving force for writing this book.
the possibility for external communication via Fieldbuses or LANs and can therefore
be integrated in larger processes.
Controller boards are usually programmed directly as target system (i.e. the
system where the final application is run), but in some cases the support of a
different machine with more resources may be needed, e.g. to run a large compiler.
The ready programs are then downloaded and run on the target machine.
Several peripheral boards can be installed on bus systems (Chapter 8), so that
the hardware configuration of the control system can match as closely as possible
the requirements of the technical process. The boards on the bus can be changed at
any time with comparatively little effort. Software development for the effective use of
a bus system is not a simple matter, but can be supported considerably with help of
special bus operating systems.
Programmable logic controllers (PLC) (Chapter 7) are self-contained units for
those automation applications where the input and the output data are digital signals.
For uncomplicated automation applications with a limited number of parameters,
PLCs represent a cost-effective solution. PLCs can also be connected to Fieldbuses
and communication networks for integrated process control. Modern PLCs have also
analog input/outputs and can carry out more complex functions, like for example
regulation with PID controllers.
With the connection of local control systems like PLCs, bus systems or other
controllers together on a common network, information from a whole plant is
collected and recorded and commands can be sent to the detached units in a
coordinated way. Integrated systems of this kind are known as Monitoring and
Control (M&C) systems. In the application of a M&C system in a complex plant it is
strongly advised to structure the control task and the related hardware and software
solutions; an example in this respect is to follow the principles for hierarchical
structuring of the control levels as described in Section 9.6.1. Complex monitoring
and control systems are built modularly and can be constructed from existing kit
components.
The implementation of automated systems does not require that the whole
software is written anew every time. For automation and supervisory computers
software packages are available in which programming does not take place
procedurally but with a description of application-specific parameters („fill-in-the-
blanks“ programming).
At the mechanical level, the most common industrial standard is today the 19“
format for cabinets and racks. The measure 19“ refers to the width of the rack, which
is 19 inch or 482.6 mm. The height of rack system components is measured in
height units (U), where one U is 44.45 mm or 1.75 inches. In practice, only multiples
of three are used for heights, like for example 3U (133.35 mm or 5.25 in). In common
talk the expressions „single height“ and „double height“ are long established.
However, it should be noted that „single height“ means 3U, not one U. These
dimensions are compatible with those for bus board formats (Section 8.2.2). The
Eurocard boards, designed to fit in a 19" rack, have a minimum height of 100 mm
and increase then in steps of 133.35 mm, or 3U. In Figure 12.1 is shown a 19“ rack
cabinet.
Figure 12.1: 19“ Rack cabinet for industrial applications (courtesy of Schroff, Germany)
446 Chapter 12: System Integration
component. Of course this type of problems can happen also in manually controlled
systems, but automation makes the problem bigger.
For the operation of a system the availability is a parameter of practical
importance. Availability is defined as the probability that a component, device or a
system at a given time operates correctly. This probability represents the relation
between the time during which the component operates correctly and the total time in
which the component should operate at all. The availability of a component or a
device is a function of the probability of failures during a given time and of the time
for bringing the component or device back to normal operation after a failure.
Because of the interaction between system parts and components, the total
reliability of a system can become quite small if not all components have a very high
reliability. As an example can be considered a production line with ten machines
connected in series. If each machine always repeats the same operation and makes
an error at an average of every hundred operations, then the probability that the
machine does not make any error during a cycle is 99%. For the preparation of an
acceptable final product all machines must operate correctly, so that the related
probability becomes:
0 .9910 = 0 .904
i.e. the probability that an error-free part is produced is only about 90%. A
commonly used method for the improvement of the total reliability on production lines
is the introduction of buffers between the machines. In this way it is avoided that the
whole production line is brought to a halt in case of failure of a single machine.
n h (t ) n (t )
R(t ) = = 1− f
n n
It is interesting to analyze the relative number of errors of all other operating
components as function of time. This is expressed by the error intensity z(t ) :
f (t ) 1 d
z( t ) = =− R(t ) (12.1)
R(t ) R(t ) dt
If a component has remained operative until the time t, the error intensity
indicates the probability that this component fails immediately after the time t. The
error intensity function z(t ) can be estimated from the observation of a large number
of components over a long time period. Somewhat simpler the function z(t ) can be
12.3: Systems Reliability 449
represented in Figure 12.2. Because of its shape, this curve is also known als
„bathtub“-function.
z (t )
λ
(a) (b) (c)
time
Figure 12.2: The failure rate z(t ) of a component as function of time („bathtub“ function):
(a) early faults; (b) random faults (region with constant fault rate λ ); (c) wear-
out faults.
In general it is examined the „best time“, i.e. the central part of the error intensity
function z(t ) . It is then assumed that a system has been in operation long enough so
that no children illnesses take place. On the other hand a system should not have
been so long in operation, so that its components are already worn out and the
failure rate increases again. With this limitations, z(t ) can be assumed to be
constant, i.e. z(t ) = λ . The solution of Equation (12.1) becomes then:
R(t ) = e − λ ⋅ t (12.2)
The parameter of interest for both user and producer of system components is
how long the component can operate according to the specifications before a fault
occurs. A measure for this is the MTTF (Mean Time To Failure), i.e. the
mathematical expectation of the exponential distribution:
∞
1
MTTF = ∫ R(t ) dt = (12.3)
λ
0
A measure for the availability of a system is derived from the average value in
the time interval in which the system operates correctly. This value is called MTBF
(Mean Time Between Failures). Also a measure for the time in which a system does
not function can be derived from average values; the related value is called MTTR
from Mean Time To Repair and represents the time between the appearance of a
fault and the reestablishment of full system functionality.
The availability A of a component or subsystem is defined as follows:
MTBF
A=
MTBF + MTTR
In systems that consist only in one device or component there are rarely
problems in the calculation of availability. More complex systems of course present
450 Chapter 12: System Integration
entirely different problems. In this brief description it was considered only the case in
which the components are connected in series and how this influences the reliability
of a system. Similar computations can be carried out also for systems connected in
parallel; in general, the parallel connection of similar components increases
reliability, because only when all the components in parallel are faulty the system
function is no longer ensured.
how a single program mistake could bring a major disruption in the American
telephone network.
The problems with programming errors are related with system complexity;
mistakes made during program development can reproduce and remain hidden in
the final product. Programming errors belong to everyday life of complex realizations,
like e.g. automated systems, although only in a few and spectacular cases it is
reported about them.
Differently than with hardware, software does not wear out. All defects in a
program come from the time of its development, so that at least in theory all errors
could be eliminated once for all at the very beginning. The problem is how to
discover them. Mathematical and logical methods help the programmers in the
development of error-free programs. In practice, however, despite intensive and
comprehensive tests most programs still contain mistakes at the beginning of their
operations. In case of unforeseen input data and interrupt signals a program can
behave differently than earlier planned and tested.
Quite often the requirements for a program are changed during the development
phase, as the goal of program utilization becomes clearer and better understood.
Late changes to a program can have considerable effect over its full operation. A
fully ready and tested program could also be used in a different way than originally
foreseen by its developers, which increases again the possibility of errors.
If the perfect program is an illusion, how can it be determined when a program is
sufficiently reliable? First the necessary safety requirements for any specific problem
must be defined. Flight control systems represent a good example for systems with
extreme safety requirements. The requirements for the new control system of the
whole North American airspace state for example that the system can on average be
out of service for only three seconds during a year.
The reliability of a program in relation to the functional requirements must be
determined, for example with tests in the form described in Section 10.6. At the end,
a program should be reasonably error-free. Later on, the program is run for a certain
time and its behavior is observed. All detected errors must be analyzed and
corrected. However, this method is appropriate only if the requirements are not all
too strict (the magnitude order lies at some errors per year). Instead, in complex
systems like aircraft for civil transportation, the specifications require reliability figures
in the magnitude order of 10 −9 serious errors per hour. To test and demonstrate
whether such requirements are fulfilled the programs should be run for a multiple of
10 9 hours, i.e. for a time in the magnitude order of 100,000 years, which is
obviously an impossible task. Another major problem during testing is due to the
effect of the law of diminishing returns. If a program is tested during a very long time,
the errors that are found become so small that their correction has only a minor
effect on the general reliability of the program.
An higher reliability can also be achieved if methods for reliability improvement
are used during program development. Such methods are based on a formal
mathematical theory, they however function only in those cases in which also the
program requirements are defined in a formal way. This means that they should be
expressed in mathematical terms, and this is not always a simple matter.
A method that is used to increase reliability in flight and in railway control
technology is the utilization of redundant systems. Several similar systems are
developed at the same time by different work groups. The assumption is that if any
of the group makes mistakes, at least these mistakes are not the same. The result is
12.4: The Functions of a Computer Control System 453
then a combination of different solutions. For example, the board computer of the
fully electronically controlled aircraft Airbus A320 consists of five different systems
that have been developed on the basis of the same specifications by five different
workgroups in five different programming languages. These systems operate in
parallel and independently of each other. The final control signals for the actuators
that control the aerodynamical surfaces are selected from the output signals by an
electromechanical selector.
physical / automation,
technical process regulation user
12.4.1 Monitoring
Process monitoring, or process data collection, is the basic function common to
all control systems. Monitoring is the collection of the physical process variables,
their storage as well as their presentation in suitable form to the human operator.
Monitoring is fundamental for all other data processing.
Monitoring can be limited to displaying raw or processed data on a terminal
screen or printing them out on paper, but can also include more sophisticated
analysis and presentation functions. For example, variables that cannot be read
directly have to be calculated or estimated from the available measurements (see
observability, Section 3.5.2). Another basic monitoring operations is the verification
that monitored or computed process values do not exceed preset limits.
When the function of the process control system is limited to data collection and
presentation, all control decisions must be taken by an operator. This control mode,
known as supervisory control, was quite common in the first applications of
454 Chapter 12: System Integration
12.4.2 Control
Control is the opposite function to monitoring; the term is however also used to
denote actions related to monitoring. In control in a strict sense, commands from the
computer reach the actuators in order to influence the physical process. In many
cases the required process parameters can be influenced only indirectly via other
control parameters (see controllability, Section 3.5.1).
analog controller. In such a case, the computer is used only for carrying out
calculations and not for measurement or actuation.
A database for automatic process control contains data structures for the
processing of the following data:
• parameters of all sensors and actuators
• parameters for the computation of derived variables
• event definition and - if required - connection with control actions
• table with control actions as function of time
• parameters for the digital controllers.
The programs for the access to the data stored in the process database include
among other the following:
• data input and interface to the database
• data output, i.e. interface between the process database and the process
computer output or actuating devices
• data representation
• interface for command input.
programs data
Figure 12.4: Structure of the real-time process database and of the modules for data access
The principal parameters, or record fields, for the description of a point are listed
in the following. It should be paid attention that different terminologies are used in
different systems although the meaning remains the same.
• code
• name / description
• type
• address or physical reference: channel / message
• event class
• alarm class
• sampling time
12.4: The Functions of a Computer Control System 457
For analog points, the following additional parameters are necessary for the
conversion from the raw values to engineering units (Section 5.5):
• scaling coefficients
• measuring units
• minimum and maximum limit values;
and for digital points:
• description of the states in clear text
• state for the generation of an alarm.
An example of process database record for an analog input is the following:
CODE: T439
DESCRIPTION: PRIMARY CIRCUIT TEMP IN
TYPE: AI
ADDRESS: #7.12.2
EVENT CLASS: 0
ALARM CLASS: 3
SAMPLE (SEC): 30
RAW VALUE: 3228
CONVERTED VALUE: 78.8
ALARM STATE: YES
A-COEFFICIENT: 0.
B-COEFFICIENT: 0.0244
UNITS: °C
MINIMUM VALUE: 50
MAXIMUM VALUE: 75
The code is used to univocally identify the point; in the process database it acts
as key and pointer to the related record. The name (or description) is a clear and
mnemonic text reference to define the point which is used in printouts and screen
presentations. The type shows whether the point is input or output and the kind of
data: analog, digital, counter, etc. In this example, „AI“ indicates that the point is an
Analog Input.
The point must be associated with a certain input channel and a position in the
incoming messages from the peripheral computers. The address of the example
could therefore mean channel #7, unit #12, point #2.
The event class shows whether the point is connected to automated functions to
be started when its value changes. The alarm class indicates whether some state is
to be understood as alarm. The alarm class may also be structured to show the
relative importance of the alarm. Some alarms may namely represent just warnings,
while others could be high-priority alarms and the two types should obviously not be
confused.
458 Chapter 12: System Integration
The parameters sampling time, scaling factors and the limit and alarm values are
contained also in the data structure (record) for input data processing described in
Section 5.5.4. These parameters are needed for a first processing of the signal at a
level as close as possible to the sensors and to the process; the preliminary
processing should take place as fast as possible after sampling.
In the case of the analog input point above, the scaling coefficients for the linear
conversion from raw data to temperature are: a = 0 and b = 100/4095 = 0.0244. It is
assumed here that the analog input value is converted in digital form by a 12-bit A/D-
converter, with 0 corresponding to 0°C and 4095 to 100°C. The raw input value 3228
is converted in (3228*0.0244) = 78.8°C. This is higher than the maximum allowed
value 75°C, so that an alarm state is reported.
For a Digital Input (DI) some of the record parameters differ:
CODE: K010
DESCRIPTION: PRIMARY LOOP PUMP
TYPE: DI
ADDRESS: #7.45.01
EVENT CLASS: 0
ALARM CLASS: 0
SAMPLE (SEC): 0
RAW VALUE: 1
CONVERTED VALUE: ON
STATE=0: OFF
STATE=1: ON
ALARM GENERATION: NO
ALARM STATE: NO
In a point defined as digital input („DI“) the states 0 and 1 are associated to
descriptions in clear text, as e.g. 0=„OFF“ and 1=„ON“, or 0=„OK“, 1=„ALARM“. To
avoid ambiguities and facilitate the programming, the generation of an alarm is not
controlled by the raw value 0/1, but via the converted value „ON“/ „OFF“.
The process database provides the stored data with homogeneity and structure.
In a process control system sensors and actuators are of many different types. A
temperature could be read with a PTC resistor, another with a thermoelement, a third
one with a small digital instrument. The data from the sensors would then reach the
central unit in raw format, or in complete data packets, maybe even already
converted and coded in ASCII. Via the process database each measuring value is
processed separately and converted to a uniform representation. The application
program modules need only to access the database and do not need to take in
consideration the particular physical details of the sensors and the actuators. The
substitution of a sensor with another of a different model does not require the new
coding of one or more program modules, but only the input of the new parameters in
the database. The parameter change can even take place online and without the
need to disconnect or switch off the control system.
Abstraction and separation of the measured values from the physical data is
useful when some parameter has to be updated. It is not necessary to modify a
program or halt the control system, but it is sufficient to redefine the conversion
parameters stored in the database.
12.4: The Functions of a Computer Control System 459
Sorting means ordering the selected data according to some principle, like e.g.
alphabetical ordering of the code field or ordering for increasing/decreasing value, for
sensor type, etc. Sorting is done with reference to one or more of the fields that were
selected in the projection operation.
460 Chapter 12: System Integration
When the three basic database operations are combined together, they may
lead to a large number of combinations. The data contained in a database is too
much to make sense and be understood, but once it is approached with the right
tool, all kinds of desired and task-oriented information can be extracted. The
database access operations provide this tool.
An operation on the database to extract information is called query. There are
several query languages, but their basic operations are always the same, and also in
their syntax there are not many differences. An example of query is the following:
It is easily recognized that „WITH CODE = A*, B* AND TYPE = AI“ is the
selection operation, „PRINT CODE, DESCRIPTION, VALUE, UNITS“ is the
projection and „ORDERED BY CODE“ is the sorting. For newcomers to databases it
will be remembered that sorting may take quite some time, depending on the amount
of records to sort, the quality of the software and the machine capacity. It is not
recommended to start a large database query when in a hurry.
The use of some logical principle in the code structuring for the process points
contributes notably to increase the flexibility of the database. To this purpose it is
necessary to consider the most important selection criteria. The most important
selection types are geographic (all points at a specific location), for system /
subsystem / work cell and for type of sensor. In the definition of the code structure a
precise meaning can be given to all character positions. In the database all objects
are of course treated in a similar way, but still the definition of a structure notably
helps the process operators in the organization and completion of their work tasks.
In order to effectively use a database access program it is necessary to select
beforehand a subset for the data of interest. It is useless to list out the state of all the
points of a system if it is known in advance where the information of interest is
located. Usually only a few combinations of data printouts from the database are of
interest at any particular time, so that a small number of standard queries can be
identified. These queries are known as protocols (no relation with the protocols as
set of rules and procedures for data communication described in Chapters 8 and 9).
Protocols are basically queries in which the projection and sorting operations (what
information to print out and in what order) are predefined and only the selection
parameters need to be given when the function is started (Figure 12.5). Note that the
fields to print out and the sorting order are not explicitly indicated in the query.
Alarm protocols
One of the most important functions of a control system is to quickly recognize
unallowed states and to alarm the human operators. Every variation of the state of
points classified as alarm should also be recorded with indication of the time in a
special file, the alarm-log.
12.4: The Functions of a Computer Control System 461
A particular query, the alarm protocol, is used to search and list all those objects
from the database that are in alarm state at any given moment. This protocol is
particularly important for maintenance and repair works.
Maintenance Protocols
Another important aspect of the operation of a technical plant is the maintenance
of devices and equipment, that has to be carried out by the personnel. Examples of
maintenance actions are the substitution of worn-out machine tools, the calibration of
sensors and the control of the level of fuel and lubricants. Maintenance actions can
even be quite complicated, up to the point of disassembling complex machine
equipment to check and clean all of their parts. This type of maintenance is called
preventive maintenance and is carried out to keep the equipment at an optimum
operational state. Actions to repair devices or parts that are already defective or
broken down are instead known as corrective maintenance.
Depending on the type of device, preventive maintenance operations are carried
out either on a fixed schedule (e.g. once every thirty days) or after a certain
accumulated work time (a tool may have to be changed after 200 hours of
operation). In a large plant, maintenance is required for hundreds or even thousands
of devices. To keep tab of the right schedule manually is a complicated and not
particularly grateful task.
It is straightforward to prepare schedules for the planned maintenance actions
for a workday or other selected time period from the data stored in the process
database. The repair of a device after a defect appeared cannot of course be
planned in advance, but still also the data of the unplanned measure can be stored
in the database, to save some redundant maintenance actions later on. If a piece of
equipment is repaired on Monday after a breakdown, it is not necessary to carry out
the yearly control on Wednesday, even if it was initially planned for that date. An
example of preventive maintenance schedule is shown in Figure 12.6.
462 Chapter 12: System Integration
A particular kind of event is when a certain time has been reached or when a
period of time has elapsed. The action table has then the form
In this way for example in a factory the lights can be automatically turned on and
the machines powered shortly before the beginning of the first work shift. Extra
parameters can be used to qualify the data in the tables. Holidays are recorded
separately to be treated e.g. as Sundays, to avoid a plant warming up and starting all
automated equipment at 6:30 a.m. on a Monday, Dec. 25th.
Also the parameters for digital regulators can be stored in the database in form
of records. The most common types of digital regulators are implementations of PID
regulators where the integration and derivation operations are approximated with
numerical methods. In Direct Digital Control (DDC) the regulators are built in the
database. DDC packages are implemented with a single program module acting on
the basis of parameters for each single control loop; the parameters are structured
12.4: The Functions of a Computer Control System 463
as records to be stored in the database. Examples of such data structures and of the
code for a digital PID regulator have been shown in Chapter 6.
There is an important practical difference in automation function and process
regulation via the database or with PLC systems or local regulators. The latter are
installed close to the process inputs and outputs and can react quickly to a change in
the input data. The database of a hierarchical control system has instead a slower
reaction time because the information must follow the communication chain up and
down, and go through several processing steps in the central processor. It is
therefore worth programming automated reactions in the central computer only when
several parameters have to be compared to each other and when the same
operation cannot be performed in the local control units. Tight control loops cannot
be implemented in DDC form, and the possibility of a heavy overload of the
communication channels must also be taken into consideration.
• safety (the system won’t act in a dangerous way under unforeseen conditions)
• maintainability (almost all systems need some kind of periodical human
intervention for cleaning, checking, calibration, etc; these operations should be
facilitated)
• economy (more in the sense of getting value for money than just spending as
little money as possible).
It is imperative that all parts of a system are correctly documented in relation to
the hardware and software implementation as well as to the functions to be
performed. The documentation is the interface between the different people working
at the project when they cannot communicate directly. The documentation should not
be considered as an uncomfortable contractual duty to fulfill after a system has been
developed and delivered, but rather as a key element of its development and its
success.
Testing a system is a very important step. It must be verified that the operations
satisfy the general planning indications and the specification documents. Testing is
of course necessary to identify errors as soon as possible for immediate correction.
The steps of planning, project design, implementation and testing are ideally
separated, but there are actually strong interactions and feedback among them.
During the project phase some new facts may appear, which might lead to changes
in planning. Practical, previously unknown, implementation constraints may also
influence the course of the project. With new experience gained in the field it may
become necessary to change again parts already considered as completed.
Unfortunately, changes in the specifications become harder and costlier to
implement the later they are done, but on the other hand a complex system is
constantly modified anyway. There is no final version as such, only different degrees
of functionality.
The project engineer and the test engineer have two different goals. The project
engineer has to design a robust and efficient system. The test engineer has to think
out various tests in order to find as many errors as possible. Both have to follow the
original requirements’ document, although changes dictated by practicality and
common sense may be included.
The standard ISO 9000 „Quality management and quality assurance standards“
is actually a collection of five standards (ISO 9000 through 9004), in which it is
defined how controls and verifications should be carried out in the different phases of
work organization for project development. These standards specify also in what
measure manufacturer and customer carry the main responsibility for different
project phases and define also the type of contractual regulations. ISO 9000 does
not only refer to the technical production or the construction of a plant, but includes
also the related services and organizational measures on the part of the contractor.
In other words, the quality-conscious contractor can follow the indications of ISO
9000 in its production and in this way show his customers a concrete quality
certification.
components exactly at the moment when they are needed. Large companies, in
particular in the automotive industry, can in this way do without large and costly
warehouse storage.
The JIT principle was first developed at Toyota. It combines socio-economical
factors with technical methods and regards information technology as well as the
distribution of responsibilities among the personnel and the subcontractors. The
realization of the JIT principle is a long and costly process; it took Toyota itself about
ten years to introduce JIT in its production lines.
A further reason for the introduction of the JIT method was that warehouse stock
hide problems in the production. To explain the JIT principle the Japanese use the
following analogy. Buffering warehouses are like water in an harbor, while the sea
bottom represents the problems. The buffer-water hides the sea floor, so that a boat
can run into it. If the water level is lowered, the floor can be recognized and detours
can be made if it is necessary. In a similar way, if buffers are eliminated from the
production, also the problem areas become clearer, so that the necessary solutions
can be found easier.
For European and American companies the main goal is to make quick profits in
existing markets. Development and marketing are focussed on this goal, and the
main object of attention are the products. In Japan, instead, also the productive
process is considered. The company strategy is not only oriented toward short-term
profits, but rather toward long-term growth and stability. In parallel to product
development the Japanese also make efforts to create the related markets with long-
term actions. This does not easily fit the rougher, profit-oriented policies of Western
companies. However, in the meanwhile the Japanese insights have also reached
many European and American companies.
Each medal has its backside. Thanks to JIT the warehouses of the ordering
companies are kept small, but those of the subcontractors become larger. And when
parts of the warehouses are brought to the street, traffic density increases. Traffic-
related problems have now such influence over transport links, so that „Just-in-Time“
turns more and more into a kind of „Just-in-Line“. To reverse the Japanese analogy:
when the water level is lowered, the sea floor is better recognized, but new
unnavigable shallow areas are also created. In fact, in the meantime, the high
sensitivity to disturbances of the JIT concept has brought companies like Toyota and
Nissan to build again warehousing capacity in their new plants.
Computers act as information amplifiers, and therefore will enhance both the
good and the bad sides of a process or a system. With computers, what already
works satisfactorily will work even better, but what works poorly will cease to work
altogether. And technology should never become an end in itself. A microprocessor
can be installed in the coffee machine, but that doesn’t mean that the way of drinking
coffee is much different than if the water had been cooked on a stove. What is
essential is to define exactly measurable goals and design the tool or the automated
plant accordingly. The goals should be clearly identified, for example:
• reduction of the mean production time per unit from 2 hours to 45 min
• reduction of the production costs per unit by 10%
• quality control: reduction of faulty parts from 20% to 5%
• reduction of dead times (i.e. when a machine is not utilized because another
has to terminate its operation) by 50%
If this type of goals cannot be reached with automation, or if it can be reached
with other solutions than automation, then - don’t automate!
468 Chapter 12: System Integration
12.6 Summary
Computers are used in process control for data collection, analysis and
archiving, but apart from process regulation there are comparatively few applications
in automatic control. There is still much to do in this respect.
In a digital control system it is comparatively easy to try new control strategies,
because a digital computer may completely change the way it operates when its
software is modified, without need to redesign and rewire the whole hardware. Digital
control systems are thus not just a new way to implement established principles for
control, but rather an entirely new technique that offers greater flexibility and new
possibilities.
The implementation of control systems takes place at many levels. The final
choice of a particular solution may be dictated not only by technical aspects, but also
by factors as different as personnel availability, operating environment, and others.
For large applications that are typical in both manufacturing and process industry,
generalized monitoring and control packages programmed on the basis of parameter
tables can be used. The advantage of ready packages for automated monitoring and
control lies in simpler programming and operation. Often such systems also support
the writing and updating of the documentation.
Automation is a key technology to support quality and efficiency in industrial and
processing applications and computers are the basic components for advanced
automation. The future of automation is not restricted to manufacturing plants:
automation is going to play a key role also in the efficient use of natural resources
and in the protection of the environment from the negative aspects of a too fast and
indiscriminate industrial development. Automation is one of the few realistic answers
to the problem of enjoying a high quality of life in a world worth living in.
Further Reading
Discrete manufacturing offers different kind of computer control problems. A
descriptive view of these problems is found in [Groover 1987], while a more
analytical description of representative problems is found in [Gershwin 1994].
[Brooks 1975] is a witty and pregnant pamphlet about the real-life aspects (read:
delays) of software project planning. Recommended lecture for software
development managers, especially when they do not have direct programming
experience.
A general introduction to software reliability is provided in [Littlewood / Strigini
1992]. Fault tolerance in complex and distributed computer systems, under
consideration of hardware, software and communication aspects is given in
[Tanenbaum 1995].
Databases are described in [Ullman 1988]. This book offers a high-level
description of different database types (relational, hierarchical, etc.) as special cases
of a general database concept. Applications of expert systems for process fault
diagnosis is discussed in [Hayes-Roth / Waterman / Lenat 1983].
An important information source are the product catalogues of the different
hardware and software producers in industrial automation. Some of these catalogues
are particularly instructive and also written pedagogically.
Appendix: Standards and Standardization Organizations
The need to standardize the interfaces of different components and systems has
long been recognized by the users and the industry. Also in this book standards are
referred to in several places. Different professional and governmental organizations
work to define standards in different sectors to be used as guidelines for the
construction of components and services. Basically, standards are needed to ensure
that different components can operate together and that the required quality level is
achieved. Standards are prepared by national and international committees in which
customarily participate representatives of companies, professional organizations,
universities and governmental institutions. However, in many cases current
standards do not necessarily represent the best technical solution, because they
describe already existing realizations and therefore create „compatibility islands“. In
some cases, it is attempted in the standardization work to define general frames
before the introduction of practical - real - solutions.
On the other hand, some design solutions for components and system parts
have been so widely accepted in industrial environments to become de-facto
standards. In this respect the „anarchy“ of the industry and of the free market has led
to better results, namely less standards but that are also more widely accepted and
recognized, than what the ordered and lengthy work of international bureaucrats
would have created. The most successful solutions have been those that gave room
for flexible realizations at reasonable costs together with a practical mechanical and
electrical construction basis.
Different terminologies are used in different contexts, so that „standards“,
„recommendations“, „guidelines“ and others are encountered. Only standards that
have been developed by recognized governmental or professional organizations
have official status. Any other recommendations, guidelines and the like have no
official character and their acceptance depends ultimately on the users.
Standards can be either de jure („legal“) and de facto („factual“). Legal standards
are defined by recognized government or industrial organizations. De facto
standards, often also called „industrial standards“, develop spontaneously when in
practice almost everybody does the same thing or uses the same product but without
anyone officially taking the decision. This has been the case with the „industry
standard“ computer (what is meant is the IBM PC and its compatibles), the Hayes
modem protocol, the Epson printer control language and others. Many de facto
standards have even been later sanctioned by official organizations. The nice thing
with de facto standards is that everybody agrees on using them without being told to
do so.
The case is different with standards meant to be such. As there is always
disagreement in large international panels in what to do, in many cases several
incompatible standards are defined for the same issue, as for example has
happened with the network data packet formats described in Section 9.5. Yet such a
situation is better than nothing. It must be noted that the need for convergence and
for the use of common standards is more and more recognized, and that the
cooperation between the different standardization organizations is improving. The
most important organizations responsible for the definition of standards recognized
and used by the industry are briefly listed below.
469
470 Computer Systems for Automation and Control
Reference addresses
The original standards publications can be ordered from the respective
organizations; some addresses are reported here for convenience. National
standards organizations also act as points of sale for literature of the standards
organizations from other countries. On placing orders it should be noted that some
standards are just a few pages long, others encompass hundreds or even thousands
of pages. Because of the necessary precision and clarity the style is precise, but dry
and reminds of definitions from dictionaries. This type of publications is therefore
intended for reference rather than for continuous reading.
The ISO/IEC standards are also available from any of their national member
organisations.
[Atkinson et al. 1990] Atkinson, Rita L., Richard C. Atkinson, Edward E. Smith, and
Ernest R. Hilgard: Introduction to Psychology (10th edition); San Diego, CA: Harcourt
Brace Jovanovich, 1990.
[Bainbridge 1983] Bainbridge, Lisanne: „Ironies of Automation“; Automatica, Vol.19
No.6, pp.775-779, 1983.
[Barney 1988] Barney, George C.: Intelligent Instrumentation: Microprocessor
Applications in Measurement and Control (2nd edition); Englewood Cliffs, NJ:
Prentice-Hall, 1988.
[Bellman / Kalaba 1964] Bellman, Richard E. and Robert Kalaba (Eds.): Selected
Papers on Mathematical Trends in Control Theory; New York: Dover Publications,
1964.
[Ben-Ari 1990] Ben-Ari, M.: Principles of Concurrent and Distributed Programming;
New York: Prentice Hall, 1990.
[Bendat / Piersol 1986] Bendat, Julius S. and Allan G. Piersol: Random Data -
Analysis and Measurement Procedures (2nd edition); New York: Wiley, 1986.
[Bendat / Piersol 1993] Bendat, Julius, and Allan Piersol: Engineering Application of
Correlation and Spectral Analysis (2nd edition); New York: Wiley, 1993.
[Bender 1990] Bender, Klaus (Hrsg.): PROFIBUS (in German); München and Wien:
Carl Hanser Verlag, 1990.
[Black 1989] Black, Uyless D.: Data Networks - Concepts, Theory and Practice;
Englewood Cliffs, NJ: Prentice-Hall, 1989.
[Bode 1960] Bode, Hendrik Wade: „Feedback - the History of an Idea“, lecture given
at the Conference on Circuits and Systems, New York, 1960, reprinted in [Bellman /
Kalaba 1964].
[Brinch Hansen 1973] Brinch Hansen, Per: Operating Systems Principles;
Englewood Cliffs, NJ: Prentice-Hall, 1973.
[Brooks 1975] Brooks, Frederick P.: The Mythical Man-Month; Reading, MA:
Addison-Wesley, 1975.
[Buckley 1964] Buckley, Page S.: Techniques of Process Control; New York: Wiley,
1964.
[Cannon 1967] Cannon, R.H. Jr.: Dynamics of Physical Systems; New York:
McGraw-Hill, 1967.
473
474 Computer Systems for Automation and Control
[Glass 1983] Glass, Robert L. (Ed.): Real-Time Software; Englewood Cliffs, NJ:
Prentice-Hall, 1983.
[Gore 1991] Gore, Al (Senator): „Infrastructure for the Global Village“; Scientific
American, vol.265 n.3, pp. 108-111, September 1991.
[Groover 1987] Groover, Mikell P.: Automation, Production Systems, and Computer
Integrated Manufacturing; Englewood Cliffs, NJ: Prentice-Hall, 1987.
[Hassel / Tuvstedt 1978] Hassel, K., and G. Tuvstedt: „Microcomputer Problems in
Real-Time“ (in Swedish); Elteknik med aktuell elektronik, No 14 (1978).
[Hayes-Roth / Waterman / Lenat 1983] Hayes-Roth, Frederick, Donald A.
Waterman, and Douglas B. Lenat (Eds.): Building Expert Systems; Reading, MA:
Addison-Wesley, 1983.
[Held 1989] Held, Gilbert: Data Communication Networking Devices; New York:
Wiley, 1989.
[Henze et al. 1987] Henze, Mogens, C.P. Lesley Grady, Willi Gujer, and G.v.R.
Marais: Activated Sludge Model No.1, Scientific and Technical Report; London:
IAWPRC (International Association for Water Pollution and Control), 1987.
[Hofstadter 1979] Hofstadter, Douglas R.: Goedel, Escher, Bach - An Eternal
Golden Braid; New York: Basic Books Publishers, 1979.
[Hufault 1986] Hufault, John R.: Op Amp Network Design; New York: Wiley, 1986.
[Irvine 1994] Irvine, Robert G.: Operational Amplifier Characteristics and
Applications (3rd edition); Englewood Cliffs, NJ: Prentice-Hall, 1994.
[Jones 1986] Jones, Brian K.: Electronics for Experimentation and Research;
Englewood Cliffs, NJ: Prentice-Hall, 1986.
[Juds 1988] Juds, Scott M.: Photoelectric Sensors and Controls - Selection and
Application; New York: Dekker, 1988.
[Kaminski 1986] Kaminski, Michael A. Jr.: „Protocols for communicating in the
factory“; IEEE Spectrum, pp. 56-62, April 1986.
[Kay 1977] Kay, Alan: „Microelectronics and the Personal Computer“; Scientific
American, vol.237 n.3, pp. 230-244, September 1977.
[Kay 1984] Kay, Alan: „Computer Software“; Scientific American, vol.251 n.3, pp. 41-
47, September 1984.
[Kenjo / Sugawara 1994] Kenjo, Takashi, and Akira Sugawara: Stepping Motors
and their Microprocessor Controls (2nd edition); Oxford: Clarendon Press, and New
York: Oxford University Press, 1994.
[Klir / Folger 1988] Klir, George J., and Tina A. Folger: Fuzzy Sets, Uncertainty, and
Information; Englewood Cliffs, NJ: Prentice-Hall, 1988.
[Kosko 1990] Kosko, Bart: Neural Networks and Fuzzy Systems - A Dynamical
Systems Approach to Machine Intelligence; Englewood Cliffs, NJ: Prentice-Hall,
1990.
[Kreutzer 1986] Kreutzer, Wolfgang: System Simulation - Programming Styles and
Languages; Reading, MA: Addison-Wesley, 1986.
[Kuo 1995] Kuo, Benjamin C.: Automatic Control Systems (7th edition); Englewood
Cliffs, NJ: Prentice-Hall, 1995.
[Lee 1978] Lee, Samuel C.: Modern Switching Theory and Digital Design;
Englewood Cliffs, NJ: Prentice-Hall, 1978.
[Leonhard 1985] Leonhard, Werner: Control of Electrical Drives; Berlin and New
York: Springer Verlag, 1985.
[Levy / Eckhouse 1980] Levy, Henry M. and Richard H. Eckhouse: Computer
Programming and Architecture - The VAX-11; Bedford, MA: Digital Press, 1980.
476 Computer Systems for Automation and Control
[Littlewood / Strigini 1992] Littlewood, Bev, and Lorenzo Strigini: „The Risks of
Software“; Scientific American, vol.267 n.5, pp. 38-43, November 1992.
[Ljung 1987] Ljung, Lennart: System Identification - Theory for the User; Englewood
Cliffs, NJ: Prentice-Hall, 1987.
[Ljung / Glad 1994] Ljung, Lennart, and Torkel Glad: Modeling of Dynamic Systems;
Englewood Cliffs, NJ: Prentice-Hall, 1994.
[Ljung / Söderström 1983] Ljung, Lennart, and Torsten Söderström: Theory and
Practice of Recursive Identification; Cambridge, MA: MIT Press, 1983.
[Loukides 1990] Loukides, Michael: System performance tuning; Sebastopol, CA:
O'Reilly, 1990.
[Luenberger 1979] Luenberger, David G.: Introduction to Dynamic Systems -
Theory, Models and Applications; New York: Wiley, 1979.
[Luyben 1990] Luyben, William L.: Process Modelling, Simulation and Control for
Chemical Engineers (2nd edition); New York: McGraw-Hill, 1990.
[Mayr 1970] Mayr, Otto: The Origins of Feedback Control; Cambridge, MA: M.I.T.
Press, 1970.
[Mohan / Undeland / Robbins 1995] Mohan, Ned, Tore M. Undeland, and William
P. Robbins: Power Electronics - Converters, Applications, and Design (2nd edition);
New York: Wiley, 1995.
[Morrison 1986] Morrison, Ralph: Grounding and Shielding Techniques in
Instrumentation (3rd edition); New York: Wiley, 1986.
[Newsweek 1990] „Can We Trust Our Software?“; Newsweek Intl., January 29,
1990.
[Norman 1988] Norman, Donald A.: The Psychology of Everyday Things; New York:
Basic Books Publishers, 1988.
[Norman / Draper 1986] Norman, Donald A. and Stephen W. Draper (Eds.): User
Centered System Design - New Perspectives on Human-Computer Interaction;
London and Hillsdale, NJ: Lawrence Erlbaum Associates, 1986.
[Norton 1989] Norton, Harry N.: Handbook of Transducers; Englewood Cliffs, NJ:
Prentice-Hall, 1989.
[Olsson 1985] Olsson, Gustaf: „Control Strategies for the activated sludge process“
(Chapter 65), in Cooney, Charles E. and Arthur E. Humphrey (Eds.): Comprehensive
Biotechnology - The Principles of Biotechnology; New York: Pergamon Press, 1985.
[Ott 1988] Ott, Henry: Noise Reduction Techniques in Electronic Systems (2nd
edition); New York: Wiley, 1988.
[Pessen 1989] Pessen, David W.: Industrial Automation: Circuit Design and
Components; New York: Wiley, 1989.
[Peterson 1989] Peterson, Wade D.: The VMEbus Handbook; Scottsdale, AZ:
VMEbus Intl. Trade Association (VITA), 1989.
[Pirsig 1974] Pirsig, Robert M.: Zen and the Art of Motorcycle Maintenance - An
Inquiry into Values; New York: Bantam, and New York: Morrow, 1974.
[Preece / Keller 1990] Preece, Jenny, and Laurie Keller (Eds.): Human-Computer
Interaction; Englewood Cliffs, NJ: Prentice Hall, and The Open University, 1990.
[Rasmussen 1983] Rasmussen, Jens: „Skills, Rules, and Knowledge; Signals, Signs
and Symbols, and Other Distinctions in Human Performance Models“; IEEE
Transactions on Systems, Man and Cybernetics, Vol.13 No.3, pp.257-266, 1983.
[Rasmussen / Duncan / Leplat 1987] Rasmussen, Jens, Keith Duncan, and
Jacques Leplat (Eds.): New Technology and Human Error; New York: Wiley, 1987.
[Salvendy 1987] Salvendy, Gavriel (Ed.): Handbook of Human Factors; New York:
Wiley, 1987.
Bibliography 477
[Warrior / Cobb 1988] Warrior, Jay, and Jim Cobb: „Structure and Flexibility for
Fieldbus Messaging“; Control Engineering, pp. 18-20, October 1988.
[Washburn / Evans 1996] Washburn, Kevin and Jim Evans: TCP/IP: Running a
Successful Network (2nd edition); Harlow, England and Reading, MA: Addison
Wesley, 1996.
[Wilson / Hawkes 1989] Wilson, J. and J.F.B. Hawkes: Optoelectronics - An
Introduction (2nd edition); Englewood Cliffs, NJ: Prentice-Hall, 1989.
[Wolfram 1991] Wolfram, Stephen: Mathematica - A System for Doing Mathematics
by Computer (2nd edition); Reading, MA: Addison Wesley, 1991.
[Wood 1988] Wood, G. G.: „International Standards Emerging for Fieldbus“; Control
Engineering, pp. 22-25, October 1988.
[Yager / Zadeh 1987] Yager, Ronald R. (Ed.): Fuzzy Sets and Applications -
Selected Papers by L[otfi] A. Zadeh; New York: Wiley, 1987.
[Young 1982] Young, Stephen J.: Real-Time Languages - Design and Development;
Chichester, England: Ellis Horwood Ltd., and New York: Wiley, 1982.
Lund University
Lund Institute of Technology
Department of Industrial Electrical Engineering and Automation
1998