At.215.en.lecture Notes
At.215.en.lecture Notes
Automation Engineering
Version 5.0.en
Foreword
This book examines the foundations of automation engineering in a world increasingly
focused on the development and implementation of automation. It provides the reader with an
understanding of the key principles and components of automation engineering and how these
principles can then be combined and implemented in a real industrial system to provide safe,
economically viable, and efficient systems. A wide range of different systems including chemical,
electrical, and mechanical systems, will be considered.
At the end of each chapter, questions testing the reader’s understanding of the material
presented as well as providing places for extension and deeper understanding of the topics at hand
are given.
In order to clearly differentiate between regular text and computer-related symbols, the font
Courier New is used for all computer-related symbols.
This book is meant to be used as the course material for an introductory, bachelor’s-level
course in automation engineering. It is possible to present different permutations and combinations
of the material depending on what topics are of interest to the particular students.
Computer files and related material can be downloaded from the book website (please
insert the appropriate book website once the book has been published).
The author would like to thank Ying Deng and M.P. for their help in preparing some of the
material used in this book. As well, the author would like to thank the students of the course
AT.215 Automation Engineering for their corrections and suggestions for the contents of this
textbook.
i
Table of Contents
Foreword i
Chapter 1 : Introduction to Automation Engineering 16
Section 1.1 : The History of Automation Engineering 16
Section 1.2 : The Key Concepts in Automation Engineering 20
Section 1.3 : Framework for Automation Engineering 23
Section 1.4 : The Automation-Engineering Pyramid 24
Section 1.5 : Chapter Problems 25
Section 1.5.1 : Basic Concepts 26
Section 1.5.2 : Short Exercises 27
Chapter 2 : Instrumentation and Signals 28
Section 2.1 : Types of Signals 28
Section 2.2 : Sensors 31
Section 2.2.1 : Pressure Sensor 33
Section 2.2.2 : Liquid-Level Sensors 34
Section 2.2.3 : Flow Sensors 35
Section 2.2.4 : Temperature Sensors 37
Section 2.2.5 : Concentration, Density, Moisture, and Other Physical-Property Sensors 38
Section 2.3 : Actuators 38
Section 2.3.1 : Valves 39
Section 2.3.2 : Pumps 44
Section 2.3.3 : Variable Current Devices 46
Section 2.4 : Programmable Logic Computer (PLCs) 47
Section 2.5 : Communication Devices 51
Section 2.6 : Further Reading 52
Section 2.7 : Chapter Problems 53
Section 2.7.1 : Basic Concepts 53
Section 2.7.2 : Short Questions 54
Chapter 3 : Mathematical Representation of a Process 57
ii
Section 3.1 : Laplace and Z-Transforms 57
Section 3.1.1 : Laplace Transform 57
Section 3.1.2 : Z-Transform 62
Section 3.2 : Time- and Frequency-Based Models 65
Section 3.2.1 : Time- and Frequency-Domain Representations 67
Section 3.2.2 : Converting Between Representations 68
Section 3.2.3 : Discrete-Time Models 72
Section 3.2.4 : Converting Between Discrete and Continuous Models 73
Section 3.2.5 : Impulse-Response Model 74
Section 3.2.6 : Compact State-Space Representation 75
Section 3.3 : Process Analysis 76
Section 3.3.1 : Frequency-Domain Analysis 81
Section 3.3.2 : Stability 84
Section 3.3.3 : Realisability 95
Section 3.3.4 : Controllability and Observability 96
Section 3.3.5 : Analysis of Special Transfer Functions 97
Section 3.4 : Event-Based Representations 119
Section 3.5 : Further Reading 130
Section 3.6 : Chapter Problems 130
Section 3.6.1 : Basic Concepts 130
Section 3.6.2 : Short Questions 132
Section 3.6.3 : Computational Exercises 136
Chapter 4 : Schematic Representation of a Process 137
Section 4.1 : Block Diagrams 137
Section 4.2 : Process-Flow Diagrams 140
Section 4.3 : Piping-and-Instrumentation Diagrams (P&ID) 141
Section 4.3.1 : P&ID Component Symbols According to the DIN EN 62424 Standard 141
Section 4.3.2 : Connections and Piping in P&IDs 144
Section 4.3.3 : Labels in P&IDs 144
Section 4.4 : Electric and Logic Circuit Diagrams 148
Section 4.5 : Further Reading 150
iii
Section 4.6 : Chapter Problems 151
Section 4.6.1 : Basic Concepts 151
Section 4.6.2 : Short Questions 151
Section 4.6.3 : Computational Exercises 157
Chapter 5 : Control and Automation Strategies 158
Section 5.1 : Open- and Closed-Loop Control 159
Section 5.1.1 : Open-Loop Control 159
Section 5.1.2 : Closed-Loop Control 160
Section 5.2 : Feedforward Control 183
Section 5.3 : Discrete-Event Control 186
Section 5.4 : Supervisory Control 187
Section 5.4.1 : Cascade Control 188
Section 5.4.2 : Model Predictive Control 189
Section 5.5 : Advanced Control Strategies 196
Section 5.5.1 : Smith Predictor 196
Section 5.5.2 : Deadbanding and Gain Scheduling 196
Section 5.5.3 : Squared Control 197
Section 5.5.4 : Ratio Control 197
Section 5.5.5 : Input-Position Control 199
Section 5.5.6 : Nonlinear Characterisation 199
Section 5.5.7 : Bumpless Transfer 200
Section 5.6 : Further Reading 200
Section 5.7 : Chapter Problems 201
Section 5.7.1 : Basic Concepts 201
Section 5.7.2 : Short Questions 202
Section 5.7.3 : Computational Exercises 203
Chapter 6 : Boolean Algebra 206
Section 6.1 : Boolean Operators 206
Section 6.2 : Boolean Axioms and Theorems 207
Section 6.3 : Boolean Functions 208
Section 6.3.1 : Sum-of-Products Form and Minterms 209
iv
Section 6.3.2 : Product-of-Sums Form and Maxterms 211
Section 6.3.3 : Don’t-Care Values 213
Section 6.3.4 : Duality 213
Section 6.4 : Minimising a Boolean Function 214
Section 6.5 : Further Reading 219
Section 6.6 : Chapter Problems 219
Section 6.6.1 : Basic Concepts 220
Section 6.6.2 : Short Questions 220
Chapter 7 : PLC Programming 223
Section 7.1 : The Common IEC-Standard Hierarchy 223
Section 7.2 : Types of Variables 225
Section 7.3 : Variables, Data Types, and Other Common Elements 226
Section 7.3.1 : Simple Elements 226
Section 7.3.2 : Variables 236
Section 7.3.3 : Data Types 236
Section 7.4 : Ladder Logic (LL) 239
Section 7.4.1 : Components of Ladder Logic 240
Section 7.4.2 : Functions and Ladder Logic 242
Section 7.4.3 : Examples of Using Ladder Logic 243
Section 7.4.4 : Comments 245
Section 7.5 : Instruction List (IL) 246
Section 7.5.1 : Universal Accumulator 246
Section 7.5.2 : Operators 247
Section 7.5.3 : Functions in Instruction List 248
Section 7.5.4 : Calling Function Blocks in Instruction List 249
Section 7.5.5 : Examples 250
Section 7.5.6 : Comments 252
Section 7.6 : Function-Block Language (FB) 252
Section 7.6.1 : Blocks Used in the Function-Block Language 252
Section 7.6.2 : Feedback Variable 254
Section 7.6.3 : Example 254
v
Section 7.6.4 : Comments 255
Section 7.7 : Structured Text (ST) 255
Section 7.7.1 : Commands in Structured Text 255
Section 7.7.2 : Operators in Structured Text 257
Section 7.7.3 : Calling Function Blocks in Structured Text 258
Section 7.7.4 : Example 258
Section 7.7.5 : Comments 260
Section 7.8 : Sequential-Function-Chart Language (SFC) 261
Section 7.8.1 : Steps and Transitions 261
Section 7.8.2 : Action Blocks 263
Section 7.8.3 : Sequential Function Charts 264
Section 7.8.4 : Example 266
Section 7.8.5 : Validity of a Sequential Function Chart 269
Section 7.9 : Further Reading 272
Section 7.10 : Chapter Problems 272
Section 7.10.1 : Basic Concepts 273
Section 7.10.2 : Short Questions 273
Section 7.10.3 : Computational Exercises 278
Chapter 8 : Safety in the Automation Industry 279
Section 8.1 : Safety of the Physical System 279
Section 8.1.1 : Quantifying Risk and the Safety Integrity Level 281
Section 8.2 : Safety Regulations 283
Section 8.3 : Digital Safety 284
Section 8.4 : Further Reading 285
Section 8.5 : Chapter Problems 285
Section 8.5.1 : Basic Concepts 285
Section 8.5.2 : Short Questions 286
Bibliography 288
Appendix I : Partial Fractioning 290
vi
List of Figures
Figure 1: Automation Engineering in the Time of the Ancient Greeks: (left) Æolipile (Steam
Engine) and (right) Automated Opening Device for a Temple Door 17
Figure 2: Watt Governor (a: fly ball, b: arms, c: spindle, d: sleeve, e: ball-crank lever, and f:
throttle) 18
Figure 3: A Process in Automation Engineering 20
Figure 4: General Structure of an Automated System 23
Figure 5: Automation-Engineering Pyramid 25
Figure 6: Timing Diagram for Two Binary Signals A and B 29
Figure 7: Continuous and Discrete Signals 30
Figure 8: Analogue-to-Digital Conversion 30
Figure 9: Typical Calibration Curve 32
Figure 10: Measurement Set-Up for Pressure Sensors: (i) Measuring Differential Pressure and (ii)
Measuring Absolute Pressure (a: flexible membrane, Pa: ambient pressure, Pm: the
pressure that is to be measured, and Pf: fixed pressure) 33
Figure 11: High-Pressure Transducer-Based Pressure Sensor (a: measuring diaphragm, b: strain
gauge, c: reference hole to the atmosphere, d: true gauge diaphragm, and e: area for the
resistor for temperature correction and internal electronic amplifiers) 34
Figure 12: Level Measurement and Control Using a Float (a: trip lever, b: refill tube, c: float, d:
overflow tube, e: ballcock, f: lift chain, and g: flush valve) 35
Figure 13: Venturi Tube (a: datum, b: U-tube manometer, c: manometer fluid, d: inlet, e: outlet, f:
main pipe, g: converging cone; h: throat, i: diverging cone, D1: diameter of the main pipe,
D2: diameter of the throat, Z1: reference height 1, Z2: reference height 2, and h: height
difference in the manometer) 36
Figure 14: Thermocouple (a: metal 1, b: metal 2, c: measurement point, d: reference location, T1:
temperature to be measured, T2: reference temperature, and V: voltmeter) 37
Figure 15: Pneumatically Actuated Control Valve (Air-to-Close) (a: supply air connection, b:
mechanical stop, c: diaphragm, d: upper chamber, d: lower chamber, f: spring, g: housing,
h: local position indicator, i: stem, and j: flow direction, and k: transducer) 40
Figure 16: Inherent Valve Characteristics 43
vii
Figure 17: Phase Plot for the Typical Behaviour of a Valve with Stiction (after Shoukat Choudhury
et al. (2005)). The arrows show the direction in which the values were changed. 43
Figure 18: Centrifugal Pump (a: inflow, b: impeller, c: shaft, and d: outflow) 44
Figure 19: Positive-Displacement Pump (a: inflow, b: packing, c: piston rod, d: stuffing-box
bushing, e: liner, f: piston, g: working fluid, h: valve, and i: outflow) 45
Figure 20: Pump Characteristic Curve for a Centrifugal Pump 46
Figure 21: Layout of a PLC 48
Figure 22: Pre-emptive and Nonpre-emptive Tasks 51
Figure 23: Determining the Settling Time 78
Figure 24: Bode Plot: The Argument-Ratio and Phase-Angle Plots 83
Figure 25: A Nyquist Plot (for the same process as given by the Bode plot in Figure 24) 84
Figure 26: Bode Plot for Closed-Loop Stability Analysis 94
Figure 27: Closed-Loop Stability using the Bode Plot 95
Figure 28: Closed-Loop Stability Using the Nyquist Plot 95
Figure 29: Response of the Integrator 1 / s to a Unit-Step Input 99
Figure 30: Bode Plot for an Integrator 99
Figure 31: Bode Plot for a Lead Term (top row) K > 0, (bottom row) K < 0, (left) τL > 0, and (right)
τL < 0 102
Figure 32: Step Response of a Stable, First-Order System 104
Figure 33: Bode Plot for a First-Order System (top row) K > 0, (bottom row) K < 0, (left) τp > 0,
and (right) τp < 0 105
Figure 34: Second-Order Underdamped Process 107
Figure 35: Step Response of a Critically Damped System (ζ = 1, τp = 10, and K = 1) 108
Figure 36: Step Response of an Overdamped System (ζ = 2, τp = 5, and K = 1) 109
Figure 37: Bode Plots for τp = 5, (top) ζ = 0.5, (middle) ζ = 1, (bottom) ζ = 2; (left) K = 1 and
(right) K = −1 112
Figure 38: Step Response of a Second-Order System with Inverse Response (τL = −25, ζ = 5/√7,
τp = 10√7 and K = 1) 113
Figure 39: Bode Plots for (left) τL = −5, (right) τL = 5, and (top) ζ = 0.5 and (bottom) ζ = 2 113
Figure 40: Sketch of the Transfer-Function Step Responses: (left) First Transfer Function, (middle)
Second Transfer Function, and (right) Third Transfer Function. 115
viii
Figure 41: Graphical Representation of an Automaton 121
Figure 42: Automaton for the Example 122
Figure 43: Automaton 124
Figure 44: The Trimmed Automaton 125
Figure 45: G1 126
Figure 46: G2 126
Figure 47: The Product of G1 and G2 127
Figure 48: Parallel Composition of G1 and G2 128
Figure 49: Timed Automaton 129
Figure 50: Automata for Questions 41 and 42 135
Figure 51: Automata for Question 42 136
Figure 52: The Basic Block Diagram 137
Figure 53: Summation Block: (top) Full Form and (bottom) Short-Hand Equivalent 138
Figure 54: Block-Diagram Algebra: In order to relate U and Y, the transfer functions between the
two points need to be multiplied, thus, Y = G3G2G1U. 138
Figure 55: Generic Closed-Loop, Feedback Control System 139
Figure 56: Process-Flow Diagram for an Alkylate Splitter 140
Figure 57: P&ID for a Gas-Chilling-and-Separation Plant According to Canadian Design
Standards (Note the engineering stamp in the bottom middle box.) 141
Figure 58: Fields in a P&ID Label 146
Figure 59: Connections: a) Recommended Form for Contact; b) Commonly Encountered Form for
Contact; and c) No Contact 150
Figure 60: Block Diagrams for Question 11 152
Figure 61: Sketch of the Process-Flow Diagram for Question 13 154
Figure 62: P&IDs for Question 14 154
Figure 63: P&ID for Question 15 155
Figure 64: P&ID for Question 16 156
Figure 65: P&ID for the Production of Maple Syrup for Question 17 157
Figure 66: Open-Loop Control 159
Figure 67: Open-Loop Control for the Temperature in the House 160
Figure 68: Closed-Loop Control 161
ix
Figure 69: Closed-Loop Control of the Temperature in the House 162
Figure 70: State-Feedback Control 163
Figure 71: Effect of Changing Kc for a P-Controller 167
Figure 72: Integral Wind-Up 169
Figure 73: Effect of Changing τI for an I-Controller 170
Figure 74: Jitter with a Derivative Term 171
Figure 75: Derivative Kick 172
Figure 76: Effect of Changing τD for a D-Controller 173
Figure 77: Workflow for Controller Tuning 175
Figure 78: Closed-Loop Performance of the PI Controller 180
Figure 79: Measures for Assessing the Performance of a Controller for Setpoint Tracking 182
Figure 80: Block Diagram for Feedforward Control 183
Figure 81: Effect of Feedforward Control on a Process 186
Figure 82: Block Diagram for Cascade Control 188
Figure 83: Model Predictive Control 190
Figure 84: Block Diagram for Control Using a Smith Predictor 196
Figure 85: Ratio Control with Trim Feedback Control 198
Figure 86: Input-Position Control 199
Figure 87: Karnaugh Map for the Function F = B′ 215
Figure 88: Karnaugh Map for the Function F = Σm(0, 3, 5) 215
Figure 89: Karnaugh Map for the Function F = AB′D + A′D′ + C 216
Figure 90: Karnaugh Map for the Function F = ΠM(1, 2, 5, 9, 11, 13, 15, 16,
17, 18, 20, 21, 23, 24, 26) 216
Figure 91: Implicant, Prime Implicant, and Essential Prime Implicant 217
Figure 92: Karnaugh Map for Example 40 218
Figure 93: Procedure for Minimising a Karnaugh Map 219
Figure 94: Karnaugh Map for Question 27 222
Figure 95: Pre-emptive and Nonpre-emptive Tasks 224
Figure 96: Visual Representation of a Configuration 225
Figure 97: (top) AND and (bottom) OR in Ladder Logic 242
Figure 98: Calling a Function in Ladder Logic 243
x
Figure 99: Ladder Logic for Example 41 244
Figure 100: Ladder Logic for Example 42 245
Figure 101: Diagram Using the Function-Block Language 254
Figure 102: Feedback in the Function-Block Language 254
Figure 103: The Function Q = XY + XZ + YZ in the Function-Block Language 255
Figure 104: Tank System for the Structured-Text Example 259
Figure 105: Steps in Sequential Function Charts: (left) General Step and (right) Initial Step 261
Figure 106: Transitions Conditions in Different PLC Languages 262
Figure 107: Components of an Action Block: a: Qualifier; b: Action Name; c: Indicator Variable;
d: Process Description 263
Figure 108: Alternative Paths in Sequential Function Charts 265
Figure 109: Usual Decision Order for Alternative Paths in Sequential Function Charts 265
Figure 110: User-Defined Decision Order for Alternative Paths in Sequential Function Charts 265
Figure 111: Parallel Paths in Sequential Function Charts 266
Figure 112: Schematic of the Reactor 267
Figure 113: Sequential Function Chart 268
Figure 114: Sequential Function Chart that is to be Checked for Its Validity 270
Figure 115: First Reduction 270
Figure 116: Second Reduction 271
Figure 117: Third Reduction 271
Figure 118: Fourth and Final Reduction 272
Figure 119: Validity of the Sequential Function Chart 274
Figure 120: Stirring Process 275
Figure 121: Washing Machine 276
Figure 122: Ladder Logic 277
Figure 123: Relationship between the Parameters and the Safety-Integrity Levels 283
Figure 124: P&ID for a Compressor Unit 287
xi
List of Tables
Table 1: Types of Thermocouples 37
Table 2: Data for Creating the Valve Characterisation curve for Question 34 55
Table 3: Sensor Calibration Data for Question 35 55
Table 4: Table of Common Laplace Transforms 59
Table 5: Table of Useful Inverse Laplace Relationships 60
Table 6: Table of Common z-Transforms (Ts is the sampling time) 63
Table 7: Useful Inverse Z-Transform Table (A and D can take complex values.) 64
Table 8: Padé Approximations for the Exponential Function, ex, where x = −θs 80
Table 9: Summary of the Stability Conditions for Different Representations and Time Domains
85
Table 10: Analysis Table for Routh Stability 88
Table 11: Routh Array 89
Table 12: Analysis Table for Jury Stability 91
Table 13: Table for Jury stability 92
Table 14: Basic Information About an Integrator 98
Table 15: Basic Information About a Lead Term 101
Table 16: Basic Information About a First-Order System 104
Table 17: Basic Information About a Secord-Order System 111
Table 18: Graphical Representation of the Different Types of Functions (The ringing cases can
only occur in the discrete domain.) 116
Table 19: Component Symbols for P&IDs According to the DIN EN 62424 Standard 142
Table 20: Connections Types for P&IDs 144
Table 21: Location Symbols 144
Table 22: Type Symbols 145
Table 23: PCE Categories 146
Table 24: PCE Processing Categories 147
Table 25: Common Symbols in Circuit Diagrams 149
Table 26: PI Controller Constants for First-Order-Plus-Deadtime Models 178
Table 27: PID Controller Constants for First-Order-Plus-Deadtime Models 179
xii
Table 28: PID Controller Constants for a Second-Order-Plus-Deadtime Models 179
Table 29: Boolean Operators, where a, b ∊ 𝔹𝔹 206
Table 30: Truth Table for the Boolean Operators (left) AND and (right) OR 208
Table 31: Delimiters in the IEC IEC 61131-3 Standard 227
Table 32: All Keywords in the IEC Standard 230
Table 33: Special Strings 233
Table 34: The Elementary Data Types in the IEC 61131-3 Standard. The initial letters in the data
types represent: D = double, L = long, S= short, and U = unsigned. 237
Table 35: Components of Ladder Logic 240
Table 36: Changes in the Current Result for Different Operator Groups 247
Table 37: Operators in Instruction List 247
Table 38: Two Possibilities for Calling the Function LIMIT(MN, IN, MX) 249
Table 39: Three Methods for Calling the Function Block TIME1(IN, PT) with output variables
Q and ET. 250
Table 40: Blocks Used in the Function-Block Language 252
Table 41: Commands in Structured Text 256
Table 42: Operators and their Priority in Structured Text 258
Table 43: Qualifiers in Sequential Function Charts 263
Table 44: I/O for the Washing Machine 276
Table 45: Truth Table I 277
Table 46: Truth Table II 278
List of Examples
Example 1 : Laplace Transform 60
Example 2 : Inverse Laplace Transform 61
Example 3 : Z-Transform 64
Example 4 : Inverse z-Transform 65
Example 5 : Numeric Example of Obtaining a Transfer Function 68
Example 6 : General Univariate Case 69
Example 7 : Multivariate Example 70
xiii
Example 8 : Converting a Transfer Function into Its Controllable Canonical Realisation 71
Example 9 : Extracting Information from a Transfer Function 80
Example 10 : Determining the Stability of a Transfer Function 85
Example 11 : Determining the Stability of a State-Space Model 86
Example 12 : Example of Routh Stability Analysis 88
Example 13 : Example of Jury Stability Analysis 91
Example 14 : Sketching the Expected Time-Domain Response 114
Example 15 : Origin of Ringing in Discrete-Time Systems 117
Example 16 : Automaton for a Process 121
Example 17 : Blocking in an Automaton 123
Example 18 : Trimming an Automaton 124
Example 19 : Product of Two Automata 126
Example 20 : Parallel Composition of Two Automata 128
Example 21 : Complex Block Diagrams 139
Example 22 : P&ID Tags 148
Example 23 : Temperature Control: Open-Loop Control 160
Example 24 : Heating the House: Part 2: Closed-Loop Control 161
Example 25 : Investigation of the Proportional Term on Stability and Performance 167
Example 26 : Investigation of the Integral Term on Stability and Performance 169
Example 27 : Investigation of the Derivative Term on Stability and Performance 172
Example 28 : Designing a PI Controller 179
Example 29 : Designing a Feedforward Controller 184
Example 30 : Design of a Model Predictive Controller 192
Example 31 : Truth Table 209
Example 32 : Sum-of-Products Form 209
Example 33 : Converting into the Sum-of-Products Form 210
Example 34 : Compact Sum-of-Products Form 210
Example 35 : Product-of-Sums Form 211
Example 36 : Converting into the Product-of-Sums Form 212
Example 37 : Compact Product-of-Sums Form 212
Example 38 : Don’t Cares 213
xiv
Example 39 : Dual of a Function 214
Example 40 : Karnaugh map 218
Example 41 : Ladder Logic for a Boolean Function 243
Example 42 : Ladder Logic for a Recipe 244
Example 43 : Example of the Computation of the Current Result 250
Example 44 : Writing the Instruction-List Programme 251
Example 45 : Creating the Diagram for the Function-Block Language 254
Example 46 : Structured Text 258
Example 47 : Creating a Sequential Function Chart 266
Example 48 : Determining the Validity of a Network 270
Example 49 : Partial Fractioning 291
xv
Chapter 1: Introduction to Automation
Engineering
Automation engineering is an important component of modern industrial systems that
focuses on the development, analysis, optimisation, and implementation of complex systems to
provide safe, economically viable, and efficient processes. Automation engineering seeks to
eliminate as much as possible human intervention into the process. However, it should be noted
that this does not mean that humans are not required to monitor and assist with the running of the
process; it simply implies that the mundane, often repetitive, tasks are delegated to computer
systems that are better suited for performing such work.
In order to understand automation engineering, it is important to briefly review its long
history, its main principles, and its foundations.
1
This word is ultimately derived from the Greek word αὐτός, meaning self, and an unattested root, which comes from
the proto-Indo-European word *méntis ~ mn̥téis, meaning thought (which in turn gave us such words as mind in
English)
16
Christiaan Huygens. Later, a primitive steam engine, called an æolipile, was developed by Hero
of Alexandria (gr: Ἥρων ὁ Ἀλεξανδρεύς, c. AD 10 to 70). Examples of these devices are shown in
Figure 1. As well, objects that assisted in the computation of heavenly bodies (essentially the first
computers) were also developed. The most famous is the Antikythera mechanism, a type of
astronomical clock based on a gear-driven apparatus. This tradition of developing mechanical
automated objects was continued long into the Middle Ages both in Europe and in the Middle East,
with such work as the Book of Ingenious Devices (ar: ( ﻛﺘﺎب اﻟﺤﯿﻞKitab al-Hiyal) or pe: ﻛﺘﺎب ﺗﺮﻓﻨﺪھﺎ
(Ketab tarfandha)) by the brothers Banu Musa published in AD 850, which describe various
automata, including primitive control methods, automatic fountains, mechanical music machines,
and water dispensers. Similarly, in the court rooms around the world, various automata in the shape
of singing animals were being developed and maintained. Famous examples can be found in the
(now destroyed) palaces of the Khanbaliq of the Chinese Yuan dynasty and the court of Robert II,
Count of Artois.
Figure 1: Automation Engineering in the Time of the Ancient Greeks: (left) Æolipile (Steam Engine) and (right) Automated
Opening Device for a Temple Door
The interest in the development of automata continued into the Renaissance with the
development of life-size automata, such as The Flute Player by the French engineer Jacques de
Vaucanson (1709 – 1782) in 1737.
With the rediscovery of steam engines, the ability to develop large and complex automated
system become a reality sparking the first Industrial Revolution (1760 to 1840). One of the first
such examples was the Jacquard loom that could be programmed using punch cards to
automatically weave different designs. The development of advanced systems required methods
17
of controlling them, so that explosions and damage were minimised. The first dedicated device for
controlling a steam engine, called the Watt governor, was developed by James Watt (1736 – 1819).
The Watt governor, shown in Figure 2, regulates the amount of fuel entering into the engine using
the centrifugal force of the two balls. The faster the engine rotates, the further the balls are pushed
outwards, thus closing the throttle valve. This reduces the amount of fuel flowing into the engine,
which results in a lower speed. The development of the first Watt governor was followed by a rash
of patents trying to improve various aspects, including one by William Siemens (1823 – 1883). It
was not until 1868, when James Clerk Maxwell (1831 – 1879) provided a mathematical description
of the governor in his aptly named paper On Governors that a rigorous mathematical foundation
for the development of methods for controlling a process was available. As the systems became
more complex in the succeeding decades and centuries, there came an ever-increasing need for
understanding these intricate systems in order that they be properly run so as to avoid unsafe
operating conditions.
Figure 2: Watt Governor (a: fly ball, b: arms, c: spindle, d: sleeve, e: ball-crank lever, and f: throttle)
The demand for automation continued with the onset of the second Industrial Revolution
(1870 – 1915), which focused on the development of efficient manufacturing methods (production
lines, Taylorism, and similar ideas) coupled with the development of electricity and the first
electrical devices.
18
By the 1950s, a new industrial revolution, often called the third Industrial Revolution or
the Digital Revolution, had started. This revolution focused on the implementation and use of
complex electrical circuits that can be used to quickly and efficiently perform complex calculations.
With the development of these circuits, it became easy and cost-effective to implement automation
in a wide range of different fields. From the perspective of automation engineering, the key event
was the development of programmable logic controllers (PLCs) that could be used to implement
advanced control methods in an industrial setting. The first PLCs were developed by Bedford
Associates from Bedford, Massachusetts, USA based on a white paper written by the engineer
Edward R. Clark (1928 – 1999) in 1968 for General Motors (GM). One of the key people working
on this project was Richard E. “Dick” Morley (1932 – 2017), who is often considered the father
of the PLC. Other important work was performed by Odo Josef Struger (1931 − 1998) of Allen-
Bradley in the period 1958 – 1960.
At the same time, there was an explosion of interest in a theoretical perspective on
automation engineering, especially in the areas of control and process optimisation. This research
by such people as Andrei Kolmagorov (ru: Андре́й Никола́евич Колмого́ров, 1903 − 1987),
Rudolf Kálmán (hu: Kálmán Rudolf Emil, 1930 − 2016), and Richard E. Bellman (1920 – 1984)
lead to a strong foundation for the subsequent development and implementation of advanced
control methods in industry.
Within the context of the third Industrial Revolution, the concept of robots was also
considered. The word robot itself was first used by the Czech author Karel Čapek (1890 – 1938)
in his 1920 drama R.U.R. (cz: Rossumovi Univerzální Roboti or en: Rossum’s Universal Robots)
as a word for artificial humanoid servants that provided cheap labour. Karel credited his brother
painter Josef Čapek (1887 – 1945) with inventing this word. The word robot stems from the Czech
root robota, that means serfdom, which ultimately comes from the proto-Indo-European word,
*h₃erbʰ−, that means “to change or evolve status” from which the English word arbitrate is also
derived.
More recently, with the growth of interconnectedness and the development of smart
technologies, some have proposed that a new industrial revolution is dawning. This revolution has
been called the fourth Industrial Revolution, or Industry 4.0, which focuses on the development of
self-functioning, interconnected systems in an increasingly globalised world. Its main drivers are
19
ever increasing automation and digitalisation of the industrial plant combined with globalisation
and customisation of the supply chains.
2
Process and system are practically speaking synonymous. In this textbook, process will be used to refer to the actual
physical part, while system will refer to ensemble of the process and any sensors, actuators, and controllers. Obviously,
a system without any sensors, actuators, or controllers will be equivalent to the process.
20
It goes without saying that if we wish to understand the process, we require a model of the
process. A model of the process is a mathematical representation of the relationship between the
inputs, outputs, and states. The complexity of the model required depends on the purposes for
which the model will be used. Modelling a process is a complex endeavour that requires insight
into the process and the ability to handle large data sets quickly and effortlessly.
In order to complete the picture regarding the process, it is necessary to extend our view to
include parts that allow us to interact with the process or influence its behaviour. Such a view is
provided in Figure 4, which shows the key components and their interactions. It is important to
briefly consider their effect in order to understand how the process can be influenced and how it
will react. In this view, the eight key components can be described as (the number is the same as
in Figure 4):
1) Process: This represents the process under consideration. Normally, the process itself is
unknown. Instead, a model of the process is used.
2) Sensors: The sensors provide the ability to measure the process and understand how the
variables are changing.
3) Actuators: The actuators allow the value of a variable to be changed. If we cannot change
the value of a variable, then it is hard to use it in an automation strategy. When deciding
on which actuators to use, it is important to consider such factors as the variable being
manipulated, the automation requirements (e.g. required accuracy, tolerance, or precision),
and the type of service required (e.g. continuous, discrete, or emergency).
4) Automation Devices: The automation devices are the controllers and related components
that are used to automate the process. Most of the time the automation hardware consists
of computers and other digital devices, such as programmable logic controllers (PLCs),
that implement the required functions. The design of the automation hardware (and
software) requires knowledge of the limitations and requirements of the process.
5) Environment: The environment represents everything that surrounds the process to be
automated that can have an effect on the overall performance of the process. This influence
can be caused either by changes in other processes that interact with the process of interest
or by direct environmental changes, such as for example, changes in the ambient
temperature. The process will exchange mass, energy, and information with its
environment.
21
6) Objectives: The automation objectives play a very important role in the development and
implementation of the final automation system. Poorly defined or unclear objectives can
make achieving the project difficult if not impossible. Furthermore, the objectives often
need to be translated from the language of business into actually implementable objectives
on a system. This translation can cause additional uncertainties and lack of clarity, and thus,
requires a good agreement.
7) Operators: Although the human component is often minimised or ignored when designing
automation systems, it is in fact very important. Many complicated automation systems
have failed due to a lack of proper consideration of the operators. In general, the operators
need to have the required information easily available (no fancy graphics are needed) and
to be able to enter the required information into the system quickly and efficiently.
Appropriate feedback and safety checking of the entered values must be performed to avoid
problems. The operators interact with the process using a human-machine interface
(HMI). An HMI provides two key functions. It allows the operators to see the important
process values and to manipulate as necessary the process values. Manipulating the values
implies that the operators can change at what value the process operates, for example,
changing the flow rate in a pipe. Finally, when designing the HMI, it is important to
consider any safety features, such as logic, that limits which values can be entered by the
operators. This prevents mistakes both accidental, such as mistyped numbers or the wrong
information in a given field, and malicious, such as changes introduced by illegal access to
the system, from having an effect on the system.
8) Disturbances: Disturbances are everything that can affect the system, but whose presence
cannot be directly controlled. Disturbances can originate in the environment (for example,
the ambient temperature) or in the devices themselves (for example, measurement noise in
sensors). One of the objectives of the automation system is to minimise, as much as
possible, the effect of these disturbances on the process.
The final aspect that needs to be considered is safety. The automation system that has been
designed should allow the process to operate in a safe manner without any unexpected behaviour.
The system should also be robust, that is, minor changes in the process should not cause the whole
system to fail catastrophically. A robust system can handle small changes in the conditions and
still attain the required goals.
22
Figure 4: General Structure of an Automated System
23
strategy is lacking, then the strategy needs to be refined and retested. This implies that there
may need to iterate until the final automation strategy is found.
5) Implementation and Commissioning of the Proposed Automation Strategy, which
involves the implementation of the strategy on the real process. Naturally, the
implementation on the real process may lead to changes in the strategy. This implies that
before commissioning, the automation strategy should be tested on the real process in as
realistic conditions as possible. In certain cases, this may not be feasible and advanced
simulations, using hardware-in-the-loop methods can be implemented to provide a
realistic simulation of the process.
24
• Level 2 – Control Level: This level considers how to run the algorithms for controlling
the process using the available process information on the time horizon of minutes or even
seconds. Various hardware, such as programmable logic controllers (PLCs) or industrial
PCs (IPCs) are used to compute the required actions. It is on this level that this book focuses.
• Level 1 – Field Level: This level focuses on the sensors and actuators. Information is
actively exchanged with Level 2, often using fieldbuses. The time horizon is often in the
range of seconds or faster.
• Level 0 – Process Level: This level represents the actual process that is running in real
time.
It can be noted that the process description becomes more abstract as we go from bottom to top.
While Level 0 is very concrete and describes everything in great detail, Level 5 is very abstract
and only focuses on describing the system inputs and outputs to give an overall picture of the
system.
25
Exercises, which seek to test the reader’s ability to compute the required parameters for a simple
data set using simple or no technological aids.
26
Section 1.5.2: Short Exercises
These questions should be solved using only a simple, nonprogrammable, nongraphical calculator
combined with pen and paper.
21) How is that information can be created and destroyed, but matter and energy cannot be?
Provide some examples of such cases.
22) You have been assigned the task of designing an automation system for a traffic light
system. Explain how you would apply the framework for automation engineering to this
problem.
23) You have been given the task of designing a large, multi-unit chemical plant. Explain how
the automation-engineering pyramid could apply to this problem.
24) You have been given the task of designing a self-driving car. Explain how you would
implement the framework for automation engineering to this problem. Would you consider
safety and robustness to be significant factors?
27
Chapter 2: Instrumentation and Signals
The foundational component of any automation system is the instrumentation, that is, the
sensors, actuators, and the computer hardware that together produce a stream of values, often
called a signal, that can be used for subsequent processing. Before we look at the sensors and
actuators, it is helpful to understand the types of signals and how they can be generated.
28
value to the alarm state (say 1). Binary signals are often displayed using what is called a timing
diagram. In a timing diagram, the binary signal is plotted as a function of time. Multiple different
binary signals are normally placed on separate y-axis, but a common time x-axis. Figure 6 shows
such a typical timing diagram.
Based on the classification in the time and value domains, it is possible to have four
different types of signals, which are shown in Figure 7. By convention, a signal that is continuous
in both the time and value domains is called an analogue signal, while a signal that is discrete in
both the time and value domains is called a digital signal.
Since most real processes require and produce continuous, analogue signals, but computers
perform their computations using discrete, digital signals, there is a need to understand how signals
can be converted between the two forms. Converting from analogue to digital signals is shown in
Figure 8, and consists of three components: sampler, quantiser, and encoder. The sampler
measures (samples) the value of the analogue signal on a fixed frequency to convert the signal into
the discrete-time domain. Next, the quantiser converts this sampled signal into the available closest
value (quantum) to create a digital signal. The encoder simply encodes the digital signal into a
given digital representation that can be used by the computer. This process is often denoted as an
analogue-to-digital (A/D) converter.
29
Time Domain
Continuous Discrete
Continuous
Value Domain
Discrete
When quantising a continuous signal, its values are compared against fixed (equidistant)
quantisation levels. If the value of the continuous signal is between two decision thresholds, the
lower value is usually selected. For example, if a continuous signal has a value of 0.44 with
quantisation levels at 0.25 and 0.5, the quantised (sampled) signal will be set to 0.25. The selection
of appropriate quantisation levels is important, since this selection affects the accuracy of the
mapping of the process, for example, if the steps are too far apart, important information can be
lost.
When going in the other direction, it is normal to assume that the value of the signal will
not be changed and only the time component needs to be made analogue. This is normally
accomplished using a hold, which holds the value of signal until a new value is received. The most
common hold is the zero-order hold, which simply holds the last value received until a new value
is received. A more accurate hold is the first-order or linear hold, which uses an interpolation
30
between the previous two data points to obtain a linearly varying value over the sampling period.
This process is called digital-to-analogue (D/A) conversion.
31
Figure 9: Typical Calibration Curve
A single sensor depending on its calibration and physical arrangement can be used to
measure different physical variables, for example, a differential pressure cell can measure both
flow rates and level.
Selecting an appropriate sensor depends on the following criteria:
1) Measurement Range (Span): The required measurement range for the process variable
should lie within the instrument’s range.
2) Performance: Depending on the specific application, different factors, such as accuracy,
precision, and speed of response, will need to be considered.
3) Reliability: How well does the sensor work in the given operating conditions, for example,
if the sensor must be placed in harsh operating conditions, can it handle them and for how
long?
4) Materials of Construction: Depending on the application, the required materials of
construction for the sensor may be different, for example, a temperature sensor in a blast
furnace will require a different material than a temperature sensor in the living room of a
house.
5) Invasive or Noninvasive: An invasive sensor comes in direct contact with the object being
measured, for example, inserting a probe into a liquid to measure the temperature. If an
invasive sensor comes into contact with the process, it can influence the process or be
influenced by the process itself. Thus, invasive methods can have issues with long-term
accuracy due to fouling or corrosion of the probe surface. On the other hand, noninvasive
sensors do not come in contact with the process. In such cases, the process is not disturbed,
32
but the measurement may be less accurate. However, noninvasive sensors are generally
easier to use and can be easily retrofitted into an already built environment.
Figure 10: Measurement Set-Up for Pressure Sensors: (i) Measuring Differential Pressure and (ii) Measuring Absolute Pressure
(a: flexible membrane, Pa: ambient pressure, Pm: the pressure that is to be measured, and Pf: fixed pressure)
Most transducer-based pressure sensors use some type of electric circuit to measure the
strain induced by the pressure on the system. Common strain gauges include piezoresistive,
capacitive, electromagnetic, piezoelectric, and optical. Figure 11 shows a typical high-pressure
transducer-based pressure sensor. Similarly, manometers are also based on the effect of pressure
on some system property. They include the common hydrostatic manometers, which basically
measure the difference in pressure between the two taps, and mechanical manometers, which
33
measure the effect of pressure on the strain of the material. Mechanical manometers have the
advantage that they do not interact strongly with the fluid and can provide very sensitive readings.
On the other hand, compared to the hydrostatic manometers, they can be more expensive.
Figure 11: High-Pressure Transducer-Based Pressure Sensor (a: measuring diaphragm, b: strain gauge, c: reference hole to the
atmosphere, d: true gauge diaphragm, and e: area for the resistor for temperature correction and internal electronic amplifiers)
34
estimate, it is required that the surface be relatively flat and consistent. Froths and other particles
can affect the accuracy and precision of the measurements.
Figure 12: Level Measurement and Control Using a Float (a: trip lever, b: refill tube, c: float, d: overflow tube, e: ballcock, f: lift
chain, and g: flush valve)
35
Pressure-based flow sensors measure the pressure difference caused by some constriction
in flow to determine the flow rate. Common pressure-based flow sensors include Venturi tubes,
orifice-plate differential pressure cells, and Pitot tubes. Figure 13 shows the basic operating
principles of a Venturi tube. As with mechanical flow sensors, these flow sensors tend to work
best with uniphase flow of simple fluids without any suspended particles.
Figure 13: Venturi Tube (a: datum, b: U-tube manometer, c: manometer fluid, d: inlet, e: outlet, f: main pipe, g: converging cone;
h: throat, i: diverging cone, D1: diameter of the main pipe, D2: diameter of the throat, Z1: reference height 1, Z2: reference height
2, and h: height difference in the manometer)
36
In most industrial cases, pressure-based flow meters are used, since they are simple to use,
robust, and easy to maintain. On the other hand, when dealing with exotic or extreme fluids, then
more complex methods may be required.
Figure 14: Thermocouple (a: metal 1, b: metal 2, c: measurement point, d: reference location, T1: temperature to be measured, T2:
reference temperature, and V: voltmeter)
37
Thermocouple Temperature Range Material of
Comments
Type (°C) Construction
C, D, and G 0 to 2320 tungsten/rhenium Cannot be used in
alloys presence of oxygen,
expensive.
Chromel- −273.15 to 25 chromel-gold−iron Cryogenic applications
gold/iron
38
the actuator to respond to a change. In general, it is desired that an actuator respond quickly to
changes and deliver the final desired value in a short period of time. Most actuators are designed
so that 0% corresponds to no value and 100% corresponds to the maximal value. A common
problem with actuators is that their response is nonlinear. One way to resolve this problem is to
use a characterisation function that will convert the desired linear values into the actuator’s
nonlinear values.
Actuators need to be calibrated before being used or to check that they are behaving as
expected. Calibration involves using standards with accurate and well-defined values. However,
the exact relationships and behaviour of the calibration will depend on the specific actuator.
There are three common actuators: valves, pumps, and variable current actuators.
39
and thus the resistance to flow. For an air-to-close valve, an increase in air pressure will push the
plug towards the seat, thus reducing the area available for flow, increasing the resistance to flow,
and reducing the flow rate though the valve. For an air-to-open valve, the air enters on the bottom
of the diaphragm, so an increase in air pressure will raise the diaphragm, thus opening the valve.
Figure 15: Pneumatically Actuated Control Valve (Air-to-Close) (a: supply air connection, b: mechanical stop, c: diaphragm, d:
upper chamber, d: lower chamber, f: spring, g: housing, h: local position indicator, i: stem, and j: flow direction, and k:
transducer)
Many modern valves have an additional element called a positioner that seeks to overcome
any potential errors in the valve. A positioner basically compares the current valve location against
the reference value and will change the air supply to allow for the difference to be zero.
The behaviour of a valve is normally specified based on the percentage of the total distance
that the valve is opened or closed. This eliminates the need to know the exact flow rates. Therefore,
the flow rates of a valve are often stated in terms of percent open (often abbreviated as %open).
Properly selecting a valve for automation (or control) is very important. There are two
variables to consider: sizing and dynamic performance.
40
Section 2.3.1.1: Valve Sizing
Control valves must be specified, just like piping, heat exchangers, and other process
equipment. The sizing of a control valve determines the range of flow rates over which the valve
can produce a hydrodynamically stable flow.
A valve that is too small will not permit enough flow when it is fully open, which is defined
in terms of the needs for process regulation. A control valve must permit significantly greater flow
than the steady-state requirement in order to be able to provide reasonable performance. A valve
that is too large will have a sufficiently high maximum flow but will provide poor regulation when
the flow is low. For a number of reasons, valves are not very precise instruments, and the relative
errors tend to be greatest when the valve is almost closed.
A valve that is open by less than 10% is generally considered effectively closed, and a
valve that is more than 90% open is generally considered effectively fully open.
To determine whether a control valve is undersized or oversized, examine the range of
controller output values used when the valve is in service. If the valve spends a significant fraction
of the time fully open, then it can be considered undersized. If it spends a significant fraction of
the time less than 10% open, or if the flow through the valve reaches a maximum before the valve
is fully open, then the valve is oversized.
41
nonlinearity introduced by static friction when initiating changes in the valve position, while
dynamic nonlinearity results from the dynamic friction in the valve, usually between the valve
stem and the seal. Static friction between the stem and seal results in the valve not moving when
there is a small change in the control signal (air pressure) input to the valve. Static friction, or
“stiction,” can significantly affect controller performance.
To find static and dynamic nonlinearities in a control valve, step the valve from 0% open
to 100% open and then back to 0% open in small steps and record the steady-state flow at each
step. Plot the data points on a graph of steady-state flow versus %open, and use different lines for
opening and closing. The resulting graph will be similar to that shown in Figure 17, where the
ideal valve behaviour is shown as a dashed line. Static nonlinearity consists of the deadband
region over which the flow rate does not change even though the signal to the valve increases and
the slip-jump behaviour, while dynamic nonlinearity consists of hysteresis, which is the gap
between the two lines. Slip-jump behaviour is caused by static friction that must first be overcome
before the valve changes its position. Since the dynamic friction is much smaller than the static
friction, the valve will overshoot the position defined by the force as soon as it starts to move. This
will make the curve look like a staircase. Hysteresis arises from the difference between the
measured flow rate when opening and closing a valve. This effect can be explained by the different
effect of dynamic friction on the moving valve. When the valve is being opened, due to dynamic
friction, it will open less than desired. On the other hand, when it is being closed, the valve will be
more open than specified, that is, it will close less than desired.
42
Figure 16: Inherent Valve Characteristics
Figure 17: Phase Plot for the Typical Behaviour of a Valve with Stiction (after Shoukat Choudhury et al. (2005)). The arrows
show the direction in which the values were changed.
43
Section 2.3.2: Pumps
Another actuator that can control the flow rate in a stream is a pump. A pump is a
mechanical device that takes a fluid, most often a liquid, from a storage tank and moves it to some
other location. The main types of pumps are centrifugal pumps, positive-displacement pumps, and
axial-flow pumps. In centrifugal pumps, the flow direction changes by 90° as it moves over the
impeller, while in an axial-flow pump the flow direction is not changed. In positive-displacement
pumps, the fluid is trapped in a fixed volume and forced (or displaced) into the discharge pipe.
The traditional hand pump is a good example of a positive-displacement pump. Of these three
types, the most common type is a centrifugal pump. A positive-displacement pump is often used
if flows are small or extreme precision is required. Figure 18 shows a schematic diagram of a
centrifugal pump, while Figure 19 shows a positive-displacement pump.
Compared to valves, pumps tend to provide better control of the flow rate and have fewer
nonlinear characteristics. However, they have much higher energy consumption than valves. The
main considerations for a pump, as for valves, are sizing and performance.
Figure 18: Centrifugal Pump (a: inflow, b: impeller, c: shaft, and d: outflow)
44
Figure 19: Positive-Displacement Pump (a: inflow, b: packing, c: piston rod, d: stuffing-box bushing, e: liner, f: piston,
g: working fluid, h: valve, and i: outflow)
45
pump is shown in Figure 20. The head, H, normally expressed in units of length, such as metres
or feet, shows how high a given column of liquid could be lifted by a pump. It represents the
effective pressure gradient that the pump can overcome. The efficiency, η, represents how much
work put into the pump is converted into lifting the liquid. As in many engineering applications,
the higher the efficiency, the better it is. For centrifugal pumps, the net positive suction head
(NPSH) is the minimum head (pressure) at the inlet before cavitation occurs. Cavitation is defined
as the boiling of a liquid in a pump, which is evidently a very undesirable event. Therefore, the
head at the inlet must be greater than the specified value.
46
Section 2.4: Programmable Logic Computer (PLCs)
Programmable logic computers (PLCs) are small computers that have been made robust
and rugged. They are often used in industry for controlling processes, such as assembly lines,
robots, or complex chemical processes. PLCs allow the collection of the different signals and their
subsequent processing to reach a decision or action that may need to be taken. Given the
computational power, they can also perform relatively advanced logical and mathematical
functions that can be used to control the process.
As shown in Figure 21, a typical PLC consists of 6 key components:
1) Inputs: These allow information from outside the PLC to be incorporated and used. Most
often, they are electrical signals coming from sensors or switches.
2) Power Supply: This provides the power required to run the PLC and operate all the
circuitry. Internally, most PLCs use a 5-V standard. However, the power supply most often
provides 230 V AC, 120 V AC, or 24 V DC. Furthermore, the power supplies are often
built as a replaceable module, so that depending on the application, the appropriate power
can be provided, for example, in Europe one could use 230 V, but in North America 120 V.
3) Central Processing Unit (CPU): The CPU is the brain of the PLC that performs all the
required instructions, calculations, operations, and control functions.
4) Memory: The PLC must also contain memory or the ability to store relevant information
for future use. The amount of memory available depends on the PLC and the programming
requirements. Some PLCs can have additional memory cards inserted, so that they have
more available memory. There are two main types of memory:
a. Read-Only Memory (ROM): ROM is the permanent storage for the operating
system and system data. Since true ROM cannot be changed, in practice, an
erasable programmable ROM (EPROM) is used, so that it is possible to update
the operating system for the PLC.
b. Random-Access Memory (RAM): RAM is used to store all other information
required by the PLC including any programmes and variables. Accessing RAM is
very fast. However, when power is lost, the information in RAM is also lost.
Therefore, a PLC will always have an additional battery to maintain power to the
RAM, so that the information that is contained in the RAM is not lost during a
power outage.
47
5) Communications Unit: The communications unit allows for the PLC to interact with other
devices to exchange information using different types of protocols. Often, this exchange of
information involves sending new or updated programmes to the PLC. In general, the
communications unit will often include the ability to communicate with an operator panel,
printers, networks, or other computers.
6) Outputs: These allow the PLC to exchange information with other devices to cause them
to take an action. Such devices include motors, valves, pumps, and alarms.
In a PLC, communication between the components occurs using groups of copper wires called
buses. A bus consists of a bundle of wires that allow for the transmission of binary information,
for example, if the bus contains eight wires, then it is possible to transmit up to 8 bits of information
per bus. A typical PLC consists of four buses:
1) Data Bus: The data bus is used to transfer information between the CPU, memory, and I/O.
2) Address Bus: The address bus is used to transfer the memory addresses from which the
data will be fetched or to which data will be written.
3) Control Bus: The control bus is used to synchronise and control the traffic circuits.
4) System Bus: The system bus is used for input-output communications.
Since a PLC operates more or less similarly to that of a computer, this means that in order
for a PLC to do anything useful, it must be programmed. The basic idea for a PLC is to monitor
and control a process. A process in this context is anything that requires monitoring and control
and can range from a simple unit that requires its output to be maintained at a prespecified value
to a complex, highly interacting system like a room with multiple heating ovens, lights, ventilations
systems, and windows, wherein the temperature, carbon-monoxide levels, and humidity must be
monitored and maintained at safe levels. In PLC terms, a process is said to be in a given operating
48
mode 3, when the process is operating in some specified mode, for example, when the pump is on,
off, or operating. Finally, the PLC requires a user programme that takes the inputs, outputs, and
internal information to make decisions about the process.
Before we look at how a PLC operates, it can be useful to note the different operating
modes (states) that a PLC itself can be in. In general, the operating modes for a PLC are
programming, stop, error, diagnostic, and run. In programming mode, a PLC is being
programmed, usually using an external device. In stop mode, the PLC is stopped and will only
perform some basic operations. In error mode, the PLC has encountered some sort of problem and
has stopped working. In diagnostic mode, the PLC runs without necessarily activating any inputs
or outputs, allowing for the validity of the programme to be determined. Often, test signals are
used in place of the real inputs and outputs. In run mode, a PLC is actively working and performing
the requested actions. Each PLC manufacturer may call these operating modes different names
and not all of them may be present for a given PLC.
Naturally, the most important mode from the perspective of automation is the run mode.
Thus, its behaviour will be examined in greater detail. In run mode, the PLC performs the same
four operations in a repeating cycle:
1) Internal Processing, where the PLC checks its own state and determines if it is ready for
operation. Should the response from hardware or communication units be lacking, the PLC
can give notice of these events by setting a flag, which is an internal Boolean address (or
visual indicator) that can be checked by the user to determine the presence of an error state.
Normally, the PLC will continue operation, unless the error is serious, in which case, it
will suspend operation. In this step, software-related events are also performed. These
include such things as updating clocks, changing PLC modes, and setting watchdog times
to zero. A watchdog is a timer that is used to prevent a programme from taking too long to
execute, for example, it could be stated that if a programme does not terminate in one
second, then it could be stuck inside an unending while-loop and an error mode will be
returned.
3
Often also called a state, but this term is avoided since it has another meaning in control and process analysis.
49
2) Reading Inputs: Next, all the input values are copied into memory. This means that the
PLC will only use the values from memory rather than checking to make sure that the most
recent value is available. This also means that at any given point the programme will use
the same values during the same scan time. Furthermore, reading values from memory is
faster than reading them each and every time from the input.
3) Executing Programmes: After the inputs have been read, the programmes are executed in
the order in which the code has been written. The order of execution can be changed by
changing the associated priority of the given code or using conditional statements and
subroutines. It should be noted that at this point only internal variables and output addresses
are updated in memory; the physical outputs are not changed at this point.
4) Updating Outputs: Once the programmes have been finished, the output memory is
written so that the state and values of the outputs can be updated. This will then complete
a single cycle and the PLC will return to the first step, that is, internal processing.
Since it can be seen that the PLC in run mode performs these four operations repeatedly, the
question becomes what is the best approach for how the PLC should repeat these operations. By
convention, a single pass through the four operations is called a scan. The scan time or cycle time
is the amount of time required to perform a single scan. In practice, the scan time can vary between
scans due to the presence of different events or conditions requiring the execution of more or less
code. In order to accomplish the repetitions effectively, a programme can be associated with a task,
whose execution type can be specified. There are three common execution types:
1) Cyclic Execution: In cyclic execution, the time between scans is fixed. Obviously, the time
must be set so that the PLC has the time to complete all the required code. Naturally, certain
tasks, such as counting or timing, should always be run on cyclic execution.
2) Freewheeling Execution: In freewheeling execution, as soon as one scan has been
completed, then the next scan is started. This is the fastest way of running a task, since
there is no waiting between scans.
3) Event-Driven Execution: In event-driven execution, a task is only executed when a given
Boolean condition is fulfilled. Event-driven execution is useful for emergency stop routines,
start-up routines, and other extra-ordinary events.
Furthermore, the nature of the task must be specified: can the task be interrupted by another task?
If the task can be interrupted, then it is called pre-emptive; if it cannot be, nonpre-emptive. The
50
difference between these two types of tasks is shown in Figure 22. Finally, the priority of a task
must be specified ranging from high to low (the exact details depend on the specific PLC and
standard used).
51
4) Data Historian, which stores all the values for future retrieval. Selecting an appropriate
sampling time, or how fast the data are recorded, can determine the usefulness of the
stored data for future applications.
5) Network Cables, Switches, and Accessories, which physically connect all the
equipment and allow for the strategy to be implemented.
The main issue with the design of the communication units is the available bandwidth. The faster
the data is sampled and the more computations that need to be performed, the larger the bandwidth
and computational power that will be needed.
In automation, signals can be encoded using many different standards. The two most
common standards are the current-based standard of 4 to 20 mA and the pressure-based standard
of 3 to 15 psig. 4 It should be noted that both of these standards do not start at zero, since a value
of zero is ambiguous: is the device not working properly or is the value actually zero. By using a
live zero, that is, the value of zero corresponds to some nonzero current or pressure means that it
is possible to distinguish between the case of a zero value and a faulty device. Furthermore, a live
zero allows part of the remaining current or pressure to be used for operating the device without
needing an additional power supply. This means that the device can be used in remote areas
without its own power supply. The lower limit for the live zero was historically determined as the
smallest measurable value. In most cases, the upper limit was chosen so that the lower and upper
limits are in the ratio 1:5.
4
A psi is a unit of pressure in the imperial system of measurement. It is an abbreviation for pounds (force) per square
inch. The conversion factor is 1 psi = 6.894 757 kPa. The g represents gauge or the value above atmospheric pressure.
52
2) PLCs: K.-H. John and K. Tiegelkamp (2009). IEC 61131-3: Programming Industrial
Automation Systems: Concepts and Programming Languages, Requirements for
Programming Systems, Decision-Making Aids (Second Edition), Berlin, Germany:
Springer-Verlag.
53
17) Slip-jump in valves results from dynamic friction of the moving parts.
18) The efficiency of a pump represents the pressure gradient that it can produce at a given
flow rate.
19) A PLC consists of inputs, power supply, CPU, memory, outputs, and communication
devices.
20) A bus in a PLC is a location in memory used to store information about where different
variables are stored.
21) A PLC in programming mode is being programmed from an external device.
22) A flag in a PLC is a Boolean variable that shows the presence of an error state.
23) A watchdog in a PLC is a variable that prevents the PLC from being interrupted by external
users as it is running.
24) A PLC scan is the amount of time it takes for the PLC to read the inputs.
25) Freewheeling execution occurs when the PLC executes a task solely on demand from an
external event.
26) A pre-emptive task can never be interrupted.
27) An analogue-to-digital converter is found in all computer-based automation solutions.
28) A data historian stores the data collected from a process.
29) Live zero implies that when the sensor value is zero then the current has a value of 4 mA.
30) A PLC normally has a battery to provide power in case of a power failure.
54
33) Consider the task of pumping a mixture of sand, water, oil, air, and various particles. What
would you need to consider when designing the pump? What kind of sensors would you
consider? Do you think you can achieve highly accurate results?
34) Consider the data shown in Table 2. Create the valve characterisation curve using the data.
Determine what type of valve this is and how reproducible the values are. Are there any
static or dynamic nonlinearities present? How can you determine this?
Table 2: Data for Creating the Valve Characterisation curve for Question 34
Measured Height Sensor Value (m) Measured Height Sensor Value (m)
(m) Run 1 Run 2 (m) Run 1 Run 2
0.00 0.02 0.03 0.25 0.248 0.251
0.10 0.115 0.105 0.30 0.321 0.312
0.15 0.149 0.152 0.35 0.348 0.349
0.20 0.229 0.215 0.40 0.412 0.392
55
Measured Height Sensor Value (m) Measured Height Sensor Value (m)
(m) Run 1 Run 2 (m) Run 1 Run 2
0.45 0.452 0.457 0.50 0.512 0.493
56
Chapter 3: Mathematical Representation of a
Process
In order to understand and provide useful information about a process, it is necessary to
understand how different processes and systems can be represented. In practice, there exist two
main types of representations: mathematical and schematic. A mathematical representation
focuses on providing an abstract description of the process that provides information about the
process. A good mathematical representation of the system can provide a deep understanding of
how the system works and how it will behave in the future. On the other hand, a schematic
representation focuses on the relationships between the different components and how they relate
to each other. It is primarily a visual approach that allows the actual process to be represented on
a piece of paper.
Common mathematical representations include state-space models, transfer function
models, and automata.
5
The notation 0− essentially represents the left limit of the signal or the pre-initial condition. In most cases, this will
be equivalent to the value at 0. However, for functions with discontinuities at 0, this will not be true. Similarly, 0+
57
∞
F (s) = ∫ f (t ) e
− st
dt (1)
0−
where F is the Laplace-transformed function, f the original function, and s the Laplace variable.
Conventionally, the Laplace transform is denoted by a script L, ℒ (U+2112), that is, F(s) = ℒ(f(t)).
Converting from the Laplace domain to the time domain is conventionally shown using the inverse
of the Laplace transform, ℒ−1. Table 4 presents a summary of the most common Laplace transforms.
The following are some useful properties of the Laplace transform:
1) Superposition: ℒ(f + g) = ℒ(f) + ℒ(g).
2) Homogeneity: ℒ(αf) = αℒ(f).
operator.
4) Shifting Properties: The following rules can be useful in solving problems involving
Laplace transforms (where δ is the Dirac delta function, u the step response, and a ≥ 0):
ℒ(f(t − a)u(t – a)) = e−asF(s) (2)
ℒ (g(t)u(t – a)) = e−asℒ(g(t + a)) (3)
ℒ(δ(t – a)) = e−as (4)
ℒ(f(t)δ(t – a)) = f(a)e−as (5)
5) Final-Value Theorem: Assuming that the poles (roots of the denominator) of sF(s) lie in
the left-hand plane 6, then
lim f (t ) = lim sF ( s ) (6)
t →∞ s →0
6) Initial-Value Theorem: The value in the time domain at the starting point t = 0+ is given
by
lim f (t ) = lim sF ( s ) (7)
t → 0+ s →∞
represents the right limit or the postinitial conditions. Additional information about this issue can be found in Lundberg
et al. (2007).
6
Equivalently, the real component of all the poles must be less than 0 for the system to be stable.
58
Table 4: Table of Common Laplace Transforms
0 t ≤ 0
Unit Step Function, u u (t ) = s−1
1 t > 0
t n −1 1
Polynomials
( n − 1)! sn
ω
Sine e−atsin(ωt)
(s + a) + ω2
2
d n f (t ) n
Derivative 7
n
= f ( ) (t )
n
s n F ( s ) − ∑ s k −1 f ( n
−k )
(0 )
−
dt k =1
∞
1
Integration ∫ f ( t ) dt s
F (s)
0−
Often, when we are given function in the Laplace domain, it may be necessary to convert
it into the time domain. This can be performed by using the inverse Laplace transform, ℒ−1, such
that ℒ−1(ℒ(f(t)) = f(t). In most automation-engineering problems, the general case reduces to
finding the time-domain function corresponding to some rational function of s. In such cases,
partial fractioning (see Appendix I for the details) is required to break up the original fraction into
its constituent parts so that the known functions given in Table 5 can be used.
7
If it is assumed that the system is initial at steady-state and using deviational variables, then all derivatives will be
zero and this equation will reduce to the first term snF(s).
59
Table 5: Table of Useful Inverse Laplace Relationships
ℒ(f(t)) f(t)
A A −CD t
e
Cs + D C
A A n −1 C
−D
t
t e
( Cs + D ) ( n − 1)!C
n n
Cβ
Cs + E E − 2α −2αβ t ρ C −2αβ t ρ
e sin t + e cos t
αs + βs +γ α α α
2
αρ
(irreducible
quadratic) β2
with ρ =γ − ≥0
4α
60
5!
(t 5 ) = (10)
s6
Similarly, for the second term, from Table 4, we have that
s+a
( e − at cos (ωt ) ) = (11)
(s + a) + ω2
2
Comparing with the form that we have, we see that a = 5 and ω = 7. Thus, the Laplace transform
is
s+5
( e −5t cos ( 7t ) ) = (12)
( s + 5)
2
+ 72
Solution
The solution will be found by treating each fraction separately and using the information
in Table 5. For the first term, the general form of the transform can be found from Table 5 as
−D
A A Ct
−1
= e (15)
Cs + D C
Comparing the general form with our first term, we see that A = 5, C = 10, and D = 1, which
implies that the inverse Laplace form will be
−1
5 5 10 t
−1 = = e 0.5e −0.1t (16)
10 s + 1 10
For the second term, the general form can be written as
−1 A A −D
n −1 C
t
= t e (17)
( n − 1) !C
( Cs + D )
n n
61
Comparing the general form with our second term, we see that A = 8, C = 2, D = 1, and n = 5,
which implies that the inverse Laplace form will be
8 8 −1
t 1 4 −0.5t
−1
= = t 5 −1 2
e t e (18)
( 2 s + 1)5
( 5 − 1)!2 5
96
where F is the transformed function and f the original discrete function. Conventionally, the z-
transform is denoted by a script 𝒵𝒵 (U+1D4B5). Table 6 presents a summary of the most common
z-transforms. The following are some useful properties:
1) Superposition: 𝒵𝒵(f + g) = 𝒵𝒵(f) + 𝒵𝒵(g).
2) Homogeneity: 𝒵𝒵(αf) = α𝒵𝒵(f).
3) Final-Value Theorem: Assuming that the poles (roots of the denominator) of (z – 1)F(z)
lie inside the unit circle, then 8
lim
= f k lim ( z − 1) F ( z ) (21)
k →∞ z →1
4) Initial-Value Theorem: The value in the time domain at the starting point k = 0 is given
by
8
The roots are expressed in terms of z. Equivalently, the system is stable.
62
lim f k = lim zF ( z ) (22)
k →0 z →∞
Continuous-Time
Discrete-Time z-Domain
Case Domain
Domain (f(kTs)) F(s)
f(t)
0 t ≠ a 0 k ≠ a
Dirac Delta, δ 9 δ (t − a) =
δ ka = z−a
∞ t = a 1 k = a
Step Function, 0 t ≤ 0 0 k ≤ 0 1
u (t ) = uk =
u 1 t > 0 1 k > 0 1 − z −1
1
Exponential eat e akTs
1 − e aTs z −1
General Power 1
ak
Series 1 − az −1
First
df
Difference fk – fk – 1 (1 – z−1)F(z)
dt
(Derivative)
Time Shift
f(t − a)u(t − a) fk − auk − a z−aF(z)
(Delay)
As can be seen from Table 6, many of the forms involve z−1. For this reason, in automation
engineering, it is common to treat z−1 as the variable, which is called the backshift operator.
Converting between the two representations is rather easy as it involves multiplying by the highest
power present in the equation.
9
In the discrete domain, the Dirac delta function is most often called the Kronecker delta function.
63
The inverse operation of finding the time-domain representation given the z-transform is
performed using the inverse z-transform. Since most automation-engineering examples consider
rational functions of z, this will require partial fractioning in order to split the rational function into
its constituent parts (see Appendix I for details). Once the constituent parts have been obtained,
we can then use Table 7 to find the corresponding time-domain representation. Instead of partial-
fractioning, it may be possible to perform long division to obtain the individual values. However,
this can be quite long and difficult to do.
Table 7: Useful Inverse Z-Transform Table (A and D can take complex values.)
𝒵𝒵(yk) yk
k
Az A A D
= yk
= −
Cz + D C + Dz −1 C C
n −1
Az ∏ ( k − j + 1)
A j1 α k ,α = − D
yk = n = n −1
( Cz + D ) C α ( n − 1) ! C
n
A A k + n − 1 k D
,n∊ℤ yk = n α ,α = −
( C + Dz )
−1 n
C n −1 C
Example 3: Z-Transform
Compute the z-transform of the following function
0 k<2
yk = k − 2 (23)
5 , k ≥ 2
Solution
From Table 6, we see that an exponential function ak has the z-transform
1
(24)
1 − az −1
In our case, this implies that a = 5. However, we can note that the values are delayed by 2 samples.
Therefore, we will need to also use the delay formula from Table 6 to obtain the final result. Thus,
the z-transform is
z −2
( 5k − 2 ) = (25)
1 − 5 z −1
64
Example 4: Inverse z-Transform
Compute for the following frequency-domain function
2
(26)
1 + 5z −1
the corresponding time-domain representation.
Solution
From Table 7, we can see that this represents the first case with A = 2, C = 1, and D = 5.
This implies that the time-domain representation is
k k
2 A D 2 5
= − = − =2 ( −5 )
−1 k
−1
(27)
1 + 5z C C 1 1
Finally, we can note that there is a relationship between the Laplace transform of the
continuous-time domain and the z-transform of the discrete-time domain, namely,
z = esT (28)
where T is the sampling time. This means that results obtained in the continuous domain will have
a transformed representation in the discrete domain. Of note, the imaginary axis of the continuous
domain is mapped onto the boundary of the unit circle.
65
b. Principle of Homogeneity: f(αt1) = αf(t1), α ∊ ℝ.
If these two statements do not hold, then the model is said to be nonlinear. Linearity is a
very useful property that allows for a system to be easily analysed using known, well-
established theoretical methods. Nonlinear models can be linearised, so that in a given
region they are well described by the linear equivalent model. A model can be linear with
respect to one variable, but not another.
2) Time-invariant versus time-variant: A model is said to be time-invariant if the
parameters in the model are constant with respect to time. In a time-varying system, the
model parameters can depend on the time period.
3) Lumped parameter versus distributed parameter: A model is said to be a lumped-
parameter system if the model does not depend on the location, that is, there are no space
derivatives present. A model that depends on the location, that is, it contains space
derivatives, is called a distributed parameter system. For example, if the temperature T is
2
a function of the x- or y-direction, that is, we have a derivative of the form ∂ T2 in the
∂x
model, then the model is a distributed-parameter system. If the temperature only depends
on the time, then we have a lumped-parameter system. The analysis of distributed-
parameter systems is often much more difficult than that of a lumped-parameter system.
A distributed-parameter system can be reduced to a lumped-parameter model if it is
assumed that the variables are homogenously distributed within the space, and hence, all
the space derivatives are zero. An extension of this idea is to discretise the space into a
set of regions that can be assumed to be modelled by a lumped-parameter equivalent and
then solving the resulting system of equations.
4) Causal versus noncausal: A system is said to be causal if the future values only depend
on the current and past values. In a noncausal system, the future values depend on the
current, past, and future values. A noncausal system is not physically realisable, since the
future values will never be known.
5) System with memory (dynamic) versus system without memory (static): A system is
said to have memory if the future output depends on both the past and present inputs and
states. On the other hand, a system is said to be without memory or memoryless if the
future output only depends on the current input.
66
Section 3.2.1: Time- and Frequency-Domain Representations
In automation engineering, there are two common representations of a system: state-space
and transfer-function models.
The state-space model focuses on the relationship between states, inputs, and outputs in
the time domain. The general state-space model is given as
dx
= f ( x, u )
dt (29)
y = g ( x, u )
where x is the state variable, u is the input variable, t is the time, y is an output, f and g are some
functions, and an arrow above denotes a vector. The state variable is a variable that describes the
current location of the system from which the system’s future behaviour can be determined. A
state variable will often appear in some equation as a derivative with respect to time. The input
variable, u, is a variable that describes the properties of a stream entering a system. Traditionally,
the number of inputs is denoted by m, the number of states by n, and the number of outputs by p.
A system where p = m = 1 is said to be univariate or single-input, single-output (SISO). If p and
m are greater than 1, then the system is said to be multivariate or multi-input, multi-output
(MIMO). A system is said to be multi-input, single-output (MISO) if p = 1 and m > 1.
The general state-space model is often reduced to a linear form
dx
= x + u
dt (30)
y x + u
=
where 𝒜𝒜 is the n×n state matrix, ℬ is the n×m input matrix, 𝒞𝒞 is the p×n output matrix, and 𝒟𝒟 is
the p×m feed-through matrix.
On the other hand, the transfer-function representation focuses solely on the relationship
between the inputs and outputs in the Laplace domain and allows easier analysis of the system
than for a state-space model. The general transfer function representation can be written as
Y ( s ) = ( s )U ( s ) (31)
where Y is the output in the Laplace domain, U the input in the Laplace domain, and 𝒢𝒢 a matrix
containing the transfer function representation of the model, that is
67
Y1 ( s ) U1 ( s ) G11 ( s ) G1m ( s )
=Y ( s ) = , U (s) = , (s) (32)
Yp ( s ) U m ( s ) G p1 ( s ) G pm ( s )
It is often assumed that each transfer function can be written as
N ( s ) −θ s
G (s) = e (33)
D (s)
where N and D are polynomials of s and θ is the deadtime or time delay in the system. Time delay
arises in real systems due to transport phenomena, measurement delays, and approximations
introduced when linearising a system. The order of a transfer function is equal to the highest
power of the D-polynomial.
Given the simple form of a transfer-function representation, much of the analysis in control
is performed using it.
where ℐ is the n×n identity matrix and s is the Laplace transform variable.
Example 5: Numeric Example of Obtaining a Transfer Function
Consider the example
10
In automation engineering, we often deal with deviation variables that are defined as x̃ = x – xss, where xss is some
steady-state value. Since we assume that the process is initially at steady state, this means that the initial conditions
will always be zero.
11
The inverse exists since the 𝒜𝒜-matrix only contains numeric entries.
68
dx
5 + 3 x =
u
dt (37)
y = x
Taking the Laplace transform of Equation (37) gives
5sX ( s ) + 3 X ( s ) =
U (s)
(38)
Y ( s ) = X ( s )
Substituting Y for X in the first equation of Equation (38) gives
5sY ( s ) + 3Y ( s ) =
U (s) (39)
Y (s) 1
G
= (s) = (41)
U ( s ) 5s + 3
(s n
+ an −1s n −1 + + a0 ) Y=
(s) (bn −1 s n −1 + + b0 ) U ( s )
Y (s) (b s n −1 + + b0 ) (44)
(s) =
n −1
G
=
U (s) (s n
+ an −1s n −1 + + a0 )
69
Example 7: Multivariate Example
Consider the following differential equation
dx
= −ax + b1u1 + b2u2
dt (45)
y = x
and determine the transfer functions for the system. Note that there are two inputs (m = 2) and one
output (p = 1).
Solution
sX ( s ) = − aX ( s ) + bU
1 1 ( s ) + b2U 2 ( s )
Y ( s ) = X ( s )
sY ( s ) + aY ( s ) = bU
1 1 ( s ) + b2U 2 ( s ) (46)
( s + a ) Y ( s ) = bU
1 1 ( s ) + b2U 2 ( s )
b1 b
Y (s)
= U1 ( s ) + 2 U 2 ( s )
s+a s+a
Rewriting this into matrix form gives
b b2 U1 ( s )
Y (s) = 1 (47)
s + a s + a U 2 ( s )
Note that this can be written separately, since linear functions are being considered. As well, note
that the principle of superposition holds, so that we can study each transfer function separately and
then combine the results together.
The reverse operation of converting a transfer function into a state-space representation
does not yield a unique solution or realisation. Consider the following transfer function, where
p < n:
β p s p + β p −1s p −1 + + β1s + β 0
G (s) = n (48)
s + α n −1s n −1 + + α1s + α 0
then the controllable canonical realisation is
70
−α n −1 −α n − 2 −α1 −α 0 1
1 0 0 0 0
= = 0 1
(49)
0
0 0 1 0 n×n 0
n×1
0 0 β p β p −1 β1 β 0 01×1
=
1×n
Note that for 𝒞𝒞 in the controllable canonical realisation and for ℬ in the observable canonical
realisation, there will be n – p – 1 zeroes at the beginning of the vector. The fact that the two forms
are related by taking the transpose is not coincidental.
Example 8: Converting a Transfer Function into Its Controllable Canonical Realisation
Convert the transfer function
s−2
G (s) = 2
(51)
s − 4s + 1
into its controllable canonical realisation.
Solution
First, we need to make sure that the transfer function is the form given by Equation (48)
and determine the values of the parameters. Since the equations have the same form, we note that
n = 2 (highest power in the denominator) and p = 1 (highest power in the numerator), which implies
that the transfer function satisfies the requirements. Thus, we can simply compare the parameters
and obtain their values, that is, α2 = 1, α1 = −4, α0 = 1, β1 = 1, and β0 = −2. Thus, using Equation
(49), the controllable canonical realisation is
4 −1 1
= =
1 0 0 (52)
=[1 −2] =01×1
71
Thus, we have defined the four matrices for one of the state-space representations of the given
transfer function.
where Gp is the process transfer function, θ the parameters, and Gl the disturbance transfer function.
Since in most applications, it is assumed that the transfer functions are rational functions of z-1, the
most common discrete transfer function equation can be written in a form called the prediction-
error model, which has the following form:
B( z −1 ) C ( z −1 )
A( z −1 ) yt
= ut −k + et (55)
F ( z −1 ) D( z −1 )
where A(z−1), C(z−1), D(z−1), and F(z−1) are polynomials in z−1 of the form
na
1 + ∑ θi z −i (56)
i =1
na is the order of the polynomial and θi are the parameters, B(z−1), is a polynomial in z−1 of the
form
72
nb
∑θ z
i =1
i
−i
(57)
nb is the order of the polynomial, and k is the time delay in the system. In general, it is very rare
for this model to be used directly. Instead, any of the following simplifications may be used:
1) Box-Jenkins Model: In this model, the A(z-1) polynomial is ignored. Thus, this model
is given as
B( z −1 ) C ( z −1 )
=yt ut − k + et (58)
F ( z −1 ) D( z −1 )
In practice, this method is sufficient to fit an accurate model of the system.
2) Autoregressive Moving-Average Exogenous Model (ARMAX): In this model, the
D(z-1) and F(z-1) polynomials are ignored, which gives
A( z −1 ) yt B( z −1 )ut −k + C ( z −1 )et
= (59)
This model assumes that the denominator for both the input and the error is the same.
However, this model has the beneficial property that its parameters can be estimated
using least-squares regression. A further simplification is to ignore the C(z−1) term.
This gives an autoregressive exogenous model (ARX). This model has the form
given by:
A( z −1 ) yt B( z −1 )ut −k + et
= (60)
3) Output-Error Model (OE): In this model, only the model for the input is fit to the
data. The error terms are ignored. Thus, the model is given as
B( z −1 )
=yt ut − k + et (61)
F ( z −1 )
73
d = eτ s
τ =τ s τ
d = ∫ e dτ (62)
τ =0
d =
d =
where τs is the sampling time and e𝒜𝒜τ is the matrix exponential function. The corresponding
transfer function can then be obtained using Equation (36). For a simple, first-order, continuous
transfer function given as
K
Y (s) = U (s) (63)
τ ps +1
the discrete, transfer function is given as
K (1 − e )
τp
−
τs
yk = uk (64)
1 − (1 − e ) z
τp
−
τs −1
If a system has time delay, then it can be converted using the following formula
θ
k= (65)
τ s
where θ is the continuous time delay and is an appropriately selected rounding function that
where h are the impulse coefficients. The values of h can be obtained by either performing long
division on the transfer function or partial fractioning the result to obtain the impulse coefficients.
74
Since the values of h can often quickly taper off, it is possible to convert the infinite-impulse-
response model into a finite-impulse-response (FIR) model, that is,
n n
=yk ∑
= hi z −i uk ∑hu i k −i (68)
=i 0=i 0
where n is an integer representing the number of terms selected for the model.
G= (69)
Using this representation, it is possible to easily partition the matrices and show this in a compact
manner, for example,
11 12 1
2
G = 21 22 (70)
1 2
where the states have been split into four groups and the relationships between the different groups
can easily be shown.
When using the compact representation, various short cuts can be used when combining
two models. When adding two compact representations, that is the transfer functions are in parallel,
1 0 1
2
0 2
G1 + G2 = (71)
1 + 2
1 2
When multiplying two representations, that is the transfer functions are in series,
1 12 12
0 2
G1G2 = 2 (72)
1 12 12
The inverse of a compact state-space representation can be written as
75
− −1 − −1
−1
G = −1 (73)
−1
provided that 𝒟𝒟 is invertible. Finally, the transpose of this representation can be written as
T
T T
G = T (74)
T
A common operation with state-space models is to transform the order or meaning of the states. In
such cases, the compact representation can be derived as follows. Assume that
x = x
u = u (75)
y = y
where 𝒯𝒯, ℛ, and 𝒮𝒮 are appropriately sized nonsingular (invertible) matrices. In this case, the
transformed compact representation can be written as
−1 −1
G= (76)
−1
−1
The order of a polynomial, denoted by n, is defined as the highest power present in a given
polynomial, for example, x4 + x2 is a fourth-order polynomial, since the highest power is 4. The
order of a transfer function is equal to the order of the denominator polynomial, D. A transfer
function is said to be proper if the order of the numerator is less than or equal to the order of the
76
denominator, that is, nN ≤ nD. A transfer function is said to be strictly proper if the order of the
numerator is less than the order of the denominator, that is, nN < nD. For most physical processes,
a transfer function will be strictly proper.
A process is said to be causal if the time delay, θ (or k) is nonnegative; otherwise, the
process is noncausal. In the discrete domain, causality is ensured by a proper transfer function.
The poles of a transfer function are defined as the roots of the denominator, D, that is, those
values of s (or z) such that D = 0. The zeros of a transfer function are defined as the roots of the
numerator, N.
A process is said to be at steady state if all derivatives are equal to zero, that is,
dx
=0 (79)
dt
If Equation (79) does not hold, then the process is said to be operating in transient mode. It should
be noted that small deviations from zero do not necessarily mean that the process is now in a
transient mode. In practice, it may not be possible to achieve an exact steady state, where all the
derivatives are exactly equal to zero, both due to continual small fluctuations and measurement
imprecisions. In such cases, it is common to define the settling time, ts, of a process as the time it
takes for the process to reach and stay within an envelope centred on the new steady-state value
and has bounds that are 2.5% of the change in the process variable. Figure 23 shows how the
settling time is computed.
77
Figure 23: Determining the Settling Time
For a process modelled by a continuous transfer function, there are three key parameters of
interest: gain, time constant, and time delay (deadtime or process delay). The gain, K, of the
process represents the steady-state behaviour of the system for a unit change in the input. It is
defined as
y (t → ∞ )
K= (80)
u (t → ∞ )
where it is assumed that the input is bounded as t → ∞. The gain is the same irrespective of the
bounded input used. Using the final-value theorem for a general transfer function and a step change
in the input, it can be seen that
sG ( s )
=K lim
= sY ( s ) lim = lim G ( s )
s →0 s →0 s s →0
= lim n
( bn −1s n −1 + + b0 )
e −θ s (81)
( n−1s + + a0 )
s →0 s + a n −1
b0
=
a0
This ratio b0 / a0 is called the gain, K, of the process.
78
The process time constant τ represents the transient or dynamic component of the system,
that is, how quickly the system responds to changes in the input and reaches a new steady-state
value. The larger the time constant, the longer it takes to reach steady state. It can be obtained from
the transfer function by factoring the denominator into the form
(b n −1 s n −1 + + b0 )
=
(b n −1 s n −1 + + b0 )
(82)
(s n
+ an −1s n −1 + + a0 )
n
∏ (τ s + 1) i
i =1
which gives the time constants, τ, of the process. If there are multiple time constants, then the
largest time constant will determine the overall response speed of the process. Should the time
constant be a complex number, then the speed of the response corresponds solely to its real
component.
The final parameter of interest is the time delay, θ, which measures how long it takes
before the system responds to a change in the input. Time delays can arise from two different
sources: physical and measurement. Physically, time delays are perceived times at which a system
is not responding to changes in the input. They can arise if it takes time for an observable change
to be seen, for example, heating a large tank would take some time before the temperature rises by
an appreciable amount that can be measured. On the other hand, measurement time delays arise
due to the placement of sensors. In many systems, it may not be possible to measure the variable
immediately where it will act on the process. In this case, it will take some time before the variable
actually affects the system, for example, the flow rate in a pipe could be measured at the beginning
of the pipe and it could take some time before it will reach the process. In the frequency domain,
the time delay is found as
e−θs (83)
where θ is the time delay. In many applications, it may be necessary to convert the exponential
form of the time delay into a polynomial expansion. This conversion can be accomplished using
the Padé approximation, denoted as the n/m Padé approximation, where n is the order of the
polynomial in the numerator and m is the order of the polynomial in the denominator. The 1/1
Padé approximation is given as
θ
1− s
e −θ s = 2 (84)
θ
1+ s
2
79
The 2/2 Padé approximation is given as
θ θ2
1− s+ s2
e −θ s = 2 12 (85)
θ θ2 2
1+ s+ s
2 12
A table of the Padé Approximation for the exponential function up to 3/3 are given in Table 8,
from which the Padé Approximation for the time delay can be easily derived.
Table 8: Padé Approximations for the Exponential Function, ex, where x = −θs
n
→ 0 1 2 3
m↓
1 1
1 1
0 1 1 2 1 3
1 1− x 1 − x + x2 1− x + x − x
2 2 6
1 1 1
1+ x 1+ x 1+ x
1+ x 2 3 4
1
1 1 2 1 3 1 2 1 3
1− x 1 − x + x2 1− x + x − x
2 3 6 4 4 24
2 1 1 1 2 1 2
1 2 1 + x + x2 1 + x + x2 1+ x + x
1+ x + x 3 6 2 12 5 20
2 2 1 1 1 3 3 2 1 3
1 1− x 1 − x + x2 1− x + x − x
3 2 12 5 20 60
3 1 1 3 3 3 2 1 3 1 1 1 3
1 2 1 3 1+ x + x2 + x 1+ x + x + x 1 + x + x2 + x
1+ x + x + x 4 4 24 5 20 60 2 10 120
3 2 6 1 2 1 2 1 1 1 3
1 1− x 1− x + x 1 − x + x2 − x
4 5 20 2 10 120
Solution
Re-arranging into the required form gives
Y ( s ) 1/ 3
( s ) = 5 e−5s
G= (87)
U (s) s +1
3
80
from which, by inspection, the gain is ⅓ and the time constant is 5 / 3. The time delay is 5.
Re ( G ( jω ) ) + Im ( G ( jω ) )
2 2
AR G
= = ( jω ) (90)
where Re is the real component of a complex number, Im is the imaginary component, and ||·|| is
the modulus function. It should be noted that in many applications, the logarithm of the amplitude
ratio is used. In most cases, a base-10 logarithm is used. Occasionally, a decibel logarithm will be
used, that is, AR = 20 log ||G(jω)||. The phase angle, ϕ, conventionally expressed in degrees, is
defined as
Im ( G ( jω ) )
φ = arctan (91)
Re ( G ( jω ) )
81
where arctan is the standard inverse tangent function defined on ]−90°, 90°[. It should be noted
that if the denominator is negative, then it is necessary to add 180° to the value obtained previously.
This is because the arctan function does not work on the complete circle. 12
It can be noted that if the original transfer function is a product of simpler transfer functions,
that is,
G ( s ) = ∏ Gi ( s ) (92)
which is the product of the individual amplitude ratios corresponding to each simpler transfer
function. The phase angle can be computed as
φ = ∑ φGi ( s ) (94)
These two formulae can simplify the determination of the amplitude ratio and phase angles of
complex transfer functions. This formulae result from the fact that all transfer functions can be
expressed in polar form as G(jω) = ||G(jω)||e−ϕj, from which it is easy to see that combining
multiple transfer functions as given by Equation (92), the given formulae will result.
The amplitude ratio and phase angle can be graphically presented in two different forms,
either as a Bode plot or as a Nyquist plot. In a Bode plot, the x-axis is the frequency, ω, and the
y-axis is either the amplitude ratio or phase angle. A typical Bode plot is shown in Figure 24.
12
In some programmes, an “astronomical” arctangent function is defined as arctan2(y, x), which will return the value
in the correct quadrant based on the signs of y and x. If available, it should be used.
82
50
Amplitude Ratio, AR (dB)
-50
-100
-150
-90
Phase Angle, 𝜙 (°)
-135
-180
-225
-270 -1
10 100 101 102 103
Frequency, ω (rad/s)
Figure 24: Bode Plot: The Argument-Ratio and Phase-Angle Plots
In a Nyquist plot, the real component of G(jω) is plotted on the x-axis and the imaginary
component of G(jω) is plotted on the y-axis. A typical Nyquist plot is shown in Figure 25. In most
applications, Bode plots are used, but a Nyquist plot can be useful to analysis the interactions
between different systems.
83
10
Imaginary Component
6
-2
-4
-6
-8
-10
-1 -0.8 -0.6 -0.4 -0.2 0
Real Component
Figure 25: A Nyquist Plot (for the same process as given by the Bode plot in Figure 24)
84
domain, the magnitude of all the poles must be less than 1, that is, the poles must lie inside the unit
circle, for the process to be stable; otherwise, the process is unstable. 13
Finally, it can be noted that if the state-space representation is stable, then so will the
transfer function representation be. However, the converse is not true, since each transfer function
does not have a unique state-space representation and it is possible to construct an unstable state-
space representation for a stable transfer function, by adding an unobservable unstable state.
Table 9: Summary of the Stability Conditions for Different Representations and Time Domains
space matrix, 𝒜𝒜
Transfer
Poles of the transfer function
Function Re(p) < 0 Re(p) ≥ 0
(Roots of D)
space matrix, 𝒜𝒜
Transfer Poles of the transfer function
||p|| < 1 ||p|| ≥ 1
Function (Roots of D)
z2
G3 ( z ) = 4 3 2 (97)
z + z + z + z −1
13
In the discrete domain with a transfer function, it is very important to take into consideration what variable is being
used and how the stability condition is being phrased. Often, especially in control, stability is discussed in terms of
z−1, in which case the above rules need to be inverted, that is, stability implies poles outside the unit circle. For
consistency, stability in this book will be discussed in terms of z.
85
Solution
For G1, setting 5s + 3 equal to zero and solving, gives a pole of −3/5. According to the
results in Table 9 for a continuous transfer function, the system is stable, since the pole is less than
zero.
For G2, setting the two terms to zero and solving, gives three poles of −3/5 and ±2i. From
Table 9 for a continuous transfer function, we conclude that the system is unstable since we have
two poles with a real component equal to zero and one pole whose value is less than zero.
For G3, the setting the denominator equal to zero and solving, gives poles of −1.291,
−0.1141±1.217i, and 0.519. For a discrete transfer function, Table 9 states that in order for the
system to be stable, the magnitude of the roots must be less than one. We see that we have at least
one pole (−1.291) whose magnitude is greater than zero. This implies that the system will be
unstable.
Example 11: Determining the Stability of a State-Space Model
Determine if the given 𝒜𝒜-matrices represent stable continuous processes:
2 0
1 = (98)
3 −2
−5 5 6
2 0 −3 2
= (99)
0 0 −1
2 1
3 = (100)
−1 2
Solution
For 𝒜𝒜1, since it is a triangular matrix, the eigenvalues can be directly found by looking at
the main diagonal entries. This implies that the eigenvalues are 2 and −2. According to the results
in Table 9 for a continuous state-space model, the system is unstable, since one of the eigenvalues
is greater than zero.
Likewise, for 𝒜𝒜2, we can find the eigenvalues by looking at the main diagonal entries. This
gives −5, −3, and −1. Since all of the eigenvalues are less than zero, from Table 9 for a continuous
state-space model, we conclude that the system is stable.
For 𝒜𝒜3, we need to compute the eigenvalues as follows
86
det ( λ I − 3 ) =( λ − 2 ) − (1)( −1)
2
= λ 2 − 4λ + 5 (101)
= 2±i
Note that the real part of the eigenvalues is greater than zero. From Table 9, we see that the system
is stable if all real parts of the poles are less than zero. Since this is not the case here, we conclude
that the system is unstable.
87
where λ1, j = an − 2 j + 2 and λ2, j = an − 2 j +1 (the first two rows are the coefficients of
the characteristic polynomial). Any values that are not given are assumed to be
zero.
d) Continue computing this value until the table has n + 1 rows.
e) A polynomial is stable (all roots of the characteristic polynomial have negative
real components) if all the values in the first column have the same sign, either
strictly positive or strictly negative.
Row 1 2 3 …
1 an an − 2 an − 4 …
2 an − 1 an − 3 an − 5 …
3 an −1an − 2 − an an −3 an −1an − 4 − an an −5
b1 = b2 = …
an −1 an −1
4 b1an −3 − b2 an −1
c1 = …
b1
…
n+1 z1
4
2) G ( s ) =
s 4 + 3s 3 + s 2 + 2 s + 1
Solution
For the first transfer function, we can determine the stability by inspection. Since we are
missing one of the powers (s5) and the coefficients are both negative and positive, we can conclude
on the basis of condition (1) of the Routh stability analysis that this transfer function is unstable.
88
For the second transfer function, we see that condition (1) is satisfied, as all the powers are
present and the coefficients have the same sign. Therefore, we will need to check condition (2) by
constructing the Routh array. There will be 3 (always n / 2, rounded up) columns in the array. In
the first row (denoted as 1 in Table 11), we place the even coefficients ordered in decreasing
powers. In the second row, we place the odd coefficients. In Rows 3, 4, and 5, we compute the
values using the formula:
an −1an − 2 − an an −3 3 (1) − 1( 2 ) 1
=b1 = =
an −1 3 3
an −1an − 4 − an an −5 3 (1) − 1( 0 )
=b2 = = 1
an −1 3
c1 =
b1an −3 − b2 an −1
=
( 13 ) 2 − 3 (1) = −7
b1 1
3
Row 1 2 3
1 1 1 1
2 3 2
3 ⅓ 1
4 −7
5 1
From Table 11, we see that there is a sign change in column 1, row 4, which implies that the system
is unstable.
89
higher-order systems. For this reason, there exist special tests for stability that do not require the
roots of the polynomial to be determined. One of the most common tests for a discrete-time transfer
function is the Jury stability analysis. By simply considering the coefficients of the polynomial
of the denominator, the stability of the system can be determined. Like with the Routh stability
test, a table is constructed. Let the polynomial of interest be given as
D ( z )= an z n + an −1 z n −1 + + a1 z + a0 (104)
Construct the following table (similar to that shown in Table 12), where the first row contains all
the coefficients starting from a0 and ending with an. The second row is the first row reversed, that
is, the first column contains an, and the last column contains a0. The third row is computed using
bi a0 ai − an an−i
= (105)
while the fourth row is the third row reversed. Note that only the first n values are reversed.
Effectively, we have now created a new reduced polynomial that needs to be analysed. Thus, the
fifth row is computed using the same formula as for the third row given by Equation (105), but
replacing n by n – 1 coefficients, that is,
ci = b0 bi – bn − 1 bn – 1 − i (106)
This procedure is then repeated until there is a row with only 3 elements left (denoted as q0, q1,
and q2), that is, the table will have 2n – 3 rows. In general, for the (2j + 1)th row (j = 1, 2, …, n – 2),
that is, each odd-numbered row, we can write the relationship as follows
row, that is, the even row, will then be the n – j + 1 coefficients written in reversed order. It can be
noted that the odd rows are essentially a determinant of the above two rows.
The conditions for stability can then be stated as:
1) D(1) > 0
2) (−1)nD(−1) > 0
3) |a0| > |an|
4) |b0| > |bn − 1|, and continuing in this manner until the last row is reach, where |q0| > |q2|.
If any of the above conditions fail, then the system will have at least one pole outside the unit circle
and hence be unstable.
90
Table 12: Analysis Table for Jury Stability
Row 0 1 … n−1 n
1 a0 a1 … an − 1 an
2 an an − 1 … a1 a0
3 b0 = a0 a0 – an an b1 = a0 a1 – an an−1 … bn + 1 = a0 an−1 – an al 0
4 bn − 1 bn – 2 … b0 0
5
…
…
2n − 3 q0 q1 … … 0
Example 13: Example of Jury Stability Analysis
Using the Jury stability test, determine the stability of the following two discrete transfer
functions:
5
1) G ( z ) =
z 6 + 5 z 4 + 6 z 3 + 2 z 2 + 3z + 1
4
2) G ( z ) =
10 z + 3 z + z 2 + 5 z + 1
4 3
Solution
For the first transfer function, we need to test the initial constraints before we consider
creating the table. For condition 1, D(1) > 0, we get
1 + 5 + 6 + 2 + 3 + 1 = 18 > 1
which implies that this condition is satisfied. Condition 2, (−1)nD(−1) > 0, gives
(−1)6[1(−1)6 + 5(−1)4 + 6(−1)3 + 2(−1)2 + 3(−1)1 + 1] = 0
which is not satisfied. This implies that the first transfer function is not stable.
For the second transfer function, testing the three initial conditions gives
Condition (1): 10 + 3 + 1 + 5 + 1 = 20 > 0 (satisfied)
Condition (2): (−1)4[10(−1)4 + 3(−1)3 + (−1)2 + 5(−1)1 + 1] = 4 > 0 (satisfied)
Condition (3): |an| > |a0| ⇒ |10| > |1| (satisfied)
91
Since all the preliminary conditions have been satisfied, the Jury array can be constructed. This is
shown in Table 13. The first row consists of the coefficients arranged in increasing powers, while
the second row consists of the coefficients arranged in decreasing power. In Row 3, we compute
the values using the formula
bi a0 ai − an an−i
= (108)
which gives
b0 = 1(1) − 10 (10 ) =
a0 a0 − a4 a4−0 = −99
b1 = (1) 5 − 10 ( 3) =
a0 a1 − a4 a4−1 = −25
b2 =− 1(1) − 10 (1) =
a0 a2 a4 a4− 2 = −9
b3 = 3 (1) − 10 ( 5 ) =
a0 a3 − a4 a4−3 = −47
From here, we should check that the condition |b0| > |bn – 1| is satisfied. Since |−99| > |−47|, it holds
and we proceed to the next step. We reverse the order of the remaining n – 1 coefficients and write
them in Row 4. Effectively, we have created a new polynomial of order n – 1 that we need to test.
Thus, in Row 5, we will use a modified form of Equation (108) to give
ci = b0 bi – bn − 1 bn – 1 − i (109)
Effectively, this is the same as Equation (108), but with the value of n reduced by 1. Evaluating
Equation (109) for the n – 2 columns gives
Row 0 1 2 3 4
1 1 5 1 3 10
2 10 3 1 5 1
3 −99 −25 −9 −47
92
4 −47 −9 −25 −99
5 7592 2052 −284
Since it has been shown that the poles of the system are the determining factor for stability, it
therefore suffices to consider only the denominator of the closed-loop transfer function, that is, the
term 1 + GcGp. It is possible to apply either the Routh or the Jury Stability Tests to determine under
what conditions the system will be stable.
However, in some circumstances, it can be instructive to look at the frequency-domain
plots, especially the Bode plot, to determine stability. In order to make the analysis simpler, we
will rewrite the denominator to
GcGp = −1 (111)
Taking the magnitude (or modulus) of Equation (111) gives
||GcGp|| = ||−1|| (112)
while the phase angle for −1 is −180°, since the imaginary component is 0 and the real component
is −1, which after subtracting −180° gives the correct location. Therefore, plotting the Bode plot
for the open-loop transfer function GcGp will allow the stability of the system to be determined by
examining the critical frequency, ωc, which is the frequency corresponding to a phase angle of
−180°. If the value of the amplitude ratio at this point is greater than 1 (or 0 if a logarithmic basis
is being used), then the process will be closed-loop unstable. An example is shown in Figure 26.
93
Figure 26: Bode Plot for Closed-Loop Stability Analysis
Furthermore, we can define two additional parameters of interest: the gain margin (GM)
and the phase margin (PM). These two margins represent how much room we have before the
system becomes unstable. On a Bode plot, instability implies an amplitude ratio above 1 (or 0 for
the logarithmic case) or a phase angle below −180°. These parameters are shown in Figure 27 for
the Bode plot and in Figure 28 for the Nyquist plot. The phase margin is defined by adding 180°
to the phase angle when the gain crosses the value of 1, which is denoted by ωg and called the gain
crossover, that is,
PM = ϕ(ωg) + 180° (113)
The gain margin is defined as the inverse of the amplitude ratio when the phase angle crosses the
phase angle of −180°, which is denoted by ωp and called the phase crossover, that is,
GM = 1 / AR(ωp) (114)
It is possible to design controllers by specifying the phase and gain margins.
94
Figure 27: Closed-Loop Stability using the Bode Plot
95
have a multiplicity greater than one. This implies that the integrator and the sine function
can be implemented.
2) Causality: The transfer function should be causal.
3) Finite Frequency Response: The frequency response of the function should be finite, that
is,
Since the rules for determining stability and causality are known, only the last condition needs to
be determined. For a continuous-time transfer function, the frequency response will be finite if the
transfer function is proper. For a discrete-time transfer function, this condition is not relevant, since
all rational transfer function will have a finite frequency response.
− λi
3) The n×n matrix has rank n for all eigenvalues λi of 𝒜𝒜. This allows the individual
states or eigenvalues of 𝒜𝒜 to be classified.
96
A system is said to be detectable if all unstable states of a state-space representation can be
− λi
observed. This can be determined by examining for each of the unstable states and
determining if it is full rank.
The state equation or the pair (𝒜𝒜, ℬ) is said to be controllable if and only if for any initial
state, x0, and final state, x1, there exists a bounded input, u(t), that transfers x0 to x1 in finite time.
This can be accomplished if and only if:
1) n×np = 2 n −1 has full rank n, where is the controllability matrix.
t
2) The controllability Grammian, c ( t )n×n = ∫ eτ T e τ dτ , is nonsingular for all t > 0.
T
c −1 is a measure of the energy required to control the process. A larger value implies that
more energy (or effort) is required.
3) The n×n matrix [𝒜𝒜 − λiℐ | ℬ] has rank n for all eigenvalues λi of 𝒜𝒜. This allows the
individual states or eigenvalues of 𝒜𝒜 to be classified.
A system is said to be stabilisable if all unstable states of a state-space representation can be
controlled. This can be determined by examining [𝒜𝒜 − λiℐ | ℬ] for each of the unstable states and
determining if it is full rank.
It can be noted that controllability and observability are duals of each other, that is, if (𝒜𝒜,
ℬ) is controllable, then (𝒜𝒜T, ℬT) is observable. Similarly, if (𝒜𝒜, 𝒞𝒞) is observable, then (𝒜𝒜T, 𝒞𝒞T) is
controllable. This also explains why the controllable and observable canonical forms are
transposes of each other.
97
Section 3.3.5.1: Integrator
The integrator, as its name suggests, integrates a variable. It is a common model for level
in a tank. Its Laplace transform is
MI
GI = (116)
s
where MI is the gain. It is an unstable system, which will always increase even if the input is
bounded. The step response of the system can be determined as
Y = GIU
MI M
Y= (117)
s s
MIM
=
s2
From Table 4, the time domain representation for Equation (117) is
yt = MIMt (118)
A representative plot is shown in Figure 29. Its Bode plot can be determined as
MI M j
GI ( jω ) = = − I
jω ω
2
M M
⇒ AR= 02 + − I = I (119)
ω ω
MI
− ω
φ=arctan = −90°
0
A representative Bode plot is shown in Figure 30. The key properties of the integrator are
summarised in Table 14.
Property Value
MI
Laplace Transform GI =
s
Step Response (Time Domain) yt = MIMt
Bode Plots AR |MI| / ω
98
ϕ −90°
Stable No
99
Section 3.3.5.2: Lead Term
The lead term is a simple, first-order transfer function that is occasionally found in
combination with other transfer function to model unusual or more complex initial dynamics in a
process. Its Laplace transform is
GL K (τ L s + 1)
= (120)
where K is the gain and τL is a time constant. The step response of the system can be determined
as
Y = GLU
M
=Y K (τ L s + 1) (121)
s
(τ s + 1)
= KM L
s
In order to obtain a time-domain representation, it is necessary to perform a partial fraction
decomposition of Equation (121) to give
Y = KM
(τ L s + 1)
s (122)
1
=Y KM τ L +
s
From Table 5, the time domain representation for Equation (122) is
=yt KM (τ Lδ + ut ) (123)
where δ is the Dirac delta function and ut is the unit step function. Its Bode plot can be determined
as
GL ( jω ) = K (τ L jω + 1) = K + Kτ Lω j
⇒ AR= K 2 + ( Kτ Lω ) =
2
K 1 + τ L2ω 2 (124)
Kτ Lω arctan τ Lω K >0
=φ arctan
= arctan τ ω + 180° K < 0
K L
A representative Bode plot is shown in Figure 31 for all 4 possible combinations of K and τL. The
key properties of the lead term are summarised in Table 15.
100
Table 15: Basic Information About a Lead Term
Property Value
Laplace Transform GL K (τ L s + 1)
=
AR K 1 + τ L2ω 2
Bode Plots arctan τ Lω K >0
ϕ
arctan τ Lω + 180° K <0
Stable Yes
Negative values of τL (positive zeros) can
induce an inverse response in a system, that
Comment is, the variable first decreases in value and
increases to reach its new steady-state value
(or vice versa).
101
Figure 31: Bode Plot for a Lead Term (top row) K > 0, (bottom row) K < 0, (left) τL > 0, and (right) τL < 0
102
Y = GFU
K M
Y= (127)
(τ p s + 1) s
KM
=
s (τ p s + 1)
= KM
The time response of a stable first-order system is shown in Figure 32, as well as how to compute
the key parameters from its graph. Its Bode plot can be determined as
K K (1 − τ pω j )
GF ( jω )
= =
(τ p jω + 1) 1 + τ p2ω 2
K 2 + ( − Kτ pω )
2
K
⇒ AR= = (131)
(1 + τ p2ω )
2 2
1 + τ p2ω 2
− Kτ pω − arctan τ pω K >0
=φ arctan
=
K 180° − arctan τ pω K <0
In order to avoid a discontinuity when it passes through 0°, it is common to use negative angles
when plotting this function, that is −45° rather than the equivalent 315°. A representative Bode
103
plot is shown in Figure 31 for all 4 possible combinations of K and τp. The key properties of the
first-order system are summarised in Table 16.
Property Value
K
Laplace Transform GF =
(τ p s + 1)
−
t
K
AR
1 + τ p2ω 2
Bode Plots
− arctan τ pω K >0
ϕ
180° − arctan τ pω K <0
Time, t
y∞
0.632 KM
ySS, 2– ySS, 1
K= M KM
Original
Steady State, ySS, 1
Time, t
Time Constant, τp
Time Delay, θ
104
Figure 33: Bode Plot for a First-Order System (top row) K > 0, (bottom row) K < 0, (left) τp > 0, and (right) τp < 0
where K is the gain, τp is the process time constant, and ζ is the damping coefficient. This basic
transfer function can be augmented by adding a lead term to model various behaviours to give
K (τ L s + 1)
GII = (133)
(τ s + 2ζτ p s + 1)
2 2
p
105
As well, it can be coupled with a time-delay term to give a second-order plus deadtime (SOPDT)
process model, that is,
K
GIID = e −θ s (134)
(τ s + 2ζτ p s + 1)
2 2
p
−2ζτ p ± 4ζ 2τ p2 − 4τ p2
s=
2τ p2
(135)
−ζ ± ζ 2 − 1
=
τp
Depending on the value of ζ, three different cases can be determined:
1) Case I: Underdamped System, where |ζ| < 1. In this case, the poles will contain an
imaginary component.
2) Case II: Critically Damped System, where |ζ| = 1. In this case, the poles will both be
real and the same.
3) Case III: Overdamped System, where |ζ| > 1. In this case, the poles will both be real.
The behaviour and critical information depend on the particular case being considered.
For the underdamped case, where |ζ| < 1, the poles of Equation (132) will contain an
imaginary component. The presence of an imaginary component will imply that there will be
oscillations present in the time response. If ζ = 0, then the system will continuously oscillate about
a mean value. In all other cases, stability will depend on the sign of ζτp: if positive, the system will
be stable (decaying oscillations); if negative, the system will be unstable (increasing oscillations).
The step response of this system can be written as
−ζ t 1− ζ 2 ζ2 1− ζ 2
KM 1 − e p cos
y (t ) =
τ
t+ sin t (136)
τp 1− ζ 2 τp
A typical stable, underdamped step response is shown in Figure 34. Some of the key parameters
that can be extracted from a step response are:
1) Time to First Peak, tp: t p = πτ
1− ζ 2
−πζ a
=
2) Overshoot, OS: OS exp
= 2
.
1− ζ b
106
3) Decay Ratio, DR: The decay ratio is the square of the overshoot ratio, i.e.
−2πζ c
=DR exp
= 2
1 − ζ a.
4) Period of Oscillation, P: This is the time between 2 oscillations. It is given by
2πτ
P= .
1− ζ 2
5) Settling Time, ts: The time required for the process to remain within 2.5% of the steady-
state value. The first time this occurs is called the settling time.
6) Rise Time, tr: Time required to first reach the steady-state value.
For the critically damped system, where |ζ| = 1, the poles of Equation (132) will both be
the same and contain no imaginary component. The system will be stable if the sign of ζτp is
positive and unstable if ζτp is negative. The step response of this system can be written as
t −ζ t τ p
(t ) KM 1 − 1 +
y= e (137)
τp
107
A typical stable, critically damped step response is shown in Figure 35. In general, such a system
looks very similar to a first-order plus deadtime system and is often analysed as such. The biggest
difference is the slightly slower initial response, which is often treated as a time delay.
For the overdamped case, where |ζ| > 1, the poles of Equation (132) will only be real
numbers. This implies that there will be no oscillations in the step response. The system will be
stable if the sign of ζτp is positive and unstable if ζτp is negative. The step response of this system
can be written as 14
−ζ t ζ 2 −1 ζ2 ζ 2 − 1
KM 1 − e p cosh
y (t ) =
τ
t+ sinh t (138)
τp τp
ζ
2
− 1
A typical, stable overdamped step response is shown in Figure 36. In most cases, this system can
be analysed as a first-order-plus-deadtime process. It can be noted that the overdamped case has
the slowest initial response of all second-order and first-order systems. This slow initial response
is often treated as a time delay when fitting a first-order system.
cosh is the hyperbolic cosine function defined as ½(ex + e−x) and sinh is the hyperbolic sine function defined as
14
½(ex – e−x).
108
Figure 36: Step Response of an Overdamped System (ζ = 2, τp = 5, and K = 1)
K K K (1 − τ p2ω 2 − 2ζτ p jω )
=GII ( jω ) = =
τ p2 ( jω ) + 2ζτ p jω + 1 1 − τ pω + 2ζτ p jω (1 − τ p2ω 2 ) + 4ζ 2τ p2ω 2
2 2 2 2
K 2 (1 − τ p2ω 2 ) + K 2 ( −2ζτ pω )
2 2
K
⇒ AR= =
((1 −τ ω ) + 4ζ τ ω )
2
(1 − τ p2ω 2 ) + 4ζ 2τ p2ω 2
2
2 2 2 2 2 2
p p
2ζτ pω
− arctan K > 0, τ pω < 1
1 − τ p2ω 2
2ζτ pω
− arctan − 180° K > 0, τ pω > 1
− K 2ζτ pω 1 − τ p2ω 2
=φ arctan
=
K (1 − τ p2ω 2 ) 2ζτ pω
180° − arctan K < 0, τ pω < 1 (139)
1 − τ p2ω 2
2ζτ pω
− arctan K < 0, τ pω > 1
1 − τ p2ω 2
When dealing with second-order systems, there is a potential that the amplitude ratio can
be greater than the original starting value of |K|. Specifically, this occurs whenever the denominator
of the amplitude ratio is less than 1. Taking the denominator of the amplitude ratio for a second-
order system and solving it gives
109
(1 − τ ω 2 ) + 4ζ 2τ p2ω 2 < 1
2 2
p
Since the frequency is only a positive real number, the term under the square root must also only
be positive (since a negative would give a complex number), that is,
2 − 4ζ 2 ≥ 0
(141)
ζ ≥ 0.5 ≈ 0.707
If the damping coefficient lies within the region given by Equation (141), then there will be a hump
in the Bode plot, as shown in Figure 37 (top). Since these frequencies magnify the system response,
it is important that special care be taken when designing controllers for such systems.
If a lead term has been added to a second-order system, as given by Equation (133), then
the system will display an inverse response if the zeros of the transfer function are positive, for
example, as shown in Figure 38. The Bode plot for this composite system can be obtained by
invoking the rules for combinations of transfer functions, that is,
K (τ L s + 1)
=GII = G G
(τ p s + 2ζτ p s + 1) II L
2 2
K 1 + τ L2ω 2
=AR AR
= II AR L
(1 − τ ω )
2
p
2 2
+ 4ζ 2τ p2ω 2 (142)
2ζτ pω
φ = φII + φL = arctan τ Lω − arctan
1 − τ p2ω 2
(ignoring all angle complications)
An example is shown in Figure 39.
Representative Bode plots are shown in Figure 37 for different combinations of the
parameters. The key properties of the second-order system are summarised in Table 17.
110
Table 17: Basic Information About a Secord-Order System
Property Value
K
Laplace Transform GII =
(τ s + 2ζτ p s + 1)
2 2
p
111
Figure 37: Bode Plots for τp = 5, (top) ζ = 0.5, (middle) ζ = 1, (bottom) ζ = 2; (left) K = 1 and (right) K = −1
112
Figure 38: Step Response of a Second-Order System with Inverse Response (τL = −25, ζ = 5/√7, τp = 10√7 and K = 1)
Figure 39: Bode Plots for (left) τL = −5, (right) τL = 5, and (top) ζ = 0.5 and (bottom) ζ = 2
113
Section 3.3.5.5: Higher-Order Systems
Analysing higher-order systems is based on the results obtained from the analysis of the
simpler systems. The following are some key points to consider for the analysis in the time domain:
1) Poles: The poles of the process transfer function determine the stability of the system.
Table 9 summarises the requirements for stability.
2) Zeros: If the zeros of the continuous-time transfer function are positive, then there will be
an inverse response in the system.
3) Time Constant: If the system is stable, then the largest stable pole in absolute magnitude
can be treated as the dominant time constant of the process.
In the frequency domain, the Bode plots are obtained by combining the appropriate simple transfer
functions, using the rules for composition of the amplitude ratio (multiplication) and phase angle
(addition).
Example 14: Sketching the Expected Time-Domain Response
For the following three transfer functions, sketch the expected time-domain response of the
system when a positive step change is made:
1.54 ( −5s + 1)
1) G1 = e −10 s
( 5s + 1)( 4s + 2 )( 2s + 1)
1.54 ( 5s + 1)
2) G2 =
100s 2 − 200s + 1
1.54
3) G3 =
( −100s + 10s − 1) ( 4s + 1)
2
Solution:
First Transfer Function
For the first transfer function, the gain is 1.54 (by inspection), the zero is 0.2, and the poles
are −0.2 (= −1/5), −0.5 (= −2/4), and −0.5 (= −1/2), and the time delay is 10. Since the zero is
positive, we expect an inverse response, while all poles are negative, which implies that the system
is stable. As well, none of the poles have an imaginary component and so there are no oscillations.
The plot would therefore be as given in Figure 40 (left).
Second Transfer Function
For the second transfer function, the zero is −0.2. Instead of computing the poles directly,
we can note that this is a second-order system. Therefore, writing it into the standard form for a
114
second-order system given by Equation (134), it can be seen that τp = 10 and ζ = −10. Since τpζ < 0,
the system is unstable and without any oscillations (|ζ| > 1). The “gain” is positive, which implies
that the function will go towards +∞. Thus, the plot would be as given in Figure 40 (middle).
Third Transfer Function
For the third transfer function, there are no zeros or time delay. Similar to the second
transfer function, let us rewrite the denominator into the required form to give
1.54 −1 −1.54
=G3 = .
( −100s + 10s − 1) ( 4s + 1) −1
2
(100s − 10s + 1) ( 4s + 1)
2
By comparison, we can see that the second-order term has the following characteristics, τp = 10
and ζ = −0.5. This implies that the poles are unstable and oscillatory. The second term will give a
stable pole (−0.25 = −¼). Therefore, the plot of this transfer function will be given as Figure 40
(right).
Figure 40: Sketch of the Transfer-Function Step Responses: (left) First Transfer Function, (middle) Second Transfer
Function, and (right) Third Transfer Function.
It can be noted that when sketching the transfer function, it is important to only give the general
characteristics, while the exact values can be ignored.
115
Table 18: Graphical Representation of the Different Types of Functions (The ringing cases can only occur in the discrete
domain.)
Stable,
exponential
decay
Stable,
oscillatory
Unstable, pure
oscillatory
Unstable,
integrator
Unstable,
exponential
growth
Unstable,
oscillatory
116
Location of the Poles Unit-Step Response
Case
Continuous Discrete Continuous Discrete
Ringing,
stable
Ringing,
stable
oscillatory
Ringing,
integrator
Ringing,
unstable
Ringing,
unstable,
oscillatory
Deadbeat
response
117
y(t) = eatcos(ωt) (143)
that is sampled with a sampling time of Ts to give a discrete-time system of the form
We will assume that a ∊ ℝ so that values of a ≥ 0 will lead to an unstable system. It can be noted
that the results for sine will be the same mutatis mutandi. Examine the effect of the sampling time
on the resulting discrete-time function and its z-transform.
Solution
The behaviour of the transfer function is determined by the values of its poles, that is, the
roots of the denominator. Using the quadratic formula gives the general form of the poles as
where to simplify notation ψ = eaTs . We can note that ψ will always be positive since the
exponential of any real number is positive.
In order to understand the behaviour of the discrete function, we will need to examine the
determinant of the equation (the part inside the square root) and consider three cases: when the
determinant is greater than zero, exactly zero, and less than zero.
Case 1: Determinant greater than zero
For the determinant to be greater than zero, it follows that
cos 2 (ωTS ) − 1 > 0 ⇒ cos 2 (ωTs ) > 1 (147)
However, the cosine function is never greater than 1. Thus, this situation cannot occur and there
will not be two distinct real roots.
Case 2: Determinant equal to zero
For the determinant to be exactly zero, it follows that
Taking the square root of the right-hand side and noting that there are two solutions gives
118
which occurs when
ωTs = πn
for n ∊ ℤ. If we restrict ourselves to the domain [0, 2π[, we see that we have two solutions: at n =
0 with a value of 1 and n = 1 with a value of −1. In such a case, the double root will be located on
the x-axis at the location of ψ for n even and at the location of −ψ for n odd. When n is odd, the
poles will lie in the left-hand plane of the discrete domain, which implies that we will have ringing
behaviour. Stability will be determined by the value of ψ. However, there will not be any
oscillatory behaviour. The general form of the discrete function is then
yk = ψ k cos ( kπ n ) (150)
When n is odd, the value of cos(kπn) will oscillate between 1 and −1 which will give the
characteristic ringing behaviour.
Case 3: Determinant less than zero
For the determinant to be less than zero, it follows that
In such cases, there will be two imaginary roots that are complements of each other, that is, ψ + γi
and ψ – γi, where γ is equal to ψ 1 − cos 2 (ωTS ) . This implies that there will be a clear oscillatory
behaviour. If we restrict ourselves to the domain [0, 2π[, we can note that cos(ωTs) will be positive
in the region [0, 0.5π[ ∪ ]1.5π, 2π[ and negative in the region ]0.5π, 1.5π[. The function will be
exactly zero at 0.5π and 1.5π. In the positive region, this will place the poles in the right-hand side
of the discrete system, while when negative it will place them in the left-hand side leading to
ringing. When cos(ωTs) is exactly zero, we will have two roots at the origin of the system and we
will have no information about the system. This brings us directly to the constraint given by the
Shannon sampling theorem that the sampling time must be greater than 2/ω.
119
Before considering a formal definition of an automaton, let us examine a simple case and
how it could be modelled as an automaton. Consider a system that consists of only two inputs a
and b. The objective of this system is to determine when the sequence of inputs is baba. In
automaton theory, the acceptable inputs are called the alphabet, while the actual sequence of
inputs is called a word. Thus, in this example, the alphabet is the set {a, b} and the word of interest
is baba. A state is defined as an internal representation of the system and its expected behaviour.
In this example, we can define 5 states: Z0 that represents the initial state, Z1 when we have
received the first b, Z2, when we have received ba, Z3, when we have received bab, and Z4, when
we have received baba. Based on the inputs and current state, a transition function shows how
the system will move to the next state. For example, if we are in state Z0 and receive an a, then
the system will transition to Z0 (remain in the same place), while if a b is received, the system will
transition to Z1. States can be classified as either accepting (also called marked states) or
rejecting. An accepting state is one that has the desired outcome. In this particular example, it
would be state Z4. A rejecting state is one that does not have the desired outcome. In this particular
example, it would be all the other states. When an automaton has finished reading a word, we can
note the final state of the automaton. If it is an accepting state, then we can say that the automaton
accepts the word; otherwise it rejects the word. The set of all words accepted by the automaton is
called the language recognised (or marked) by the automaton.
Mathematically, for a finite-state automaton 𝒜𝒜, we can write this as the quintuple
𝒜𝒜 ≡ (𝕏𝕏, Σ, f, x0, 𝕏𝕏m) (152)
where 𝕏𝕏 is the finite set of states, Σ the finite set of symbols, called the alphabet of the automaton,
x0 ∊ 𝕏𝕏 the initial state, 𝕏𝕏m ⊆ 𝕏𝕏 the set of all accepting states, and f the transition function defined
as
f: 𝕏𝕏×Σ → 𝕏𝕏 (153)
The alphabet represents all possible values that the automaton will recognise. It can consist of
letters, values, or any other acceptable symbol. An automaton generates a language, L, which
simply consists of all possible strings (irrespective of the final state) generated by the automaton.
An automaton is said to recognise (or mark) a specific language Lm.
As well, it is possible to define an output function, g, that determines what the output from
the automaton will be. In general, it is defined as
g: 𝕏𝕏×Σ → Y, (154)
120
that is, the output function depends on the state and inputs. In such cases, this automaton is called
a Mealy Automaton, which is named after George H. Mealy (1927 − 2010). On the other hand,
when the output function, g, is defined as
g: 𝕏𝕏 → Y (155)
that is, the output function only depends on the state, then we have a Moore Automaton, which
is named after Edward F. Moore (1925 – 2003).
It is also possible to provide a graphical representation of an automaton. Figure 41 shows
a typical representation of an automaton. The most important components are:
• Each state is enclosed by a circle and given a specific name.
• The initial state is shown by an arrow pointing to the state and without any additional
markings.
• The transitions between the states are shown with arrows.
• On the arrows, the combination of inputs and outputs that lead to the next state are
shown.
• Accepting states are enclosed by a double circle.
The sending and receiving of symbols for the inputs and outputs is assumed to be
instantaneous. A finite-state automaton must allocate for each input symbol at each time point a
valid transition. Often such a transition can be a self-loop, that is, a transition where the initial and
final states are the same.
Example 16: Automaton for a Process
Consider the previously mentioned process where it was desired to find the word baba.
Draw the automaton for this process and define all the components in the mathematical description
of the automaton.
Solution
The automaton is shown in Figure 42.
121
Figure 42: Automaton for the Example
The mathematical description can be stated as:
𝕏𝕏 = {Z0, Z1, Z2, Z3, Z4}
Σ = {a, b}
x0 = Z0
𝕏𝕏m = {Z4}
The transition function, f, is defined as follows:
f(Z0, a) = Z0 (which is a self-loop)
f(Z0, b) = Z1
f(Z1, a) = Z2
f(Z1, b) = Z1
f(Z2, a) = Z0
f(Z2, b) = Z3
f(Z3, a) = Z4
f(Z3, b) = Z1
f(Z4, a) = Z0
f(Z4, b) = Z1
Note that the transition function should match the arrows drawn in the schematic for the
automaton!
Transitions in an automaton can be spontaneous, that is, we do not know exactly when a
given transition occurs, for example, the transition from filling a tank to full can be spontaneous
(especially, if we do not know the height of the tank). Such a transition is denoted using the symbol
ε on the arrow. Spontaneous transitions often arise when there is incomplete knowledge of the
system. Automata containing spontaneous transitions are said to be nondeterministic, since it is
122
not possible to know in which states the automaton currently is. Another form of nondeterminism
is the presence of multiple transitions with the same input, for example, two transitions from a
given state with the input a leading to two different states. In such cases, it is likewise impossible
to know in which state the automaton is in. In all other cases, the automaton is said to be
deterministic since it is possible to precisely determine the next state given all past information.
The states in an automaton can be classified as follows:
1) Periodic States: Periodic states are a set of states between which the automaton can
oscillate. Normally, one takes the largest set of states between which the automaton can
oscillate.
2) Ergodic States: Ergodic states are those states once reached the automaton cannot leave.
3) Transient States: All states that are not ergodic are called transient states.
123
Figure 43: Automaton
Solution
Looking at Figure 43, state Z3 is an ergodic state which is not accepting. Therefore,
deadlock will occur in this state. Thus, the system is blocking. State Z3 is a deadlock. States Z5
and Z6 form a periodic set from which there is no escape. However, neither state is accepting.
Therefore, livelock will occur for these two states.
It is possible to manipulate automata. The following are some common manipulations and
their definitions:
1) Accessible Operator (Acc): This removes all unreachable states and their associated
transitions. This operation is necessary when performing more advanced manipulations on
automata to clean up the resulting automaton. This operation will not change the generated
or recognised languages. A state is defined as being unreachable if there exists no path
from the initial state to the given state.
2) Co-accessible Operator (CoAc): This removes any states and their associated transitions
from which one cannot end up in an accepting state. An automaton where A = CoAc(A) is
called a co-accessible automaton and is never blocking. This operation can change the
generated language but not the recognised language.
3) Trim Operator (Trim): This operation creates an automaton that is both co-accessible and
accessible. The order of operation is immaterial, that is, Trim(A) = CoAc(Acc(A)) =
Acc(CoAc(A)).
Example 18: Trimming an Automaton
Apply the trim operation to the automaton shown in Figure 43.
Solution
124
Quickly looking at the automaton in Figure 43, we that there are no states that cannot be
accessed from the initial state. Thus, we need to consider the co-accessible operator. Here, we see
that we need to remove states Z5, Z6, and Z3 since we know that they are blocking. However, by
removing Z3, we now make Z2 blocking. Therefore, we must also remove it. In general, this
process is iterative and continues until we have removed all states or there are no more states to
remove. The final automation in shown in Figure 44.
( ( )
G1 × G2 ≡ Acc 1 × 2 , Σ1 ∪ Σ 2 , f , x01 , x02 , m1 × m2 ) (156) 15
where
( f ( x , e ) , f ( x , e ) ) if e is a valid input at the given point
f ( ( x , x ) , e ) ≡
1 2
1 1 2 2
(157)
undefined otherwise
15
Note that the event set here is defined as the union of both event sets, since we may wish to keep track of all the
events in future cases.
125
In product composition, the transitions of the two automata are always synchronised on a common
event. This implies that a transition occurs only if the input is a valid input for both automata. The
states of G1 × G2 are given as the pair (x1, x2), where x1 is the current state of G1 and x2 is the
current state of G2. It follows from the definition of product composition that
L ( G1 × G2 )= L ( G1 ) ∩ L ( G2 )
(158)
Lm ( G1 × G2=
) Lm ( G1 ) ∩ Lm ( G2 )
Product composition has the following properties:
1) It is commutative up to a re-ordering of the state components in the composed states.
2) It is associative. This implies that G1×G2×G3 ≡ (G1×G2)×G3 = G1×(G2×G3).
Example 19: Product of Two Automata
Consider the automata shown in Figure 45 and Figure 46. Determine the product of these
two automata.
Figure 45: G1
Figure 46: G2
Solution
Before we can start with drawing the final automaton, it makes sense to first consider which
inputs are valid for the final automaton. From Figure 45, it can be seen that, for G1, the inputs are
{a, b, g}. Similarly, from Figure 46, it can be seen that, for G2, the inputs are {a, b}. Therefore,
the common set is {a, b}.
126
When drawing the final automaton, it helps to start from the initial states of both and work
through all the possible transitions and draw the next state. Thus, starting from (x, 0), with an input
of a, G1 remains in state x, but G2 goes to state 1. Therefore, the new state in the product automaton
will be (x, 1). This is the only valid transition since from (x, 0), an input of b is not valid for G1.
An input must be valid for both automata for it to occur in the product. Note that g will not occur
since it is not a common input. We will then continue in the same fashion by looking at the possible
states and how the inputs would affect them. A state will be marked if all the states in the original
automaton are marked. The final automaton is shown in Figure 47.
As can be seen, product composition is relatively restrictive in that a given input must be
valid for both automata. One way to relax this constraint is to consider parallel composition. In
parallel composition, the inputs are split into two parts: common inputs and private inputs. A
private input only pertains to a given automaton, while common inputs are shared with other
automata. Formally, the parallel composition of two automata G1 and G2, denoted as G1 || G2, is
defined as
( ( )
G1 || G2 ≡ Acc 1 × 2 , Σ1 ∪ Σ 2 , f , x01 , x02 , m1 × m2 ) (159)
where
( f1 ( x1 , e ) , f 2 ( x2 , e ) ) if e is a valid common input for both automata
( f1 ( x1 , e ) , x2 ) if e is a private event to G1
f ( ( x1 , x2 ) , e ) ≡ (160)
( x1 , f 2 ( x2 , e ) ) if e is a private event to G2
undefined otherwise
Note that the only difference between parallel and product composition is how the transition
function is defined.
Product composition has the following properties:
1) It is commutative up to a re-ordering of the state components in the composed states.
2) It is associative. This implies that G1 || G2 || G3 ≡ (G1 || G2) || G3 = G1 || (G2 || G3).
127
Example 20: Parallel Composition of Two Automata
Consider the same two automata as for Example 19. Determine the parallel composition of
these two automata.
Solution
The general procedure for solving such a problem is similar to that of the product
composition. First, we need to determine which inputs belong to which categories. Since input g
only affects G1, it is a private input for G1. The other two inputs {a, b} are the common inputs to
both automata.
Again, we start with the initial states of both automata and work our way through. From
the initial state of (x, 0), we have two valid inputs (the common input a and the private input g).
The common input a will bring us as before to the state (x, 1), while the private input g will bring
us to the state (z, 0). In the state (z, 0), there are three valid inputs (the common events a and b as
well as the private input g). Input a will bring us to state (x, 1), while input b will be a self-loop.
Private input g, which only affects G1, will bring us to state (y, 0). The final automaton is shown
in Figure 48.
128
Figure 49, we see that the process can remain in state Z0 until c = 240 s, at which point it must
leave the state. The implies that a time automaton has an infinite number of possible realisations,
since the system can switch states at any point between 180 and 240 s. Thus, a timed automaton
has an infinite state space.
129
In certain formalisms, transitions can be specified as either urgent or nonurgent. Urgent
transitions will always be taken as soon as possible, while nonurgent transitions can wait. Normally,
spontaneous transitions are assumed to be nonurgent.
130
1) A process satisfying the principles of superposition and homogeneity is said to be linear.
2) In a time-variant model, the parameters themselves vary with respect to time.
3) In a lumped-parameter model, there are space derivatives.
4) A noncausal system depends on future values.
5) A system with memory only cares about the current value of the process.
6) A state-space representation provides a model linking states, inputs, and outputs.
7) A transfer function can only be written for linear processes.
8) Every transfer function has a unique state-space representation.
9) Prediction-error models are discrete-time models of the process.
10) A white-noise signal depends on past values of the noise.
11) In a Box-Jenkins model, the order of the A-polynomial is fixed to zero.
12) In an autoregressive exogenous model, only the orders of the C- and D-polynomials are
zero.
13) It is not possible to convert a continuous model into a discrete model.
14) A process at steady state will experience wild, unpredictable swings in values.
15) The gain of a process represents the transient behaviour of the process.
16) The process time constant represents the delay before a process responds.
17) A continuous transfer function with poles of −2, −1, and 0 is stable.
18) A continuous transfer function with poles of 1, 2, and 5 is stable.
19) A discrete transfer function with poles of 0.5, −0.5, and 1 is unstable.
20) A discrete transfer function with poles of 0.25, 0.36, 0.25±0.5i is stable.
21) A continuous state-space model with eigenvalues of 0.25±2i is stable.
22) A discrete state-space model with eigenvalues of ±0.25i is stable.
23) The alphabet of an automaton represents the allowed inputs into the process.
24) An accepting state is a state that has the desired outcome.
25) The language recognised by an automaton is the set of all words accepted by the automaton.
26) In a Mealy automaton, the output function depends only on the states.
27) Blocking occurs when an automaton cannot reach an accepting state.
28) We denote spontaneous transitions by ε.
29) An automaton with spontaneous transitions is called a deterministic automaton.
131
30) The co-accessible operator removes all states and their associated transitions that are
unreachable from the initial state.
31) In a timed automaton, a guard determines the maximal time in which we can remain in a
given state.
32) For a timed automaton, δ ≡ (c ≤ 1.000) is an acceptable time constraint.
33) For a timed automation, δ ≡ (c = 'abcd') is an acceptable time constraint.
34) There is no escape from an ergodic set.
a. yk +1 =4 yk + 7uk +5 − 5ek .
∂ 2T ∂T
b. 2
= −α ( t ) , where α is a parameter that depends on time.
∂x ∂t
c. −4 yk − 3ek
yk +1 =
d. ∂T =
−α ( t ) u ( t + 1) , where α is a parameter that depends on time.
∂t
36) For the following continuous-time transfer functions, determine their stability. For the
stable transfer functions, determine the gain, time constant, and time delay.
5 ( s + 1)
a. G ( s ) = 3 2
e−3s
6s + 11s + 6s + 1
−5
b. G ( s ) = e −10 s
150 s + 65s 2 + 2 s − 1
3
4.5
c. G ( s ) = 2
e −10 s
15s + 8s + 1
4.5
d. G ( s ) = 2
e −7 s
15s + 26 s + 7
132
37) For the following continuous-time state-space models, determine their stability. Convert
the models to a transfer function. For the stable models, determine their gain and time
constant.
dx 5 0 2
= x + u
dt 0 −2 1
a.
1 0
y= x
0 1
dx −5 0 −2
= x + u
dt 0 −2 1
b.
2 0
y= x
0 1
−2 1 2 1
dx
= 0 −3 2 x + −0.5 u
dt
0 0 −1 2
c.
2 0 0
=y 0 −1 0 x
0 0 1
a. yk +1 =4 yk + 7uk +5 − 5ek
z −5
b. yk +1 = uk
1 − 4 z −1
z5 + z 4
c. yk +1 = 6 uk
z + z 5 + z 4 + z 3 + z 2 + z1 + 1
−0.5 1 2 1
= xk +1 0 0.5 2 xk + −0.5 uk
0 0 0.25 2
d.
2 0 0
= yk 0 −1 0 xk
0 0 1
133
−1.5 0 0 −1
= xk +1 3
1.5 0 xk + 0.5 uk
1 2 2.25 3
e.
1 0 0
yk = 0 1 0 xk
0 0 1
39) What is the relationship between the eigenvalues of the state-space model and the time
constant (as determined from the transfer function)?
40) Derive the compact state-space representations for addition (given by Equation (71)),
multiplication (given by Equation (72)), the inverse (given by Equation (73)), and the
transpose (given by Equation (74)).
41) For the automata shown in Figure 50, classify the states into marked, ergodic, periodic, and
transient. Determine if there is blocking. If present, give the type of blocking encountered.
134
Figure 50: Automata for Questions 41 and 42
135
Figure 51: Automata for Question 42
136
Chapter 4: Schematic Representation of a
Process
This section will describe the most common schematic methods for representing a process,
including block diagrams, piping-and-instrumentation diagrams (P&IDs), process-flow
diagrams (PFDs), and electrical and logic circuit diagrams.
Another common block is the summation block, which shows how two or more signals
are to be combined. Figure 53 shows a typical summation block. The signs inside the circle show
whether the signal coming in should be added or subtracted. Given the common nature of a
summation block, two simplifications can be made. Rather than using a full circle, the signals are
simply shown to connect and the signs are shown beside each signal. This is shown in the bottom
part of Figure 53. A further simplification is to completely ignore any positive signs and only give
the negative signs beside the appropriate signals. A commonly used standard is to place the
summation signs on the left-hand side of the arrow.
16
Often, it will also be used for a time-domain representation by ignoring the composition and summation rules and
using slightly different models. In such cases, they are better called process-flow diagrams, which are described in
Section 4.2.
137
Figure 53: Summation Block: (top) Full Form and (bottom) Short-Hand Equivalent
One of the most useful features of block diagrams is the ability to easily compute the
relationship between the different signals. For the basic block shown in Figure 52, the relationship
between the input and output can be written as:
Y = GU (164)
while for the summation block, it can be written as
Y = U1 – U2 (165)
Now, consider the process shown in Figure 54, where it is desired to determine the relationship
between Y and U, where there are three blocks in series. The naïve approach would be to denote
each of the outputs from the two intermediate steps as Y1 and Y2 and then to write the relationships
between each of these variables to obtain the final result, that is,
Y1 = G1U (166)
Y2 = G2Y1 = G2G1U (167)
Y = G3Y2 = G3G2G1U (168)
This shows that the final relationship can be written as Y = G3G2G1U. The easier approach is to
note that since these process blocks are in series, the process models can be multiplied together to
give the desired result (as the final result shows). However, the naïve approach is very useful if
the system is very complex with many different summation blocks and functions.
Figure 54: Block-Diagram Algebra: In order to relate U and Y, the transfer functions between the two points need to be
multiplied, thus, Y = G3G2G1U.
138
Example 21: Complex Block Diagrams
Consider the closed-loop system shown in Figure 55 and derive the expression for the
relationship between R and Y. Assume that all signals are in the frequency domain.
Solution:
Starting from the desired signal R and moving towards Y, the following relationships can
be written
ε = R − GmY
U = Gcε
Y = GpGaU + GdD
Substituting the first relationships into the second and then the combination into the third gives
Y = Gp GaGc(R − GmY) + GdD
Re-arranging this equation gives
Y = Gp GaGcR − Gp GaGcGmY + GdD
Solving this equation for Y gives
G p Ga Gc Gd
=Y R + D
1 + G p Ga Gc Gm 1 + G p Ga Gc Gm
Since we are only interested in the relationship between Y and R, we can set D = 0 to get
G p Ga Gc
Y= R
1 + G p Ga Gc Gm
139
The creation of block diagram for a given process can be quite a complex task, but it is
worthwhile as it allows the essential features of the system to be abstracted out and understood.
140
Section 4.3: Piping-and-Instrumentation Diagrams (P&ID)
The piping-and-instrumentation diagram (P&ID) is a detailed description of the process,
where all connections and components are shown. A P&ID contains, in addition to the information
found in a process flow diagram, the following information:
1) Type and identification number for all components;
2) Piping, fittings with nominal diameters, pressure stages, and materials;
3) Drives; and
4) All measurement and control devices.
Figure 57 shows a typical P&ID for part of a chemical plant.
Figure 57: P&ID for a Gas-Chilling-and-Separation Plant According to Canadian Design Standards (Note the engineering stamp
in the bottom middle box.)
17
The older German standard DIN 19227 matches closely the ISA or North American standard. Differences include
how the different sensors or functions are denoted and minor details regarding the proper location for various pieces
of additional information. This book will follow the new standard without necessarily making any comments about
the other possibilities in order to avoid confusion.
141
Table 19: Component Symbols for P&IDs According to the DIN EN 62424 Standard
Jacketed pipe
Horizontal pressurised
Axial fan
vessel
Gas bottle
Fluid-contacting column
Pump
Furnace
Vacuum pump or
compressor Cooling tower
142
Symbol Name Symbol Name
Valve
Fixed straight-tube heat
exchanger
Control valve
U-shaped-tube heat
exchanger
Manual valve
Finned-tube heat
exchanger with axial fan
Back draft damper
143
Symbol Name Symbol Name
Butterfly valve
Spring safety valve
Diaphragm valve
Symbol Name
Pipe (process flow)
Pneumatic signal
Electrical signal
Hydraulic signal
Electromagnetic Signal
144
Location Local/in the field In a central location In a local, central point
PI PI PI
Symbol 123.4 123.4 123.4
There are many different fields in the equipment label. These are shown in Figure 58. The
left fields (#1 to 3) are only used if needed and there are no restrictions on what can be placed
there. Field #1 often gives the supplier, while Field #2 gives the standard value of the component.
The two central fields (#4 and 5) show the important information about the component. Field #4
shows the PCE category 18 and the PCE processing category (see Table 23 for additional
information). Field #5 shows the PCE tag that is arbitrary. The right fields (#6 to 12) show
additional information about the component. For example, Fields #6 to #8 show alarms and
notifications related to upper limits, while Fields #10 to 12 contain alarms and notifications related
to lower limits. The fields located furthest from the center contain the most important information.
Field #9 shows the importance of the component. A triangle (▲) shows a safety-relevant
component, while a circle (●) shows a component required for the good manufacturing process
(GMP). A square (■) shows a quality-relevant component.
18
PCE is an abbreviation for process-control engineering.
145
Figure 58: Fields in a P&ID Label
Table 23 shows the PCE categories, while Table 24 shows the PCE processing functions.
For motorised drives (PCE category N), there are only two possibilities for the processing function:
S, which implies an on/off motor, and C, which implies motor control. For valves (PCE category
Y), there are also limitations: S implies an on/off valve, C implies a control valve, Z implies an
on/off valve with safety relevance, and IC implies a control valve with a continuous position
indicator. For process-control functions, there are some very specific rules:
1) The PCE category is always the same U.
2) The following letters are often A, C, D, F, Q, S, Y, or Z. Combinations of these letters are
also possible.
Letter Meaning
A Analysis
B Burner Combustion
C 19 Conductivity
D Density
E Voltage
F Flow
19
Officially, this is a free variable to be set as needed. Practically, it is often used for conductivity.
146
Letter Meaning
G Gap
H Hand
I Current
J Power
K Time Schedule
L Level
M Moisture
N Motor
O Free
P Pressure
Q Quantity/Event
R Radiation
S Speed, Frequency
T Temperature
U anticipated for PCE control functions
V Vibration
W Weight
X Free
Y Valve
Z Free
Table 24: PCE Processing Categories
147
Example 22: P&ID Tags
What is the meaning of the following P&ID tags: PI-512, UZ-512 und MDI-512?
Solution
For PI-512, the first letter is “P”. From Table 23, we can see that “P” represents pressure.
The following letter is “I”. From Table 24, we can see that “I” represents indicator. Thus, “PI-512”
represents a pressure indicator.
For UZ-512, the first letter is “U”. From Table 23, we can see that “U” represents a process-
control function. The following letter is “Z”. From Table 24, we can see that “Z” represents a
safety-critical control function. Thus, “UZ-512” represents a safety-critical control function that is
computed using a computer/PLC.
For MDI-512, the first letter is “M”. From Table 23, we can see that “M” represents
moisture. The following letters are “DI”. From Table 24, we can see that “D” represents difference
and “I” represents indicator. Thus, “MDI-512” represents a moisture difference indicator.
The labels for the other fields are not standardised. However, in a P&ID, the same label
should be used for the same component/idea. All P&IDs require a legend, where all the
components are briefly described, including such information as their name, engineering data (size,
material), and operating conditions. Appropriate stamps and signatures may need to be affixed
depending on local laws, for example, in Canada, all engineering documents require a stamp and
signature from a practising engineer.
148
Furthermore, when it comes to showing connections, for example, the splitting of a wire,
different formats are possible. The recommended approach is to use T-junctions to show a split (as
shown by Figure 59a)). However, often, the split will be shown as in Figure 59b. A simple crossing
of wires is shown by Figure 59c.
Resistor
Inductor
Direct-Current
Essentially a battery
Voltage Source
Alternating-
Current Voltage
Source
Diode
Capacitor
AND Gate
OR Gate
Inverter
NAND Gate
149
Item DIN-60617 Symbol ANSI Symbol Comments
NOR Gate
XOR Gate
Ground
The arrow is placed
over the element that
is variable, for
Variable
example, a variable
resistor:
Negation is placed
where the signal
enters or leaves a
General Negation
block (see, for
example, the NAND
or NOR gates above).
Figure 59: Connections: a) Recommended Form for Contact; b) Commonly Encountered Form for Contact; and c) No Contact
150
Section 4.6: Chapter Problems
Problems at the end of the chapter consist of three different types: (a) Basic Concepts (True/False),
which seek to test the reader’s comprehension of the key concepts in the chapter; (b) Short
Exercises, which seek to test the reader’s ability to compute the required parameters for a simple
data set using simple or no technological aids; and (c) Computational Exercises, which require
not only a solid comprehension of the basic material, but also the use of appropriate software.
151
Figure 60: Block Diagrams for Question 11
12) Draw the process-flow diagrams for the following process descriptions. Hint: Knowledge
of chemical engineering and the physical behaviour of systems is required.
a. The DEA solution enters the treatment unit via a throttle valve and is heated in three
consecutive heat exchangers. The heated solution enters the first evaporation
column which is operated under vacuum at 80 kPa and a temperature of 150°C.
Most of the water is evaporated here. The water vapour is used in the first heat
exchanger to heat the incoming solution. The concentrated DEA solution is
transferred from the first evaporator to a second evaporation column via a second
throttle valve, so that the pressure can be lowered to 10 kPa. The second
evaporation column is a thin film evaporator (similarly built to a scraped-wall heat
exchanger), which is heated by high-pressure steam. Here, most of the DEA is
evaporated. The remaining slurry is removed from the column by a positive
displacement pump. The DEA vapour is used to heat the feed in the second heat
exchanger. The third heat exchanger in the feed line is heated by medium pressure
steam to achieve sufficient evaporation in the first evaporation column. After
exchanging heat with the feed stream, the water vapour and DEA vapour streams
are completely liquefied in two condensers operated with cooling water, before
being pumped to a T-junction and returned to the gas scrubbing process.
152
b. A concentrated solution of 99% triethylene glycol (C6H14O4) and 1% water is
commonly used to absorb moisture from natural gas at 4.1 MPa. Natural gas is
mainly methane, with smaller amounts of ethane, propane, carbon dioxide, and
nitrogen. The water-saturated natural gas is contacted with the triethylene glycol at
40°C in a trayed absorber column to remove the water. The dried gas is then ready
for piping to market. The triethylene-glycol solution leaving the absorber column
is diluted by water, and must be regenerated for re-use. It first passes through a
flash drum at a pressure of 110 kPa to release dissolved gases. Then, it is heated in
a heat exchanger with the hot regenerated glycol. The dilute solution then enters
the top of a packed regeneration column. As it flows downward over the packing,
it passes steam flowing upwards which evaporates water from the glycol solution.
The reboiler at the bottom of the regeneration column uses medium-pressure steam
to heat the triethylene glycol solution to 200°C to generate the vapour that passes
up the column. At the top of the column, the vapour (i.e. the water evaporated from
the triethylene-glycol solution) is vented to the atmosphere. The hot regenerated
solution from the bottom of the regenerator column is cooled in a heat exchanger
with the dilute solution from the absorber. It is then pumped through an air cooler
and then back to the absorber column at approximately 45°C.
13) Using the sketch of the process-flow diagram in Figure 61 and the process description
below, provide a properly formatted process-flow diagram that includes all the required
components and information. The process description is as follows. Ethyl chloride
(C2H5Cl) is produced in a continuous, stirred tank reactor (CSTR) filled with a slurry of
catalyst suspended in liquid ethyl chloride. Most of the heat of reaction is absorbed by
vaporising 25 kmol/hr of the liquid ethyl chloride. This vapour leaves the reactor with the
product stream. The reactor is jacketed to allow additional temperature control if required.
All of the ethyl chloride in the product stream is condensed and enough ethyl chloride is
returned to the reactor to maintain steady state. The waste gas is sent to the flare system.
153
Figure 61: Sketch of the Process-Flow Diagram for Question 13
14) Evaluate the P&IDs shown in Figure 62. Have they been corrected drawn? Is there anything
that is missing? Are all the streams correctly shown?
15) Given the P&ID in Figure 63, determine where the controller is located and what signals it
requires.
154
Figure 63: P&ID for Question 15
16) For the process shown in Figure 64, answer the following questions:
a. What kind of alarm does the controller provide?
b. How is the level measured? What kind of signal is produced?
c. What kind of valve is used to control the level?
d. What do the double lines for item LI-135 mean?
155
Figure 64: P&ID for Question 16
17) Imagine that you producing maple syrup. The P&ID along with the current values is shown
in Figure 65. Determine if there are any measurement errors.
156
Figure 65: P&ID for the Production of Maple Syrup for Question 17
157
Chapter 5: Control and Automation
Strategies
Having looked at the different instruments that can be used for automation and how to
describe the process and its interconnections, it is now necessary to see how the desired automation
can actually be implemented. The control or automation strategy is the method used to
control/automate the process to achieve the desired objectives. Although two different words can
be used here, the overall concepts are very similar: produce a system that can operate on its own
with minimal human interference. Depending on the field and even industry, one of these two
words may be more common.
There exist many different ways to classify the different types of strategies that can be
implemented. Often, in practice, these strategies can be combined to produce a final overall control
strategy. The following are the most common types of control strategies:
1) Open-Loop Control (or steering, servoresponse): In open-loop control, the desired
trajectory is set and implemented. The object follows this trajectory without taking into
consideration any variations in the environment or surroundings. Clearly, if there are any
changes in the environment, the object may not achieve its trajectory.
2) Closed-Loop Control (or regulation, regulatory response): In closed-loop control, the
actual value of the system is always compared against the setpoint value. Any deviations
are then corrected using a controller. This allows for the system to make corrections based
on imperfections in the original specifications, changes in the environment, or unexpected
events. In most control strategies, some aspect of closed-loop control will be implemented.
3) Feedforward Control: In feedforward control, known disturbances are measured and
corrective action is taken so that the disturbance does not affect the plant. This is a way of
taking into consideration future information about the process and taking action now.
4) Discrete-Event Control: In discrete-event control, control only occurs, when some logic
condition is triggered. This is often used in safety-relevant systems to trigger immediate
action or raise an alarm, for example, if the pressure is above a certain threshold, then the
pressure release valve should be opened. Often, such systems are modelled using automata.
158
5) Supervisory Control: In supervisory control, the control loop does not control a process,
but it controls another control loop. Supervisory control loops are common in complex
industrial systems, where there may be multiple objectives and variables to control.
In principle, if we are given a mathematical function that converts u(t) into y(t), more
commonly called a plant model and denoted by Gp, then using the inverse of this model as the
controller will allow us to attain the goal of making y(t) = r(t). However, in practice, the following
issues arise:
1. Unrealisability of the Model Inverse: Due to time delays and unstable zeros of the process,
it may not be possible to obtain a realisable inverse model.
2. Plant-Model Mismatch: It is very likely that the mode for Gp is not exact, which implies
that the incorrect parameters are given to the controller leading to incorrect results.
159
3. Disturbances: In reality, there will be disturbances that prevent y(t) from reaching the
value specified by r(t). One solution to this problem is to implement feedforward control
that measures the disturbance and takes corrective action. However, this only solves the
problem if the disturbance variable can be measured.
Example 23: Temperature Control: Open-Loop Control
160
reference signal and the actual output is used as the input into the controller. The controller error,
ε(t), is defined as the difference between the setpoint and the measured output. This error is then
the input into the controller. In order to emphasise that the output must be measurable in order for
closed-loop control to occur, the sensor transfer function, Gm, is explicitly shown. Similarly, to
emphasise the importance of the actuator, its transfer function is also explicitly included as Ga. In
most applications, it will be assumed that Gm and Ga have a minimal effect on the overall system,
and hence, they will be ignored.
161
Figure 69: Closed-Loop Control of the Temperature in the House
Furthermore, other disturbances may occur that are not easily measured, but whose effect
can be controlled by the closed-loop controller. Figure 69 shows people in the room, an open
window, and direct sunlight. Since these will influence the room temperature, their effect will be
noticed by the room temperature sensor that will cause the controller to make appropriate changes
to maintain the temperature at its desired value.
In closed-loop control, the following are the key ideas to consider (Seborg, Edgar,
Mellichamp, & Doyle, 2011):
1) The closed-loop system should be stable; otherwise, the system is worse than before.
2) The effect of disturbances should be minimised.
3) The controller should provide quick and effective change between different setpoints, that
is, setpoint tracking should be good.
4) There should not be any bias, that is, the output should reach the desired value.
5) Large actuator values should be minimised.
6) The controller should be robust, that is, small changes in the process characteristics should
not make the overall system unstable.
162
When designing a closed-loop control strategy, there are two common approaches to take:
1) State Feedback, where it is assumed that the controller is a constant K and all the states
are measurable and available, that is, yt = xt. The control law is given as ut = −Kxt.
2) Proportional, Integral, and Derivative (PID) Control, where the control law can be
written as
1
U ( s )= K c 1 + +τ Ds ε ( s) (169)
τIs
where Kc, τI, and τD are parameters to be determined. There exist different forms of the PID
control law depending on the industry, era, and implementation. It is common to drop the
D term, that is, set τD = 0, to give a PI controller.
In addition to these common methods, there also exist various nonlinear approaches that can be
applied to improve overall control, such as deadbanding or squared-error control.
163
It is possible to design different types of observers, depending on the intended application.
The most common observer is the Luenberger observer which seeks to minimise the error
between the predicted and actual states. Assume that the Luenberger observer can be written as
(
)
xˆ = xˆ + y − yˆ + u
(170)
=yˆ xˆ + u
where ℒ, the observer gain, is an appropriately sized matrix that needs to be designed and ◌̂
represents an estimated value. Rewriting Equation (170) gives
xˆ = ( − ) xˆ + y + ( − ) u
(171)
=yˆ xˆ + u
Let the error be defined as
e= x − xˆ (172)
Taking the derivative (or difference) of Equation (172) gives
e= x − xˆ (173)
Substituting Equations (30) and (171) into Equation (173) gives
e = x + u − ( − ) xˆ − ( x + u ) − ( − ) u (174)
= ( − ) e
From Equation (174), it can be seen that for the error to reach zero 𝒜𝒜 – ℒ𝒞𝒞 must be stable, that is,
the eigenvalues of 𝒜𝒜 – ℒ𝒞𝒞 must be located so as to make the process stable. 20
Now that we can estimate the state values, it makes sense to design a state controller.
Assume that the state controller law can be written as 21
u = −xˆ (175)
Before examining the general case, let us consider the situation, where perfect information can be
obtained about the states and there is no need to design an observer, that is, 𝒞𝒞 = ℐ, which implies
that y = x . In this situation, we can use the basic state-space equations, given by Equation (30),
to describe the system. Substituting Equation (175) into Equation (30) and re-arranging gives
20
Continuous domain: Re(λ) < 0; discrete domain: ||λ|| < 1
21
Often, the estimated state is replaced by the true state value. As it will be shown, this makes sense in many cases
since we have full information about the states by actually measuring them.
164
x =− ( ) x
x ( x ) =−
(176)
=y x + u
Thus, it can be seen that the stability of the controlled (overall, closed-loop) system is determined
by the location of the eigenvalues of the 𝒜𝒜 – ℬ𝒦𝒦 matrix.
Now consider the case, where we do not have full information about the process. In this
case, we will need to consider two different equations: the observer equation and the true state-
space model. Substituting the control law given by Equation (175) into the observer equation,
Equation (171), gives
xˆ = ( − − + ) xˆ + y
(177)
=yˆ xˆ − xˆ
The fact that both the ℒ- and 𝒦𝒦-matrices are present in this equation raises the question if the
controller and observer must be designed simultaneously or could they be designed separately.
In fact, the linear, state-space law presented here coupled with the linear observer are fully
separable and stability will be assured if both components are stable. In order to show this, rewrite
the controller law as
u=− ( x − e ) (178)
Now, combining this equation with the error equation, given as Equation (174), into a single
equation, we can see that the combined system consisting of the states and errors can be written as
x − x
= (180)
e 0 − e
Since the combined system matrix is triangular, the eigenvalues can be obtained by considering
the eigenvalues of the diagonal elements, that is, the eigenvalues of the 𝒜𝒜 – ℬ𝒦𝒦 and 𝒜𝒜 – ℒ𝒦𝒦
matrices. Furthermore, since neither of the two matrices interact with each other, it can be
concluded that both can be designed separately and then combined. As long as each is stable, then
the overall system will also be. This result is called the separation principle and is a very powerful
result in designing state-feedback systems.
165
Section 5.1.2.2: Proportional, Integral, and Derivative (PID) Control
Another class of common controllers is the proportional, integral, and derivative (PID)
controllers. This class of controllers provides effective control for many industrial processes and
can be configured to deal with a wide range of different situations. The general form of the PID
controller can be written as
1
Gc = K c 1 + +τ Ds (181)
τIs
where Kc is the proportional term or controller (proportional) gain, τI is the integral term or
the integral time constant in units of time, and τD is the derivative term or the derivative time
constant in units of time. Another common representation is given as
1
Gc =K c + K I + KDs (182)
s
where KI is the integral gain and KD is the derivative gain. In many industrial plants, it is possible
to find the terms reset for integral and rate for derivative, for example, τI would be called the reset
time constant.
In industry, different combinations of this controller can be found including the rather
common proportional and integral controller (PI), where τD = KD = 0, that is, the D-term is ignored.
In order to understand the behaviour of this controller, each of the three terms (P, I, and D) will be
investigated separately. As well, the two common configurations (PI and PID) will be considered
in greater detail.
166
where Rs is the setpoint which gives a step change of Mr and Kp is the process gain. It is assumed
that the overall closed-loop transfer function is stable. From Equation (183), it can be seen that the
steady-state value for the closed-loop transfer function is not Mr. This implies that the final value
will not be equal to the setpoint. For this reason, pure P-controllers are rarely used.
Example 25: Investigation of the Proportional Term on Stability and Performance
Consider the following first-order system
1.5
Gp = e −10 s (184)
20 s + 1
controlled with a proportional controller Gc = Kc. Setting Kc equal to −0.25, 0, 0.5, 1.0, and 2.0,
show how the closed-loop response to a step change of two in the setpoint changes.
Solution:
Figure 71 shows the results for changing the Kc. It can be seen that for none of the cases is
the setpoint attained. There is offset for all of the cases. Furthermore, for Kc = 0, the process
remains at zero, since no control is being implemented. As Kc increases, the amount of oscillation
and length of time required to attain a steady-state value increase. In fact, if Kc is increased further,
the process will become unstable. Similarly, for Kc < 0, the process is initially stable. However,
increasing the value will rapidly make the system unstable.
167
Section 5.1.2.2.b: Integral Term
The integral term, τI, provides a measure of additional stability to the system as well as
removing any bias present. It represents the contribution of past errors on the current controller
action. In general, the integral term is always combined with a proportional term to give the
proportional and integral controller. Furthermore, a controller containing only the integral term
will have no bias or offset, that is,
1
s G
sGc G p τIs p Mr M rGp
lim = Rs lim = lim = Mr (185)
s →0 1 + G G s →0 1 s s →0 τ s + G
c p 1+ G I p
τIs p
where Rs is the setpoint which makes a step change of Mr. It is assumed that the overall closed-
loop transfer function is stable. From Equation (185), it can be seen that the closed-loop gain is
exactly equal to the step change in the setpoint, which implies that there will be no bias or offset.
Since the integral term represents the effect of past errors on the current controller action,
it is possible that in a real implementation, integral (reset) wind-up can occur. This occurs when
the controller output is above the physical limit of the actuator. Since the controller does not have
a way of knowing that the physical limit has been reached, it continues to increase the desired
controller output as the error keeps on increasing. This makes the integral term very large. When
there is a need to now decrease this value, the controller decreases the output value from its large,
unphysical value until it goes below the upper limit. The time delay between when the actuator
should have started to respond and when it is observed to be responding is called integral wind-up.
This is shown in Figure 72, where it can be seen that at 100 min, when the setpoint is changed, it
takes the process another 20 min before it even starts changing, since the true actuator value
remains saturated at its upper limit. Integral wind-up can be avoided by including the physical
limits of the actuator in the controller, that is, by making values beyond the physical limits of the
actuator equal to the physical limit.
168
Figure 72: Integral Wind-Up
169
Figure 73: Effect of Changing τI for an I-Controller
where Rs is the setpoint which makes a step change of Mr. It is assumed that the overall closed-
loop transfer function is stable. From Equation (187), it can be seen that irrespective of the change
in the setpoint, the system will return to zero, which implies that the derivative term cannot track
the setpoint. Therefore, the main role of the derivative term is for disturbance rejection, since in
that case, it is desired that the system return to the same initial value.
Furthermore, the derivative term as written cannot be physically realised, since the
numerator is greater than the denominator. In order to avoid this problem, it is common to rewrite
the derivative term into the following form:
N (188)
Gc , real = τ D
N
1 +
s
170
where N is a filter parameter to be selected. It can be noted that as N → ∞, this form will become
equal to the original version.
Using a derivative term introduces two potential problems into the control strategy: jitter
and derivative kick. Jitter occurs when the error signal fluctuates greatly about some mean value
causing the estimated value of the future error to also fluctuate greatly. This in turn causes
unnecessary fluctuations in the controller output, which can lead to issues with the actuator. Figure
74 shows the typical situation where jitter is present. Jitter can be mitigated by filtering the error
signal used in computing the derivative term with a low-pass filter, which removes the high
frequency component of the noise.
Derivative kick occurs when the setpoint has a sudden change in value (for example, a step
change) causing the instantaneous error to be practically speaking infinite. This causes the
controller error to spike for a very short period of time after the change occurs. Figure 75 shows
the typical situation when derivative kick occurs. When the setpoint changes at 10 s, there is a
corresponding spike in the actuator value. Note that in practice, due to saturation in the actuator,
the effect of the derivative kick will be less than shown. Nevertheless, it will be present. Derivative
kick can be lessened by solely using the change in the output rather than the error when computing
the derivative term, that is,
ut = −τ D syt (189)
Since it has been shown that the overall effect of the derivative term is primarily for disturbance
rejection, that is, making yt ≈ 0, this approach is reasonable.
171
Figure 75: Derivative Kick
172
Figure 76: Effect of Changing τD for a D-Controller
173
process and predicts the future trajectory of the system. It is commonly used in large complex
systems where there is a need for an additional degree-of-freedom to stabilise the system. Systems
which have a very jittery output or setpoint would need to be filtered before being used as the
unfiltered signal can cause undesired behaviour.
Kc 1 −1 2
=uk (1 − z −1
) + + τ (1 − z ) εk (193)
(1 − z −1 ) τI
D
Equation (193) is often called the positional form of the discretised PID controller. Re-arranging
Equation (193) to give
1 2
(1 − z ) u
−1
k =∆uk =K c (1 − z −1 ) + + τ D (1 − z −1 ) ε k
τI
(194)
produces another common PID equation called the velocity form of the discretised PID controller.
In industrial implementations, it is possible to encounter both forms. Although these forms do not
have an effect on controller design, they will have an effect on understanding the values obtained.
174
state-space controllers and PID controllers. Irrespective of the approach used, there will always be
a need to simulate the resulting control system to make sure that there are no issues with the
performance. Furthermore, it should be noted that for certain applications, there exist specific
controller tuning rules that provide optimal performance for the problem at hand, for example,
level controllers are often tuned using special rules that seek to minimise large deviations from the
setpoint.
The general approach to controller tuning can be summarised by Figure 77. Before starting
the tuning procedure, it is required that the process be understood or modelled, that the
performance criteria be clearly specified, and that the control strategies of interest be known. The
first step will be to determine the initial controller parameters, followed by a simulation (or actual
implementation, if the system can handle repeated perturbations). Based on the test and a
comparison with the desired performance, new controller parameters can be obtained and new tests
performed. This would be repeated until either the desired criteria are satisfied or the time available
has run out. At this point, it may happen that the process understanding is found to be deficient
and additional information would need to be sought. If the controller has not been implemented on
the real system during the initial controller testing, then it will be necessary to repeat this procedure
once more on the actual system. Very often, it will be found that the performance may not be as
expected given the differences between the simulated and actual processes. However, following
this procedure will minimise the risk that such a situation occurs.
175
Section 5.1.2.3.a: Tuning a State-Space Controller
A state-space controller is often tuned using pole placement, which involves selecting the
desired poles of the closed-loop transfer function and designing a controller that can achieve this.
When placing the poles or eigenvalues of the closed-loop transfer function using a state-
space approach, both the controller and observer will need to have their poles placed. The general
rule of thumb is that the poles of the observer should be 10 to 20 times faster than the poles of the
controller. Pole placement can be achieved using two different methods: characteristic
polynomial and Ackermann’s Formula. The approaches work for both continuous and discrete
controllers. It should be noted that for multi-input systems, the computed value of 𝒦𝒦 is not
necessarily unique.
The general problem statement is: given the desired eigenvalues {λ1, λ2, …, λn} and the
system {, , }, determine the state feedback controller gain . For the characteristic polynomial
n −1
2) Compute ∆( s ) = s + α1s + + α n −1s + α n , which is the characteristic polynomial of .
n
−α1′ −α n′ −1 −α n′ 1
1 0 0 0
3) Compute =
= , .
0 0 0 0
0 0 1 0 0
4) Compute = n−1 and ′ = n−1 .
[α1′ − α1 α n′ − α n ] ′ −1 .
5) =
Similarly, Ackermann’s formula, uses the following steps to place the poles:
n
1) Compute ∆( s ) = ∏ ( s − λi ) = s n + α1′s n −1 + + α n′ −1s + α n′ .
i =1
n −1
2) Compute ∆( s ) = s + α1s + + α n −1s + α n , which is the characteristic polynomial of .
n
−α1′ −α n′ −1 −α n′ 1
1 0 0 0
3) Compute =
= , .
0 0 0 0
0 0 1 0 0
176
4) Compute = n−1 and ′ = n−1 .
5) [ 0 0 1 ]1×n ∆ ( ) .
−1
=
It is also possible to design the observer using Ackermann’s formula which gives
= ∆ ( ) −1 [ 0 1 ]1×n
T
0 (195)
When using pole placement, the following points should be borne in mind:
1) The magnitude of 𝒦𝒦 gives the amount of effort required to control the process. The
further the desired poles are from the actual poles of the system, the larger the controller
gain 𝒦𝒦.
2) For multi-input systems, 𝒦𝒦 is not unique.
3) (𝒜𝒜, ℬ) and (𝒜𝒜 − ℬ𝒦𝒦, ℬ) are controllable. However, due to pole-zero cancellations, the
resulting system may not be observable.
4) Discrete systems can be controlled in the same manner, mutatis mutandi.
177
input and faster response for systems with large time constants. SIMC rules recommend PI
controllers for first-order systems and PID controllers for second-order systems.
In structure-based controller tuning, the structure (or type) of a controller, the objective
(disturbance rejection or setpoint tracking), and metric for measuring good control are specified.
Minimising this metric allows the values of the parameters to be determined. The most common
structure-based approach is using the integrated time-averaged error (ITAE) as the metric. Using
the ITAE metric penalises persistent errors, which can be small errors that last for a long period of
time, and provides a conservative approach to control. The main advantage of this method is that
a model of the system need not be provided, while the main disadvantages are that the engineer
has no control over the closed-loop response of the system and that the resulting system is not very
robust to changes in the process.
Table 26 and
Table 27 present some common tuning methods for first-order transfer functions. Table 28 presents
the SIMC tuning method for a second-order transfer function. It should be noted that the PID
controller has the following series form:
1
Gc =K c 1 + (1 + τD s ) (196)
τI s
where the controller parameters with the tilde (◌̃) have the same meaning as the corresponding
controller parameters without a tilde.
Controller Method Kc τI
τ
ITAE 0.586 θ
−0.916
Structure-based
θ
(setpoint tracking) K τ 1.03 − 0.165
τ
ITAE 0.859 θ
−0.977
τ θ
0.680
(disturbance rejection) K τ 0.674 τ
178
Model-based SIMC
1 τ
(τc chosen so that τc > 0.8θ min(τ, 4(τc + θ))
K θ +τc
and τc > 0.1τ)
Controller Method Kc τI τD
τ
ITAE 0.965 θ
−0.85
θ
0.929
Structure-based
θ 0.308τ
(setpoint tracking) K τ 0.796 − 0.147 τ
τ
ITAE 1.357 θ
−0.947
τ θ
0.738
θ
0.995
0.381τ
(disturbance rejection) K τ 0.842 τ τ
IMC τ τ
2 +1
1 θ θ
Model-
K 1 τ1
Gp = e −θ s min(τ1, 4(θ + τc)) τ2
(τ 1s + 1)(τ 2 s + 1) K θ +τc
with τ 1 > τ 2
179
Gain: K = 1.5
Time Constant: τ = 20
Time Delay: θ = 10
For the SIMC method, there is a need to also specify the value of τc, which is essentially the closed-
loop time constant. The smaller the value, the faster the response is, but less robust is the overall
system. The constraints given with this method imply that τc > 0.8θ = 8 and τc > 0.1τ = 2. For the
purposes of this example, set the value of τc to be 10, which satisfies both constraints.
Therefore, the controller parameters can be computed from Table 26 as follows:
1 τ 1 20 2 (198)
=Kc = =
K θ + τ c 1.5 10 + 10 3
=τI min (τ , 4 (τ =
c + θ )) min ( 20, 4 (10=
+ 10 ) ) 20 (199)
The resulting behaviour of the closed-loop system is shown in Figure 78. It can be seen that the
process responds almost exactly as expected.
180
or implicitly, for statistics such as standard deviation. The performance of a controller can be
measured based on two different sets of criteria: how the controller responds to a change in setpoint,
that is, setpoint tracking or the servoresponse, and how the controller responds to disturbances,
that is, the regulatory response.
Since the objective in setpoint tracking is how well the controller responds to a setpoint
change, it is easy to determine an appropriate measure for performance assessment. For this reason,
setpoint tracking is often used to design a controller. As a first approximation, a closed-loop
system can be considered to be a second-order system with time delay. Therefore, the response of
the closed-loop system to a step change in the setpoint would be the step response of a second-
order system. The most common performance measures for setpoint tracking are just
characteristics of a second-order system responding to a step input, that is, rise time, overshoot,
and settling time of the controlled variable, as shown in Figure 79. The rise time, τr, is defined as
the first time the process reaches the setpoint value. The overshoot is defined as the ratio of how
much the process goes over (or under) the setpoint divided by the magnitude of the step change.
Note that if the step change is negative, then the overshoot will also be negative (that is, it is really
an undershoot) so that the ratio remains positive. The settling time, τs, is defined as the last time
for which the process lies outside the 5% bounds. The 5% bounds are defined as a boundary on
either side of the new setpoint that is defined as 2.5% of the difference (yss, 2 – yss, 1), where yss is
the steady-state value and the numeric subscripts represent the initial and final values. The settling
time is roughly three times the closed-loop time constant.
181
Figure 79: Measures for Assessing the Performance of a Controller for Setpoint Tracking
On the other hand, for performance assessment of the regulatory response, the objective is
less certain. Instead, various quantitative measures are used to quantify performance assessment,
including:
1) Standard deviation of manipulated variable: This is the simplest and most important
measure of control performance. However, it is difficult to specify the desired value a
priori since it depends on the nature and magnitude of disturbances affecting the process.
What can be specified, or at least described qualitatively, is the trade-off between control
error and control action. One way of thinking of a controller is that it moves variation
from one variable (usually the controlled variable) to another (usually the manipulated
variable). As disturbances affect the process, the controller will respond by changing the
manipulated variable. The response will then mitigate the effect of the disturbances.
Larger disturbances will require greater control action than small disturbances.
2) Mean of the output variable: This can be used to assess how well the controller
maintains the given setpoint in the presence of disturbances.
182
3) Advanced performance assessment: More advanced performance assessment methods
are available, such as the minimum variance controller and the Harris Index (Shardt, et
al., 2012), which can provide appropriate benchmarks for determining good performance.
183
In feedforward control design, the objective to design a controller that can compensate for
a measured disturbance before it can affect the process. Assume that the process model is Gp and
the disturbance model is Gd, then for the feedforward controller shown in Figure 80, the basic form
of the feedforward controller can be written as
Gd (200)
G ff = −
Gp
In the ideal situation, this will exactly cancel out the effect of the measured disturbance. However,
in practice, such a controller cannot be implemented for the following two reasons:
1) Time Delay: If the time delay in the process response is larger than the time delay in the
disturbance response, then the overall time delay for the process will be negative
requiring knowledge of future information about the process. Since such a situation is
impossible, the general solution is to drop the unrealisable time delay from the final
controller.
2) Unstable Zeroes in Gp: If the process contains unstable zeroes, then the resulting transfer
function will also be unstable. In such a case, it will not be possible to realise the
controller. A common solution in this case is to drop the offending zeroes from the final
representation.
There are two common feedforward controllers that can be designed:
1) Static controllers where only the gains of the process are considered, that is,
Kd (201)
G ff = −
Kp
where τp is the process time constant, τd is the disturbance time constant, and θff = θd – θp.
If θff is negative, then the term is often ignored. Ideally, |τp / τd| < 1, which avoids large
spikes when this controller is used.
184
Given the following system, design both a dynamic and a static feedforward controller.
Compare the performance of both. The system parameters are:
−1.5 ( s − 1) −10 s
Gp = e (203)
( s + 1)(10s + 1)
−0.5 (204)
Gd = e −5 s
( 5 s + 1)( 7 s + 1)
2 1 (205)
Gc
= 1 +
3 20 s
For the simulation, assume that the measured disturbance is driven by Gaussian white noise with
a magnitude of 0.5 and there is a step change in the setpoint of 2 units after 100 s.
Solution
Using Equation (201), the static feedforward controller can be computed as
K −0.5 1 (206)
G ff , s =
− d =
− =
Kp 1.5 3
Note that the gain can be obtained by setting s = 0 in the given transfer functions and evaluating
the resulting value.
When creating the dynamic feedforward controller, it is important that the transfer
functions be written in their standard form, that is, all roots are of the form τs + 1. In this particular
example, the zero of the process transfer function needs to be written into this form to give
1.5 ( − s + 1) −10 s
Gp = e (207)
( s + 1)(10s + 1)
The dynamic feedforward controller can be designed using Equation (200). This gives
−0.5
e −5 s
G ff ,d =
−
Gd
=
−
( 5s + 1)( 7 s + 1) 1
=
( s + 1)(10s + 1) e5 s (208)
Gp 1.5 ( − s + 1) 3 ( 5s + 1)( 7 s + 1)( − s + 1)
e −10 s
( s + 1)(10s + 1)
However, this controller as written cannot be realised since there is an unstable pole and the time
delay requires future values. In order to obtain a realisable dynamic feedforward controller, both
the unstable pole and time delay terms will be dropped. This gives the following form for the
controller
1 ( s + 1)(10 s + 1)
G ff ,d = (209)
3 ( 5s + 1)( 7 s + 1)
185
Figure 81 shows the effects of both feedforward controllers on the process. It can be seen
that without the feedforward controller the process has greater oscillations. Adding the static
feedforward controller tends to decrease the effect of the oscillations. However, the behaviour is
still rather jittery. The dynamic feedforward controller has smoothed out the jitter and the
behaviour is cleaner.
186
A special type of discrete-event control occurs when binary signals are used, for example,
a sensor will report when the elevator has reached the correct floor, and then the motor of the drive
will be switched off. The exact height of the elevator above the ground is not continuously
measured and monitored. When dealing with binary signals, there are two possible types of
controllers: logic control and sequential control.
In logic controllers, also called combinatorial controllers, one obtains the control variable
as a combination, that is, a logical operation, of signals, for example, system output signals (sensor
values such as door open or closed) or user inputs (e.g emergency button pressed or not pressed).
Consider a simple example of a lathe. A lathe is turned on when the user presses the power button
and the chuck is closed. The lathe is switched off when an end position is reached or the emergency
stop button is pressed.
In sequential control, individual control operations are performed in certain steps. The
advancement to the next step occurs either after a certain time has passed (time-dependent
sequential control), for example, a simple traffic light, or in the presence of a specific event
(process-dependent sequential control), for example, traffic lights that change their signal when a
pedestrian presses the button. In contrast to the logic controllers, it is therefore not possible to
clearly determine the manipulated variable even if all signal values are known, since one also has
to know at which point in the process, one is currently located.
187
Section 5.4.1: Cascade Control
In cascade control, at least two control loops are nested within each other. A typical
cascade-control strategy is shown in Figure 82, where it is desired to ensure that the flow rate
controlled by the valve is as accurate as possible, so that the process experiences the tightest control
possible. The primary or master control loop is the outer control loop, which sets the setpoint for
the secondary or slave control loop. The general procedure for tuning a cascade control loop is to
first tune the innermost loop and then work up towards the uppermost loop, treating all tuned
controllers as part of the process. The closed-loop time constant of the inner loop should be smaller
(faster) than the closed-loop time constant of the outer loop. A common rule of thumb is that the
ratio of closed-loop time constant of the primary loop and that of the secondary loop (τc, p / τc, s)
should be between 4 and 10. Too small a ratio implies that the secondary loop will not have reached
steady state and there will be interactions between the two loops leading to a loss of overall
performance. Too large a ratio implies that the advantages of cascade control will be lost as it will
slow down the overall response of the system. However, it will make it more robust to changes in
the underlying process models.
188
Section 5.4.2: Model Predictive Control
Model predictive control is an advanced control strategy that can take into consideration
not only the deviations from the setpoint, but also various economic and physical constraints, for
example, it can explicitly handle the situation where the water in the tank should not go above a
given value. In order to accurately handle these constraints, this approach requires a good model
and proper engineering design. As shown in Figure 83, model predictive control works by
optimising the control actions over a period of time, often called the control horizon, using the
predicted values from the model. The prediction horizon is the period over which the model used
to predict the behaviour of the system. After the prediction horizon has been reached, it is assumed
that the process is at steady state and will not change its values. Any constraints are then
implemented as necessary on the predicted results. The controller then implements the next control
action and repeats the optimisation procedure again. This ensures that the effect of disturbances,
plant-model mismatch, and other imperfections in the system do not have too large effect on the
overall performance.
189
Figure 83: Model Predictive Control
Model predictive control is effective in handling complex process with multiple inputs and
outputs that interact strongly. Although the original version was designed for linear systems,
variants exist for nonlinear systems.
One of the key disadvantages of model predictive control is that it requires a good model
that must be updated as necessary. A poor model can cause the control system to degrade and forgo
the benefits of the approach.
There are many different implementations of model predictive control. The most popular
implementation in the industry is the dynamic-matrix controller (DMC) approach, which is
detailed here. The objective function for model predictive control is
190
min
∆u
( ) ( )
r − yˆ T r − yˆ + ∆u T ∆u
( ) ( )
subject to (210)
yˆ = y * + ∆u
where r is the reference vector, ŷ the vector of the predicted process values with control, 𝒬𝒬 the
process scaling matrix, ∆u the vector of the changes in the controller action, ℛ the input scaling
matrix, y* the vector of the process values without control, and 𝒜𝒜 the dynamic matrix.
Furthermore, let m be the control horizon, p the prediction horizon, d the process time delay, and
n the settling time. It should be noted that 1 ≤ m ≤ p – d and p > d.
The solution requires the step response of the process, that is,
∞
=yt ∑a z i
−i
∆ut (211)
i =1
where ai is the step-response coefficient. The step-response coefficient can be calculated either by
polynomial division of the transfer function model or using the coefficients of the impulse response.
The coefficients ai of the step response have the following relationship to the coefficients of the
impulse response hj
i
ai = ∑ h j (212)
j =1
Furthermore, the settling time is defined as the time at which the first coefficient an is within a
range of between 0.975 and 1.025 times the value of a∞, where a∞ is the steady-state value. All
step-response coefficients after the settling time n can be assumed to be equal to an + 1. The p × m
dynamic matrix 𝒜𝒜 can written as
a1 0 0
a a1
2
= 0 (213)
a1
a p a p −1 a p − m +1
For a univariate system with only one input variable and one output variable, the solution for
Equation (210) is
( + ) T T ( r − y * )
−1
u K C=
∆= e T
(214)
where
191
n
yt*+l =yt − ∑ ( ai − al +i ) ∆ut −i (215)
i =1
Once the solution has been found, then the first control action Δu1 will be implemented by the
controller. At the next sampling time, the above optimisation procedure is repeated, a new optimal
value is calculated, and the first control action is implemented. This allows the system to take
unexpected process changes into consideration.
Example 30: Design of a Model Predictive Controller
Design a model predictive controller for the following SISO system:
2 z −1
Gp = (216)
1 − 0.75 z −1
Set up the required matrices and perform the first step of the iteration. For this, assume that m = p
= 3. Let 𝒬𝒬 = ℐp and ℛ = ℐ3, where ℐn is the n×n identity matrix. Furthermore, a step change occurs
at t = 0, with the process having previously been in steady state.
Solution
To determine the model predictive controller, we must first determine the step-response
model. This can be determined using long division, which gives the impulse-response coefficients
from which the step-response coefficients can be easily calculated. Thus,
2 z −1 + 1.5 z −2 + 1.125 z −3
1 − 0.75 z −1 2 z −1 (217)
−2 z −1 + 1.5 z −2
1.5 z −2
−1.5 z −2 + 1.125 z −3
1.125z −3
It can be seen that hi = 2(0.75)i – 1 for i ≥ 1. In general, for a transfer function of the form
β z −d (218)
Gp =
1 − α z −1
the coefficients of the impulse response can be given as
βα i − d i≥d
hi = (219)
0 i<d
The required step response coefficients can be found using Equation (212)
i i
ai
=
=j 0=j 1
∑=
hj ∑ 2 ( 0.75 )j −1
(220)
192
Equation (220) gives a geometric series that can be written as
=
1 − α i − d +1
ai β= 2
(1 − 0.75i ) (221)
1−α 1 − 0.75
It follows that
=
(1 − 0.75)
a1 2= 2
1 − 0.75
=
( 1 − 0.752 )
a2 2= 3.5 (222)
1 − 0.75
=
(1 − 0.753 )
a3 2= 4.625
1 − 0.75
Since d = 1 for this example, the step response coefficients with a smaller d have a value of zero
and can thus be ignored in the summation.
In the next step, the settling time is calculated. For a converging geometric series (implies
that the process of interest is stable), the value to which the series converges is given by
β 2
(223)
K=
p a=
∞ = = 8
1 − α 1 − 0.75
This gives the settling time for the first value for which the process lies in the interval 0.975×8 and
1.025×8. Since the process under consideration has no oscillations, only the lower limit is of
interest to us. Given that the settling time is equal to the value of i in Equation (221), we get
1 − α n − d +1 0.975β
β = , (224)
1−α 1−α
193
a1 0 0
a a1
2 2 0 0
= = 0 3.5 2 0 (227)
a1 4.625 3.5 2
a p a p −1 a p − m +1
This gives
T
2 0 0 1 0 0 2 0 0 1 0 0
+ 3.5
T
2 0 2 0 + 0 1 0
0 1 0 3.5
4.625 3.5 2 0 0 1 4.625 3.5 2 0 0 1
(228)
38.640 625 23.1875 9.25
= 23.1875 17.25 7
9.25 7 5
23.1875 17.25
9.25 7 5
(229)
0.134 046 −0.184 200 0.009 896
= −0.184 200 0.387 349 −0.201518
0.009 896 −0.201 518 0.463 818
For the controller gain, we obtain the result
K C ( T + ) TT
−1
=
T
0.134 046 −0.184 200 0.009 896 2 0 0 1 0 0
2 0 0 1 0 (230)
= −0.184 200 0.387 349 −0.201518 3.5
0.009 896 −0.201 518 0.463 818 4.625 3.5 2 0 0 1
0.268 091 0.100 759 −0.004 948
= −0.368 400 0.129 997 0.100 759
0.019 792 −0.368 400 0.268 091
1
r = 1 (231)
1
194
The predicted uncontrolled position will be equal to the steady-state value, i.e. zero since no control
has been made. This implies that
0
*
y = 0 (232)
0
Only the first controller action Δu1 = 0.363 902 will be implemented. At the next time point,
Equation (233) will be recomputed using the new values for r and y*.
For a multivariate system, the vectors and matrices become supervectors and supermatrices,
meaning that a vector consists of many vectors, for example
∆u1
(234)
∆u =
∆uh
where ∆ui is the input vector for the ith input. Let us consider a MIMO System with s outputs and
h inputs. This gives a dynamic matrix 𝒜𝒜 with the following form
11 1h
= (235)
s1 sh
where 𝒜𝒜ij is the dynamic matrix between the jth input and ith output. From Equation (214), it
follows that
h n
yi*,t +l =yi ,t − ∑∑ ( aij ,k − aij ,l + k ) ∆u j ,t − k (236)
=j 1 =
k 1
and
195
ps
∆u j = ∑ k ( r − y ),
i =1
ji i
*
i j = km + 1, k = 0,1,..., h − 1 (237)
where aij, k is the kth coefficient of the step response for the process between the jth input and ith
output and Δuj, t – k is the change in the control action for the jth input at time point t − k.
196
where Kdb is the deadband constant. The deadband can be specified as either some fixed value of
the setpoint (for example, within 5°C of the setpoint) or as a percentage (within 5% of the setpoint).
Deadbanding is useful when tight control is not desired, that is, small deviations are permissible.
It is often used with level control for surge tanks as these will often need to maintain a general
level rather than a specific value. Furthermore, the controller can be made more aggressive outside
the band to quickly drive the system to the desired value.
A more generalised approach to deadbanding is called gain scheduling, where the
controller gain changes depending on the value of the scheduling variable. Most often, the domain
of the scheduling variable is partitioned into different regions. For each region, a different
controller gain may be assigned. Mathematically, this can be written as
K c ,1 st < K gs ,1
K K gs ,1 ≤ st < K gs ,2
c ,2 (239)
ut = Gc
K c ,n K gs ,n < st
where Kc, i is the controller gain for the ith region, Kgs, i is the ith scheduling limit, and st is the
scheduling variable. This approach allows for a nonlinear process to be controlled with a series of
linear controllers, which would not be possible with a single controller.
where sign is the sign function that returns −1 if et is negative, 0 if the value is zero, and 1 otherwise.
197
When implementing ratio control, the ratio itself should not be controlled, but rather the
ratio controller should set the setpoint for one of the variables using the ratio, for example, if R =
u1 / u2, then we could set u2 = Ru1 and use this u2 as the setpoint to the u2 controller. In all cases,
division should be avoided since if one of the variables becomes zero, this will then cause an error.
As well, it should be noted that ratio control is implemented using the absolute values of the
variables and not their deviational values as is common with other forms of control.
198
Section 5.5.5: Input-Position Control
Input-position control, also called valve-position control, allows controlling multi-input,
single-output systems using more advanced methods. In this control strategy, it is normally
assumed that there are two inputs: a fast-acting but expensive (or otherwise restricted) input, u1,
and a slow-acting but cheap (or otherwise abundant) input, u2. An example would be cooling an
exothermic reactor using both coolant (expensive, but fast) and cooling water (abundant, but slow).
In general, the cheap input is used for controlling the process, but the expensive input can be used
to improve the speed of response. Basically, at steady state, it is assumed that the expensive input
will attain some steady-state value u1s, so that the overall process will be controlled by u2. A
schematic of this control strategy is shown in Figure 86.
Since input-position control can be treated as a modification of cascade control, the fast
loop given by u1 is tuned first and then the slower loop given by u2. This also implies that the rule
regarding time constants between the loops for cascade control should hold, that is, τc2 / τc1 should
be between 4 and 10. In general, both controllers are designed as simple PI controllers without any
anti-windup features.
199
look-up table with interpolation between the given data points. Such an approach can allow for the
system to be focused on those areas that are highly nonlinear.
200
5) Model Predictive Control: J. B. Rawlings, D. Q. Mayne, and M. M. Diehl (2017). Model
Predictive Control: Theory, Computation, and Design (Second edition), Madison, United
States of America: Nob Hill Publishing.
6) Advanced Control Strategies: S. Skogestad (2023). “Advanced control using
decomposition and simple elements” in Annual Reviews in Control, volume 56, article
100903.
201
12) The proportional term in a PID controller considers the current values of the error.
13) A PI controller can be tuned using the IMC method.
14) The rise time of a closed-loop system can be used to determine how well a controller
regulates the disturbance.
15) The settling time is defined as three times the closed-loop time constant.
16) For regulatory-control performance, it is easy to specify the desired values.
17) Feedforward control seeks to minimise the effects of unmeasurable disturbances on the
process.
18) A decoupler is a type of feedforward control.
19) In feedforward control, it may be necessary to remove terms such as time delay or unstable
zeros from the final controller.
20) Interlocking occurs when a series of discrete events must be fulfilled before some action
can occur.
21) Supervisory control allows us to create a network of controllers each of which can be
controlling another controller.
22) In cascade control, the primary controller should always be faster than the secondary
controller.
23) Model predictive control allows constraints and economic conditions to be considered in
controlling the process.
24) Model predictive control requires good models.
202
26) Design PI controllers using the formulae in Table 26 for the following processes:
2
a. G p = e −15 s
30 s + 1
−2
b. G p = e −15 s
30 s + 1
2
c. G p = e −150 s
3s + 1
−5
d. G p = e −15 s
s − 0.5
You should use the smallest τc possible.
27) Table 27 for the same processes as in Question 26). You should use the smallest τc possible.
2 −2 −5 s
=c. G p = e − s , Gd e
( 3s + 1)(10s + 1) 15s + 1
30) Design static feedforward controllers for the processes in Question 30). Simulate and
compare the performance of the two types of feedforward controllers for a setpoint change
of +2. You can assume that the disturbance is driven by Gaussian white noise.
31) Consider a cascade loop with the following two transfer functions:
2 −2
G p , secondary
= = e − s , G p , primary e −20 s (241)
3s + 1 30 s + 1
203
Design appropriate PI controllers for this cascade loop. What aspects should you take into
consideration when designing this controller? Simulate the system.
32) Consider the same situation as in Question 31), but now you also wish to ensure that the
secondary loop does not have any oscillations and reaches the setpoint as fast as possible.
Using simulations, design appropriate controllers for this system.
33) You need to design a controller for a process whose model has been determined
experimental to be
1
Gˆ p = e −10 s (242)
15s + 1
However, you do not know how well the experimental model reflects the true process.
Using the IMC tuning method, design a PID controller assuming that the experimental
model is correct. Knowing that the model may be incorrect, do not pick too small a τc.
Simulate your model assuming Equation (242) is correct. If your controller is satisfactory,
then try simulating the closed-loop system assuming that the true process model is given
by
204
35) Simulate the system given by Equation (243) with and without the decoupler. What is the
effect of the decoupler? The PI controllers are given as
1 1
ε1 = 1 + ( r1 − y1 )
10 25s (244)
1 1
ε2 =1 + ( r2 − y2 )
5 40 s
36) Using the DMC method, design a model predictive controller for the following system:
z −10
yt = ut (245)
1 − 0.25 z −1
37) Using the DMC method, design a model predictive controller for the following system:
2 −2 −15 s
e −5 s e
y1 10 s + 1 5s + 1 u1
(246)
y = 5 4
2 −10 s u2
e −10 s e
15s + 1 10 s + 1
205
Chapter 6: Boolean Algebra
Boolean algebra is the algebra of binary variables that can only take two values, for
example, true and false or 1 and 0. It is very useful for solving problems in logic and is a
requirement for good programming. George Boole (1815 – 1864) is the discoverer of Boolean
algebra.
A Boolean expression is a group of elementary terms that are linked with connectors
(operators). The mathematical space in which a Boolean algebra is defined will be denoted using
a double-struck 𝔹𝔹 (U+1D539).
Other Word
Operator Symbol Statement
Representations Representation
Conjunction ∧ (U+2227) a ∧ b a·b, ab, AND
a AND b, a & b
Disjunction ∨ (U+2228) a ∨ b a + b, a OR b, OR
a || b
Negation ¬ (U+00AC) ¬b, b′ b̄ NOT b, !b NOT
Implication → (U+2192) a → b — IF-THEN
Equivalence ↔ (U+2194) a ↔ b — IF-&ONLY-IF
All Boolean expressions can be written using ∧, ∨, ¬, 0 and 1. The precedence of the
operators is such that ∧ has a higher precedence than ∨, for example, a ∨ b ∧ c = a ∨ (b
∧ c).
206
Section 6.2: Boolean Axioms and Theorems
For the Boolean space 𝔹𝔹 = {0, 1} with variables a, b, and c and operators ∧ und ∨, the
following axioms hold:
1) Closure
a. a ∨ b ∊ 𝔹𝔹
b. a ∧ b ∊ 𝔹𝔹
2) Commutativity
a. a ∨ b = b ∨ a
b. a ∧ b = b ∧ a
3) Distributivity
a. a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c)
b. a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c)
4) Identity
a. a ∨ 0 = a
b. a ∧ 1 = a
5) Complementation
a. a ∧ ¬a = 0
b. a ∨ ¬a = 1
6) Annihilator
a. a ∨ 1 = 1
b. a ∧ 0 = 0
7) Associativity
a. (a ∧ b) ∧ c = a ∧ (b ∧ c)
b. (a ∨ b) ∨ c = a ∨ (b ∨ c)
8) Idempotence
a. a ∨ a = a
b. a ∧ a = a
9) Involution
a. ¬¬a = a
207
10) Absorption
a. a ∧ (a ∨ c) = a
b. a ∨ (a ∧ c) = a
With these axioms, it is possible to define a complete Boolean algebra.
An important law is De Morgan’s Law:
¬(a ∨ b) = ¬a ∧ ¬b (247)
¬(a ∧ b) = ¬a ∨ ¬b (248)
This law can be used to simplify many complex Boolean expressions or convert between
representations.
Table 30: Truth Table for the Boolean Operators (left) AND and (right) OR
AND OR
A B AB A B A+B
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
208
AND OR
A B AB A B A+B
1 1 1 1 1 1
There are two common representations for Boolean functions: the sum-of-products (SOP)
form and the product-of-sums (POS) form.
209
Only 1) and 4) are in the sum-of-product form, since these representations are a sum of the
products of individual variables. In 2) and 3), we have a product of many variables (A and B) in 2)
and (D and E) in 3).
A minterm is a row in the truth table where the value is 1. The symbol for a minterm is
mi, where i is the decimal row number. The compact sum-of-products form is Σm(i,…), where i is
the row number of the minterms. When the minterms are converted into a functional representation,
each variable, whose value is 1, will be written in its plain form, while each variable, whose value
is 0 will be written in its negated form, for example, for m2, the minterm with the binary value
0102, the term will be given as A′BC’.
210
A B C F
1 1 1 1
The rows with the numbers in bold are the rows where the function has a value of 1. We
can find the decimal row number simply by converting the binary representation into a decimal
value, that is, for the first red row (011)
0112 = 2 + 1 = 3
and
1012 = 22 + 1 = 5
1112 = 22 + 2 + 1 = 7
Thus, the compact sum-of-products form is
Σm(3, 5, 7).
It should be noted that the ordering of the Boolean variables is important. When the ordering is
changed, then the compact sum-of-products form will also change.
211
Example 36: Converting into the Product-of-Sums Form
Convert the function F = AC + BC into its product-of-sums form.
Solution
Using the distributive property, we can obtain the product-of-sums form, that is,
F = AC + BC = (A + B)C
A maxterm is a row in the truth table with the value of 0. The symbol for a maxterm is Mi,
where i is the decimal value of the row. The compact product-of-sums form is ΠM(i,…), where i
is the decimal row value of the corresponding maxterm. When maxterms are converted into a
functional representation, then each variable with the value of 0 is converted as written, while each
variable with a value of 1 is written in its negated form, for example, M2, the maxterm with the
binary value 0102, would be written a A + B’ + C.
Example 37: Compact Product-of-Sums Form
What is the compact product-of-sums form for the function F = (A + B)C.
Solution
First, we require the truth table for the function. Then, we can easily find the rows with a
value of 0.
A B C F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
The rows with bold numbers are the rows where the function has a value of 0. We can
obtain the row number by converting the binary values into a decimal representation, for example,
for the first row (000)
212
0002 = 0 + 0 + 0 = 0
and
0012 = 0 + 0 + 1 = 1
0102 = 0 + 2 + 0 = 2
1002 = 22 + 0 + 0 = 4
1102 = 22 + 2 + 0 = 6
Therefore, the compact product-of-sums form is
ΠM(0, 1, 2, 4, 6).
It is important to note that the order of Boolean variables is important. When the order is changed,
then the compact product-of-sums form will also change. Also, it is obvious that any terms in the
sum-of-products form are not in the product-of-sums form!
213
• Replace all OR by AND.
• Replace 0 by 1.
• Replace 1 by 0.
Duality is an important property when we are simplifying or minimising an expression. Often the
dual of the representation can be easier to work with.
Example 39: Dual of a Function
What is the dual of the function F = (A + B)C?
Solution
F = (A + B)C
FD = [(A + B)C]D
FD = [(A + B)]D + C D
FD = AB + C
The dual of a function is often represented by a superscript D.
214
of-products representation, we circle the largest group with a size that is a power of 2 that covers
as many of the 1 as possible.
The Karnaugh map for three variables is shown in Figure 88. The diagram is created so
that on one axis lies one variable and on the other axis the remaining two variables. Each row and
column has one of the two possible values (0 or 1) so that each adjacent row or column only differs
by one entry, for example, when the row is 01, then the next row must be 11, since only one entry
should be changed.
The Karnaugh map for four variables is shown in Figure 89. Each row and column has two
variables. The Karnaugh map for five variables is shown in Figure 90. When we are looking for 1,
it is common to not bother with writing the 0.
215
Figure 89: Karnaugh Map for the Function F = AB′D + A′D′ + C
Figure 90: Karnaugh Map for the Function F = ΠM(1, 2, 5, 9, 11, 13, 15, 16, 17, 18, 20, 21, 23,
24, 26)
The general procedure for finding the minimal sum-of-products form is:
1) Construct the Karnaugh map.
2) Circle the 1 into the largest groups possible.
3) Write the corresponding sum-of-product form based on the circled groups. For each group,
we only write the variables whose value is not changed. Variables with a value of 0 are
negated. For example, in Figure 89, for the green loop, C varies between 0 and 1, which
means that it is ignored. The other variables remain constant. A and D have a value of 1,
while B has a value of 0. Thus, we negate B and write the other two variables normally to
give AB′D.
The general procedure for finding the minimal product-of-sums form is:
216
1) Construct the Karnaugh map.
2) Circle the 0 into the largest groups possible.
3) Write the corresponding sum-of-product form for F′ based on the circled groups. For each
group, we only write the variables whose value is not changed. Variables with a value of
0 are negated, for example, in Figure 89, for the loop in the first row, A varies between 0
and 1, which means that it is ignored. The other variables remain constant and have a value
of 0. Thus, we write the negated forms of these variables, that is, B′C′D′.
4) Convert F′ to F.
Of course, we can look for the loops using trial and error, but we have no guarantee that we will
find the best loops. Therefore, we wish to find a procedure that we can always find the best loops.
Before we can describe such a procedure, we need to define certain words. An implicant
is a single 1 or group of 1’s. A prime implicant is an implicant that cannot be further combined,
that means, that a single 1 creates a prime implicant if there are no adjacent 1. Two adjacent 1’s
create a prime implicant if they cannot be combined into a group of four 1’s, while four adjacent
1’s create a prime implicant if they cannot be combined into a group of eight 1’s. Figure 91 shows
the difference between an implicant and a prime implicant. We can state that a sum-of-products
form with nonprime implicants is not a minimal form, but not all prime implicants will necessarily
be required for the minimal sum-of-products form. An essential prime implicant is a minterm
that is covered by only a single prime implicant. All essential prime implicants must be in the
minimal sum-of-products form. Thus, we can say that the objective is to find all the essential prime
terms. Figure 93 shows the procedure for minimising a Karnaugh map.
217
Example 40: Karnaugh map
For the Karnaugh map shown in Figure 92, find the minimal sum-of-products form.
Solution
1) We start with the first 1 (cell: 0000). The largest group that we can
find is four 1. This group is an essential prime implicant.
2) The next unlooped 1 is in the cell 0010. This 1 can only be combined
with the 1 in cell 0000. This group is also an essential prime implicant.
4) The next free 1 is in cell 1011, which we can combine with cell 1111.
This is the only possibility for combining this cell. Therefore, this group
is also an essential prime implicant.
5) The last step is to write the minimal sum-of-product form. First, we will write all the essential
prime implicants, that is, A′B′D′, B′C′ and BCD. Then, we must select one of the remaining
218
prime implicants (AB′D or ACD). There is no difference which of these two prime implicants we
select. The minimal sum-of-products form is then
F = A′B′D′ + B′C′ + BCD + {AB′D or ACD}
219
Exercises, which seek to test the reader’s ability to compute the required parameters for a simple
data set using simple or no technological aids.
220
21) Simplify the following function Z = (A + B)(A + BC)(B + BC). Using a truth
table, show that the original and simplified functions are the same.
22) Convert the following functions into the sum-of-products form:
a. Z = (A + B)(A + C)(A + D)(BDC + E)
b. Z = (A + B + C)(B + C + D)(A + C)
23) Convert the following functions into a product-of-sums form:
a. Z = W + XYZ
b. Z = ABC + ADE + ABF
24) Find the compact product-of-sums form for the following functions:
a. F(A, B, C) = A′.
b. F(A, B, C, D) = A′B′ + A′B′(CD + CD′).
25) Find the compact sum-of-products form for the following functions:
a. F(A, B, C) = (A′ + B + C)(A + C).
b. F(A, B, C, D) = A′B′ + A′B(CD + CD′).
26) Using a Karnaugh map, find the minimal sum-of-products form for the following functions:
a. F(A, B, C, D) = A′B′ + A′B(CD + CD′).
b. F(A, B, C, D) = Σm(0, 1, 2, 3, 6, 7).
c. F(A, B, C, D) = Σm(0, 4, 5, 6, 8, 9, 10, 11).
d. F(A, B, C, D) = Σm(10, 12, 14) .
27) For the Karnaugh map shown in Figure 94, find all prime implicants and essential prime
implicants.
221
Figure 94: Karnaugh Map for Question 27
222
Chapter 7: PLC Programming
When using a PLC, it is necessary to transfer the required information to the PLC using
some methods. There are two possible approaches. We could use an ad-hoc approach that depends
on the PLC or situation or we could use some type of standard. It is obvious that using standards
is better since we can re-use the information, for example, the same code can be re-used for
different cases without having to worry about compatibility problems. The IEC/EC 61131 is the
standard for PLC programming and will be described in the following sections. This standard
consists of five different programming languages and a common set of rules that apply to all the
programming languages.
223
3) Remainder of the POU with the instructions.
Before a POU can be used, each programme must be associated with a task. Before we can load a
task into the PLC, we must first define:
1) Which resources do we need? In the standard, a resource is defined as either a CPU (central
processing unit) or a special processor.
2) How is the program executed and with what priority?
3) Do variables have to be assigned to physical PLC addresses?
4) Do references to other programs have to be made using global or external variables?
The priority of a task shows how the given task should be executed. There two important parts to
define the priority: scheduling and priority type. Scheduling focuses on how the programme is
executed. There are two possibilities: cyclically, that is, the programme will be continually
executed; and on demand, that is, the programme will only be executed as need. The priority type
represents whether the programme can be interrupted. Again, there are two possibilities: nonpre-
emptive and pre-emptive. A nonpre-emptive task must always be completed before another task
can be started. A pre-emptive task can be stopped if a task higher priority occurs. Figure 95 shows
the two possibilities. As well, the priority level needs to be set. This ranges from 0 for the highest
priority to 3 for the lowest priority.
Defining these components creates a configuration. Figure 96 shows a visual
representation of the components of a configuration and how these are combined together.
The call hierarchy is defined as follows: a programme can only call function blocks and
functions. A function block can only call other function blocks and functions, while a function can
only call other functions. Recursion cannot be implemented in this standard. POUs cannot call
themselves nor can they be called as a result of a chain of POUs.
224
Figure 96: Visual Representation of a Configuration
225
reference. For variables with complex data structures, this can lead to efficient
programming. However, since the variable location is passed, this means that (undesired)
changes will affect the variable even outside the calling function. All POUs can use this
type.
5) External Variables (VAR_EXTERNAL): This variable can be changed outside of the POU
using the variable. An external variable is required to have read and write access to a global
variable of another POU within a given POU. It is only visible for POUs that list this global
variable under VAR_EXTERNAL, all others have no access to this global variable. The
identifier and type of a variable under VAR_EXTERNAL must match the corresponding
VAR_GLOBAL declaration in the program. Only programs and function blocks can use this
type.
6) Global Variables (VAR_GLOBAL): A globally declared variable can be read and written
to by several POUs. To do this, the variable must be specified in the other POUs under the
VAR_EXTERNAL with the same name and type.
7) Access Variables (VAR_ACCESS): Access variables are global variables for the
configurations that act as a communication channel between components (resources) of the
configurations. It can be used like a global variable within the POU.
226
Section 7.3.1.1: Delimiters
Delimiters are symbols that separate the individual components from one another. Typical
delimiters include the space, +, the comma (, ), and *. Table 31 shows all the delimiters in the IEC
standard.
227
Delimiter Meaning, Clarification
Prefix for Time literal Introductory characters for time literals, combinations of
t#,T#; d#, D#; lowercase and uppercase letters are permitted
d, D; h, H; m, M;
s, S; ms, MS;
date#, DATE#;
time#, TIME#;
time_of_day#;
TIME_OF_DAY#;
tod#, TOD#;
date_and_time#;
DATE_AND_TIME#;
dt#, DT#
Colon : Separator for:
1. Time within time literals
2. Definition of the data type for variable declaration
3. Definition of a data-type name
4. Step names
5. PROGRAM ... WITH ...
6. Function name / data type
7. Access path: data / type
8. Jump label before the next instruction
9. Network name before the next instruction
Assignment (Walrus) 1. Operator for initial-value assignment
2. Input connection operator (assignment of actual
Operator :=
parameters to formal parameters when calling the POU)
3. Assignment operator
(Round) Brackets (…) Start and end of:
1. Initial-value list, also: multiple initial values (with
repetition number)
2. Range specification
3. Field index
4. Sequence length
5. Operator in instruction list (calculation level)
6. Parameter list when calling the POU
7. Subexpression hierarchy
Square Brackets […] Start and end of:
1. Array index (access to an array)
2. String length (when declaring a string)
228
Delimiter Meaning, Clarification
Comma , Separator for:
1. Lists
2. Initial-value lists
3. Array indices
4. Variable names (when there are multiple variables with
the same data type)
5. Parameter list when calling a POU
6. Operator in instruction list
7. CASE list
Semicolon ; End of:
1. Definition of a (data) type
2. Declaration (of a variable)
3. Structured text command
Period-Period .. Separator for:
1. Range specifications
2. CASE branches
Percent % Introductory character for hierarchical addresses for directly
represented and symbolic variables
Assignment Operator => Output binding operator (assignment of formal parameters
to actual parameter when calling a PROGRAM or
FUNCTIONBLOCK)
Comparison >,<; >=, <=; Comparison operators in expressions
=, <>
Exponent ** Exponentiation in expressions
Multiplication * Multiplication in expressions
Division / Division in expressions
Ampersand & AND operator in expressions
229
3) Names of standard function blocks
4) Names of the input variables for the standard functions
5) Names of the input and output variables of the standard function blocks
6) The variables EN und ENO in the graphical programming languages
7) The operators of the instruction-list language
8) The elements of the structured-text language and
9) The elements of sequential charts
Table 32 shows all the keywords in the IEC standard.
A
ABS ANY ANY_MAGNITUDE
ACOS ANY_BIT ANY_NUM
ACTION ANY_DATE ANY_REAL ARRAY
ADD ANY_DERIVED ASIN
AND ANY_ELEMENTARY AT
ANDN ANY_INT ATAN
B
BOOL BY BYTE
C
CAL CLK CTU
CALC CONCAT CTUD
CALCN CONFIGURATION CU
CASE CONSTANT CV
CD COS
CDT CTD
D
D DINT DT
DATE DIV DWORD
DATE_AND_TIME DO
DELETE DS
E
230
ELSE END_PROGRAM EN
ESIF END_REPEAT ENO
END_ACTION END_RESOURCE EQ
END_CASE END_STEP ET
END_CONFIGURATION END_STRUCT EXIT
END_FOR END_TRANSITION EXP
END_FUNCTION END_TYPE EXPT
END_FUNCTION_BLOCK END_VAR
END_IF END_WHILE
F
FALSE FIND FUNCTION
F_EDGE FOR FUNCTION_BLOCK
F_TRIG FROM
G
GE GT
I
IF INITIAL_STEP INT
IN INSERT INTERVAL
J
JMP JMPC JMPCN
L
L LEN LREAL
LD LIMIT LT
LDN LINT LWORD
LE LN
LEFT LOG
M
MAX MOD MUX
MID MOVE
MIN MUL
N
231
N NEG NOT
NE NON_RETAIN
O
OF OR
ON ORN
P
P PROGRAM PV
PRIORITY PT
Q
Q QU
Q1 QD
R
R RELEASE RETCN
R1 REPEAT RETURN
R_EDGE REPLACE RIGHT
R_TRIG RESOURCE ROL
READ_ONLY RET ROR
READ_WRITE RETAIN RS
REAL RETC
S
S SIN STEP
S1 SINGLE STN
SD SINT STRING
SEL SL STRUCT
SEMA SQRT SUB
SHL SR
SHR ST
T
T THEN TO
TAN TIME TOD
TASK TIME_OF_DAY TOF
232
TON TRANSITION TYPE
TP TRUE
U
UDINT ULINT USINT
UINT UNTIL
V
VAR VAR_EXTERNAL VAR_IN_OUT
VAR_ACCESS VAR_GLOBAL VAR_OUTPUT
VAR_CONFIG VAR_INPUT VAR_TEMP
W
WHILE WORD
WITH WSTRING
X
XOR XORN
233
Dollar-Sign Representation Representation on the Screen or Printer
$$ $
$', $" ', "
$L, $l Line feed ($0A)
$N, $n New line
$P, $p New page
$R, $r Carriage return 22 ($0D)
$T, $t Tab
The octothorpe is used to give additional information about the literal, for example, 2# implies a
binary representation. The additional information always comes before the octothorpe. Common
representations are:
1) Binary Representation: 2#
2) Hexadecimal Representation: 16#
3) Duration Representation: T# or TIME#
4) Date Representation: D# or DATE#
5) Time-of-Day Representation: TOD# or TIME_OF_DAY#
6) Date-and-Time Representation: DT# or DATE_AND_TIME#
It is possible to use any defined data structure with the octothorpe. Numerical and time literals may
also contain underscores in order to make the presentation more legible. Capitalisation is not
important.
Time literals have some special properties. There are multiple different types of time
literals: duration, date, time of day, and date and time. For each case, there is a special
representation with its own rules.
Duration is represented by T#. After the octothorpe, the duration is given using the
following units:
1) d: Day
22
This term comes from the days of typewriters, where the writing head with the ink ribbon was attached to a carriage
that had to be pushed at the end of each line to the beginning of the new line.
234
2) h: Hours
3) m: Minutes
4) s: Seconds
5) ms: Milliseconds
Each unit is separated by an underscore. 23 The units must be placed from largest to smallest. The
smallest unit can have a decimal value, for example, T#1m_10s_100.7ms. The highest value
can “overflow”, for example, the time duration T#127m_19s is valid and will be automatically
converted into the proper representation of T#2h_7m_19s. A negative value is also possible, for
example, T#-22s_150ms.
Dates are represented using D#. After the octothorpe comes the date in scientific notation,
that is, year-month-day, for example, D#2017-02-28.
The time of day is represented using TOD#. After the octothorpe comes the time in the
format Hours:Minutes:Seconds.Decimal Part, for example, TOD#12:45:25.21.
Note that the 24-hour clock is used.
The date and time is shown using DT#. After the octothorpe comes the date in scientific
notation followed by a dash and the time in the time-of-day format, for example, DT#2017-05-
30-2:30:12.
2) No more than one underscore can be used together (✗ A__B [with two underscores]).
23
The underscore is not obligatory to separate the units, but it does help with the readability of the text.
235
Only the first six characters are considered when comparing two identifiers, that is, both TUI_123
and TUI_125 are equivalent. Capitalisation also plays no role, that is, TUI, tui, and TuI are all
equivalent.
236
Table 34: The Elementary Data Types in the IEC 61131-3 Standard. The initial letters in the data types represent: D = double, L
= long, S= short, and U = unsigned.
For an elementary data type, it is possible to define the initial value and range. The initial
value is defined as the value of the variable when it is first used. The range defines what the
possible values for the variable are.
237
Section 7.3.3.2: Arrays
Arrays are data elements of identical type that are sequentially stored in memory. An array
element can be accessed with the help of an array index that lies within the array boundaries. The
value of the index indicates which array element is to be accessed. Most PLC systems ensure that
array access with an array index outside the array limits results in an error message during runtime.
The array is defined using square brackets ([]). The dimensions are separated by commas, e.g.
ARRAY [1...45] OF INT
is a one-dimensional array with 45 elements of data type INT, while
ARRAY [1...50,1...200] OF INT
is a two-dimensional array of data type INT with 50 elements in one dimension and 200 elements
in the other dimension.
The elements of an array are accessed using square brackets, for example, TEST[3] takes
the third element in the array TEST. The dimensions are also separated using commas.
The initial values in the array can be defined using square brackets. When values are
repeated, then we can use the format Repeats(Values), to simplify matters, for example,
2(4) means that we will write the value 4 twice. Thus, the following two array definitions are
equivalent:
TEST1 : ARRAY [1...5] OF INT := [1, 1, 1, 3, 3];
TEST1 : ARRAY[1...5] OF INT := [3(1), 2(3)];
238
Section 7.3.3.4: Derived Data Types
A derived data type is a user-defined data type that consists of elementary data types,
arrays, and data structures. This procedure is called derivation or type definition. In this way, a
programmer can define the best data model for the problem at hand. A derived data type is defined
by TYPE and END_TYPE. The initial values for the elements of a derived data type is given by := ,
for example,
TYPE
COLOUR : (red, yellow, green);
SENSOR : INT;
MOTOR :
STRUCT
REVOLUTIONS : INT := 0;
LEVEL : REAL := 0;
MAX : BOOL := FALSE;
FAILURE : BOOL := FALSE;
BRAKE : BYTE := 16#FF;
END_STRUCT;
END_TYPE;
where the element COLOUR is an enumeration that can only take the values red, green, and
yellow; SENSOR is an integer (INT); MOTOR is a data structure that contains the following
elements: REVOLUTION with an initial value of 0, LEVEL with an initial value of 0, MAX with an
initial value of FALSE, FAILURE with an initial value of FALSE, and BRAKE with an initial
hexadecimal value of FF.
239
right-hand track following the rungs. Thus, the ladder network is always read rung by rung from
top to bottom and in a given row from left to right, as long as no other order is provided. It is
traditional to label all the left-hand rungs with a number. Normally, the numbers are not sequential
but increase in units of 5 or 10 in order that additional future rungs can be easily added. Finally,
the ladder network is often visually split into two parts: a left-hand part that shows the
computations and a right-hand part that shows the storing or using of the variables. This convention
makes reading the ladder network easier.
240
Name Symbol Commentary
Copies the value on the left into the variable
Coil 24
VarName.
Copies the negated value of the left into the
Negated coil24
variable VarName.
Copies TRUE to variable VarName, if the left
Set coil24
link is TRUE; otherwise, no change.
Copies FALSE to variable VarName, if the left
Reset coil24
link is TRUE; otherwise, no change.
Saves TRUE to the variable VarName if and
Positive-transition- only if a FALSE → TRUE transition is detected
sensing coil24 on the left link; otherwise, no change in the
variable.
Saves TRUE to the variable VarName if and
Negative-transition- only if a TRUE → FALSE transition is detected
sensing coil24 on the left link; otherwise, no change in the
variable.
24
The value on the left is always transferred to the right-hand side.
25
tnw represents a Boolean variable that determines if the given link should be performed.
241
Name Symbol Commentary
If the left link tnw25 is TRUE, jump to the
Conditional jump
network with the given NAME.
Figure 97 shows how the typical Boolean operators can be implemented in ladder logic.
The AND operator is implemented by placing the two contacts in series, while the OR operator
places the two contacts in parallel. This follows from the observation that the electricity flows
from left to right. For an AND operation, we need both contacts to be true for the electricity to flow.
This implies that both need to be in series. On the other hand, for the OR operation, electricity can
flow through either of the two paths. Therefore, the contacts should be placed in parallel.
242
output variable ENO (enable out) determines if the programme completed successfully. It takes the
value TRUE, if no errors occurred. Figure 98 shows such an implementation using ladder logic.
243
Figure 99: Ladder Logic for Example 41
Solution
In order to implement a recipe in ladder logic, we will need to define Boolean variables
that keep track of in which step we are. In this example, since we have five steps, it makes sense
to define the Boolean step variables as S1, S2, S3, S4, and S5. S1 will be initialised as TRUE,
while all other variables will be initialised as FALSE. At the end of each step, the current step
variable will be reset (to zero) and the next step variable will be set (to one). Turning on and off
valves will be implemented using the set and reset coils, while the delay and timer will be
244
implemented using the built-in time function (TON). Rung numbers have been added in multiples
of 5. Finally, it can be noted that in this particular recipe each set has a corresponding reset. This
is a feature of many recipes that will be made explicit in the PLC programming language sequential
function charts. Figure 100 shows the final programme using ladder logic.
245
Section 7.5: Instruction List (IL)
Instruction list (IL) is a language similar to assembly language. This language is a simple
list of instructions, each of which is placed on a separate line. Each instruction has the following
form:
Label: Operator/Function Operand(list) Comments
where Label names a given row of instructions and along with the colon can be ignored; the
Operator or Function is an operator in instruction list or a function, Operand is zero, one,
or more constants or variables for the operator or input parameters for the functions that are
separated by commas; and Comments is an optional field that provides additional information
about what the given instruction row does. All fields in italics are optional.
246
The IEC 61131-3 standard itself does not define any operator groups. In fact, the behaviour
and evaluation of the current result is only partially described in the standard. With operations such
as AND, the type and content of the current result is intuitively clear both before and after execution.
However, the standard leaves open the question of how the current result is defined after an
unconditional jump.
Table 36: Changes in the Current Result for Different Operator Groups
LD N ANY Load
ST N ANY Save
S BOOL Set
R BOOL Reset
AND / & N, ( ANY Boolean AND
247
Operator Acceptable Modifiers Operand Definition
OR N, ( ANY Boolean OR
XOR N, ( ANY Boolean Exclusive OR
ADD ( ANY Addition
SUB ( ANY Subtraction
MUL ( ANY Multiplication
DIV ( ANY Division
GT ( ANY > (Greater than)
GE ( ANY ≥ (Greater than and equal to)
EQ ( ANY = (Equal to)
NE ( ANY ≠ (Not equal to)
LT ( ANY < (Less than)
LE ( ANY ≤ (Less than and equal to)
JMP C, ( LABEL Jump to LABEL
CAL C, ( NAME Call function NAME.
RET C, ( Return from a function call
) Take the last deferred instruction
The current result can be linked with the result of an instruction sequence using the bracket
operators. When the modifier( appears, the associated operator, the value of the current result and
the data type of the current result are cached. The data type and value of the following line are
loaded into the current result. When the ) operator appears, the cached values and data type based
on the operator and modifiers are linked with the current result. The result is then stored as the
current result. Expressions in brackets can be nested.
248
Table 38: Two Possibilities for Calling the Function LIMIT(MN, IN, MX)
A function has at least one output parameter (function value) that is returned using the
current result. Should the function have additional output parameters, these can be returned using
parameter assignments. A call without formal parameters takes place in one line. The original order
of the output declarations must be observed. In the case of formal parameter assignments, this is
done line by line, followed by a closing bracket on its own line. With formal parameter assignment,
the output parameters are marked with =>, e.g., ENO => ErrorOut means that ENO is an output
value and is saved in the ErrorOut variable. The programming system assigns the function value
to a variable with the function name. This name is declared automatically and does not have to be
specified separately by the user in the declaration section of the calling block.
249
Table 39: Three Methods for Calling the Function Block TIME1(IN, PT) with output variables Q and ET.
250
Instruction (* Comments *) CR X1 X2 W1 FB1.i1 FB1.o1
SQRT Function: 10 1 0 10 1 103
sqrt(CR) → CR
ST Save CR → 10 1 0 10 10 103
FB1.il FB1.i1
CAL FB1 FB1: internal 10 1 0 10 10 112
computation
LD Load the 112 1 0 10 10 112
FB1.o1 output o1
from FB1 → CR
ST W1 Save CR → W1 112 1 0 112 10 112
GT 90 (CR > 90)? → 1 1 0 112 10 112
CR
251
Section 7.5.6: Comments
Instruction list is perfect for large Boolean networks. However, like with ladder logic, it is
inappropriate for sequence or recipe programming. Instruction list has no complex programming
flow concepts, such as loops. Finally, in instruction list, jumps should be avoided as they can lead
to inconsistencies during runtime.
AND
OR
252
Name Symbol Comments
This is placed within the function
block next to the corresponding
Rising Edge
variable in order to show a rising edge
transition.
This is placed within the function
Falling block next to the corresponding
Edge variable in order to show a falling
edge transition.
Leaves a POU and returns to the
Return
calling POU.
If the left connection snw 26 is TRUE,
Conditional
then exit the POU and return to the
Return
calling POU; otherwise ignored.
Jump to the network with the given
Jump
identifier NAME.
If the left connection snw26 is TRUE,
Conditional
jump to the network with the given
Jump
identifier NAME; otherwise ignored.
Inputs and outputs are defined upon first use. Figure 101 shows an example of a function
block diagram with common components. The exact method for labelling the variables is not
specified in the standard; any reasonable method can be used.
26
snw represents a subnetwork that returns a Boolean value.
253
Figure 101: Diagram Using the Function-Block Language
254
Figure 103: The Function Q = XY + XZ + YZ in the Function-Block Language
255
The IF command has many different forms. The obligatory components are the IF, THEN,
and END_IF commands. The IF command opens the IF block, while the END_IF closes it. The
other possibilities are the ELSE and ELSIF commands. The ELSE block is only performed if all
previous expressions have been evaluated as FALSE. The ELSIF block is only performed if all
previous expressions have been evaluated as FALSE and the corresponding Boolean expression is
TRUE. This command can be repeated as often as desired. This gives the following possibilities:
1) IF expression THEN code block; END_IF;
2) IF expression THEN code block; ELSE code block; END_IF;
3) IF expression THEN code block; ELSIF expression THEN code block; ELSIF expression
THEN code block; ELSE code block; END_IF;
The FOR command also has many different possibilities. The obligatory parts are FOR, TO,
DO, and END_FOR. The FOR command opens this code block and the END_FOR command closes
it. The TO command specifies the end value and the DO command closes the declaration line of
the FOR command. The optional part is the BY command that gives the step value. If no step value
is given using the BY command, then it is assumed that the step is one. The two possibilities for
the FOR command are:
1) FOR Counter := expression TO expression BY expression DO code block;
END_FOR;
2) FOR Counter := expression TO expression DO code block; END_FOR;
256
Keyword Description Example Comments
IF A>100 THEN
f:=1;
IF … THEN
ELSIF d=e THEN
ELSE, Selection of alternatives using
Branching f:=2;
ELSIF Boolean logic.
ELSE
END_IF
f:=4;
END_IF
CASE f OF
CASE … OF 1: g:=11;
Selects a code block based on the
ELSE Multiple Selection 2: g:=14;
value of the expression f.
END_CASE ELSE g:=-1;
END_CASE;
FOR h:=1 TO 10
FOR … TO …
BY 2 DO Repeated running of a code block
BY … DO FOR Loop
f[h/2]:=h; with start and end conditions.
END_FOR
END_FOR;
WHILE m>1 DO
WHILE … DO Repeated running of a code block
WHILE Loop n:=n/2;
END_DO with end conditions.
END_WHILE;
REPEAT
REPEAT …
i:=i*j; Repeated running of a code block
UNTIL REPEAT Loop
UNTIL i>10000 with end conditions.
END_REPEAT
END_REPEAT;
EXIT Breaking a loop EXIT; Immediate exit from a loop
Command
; Shows the end of a command.
delimiter
257
Table 42: Operators and their Priority in Structured Text
258
4: Empty the tank.
As necessary, the appropriate values are opened or closed to control the tank level. The stirrer can
only work if the tank is full; otherwise, the command is ignored.
Solution
(*Tank States*)
TYPE T_STATE:(FULL,NOT_EMPTY,EMPTY); END_TYPE;
(*Valve States*)
TYPE T_VALVE:(ON,OFF); END_TYPE;
FUNCTION_BLOCK Weightcontrol
VAR_IN
Command: INT;
Weight: Real;
Full_weight,Empty_weight: Real; (*Same data type declared on
one line*)
END_VAR;
VAR_OUTPUT
V1: T_VALVE := OFF;
V2: T_VALVE := OFF;
259
Speed: REAL := 0.0;
END_VAR;
VAR (*Internal Variables*)
State: T_STATE := EMPTY;
END_VAR;
(*Determine the Tank State: Compare the full and empty weights *)
IF Weight >= Full_weight THEN
State := FULL;
ELSIF Weight <= Empty_weight THEN
State := EMPTY;
ELSE
State := NOT_EMPTY;
END_IF;
(*Implementation of Commands: 1-Fill, 2-Stop, 3-Stir, 4-Empty*)
CASE Command OF
1: V2 := OFF;
V1 := SELECT(G := State=FULL,IN0 := ON,IN1 := OFF);
(*ON only if G is false*)
2: V2 := OFF;
V1 := OFF;
4: V1 := OFF;
V2 := ON;
END_CASE;
(*Stirrer Speed*)
Speed := SELECT(G := Command=3; IN0 := 0.0; IN1 := 100.0);
END_FUNCTION_BLOCK;
260
conversion of the programme into machine code cannot be directly influenced since it is performed
using a compiler. As well, the higher abstraction level brings with it a loss of efficiency, that is,
the translated programme is longer and slower.
Figure 105: Steps in Sequential Function Charts: (left) General Step and (right) Initial Step
The transition conditions are marked with a horizontal line with identifiers. The Boolean
description, often called a guard, shows the requirements for a transition to occur. The guard can
be written in any of the other PLC languages. Figure 106 shows some possibilities. The most
frequently used PLC languages for describing transitions is structured text, function-block
language, or ladder logic. Often, the guard is ignored.
261
Figure 106: Transitions Conditions in Different PLC Languages
When the POU is called, the specially marked initialisation step is made active. All the
assigned instructions will be performed. When the transition conditions become TRUE, the
initialisation step will be made inactive and the next step will be activated. When a transition
262
occurs, the active attribute (often called a token) is passed from the current active step to its
successor. This active attribute wanders through the individual steps, multiplying for parallel
branches, and coming together again. It may not be completely lost nor is uncontrolled distribution,
which occurs when multiple tokens are present in a single step, possible.
Figure 107: Components of an Action Block: a: Qualifier; b: Action Name; c: Indicator Variable; d: Process Description
263
Qualifier Short Name Description
D delay Means that the action is delayed by the specified time
before being implemented.
P pulse Means that the action occurs for a very short period of
time.
DS delayed and saved Means that the action is first delayed and then saved.
SD saved and delayed Means that the action is first saved and, then after the
delay, if the step is still active, implemented.
SL saved and time Means that a time-limited action is saved.
limited
264
Figure 108: Alternative Paths in Sequential Function Charts
Figure 109: Usual Decision Order for Alternative Paths in Sequential Function Charts
Figure 110: User-Defined Decision Order for Alternative Paths in Sequential Function Charts
265
Figure 111: Parallel Paths in Sequential Function Charts
266
Figure 112: Schematic of the Reactor
Solution
Before the solution to the problem is provided, it is useful to consider the general procedure
for solving such problems. This procedure can be written as
1. Define all the variables and their values, especially for the Boolean variables.
2. Write the process description as a series of steps. Note that a single sentence can be
associated with multiple steps or multiple sentences can be combined into a single step.
3. Draw the sequential function chart.
Defining the Variables
The variables are defined as follows.
Input Variable Symbol Data Type Logical Values Address
Start Button START BOOL Pressed START = 1 E 0.0
Reactor Status S1 BOOL Tank empty S1 = 1 E 0.1
Level Sensor 1 S2 BOOL Level 1 reached S2 = 1 E 0.2
Level Sensor 2 S3 BOOL Level 2 reached S3 = 1 E 0.3
Temperature Sensor S4 BOOL Temperature S4 = 1 E 0.4
reached
267
Input Variable Symbol Data Type Logical Values Address
Pressure Sensor S5 BOOL High-Pressure S5 = 1 E 0.5
Alarm
Valve 1 Y1 BOOL Valve open Y1 = 1 A 4.1
Valve 2 Y2 BOOL Valve open Y2 = 1 A 4.2
Release Valve Y3 BOOL Valve open Y3 = 1 A 4.3
Pressure Release Y4 BOOL Valve open Y4 = 1 A 4.4
Valve
Heater H BOOL Heater on H = 1 A 4.5
Agitator Motor M BOOL Motor on M = 1 A 4.6
Figure 113 shows the sequential function chart along with the corresponding text, so that is clear
how each of the components were created.
268
Section 7.8.5: Validity of a Sequential Function Chart
With sequential function charts, it is easy to create complex networks. However, the
question remains if these networks are truly valid and result in proper operation.
Although there exists a method to determine the validity of a sequential function chart, it
is not guaranteed that it will find all valid networks. The proposed method only determines if the
network is valid. If the method fails, there is no guarantee that the chart is truly invalid. The
procedure is:
1) Replace all step-transition-step by a
single step.
269
The validity is then determined using the following rule: A sequential function chart is valid when
the chart can be reduced to a single, implementable step.
Example 48: Determining the Validity of a Network
Determine the validity of the sequential function chart shown in Figure 114.
Figure 114: Sequential Function Chart that is to be Checked for Its Validity
Solution
The method is followed until no further reductions can be produced. The first step is to
apply Rule #1 to give Figure 115.
270
Then, Rules #4 and 5 can be applied to give Figure 116.
271
Figure 118: Fourth and Final Reduction
The reduced chart is obviously valid, since it contains only a single step and a single transition.
Thus, we can conclude that the proposed sequential function chart is in fact valid.
272
Section 7.10.1: Basic Concepts
Determine if the following statements are true or false and state why this is the case.
1) Global variables can only be used in a single resource.
2) A nonpre-emptive task must always be completed before another task can be started.
3) 1Prog12 is a valid function name.
4) According to the IEC standard, TUI_124 and TUI_12456 are equal.
5) T#4d4.2h represents 4 days and 4.2 hours.
6) LE means less than.
7) A task with a priority value of 3 has the highest priority.
8) In the function-block language, a double arrow denotes a jump between two parts of the
function-block network.
9) In the function-block language, we can use &.
10) In ladder logic, a coil can be used to save a value.
11) In ladder logic, we can create feedback loops.
12) In instruction list, the statement SN HIPPO is a valid one.
13) In instruction list, the brackets () delay the implementation of an instruction.
14) In structured text OR has a higher priority compared to AND.
15) In structured text, we can use the CASE command.
16) In sequential function charts, N means that as soon as the step is ended, the action is stopped.
17) In sequential function charts, R means that an action is delayed by the given time.
18) In sequential function charts, it is possible to determine the validity of the resulting chart.
19) Ladder logic is a great idea to create complex, high-level PLC programmes.
20) Instruction list is designed for simple, optimised PLC programmes.
273
Figure 119: Validity of the Sequential Function Chart
22) Give the sequential function charts for the controlling the following systems:
a. Stirring process: Figure 120 shows the P&ID diagram of a stirred tank B with flow
controller US2. The binary input signals to US2 are the high-level alarm L, the start
signal S and the end signal E. The binary output signals from US2 are V1 for
switching the input valve, V2 for switching the drain valve, and R for switching the
stirrer motor. The following sequence is required: After the start signal reaches 1
(S = 1), a liquid is to be dosed by opening the input valve (with V1 = 1) and turning
the stirrer on (R = 1) until the level L reaches its upper limit (L = 1). Then, valves
are closed and the stirrer should alternately between being switched on for 1 min
and switched off for 1 min. This switching on and off should, regardless of the
current cycle, be ended immediately when the end button is pressed (E = 1). Then
the drain valve should be opened for 5 minutes. Then everything should be switched
274
into the idle state, that is, V1 = V2 = R = 0. When S = 1, the process is started from
the beginning.
b. Washing Machine: The control for a simple washing machine, shown in Figure
121 whose variables are defined in Table 44, should implement the following
sequence. After the input signal START has a value of 1, valve V1 should be opened
until the binary level sensor L1 reports that the desired water level has been reached.
Then, the MOTOR of the washing drum should be switched on alternately for a
period of time T_on and switched off for a period of time T_off. During this
alternating switching on and off, the electrical HEATING is first switched on until
the water temperature has reached a certain value, which is reported by the binary
sensor T2. Then, the process should wait a certain minimum waiting time T_wait
before any further heating occurs. Once the motor has stopped running, the
alternative switching of the heating is also stopped. Then, the PUMP is switched on
275
and valve V2 is opened at the same time. Once the level sensor L0 reports an empty
drum, the initial state is reached, and the process can be repeated.
23) In the examples below, various Boolean functions of the form Q = f(X, Y, Z) are given.
For each, please provide a) the function in its sum-of-products and product-of-sums forms,
276
b) the reduced function found using a Karnaugh diagram; and c) the PLC programme using
instruction list, ladder logic, and function-block language for the minimised function.
a. The function shown using ladder logic in Figure 122.
b. The function that implements a majority decision rule for a 2-out-of-3 redundancy
system, that is, the output Q is 1 if and only if at least two of the inputs are 1.
c. The function shown by the truth table in Table 45.
d. The function shown by the truth table in Table 46.
e. The function Q = f(B, G, M) is described as follows:
i. Three sensors in a sorting system measure the properties of parts and deliver
the following binary signals to the inputs of a PLC:
1. B, where B = 1 means a hole is present,
2. G, where G = 1 means green paint is present, and
3. M, where M = 1 means a metallic material is present.
ii. Parts produced without errors have the following properties:
1. Either metallic and green (with or without a hole)
2. Nonmetallic, not green, and with a hole.
iii. The output Q of the PLC should be 1 when the part is to be rejected, i.e., if
it does not have the above properties of a faultlessly produced part.
X 0 0 0 0 1 1 1 1
Y 0 0 1 1 0 0 1 1
Z 0 1 0 1 0 1 0 1
277
Q 0 1 1 0 1 1 1 1
X 0 0 0 0 1 1 1 1
Y 0 0 1 1 0 0 1 1
Z 0 1 0 1 0 1 0 1
Q 0 0 1 1 1 0 1 1
278
Chapter 8: Safety in the Automation
Industry
As automation becomes more widespread, there is a corresponding need to consider the
safety of those who come in contact with the automated systems. Furthermore, automated systems
need to take into consideration safety constraints themselves when they implement various actions.
For these reasons, it is helpful to briefly review the different safety regulations. Obviously, it is
always your engineering obligation to make sure that you have checked the most recent and most
relevant regulations and laws applying to your specific situation.
In general, safety can be divided into two parts: physical and digital. Physical safety
considers the steps and regulations required to ensure that the plant and its surroundings are safe
for the workers, visitors, and the environment. Environmental protection considers not only
hazardous substances, but also the emission of electromagnetic radiation or noise. Digital safety
considers the steps required to ensure that the communication networks and the associated devices
cannot be hacked and used to create an unsafe physical situation. Furthermore, digital safety must
ensure that no sensitive information can be stolen or used in an inappropriate manner. This aspect
is very important given the increasing legislative interest in making sure that confidential personal
information remains confidential.
279
3) Work, which is energy stored in springs, electrical circuits, and other devices. When
released, this can lead to catastrophic failure and impressive damage. A common electrical
example is a short circuit.
4) Heat, which is energy crossing a boundary. Heat exchange is always based on a
temperature difference between two points in space. Since heat always influences the
environment, touching hot surfaces, for example, can lead to burns. The same situation
applies to touching very cold surfaces, which can also lead to burns or frostbite.
In order to increase the safety of a physical system, it can be useful to consider the following steps
when designing the overall system:
1) Minimise: Avoid using (or use as little as possible) any hazardous substances.
2) Substitute: Replace hazardous substances by ones that are less hazardous but with similar
properties.
3) Moderate: Replace extreme operating conditions by ones that are less severe.
4) Simplify: Create designs or processes that are less complex and simpler.
5) Isolate: Create situations where the effect of a hazard has minimal effect on the overall
system, for example, physically separating the office space from the production area.
The above ideas can be framed within the inherently safer predesign (ISPD) approach, which
consists of the following 4 steps:
1) Identify: Determine what the hazards are and how they can affect the process.
2) Eradicate: Remove the effects of as many of the hazards as possible, for example, by
designing fail-safe systems, that is, should a system encounter a failure it ends up in an
inherently safe mode that cannot cause further problems. A common example of this is the
design of control valves to fail open or closed depending on the process conditions, for
example, a control valve for a critical cooling jacket should fail open so that the system
remains cooled even if the valve has failed.
3) Minimise, simplify, and moderate: If a hazard cannot be eradicated, then try and limit its
effects on the system.
4) Isolate: Create structures that will limit the amount of damage that can occur, for example,
by segregating hazardous operations.
Another approach to this situation is to perform a hazard-and-operability study (HAZOP) to
determine where the given hazards lie and how best to mitigate them. The HAZOP procedure
280
consists of the following four steps: determine, using a systematic search, possible faults; find the
causes for the faults; estimate the effects of the faults on the system; and suggest appropriate
countermeasures. A HAZOP requires that a detailed plan of the process be available. Thus, such
analysis is often performed at a later stage of design after the overall process design has already
been completed. This implies that, due to the high cost or structural changes required, it could be
too late to make substantive changes at this point. Thus, HAZOPs are often used to provide an
understanding of the hazards present and their risk.
Finally, it can be mentioned that when designing safety systems, it is useful to consider
redundancy, that is, having more than one channel or way to achieve a given task. As well, this
implies that different channels should be used for different tasks (control, alarm, and monitoring),
so that there is less risk of catastrophic failure. Thus, for example, alarms and monitoring should
not occur on the same channel. If it should fail, alarm signals can no longer be transmitted in
addition to the less important monitoring signals. There are two main ways to implement
redundancy. In the first approach, often called homogeneous redundancy, the same task is
implemented by multiple (identical or similar) devices, for example, the temperature is measured
using three temperature sensors at the same point. However, this approach carries the risk that
systematic errors in the sensors or devices are propagated into the system. In the second approach,
often called heterogeneous redundancy or redundancy by diversity, the same task is
implemented using different devices, for example, three separate path-planning computer systems
that use different computational algorithms could be implemented and the decision taken by
majority vote, that is, if two or more algorithms give the same result it is followed. Selecting the
appropriate approach depends on the requirements and standards of the process.
281
where F is the occurrence frequency, P is the probability that the hazard cannot be mitigated, and
W is the probability that without any safety system in place an undesired state will be reached.
Since it makes little sense to define the risk with an exact value, it is common to instead associate
a given level to the individual variables and look at the combination of levels.
For C, the following levels are defined:
• C1: Minor injuries
• C2: Major or permanent injuries of one or more people or a single death
• C3: Up to five deaths
• C4: More than five deaths.
For F, two levels are defined:
• F1: During the course of the day, people are in the danger zone less than or equal to
10% of the time.
• F2: During the course of the day, people are in the danger zone more than 10% of the
time.
For P, two levels are defined:
• P1: It is possible to mitigate the hazard (one should provide the appropriate steps to do
so).
• P2: It is not possible to mitigate the hazard.
For W, three levels are defined:
• W1: The undesired state will occur less than once every ten years.
• W2: The undesired state will occur less than once per year.
• W3: The undesired state will occur more often than once per year.
The above levels are then combined to give an overall safety integrity level (SIL). There are four
safety integrity levels labelled SIL1 to SIL4, where the larger number reflects a more hazardous
level. The relationship between the different parameters is shown in Figure 123.
282
Figure 123: Relationship between the Parameters and the Safety-Integrity Levels
283
1) DIN 31635 which standardises the transliteration of the Arabic script used to write Arabic,
Ottoman Turkish, Iranian, Kurdish, Urdu, and Pasto
2) DIN EN ISO 216 which standardises writing paper and certain classes of printed matter,
trimmed sizes, A and B series, and indication of machine direction
3) DIN ISO 509 which covers the production of technical drawings, relief grooves, and types
and dimensions of them.
4) DIN EN 772-7 which covers clay masonry units, namely the determination of water
absorption of clay masonry damp proof course units by boiling water.
Other countries use similar systems, for example, Austria prefixes its codes with ÖNORM
while the United States of America uses the ANSI system.
Safety regulations in Germany (and most of Europe) for machines can be split into three
types:
• Type A Regulations: These regulations cover the basic safety concepts, design
principles, and general aspects of machines. An example of a Type A regulation is the
EN ISO 12100 standard that provides the general principles of design.
• Type B Regulations: These regulations are baseline safety standards and requirements
for protective equipment. There are two subtypes: B1-Regulations that cover specific
safety aspects and B2-Regulations that cover the standards for protective equipment
required for machines. An example of a Type B1 regulation is the EN ISO 13855
standard that provides the guidelines for the arrangement of protective devices, while a
Type B2 regulation would be the EN 953 standard that considers fixed guards for
machines.
• Type C Regulations: These regulations are the specific safety standards for a particular
machine or group of machines. An example of a Type C regulation would be the EN
693 standard that provides the standards for hydraulic presses.
284
company to various threats including loss of proprietary information, damage to the process by
illegal changing of process operating conditions, and legal issues due to distribution of confidential
personal information.
Digital security can be achieved by creating strong passwords, changing the passwords on
a regular basis, and checking for any intruders. Strong antivirus software should also be
implemented. Multiple interacting networks should be considered to provide additional levels of
security. Finally, the workers should be educated in proper digital safety as the digital system is
only as strong as its weakest link. People placing unknown USB-drivers into work computers can
easily introduce unwanted viruses into the company network.
285
6) Designing complex processes is a good risk-mitigation strategy.
7) The fail-safe principle states that a failing system should always end up in a safe mode.
8) Using the fail-safe principle, valves should always fail closed.
9) A HAZOP seeks to identify the risks and how best to mitigate them.
10) Redundancy means that a single temperature sensor is used for process monitoring and
process control.
11) Selecting a course of action based on two-out-of-three voting is an example of redundancy
by diversity.
12) A risk with an occurrence frequency greater than 10% is always an SIL 4 risk.
13) A risk with a hazard-impact level of C3 implies that it can cause only minor injuries.
14) A risk with a mitigation level of P2 implies that it cannot be mitigated.
15) A risk with a W level of W3 implies that the undesired state will occur more often than
once per year.
16) In Germany, Type A regulations cover the detailed requirements for the safety of a specific
machine.
17) An example of a B2 regulation would be the design of protective guards for machines.
18) An example of a C regulation would be the standards for the design of chemical reactors.
19) Using simple passwords and minimal digital security is a good idea for a critical chemical
process.
286
b. Propene (C3H6), which is produced from ethene and 2-butene.
22) Perform a HAZOP on the compressor unit shown in Figure 124.
287
Bibliography
Åström, K. J., & Hägglund, T. (1995). PID controllers: theory, design, and tuning (2 ed.).
Research Triangle Park, North Carolina, USA: Instrument Society of America.
Carroll, J., & Long, D. (1989). Theory of Finite Auotmata with an Introduction to Formal
Languages. Englewood Cliffs, New Jersey, USA: Prentice-Hall.
Cassandras, C. G., & Lafortune, S. (2008). Introduction to Discrete Event Systems (2 ed.). New
York, New York, USA: Springer.
Doetsch, G. (1974). Introduction to the Theory and Application of the Laplace Transform. Berlin,
Germany: Springer.
El Attar, R. (2004). Lecture notes on Z-Transform. Morrisville, North Carolina, USA: Lulu Press.
Green, D. W. (Ed.). (2018). Perry’s Chemical Engineers’ Handbook (85th ed.). New York, New
York, USA: McGraw-Hill.
Halmos, P., & Givant, S. (2009). Introduction to Boolean Algebras. New York, New York, USA:
Springer.
John, K.-H., & Tiegelkamp, K. (2009). IEC 61131-3: Programming Industrial Automation
Systems: Concepts and Programming Languages, Requirements for Programming Systems,
Decision-Making Aids (2nd ed.). Berlin, Germany: Springer-Verlag.
Kreyszig, E. (2011). Advanced Engineering Mathematics (10 ed.). New York, New York, USA:
Wiley.
Liu, L., Tian, S., Xue, D., Zhang, T., & Chen, Y. (2019). Industrial feedforward control
technology: a review. Journal of Intelligent Manufacturing, 30, 2819-2833.
Lundberg, K. H., Miller, H. R., & Trumper, D. L. (2007). Initial Conditions, Generalizerd
Functions, and the Laplace Transform: Troubles at the Origin. IEEE Control Systems
Magazine, 27(1), 22-35. doi:10.1109/MCS.2007.284506
Ogata, K. (1995). Discrete-time control systems (2 ed.). Upper Saddle River, New Jersey, USA:
Prentice-Hall.
Rawlings, J. B., Mayne, D. Q., & Diehl, M. M. (2017). Model Predictive Control: Theory,
Computation, and Design (2nd ed.). Madison, United States of America: Nob Hill
Publishing.
288
Seborg, D. E., Edgar, T. F., Mellichamp, D. A., & Doyle, F. J. (2011). Process Dyanamics and
Control (3rd ed.). Hoboken, New Jersey, United States of America: John Wiley & Sons,
Inc.
Shardt, Y. A. (2012). Data Quality Assessment for Closed-Loop System Identification and
Forecasting with Application to Soft Sensors. Edmonton, Alberta, Canada: University of
Alberta. doi:http://hdl.handle.net/10402/era.29018
Shardt, Y. A., Zhao, Y., Qi, F., Lee, K. H., Yu, X., Huang, B., & Shah, S. (2012, April).
Determining the State of a Process Control System: Current Trends and Future Challenges.
Canadian Journal of Chemical Engineering, 217-245. doi:10.1002/cjce.20653
Shoukat Choudhury, M. A., Thornhill, N. F., & Shah, S. L. (2005). Modelling valve stiction.
Control Engineering Practice, 641-658.
Skogestad, S. (2023). Advanced control using decomposition and simple elements. Annual
Reviews in Control, 56, 100903. doi:10.1016/j.arcontrol.2023.100903
Sontag, E. D. (1998). Mathematical Control Theory: Deterministic Finite Dimensional Systems.
New York, New York, USA: Springer.
Toghraei, M. (2019). Piping and Instrumentation Diagram Development. Hoboken, New Jersey,
USA: Wiley.
Ulrich, G. D., & Vasudevan, P. T. (2004). Chemical Engineering Process Design and Economics:
A Practical Guide (Second ed.). Durham, New Hampshire, USA: Process Publishing.
Visioli, A. (2006). Practical PID control. London, UK: Springer-Verlag.
289
Appendix I: Partial Fractioning
When solving equations in the frequency domain and it is desired to convert them back
into the time domain, it may be necessary to perform partial fractioning to obtain a solution.
Although there exist many different approaches, the following is one simple method that will allow
the final result to be obtained easily. Consider a rational function of the form:
N (s) N (s)
= (252)
D (s) nl nq
∏ ( α s + β ) ∏ (α s + β js + γ j )
ni 2 nj
i i j
=i 1 =j 1
where nl represents the number of distinct linear terms, nq the number of distinct irreducible
quadratics (those that have imaginary roots as their solution), and α, β, and γ are known constants.
Let n be the overall order of the system. In order to perform partial fractioning, write the following
fraction depending on the form of the root:
n
Bk
1) For each linear term (αs + β)n, put the term, ∑ .
(α s + β )
k
k =1
m
Ak + Bk s
2
2) For each irreducible quadratic term, (αs + βs + γ) , put the term, m
∑ .
(α s + βs +γ )
2 k
k =1
Once the form of the partial fractioning solution has been obtained, it is necessary to solve for the
unknown parameters. First, cross-multiply, so that the denominators are the same. Then, it is
necessary to solve for the unknown parameters by equating the unknown side with the known N(s).
The easiest way to solve this is using the following approach:
1) For each linear term, set s = −β / α to obtain Bn of the linear terms. This will reduce the
nl nq
equation to the form Bn ∏ (α i s + β i ) i ∏ (α j s 2 + β j s + γ j ) j =
n
N ( s ) evaluated at the
n
=i 1 =j 1
i≠n
given root.
2) For each quadratic term, set s equal to the imaginary roots. This will also reduce the
equation to a simpler form and allow for An and Bn to be solved.
For the remaining terms, create a system of equations by selecting different values of s and
evaluating the known values, so that the remaining unknowns can be solved. You will need n –
nl – 2nq equations in order to find the remaining n – nl – 2nq terms.
290
Example 49: Partial Fractioning
Consider the following fraction
3s + 1
(253)
( s + 2 )( s + 1)
2
( s 2 + 1)
for which we wish to determine the partial fraction form.
Solution
First, we need to write the general form, that is, for each of the terms in the denominator,
we will write the corresponding partial fraction using the rules above. This will give
A B C Ds + E
+ + + 2 (254)
s + 2 s + 1 ( s + 1) 2
s +1
It can be noted that for the first term s + 2, as well as the last term s2 + 1, there will only be a single
component, since its exponent is one. For the middle term, (s + 1)2, there will be two terms, since
the exponent is two. For the linear terms, we set a simple constant term in the numerator, while for
the quadratic term, we include a linear term in the numerator.
Next, we need to determine the values of the constants in the numerator. Before doing this,
let us cross-multiply and determine the general form of the numerator
A ( s + 1) ( s 2 + 1) + B ( s + 2 )( s + 1) ( s 2 + 1) + C ( s + 2 ) ( s 2 + 1) + ( Ds + E )( s + 2 )( s + 1) = 3s + 1 (255)
2 2
As was previously mentioned, we can see that setting s = −1 or −2 will cancel every term but one,
allowing us to effortless compute that term. This gives for s = −1
( )
C ( −1 + 2 ) ( −1) + 1 = 3 ( −1) + 1
2
(256)
−2
C= = −1
2
Similarly, for s = −2, we get
A ( −2 + 1)
2
(( −2) + 1) =
2
3 ( −2 ) + 1
(257)
−5
A= = −1
5
For the quadratic term, we can set s = ±j, which will give us a linear system of equations in two
unknown (D and E) that we can then solve to obtain the value of D and E. This gives
( Dj + E )( j + 2 )( j + 1) =3 j + 1
2
(258)
( − Dj + E )( − j + 2 )( − j + 1) =−3 j + 1
2
291
Placing all the constant terms on the right gives
Dj + E = 0.5 − 0.5 j
(259)
− Dj + E = 0.5 + 0.5 j
Adding the two equations together gives that E = (0.5 + 0.5)/2 = 0.5. From this, it follows that D
= −0.5. It can be noted that these two equations will always be complex conjugates of each other
and one can use this fact to solve them without necessarily computing both components.
The remaining term B can be found by selecting an arbitrary value of s (that has not already
been used) and solving Equation (255). The known constants are inserted as required. Setting s =
0, we get
292