Academia.eduAcademia.edu

Advanced Control Engineering

AI-generated Abstract

This research focuses on advanced control engineering concepts, particularly the analysis and design of dynamic systems. It delves into time domain responses of first and second-order systems, detailing key characteristics such as impulse and step responses, experimental determinations of time constants, and the implications of system dynamics in control strategies. The findings provide foundational knowledge necessary for understanding complex control systems and inform future developments in automation and robotics.

Advanced Control Engineering In fond memory of my mother Advanced Control Engineering Roland S. Burns Professor of Control Engineering Department of Mechanical and Marine Engineering University of Plymouth, UK OXFORD AUCKLAND BOSTON JOHANNESBURG MELBOURNE NEW DELHI Butterworth-Heinemann Linacre House, Jordan Hill, Oxford OX2 8DP 225 Wildwood Avenue, Woburn, MA 01801-2041 A division of Reed Educational and Professional Publishing Ltd A member of the Reed Elsevier plc group First published 2001 # Roland S. Burns 2001 All rights reserved. No part of this publication may be reproduced in any material form (including photocopying or storing in any medium by electronic means and whether or not transiently or incidentally to some other use of this publication) without the written permission of the copyright holder except in accordance with the provisions of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road, London, England W1P 9HE. Applications for the copyright holder's written permission to reproduce any part of this publication should be addressed to the publishers British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library Library of Congress Cataloguing in Publication Data A catalogue record for this book is available from the Library of Congress ISBN 0 7506 5100 8 Typeset in India by Integra Software Services Pvt. Ltd., Pondicherry, India 605 005, www.integra-india.com Contents     1 2   INTRODUCTION TO CONTROL ENGINEERING 1.1 Historical review 1.2 Control system fundamentals 1.2.1 Concept of a system 1.2.2 Open-loop systems 1.2.3 Closed-loop systems 1.3 Examples of control systems 1.3.1 Room temperature control system 1.3.2 Aircraft elevator control 1.3.3 Computer Numerically Controlled (CNC) machine tool 1.3.4 Ship autopilot control system 1.4 Summary 1.4.1 Control system design SYSTEM MODELLING 2.1 Mathematical models 2.2 Simple mathematical model of a motor vehicle 2.3 More complex mathematical models 2.3.1 Differential equations with constant coefficients 2.4 Mathematical models of mechanical systems 2.4.1 Stiffness in mechanical systems 2.4.2 Damping in mechanical systems 2.4.3 Mass in mechanical systems 2.5 Mathematical models of electrical systems 2.6 Mathematical models of thermal systems 2.6.1 Thermal resistance T 2.6.2 Thermal capacitance T 2.7 Mathematical models of fluid systems 2.7.1 Linearization of nonlinear functions for small perturbations 2.8 Further problems xii 1 1 3 3 5 5 6 6 7 8 9 10 10 13 13 13 14 15 15 15 16 17 21 25 25 26 27 27 31 vi  3 4 TIME DOMAIN ANALYSIS 3.1 Introduction 3.2 Laplace transforms 3.2.1 Laplace transforms of common functions 3.2.2 Properties of the Laplace transform 3.2.3 Inverse transformation 3.2.4 Common partial fraction expansions 3.3 Transfer functions 3.4 Common time domain input functions 3.4.1 The impulse function 3.4.2 The step function 3.4.3 The ramp function 3.4.4 The parabolic function 3.5 Time domain response of first-order systems 3.5.1 Standard form 3.5.2 Impulse response of first-order systems 3.5.3 Step response of first-order systems 3.5.4 Experimental determination of system time constant using step response 3.5.5 Ramp response of first-order systems 3.6 Time domain response of second-order systems 3.6.1 Standard form 3.6.2 Roots of the characteristic equation and their relationship to damping in second-order systems 3.6.3 Critical damping and damping ratio 3.6.4 Generalized second-order system response to a unit step input 3.7 Step response analysis and performance specification 3.7.1 Step response analysis 3.7.2 Step response performance specification 3.8 Response of higher-order systems 3.9 Further problems 35 35 36 37 37 38 39 39 41 41 41 42 42 43 43 44 45 52 55 55 57 58 60 CLOSED-LOOP CONTROL SYSTEMS 4.1 Closed-loop transfer function 4.2 Block diagram reduction 4.2.1 Control systems with multiple loops 4.2.2 Block diagram manipulation 4.3 Systems with multiple inputs 4.3.1 Principle of superposition 4.4 Transfer functions for system elements 4.4.1 DC servo-motors 4.4.2 Linear hydraulic actuators 4.5 Controllers for closed-loop systems 4.5.1 The generalized control problem 4.5.2 Proportional control 4.5.3 Proportional plus Integral (PI) control 63 63 64 64 67 69 69 71 71 75 81 81 82 84 46 47 49 49 49 51  vii 4.6 4.7 5 6 7 4.5.4 Proportional plus Integral plus Derivative (PID) control 4.5.5 The Ziegler±Nichols methods for tuning PID controllers 4.5.6 Proportional plus Derivative (PD) control Case study examples Further problems CLASSICAL DESIGN IN THE s-PLANE 5.1 Stability of dynamic systems 5.1.1 Stability and roots of the characteristic equation 5.2 The Routh±Hurwitz stability criterion 5.2.1 Maximum value of the open-loop gain constant for the stability of a closed-loop system 5.2.2 Special cases of the Routh array 5.3 Root-locus analysis 5.3.1 System poles and zeros 5.3.2 The root locus method 5.3.3 General case for an underdamped second-order system 5.3.4 Rules for root locus construction 5.3.5 Root locus construction rules 5.4 Design in the -plane 5.4.1 Compensator design 5.5 Further problems 89 90 92 92 104 110 110 112 112 114 117 118 118 119 122 123 125 132 133 141 CLASSICAL DESIGN IN THE FREQUENCY DOMAIN 6.1 Frequency domain analysis 6.2 The complex frequency approach 6.2.1 Frequency response characteristics of first-order systems 6.2.2 Frequency response characteristics of second-order systems 6.3 The Bode diagram 6.3.1 Summation of system elements on a Bode diagram 6.3.2 Asymptotic approximation on Bode diagrams 6.4 Stability in the frequency domain 6.4.1 Conformal mapping and Cauchy's theorem 6.4.2 The Nyquist stability criterion 6.5 Relationship between open-loop and closed-loop frequency response 6.5.1 Closed-loop frequency response 6.6 Compensator design in the frequency domain 6.6.1 Phase lead compensation 6.6.2 Phase lag compensation 6.7 Relationship between frequency response and time response for closed-loop systems 6.8 Further problems 145 145 147 147 DIGITAL CONTROL SYSTEM DESIGN 7.1 Microprocessor control 7.2 Shannon's sampling theorem 198 198 200 150 151 152 153 161 161 162 172 172 178 179 189 191 193 viii  7.3 7.4 7.5 7.6 7.7 7.8 8 9 Ideal sampling The -transform 7.4.1 Inverse transformation 7.4.2 The pulse transfer function 7.4.3 The closed-loop pulse transfer function Digital control systems Stability in the -plane 7.6.1 Mapping from the -plane into the -plane 7.6.2 The Jury stability test 7.6.3 Root locus analysis in the -plane 7.6.4 Root locus construction rules Digital compensator design 7.7.1 Digital compensator types 7.7.2 Digital compensator design using pole placement Further problems 201 202 204 206 209 210 213 213 215 218 218 220 221 224 229 STATE-SPACE METHODS FOR CONTROL SYSTEM DESIGN 8.1 The state-space-approach 8.1.1 The concept of state 8.1.2 The state vector differential equation 8.1.3 State equations from transfer functions 8.2 Solution of the state vector differential equation 8.2.1 Transient solution from a set of initial conditions 8.3 Discrete-time solution of the state vector differential equation 8.4 Control of multivariable systems 8.4.1 Controllability and observability 8.4.2 State variable feedback design 8.4.3 State observers 8.4.4 Effect of a full-order state observer on a closed-loop system 8.4.5 Reduced-order state observers 8.5 Further problems 232 232 232 233 238 239 241 244 248 248 249 254 OPTIMAL AND ROBUST CONTROL SYSTEM DESIGN 9.1 Review of optimal control 9.1.1 Types of optimal control problems 9.1.2 Selection of performance index 9.2 The Linear Quadratic Regulator 9.2.1 Continuous form 9.2.2 Discrete form 9.3 The linear quadratic tracking problem 9.3.1 Continuous form 9.3.2 Discrete form 9.4 The Kalman filter 9.4.1 The state estimation process 9.4.2 The Kalman filter single variable estimation problem 9.4.3 The Kalman filter multivariable state estimation problem 272 272 272 273 274 274 276 280 280 281 284 284 285 286 260 262 266  ix 9.5 9.6 Linear Quadratic Gaussian control system design Robust control 9.6.1 Introduction 9.6.2 Classical feedback control 9.6.3 Internal Model Control (IMC) 9.6.4 IMC performance 9.6.5 Structured and unstructured model uncertainty 9.6.6 Normalized system inputs 2- and -optimal control 9.7.1 Linear quadratic 2-optimal control 9.7.2 H -optimal control Robust stability and robust performance 9.8.1 Robust stability 9.8.2 Robust performance Multivariable robust control 9.9.1 Plant equations 9.9.2 Singular value loop shaping 9.9.3 Multivariable 2 and  robust control 9.9.4 The weighted mixed-sensitivity approach Further problems 288 299 299 300 301 302 303 304 305 305 306 306 306 308 314 314 315 316 317 321 INTELLIGENT CONTROL SYSTEM DESIGN 10.1 Intelligent control systems 10.1.1 Intelligence in machines 10.1.2 Control system structure 10.2 Fuzzy logic control systems 10.2.1 Fuzzy set theory 10.2.2 Basic fuzzy set operations 10.2.3 Fuzzy relations 10.2.4 Fuzzy logic control 10.2.5 Self-organizing fuzzy logic control 10.3 Neural network control systems 10.3.1 Artificial neural networks 10.3.2 Operation of a single artificial neuron 10.3.3 Network architecture 10.3.4 Learning in neural networks 10.3.5 Back-Propagation 10.3.6 Application of neural networks to modelling, estimation and control 10.3.7 Neurofuzzy control 10.4 Genetic algorithms and their application to control system design 10.4.1 Evolutionary design techniques 10.4.2 The genetic algorithm 10.4.3. Alternative search strategies 10.5 Further problems 325 325 325 325 326 326 328 330 331 344 347 347 348 349 350 351 9.7 9.8 9.9 9.10 10 358 361 365 365 365 372 373 x  APPENDIX 1 CONTROL SYSTEM DESIGN USING MATLAB 380 APPENDIX 2 MATRIX ALGEBRA 424      428 433 List of Tables 3.1 3.2 3.3 3.4 4.1 4.2 4.3 5.1 5.2 6.1 6.2 6.3 6.4 6.5 7.1 7.2 7.3 7.4 9.1 9.2 10.1 10.2 10.3 10.4 10.5 10.6 10.7 Common Laplace transform pairs Unit step response of a first-order system Unit ramp response of a first-order system Transient behaviour of a second-order system Block diagram transformation theorems Ziegler±Nichols PID parameters using the process reaction method Ziegler±Nichols PID parameters using the continuous cycling method Roots of second-order characteristic equation for different values of  Compensator characteristics Modulus and phase for a first-order system Modulus and phase for a second-order system Data for Nyquist diagram for system in Figure 6.20 Relationship between input function, system type and steady-state error Open-loop frequency response data Common Laplace and -transforms Comparison between discrete and continuous step response Comparison between discrete and continuous ramp response Jury's array Variations in dryer temperature and moisture content Robust performance for Example 9.5 Selection of parents for mating from initial population Fitness of first generation of offsprings Fitness of second generation of offsprings Parent selection from initial population for Example 10.6 Fitness of first generation of offsprings for Example 10.6 Fitness of sixth generation of offsprings for Example 10.6 Solution to Example 10.8 38 45 48 50 67 91 91 121 133 149 150 167 170 195 204 209 209 216 292 313 367 368 368 370 371 371 376 Preface and acknowledgements The material presented in this book is as a result of four decades of experience in the field of control engineering. During the 1960s, following an engineering apprenticeship in the aircraft industry, I worked as a development engineer on flight control systems for high-speed military aircraft. It was during this period that I first observed an unstable control system, was shown how to frequency-response test a system and its elements, and how to plot a Bode and Nyquist diagram. All calculations were undertaken on a slide-rule, which I still have. Also during this period I worked in the process industry where I soon discovered that the incorrect tuning for a PID controller on a 100 m long drying oven could cause catastrophic results. On the 1st September 1970 I entered academia as a lecturer (Grade II) and in that first year, as I prepared my lecture notes, I realized just how little I knew about control engineering. My professional life from that moment on has been one of discovery (currently termed `life-long learning'). During the 1970s I registered for an M.Phil. which resulted in writing a FORTRAN program to solve the matrix Riccati equations and to implement the resulting control algorithm in assembler on a minicomputer. In the early 1980s I completed a Ph.D. research investigation into linear quadratic Gaussian control of large ships in confined waters. For the past 17 years I have supervised a large number of research and consultancy projects in such areas as modelling the dynamic behaviour of moving bodies (including ships, aircraft missiles and weapons release systems) and extracting information using state estimation techniques from systems with noisy or incomplete data. More recently, research projects have focused on the application of artificial intelligence techniques to control engineering projects. One of the main reasons for writing this book has been to try and capture four decades of experience into one text, in the hope that engineers of the future benefit from control system design methods developed by engineers of my generation. The text of the book is intended to be a comprehensive treatment of control engineering for any undergraduate course where this appears as a topic. The book is also intended to be a reference source for practising engineers, students undertaking Masters degrees, and an introductory text for Ph.D. research students.      xiii One of the fundamental aims in preparing the text has been to work from basic principles and to present control theory in a way that is easily understood and applied. For most examples in the book, all that is required to obtain a solution is a calculator. However, it is recognized that powerful software packages exist to aid control system design. At the time of writing, MATLAB, its Toolboxes and SIMULINK have emerged as becoming the industry standard control system design package. As a result, Appendix 1 provides script file source code for most examples presented in the main text of the book. It is suggested however, that these script files be used to check hand calculation when used in a tutorial environment. Depending upon the structure of the undergraduate programme, it is suggested that content of Chapters 1, 2 and 3 be delivered in Semester 3 (first Semester, year two), where, at the same time, Laplace Transforms and complex variables are being studied under a Mathematics module. Chapters 4, 5 and 6 could then be studied in Semester 4 (second Semester, year two). In year 3, Chapters 7 and 8 could be studied in Semester 5 (first Semester) and Chapters 9 and 10 in Semester 6 (second Semester). However, some of the advanced material in Chapters 9 and 10 could be held back and delivered as part of a Masters programme. When compiling the material for the book, decisions had to be made as to what should be included, and what should not. It was decided to place the emphasis on the control of continuous and discrete-time linear systems. Treatment of nonlinear systems (other than linearization) has therefore not been included and it is suggested that other works (such as Feedback Control Systems, Phillips and Harbor (2000)) be consulted as necessary. I would wish to acknowledge the many colleagues, undergraduate and postgraduate students at the University of Plymouth (UoP), University College London (UCL) and the Open University (OU) who have contributed to the development of this book. I am especially indebted to the late Professor Tom Lambert (UCL), the late Professor David Broome (UCL), ex-research students Dr Martyn Polkinghorne, Dr Paul Craven and Dr Ralph Richter. I would like to thank also my colleague Dr Bob Sutton, Reader in Control Systems Engineering, in stimulating my interest in the application of artificial intelligence to control systems design. Thanks also go to OU students Barry Drew and David Barrett for allowing me to use their T401 project material in this book. Finally, I would like to express my gratitude to my family. In particular, I would like to thank Andrew, my son, and Janet my wife, for not only typing the text of the book and producing the drawings, but also for their complete support, without which the undertaking would not have been possible. Roland S. Burns 1 Introduction to control engineering 1.1 Historical review Throughout history mankind has tried to control the world in which he lives. From the earliest days he realized that his puny strength was no match for the creatures around him. He could only survive by using his wits and cunning. His major asset over all other life forms on earth was his superior intelligence. Stone Age man devised tools and weapons from flint, stone and bone and discovered that it was possible to train other animals to do his bidding ± and so the earliest form of control system was conceived. Before long the horse and ox were deployed to undertake a variety of tasks, including transport. It took a long time before man learned to replace animals with machines. Fundamental to any control system is the ability to measure the output of the system, and to take corrective action if its value deviates from some desired value. This in turn necessitates a sensing device. Man has a number of `in-built' senses which from the beginning of time he has used to control his own actions, the actions of others, and more recently, the actions of machines. In driving a vehicle for example, the most important sense is sight, but hearing and smell can also contribute to the driver's actions. The first major step in machine design, which in turn heralded the industrial revolution, was the development of the steam engine. A problem that faced engineers at the time was how to control the speed of rotation of the engine without human intervention. Of the various methods attempted, the most successful was the use of a conical pendulum, whose angle of inclination was a function (but not a linear function) of the angular velocity of the shaft. This principle was employed by James Watt in 1769 in his design of a flyball, or centrifugal speed governor. Thus possibly the first system for the automatic control of a machine was born. The principle of operation of the Watt governor is shown in Figure 1.1, where change in shaft speed will result in a different conical angle of the flyballs. This in turn results in linear motion of the sleeve which adjusts the steam mass flow-rate to the engine by means of a valve. Watt was a practical engineer and did not have much time for theoretical analysis. He did, however, observe that under certain conditions the engine appeared to hunt, 2 Advanced Control Engineering Flyballs Sleeve Steam Valve Fig. 1.1         where the speed output oscillated about its desired value. The elimination of hunting, or as it is more commonly known, instability, is an important feature in the design of all control systems. In his paper `On Governors', Maxwell (1868) developed the differential equations for a governor, linearized about an equilibrium point, and demonstrated that stability of the system depended upon the roots of a characteristic equation having negative real parts. The problem of identifying stability criteria for linear systems was studied by Hurwitz (1875) and Routh (1905). This was extended to consider the stability of nonlinear systems by a Russian mathematician Lyapunov (1893). The essential mathematical framework for theoretical analysis was developed by Laplace (1749±1827) and Fourier (1758±1830). Work on feedback amplifier design at Bell Telephone Laboratories in the 1930s was based on the concept of frequency response and backed by the mathematics of complex variables. This was discussed by Nyquist (1932) in his paper `Regeneration Theory', which described how to determine system stability using frequency domain methods. This was extended by Bode (1945) and Nichols during the next 15 years to give birth to what is still one of the most commonly used control system design methodologies. Another important approach to control system design was developed by Evans (1948). Based on the work of Maxwell and Routh, Evans, in his Root Locus method, designed rules and techniques that allowed the roots of the characteristic equation to be displayed in a graphical manner. Introduction to control engineering 3 The advent of digital computers in the 1950s gave rise to the state-space formulation of differential equations, which, using vector matrix notation, lends itself readily to machine computation. The idea of optimum design was first mooted by Wiener (1949). The method of dynamic programming was developed by Bellman (1957), at about the same time as the maximum principle was discussed by Pontryagin (1962). At the first conference of the International Federation of Automatic Control (IFAC), Kalman (1960) introduced the dual concept of controllability and observability. At the same time Kalman demonstrated that when the system dynamic equations are linear and the performance criterion is quadratic (LQ control), then the mathematical problem has an explicit solution which provides an optimal control law. Also Kalman and Bucy (1961) developed the idea of an optimal filter (Kalman filter) which, when combined with an optimal controller, produced linear-quadraticGaussian (LQG) control. The 1980s saw great advances in control theory for the robust design of systems with uncertainties in their dynamic characteristics. The work of Athans (1971), Safanov (1980), Chiang (1988), Grimble (1988) and others demonstrated how uncertainty can be modelled and the concept of the H norm and -synthesis theory. The 1990s has introduced to the control community the concept of intelligent control systems. An intelligent machine according to Rzevski (1995) is one that is able to achieve a goal or sustained behaviour under conditions of uncertainty. Intelligent control theory owes much of its roots to ideas laid down in the field of Artificial Intelligence (AI). Artificial Neural Networks (ANNs) are composed of many simple computing elements operating in parallel in an attempt to emulate their biological counterparts. The theory is based on work undertaken by Hebb (1949), Rosenblatt (1961), Kohonen (1987), Widrow-Hoff (1960) and others. The concept of fuzzy logic was introduced by Zadeh (1965). This new logic was developed to allow computers to model human vagueness. Fuzzy logic controllers, whilst lacking the formal rigorous design methodology of other techniques, offer robust control without the need to model the dynamic behaviour of the system. Workers in the field include Mamdani (1976), Sugeno (1985) Sutton (1991) and Tong (1978). 1.2 1.2.1 Control system fundamentals Concept of a system Before discussing the structure of a control system it is necessary to define what is meant by a system. Systems mean different things to different people and can include purely physical systems such as the machine table of a Computer Numerically Controlled (CNC) machine tool or alternatively the procedures necessary for the purchase of raw materials together with the control of inventory in a Material Requirements Planning (MRP) system. However, all systems have certain things in common. They all, for example, require inputs and outputs to be specified. In the case of the CNC machine tool machine table, the input might be the power to the drive motor, and the outputs might be the position, velocity and acceleration of the table. For the MRP system inputs would include sales orders and sales forecasts (incorporated in a master 4 Advanced Control Engineering Inputs System Outputs Boundary Fig. 1.2      production schedule), a bill of materials for component parts and subassemblies, inventory records and information relating to capacity requirements planning. Material requirements planning systems generate various output reports that are used in planning and managing factory operations. These include order releases, inventory status, overdue orders and inventory forecasts. It is necessary to clearly define the boundary of a system, together with the inputs and outputs that cross that boundary. In general, a system may be defined as a collection of matter, parts, components or procedures which are included within some specified boundary as shown in Figure 1.2. A system may have any number of inputs and outputs. In control engineering, the way in which the system outputs respond in changes to the system inputs (i.e. the system response) is very important. The control system design engineer will attempt to evaluate the system response by determining a mathematical model for the system. Knowledge of the system inputs, together with the mathematical model, will allow the system outputs to be calculated. It is conventional to refer to the system being controlled as the plant, and this, as with other elements, is represented by a block diagram. Some inputs, the engineer will have direct control over, and can be used to control the plant outputs. These are known as control inputs. There are other inputs over which the engineer has no control, and these will tend to deflect the plant outputs from their desired values. These are called disturbance inputs. In the case of the ship shown in Figure 1.3, the rudder and engines are the control inputs, whose values can be adjusted to control certain outputs, for example heading and forward velocity. The wind, waves and current are disturbance inputs and will induce errors in the outputs (called controlled variables) of position, heading and forward velocity. In addition, the disturbances will introduce increased ship motion (roll, pitch and heave) which again is not desirable. Rudder Engines Wind Waves Current Fig. 1.3         Position Ship Velocity Forward Velocity Heading Ship Motion (roll, pitch, heave) Introduction to control engineering 5 Disturbance Input – Control Input Controlled Variable or Output + Plant Summing Point Fig. 1.4        Generally, the relationship between control input, disturbance input, plant and controlled variable is shown in Figure 1.4. 1.2.2 Open-loop systems Figure 1.4 represents an open-loop control system and is used for very simple applications. The main problem with open-loop control is that the controlled variable is sensitive to changes in disturbance inputs. So, for example, if a gas fire is switched on in a room, and the temperature climbs to 20  C, it will remain at that value unless there is a disturbance. This could be caused by leaving a door to the room open, for example. Or alternatively by a change in outside temperature. In either case, the internal room temperature will change. For the room temperature to remain constant, a mechanism is required to vary the energy output from the gas fire. 1.2.3 Closed-loop systems For a room temperature control system, the first requirement is to detect or sense changes in room temperature. The second requirement is to control or vary the energy output from the gas fire, if the sensed room temperature is different from the desired room temperature. In general, a system that is designed to control the output of a plant must contain at least one sensor and controller as shown in Figure 1.5. Forward Path Summing Point Desired Value + Output Value Control Signal Error Signal Plant Controller – Measured Value Sensor Feedback Path Fig. 1.5     • 6 Advanced Control Engineering Figure 1.5 shows the generalized schematic block-diagram for a closed-loop, or feedback control system. The controller and plant lie along the forward path, and the sensor in the feedback path. The measured value of the plant output is compared at the summing point with the desired value. The difference, or error is fed to the controller which generates a control signal to drive the plant until its output equals the desired value. Such an arrangement is sometimes called an error-actuated system. 1.3 1.3.1 Examples of control systems Room temperature control system The physical realization of a system to control room temperature is shown in Figure 1.6. Here the output signal from a temperature sensing device such as a thermocouple or a resistance thermometer is compared with the desired temperature. Any difference or error causes the controller to send a control signal to the gas solenoid valve which produces a linear movement of the valve stem, thus adjusting the flow of gas to the burner of the gas fire. The desired temperature is usually obtained from manual adjustment of a potentiometer. Insulation Desired Temperature Potentiometer Outside Temperature Control Signal Gas Solenoid Valve Actual Room Temperature Controller Measured Temperature Gas Flow-rate Gas Fire Heat Input Heat Loss Thermometer Fig. 1.6        Outside Temperature Gas Heat InsulaFlow-rate Loss tion Actual Control Error 3 (m /s) (W) Temperature Signal Signal Desired (°C) + (V) Temperature Potentio(V) Gas Gas – Controller Solenoid meter Room Burner + Valve (V) – (°C) Heat Input (W) Thermometer (V) Fig. 1.7             Introduction to control engineering 7 A detailed block diagram is shown in Figure 1.7. The physical values of the signals around the control loop are shown in brackets. Steady conditions will exist when the actual and desired temperatures are the same, and the heat input exactly balances the heat loss through the walls of the building. The system can operate in two modes: (a)   : Here the linear movement of the valve stem is proportional to the error. This provides a continuous modulation of the heat input to the room producing very precise temperature control. This is used for applications where temperature control, of say better than 1  C, is required (i.e. hospital operating theatres, industrial standards rooms, etc.) where accuracy is more important than cost. (b)    : Also called thermostatic or bang-bang control, the gas valve is either fully open or fully closed, i.e. the heater is either on or off. This form of control produces an oscillation of about 2 or 3  C of the actual temperature about the desired temperature, but is cheap to implement and is used for low-cost applications (i.e. domestic heating systems). 1.3.2 Aircraft elevator control In the early days of flight, control surfaces of aircraft were operated by cables connected between the control column and the elevators and ailerons. Modern high-speed aircraft require power-assisted devices, or servomechanisms to provide the large forces necessary to operate the control surfaces. Figure 1.8 shows an elevator control system for a high-speed jet. Movement of the control column produces a signal from the input angular sensor which is compared with the measured elevator angle by the controller which generates a control signal proportional to the error. This is fed to an electrohydraulic servovalve which generates a spool-valve movement that is proportional to the control signal, Desired Angle Elevator Output Angular Sensor Control Signal Control Column Actual Angle Controller Input Angular Sensor Measured Angle Hydraulic Cylinder Fig. 1.8          Electrohydraulic Servovalve 8 Advanced Control Engineering Fluid Flow-rate Hydraulic Control Error Actual Desired 3 (m /s) Force Signal Signal Angle Angle (N) (deg) Input (deg) (V) + (V) (V) ServoHydraulic Angular Controller Elevator valve Cylinder – Sensor (V) Output Angular Sensor Fig. 1.9          thus allowing high-pressure fluid to enter the hydraulic cylinder. The pressure difference across the piston provides the actuating force to operate the elevator. Hydraulic servomechanisms have a good power/weight ratio, and are ideal for applications that require large forces to be produced by small and light devices. In practice, a `feel simulator' is attached to the control column to allow the pilot to sense the magnitude of the aerodynamic forces acting on the control surfaces, thus preventing excess loading of the wings and tail-plane. The block diagram for the elevator control system is shown in Figure 1.9. 1.3.3 Computer Numerically Controlled (CNC) machine tool Many systems operate under computer control, and Figure 1.10 shows an example of a CNC machine tool control system. Information relating to the shape of the work-piece and hence the motion of the machine table is stored in a computer program. This is relayed in digital format, in a sequential form to the controller and is compared with a digital feedback signal from the shaft encoder to generate a digital error signal. This is converted to an analogue Computer Controller Computer Program Machine Table Movement Shaft Encoder DC-Servomotor Lead-Screw Digital Controller Bearing Power Amplifier Tachogenerator Digital Positional Feedback Analogue Velocity Feedback Fig. 1.10           Introduction to control engineering 9 Digital Desired Position Computer + Program – Control Signal (V) Digital Error + (V) Digital Controller – Power Amplifier Analogue Velocity Feedback Digital Positional Feedback Actual Velocity (m/s) Torque (Nm) DC Servo motor Machine Table Actual Position (m) Integrator Tachogenerator Shaft Encoder Fig. 1.11             control signal which, when amplified, drives a d.c. servomotor. Connected to the output shaft of the servomotor (in some cases through a gearbox) is a lead-screw to which is attached the machine table, the shaft encoder and a tachogenerator. The purpose of this latter device, which produces an analogue signal proportional to velocity, is to form an inner, or minor control loop in order to dampen, or stabilize the response of the system. The block diagram for the CNC machine tool control system is shown in Figure 1.11. 1.3.4 Ship autopilot control system A ship autopilot is designed to maintain a vessel on a set heading while being subjected to a series of disturbances such as wind, waves and current as shown in Figure 1.3. This method of control is referred to as course-keeping. The autopilot can also be used to change course to a new heading, called course-changing. The main elements of the autopilot system are shown in Figure 1.12. The actual heading is measured by a gyro-compass (or magnetic compass in a smaller vessel), and compared with the desired heading, dialled into the autopilot by the ship's master. The autopilot, or controller, computes the demanded rudder angle and sends a control signal to the steering gear. The actual rudder angle is monitored by a rudder angle sensor and compared with the demanded rudder angle, to form a control loop not dissimilar to the elevator control system shown in Figure 1.8. The rudder provides a control moment on the hull to drive the actual heading towards the desired heading while the wind, waves and current produce moments that may help or hinder this action. The block diagram of the system is shown in Figure 1.13. Actual rudder-angle Desired Heading Gyro-compass Auto-pilot Steering-gear Sensor Error Actual Heading Fig. 1.12 !        Demanded rudder-angle Measured rudder-angle 10 Advanced Control Engineering Desired Heading (deg) Disturbance Actual Moment Demanded Rudder Actual (Nm) Rudder Angle Heading Angle (deg) Rudder (deg) + + – Autopilot Steering Hull Charact(Controller) (V) Gear eristics – Course Error + (V) Potentiometer (V)– Rudder Angle Sensor Measured Heading (V) Rudder Moment (Nm) GyroCompass Fig. 1.13              1.4 Summary In order to design and implement a control system the following essential generic elements are required: .       : It is necessary to know what it is you are trying to . . . . control, to what accuracy, and over what range of values. This must be expressed in the form of a performance specification. In the physical system this information must be converted into a form suitable for the controller to understand (analogue or digital signal).          : This must be measured by a feedback sensor, again in a form suitable for the controller to understand. In addition, the sensor must have the necessary resolution and dynamic response so that the measured value has the accuracy required from the performance specification.        : The controller must be able to accept measurements of desired and actual values and compute a control signal in a suitable form to drive an actuating element. Controllers can be a range of devices, including mechanical levers, pneumatic elements, analogue or digital circuits or microcomputers.        : This unit amplifies the control signal and provides the `effort' to move the output of the plant towards its desired value. In the case of the room temperature control system the actuator is the gas solenoid valve and burner, the `effort' being heat input (W). For the ship autopilot system the actuator is the steering gear and rudder, the `effort' being turning moment (Nm).      : Most control strategies require some knowledge of the static and dynamic characteristics of the plant. These can be obtained from measurements or from the application of fundamental physical laws, or a combination of both. 1.4.1 Control system design With all of this knowledge and information available to the control system designer, all that is left is to design the system. The first problem to be encountered is that the Introduction to control engineering 11 START Define System Performance Specification Identify System Components • Model Behaviour of Plant and System Components Select Alternative Components No Is Component Response Acceptable? Yes Define Control Strategy • Simulate System Response Modify Control Strategy No Does Simulated Response Meet Performance Specification? Yes Implement Physical System • Measure System Response No Does System Response Meet Performance Specification? Yes FINISH Fig. 1.14 !          Modify Control Strategy 12 Advanced Control Engineering knowledge of the system will be uncertain and incomplete. In particular, the dynamic characteristics of the system may change with time (time-variant) and so a fixed control strategy will not work. Due to fuel consumption for example, the mass of an airliner can be almost half that of its take-off value at the end of a long haul flight. Measurements of the controlled variables will be contaminated with electrical noise and disturbance effects. Some sensors will provide accurate and reliable data, others, because of difficulties in measuring the output variable may produce highly random and almost irrelevant information. However, there is a standard methodology that can be applied to the design of most control systems. The steps in this methodology are shown in Figure 1.14. The design of a control system is a mixture of technique and experience. This book explains some tried and tested, and some more recent approaches, techniques and methods available to the control system designer. Experience, however, only comes with time. 2 System modelling 2.1 Mathematical models If the dynamic behaviour of a physical system can be represented by an equation, or a set of equations, this is referred to as the mathematical model of the system. Such models can be constructed from knowledge of the physical characteristics of the system, i.e. mass for a mechanical system or resistance for an electrical system. Alternatively, a mathematical model may be determined by experimentation, by measuring how the system output responds to known inputs. 2.2 Simple mathematical model of a motor vehicle Assume that a mathematical model for a motor vehicle is required, relating the accelerator pedal angle  to the forward speed u, a simple mathematical model might be u(t)  a(t) (21) Since u and  are functions of time, they are written u(t) and (t). The constant a could be calculated if the following vehicle data for engine torque T, wheel traction force F, aerodynamic drag D were available T  b(t) (22) F  cT (23) D  du(t) (24) Now aerodynamic drag D must equal traction force F DF du(t)  cT 14 Advanced Control Engineering Forward Speed u(t) (m/s) a Accelerator angle θ(t) (degrees) Fig. 2.1           from (2.2) du(t)  cb(t) giving u(t)    cb (t) d (25) Hence the constant for the vehicle is   cb a d (26) If the constants b, c and d were not available, then the vehicle model could be obtained by measuring the forward speed u(t) for a number of different accelerator angles (t) and plotting the results, as shown in Figure 2.1. Since Figure 2.1 shows a linear relationship, the value of the vehicle constant a is the slope of the line. 2.3 More complex mathematical models Equation (2.1) for the motor vehicle implies that when there is a change in accelerator angle, there is an instantaneous change in vehicle forward speed. As all car drivers know, it takes time to build up to the new forward speed, so to model the dynamic characteristics of the vehicle accurately, this needs to be taken into account. Mathematical models that represent the dynamic behaviour of physical systems are constructed using differential equations. A more accurate representation of the motor vehicle would be e du  fu  g(t) dt (27) Here, du/dt is the acceleration of the vehicle. When it travels at constant velocity, this term becomes zero. So then System modelling 15 fu(t)  g(t)   g (t) u(t)  f (28) Hence (g/f ) is again the vehicle constant, or parameter a in equation (2.1) 2.3.1 Differential equations with constant coefficients In general, consider a system whose output is x(t), whose input is y(t) and contains constant coefficients of values a, b, c, . . . , z. If the dynamics of the system produce a first-order differential equation, it would be represented as a dx  bx  cy(t) dt (29) If the system dynamics produced a second-order differential equation, it would be represented by a d2 x dx  b  cx  ey(t) 2 dt dt (210) If the dynamics produce a third-order differential equation, its representation would be a d3 x d2 x dx  b  c  ex  fy(t) dt3 dt2 dt (211) Equations (2.9), (2.10) and (2.11) are linear differential equations with constant coefficients. Note that the order of the differential equation is the order of the highest derivative. Systems described by such equations are called linear systems of the same order as the differential equation. For example, equation (2.9) describes a first-order linear system, equation (2.10) a second-order linear system and equation (2.11) a third-order linear system. 2.4 Mathematical models of mechanical systems Mechanical systems are usually considered to comprise of the linear lumped parameter elements of stiffness, damping and mass. 2.4.1 Stiffness in mechanical systems An elastic element is assumed to produce an extension proportional to the force (or torque) applied to it. For the translational spring Force  Extension 16 Advanced Control Engineering θi(t) xi(t) θo(t) xo(t) K K T(t) P(t) P(t) T(t) (a) Translational Spring (b) Rotational Spring Fig. 2.2      If xi (t)  xo (t), then P(t)  K(xi (t)  xo (t)) (212) And for the rotational spring Torque  Twist If i (t)  o (t), then T(t)  K(i (t)  o (t)) (213) Note that K, the spring stiffness, has units of (N/m) in equation (2.12) and (Nm/rad) in equation (2.13). 2.4.2 Damping in mechanical systems A damping element (sometimes called a dashpot) is assumed to produce a velocity proportional to the force (or torque) applied to it. For the translational damper Force  Velocity P(t)  Cv(t)  C dxo dt (214) And for the rotational damper Torque  Angular velocity T(t)  C(t)  C do dt (215) C C P(t) v(t) (a) Translational Damper Fig. 2.3     T(t) ω (t) (b) Rotational Damper System modelling 17 Note that , the damping coefficient, has units of (Ns/m) in equation (2.14) and (Nm s/rad) in equation (2.15). 2.4.3 Mass in mechanical systems The force to accelerate a body is the product of its mass and acceleration (Newton's second law). For the translational system Force  Acceleration P(t)  ma(t)  m dv d2 x o m 2 dt dt (216) For the rotational system Torque  Angular acceleration T(t)  I(t)  I d d2 o I 2 dt dt (217) In equation (2.17) I is the moment of inertia about the rotational axis. When analysing mechanical systems, it is usual to identify all external forces by the use of a `Free-body diagram', and then apply Newton's second law of motion in the form:  F  ma for translational systems or  M  I for rotational systems (218) Example 2.1 Find the differential equation relating the displacements xi (t) and xo (t) for the spring±mass±damper system shown in Figure 2.5. What would be the effect of neglecting the mass? I P(t) m a(t) α (t) T(t) (a) Translational Acceleration Fig. 2.4     (b) Angular Acceleration 18 Advanced Control Engineering C K m Spring Damper xi(t) xo(t) Fig. 2.5        dx C dto m K(xi –xo) 2 xo(t),dxo ,d xo dt dt Fig. 2.6               Solution Using equations (2.12) and (2.14) the free-body diagram is shown in Figure 2.6. From equation (2.18), the equation of motion is  Fx  max dxo d2 xo m 2 dt dt d2 xo dxo Kxi  Kxo  m 2  C dt dt K(xi  xo )  C Putting in the form of equation (2.10) m d2 xo dxo  Kxo  Kxi (t) C 2 dt dt (219) Hence a spring±mass±damper system is a second-order system. If the mass is zero then  Fx  0 K(xi  xo )  C dxo 0 dt Kxi  Kxo  C dxo dt Hence C dxo  Kxo  Kxi (t) dt Thus if the mass is neglected, the system becomes a first-order system. (220) System modelling 19 C Torque T(t) Angular velocity ω(t) I Fig. 2.7       Example 2.2 A flywheel of moment of inertia I sits in bearings that produce a frictional moment of C times the angular velocity (t) of the shaft as shown in Figure 2.7. Find the differential equation relating the applied torque T(t) and the angular velocity (t). Solution From equation (2.18), the equation of motion is  M  I T(t)  C  I I d dt d  C  T(t) dt (221) Example 2.3 Figure 2.8 shows a reduction gearbox being driven by a motor that develops a torque Tm (t). It has a gear reduction ratio of `n' and the moments of inertia on the motor and output shafts are Im and Io , and the respective damping coefficients Cm and Co . Find the differential equation relating the motor torque Tm (t) and the output angular position o (t). Im Tm(t ) a and b are the pitch circle radii of the gears. Hence gear reduction ratio is n = b/a Cm a θm b θo(t) Io Fig. 2.8     Co 20 Advanced Control Engineering 2 dθm d θm θm(t) dt dt 2 Cm Im a X(t) Tm(t) 2 Co θo(t) dθm Cm dt dθ o d θ o dt dt 2 Io X(t) dθo Co dt b Motor Shaft X(t) = Gear tooth reaction force Output Shaft Fig. 2.9            Gearbox parameters Im  5  106 kg m2 Io  001 kg m2 Cm  60  106 Nm s/rad Co  015 Nm s/rad n  50:1 Solution The free-body diagrams for the motor shaft and output shaft are shown in Figure 2.9. Equations of Motion are (1) Motor shaft  Tm (t)  Cm M  Im d2 m dt2 dm d2 m  aX(t)  Im 2 dt dt re-arranging the above equation,   1 d2 m dm X(t)  Tm (t)  Im 2  Cm a dt dt (2) Output shaft  M  Io bX(t)  Co d2 m dt2 do d2 o  Io 2 dt dt (222) System modelling 21 re-arranging the above equation,   1 d2 o do "(t)  Io 2  C o b dt dt (223) Equating equations (2.22) and (2.23)     b d2 m dm d2 o do Tm (t)  Im 2  Cm  Io 2  Co a dt dt dt dt Kinematic relationships b n a m (t)  no (t) dm do n dt dt d2 m d2 o  n dt2 dt2 Hence     d2 o do d2 o do  Io 2  Co n Tm (t)  nIm 2  nCm dt dt dt dt giving the differential equation  I o  n2 I m  d2 o   do  nTm (t)  Co  n2 Cm 2 dt dt (224) The terms (Io  n2 Im ) and (Co  n2 Cm ) are called the equivalent moment of inertia Ie and equivalent damping coefficient Ce referred to the output shaft. Substituting values gives Ie  (001  502  5  106 )  00225 kg m2 Ce  (015  502  60  106 )  03 Nm s/rad From equation (2.24) 00225 2.5 d2 o do  50Tm (t)  03 dt2 dt (225) Mathematical models of electrical systems The basic passive elements of electrical systems are resistance, inductance and capacitance as shown in Figure 2.10. 22 Advanced Control Engineering R v1(t) v2(t) i(t) (a) Resistance L v1(t) v2(t) i(t) (b) Inductance v1(t) v2(t) C i(t) (c) Capacitance Fig. 2.10           For a resistive element, Ohm's Law can be written (v1 (t)  v2 (t))  Ri(t) (226) For an inductive element, the relationship between voltage and current is (v1 (t)  v2 (t))  L di dt (227) For a capacitive element, the electrostatic equation is Q(t)  C(v1 (t)  v2 (t)) Differentiating both sides with respect to t dQ d  i(t)  C (v1 (t)  v2 (t)) dt dt Note that if both sides of equation (2.28) are integrated then  1 idt (v1 (t)  v2 (t))  C (228) (229) Example 2.4 Find the differential equation relating v1 (t) and v2 (t) for the RC network shown in Figure 2.11. Solution From equations (2.26) and (2.29) v1 (t)  v2 (t)  Ri(t)  1 idt v2 (t)  C (230) System modelling 23 R v1(t) i(t) v2(t) C Fig. 2.11     or  dv2  i(t) dt (231) substituting (2.31) into (2.30) v1 (t)  v2 (t)  RC dv2 dt (232) Equation (2.32) can be expressed as a first-order differential equation RC dv2  v2  v1 (t) dt (233) Example 2.5 Find the differential equations relating v1 (t) and v2 (t) for the networks shown in Figure 2.12. R L v1(t) v2(t) C i(t) (a) i1(t) + i2(t) R2 R1 v1(t) i1(t) v3(t) C1 (b) Fig. 2.12 !      i2(t) C1 v2(t) 24 Advanced Control Engineering Solution for Network (a) Figure 2.12 From equations (2.26), (2.27) and (2.29) v1 (t)  v2 (t)  Ri(t)  L 1 v2 (t)  C  di dt (234) idt or C dv2  i(t) dt (235) substituting (2.35) into (2.34) v1 (t)  v2 (t)  RC   dv2 d dv2 C L dt dt dt or v1 (t)  v2 (t)  RC dv2 d2 v2  LC 2 dt dt (236) Equation (2.36) can be expressed as a second-order differential equation LC d2 v2 dv2  v2  v1 (t)  RC dt2 dt (237) Solution for Network (b) Figure 2.12 System equations v1 (t)  v3 (t)  R1 (i1 (t)  i2 (t)) v3 (t)  1 C1  i1 dt or C1 dv3  i1 (t) dt v3 (t)  v2 (t)  R2 i2 (t) 1 v2 (t)  C2  i2 dt or C2 dv2  i2 (t) dt (238) (239) (240) (241) From equation (2.40) v3 (t)  R2 i2 (t)  v2 (t) Substituting for i2 (t) using equation (2.41) v3 (t)  R2 C2 dv2  v2 (t) dt (242) System modelling 25 Hence from equations (2.42) and (2.39)   d dv2 R2 C2  v2 (t) 1 (t)  C1 dt dt  R2 C1 C2 d 2 v2 dv2  C1 dt2 dt (243) Substituting equations (2.41), (2.42) and (2.43) into equation (2.38)     dv2 d2 v2 dv2 dv2  v2 (t)  R1 R2 C1 C2 2  C1  C2 v1 (t)  R2 C2 dt dt dt dt which produces the second-order differential equation R1 R2 C1 C2 2.6 d2 v2 dv2  v2  v1 (t)  (R1 C1  R1 C2  R2 C2 ) 2 dt dt (244) Mathematical models of thermal systems It is convenient to consider thermal systems as being analogous to electrical systems so that they contain both resistive and capacitive elements. 2.6.1 Thermal resistance RT Heat flow by conduction is given by Fourier's Law QT  KA(1  2 )  (245) The parameters in equation (2.45) are shown in Figure 2.13. They are (1  2 )  Temperature differential (K) A  Normal cross sectional area (m2 )   Thickness (m) K  Thermal conductivity (W/mK) QT  Heat flow (J/s  W) A θ1 QT θ2 l Fig. 2.13 "         26 Advanced Control Engineering Equation (2.45) can be written in the same form as Ohm's Law (equation (2.26)) (1 (t)  2 (t))  RT QT (t) (246) where RT is the thermal resistance and is RT  2.6.2  KA (247) Thermal capacitance C T The heat stored by a body is H(t)  mCp (t) (248) where H  Heat (J) m  Mass (kg) Cp  Specific heat at constant pressure (J/kg K)   Temperature rise (K) If equation (2.48) is compared with the electrostatic equation Q(t)  Cv(t) (249) CT  mCp (250) then the thermal capacitance CT is To obtain the heat flow QT , equation (2.48) is differentiated with respect to time dH d  mCp dt dt (251) d dt (252) or QT (t)  CT Example 2.6 Heat flows from a heat source at temperature 1 (t) through a wall having ideal thermal resistance RT to a heat sink at temperature 2 (t) having ideal thermal capacitance CT as shown in Figure 2.14. Find the differential equation relating 1 (t) and 2 (t). Solution (1) Wall: From equation (2.46) QT (t)  (1 (t)  2 (t)) RT (253) System modelling 27 Wall Heat Source θ1(t ) Heat Sink CT θ2(t) Fig. 2.14 "       (2) Heat sink: From equation (2.52) %T (t)  CT d2 dt (254) Equating equations (2.53) and (2.54) (1 (t)  2 (t)) d2  CT RT dt Re-arranging to give the first-order differential equation RT CT 2.7 d2  2  1 (t) dt (255) Mathematical models of fluid systems Like thermal systems, it is convenient to consider fluid systems as being analogous to electrical systems. There is one important difference however, and this is that the relationship between pressure and flow-rate for a liquid under turbulent flow conditions is nonlinear. In order to represent such systems using linear differential equations it becomes necessary to linearize the system equations. 2.7.1 Linearization of nonlinear functions for small perturbations Consider a nonlinear function Y  f (x) as shown in Figure 2.15. Assume that it is necessary to operate in the vicinity of point a on the curve (the operating point) whose co-ordinates are Xa ,Ya . For the small perturbations X and Y about the operating point a let X  x Y  y (256) 28 Advanced Control Engineering If the slope at the operating point is d1 d" a then the approximate linear relationship becomes y dY x dX a (257) Example 2.7 The free-body diagram of a ship is shown in Figure 2.16. It has a mass of 15  106 kg and the propeller produces a thrust of Kn times the angular velocity n of the propeller, Kn having a value of 110  103 Ns/rad. The hydrodynamic resistance is given by the relationship R  Cv V 2 , where Cv has a value of 10,000 Ns2 /m2 . Determine, using small perturbation theory, the linear differential equation relating the forward speed v(t) and propeller angular velocity n(t) when the forward speed is 7.5 m/s. Solution Linearize hydrodynamic resistance equation for an operating speed Va of 7.5 m/s. R  Cv V 2 dR  2Cv V dV dR  2Cv Va dV a  2  10 000  75 dR dV  C  150 000 Ns/m a Y ∆Y Y = f(x) Ya Approximate linear relationship a ∆X Xa Fig. 2.15  #     X System modelling 29 x,v,ax m T = Kn.n R = CvV 2 Fig. 2.16         Hence the linear relationship is #  Cv (258) Using Newton's second law of motion  Fx  max T Rm dv dt Kn n  Cv  m m dv dt dv  Cv  Kn n dt (259) Substituting values gives (15  106 ) dv  (150  103 )v  (110  103 )n(t) dt (260) Example 2.8 In Figure 2.17 the tank of water has a cross-sectional area A, and under steady conditions both the outflow and inflow is Va and the head is Ha . (a) Under these conditions find an expression for the linearized valve resistance Rf given that flow through the valve is V  Av Cd where V  volumetric flow-rate (m3 /s) Av  valve flow area (m2 ) Cd  coefficient of discharge g  acceleration due to gravity (m/s2 ) H  head across the valve (m) 2gH , 30 Advanced Control Engineering (b) If the steady value of the head /a is 1.5 m, what is the valve resistance Rf when Av  15  103 m2 g  981 m/s2 Cd  06 (c) If the inflow now increases an amount v1 producing an increase in head h and an increase in outflow v2 , find the differential equation relating v1 and v2 when the tank cross-sectional area A is 075 m2 . Solution (a) Flow through the valve is given by V  Av Cd 2gH now dV dH dV dH  Av Cd (2g)1/2  05H1/2 a a  Av Cd a g v2  2Ha h The linearized relationship is h  R f v2 hence Rf  1 Av Cd 2Ha g (261) Va + v1 h Ha A Rf Fig. 2.17 $       Va + v 2 System modelling 31 (b) Inserting values gives 1 15  103  06 #f  6145 s/m2 #f  2  15 981 (262) (c) Tank (Continuity Equation) d5 dt dh (Va  v1 )  (Va  v2 )  A dt dh v1  v2  A dt Inflow  Outflow  . (263) Valve (Linearized Equation) h  Rf v2 and dh dv2  Rf dt dt (264) Substituting equation (2.64) into equation (2.63) v1  v2  ARf dv2 dt giving ARf dv2  v2  v1 (t) dt (265) dv2  v2  v1 (t) dt (266) Inserting values gives 4609 2.8 Further problems Example 2.9 A solenoid valve is shown in Figure 2.18. The coil has an electrical resistance of 4 , an inductance of 0.6 H and produces an electromagnetic force Fc (t) of Kc times the current i(t). The valve has a mass of 0.125 kg and the linear bearings produce a resistive force of C times the velocity u(t). The values of Kc and C are 0.4 N/A and 0.25 Ns/m respectively. Develop the differential equations relating the voltage v(t) and current i(t) for the electrical circuit, and also for the current i(t) and velocity u(t) for the mechanical elements. Hence deduce the overall differential equation relating the input voltage v(t) to the output velocity u(t). 32 Advanced Control Engineering u(t) R,L,Kc Fc(t) C i(t) v(t) Fig. 2.18    Solution di  Ri  v(t) dt du m  Cu  Kc i(t) dt L 0075 d2 u du  065  u  04v(t) dt2 dt Example 2.10 The laser-guided missile shown in Figure 2.19 has a pitch moment of inertia of 90 kg m2 . The control fins produce a moment about the pitch mass centre of 360 Nm per radian of fin angle (t). The fin positional control system is described by the differential equation d  (t)  u(t) 02 dt where u(t) is the control signal. Determine the differential equation relating the control signal u(t) and the pitch angle (t). Solution d3  d2   5 2  20u(t) 3 dt dt θ(t) G β(t) Fig. 2.19       System modelling 33 K θi(t) θo(t) I Fig. 2.20 $       C    Example 2.11 A torsional spring of stiffness K, a mass of moment of inertia I and a fluid damper with damping coefficient C are connected together as shown in Figure 2.20. If the angular displacement of the free end of the spring is i (t) and the angular displacement of the mass and damper is o (t), find the differential equation relating i (t) and o (t) given that I  25 kg m2 C  125 Nm s/rad K  250 Nm/rad Solution 25 d 2 o do  250o  250i (t)  125 dt2 dt Example 2.12 A field controlled d.c. motor develops a torque Tm (t) proportional to the field current if (t). The rotating parts have a moment of inertia I of 15 kg m2 and a viscous damping coefficient C of 0.5 Nm s/rad. When a current of 1.0 A is passed through the field coil, the shaft finally settles down to a steady speed o (t) of 5 rad/s. (a) Determine the differential equations relating if (t) and o (t). (b) What is the value of the coil constant Kc , and hence what is the torque developed by the motor when a current of 0.5 A flows through the field coil? Solution do (a) I  Co  Kc if (t) dt (b) Kc  25 Nm/A Tm  125 Nm 34 Advanced Control Engineering R1 v1(t) v2(t) C R2 Fig. 2.21   %    Oven vi(t) Qi(t) K CT Burner θs(t) θo(t) RT Fig. 2.22 &   Example 2.13 Figure 2.21 shows a passive electrical network. Determine the differential equation relating v1 (t) and v2 (t). Solution   dv2 R1  R2  R1 C v2  v1 (t) dt R2 Example 2.14 A drying oven which is constructed of firebrick walls is heated by an electrically operated gas burner as shown in Figure 2.22. The system variables and constants are v1 (t)  burner operating voltage (V) Qi (t)  heat input to oven (W) o (t)  internal oven temperature (K) s (t)  temperature of surroundings (K) K  burner constant  2000 W/V RT  thermal resistance of walls  05  103 min K/J CT  oven thermal capacitance  1  104 J/K Find the differential equation relating vi (t), o (t) and s (t). Solution 5 do  o  v1 (t)  s (t) dt 3 Time domain analysis 3.1 Introduction The manner in which a dynamic system responds to an input, expressed as a function of time, is called the time response. The theoretical evaluation of this response is said to be undertaken in the time domain, and is referred to as time domain analysis. It is possible to compute the time response of a system if the following is known: . the nature of the input(s), expressed as a function of time . the mathematical model of the system. The time response of any system has two components: (a) Transient response: This component of the response will (for a stable system) decay, usually exponentially, to zero as time increases. It is a function only of the system dynamics, and is independent of the input quantity. (b) Steady-state response: This is the response of the system after the transient component has decayed and is a function of both the system dynamics and the input quantity. xo(t ) Transient Period xi(t ) xo(t ) Steady-State Error Transient Error Steady-State Period t Fig. 3.1 ransient and steady-state periods of time response.  Advanced Control Engineering The total response of the system is always the sum of the transient and steady-state components. Figure 3.1 shows the transient and steady-state periods of time response. Differences between the input function xi (t) (in this case a ramp function) and system response xo (t) are called transient errors during the transient period, and steady-state errors during the steady-state period. One of the major objectives of control system design is to minimize these errors. 3.2 Laplace transforms In order to compute the time response of a dynamic system, it is necessary to solve the differential equations (system mathematical model) for given inputs. There are a number of analytical and numerical techniques available to do this, but the one favoured by control engineers is the use of the Laplace transform. This technique transforms the problem from the time (or t) domain to the Laplace (or s) domain. The advantage in doing this is that complex time domain differential equations become relatively simple s domain algebraic equations. When a suitable solution is arrived at, it is inverse transformed back to the time domain. The process is shown in Figure 3.2. The Laplace transform of a function of time f(t) is given by the integral l[ f (t)]  Z  0 f (t)est dt  F(s) (3:1) where s is a complex variable   j! and is called the Laplace operator. s Domain F(s) Algebraic equations Laplace Transform Inverse Laplace Transform L [f(t )] = F(s ) Time Domain f (t ) Differential equations Fig. 3.2 The Laplace transform process. –1 L [F(s)] = f (t ) Time domain analysis  3.2.1 Laplace transforms of common functions Example 3.1 f (t)  1 (called a unit step function). Solution From equation (3.1) Z l[ f (t)]  F(s)   1est dt 0  1 st    (e ) s 0   1 1   (0  1)  s s  (3:2) Example 3.2 f (t)  eat Z  eat est dt l[ f (t)]  F(s)  0  Z  e(sa)t dt 0   1 (sa)t (e )   sa 0   1 (0  1)   sa  1 sa (3:3) Table 3.1 gives further Laplace transforms of common functions (called Laplace transform pairs). 3.2.2 Properties of the Laplace transform (a) Derivatives: The Laplace transform of a time derivative is dn f (t)  sn F(s)  f (0)sn1  f  (0)sn2     dtn (3:4) where f(0), f  (0) are the initial conditions, or the values of f (t), d/dt f (t) etc. at t  0 (b) Linearity l[ f1 (t)  f2 (t)]  F1 (s)  F2 (s) (3:5)  Advanced Control Engineering   Common Laplace transform pairs Laplace transform l[ f (t)]  F(s) Time function f (t) 1 2 unit impulse (t) unit step 1 1 1/s 3 unit ramp t 1/s2 n! sn1 1 (s  a) a s(s  a) n 4 t 5 eat 6 1  eat 7 sin !t 8 cos !t 9 eat sin !t 10 eat (cos !t  ! s2  !2 s s2  !2 ! (s  a)2  !2 s (s  a)2  !2 a sin !t) ! (c) Constant multiplication l[af (t)]  aF(s) (3:6) (d) Real shift theorem l[ f (t  T)]  eTs F(s) for T 0 (3:7) (e) Convolution integral Z 0 t f1 ()f2 (t  )d  F1 (s)F2 (s) (3:8) (f) Initial value theorem f (0)  lim [ f (t)]  lim [sF(s)] (3:9) f ()  lim [ f (t)]  lim [sF(s)] (3:10) t 0 s  (g) Final value theorem t 3.2.3  s 0 Inverse transformation The inverse transform of a function of s is given by the integral Z j! 1 F(s)est ds f (t)  l1 [F(s)]  2j j! (3:11) Time domain analysis  In practice, inverse transformation is most easily achieved by using partial fractions to break down solutions into standard components, and then use tables of Laplace transform pairs, as given in Table 3.1. 3.2.4 (i) Common partial fraction expansions Factored roots  A B   s(s  a) s (s  a) (3:12) K A B C   2 (s  a)  a) s s (3:13) (ii) Repeated roots s2 (s (iii) Second-order real roots (b2 > 4ac) s(as2 K K A B C      bs  c) s(s  d)(s  e) s (s  d) (s  e) (iv) Second-order complex roots (b2 < 4ac) K A Bs  C   s(as2  bs  c) s as2  bs  c Completing the square gives A Bs  C  s (s  )2  !2 (3:14) Note: In (iii) and (iv) the coefficient a is usually factored to a unity value. 3.3 Transfer functions A transfer function is the Laplace transform of a differential equation with zero initial conditions. It is a very easy way to transform from the time to the s domain, and a powerful tool for the control engineer. Example 3.3 Find the Laplace transform of the following differential equation given: (a) initial conditions xo  4, dxo /dt  3 (b) zero initial conditions d2 xo dxo  2xo  5 3 dt2 dt  Advanced Control Engineering Xi(s ) Xo(s ) G(s ) Fig. 3.3 The transfer function approach. Solution (a) Including initial conditions: Take Laplace transforms (equation (3.4), Table 3.1). 5 s 5 s2 Xo (s)  3sXo (s)  2Xo (s)   4s  3  12 s (s2 Xo (s)  4s  3)  3(sXo (s)  4)  2Xo (s)  (s2  3s  2)Xo (s)  5  4s2  15s s Xo (s)  4s2  15s  5 s(s2  3s  2) (3:15) (b) Zero initial conditions At t  0, xo  0, dxo /dt  0. Take Laplace transforms s2 Xo (s)  3sXo (s)  2Xo (s)  Xo (s)  5 s 5 s(s2  3s  2) (3:16) Example 3.3(b) is easily solved using transfer functions. Figure 3.3 shows the general approach. In Figure 3.3 . Xi (s) is the Laplace transform of the input function. . Xo (s) is the Laplace transform of the output function, or system response. . G(s) is the transfer function, i.e. the Laplace transform of the differential equation for zero initial conditions. The solution is therefore given by Xo (s)  G(s)Xi (s) (3:17) Thus, for a general second-order transfer function a d2 xo dxo  cxo  Kxi (t) b 2 dt dt (as2  bs  c)Xo (s)  KXi (s) Hence Xo (s)    K Xi (s) as2  bs  c (3:18) Time domain analysis  Xi(s ) Xo(s ) K 2 as + bs +c Fig. 3.4 General second-order transfer function. Xi (s)= 5/s Xo (s) 1 2 s +3s +2 Fig. 3.5 Example 3.3(b) expressed as a transfer function. Comparing equations (3.17) and (3.18), the transfer function &(s) is G(s)  as2 K  bs  c (3:19) which, using the form shown in Figure 3.3, can be expressed as shown in Figure 3.4. Returning to Example 3.3(b), the solution, using the transfer function approach is shown in Figure 3.5. From Figure 3.5 Xo (s)  s(s2 5  3s  2) (3:20) which is the same as equation (3.16). 3.4 Common time domain input functions 3.4.1 The impulse function An impulse is a pulse with a width t impulse is its area A, where 0 as shown in Figure 3.6. The strength of an A  height h t: (3:21) The Laplace transform of an impulse function is equal to the area of the function. The impulse function whose area is unity is called a unit impulse (t). 3.4.2 The step function A step function is described as xi (t)  B; Xi (s)  B/s for t > 0 (Figure 3.7). For a unit step function xi (t)  1; Xi (s)  1/s. This is sometimes referred to as a `constant position' input.  Advanced Control Engineering Impulse xi (t ) Pulse h t ∆t Fig. 3.6 The impulse function. xi(t) B t Fig. 3.7 The step function. 3.4.3 The ramp function A ramp function is described as xi (t)  Qt; Xi (s)  Q/s2 for t > 0 (Figure 3.8). For a unit ramp function xi (t)  t; Xi (s)  1/s2 . This is sometimes referred to as a `constant velocity' input. 3.4.4 The parabolic function A parabolic function is described as xi (t)  Kt2 ; Xi (s)  2K/s3 for t > 0 (Figure 3.9). For a unit parabolic function xi (t)  t2 ; Xi (s)  2/s3 . This is sometimes referred to as a `constant acceleration' input. Time domain analysis  xi(t ) Q t Fig. 3.8 The ramp function. xi(t ) t Fig. 3.9 The parabolic function. 3.5 Time domain response of first-order systems 3.5.1 Standard form Consider a first-order differential equation a dxo  bxo  cxi (t) dt Take Laplace transforms, zero initial conditions asXo (s)  bXo (s)  cXi (s) (as  b)Xo (s)  cXi (s) (3:22)  Advanced Control Engineering The transfer function is &(s)  Xo c (s)  as  b Xi To obtain the standard form, divide by b G(s)  c b 1  ab s which is written G(s)  K 1  Ts (3:23) Equation (3.23) is the standard form of transfer function for a first-order system, where K  steady-state gain constant and T  time constant (seconds). 3.5.2 Impulse response of first-order systems Example 3.4 (See also Appendix 1, examp34.m) Find an expression for the response of a first-order system to an impulse function of area A. Solution From Figure 3.10 Xo (s)  AK AK=T  1  Ts s  1=T (3:24) or   AK 1 Xo (s)  T (s  a) (3:25) Equation (3.25) is in the form given in Laplace transform pair 5, Table 3.1, so the inverse transform becomes xo (t)  AK at AK t=T e  e T T (3:26) The impulse response function, equation (3.26) is shown in Figure 3.11. Xi (s )= A Fig. 3.10 Impulse response of a first-order system. K 1+Ts Xo (s ) Time domain analysis  xo (t ) AK T t Fig. 3.11 Response of a first-order system to an impulse function of area . 3.5.3 Step response of first-order systems Example 3.5 (See also Appendix 1, examp35.m) Find an expression for the response of a first-order system to a step function of height B. Solution From Figure 3.12 Xo (s)    BK 1 T  BK s(1  Ts) s s1 T (3:27) Equation (3.27) is in the form given in Laplace transform pair 6 Table 3.1, so the inverse transform becomes   xo (t)  BK 1  et=T (3:28) If B  1 (unit step) and K  1 (unity gain) then   xo (t)  1  et=T (3:29) When time t is expressed as a ratio of time constant T, then Table 3.2 and Figure 3.13 can be constructed. Unit step response of a first-order system   t/T xo (t) 0 0 0.25 0.221 0.5 0.393 0.75 0.527 1 0.632 1.5 0.770 2 0.865 2.5 0.920 3 0.950 4 0.980  Advanced Control Engineering Xi(s)=B/s Xo(s) K 1+Ts Fig. 3.12 Step response of a first-order system. 3.5.4 Experimental determination of system time constant using step response Method one: The system time constant is the time the system takes to reach 63.2% of its final value (see Table 3.2). Method two: The system time constant is the intersection of the slope at t  0 with the final value line (see Figure 3.13) since xo (t)  1  et   dxo 1 t 0  e T dt dxo dt t0  1 T T T  1 t e T T (3:30) at t  0 (3:31) This also applies to any other tangent, see Figure 3.13. 1.2 T T 1 xo(t ) 0.8 0.6 0.4 0.2 0 0 0.5 1 1.5 2 3.5 3 2.5 Number of Time Constants Fig. 3.13 Unit step response of a first-order system. 4 4.5 Time domain analysis  3.5.5 Ramp response of first-order systems Example 3.6 Find an expression for the response of a first-order system to a ramp function of slope Q. Solution From Figure 3.14 Xo (s)  QK QK T A B C  2   2 (s  1 T )  Ts) s (s  1 T ) s s s2 (1 (3:32) (See partial fraction expansion equation (3.13)). Multiplying both sides by s2 (s  1/T), we get     QK 1 1  As s  B s  Cs2 T T T i:e: QK A B  As2  s  Bs   Cs2 T T T (3:33) Equating coefficients on both sides of equation (3.33) (s2 ) : (s1 ) : (s0 ) : 0AC A 0 B T QK B  T T (3:34) (3:35) (3:36) From (3.34) C  A From (3.36) B  QK Substituting into (3.35) A  QKT Hence from (3.34) C  QKT Xi (s)= Q /s2 K 1+Ts Fig. 3.14 Ramp response of a first-order system (see also Figure A1.1). Xo(s )  Advanced Control Engineering 8 7 6 xo(t ) × (1/T) 5 4 3 2 1 0 0 1 3 2 5 4 6 7 Number of Time Constants Fig. 3.15 Unit ramp response of a first-order system. Inserting values of ,  and  into (3.32) $o (s)   QKT QK QKT  2  s s (s  1 T) (3:37) Inverse transform, and factor out KQ   xo (t)  KQ t  T  Tet=T (3:38) If Q  1 (unit ramp) and K  1 (unity gain) then xo (t)  t  T  Tet=T (3:39) The first term in equation (3.39) represents the input quantity, the second is the steady-state error and the third is the transient component. When time t is expressed as a ratio of time constant T, then Table 3.3 and Figure 3.15 can be constructed. In Figure 3.15 the distance along the time axis between the input and output, in the steady-state, is the time constant.   Unit ramp response of a first-order system t/T xi (t)/T xo (t)/T 0 0 0 1 1 0.368 2 2 1.135 3 3 2.05 4 4 3.018 5 5 4.007 6 6 5 7 7 6 Time domain analysis  3.6 Time domain response of second-order systems 3.6.1 Standard form Consider a second-order differential equation a d2 xo dxo  cxo  exi (t) b 2 dt dt (3:40) Take Laplace transforms, zero initial conditions as2 Xo (s)  bsXo (s)  cXo (s)  eXi (s) (as2  bs  c)Xo (s)  eXi (s) (3:41) The transfer function is G(s)  Xo e (s)  2 as  bs  c Xi To obtain the standard form, divide by c G(s)  a c s2 e c  bc s 1 which is written as G(s)  K 1 2 s !2n  !2n s  1 (3:42) This can also be normalized to make the s2 coefficient unity, i.e. G(s)  K!2n s2  2!n s  !2n (3:43) Equations (3.42) and (3.43) are the standard forms of transfer functions for a secondorder system, where K  steady-state gain constant, !n  undamped natural frequency (rad/s) and   damping ratio. The meaning of the parameters !n and  are explained in sections 3.6.4 and 3.6.3. 3.6.2 Roots of the characteristic equation and their relationship to damping in second-order systems As discussed in Section 3.1, the transient response of a system is independent of the input. Thus for transient response analysis, the system input can be considered to be zero, and equation (3.41) can be written as (as2  bs  c)Xo (s)  0 If Xo (s)  0, then as2  bs  c  0 (3:44)  Advanced Control Engineering   Transient behaviour of a second-order system Discriminant Roots Transient response type b > 4ac s1 and s2 real and unequal (ve) Overdamped Transient Response b2  4ac s1 and s2 real and equal (ve) Critically Damped Transient Response b2 < 4ac s1 and s2 complex conjugate of the form: s1 , s2    j! Underdamped Transient Response 2 This polynomial in s is called the Characteristic Equation and its roots will determine the system transient response. Their values are s1 , s2  b   b2  4ac 2a (3:45) The term (b2  4ac), called the discriminant, may be positive, zero or negative which will make the roots real and unequal, real and equal or complex. This gives rise to the three different types of transient response described in Table 3.4. The transient response of a second-order system is given by the general solution xo (t)  Aes1 t  Bes2 t (3:46) This gives a step response function of the form shown in Figure 3.16. xo (t ) Underdamping (s1 and s2 complex) Critical damping (s1 and s2 real and equal) Overdamping (s1 and s2 real and unequal) t Fig. 3.16 Effect that roots of the characteristic equation have on the damping of a second-order system. Time domain analysis 3.6.3 Critical damping and damping ratio Critical damping When the damping coefficient  of a second-order system has its critical value c , the system, when disturbed, will reach its steady-state value in the minimum time without overshoot. As indicated in Table 3.4, this is when the roots of the Characteristic Equation have equal negative real roots. Damping ratio z The ratio of the damping coefficient  in a second-order system compared with the value of the damping coefficient c required for critical damping is called the Damping Ratio (Zeta). Hence   c (3:47) Thus   0 No damping  < 1 Underdamping   1 Critical damping  > 1 Overdamping Example 3.7 Find the value of the critical damping coefficient Cc in terms of K and m for the spring±mass±damper system shown in Figure 3.17. C C xo Kxo K xo(t ) F(t ) m xo(t ) 1o(t ) m F(t ) xo(t ) Lumped Parameter Diagram (a) Fig. 3.17 Spring^ mass ^ damper system. Free-Body Diagram (b) +ve  Advanced Control Engineering Solution From Newton's second law From the free-body diagram X Fx  m xo F(t)  Kxo (t)  C x_ o (t)  m xo (t) (3:48) Taking Laplace transforms, zero initial conditions F(s)  KXo (s)  CsXo (s)  ms2 Xo (s) or (ms2  Cs  K)Xo (s)  F(s) (3:49) Characteristic Equation is ms2  Cs  K  0 C K  0 m m i:e: s2  and the roots are 8 s 9  2 1 <C C K=  s1 , s2  4 2 :m m m; (3:50) For critical damping, the discriminant is zero, hence the roots become s1  s2   Cc 2m Also, for critical damping Cc2 4K  m m2 Cc2  giving 3.6.4 4Km2 m  Cc  2 Km (3:51) Generalized second-order system response to a unit step input Consider a second-order system whose steady-state gain is K, undamped natural frequency is !n and whose damping ratio is , where  < 1. For a unit step input, the block diagram is as shown in Figure 3.18. From Figure 3.18 Xo (s)  s(s2 K!2n  2!n s  !2n ) (3:52) Time domain analysis Xo(s ) Kωn2 Xi (s) = 1/s 2 s + 2ζωns + s ωn2 Fig. 3.18 Step response of a generalized second-order system for  < 1. Expanding equation (3.52) using partial fractions $o (s)  A Bs  C  2 s s  2!n s  !2n Equating (3.52) and (3.53) and multiply by s s2  2!n s  !2n  K!2n  A s2  2!n s  !2n  Bs2  Cs Equating coefficients (s2 ) : 0  2!n A  C 0 K!2n  !2n A (s ) :  0AB 1 (s ) : (3:53) giving A  K, B  K and C  2!n K Substituting back into equation (3.53)    1 s  2!n Xo (s)  K  2 s s  2!n s  !2n Completing the square " ( )# 1 s  2!n Xo (s)  K  s (s  !n )2  !2n   2 !2n 93 > = s  2!n 7 61  K4   p2 5 > s > :(s  !n )2  !n 1   2 ; 2 8 > < (3:54) The terms in the brackets { } can be written in the standard forms 10 and 9 in Table 3.1. s Term (1)   p2 (s  !n )2  !n 1   2 9 p > = 2!n !n 1   2 p Term (2)    p2 !n 1   2 > ; : s2  !n 2  !n 1   2 > ( 8 )> <   Advanced Control Engineering Inverse transform " ( xo (t)  K 1   p !n p sin !n 1   2 t e !n 1   2 # ( ) n   p o 2 !n t sin !n 1   2 t  p e 1  2 !n t  p cos !n 1   2 t  Equation (3.55) can be simplified to give " (  p xo (t)  K 1  e!n t cos !n 1   2 t  When   0 !) (3:55) ! )#  p  p sin !n 1   2 t (3:56) 1  2 xo (t)  K[1  e0 cos !n t  0]  K[1  cos !n t] (3:57) From equation (3.57) it can be seen that when there is no damping, a step input will cause the system to oscillate continuously at !n (rad/s). Damped natural frequency w  From equation (3.56), when 0 <  > 1, the frequency of transient oscillation is given by p (3:58) ! d  !n 1   2 where !d is called the damped natural frequency. Hence equation (3.56) can be written as " ( )# !  !n t xo (t)  K 1  e (3:59) cos !d t  p sin !d t 1  2 " # e!n t  K 1  p sin (!d t  ) (3:60) 1  2 where p 1  2 tan    When   1, the unit step response is xo (t)  K[1  e!n t (1  !n t)] and when  > 1, the unit step response from equation (3.46) is given by ! " (  1  2 xo (t)  K 1   p e   1 !n t 2 2 2  1 )# !  1    2 1 !n t  p e  2 2 2  1 (3:61) (3:62) (3:63) Time domain analysis 1.6 ζ = 0.2 1.4 ζ = 0.4 1.2 ζ = 0.6 ζ = 0.8 xo(t ) 1 0.8 0.6 ζ = 2.0 0.4 ζ = 1.0 0.2 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 ωnt (rad) Fig. 3.19 Unit step response of a second-order system. The generalized second-order system response to a unit step input is shown in Figure 3.19 for the condition   1 (see also Appendix 1, sec_ord.m). 3.7 3.7.1 Step response analysis and performance specification Step response analysis It is possible to identify the mathematical model of an underdamped second-order system from its step response function. Consider a unity-gain (K  1) second-order underdamped system responding to an input of the form xi (t)  B (3:64) The resulting output xo (t) would be as shown in Figure 3.20. There are two methods for calculating the damping ratio. Method (a): Percentage Overshoot of first peak a1 100 %Overshoot  B Now a1  Be!n (=2) (3:65)  Advanced Control Engineering xo(t ) –ζω t Be n (with reference to final value) B a1 a2 B t τ τ/2 Fig. 3.20 Step response analysis. Thus, %Overshoot  e!n (=2) B 100 (3:66) Since the frequency of transient oscillation is !d , then,   Substituting (3.67) into (3.66) 2 !d 2 p !n 1   2  2 %Overshoot  e2!n =2!n 1  2 %Overshoot  e= 1 (3:67) 100 (3:68) Method (b): Logarithmic decrement. Consider the ratio of successive peaks a1 and a2 a1  Be!n (=2) Hence a2  Be!n (3=2) a1 e!n (=2)  ! (3=2)  e!n (=2)!n (3=2) a2 e n  2  e!n   e2= 1 (3:69) (3:70) (3:71) Time domain analysis Equation (3.71) can only be used if the damping is light and there is more than one overshoot. Equation (3.67) can now be employed to calculate the undamped natural frequency 2 !n  p  1  2 3.7.2 (3:72) Step response performance specification The three parameters shown in Figure 3.21 are used to specify performance in the time domain. (a) Rise time tr : The shortest time to achieve the final or steady-state value, for the first time. This can be 100% rise time as shown, or the time taken for example from 10% to 90% of the final value, thus allowing for non-overshoot response. (b) Overshoot: The relationship between the percentage overshoot and damping ratio is given in equation (3.68). For a control system an overshoot of between 0 and 10% (1 <  > 0:6) is generally acceptable. (c) Settling time ts : This is the time for the system output to settle down to within a tolerance band of the final value, normally between 2 or 5%. Using 2% value, from Figure 3.21 0:02B  Be!n ts Invert 50  e!n ts xo(t ) –ζω t Be n (with reference to final value) Overshoot + 2 or 5% of B – B Rise t Time tr Settling Time ts Fig. 3.21 Step response performance specification.   Advanced Control Engineering Take natural logs ln 50  !n ts giving ts    1 ln 50 !n (3:73) The term (1/!n ) is sometimes called the equivalent time constant Tc for a secondorder system. Note that ln 50 (2% tolerance) is 3.9, and ln 20 (5% tolerance) is 3.0. Thus the transient period for both first and second-order systems is three times the time constant to within a 5% tolerance band, or four times the time constant to within a 2% tolerance band, a useful rule-of-thumb. 3.8 Response of higher-order systems Transfer function techniques can be used to calculate the time response of higherorder systems. Example 3.8 (See also Appendix 1, examp38.m) Figure 3.22 shows, in block diagram form, the transfer functions for a resistance thermometer and a valve connected together. The input xi (t) is temperature and the output xo (t) is valve position. Find an expression for the unit step response function when there are zero initial conditions. Solution From Figure 3.22 Xo (s)  25 s(1  2s)(s2  s  25) (3:74)  12:5 s(s  0:5)(s2  s  25) (3:75)  A B Cs  D   s (s  0:5) (s  0:5)2  (4:97)2 (3:76) Resistance Thermometer Xi (s )=1/s 1 1 + 2s Valve 25 s2 + s + 25 Fig. 3.22 )lock diagram representation of a resistance thermometer and valve. Xo (s ) Time domain analysis Note that the second-order term in equation (3.76) has had the `square' completed since its roots are complex ( 2  4ac). Equate equations (3.75) and (3.76) and multiply both sides by s(s  0:5)(s2  s  25). 12:5  (s3  1:5s2  25:5s  12:5)A  (s3  s2  25s)B  (s3  0:5s2 )C  (s2  0:5s)D (3:77) Equating coefficients (s3 ) : 0ABC 2 0  1:5A  B  0:5C  D 1 0  25:5A  25B  0:5D 0 12:5  12:5A (s ) : (s ) : (s ) : Solving the four simultaneous equations A  1, B  1:01, C  0:01, D  0:5 Substituting back into equation (3.76) gives 1 1:01 0:01s  0:5  Xo (s)   s (s  0:5) (s  0:5)2  (4:97)2 (3:78) xo (t)  1  1:01e0:5t  0:01e0:5t (10:16 sin 4:97t  cos 4:97t) (3:79) Inverse transform Equation (3.79) shows that the third-order transient response contains both firstorder and second-order elements whose time constants and equivalent time constants are 2 seconds, i.e. a transient period of about 8 seconds. The second-order element has a predominate negative sine term, and a damped natural frequency of 4.97 rad/s. The time response is shown in Figure 3.23. 1.2 1 x0(t ) 0.8 0.6 0.4 0.2 0 0 1 2 3 Fig. 3.23 Time response of third-order system. 4 6 5 Time (s) 7 8 9   Advanced Control Engineering 3.9 Further problems Example 3.9 A ship has a mass m and a resistance C times the forward velocity u(t). If the thrust from the propeller is K times its angular velocity !(t), determine: (a) The first-order differential equation and hence the transfer function relating U(s) and !(s). 103 kg, C  150 000 Ns/m, and When the vessel has the parameters: m  18 000 K  96 000 Ns/rad, find, (b) the time constant. (c) an expression for the time response of the ship when there is a step change of !(t) from 0 to 12.5 rad/s. Assume that the vessel is initially at rest. (d) What is the forward velocity after (i) one minute (ii) ten minutes. Solution (a) m(du=dt)  Cu  K!(t) U K=C (s)  ! 1  (m=C)s (b) 120 seconds (c) u(t)  8(1  e0:00833t ) (d) (i) 3.148 m/s (ii) 7.946 m/s Example 3.10 (a) Determine the transfer function relating V2 (s) and V1 (s) for the passive electrical network shown in Figure 3.24. (b) When C  2 mF and R1  R2  1 M , determine the steady-state gain K and time constant T. (c) Find an expression for the unit step response. R1 v1(t ) Fig. 3.24 +assive electrical network. C R2 v2(t ) Time domain analysis  Solution (a) V2 R2 R1  R2 (s)  V1 1  R1 R2 C R1  R2 s (b) 0.5 1.0 seconds (c) vo (t)  0:5(1  et ) Example 3.11 Determine the values of !n and  and also expressions for the unit step response for the systems represented by the following second-order transfer functions Xo 1 (i) (s)  0:25s2  s  1 Xi (ii) (iii) Xo 10 (s)  2 s  6s  5 Xi Xo 1 (s)  2 s s1 Xi Solution (i) 2.0 1.0 (Critical damping) xo (t)  1  e2t (1  2t) (ii) 2.236 1.342 (Overdamped) xo (t)  2  2:5et  0:5e5t (iii) 1.0 0.5 (Underdamped) xo (t)  1  e0:5t ( cos 0:866t  0:577 sin 0:866t) Example 3.12 A torsional spring of stiffness K, a mass of moment of inertia I and a fluid damper with damping coefficient C are connected together as shown in Figure 3.25. The angular displacement of the free end of the spring is i (t) and the angular displacement of the mass and damper is o (t). θi (t ) K θo(t ) I Fig. 3.25 Torsional system. C  Advanced Control Engineering (a) Develop the transfer function relating i (s) and o (s). (b) If the time relationship for i (t) is given by i (t)  4t then find an expression for the time response of o (t). Assume zero initial conditions. What is the steadystate error between i (t) and o (t)? Solution (a) o (s)  1   KC s  1 (b) o (t)  4t  0:2  e2:5t (0:2 cos 9:682t  0:361 sin 9:682t) 0.2 radians. i I K  s2 Example 3.13 When a unity gain second-order system is subject to a unit step input, its transient response contains a first overshoot of 77%, occurring after 32.5 ms has elapsed. Find (a) (b) (c) (d) (e) the damped natural frequency the damping ratio the undamped natural frequency the system transfer function the time to settle down to within 2% of the final value Solution (a) 96.66 rad/s (b) 0.083 (c) 96.99 rad/s 1 0:106 103 s2  1:712 (e) 0.486 seconds (d) G(s)  103 s  1 Example 3.14 A system consists of a first-order element linked to a second-order element without interaction. The first-order element has a time constant of 5 seconds and a steadystate gain constant of 0.2. The second-order element has an undamped natural frequency of 4 rad/s, a damping ratio of 0.25 and a steady-state gain constant of unity. If a step input function of 10 units is applied to the system, find an expression for the time response. Assume zero initial conditions. Solution     xo (t)  2:0  2:046e0:2t  et 0:046 cos 15t  0:094 sin 15t 4 Closed-loop control systems 4.1 Closed-loop transfer function Any system in which the output quantity is monitored and compared with the input, any difference being used to actuate the system until the output equals the input is called a closed-loop or feedback control system. The elements of a closed-loop control system are represented in block diagram form using the transfer function approach. The general form of such a system is shown in Figure 4.1. The transfer function relating R(s) and C(s) is termed the closed-loop transfer function. From Figure 4.1 C(s)  G(s)E(s) (4:1) B(s)  H(s)C(s) (4:2) E(s)  R(s) (4:3) B(s) Substituting (4.2) and (4.3) into (4.1) C(s) ˆ G(s)fR(s) H(s)C(s)g C(s) ˆ G(s)R(s) G(s)H(s)C(s) C(s)f1 ‡ G(s)H(s)g ˆ G(s)R(s) C G(s) (s) ˆ R 1 ‡ G(s)H(s) (4:4) The closed-loop transfer function is the forward-path transfer function divided by one plus the open-loop transfer function.  Advanced Control Engineering Forward Path Summing point R(s) + E(s) Take-off point C(s) G(s) – B(s) H(s) Feedback Path Fig. 4.1                                                             ˆ               ˆ              ˆ      ˆ                ˆ     ! ˆ !       4.2 4.2.1 Block diagram reduction Control systems with multiple loops A control system may have several feedback control loops. For example, with a ship autopilot, the rudder-angle control loop is termed the minor loop, whereas the heading control loop is referred to as the major loop. When analysing multiple loop systems, the minor loops are considered first, until the system is reduced to a single overall closed-loop transfer function. To reduce complexity, in the following examples the function of s notation (s) used for transfer functions is only included in the final solution. Example 4.1 Find the closed-loop transfer function for the system shown in Figure 4.2. Solution In Figure 4.2, the first minor loop to be considered is G3 H3 . Using equation (4.4), this may be replaced by Gm1  G3 1  G 3 H3 (4:5) Cl       First Minor Loop Cascade R(s) + – + G1 C(s) + G2 – – G3 H3 H4 H5 Fig. 4.2 "       Now Gml is multiplied by, or in cascade with G2 . Hence the combined transfer function is G2 Gm1  G2 G3 1  G 3 H3 (4:6) The reduced block diagram is shown in Figure 4.3. Following a similar process, the second minor loop Gm2 may be written Gm2  1 G2 G3 1G3 H3 G2 G3 H2  1G 3 H3 Multiplying numerator and denominator by 1  G3 H3 Gm2  G2 G3 1  G 3 H3  G 2 G 3 H2 But Gm2 is in cascade with G1 , hence G1 Gm2  G1 G2 G3 1  G3 H3  G2 G3 H2 (4:7) Transfer function (4.7) now becomes the complete forward-path transfer function as shown in Figure 4.4.  Advanced Control Engineering Second Minor Loop Cascade R(s) + – + G1 G2G3 1 + G3H3 – C(s) H2 H1 Fig. 4.3 #        R(s)  + C(s) G1G2G3 1 + G3H3 + G2G3H2 – H1 Fig. 4.4         The complete, or overall closed-loop transfer function can now be evaluated G G G 1 2 3 C 1G3 H3 G2 G3 H2 (s)  G3 H1 R 1  1GG1HG2G G H 3 3 2 3 2 Multiplying numerator and denominator by 1  G3 H3  G2 G3 H2 C G1 (s)G2 (s)G3 (s) (s)  R 1  G3 (s)H3 (s)  G2 (s)G3 (s)H2 (s)  G1 (s)G2 (s)G3 (s)H1 (s) (4:8) Cl  4.2.2      Block diagram manipulation There are occasions when there is interaction between the control loops and, for the purpose of analysis, it becomes necessary to re-arrange the block diagram configuration. This can be undertaken using Block Diagram Transformation Theorems.   Block Diagram Transformation Theorems Transformation Block diagram Equation 1. Combining blocks in cascade Y = (G1G2)X 2. Combining blocks in parallel; or eliminating a forward loop Y = G1X + – G2X 3. Removing a block from a forward path Y = G1X + – G2X 4. Eliminating a feedback loop Y = G1(X + – G2Y ) 5. Removing a block from a feedback loop Y = G1(X + – G2Y ) 6. Rearranging summing points Z=W+ –Y –X + 7. Moving a summing point ahead of a block Z = GX + –Y X G1 Equivalent block diagram Y G2 X X X + G1 Y G1G2 Y G1+ – G2 Y + – X G2 X + X Y G1 – + X + + + – X Y X + – Z Z + G 1 + G2 + W Y X Z = G(X + – Y) 9. Moving a take-off point ahead of a block Y = GX 10. Moving a take-off point beyond a block Y = GX G + – Y G X Y Z Y + X Y G Z Z G Y X + – + – Y Y X + 1 G G Z Y G 1 G2 – + G + – X X + Y X + Y 8. Moving a summing point beyond a block + – + – + – Y + G1 G2 G1 1+ – G 1 G2 . G2 W . G2 G Y G X X G 1 G . Y  Advanced Control Engineering Example 4.2 Moving a summing point ahead of a block. Equation Z  GX  Y Equation Z ˆ fX  (1$G)YgG (4:9) Z ˆ GX  Y A complete set of Block Diagram Transformation Theorems is given in Table 4.1. Example 4.3 Find the overall closed-loop transfer function for the system shown in Figure 4.6. Solution Moving the first summing point ahead of G1 , and the final take-off point beyond G4 gives the modified block diagram shown in Figure 4.7. The block diagram shown in Figure 4.7 is then reduced to the form given in Figure 4.8. The overall closed-loop transfer function is then C (s) ˆ R 1‡ ˆ G1 G2 G3 G4 (1‡G1 G2 H1 )(1‡G3 G4 H2 ) 6G1 G2 G3 6G4 H3 (6G1 6G4 )(1‡G1 G2 H1 )(1‡G3 G4 H2 ) G1 (s)G2 (s)G3 (s)G4 (s) (1 ‡ G1 (s)G2 (s)H1 (s))(1 ‡ G3 (s)G4 (s)H2 (s)) ‡ G2 (s)G3 (s)H3 (s) + X Z X + G + – (4:10) Z G + – Y Y 1 G Fig. 4.5 "         Ahead R(s) + – Beyond H3 + G1 – G2 C(s) + G3 G4 – H1 Fig. 4.6       H2 Cl  1 G1 R(s) + – C(s) + –    1 G4 H3 G 1 G2   G 3 G4 – H2 H1 Fig. 4.7 "         H3 G1G4 R(s) + – G3G4 G1G2 1 + G1G2H1 C(s) 1 + G3G4H2 Fig. 4.8 %     4.3 4.3.1 Systems with multiple inputs Principle of superposition A dynamic system is linear if the Principle of Superposition can be applied. This states that `The response "() of a linear system due to several inputs x1 (t), x2 (t) . . .  xn (t), acting simultaneously is equal to the sum of the responses of each input acting alone'. Example 4.4 Find the complete output for the system shown in Figure 4.9 when both inputs act simultaneously. Solution The block diagram shown in Figure 4.9 can be reduced and simplified to the form given in Figure 4.10. Putting R2 (s)  0 and replacing the summing point by 1 gives the block diagram shown in Figure 4.11. In Figure 4.11 note that C1 (s) is response to R1 (s) acting alone. The closed-loop transfer function is therefore G G 1 2 CI 2 (s)  1GG21 H G2 H 1 R1 1  1G H 2 2  Advanced Control Engineering or C I (s)  G1 (s)G2 (s)R1 (s) 1  G2 (s)H2 (s)  G1 (s)G2 (s)H1 (s) (4:11) Now if R1 (s)  0 and the summing point is replaced by 1, then the response C II (s) to input R2 (s) acting alone is given by Figure 4.12. The choice as to whether the summing point is replaced by ‡1 or 1 depends upon the sign at the summing point. Note that in Figure 4.12 there is a positive feedback loop. Hence the closed-loop transfer function relating R2 (s) and C II (s) is C II (s) ˆ R2 1 R1(s) + G1 G2 H1 1‡G2 H2  G1 G2 H1 1‡G2 H2  + C(s) G1 G2 – – H2 + H1 + R2(s) Fig. 4.9       R1(s) + C(s) G 1 G2 1 + G2H2 – + H1 + R2(s) Fig. 4.10 %         Cl  + R1(s) H1 Fig. 4.11    I +1  &    R2(s) + H1 –1 + Fig. 4.12       C (s) G1G2 1 + G2H2 –   G 1 G2 1 + G2H2 C II(s)  '    or C II (s)  G1 (s)G2 (s)H1 (s)R2 (s) 1 ‡ G2 (s)H2 (s) ‡ G1 (s)G2 (s)H1 (s) (4:12) It should be noticed that the denominators for equations (4.11) and (4.12) are identical. Using the Principle of Superposition, the complete response is given by C(s) ˆ C I (s) ‡ C II (s) (4:13) or C(s) ˆ 4.4 4.4.1 (G1 (s)G2 (s))R1 (s) (G1 (s)G2 (s)H1 (s))R2 (s) 1 ‡ G2 (s)H2 (s) ‡ G1 (s)G2 (s)H1 (s) (4:14) Transfer functions for system elements DC servo-motors One of the most common devices for actuating a control system is the DC servomotor shown in Figure 4.13, and can operate under either armature or field control. (a) Armature control: This arrangement is shown in schematic form in Figure 4.14. Now air gap flux  is proportional to if , or  ˆ Kfd if (4:15)  Advanced Control Engineering ef(t) if(t) Field coil Rf; Lf θ(t) ω(t) Armature winding Ra; La (a) Physical Arrangement ia(t) ea(t) Ra Rf La ia(t) if(t) ea(t) ef(t) Lf θ(t), ω(t) (b) Schematic Diagram Fig. 4.13   !(     where %fd is the field coil constant. Also, torque developed &m is proportional to the product of the air gap flux and the armature current &m ()  %am a () (4:16) Cl       La Ra Tm ia(t) ea(t) θ(t) ω(t) eb(t) if ef Fig. 4.14 !(            ˆ    )     ˆ         ˆ        ˆ     ˆ (     ˆ    ˆ (      ˆ * +      ˆ         ˆ      ˆ $ where %am is the armature coil constant. Substituting (4.15) into (4.16) gives &m ()  (%fd %am f )a () (4:17) &m ()  %a a () (4:18) Since f is constant where the overall armature constant %a is %a  %fd %am f (4:19) When the armature rotates, it behaves like a generator, producing a back emf eb (t) proportional to the shaft angular velocity eb (t)  Kb d  Kb (t) dt (420) where Kb is the back emf constant. The potential difference across the armature winding is therefore ea (t) eb (t) ˆ La dia ‡ Ra ia dt (421) Taking Laplace transforms of equation (4.21) with zero initial conditions Ea (s) Eb (s) ˆ (La s ‡ Ra )Ia (s) (422) Figure 4.15 combines equations (4.18), (4.20) and (4.22) in block diagram form. Under steady-state conditions, the torque developed by the DC servo-motor is Tm (t) ˆ fea (t) Kb (t)g Ka Ra  Advanced Control Engineering Ea(s) + Ia(s) 1 Las + Ra Tm(s) Ka – Eb(s) ω(s) Kb Fig. 4.15             !(     or &m ()    %a ea (t) Ra   Ka Kb !(t) Ra (4:23) From equation (4.23), the relationship between Tm (t), !(t) and Ea (t) under steadystate conditions is shown in Figure 4.16. (b) Field control: This arrangement is shown in schematic form in Figure 4.13, with the exception that the armature current ia is held at a constant value. Equation (4.17) may now be written as Tm (t) ˆ (Kfd Kam ia )if (t) (4:24) Tm (t) ˆ Kf if (t) (4:25) and since ia is a constant, then where the overall field constant Kf is Kf ˆ Kfd Kam ia (4:26) In this instance, the back emf eb does not play a part in the torque equation, but it can produce difficulties in maintaining a constant armature current ia . The potential difference across the field coil is ef (t) ˆ Lf dif ‡ Rf if dt (4:27) Taking Laplace transforms of equation (4.27) with zero initial conditions Ef (s) ˆ (Lf s ‡ Rf )If (s) Figure 4.17 combines equations (4.25) and (4.28) in block diagram form. (4:28) Cl       Tm(t) (Nm)_ Increasing ea(t) ω(t) (rad/s) Fig. 4.16        !    Ef(s) Fig. 4.17    1 Lfs + Rf If(s)          !(   Tm(s) Kr        !(     Under steady-state conditions, the torque developed by the DC servo-motor is   %f &m ()  ef (t) (4:29) Rf The relationship between Tm (t), ef (t) and !(t) under steady-state conditions is shown in Figure 4.18. 4.4.2 Linear hydraulic actuators Hydraulic actuators are employed in such areas as the aerospace industry because they possess a good power to weight ratio and have a fast response. Figure 4.19 shows a spool-valve controlled linear actuator. When the spool-valve is moved to the right, pressurized hydraulic oil flows into chamber (1) causing the piston to move to the left, and in so doing forces oil in chamber (2) to be expelled to the exhaust port. The following analysis will be linearized for small perturbations of the spool-valve and actuator.  Advanced Control Engineering Tm(t) (Nm) Tm(t) (Nm) Increasing ef(t) Kf Rf ω(t) (rad/s) ef(t) (V) (b) (a) Fig. 4.18          !      !(     Pe = 0 Pe = 0 Ps Xv, xv Q2 Q1 P2 V2 A A Xo, xo P1 V1 m (1) (2) Qleak Fig. 4.19       It is assumed that: . the supply pressure *s is constant . the exhaust pressure *e is atmospheric . the actuator is in mid-position so that +1  +2  +o which is half the total volume . . . . . . of hydraulic fluid +t the hydraulic oil is compressible the piston faces have equal areas # ,_ 1 and ,_ 2 are the volumetric flow-rates into chamber (1) and out of chamber (2) the average, or load flow-rate ,_ L has a value (,_ 1  ,_ 2 )$2 *1 and *2 are the fluid pressures in chamber (1) and chamber (2) the load pressure *L has a value (*1 *2 ) Cl       (a) Actuator analysis: The continuity equation for the chambers may be written   Q_ in Q_ out ˆ (rate of change of chamber volume) ‡ (rate of change of oil volume) (4:30) In equation (4.30), the rate of change of chamber volume is due to the piston movement, i.e. dV$dt. The rate of change of oil volume is due to compressibility effects, i.e.: Bulk Modulus of oil,  ˆ Volumetric stress/Volumetric strain ˆ dP dVV (431) Note that in equation (4.31) the denominator is negative since an increase in pressure causes a reduction in oil volume. Hence dV dP ˆ V  Giving, when differentiated with respect to time dV ˆ dt   V dP  dt (432) For chamber (1), equation (4.30) may be expressed as Q_ 1   dV1 V1 dP1 _ ‡ Qleak ˆ dt  dt (433)   dV2 V2 dP2 Q_ 2 ˆ ‡ dt  dt (434) and for chamber (2) Q_ leak Now Q_ 1 ‡ Q_ 2 Q_ L ˆ 2 Thus, from eqations (4.33) and (4.34)  1 dV1 Q_ L ˆ Q_ leak ‡ 2 dt   dV2 1 dP1 V1 ‡ 2 dt dt V2 dP2 dt  (435) If leakage flow-rate Q_ leak is laminar, then Q_ leak ˆ Cp PL (436)  Advanced Control Engineering where Cp is the leakage coefficient. Also, if V1  V2  Vo , then dV2 dV1 dVo ˆ ˆ dt dt dt (4:37) Hence equation (4.35) can be written dVo Vo d ‡ (P1 Q_ L ˆ CP PL ‡ dt 2 dt P2 ) (438) or dXo Vt dPL ‡ Q_ L ˆ CP PL ‡ A dt 4 dt (439) where dVo dXo ˆA dt dt and Vo ˆ Vt 2 (b) Linearized spool-valve analysis: Assume that the spool-valve ports are rectangular in form, and have area Av ˆ WXv (440) where W is the width of the port. From orifice theory Q_ 1 ˆ Cd WXv  2 (Ps P1 )  (441)  2 (P2 0)  (442) and Q_ 2 ˆ Cd WXv whereo Cd is a coefficient of discharge and  is the fluid density. Equating (4.41) and (4.42) Ps P1 ˆ P2 (443) since PL ˆ P1 P2 Equation (4.43) may be re-arranged to give P1 ˆ Ps ‡ PL 2 (444) Cl  From equations (4.41) and (4.42) the load flow-rate may be written as    2 Ps PL _ ,L  Cd WXv  2      (4:45) Hence Q_ L ˆ F(XV PL ) (4:46) Equation (4.45) can be linearized using the technique described in section 2.7.1. If qL , xv and pL are small perturbations of parameters QL , XV and PL about some operating point `a', then from equation (4.46) q_ L ˆ  Q_ L  Q_ L xv ‡ pL Xv a PL a (4:47) or q_ L ˆ Kq xv (4:48) K c pL where  1 Kq (flow gain) ˆ Cd W (Ps PLa )  (4:49) and (flow-pressure coefficient which has a negative value)  Cd WXva 1 Kc ˆ (Ps PLa ) 2 (4:50) Note that PLa and Xva are the values of PL and Xv at the operating point `a'. The relationship between Q_ L , PL and Xv , from equation (4.45), together with the linearized relations q_ L , PL and xv are shown in Figure 4.20. Equation (4.39) is true for both large and small perturbations, and so can be written q_ L ˆ A dxo Vt dpL ‡ C P pL ‡ dt 4 dt (451) Equating (4.48) and (4.51) gives Kq xv ˆ A dxo Vt dpL ‡ (CP ‡ Kc )pL ‡ dt 4 dt (452) Taking Laplace transforms (zero initial conditions), but retaining the lower-case small perturbation notation gives Kq xv (s) ˆ Asxo (s) ‡ (CP ‡ Kc ) ‡ Vt s pL (s) 4 (453)  Advanced Control Engineering QL 3 ms Increasing Xv Linearized Relationship Ps PL (Pa) Fig. 4.20     , #         The force to accelerate the mass m is shown in Figure 4.21. From Figure 4.21  )x  m xo APL  m xo (4:54) Take Laplace transforms with zero initial conditions and using lower-case notation pL (s)  m 2 s xo (s) A (4:55) Inserting equation (4.55) into (4.53) gives Kq xv (s)  Asxo (s)  (CP  Kc )  Vt m 2  s xo (s) s A 4 (456) Equation (4.56) may be re-arranged to give the transfer function relating xo (s) and xv (s) APL m xo(t), xo(t), 1o(t) Fig. 4.21 #           Cl       K q xo A    (s)   C K xv s mVt s2  p c s  1 4A2 (457) A2 Equation (4.57) can be written in the standard form xo (s)   xv s where Kh 1 2 s 2nh  2nhh s  1 (458)  Kq A  4A2 (hydraulic natural frequency)  mVt Kh (hydraulic gain)  nh h (hydraulic damping ratio)   CP  Kc 2  4 mVt A2 Since the Bulk Modulus of hydraulic oil is in the order of 1.4 GPa, if m and Vt are small, a large hydraulic natural frequency is possible, resulting in a rapid response. Note that the hydraulic damping ratio is governed by CP and Kc . To control the level of damping, it is sometimes necessary to drill small holes through the piston. 4.5 4.5.1 Controllers for closed-loop systems The generalized control problem A generalized closed-loop control system is shown in Figure 4.22. The control problem can be stated as: `The control action u(t) will be such that the controlled output c(t) will be equal to the reference input r1 (t) for all values of time, irrespective of the value of the disturbance input r2 (t)'. In practice, there will always be transient errors, but the transient period should be kept as small as possible. It is usually possible to design the controller so that steadystate errors are minimized, or ideally, eliminated. R2(s) R1(s) + Reference Input E (s) – Controller U(s) + Control Action Fig. 4.22 - .        Disturbance Input – C(s) Plant Controlled Output  Advanced Control Engineering 4.5.2 Proportional control In this case, the control action, or signal is proportional to the error e(t) u(t)  K1 e(t) (4:59) where K1 is the proportional gain constant. If the plant dynamics are first-order, then Figure 4.22 can be described as shown in Figure 4.23. The plant transfer function is   K (U(s) R2 (s)) ˆ C(s) (4:60) 1 ‡ Ts And the proportional control law, from equation (4.59) becomes U(s) ˆ K1 (R1 (s) (4:61) C(s)) Inserting equation (4.61) into equation (4.60) gives C(s) ˆ fK1 (R1 (s) C(s)) R2 (s)gK (1 ‡ Ts) (4:62) which can be written as f(1 ‡ K1 K) ‡ TsgC(s) ˆ K1 KR1 (s) Re-arranging equation (4.63) gives  C(s) ˆ K1 K 1‡K1 K KR2 (s)    K R1 (s) 1‡K1 K R2 (s)   T s 1 ‡ 1‡K 1K (4:63) (4:64) When r1 (t) is a unit step, and r2 (t) is zero, the final value theorem (equation (3.10)) gives the steady-state response   K1 K c(t) ˆ as t ! 1: 1 ‡ K1 K R2(s) Proportional Controller R1(s) + E(s) K1 U(s) – Fig. 4.23            + – K 1 + Ts C(s) Cl       When r2 (t) is a unit step, and r1 (t) is zero, the final value theorem (equation (3.10)) gives the steady-state response   K c(t) ˆ as t ! 1: 1 ‡ K1 K Hence, for the system to have zero steady-state error, the terms in equation (4.64) should be   K1 K ˆ1 1 ‡ K1 K   (4:65) K ˆ0 1 ‡ K1 K This can only happen if the open-loop gain constant K1 K is infinite. In practice this is not possible and therefore the proportional control system proposed in Figure 4.23 will always produce steady-state errors. These can be minimized by keeping the openloop gain constant K1 K as high as possible. Since the closed-loop time-constant form equation (4.64) is   T (4:66) Tc ˆ 1 ‡ K1 K Then maintaining K1 K at a high value will reduce the closed-loop time constant and therefore improve the system transient response. This is illustrated in Figure 4.24 which shows a step change in r1 (t) followed by a step change in r2 (t). Summary For a first-order plant, proportional control will always produce steady-state errors. This is discussed in more detail in Chapter 6 under `system type classification' where equations (6.63)±(6.65) define a set of error coefficients. Increasing the open-loop c(t) Steady-state Error r1(t) K1K large r2(t) K1K small Time(s) Fig. 4.24                   Advanced Control Engineering gain constant (which is usually achieved by increasing the controller gain %1 ) will reduce, but not eliminate them. A high controller gain will also reduce the transient period. However, as will be shown in Chapters 5 and 6, high open-loop gain constants can result in the instability of higher-order plant transfer functions. 4.5.3 Proportional plus Integral (PI) control Including a term that is a function of the integral of the error can, with the type of plant shown in Figure 4.23, eliminate steady-state errors. Consider a control law of the form  ()  %1 e(t)  K2 edt (4:67) Taking Laplace transforms   K2 U(s)  K1  E(s) s   K2  K1 1  E(s) K1 s   1  K1 1  E(s) Ti s (4:68) In equation (4.68), Ti is called the integral action time, and is formally defined as: `The time interval in which the part of the control signal due to integral action increases by an amount equal to the part of the control signal due to proportional action when the error is unchanging'. (BS 1523). Inserting the PI control law given in equation (4.68) into the first-order plant transfer function shown in equation (4.60) gives C(s)  (K1 (1  1Ti s)(R1 (s) C(s)) (1 ‡ Ts) R2 (s))K (469) which can be written as fTi Ts2 ‡ Ti (1 ‡ K1 K)s ‡ K1 KgC(s) ˆ K1 K(1 ‡ Ti s)R1 (s) K1 KTi sR2 (s) (470) Re-arranging gives (1 ‡ Ti s)R1 (s) Ti sR2 (s)    Ti T 2‡T 1‡ 1 s i K1 K s ‡ 1 K1 K C(s) ˆ  (471) The denominator is now in the standard second-order system form of equation (3.42). The steady-state response may be obtained using the final value theorem given in equation (3.10). c(t) ˆ (1 ‡ 0)r1 (t) (0)r2 (t) as t ! 1 (472) Cl       c(t) r1(t) r2(t) Time (s) Fig. 4.25             /   When there are step changes in r1 (t) and r2 (t): (1  0)sR1 (s) s ˆ R1 (s) C(s)  (0) sR2 (s) s c(t) ˆ r1 (t) (4:73) Thus, when r1 (t) and r2 (t) are unchanging, or have step changes, there are no steadystate errors as can be seen in Figure 4.25. The second-order dynamics of the closedloop system depend upon the values of Ti , T, K1 and K. Again, a high value of K1 will provide a fast transient response since it increases the undamped natural frequency, but with higher order plant transfer functions can give rise to instability. Summary For a first-order plant, PI control will produce a second-order response. There will be zero steady-state errors if the reference and disturbance inputs r1 (t) and r2 (t) are either unchanging or have step changes. The process of including an integrator within the control loop to reduce or eliminate steady-state errors is discussed in more detail in Chapter 6 under `system type classification'. Example 4.5 (See also Appendix 1, examp45.m) A liquid-level process control system is shown in Figure 4.26. The system parameters are A ˆ 2 m2 Rf ˆ 15 s$m2 H1 ˆ 1 V$m Kv ˆ 0:1 m3 $sV K1 ˆ 1 (controller again) (a) What are the values of Ti and  when the undamped natural frequency !n is 0.1 rad/s? (b) Find an expression for the time response of the system when there is a step change of hd (t) from 0 to 4 m. Assume zero initial conditions.  Advanced Control Engineering Control Valve Kv u(t) v1(t) hd(t) hm(t) PI Controller Tank Area A ha(t) Outlet valve Resistance Rf Pressure transducer H1 v2(t) Fig. 4.26 +        The controller is given in equation (4.68). The inflow to the tank is .1 ()  %v () (4:74) The tank dynamics are expressed, using equation (2.63) as .1 () .2 () ˆ # d3a d (4:75) and the linearized outflow is .2 () ˆ 3a () Rf (4:76) The measured head hm (t) is obtained from the pressure transducer hm (t) ˆ H1 ha (t) (4:77) From equations (4.75) and (4.76), the tank and outflow valve transfer function is Ha Rf (s) ˆ V1 1 ‡ ARf s (4:78) The block diagram for the control system is shown in Figure 4.27. From the block diagram, the forward-path transfer function G(s) is G(s) ˆ   K1 Kv Rf 1 ‡ T1i s (1 ‡ ARf s) K1 Kv Rf (1 ‡ Ti s) ˆ Ti s(1 ‡ ARf ) (4:79) Cl  PI Controller E(s) U(s) K1 1 + 1 T is – Hm(s) V1(s) Kv    Tank and valve Control valve Hd(s) +   Rf 1+ARfs Ha(s) Pressure tranducer H1 Fig. 4.27     +        Using equation (4.4), the closed-loop transfer function becomes K1 Kv Rf (1Ti s) Ha (ARf Ti s2 Ti s) (s)  Hd 1  K1 Kv Rf H12(1Ti s) (4:80) Ha K1 Kv Rf (1  Ti s) (s)  2 (ARf Ti )s  Ti (1  K1 Kv Rf H1 )s  K1 Kv Rf H1 Hd (4:81) (ARf Ti s Ti s) which simplifies to Equation (4.81) can be expressed in the standard form of equation (3.42) for a second-order system. Putting H1  1, then Ha (1  Ti s)    (s)   ATi 1 Hd 2 K1 Kv s  Ti K1 Kv Rf  1 s  1 (4:82) (a) Comparing the denominator terms with the standard form given in equation (3.42)   ATi 1 (4:83)  2 !n K1 Kv  1 Ti 1 K1 Kv Rf   2 !n From equation (4.83) Ti  K1 Kv 1 0:1   5 seconds 2 0:12 2 !n A From equation (4.84)   !n Ti 1 1 K1 Kv Rf 2   0:1 5 1  1  0:417  2 1 0:1 15  (4:84)  Advanced Control Engineering (b) Inserting values into equation (4.82) Ha (1  5s) (s)  2 100s  8:34s  1 Hd (4:85) For a step input of height 4 m Ha (s)    0:01(1  5s) 4 s2  0:0834s  0:01 s Expanding by partial fractions using 3.2.4 (iv) Ha (s)  s(s2 0:04  0:2s A Bs  C   2 s s  0:0834s  0:01  0:0834s  0:01) (4:86) Multiplying through by s(s2  0:0834s  0:01) 0:04  0:2s  A(s2  0:0834s  0:01)  Bs2  Cs Equating coefficients (s2 ) : 0AB 1 0:2  0:0834A  C 0 0:04  0:01A (s ) : (s ) : giving A4 Bˆ 4 Cˆ 0:1336 Substituting values back into (4.86) and complete the square to give Ha (s) ˆ 4 4s 0:1336 ‡ s (s ‡ 0:0417)2 ‡ 0:09092 (4:87) Inverse transform using Laplace transform pairs (9) and (10) in Table 3.1. Ha (s) ˆ 4 s ha (t) ˆ 4 4s (s ‡ 0:0417)2 ‡ 0:09092 4e 0:0417t 1:4697e  cos 0:0909t 0:0417t 1:4697 0:0909 (s ‡ 0:0417)2 ‡ 0:09092 0:0417 sin 0:0909t 0:0909 sin 0:0909t  which simplifies to give ha (t) ˆ 4[1 e 0:0417t ( cos 0:0909t 0:0913 sin 0:0909t)] (4:88) Cl       6 5 ha(t) 4 3 2 1 0 10 20 40 30 50 t (s) Fig. 4.28 %     /   +    2  0  60 70 80 90 100   #   0'1         In equation (4.88) the amplitude of the sine term is small, compared with the cosine term, and can be ignored. Hence   3a ()  4 1 e 0:0417 cos 0:0909 (4:89) The time response depicted by equation (4.89) is shown in Figure 4.28. 4.5.4 Proportional plus Integral plus Derivative (PID) control Most commercial controllers provide full PID (also called three-term) control action. Including a term that is a function of the derivative of the error can, with high-order plants, provide a stable control solution. Proportional plus Integral plus Derivative control action is expressed as  de (4:90) () ˆ %1 e(t) ‡ K2 edt ‡ K3 dt Taking Laplace transforms   K2 U(s) ˆ K1 ‡ ‡ K3 s E(s) s   K2 K3 ‡ ˆ K1 1 ‡ s E(s) K1 s K1   1 ‡ Td s E(s) ˆ K1 1 ‡ Ti s (4:91)  Advanced Control Engineering In equation (4.91), &d is called the derivative action time, and is formally defined as: `The time interval in which the part of the control signal due to proportional action increases by an amount equal to the part of the control signal due to derivative action when the error is changing at a constant rate' (BS 1523). Equation (4.91) can also be expressed as 1(s)  4.5.5 K1 (Ti Td s2  Ti s  1) E(s) Ti s (4:92) The Ziegler±Nichols methods for tuning PID controllers The selection of the PID controller parameters K1 , Ti and Td can be obtained using the classical control system design techniques described in Chapters 5 and 6. In the 1940s, when such tools were just being developed, Ziegler and Nichols (1942) devised two empirical methods for obtaining the controller parameters. These methods are still in use. (a) The Process Reaction Method: This is based on the assumption that the openloop step response of most process control systems has an S-shape, called the process reaction curve, as shown in Figure 4.29. The process reaction curve may be approximated to a time delay D (also called a transportation lag) and a first-order system of maximum tangential slope R as shown in Figure 4.29 (see also Figure 3.13). The Process Reaction Method assumes that the optimum response for the closedloop system occurs when the ratio of successive peaks, as defined by equation (3.71), is 4:1. From equation (3.71) it can be seen that this occurs when the closed-loop damping ratio has a value of 0.21. The controller parameters, as a function of R and D, to produce this response, are given in Table 4.2. c(t) R D Fig. 4.29      t(s) Cl         Ziegler±Nichols PID parameters using the Process Reaction Method Controller type K1 Ti Td P PI PID 1/RD 0:9/RD 1:2/RD ± D/0:3 2D ± ± 0:5D   Ziegler±Nichols PID parameters using the Continuous Cycling Method Controller type K1 Ti Td P PI PID Ku /2 Ku /2:2 Ku /1:7 ± Tu /1:2 Tu /2 ± ± Tu /8 Note that the Process Reaction Method cannot be used if the open-loop step response has an overshoot, or contains a pure integrator(s). (b) The Continuous Cycling Method: This is a closed-loop technique whereby, using proportional control only, the controller gain K1 is increased until the system controlled output c(t) oscillates continually at constant amplitude, like a secondorder system with no damping. This condition is referred to as marginal stability and is discussed further in Chapters 5 and 6. This value of controller gain is called the ultimate gain Ku , and the time period for one oscillation of c(t) is called the ultimate period Tu . The controller parameters, as a function of Ku and Tu , to provide a similar closed-loop response to the Process Reaction Method, are given in Table 4.3. The two Ziegler±Nichols PID tuning methods provide a useful `rule of thumb' empirical approach. The control system design techniques discussed in Chapters 5 and 6 however will generally yield better design solutions. Of the two techniques, the Process Reaction Method is the easiest and least disruptive to implement. In practice, the measurement of R and D is very subjective, and can lead to errors. The Continuous Cycling Method, although more disruptive, has the potential to give better results. There is the risk however, particularly with high performance servo-mechanisms, that if Ku is increased by accident to slightly above the marginal stability value, then full instability can occur, resulting in damage to the system. Actuator saturation and integral wind-up One of the practical problems of implementing PID control is that of actuator saturation and integral wind-up. Since the range of movement in say, a control valve, has physical limits, once it has saturated, increasing the magnitude of the control signal further has no effect. However, if there is a difference between desired and measured values, the resulting error will cause a continuing increase in the integral term, referred to as integral wind-up. When the error term changes its sign, the integral term starts to `unwind,' and this can cause long time delays and possible instability. The solution is to limit the maximum value that the integral term can have.  Advanced Control Engineering 4.5.6 Proportional plus Derivative (PD) control Proportional plus Derivative control action is expressed as ()  %1 e(t)  K3 de dt (4:93) Taking Laplace transforms   K3 U(s)  K1 1  E(s) K1  K1 1  Td s E(s) (4:94) The inclusion of a derivative term in the controller generally gives improved damping and stability. This is discussed in more detail in Chapters 5 and 6. 4.6 Case study examples Example 4.6.1 CNC Machine-Tool Positional Control (See also Appendix 1, examp461.m) The physical configuration and block diagram representation of a CNC machinetool is shown in Figures 1.10 and 1.11. The fundamental control problem here is that, by design, the lead-screw (by the use of re-circulating ball-bearings) is friction-free. This means that the positional control system will have no damping, and will oscillate continuously at the undamped natural frequency of the closed-loop system. Damping can be introduced in a number of ways: (a) A dashpot attached to the lead-screw: This is wasteful on energy and defeats the objective of a friction-free system. (b) Velocity feedback: A signal from a sensor that is the first derivative of the output (i.e. velocity) will produce a damping term in the closed-loop transfer function. (c) PD control: A PD controller will also provide a damping term. However, the practical realization will require an additional filter to remove unwanted high frequency noise (see Chapter 6 for further details on lead-lag compensation). Most machine-tool manufacturers employ velocity feedback to obtain the necessary damping. Since overshoot in a cutting operation usually cannot be tolerated, the damping coefficient for the system must be unity, or greater. For this study, the machine-tool configuration will be essentially the same as shown in Figure 1.10, with the exception that: (i) A gearbox will be placed between the servo-motor and the lead-screw to provide additional torque. (ii) The machine table movement will be measured by a linear displacement transducer attached to the table. This has the advantage of bringing the table `within the control-loop' and hence providing more accurate control. Cl       System element dynamic equations: With reference to Figures 1.11 and 4.31 1. Controller Proportional control gain K1 (V$m) Control signal U1 (s)  K1 (Xd (s) Xm (s)) Gain K2 (V$V) Control signal U2 (s) ˆ K2 (U1 (s) B2 (s)) (4:95) 2. Power amplifier (4:96) 3. DC servo-motor: Field controlled, with transfer function as shown in Figure 4.17. It will be assumed that the field time constant Lf $Rf is small compared with the dynamics of the machine table, and therefore can be ignored. Hence, DC servomotor gain K3 (Nm$V). Motor Torque Tm (s) ˆ K3 U2 (s) (4:97) 4. Gearbox, lead-screw and machine-table: With reference to Figure 2.9 (free-body diagram of a gearbox), the motor-shaft will have zero viscous friction Cm , hence equation (2.22), using Laplace notation, becomes 1 X(s) ˆ (Tm (s) a Im s2 m (s)) (498) The output shaft in this case is the lead screw, which is assumed to have zero moment of inertia Io and viscous friction Co . The free-body diagrams of the machine-table and lead-screw are shown in Figure 4.30. For lead-screw Work in ˆ Work out bX(t)o (t) ˆ F(t)xo (t) or F(t) ˆ bX(t) o (t) xo (t) (499) xo(t), xo(t), 1o(t) θo(t) bX(t) m P Fig. 4.30 #          F(t)  Advanced Control Engineering Now the pitch p of the lead-screw is p xo (t) o (t) (4100) Substituting (4.100) into (4.99) F(t)  bX(t) p (4101) The equation of motion for the machine-table is F(t)  m xo (4102) Equating (4.101) and (4.102) gives 1 xo ) X(t)  ( pm b Taking Laplace transforms 1 X(s)  ( pms2 Xo (s)) b Equating (4.98) and (4.103) gives pms2 Xo (s)  Now b Tm (s) a Im s2 m (s) (4103)  (4104) b$a ˆ gear ratio n m (s) ˆ no (s) Hence s2 m (s) ˆ ns2 o (s) and o (s) ˆ Xo (s) p (4105) Equation (4.105) can be substituted into (4.104) pms2 Xo (s) ˆ nTm (s) n nIm s2 Xo (s) p or nTm (s) ˆ   n2 I m 2 pm ‡ s Xo (s) p (4106) giving the transfer function for the gearbox, lead-screw and machine-table as Xo n (s) ˆ pm ‡ n2 Im p†s2 Tm (4107) where the term n2 Im $P may be considered to be equivalent mass of Im referred to the machine-table. Cl       5. Tachogenerator Gain H2 (V s$rad) Feedback signal B2 (s)  H2 so (s) (4108) or, from equation (4.105) B2 (s)  H2 sXo (s) p (4109) 6. Position transducer Gain H1 (V$m) Feedback signal Xm (s)  H1 Xo (s) (4110) The system element dynamic equations can now be combined in the block diagram shown in Figure 4.31. Using equation (4.4), the inner-loop transfer function is G(s)  K2 K3 np ( p2 m  n2 Im )s  K2 K3 nH2 (4111) Again, using equation (4.4), the overall closed-loop transfer function becomes Xo K1 K2 K3 np (s)  2 (p m  n2 Im )s2  K2 K3 nH2 s  K1 K2 K3 npH1 Xd (4112) which can be written in standard form Xo (s)   Xd Xd(s) + – Xm(s) Controller U1(s) + K1 1 H1 p2 mn2 Im K1 K2 K3 npH1 Power Amplifier   H2 K1 pH1 DC Servomotor Tm(s) U2(s) – s2  K3 K2  s1 Machine Table n 2 s pm + n Im p B2(s) Tachogenerator H2 sθo(s) H1 Position Transducer Fig. 4.31     (3(       1 p (4113) Integrator sXo(s) Xo(s) 1 s  Advanced Control Engineering Specification: The CNC machine-table control system is to be critically damped with a settling time of 0.1 seconds. Control problem: To select the controller gain K1 to achieve the settling time and tachogenerator constant to provide critical damping. System parameters K2  2 V$V K3  4 Nm$V n  10 : 1 p5 m ˆ 50 kg 10 3 Im ˆ 10  10 m 6 kgm2 H1 ˆ 60 V$m Calculation of K1 : In general, the settling time of a system with critical damping is equal to the periodic time of the undamped system, as can be seen in Figure 3.19. This can be demonstrated using equation (3.62) for critical damping xo (t) ˆ [1 e t ˆ 2 n  xo (t) ˆ 1 e !n t (1 ‡ !n t)] when 2 (1 ‡ 2 ) ˆ 0986  (4114) Thus, for a settling time of 0.1 seconds for a system that is critically damped, the undamped natural frequency is n ˆ 2 ˆ 6284 rad$s 01 (4115) Comparing the closed-loop transfer function given in equation (4.113) with the standard form given in (3.42)   K1 K2 K3 npH1 2 n ˆ (4116) p2 m ‡ n2 I m Hence (p2 m ‡ n2 Im )2n K2 K3 npH1   f(5  10 3 )2  50g ‡ (102  10  10 6 ) ˆ  62842 (2  4  10  5  10 3  60) K1 ˆ ˆ 0365 V$V (4117) Again, comparing equation (4.113) with the standard form (3.42) 2 H2 ˆ n K1 pH1 (4118) Cl       Hence 2K1 pH1 !n 2 1 0:365 5 10  62:84 3 ˆ 3:485  10 V s$rad H2  3  60 (4:119) Example 4.6.2 Temperature control system (See also Appendix 1, examp462.m) The general form of a temperature control system is shown in Figure 1.6 with the corresponding block diagram given in Figure 1.7. The system variables are: d (t) ˆ Desired temperature ( C) m (t) ˆ Measured temperature (V) o (t) ˆ Actual temperature ( C) s (t) ˆ Temperature of surroundings ( C) u(t) ˆ Control signal (v) _ ˆ Gas flow-rate (m3 $s) v(t) Qi (t) ˆ Heat flow into room (J$s ˆ W) Qo (t) ˆ Heat flow though walls (W) System equations 1. Controller: The control action is PID of the form given in equation (4.91)   1 ‡ Td s (d (s) U(s) ˆ K1 1 ‡ Ti s m (s)) (4120) 2. Gas solenoid valve: This is assumed to have first-order dynamics of the form K2 V_ (s) ˆ U 1 ‡ T1 s (4121) where K2 is the valve constant (m3 $s V). _ into heat flow Qi (t) i.e.: 3. Gas burner: This converts gas flow-rate v(t) _ Qi (s) ˆ K3 V(s) (4122) where K3 is the burner constant (Ws$m3 ). 4. Room dynamics: The thermal dynamics of the room are Qi (t) Qo (t) ˆ CT do dt (4123) Equation (4.123) is similar to equation (2.54), where CT is the thermal capacitance of the air in the room.  Advanced Control Engineering The heat flow through the walls of the building is as given in equation (2.53), i.e. (o () s ()) RT ,o ()  (4124) where RT is the thermal resistance of the walls, see equation (2.47). Substituting equation (4.124) into (4.123) gives   o (t) s (t) do Qi (t) ˆ CT RT dt (4125) Multiplying through by RT do dt (4126) RT Qi (s) ‡ s (s) ˆ (1 ‡ RT CT s)o (s) (4127) RT Qi (t) ‡ s (t) ˆ o (t) ‡ RT CT Taking Laplace transforms Equation (4.127) can be represented in block diagram form as shown in Figure 4.32. 5. Thermometer: The thermometer equation is m (s) ˆ H1 o (s) (4128) The complete block diagram of the temperature control system is shown in Figure 4.33. From Figure 4.33 K1 K2 K3 RT (Ti Td s2 ‡ Ti s ‡ 1)(d (s) Ti s(1 ‡ T1 s) H1 o (s)) ‡ s (s) ˆ (1 ‡ RT CT s)o (s) (4129) θs(s) + Qi(s) RT Fig. 4.32          Valve PID Controller θi(s) + θm(s) – K1 1 + 1 +Tds T is U(s) K2 1 + T is θo(s) 1 1 + RTCTs +        θs(s) Burner V(s) Qi(s) K3 H1 Fig. 4.33              Room + RT + 1 1 + RTCTs θo(s) Cl       Equation (4.129) can be re-arranged to give o (s)   1 s) (Ti Td s2  Ti s  1)d (s)  Ti s(1T KF H1 s (s)     1 1 T2 ) 2 s3  Ti (T KF H1  Ti Td s  Ti KF H1  1 s  1 1 H1 Ti T1 T2 KF H1  (4130) where the forward-path gain KF is KF  K1 K2 K3 RT (4131) Control problem: Given the system parameters, the control problem is to determine the controller settings for K1 , Ti and Td . This will be undertaken using the Zeigler± Nichols process reaction method described in Section 4.5.5(a). System parameters: K2 K3  5 W$V CT  80 J$K RT  01 Ks$J H1  10 V$K T1  4 seconds Process reaction curve: This can be obtained from the forward-path transfer function o K2 K3 RT (s)  U (1  T1 s)(1  RT CT s) (4132) Inserting values into equation (4.132) gives o 05 (s)  (1  4s)(1  8s) U (4133) Figure 4.34 shows the response to a unit step, or the process reaction curve. From the R and D values obtained from the process reaction curve, using the Zeigler±Nichols PID controller settings given in Table 4.2 K1  12$RD  26144 Ti  2D  30 seconds Td  05D  075 seconds Assuming that the temperature of the surroundings s (t) remains constant, the closed-loop transfer function (using equation (4.130)) for the temperature control system, is o (225s2  3s  1) (s)  3 7344s  5004s2  3229s  1 d (4134) The response to a step change in the desired temperature of 0±20  C for the closedloop transfer function given by equation (4.134) is shown in Figure 4.35. From Figure 4.35, the ratio of successive peaks is a1 892  45  a2 198 (4135) Advanced Control Engineering 0.6 Actual Temperature (°C) 0.5 0.4 0.3 0.2 R = 0.0306 0.1 0 0 D = 1.55 10 15 25 20 30 35 40 45 50 Time (s) Fig. 4.34                  #   044 35 Actual Temperature (°C) 30 25 a1 a2 20 15 10 5 0 0 5 10 15 20 Time (s) Fig. 4.35 (               5  , 3     25 30 35   /!      This corresponds to a damping ratio of 0.23. These values are very close to the Zeigler±Nichols optimum values of 4.0 and 0.21 respectively. Example 4.6.3 Ship Autopilot (See also Appendix 1, examp463.m) A ship has six degrees-of-freedom, i.e. it is free to move in six directions simultaneously, namely three linear motions ± surge (forward), sway (lateral) and heave Cl      (vertical) together with three rotational motions ± roll, pitch and yaw. This analysis considers rotation about the yaw axis (i.e. heading control) only. Figure 1.12 shows a typical ship autopilot system and Figure 1.13 shows the corresponding block diagram. Rotation about the yaw axis is in effect rotation about the -, or vertical axis of the vessel, called the `r' direction since r is the symbol for yaw-rate. Hence hydrodynamic coefficients for the yaw axis are therefore given the subscript `r'. Yaw hydrodynamic coefficients are given the symbol `N'. In this analysis the dynamics of the steering gear are neglected. The system variables are  Desired heading (radians) a (t)  Actual heading (radians) d (t) (t)  Rudder angle (radians) Figure 4.36 shows the hull free-body diagram. Disturbance effects (wind, waves and current) are not included. System equations 1. Hull dynamics: In Figure 4.36, Xo Yo is the earth co-ordinate system where Xo is aligned to north. All angles are measured with respect to Xo . A consistent righthand system of co-ordinates is used, with the exception of the rudder-angle, which has been selected to be left-hand to avoid negative coefficients in the hull transfer function. Xo Actual Course ψa(t) ψa(t) Nrψa(t) ψd(t) IIz Nδδ(t) Desired Course ψa(t) G δ(t) Yo Fig. 4.36 #          Advanced Control Engineering From Figure 4.36 the equation of motion for the yaw axis is  4G  (z a () (4:136) (;r _ a ()) ˆ (z a () (; ()) Taking Laplace transforms ; (s) ˆ (Iz s2 ‡ Nr s) a (s) (4:137) Hence the hull transfer function becomes a (s) ˆ N s(Iz s ‡ Nr ) (4:138) 2. Control action: In this case, the autopilot (controller) is considered to provide proportional control only. (s) ˆ K1 ( d (s) a (s)) (4:139) 3. Gyro-compass: This provides a measured heading proportional to the actual heading m (s) ˆ H1 a (s) (4:140) Combining equations (4.138), (4.139) and (4.140) produces the block diagram shown in Figure 4.37. Using equation (4.4), the closed-loop transfer function is a (s) ˆ d 1 K1 K2 N s(Iz s‡Nr ) 2 N H1 ‡ Ks(I1 Kz s‡N r) (4:141) Equation (4.141) simplifies to give a d Iz K1 K2 N H1 + – K1  s2 ‡ Steering Gear Autopilot ψd(s) 1 H1 (s) ˆ  U(s) K2  Nr K1 K2 N H1  Rudder Characteristics δ(s) ψm(s) Gyro-Compass H1 Fig. 4.37            Nδ (4:142) s‡1 Hull Dynamics 1 s(Izs + Nr) ψa(s) Cl      Equation (4.142) is in the standard form given in equation (3.42). Control problem: For a specific hull, the control problem is to determine the autopilot setting (K1 ) to provide a satisfactory transient response. In this case, this will be when the damping ratio has a value of 0.5. Also to be determined are the rise time, settling time and percentage overshoot. System parameters: The ship to be controlled is a cargo vessel of length 161 m with a MARINER type hull of total displacement 17 000 tonnes. K2  1:0 rad$V Nr  2 N  80 109 Nms$rad Iz  20 106 Nm$rad 109 kg m2 H1  1:0 V$rad Inserting values into equation (4.142) gives a d which simplifies to (s)   a d 20 109 K1 80 106 (s)   1    9 2 s  K1 2 8010 106 s  1 250 K1  s2 1    K251 s  1 (4:143) (4:144) Comparing equation (4.144) with the standard form given in equation (3.42) 1 250  !2n K1 (4:145) 2 25  !n K1 (4:146) and Given that   0:5, then from equation (4.146) !n  K1 25 (4:147) Substituting (4.147) into (4.145) gives 252 250  K1 K12 Hence 625  2:5 250 (4:148) 2:5  0:1 rad$s 25 (4:149) K1  and from equation (4.147), !n   Advanced Control Engineering 1.4 Actual Heading (rad) 1.2 1 0.8 0.6 0.4 0.2 0 0 10 20 30 40 50 60 Time (s) 70 80 90 100 Fig. 4.38 6             % *  7 89:; < '4        < &14:    7 ':; < =&   From equations (3.58) and (3.59) the unit step response for the ship autopilot control system is given by the expression a () 1 e 0:05 ( cos 0:0866 ‡ 0:577 sin 0:0866) (4:150) Figure 4.38 shows the system unit step response. From Figure 4.38 4.7 Further problems Example 4.7 For the block diagrams shown in Figure 4.39 find an expression for the complete output when all inputs act simultaneously. Solutions (G (s)G (s)G (s))R (s) ‡ G (s)(1 ‡ G (s)H (s))R (s) 2 3 1 3 2 3 2 (a) C(s) ˆ 1 ‡1 G (s)H 3 2 (s) ‡ G2 (s)H3 (s) ‡ G1 (s)G2 (s)G3 (s)H1 (s) (b) C(s) ˆ (G1 (s)G2 (s)G3 (s)G4 (s))R1 (s) (G1 (s)G2 (s)G3 (s)G4 (s)H1 (s))R2 (s) 1 ‡ G3 (s)H2 (s) ‡ G1 (s)G2 (s)G3 (s)G4 (s)H1 (s) (G3 (s)G4 (s))R3 (s) Example 4.8 The speed control system shown in Figure 4.40 consists of an amplifier, a fieldcontrolled DC servomotor and a tachogenerator. The load consists of a mass of moment of inertia I and a fluid damper C. The system parameters are: I ˆ 0:75 kg m2 C ˆ 0:5 Nms$rad K2 ˆ 5 Nm$A H1 ˆ 0:1 Vs$rad Cl      H3 R2 + R1 + G1 – – + G2 + + G3 – C H2 H1 (a) R3 R1 + G1 – + G2 + – G3 – G4 C H2 + H1 + R2 (b) Fig. 4.39         Ia = constant Amplifier vi(t) Field Coil K1 vo(t)  I C + Tachogenetator H1 if(t) K2 ωo(t) – D.C. Servo-motor Fig. 4.40       Find the value of %1 to give the system a closed-loop time constant of one second. What is the steady-state value of !o () when .i () has a value of 10 V. Solution 0.5 A/V 33.3 rad/s   Advanced Control Engineering Error Detector + Velocity Feedback θo(t) Ia = constant θi(t) K1 H1 Tachogenerator K3 Gear ratio ‘n’ K2 Amplifier if(t) θo(t) Field Controlled D.C. Servo-motor Io Co Positional Feedback Fig. 4.41          & < >    7?$ ; ' <     7$?; 4 < "   73 $;  < -  & < *     7? $ ;  <       7 ' ;  <      73 $ ; Example 4.9 Find an expression for the closed-loop transfer function relating i (s) and o (s) for the angular positional control system shown in Figure 4.41. Solution o (s)   i Io K1 K2 K3 n 1    C0 K2 K3 n2 H1 2 s  s1 K1 K2 K3 n Example 4.10 A hydraulic servomechanism consists of the spool-valve/actuator arrangement shown in Figure 4.19 together with a `walking beam' feedback linkage as shown in Figure 4.42. The spool-valve displacement xv (t) is given by the relationship xi(t) a Spool-Valve xv(t) b Hydraulic Actuator m xo(t) Fig. 4.42 @      A  B    Cl  θi(s) Amplifier Actuator 2 5 s(1 + 0.5s) + –     θo(t) Sensor 3 Fig. 4.43         xv (t)     b xi (t) ab   a xo (t) a‡b If the forward-path transfer function is given by equation (4.57), find an expression for the closed-loop transfer function relating Xi (s) and Xo (s). The system parameters are m ˆ 50 kg A ˆ 001 m2 Cp ˆ 6  10 9 m5 $Ns Vt ˆ 4  10 3 m3 Kq ˆ 100 m2 $s a ˆ b ˆ 015 m  ˆ 14 GPa Kc ˆ 6  10 9 m5 $Ns Solution Xo 500 (s) ˆ 6 3 0357  10 s ‡ 012  10 3 s2 ‡ s ‡ 500 Xi Example 4.11 A servomechanism consists of an amplifier, actuator and sensor as shown in block diagram form in Figure 4.43. If the input to the system is a constant velocity of the form i (t) ˆ 2t find an expression for the time response of the system. Solution o (t) ˆ 0667t 00222 ‡ e t (00222 cos 768t 0083 sin 768t) Example 4.12 Figure 4.44 shows the elements of a closed-loop temperature control system. A proportional controller compares the desired value i (t) with the measured value vo (t) and provides a control signal u(t) of K1 times their difference to actuate the valve and burner unit. The heat input to the oven Qi (t) is K2 times the control signal.   Advanced Control Engineering Proportional Controller Valve/Burner Qi(t) θi(t) K1 u(t) Thermometer K2 θo(t) C vo(t) R Measurement Systems K3 Fig. 4.44 (           The walls of the oven have a thermal resistance RT and the oven has a thermal capacitance CT and operating temperature o (t). The heat transfer equation for the oven may be written Qi (t) o (t) do ˆ CT RT dt The thermometer and measurement system feed a measured value of H1 times o (t) to the controller. The system parameters are K1 ˆ 5 RT ˆ 2 K$J K2 ˆ 15 J$V H1 ˆ 1 V$K CT ˆ 25 Js$W Find (a) The open-loop time constant (b) The closed-loop time constant (c) The percentage steady-state error in the output when the desired value is constant. Solution (a) 50 seconds (b) 3.125 seconds (c) 6.25% Example 4.13 Figure 4.45 shows the block diagram representation of a process plant being controlled by a PID controller. (a) Find an expression for the complete response C(s) when R1 (s) and R2 (s) act simultaneously. (b) Using the Ziegler±Nichols Process Reaction Method, determine values for K1 , Ti and Td when T1 ˆ 10 seconds and T2 ˆ 20 seconds. Cl  R2(s) PID Controller + R1(s) +   Process Plant + K1 1+ 1 + Tds Tis –   1 (1+T1s)(1+T2s) C(s) Fig. 4.45     /!   (c) Insert the values into the expression found in (a). Using MATLAB, or otherwise, determine the response c(t) when r1 (t) is a unit step and r2 (t) is zero. What is the ratio of successive peaks? Solution (a) C(s)  K1 (Ti Td s2  Ti s  1)R1 (s)  Ti sR2 (s) Ti T1 T2 s3  Ti (T1  T2  K1 Td )s2  Ti (1  K1 )s  K1 (b) K1  17:2 Ti  6 seconds 2 (c) C(s)  s(1200s3 2.75 Td  1:5 seconds 17:2(9s  6s  1)  334:8s2  109:2s  17:2)  5 Classical design in the s-plane 5.1 Stability of dynamic systems The response of a linear system to a stimulus has two components: (a) steady-state terms which are directly related to the input (b) transient terms which are either exponential, or oscillatory with an envelope of exponential form. If the exponential terms decay as time increases, then the system is said to be stable. If the exponential terms increase with increasing time, the system is considered unstable. Examples of stable and unstable systems are shown in Figure 5.1. The motions shown in Figure 5.1 are given graphically in Figure 5.2. (Note that (b) in Figure 5.2 does not represent (b) in Figure 5.1.) The time responses shown in Figure 5.2 can be expressed mathematically as: For (a) (Stable) xo (t)  Ae t sin(!t  ) (5:1) xo (t)  Aet sin(!t  ) (5:2) xo (t)  Aet (5:3) xo (t)  Aet (5:4) For (b) (Unstable) For (c) (Stable) For (d) (Unstable) From equations (5.1)±(5.4), it can be seen that the stability of a dynamic system depends upon the sign of the exponential index in the time response function, which is in fact a real root of the characteristic equation as explained in section 5.1.1. Classical design in the s-plane 111 xo(t ) xo ( t ) (b) Unstable (a) Stable xo ( t ) xo ( t ) mg mg N N (d) Unstable (c) Stable Fig. 5.1 Stable and unstable systems. A xo(t ) xo(t ) A t t (a) (b) xo(t ) xo(t ) A A t t (c) Fig. 5.2 Graphical representation of stable and unstable time responses. (d) 112 Advanced Control Engineering 5.1.1 Stability and roots of the characteristic equation The characteristic equation was defined in section 3.6.2 for a second-order system as as2  bs  c  0 (5:5) The roots of the characteristic equation given in equation (5.5) were shown in section 3.6.2. to be  b  b2  4ac s1 , s2  (5:6) 2a These roots determine the transient response of the system and for a second-order system can be written as (a) Overdamping s1  1 (5:7) s1  s2   (5:8) s1 , s2    j! (5:9) s2  2 (b) Critical damping (c) Underdamping If the coefficient b in equation (5.5) were to be negative, then the roots would be s1 , s2    j! (5:10) The roots given in equation (5.9) provide a stable response of the form given in Figure 5.2(a) and equation (5.1), whereas the roots in equation (5.10) give an unstable response as represented by Figure 5.2(b) and equation (5.2). The only difference between the roots given in equation (5.9) and those in equation (5.10) is the sign of the real part. If the real part  is negative then the system is stable, but if it is positive, the system will be unstable. This holds true for systems of any order, so in general it can be stated: `If any of the roots of the characteristic equation have positive real parts, then the system will be unstable'. 5.2 The Routh±Hurwitz stability criterion The work of Routh (1905) and Hurwitz (1875) gives a method of indicating the presence and number of unstable roots, but not their value. Consider the characteristic equation an sn  an1 sn1      a1 s  a0  0 (5:11) Classical design in the s-plane 113 The Routh±Hurwitz stability criterion states: (a) For there to be no roots with positive real parts then there is a necessary, but not sufficient, condition that all coefficients in the characteristic equation have the same sign and that none are zero. If (a) above is satisfied, then the necessary and sufficient condition for stability is either (b) all the Hurwitz determinants of the polynomial are positive, or alternatively (c) all coefficients of the first column of Routh's array have the same sign. The number of sign changes indicate the number of unstable roots. The Hurwitz determinants are D 1  a1   a1   D 3   a0   a3 a2 a1  a5   a4   a3    a1 D2   a0   a1   a0   D4        a3  a  (5:12) 2 a3 a2 a5 a4 a1 a3 a2  a7   a6   a5   a4   etc: Routh's array can be written in the form shown in Figure 5.3. In Routh's array Figure 5.3     1  an1 an3  1  an1 an5  b1  b2  etc: an1  an an2  an1  an an4      1  b1 1  b1 b2  b3  c2   etc: c1   b1 an1 an3  b1 an1 an5  (5:13) (5:14) Routh's method is easy to apply and is usually used in preference to the Hurwitz technique. Note that the array can also be expressed in the reverse order, commencing with row sn . 0 p1 1 q1 ··· ·· · s s s n –3 c1 c2 c3 s n –2 b1 b2 b3 s n –1 an – 1 an – 3 an – 5 s n an an – 2 an – 4 Fig. 5.3 Routh's array. 11 Advanced Control Engineering Example 5.1 (See also Appendix 1, A1.5) Check the stability of the system which has the following characteristic equation s4  2s3  s2  4s  2  0 (5:15) Test 1: All coefficients are present and have the same sign. Proceed to Test 2, i.e. Routh's array s0 2 s 1 8 s 2 s 3 1 s 4 2 2 4 1 1 (5:16) 2 The bottom two rows of the array in (5.16) are obtained from the characteristic equation. The remaining coefficients are given by   1  2 4  1 b1    (2  4)  1 (5:17) 2 1 1 2  12 b2   2 1   1 c1  1 2  0  1  (4  0)  2 2 2 b3  0  2   1(4  4)  8 4 c2  0   1  8 0  1  (16  0)  2 d1   8 1 2  8 (5:18) (5:19) (5:20) (5:21) (5:22) In the array given in (5.16) there are two sign changes in the column therefore there are two roots with positive real parts. Hence the system is unstable. 5.2.1 Maximum value of the open-loop gain constant for the stability of a closed-loop system The closed-loop transfer function for a control system is given by equation (4.4) C G(s) (s)  R 1  G(s)H(s) (5:23) In general, the characteristic equation is most easily formed by equating the denominator of the transfer function to zero. Hence, from equation (5.23), the characteristic equation for a closed-loop control system is 1  G(s)H(s)  0 (5:24) Classical design in the s-plane 11 R(s) + Proportional Controller Control Valve K1 4 s Plant 2 2 (s + s + 2) – C(s) Fig. 5.4 Closed-loop control system. Example 5.2 (See also Appendix 1, examp52.m) Find the value of the proportional controller gain K1 to make the control system shown in Figure 5.4 just unstable. Solution The open-loop transfer function is G(s)H(s)  8K1 s(s2  s  2) (5:25) The open-loop gain constant is K  8K1 (5:26) giving G(s)H(s)  s(s2 K  s  2) (5:27) From equation (5.24) the characteristic equation is K 0  s  2) (5:28) s(s2  s  2)  K  0 (5:29) s3  s2  2s  K  0 (5:30) 1 s(s2 or which can be expressed as The characteristic equation can also be found from the closed-loop transfer function. Using equation (4.4) C G(s) (s)  R 1  G(s)H(s) Given the open-loop transfer function in equation (5.27), where H(s) is unity, then K C s(s2 s2) (s)  K R 1 s(s2 s2) (5:31) 116 Advanced Control Engineering Multiplying numerator and denominator by s(s2  s  2) C K (s)  2 R s(s  s  2)  K (5:32) C K (s)  3 R s  s2  2s  K (5:33) s3  s2  2s  K  0 (5:34) Equating the denominator of the closed-loop transfer function to zero Equations (5.30) and (5.34) are identical, and both are the characteristic equation. It will be noted that all terms are present and have the same sign (Routh's first condition). Proceeding straight to Routh's array s0 K s1 (2  K) s2 s3 1 K 1 2 (5:35) where  1 b1  1 1 b2  0  K   (2  K) 2 c1  K To produce a sign change in the first column, K 2 (5:36) Hence, from equation (5.26), to make the system just unstable K1  0:25 Inserting (5.36) into (5.30) gives s3  s2  2s  2  0 factorizing gives (s2  2)(s  1)  0 hence the roots of the characteristic equation are s  1 and the transient response is  s0j 2  c(t)  Aet  B sin( 2t  ) (5:37) From equation (5.37) it can be seen that when the proportional controller gain K1 is  set to 0.25, the system will oscillate continuously at a frequency of 2 rad/s. Classical design in the s-plane 117 5.2.2 Special cases of the Routh array Case 1: A zero in the first column If there is a zero in the first column, then further calculation cannot normally proceed since it will involve dividing by zero. The problem is solved by replacing the zero with a small number " which can be assumed to be either positive or negative. When the array is complete, the signs of the elements in the first column are evaluated by allowing " to approach zero. Example 5.3 s4  2s3  2s2  4s  3  0 s0 3 s 1 s 2 " 3 s 3 2 4 s 4 1 2 4  6/" (5:38) 3 Irrespective of whether " is a small positive or negative number in array (5.38), there will be two sign changes in the first column. Case 2: All elements in a row are zero If all the elements of a particular row are zero, then they are replaced by the derivatives of an auxiliary polynomial, formed from the elements of the previous row. Example 5.4 s5  2s4  6s3  12s2  8s  16  0 s0 16 s 1 8/3 s 2 6 16 s 3 8 24 s4 2 12 16 5 1 6 s (5:39) 8 The elements of the s3 row are zero in array (5.39). An auxiliary polynomial P(s) is therefore formed from the elements of the previous row (s4 ). i.e. P(s)  2s4  12s2  16 dP(s)  8s3  24s ds (5:40) The coefficients of equation (5.40) become the elements of the s3 row, allowing the array to be completed. 118 Advanced Control Engineering 5.3 5.3.1 Root-locus analysis System poles and zeros The closed-loop transfer function for any feedback control system may be written in the factored form given in equation (5.41) C G(s) Kc (s  zc1 )(s  zc2 ) . . . (s  zcn ) (s)   R 1  G(s)H(s) (s  pc1 )(s  pc2 ) . . . (s  pcn ) (5:41) where s  pc1 , pc2 , . . . , pcn are closed-loop poles, so called since their values make equation (5.41) infinite (Note that they are also the roots of the characteristic equation) and s  zc1 , zc2 , . . . , zcn are closed-loop zeros, since their values make equation (5.41) zero. The position of the closed-loop poles in the s-plane determine the nature of the transient behaviour of the system as can be seen in Figure 5.5. Also, the open-loop transfer function may be expressed as G(s)H(s)  K(s  z01 )(s  z02 ) . . . (s  z0n ) (s  p01 )(s  p02 ) . . . (s  p0n ) (5:42) where z01 , z02 , . . . , z0n are open-loop zeros and p01 , p02 , . . . , p0n are open-loop poles. X jω X X X X X X X X X X X σ X X X Fig. 5.5 Effect of closed-loop pole position in the s-plane on system transient response. Classical design in the s-plane 119 5.3.2 The root locus method This is a control system design technique developed by W.R. Evans (1948) that determines the roots of the characteristic equation (closed-loop poles) when the open-loop gain-constant  is increased from zero to infinity. The locus of the roots, or closed-loop poles are plotted in the s-plane. This is a complex plane, since s    j!. It is important to remember that the real part  is the index in the exponential term of the time response, and if positive will make the system unstable. Hence, any locus in the right-hand side of the plane represents an unstable system. The imaginary part ! is the frequency of transient oscillation. When a locus crosses the imaginary axis,   0. This is the condition of marginal stability, i.e. the control system is on the verge of instability, where transient oscillations neither increase, nor decay, but remain at a constant value. The design method requires the closed-loop poles to be plotted in the s-plane as K is varied from zero to infinity, and then a value of K selected to provide the necessary transient response as required by the performance specification. The loci always commence at open-loop poles (denoted by x) and terminate at open-loop zeros (denoted by o) when they exist. Example 5.5 Construct the root-locus diagram for the first-order control system shown in Figure 5.6. Solution Open-loop transfer function G(s)H(s)  K Ts (5:43) Open-loop poles s0 Open-loop zeros: none Characteristic equation Substituting equation (5.3) gives 1  G(s)H(s)  0 K 0 Ts Ts  K  0 1 i.e. R (s ) + – Fig. 5.6 First-order control system. K Ts (5:44) C (s ) 120 Advanced Control Engineering jω –∞ X σ Fig. 5.7 Root-locus diagram for a first-order system. Roots of characteristic equation s K T (5:45) When K is varied from zero to infinity the locus commences at the open-loop pole s  0 and terminates at minus infinity on the real axis as shown in Figure 5.7. From Figure 5.7 it can be seen that the system becomes more responsive as K is increased. In practice, there is an upper limit for K as signals and control elements saturate. Example 5.6 Construct the root-locus diagram for the second-order control system shown in Figure 5.8. Open-loop transfer function K G(s)H(s)  (5:46) s(s  4) Open-loop poles Open-loop zeros: none Characteristic equation s  0, 4 1  G(s)H(s)  0 R (s) + K s (s + 4) – Fig. 5.8 Second-order control system. C (s) Classical design in the s-plane 121   Roots of second-order characteristic equation for different values of K K 0 4 8 16 Characteristic equation 2 s  4s  0 s2  4s  4  0 s2  4s  8  0 s2  4s  16  0 Roots s  0,  4 s  2  j0 s  2  j2 s  2  j3:46 Substituting equation (5.4) gives  0 s(s  4) s2  4s  K  0 1 i.e. (5:47) Table 5.1 shows how equation (5.7) can be used to calculate the roots of the characteristic equation for different values of K. Figure 5.9 shows the corresponding root-locus diagram. In Figure 5.9, note that the loci commences at the open-loop poles (s  0, 4) when K  0. At K  4 they branch into the complex space. This is called a breakaway point and corresponds to critical damping. jω K = 16 3 K=8 2 1 –5 K=0 X –4 K=0 K=4 X –3 –2 σ –1 –1 K=8 –2 –3 K = 16 Fig. 5.9 Root locus diagram for a second-order system. 122 Advanced Control Engineering 5.3.3 General case for an underdamped second-order system For the generalized second-order transfer function given in equation (3.43), equating the denominator to zero gives the characteristic equation s2  2!n s  !2n  0 (5:48) If  < 1 in equation (5.48), then the roots of the characteristic equation are  s1 , s2  !n  j!n 1   2 Hence a point P in the s-plane can be represented by Figure 5.10. From Figure 5.10, Radius   2 2 OP  (!n )  !n 1   2 (5:49) (5:50) Simplifying (5.50) gives OP  !n Also from Figure 5.10 cos  (5:51) !n   !n (5:52) Thus, as  is varied from zero to one, point P describes an arc of a circle of radius !n , commencing on the imaginary axis (  90 ) and finishing on the real axis (  0 ). Limits for acceptable transient response in the s-plane If a system is (1) to be stable (2) to have acceptable transient response (  0:5) jω P ωn 1–ζ2 β –ζωn O σ Fig. 5.10 Roots of the characteristic equation for a second-order system shown in the s-plane. Classical design in the s-plane 123 jω Unacceptable Region Acceptable Region (ζ ≥ 0.5) 60° –60° σ Fig. 5.11 Region of acceptable transient response in the s-plane for   0.5. then the closed-loop poles must lie in an area defined by   cos1 0:5  60 (5:53) This is illustrated in Figure 5.11. 5.3.4 Rules for root locus construction Angle and magnitude criteria The characteristic equation for a closed-loop system (5.24) may also be written as (s)H(s)  1 (5:54) Since equation (5.54) is a vector quantity, it can be represented in terms of angle and magnitude as =G(s)H(s)  180 (5:55) G(s)H(s)  1 (5:56) The angle criterion Equation (5.55) may be interpreted as `For a point s1 to lie on the locus, the sum of all angles for vectors between open-loop poles (positive angles) and zeros (negative angles) to point s1 must equal 180 .' In general, this statement can be expressed as  Pole Angles   Zero Angles  180 (5:57) 124 Advanced Control Engineering jω s1 +ve θ2 θ3 θ1 φ1 O s = –a X s = –c X s = –b X s=0 σ –ve Fig. 5.12 Application of the angle criterion. Example 5.7 Consider an open-loop transfer function G(s)H(s)  K(s  a) s(s  b)(s  c) Figure 5.12 shows vectors from open-loop poles and zeros to a trial point s1 . From Figure 5.12 and equation (5.57), for s1 to lie on a locus, then (1  2  3 )  (1 )  180 (5:58) The magnitude criterion If a point s1 lies on a locus, then the value of the open-loop gain constant K at that point may be evaluated by using the magnitude criterion. Equation (5.56) can be expressed as   N(s) 1 (5:59) K D(s) or D(s) (5:60) K  N(s) Equation (5.60) may be written as K Product of pole vector magnitudes Product of zero vector magnitudes (5:61) Classical design in the s-plane 125 jω s1 |x | |w | |y | |z | O s = –a X s = –c X s = –b X s=0 σ Fig. 5.13 Application of the magnitude criterion. For Example 5.7, if s1 lies on a locus, then the pole and zero magnitudes are shown in Figure 5.13. From Figure 5.13 and equation (5.61), the value of the open-loop gain constant K at position s1 is xyz (5:62) K w If there are no open-loop zeros in the transfer function, then the denominator of equation (5.62) is unity. 5.3.5 Root locus construction rules 1. Starting points (K  0): The root loci start at the open-loop poles. 2. Termination points (K  ): The root loci terminate at the open-loop zeros when they exist, otherwise at infinity. 3. Number of distinct root loci: This is equal to the order of the characteristic equation. 4. Symmetry of root loci: The root loci are symmetrical about the real axis. 5. Root locus asymptotes: For large values of k the root loci are asymptotic to straight lines, with angles given by  where k  0, 1, . . . (n  m  1) n  no. of finite open-loop poles m  no. of finite open-loop zeros (1  2k) (n  m) 126 Advanced Control Engineering 6. Asymptote intersection: The asymptotes intersect the real axis at a point given by a   open-loop poles   open-loop zeros (n  m) 7. Root locus locations on real axis: A point on the real axis is part of the loci if the sum of the number of open-loop poles and zeros to the right of the point concerned is odd. 8. Breakaway points: The points at which a locus breaks away from the real axis can be calculated using one of two methods: (a) Find the roots of the equation  dK  0 ds sb where K has been made the subject of the characteristic equation i.e. K  . . . (b) Solving the relationship n 1 1  (b  pi ) m 1 1 (b  zi ) where pi  and zi  are the absolute values of open-loop poles and zeros and b is the breakaway point. 9. Imaginary axis crossover: The location on the imaginary axis of the loci (marginal stability) can be calculated using either: (a) The Routh±Hurwitz stability criterion. (b) Replacing s by j! in the characteristic equation (since   0 on the imaginary axis). 10. Angles of departure and arrival: Computed using the angle criterion, by positioning a trial point at a complex open-loop pole (departure) or zero (arrival). 11. Determination of points on root loci: Exact points on root loci are found using the angle criterion. 12. Determination of K on root loci: The value of K on root loci is found using the magnitude criterion. Example 5.8 (See also Appendix 1, examp58.m and examp58a.m) A control system has the following open-loop transfer function G(s)H(s)  K s(s  2)(s  5) (a) Sketch the root locus diagram by obtaining asymptotes, breakaway point and imaginary axis crossover point. What is the value of K for marginal stability? (b) Locate a point on the locus that corresponds to a closed-loop damping ratio of 0.5. What is the value of K for this condition? What are the roots of the characteristic equation (closed-loop poles) for this value of K? Classical design in the s-plane 127 Solution Part (a) Open loop poles: s  0, 2, 5 n  3 Open-loop zeros: none m0 Asymptote angles (Rule 5) 3  1  (1  0)    60 , k  0 30 3 (5:63) 2  (1  2)    180 , k  1 30 (5:64) (1  4) 5   300 (60 ), 30 3 k  2, i:e: n  m  1 (5:65) Asymptote intersection (Rule 6) a  (0)  (2)  (5)  0 30 a  2:33 (5:66) (5:67) Characteristic equation: From equation (5.24) 1 K 0 s(s  2)(s  5) (5:68) or s(s  2)(s  5)  K  0 giving s3  7s2  10s  K  0 (5:69) Breakaway points (Rule 8) Method (a): Re-arrange the characteristic equation (5.69) to make K the subject K  s3  7s2  10s (5:70) dK  3s2  14s  10  0 ds (5:71) 3s2  14s  10  0 (5:72) Multiplying through by ±1 s 1 , s 2  b  14   142  120 6 b  3:79, 0:884 (5:73) 128 Advanced Control Engineering Method (b) 1 1 1  0  b b  2 b  5 (5:74) Multiplying through by, b (b  2)(b  5) (b  2)(b  5)  b (b  5)  b (b  2)  0 2b  7b  10  2b  5b  2b  2b  0 (5:75) 32b  14b  10  0 b  3:79,  0:884 (5:76) Note that equations (5.72) and (5.75) are identical, and therefore give the same roots. The first root, 3:79 lies at a point where there are an even number of open-loop poles to the right, and therefore is not valid. The second root, 0:884 has odd open-loop poles to the right, and is valid. In general, method (a) requires less computation than method (b). Imaginary axis crossover (Rule 9) Method (a) (Routh±Hurwitz) s0 s 1 s 2 s 3 K (70  K)/7 7 K 1 10 From Routh's array, marginal stability occurs at K  70. Method (b): Substitute s  j! into characteristic equation. From characteristic equation (5.69) (j!)3  7(j!)2  10(j!)  K  0  j!3  7!2  10j!  K  0 (5:77) Equating imaginary parts gives !3  10!  0 !2  10 !  3:16 rad/s (5:78) Equating real parts gives 7!2  K  0 8; K  7!2  70 (5:79) Note that method (b) provides both the crossover value (i.e. the frequency of oscillation at marginal stability) and the open-loop gain constant. Classical design in the s-plane 129 4 K = 70 3 G(s)H J(s) = K s(s+2)(s+5) Imaginary Axis 2 ζ = 0.5 (β = 60°) K = 11.35 1 θ3 |c| θ1 |b| 0 |a| θ2 σa –1 –2 –3 –4 –9 –8 –7 –6 –5 –4 –3 –2 –1 0 1 Real Axis Fig. 5.14 Sketch of root-locus diagram for Example 5.8. The root locus diagram is shown in Figure 5.14. Part (b) From equation (5.52), line of constant damping ratio is  cos1 ()  cos1 (0:5)  60 (5:80) This line is plotted on Figure 5.14 and trial points along it tested using the angle criterion, i.e. 1  2  3  180 At s  0:7  j1:25 (5:81) 120  44  16  180 (5:82) Hence point lies on the locus. Value of open-loop gain constant K: Applying the magnitude criterion to the above point K  abc  1:4 1:8 4:5  11:35 (5:83) 130 Advanced Control Engineering jω x+5 x+2 x X –2 X –5 s1 σ Fig. 5.15 %etermination of real closed-loop pole. Closed-loop poles (For K  11:35): Since the closed-loop system is third-order, there are three closed-loop poles. Two of them are given in equation (5.81). The third lies on the real locus that extends from 5 to  . Its value is calculated using the magnitude criterion as shown in Figure 5.15. From Figure 5.15 x(x  2)(x  5)  11:35 (5:84) Substituting x  0:73 (i.e. s1  5:73) in equation (5.84) provides a solution. Hence the closed-loop poles for K  11:35 are s  5:73, 0:7  j1:25 (5:85) Example 5.9 (See also Appendix 1, examp59.m) The open-loop transfer function for a control system is G(s)H(s)  K s(s2  4s  13) Find the asymptotes and angles of departure and hence sketch the root locus diagram. Locate a point on the complex locus that corresponds to a damping ratio of 0.25 and hence find (a) the value of K at this point (b) the value of K for marginal stability Solution Open-loop poles: s  0, 4  Open-loop zeros: None  16  52  2  j3 n  3 2 m0 Classical design in the s-plane 131 Asymptote angles (Rule 5) 3  1  (1  0)    60 , k  0 30 3 (5:86) 2  (1  2)    180 , k  1 30 (5:87) (1  4) 5   300 , 30 3 k  2, n  m  1 (5:88) Asymptote intersection (Rule 6) a  (0)  (2  j3)  (2  j3)  0 3 (5:89) a  1:333 (5:90) s3  4s2  13s  K  0 (5:91) Characteristic equation Breakaway points: None, due to complex open-loop poles. Imaginary axis crossover (Rule 9) Method (b) (j!)3  4(j!)2  13j!  K  0 or j!3  4!2  13j!  K  0 (5:92) Equating imaginary parts !3  13!  0 !2  13 !  3:6 rad/s (5:93) Equating real parts 4!2  K  0 K  52 (5:94) Angle of departure (Rule 10): If angle of departure is d , then from Figure 5.16 a  b  d  180 d  180  a  b d  180  123  90  33 (5:95) Locate point that corresponds to   0:25. From equation (5.52)  cos1 (0:25)  75:5 (5:96) 132 Advanced Control Engineering 4 ζ = 0.25 θd 3 G(s)H(s) = K 2 s(s + 4s +13) K = 52 K = 22.5 2 β Imaginary Axis 1 θa 0 σa –1 –2 θb –3 –4 –9 –8 –7 –6 –5 –3 –4 Real Axis –2 –1 0 1 Fig. 5.16 Root locus diagram for Example 5.9. Plot line of constant damping ratio on Figure 5.16 and test trial points along it using angle criterion. At s  0:8  j2:9 104:5  79:5  4  180 Hence point lies on locus. Applying magnitude criterion K  3:0 5.4 6:0 1:25  22:5 (5:97) Design in the s-plane The root locus method provides a very powerful tool for control system design. The objective is to shape the loci so that closed-loop poles can be placed in the s-plane at positions that produce a transient response that meets a given performance specification. It should be noted that a root locus diagram does not provide information relating to steady-state response, so that steady-state errors may go undetected, unless checked by other means, i.e. time response. Classical design in the s-plane 133   Compensator characteristics Compensator Characteristics PD PI One additional zero One additional zero One additional pole at origin Two additional zeros One additional pole at origin PID 5.4.1 Compensator design A compensator, or controller, placed in the forward path of a control system will modify the shape of the loci if it contains additional poles and zeros. Characteristics of conventional compensators are given in Table 5.2. In compensator design, hand calculation is cumbersome, and a suitable computer package, such as MATLAB is generally used. Case Study Example 5.10 (See also Appendix 1, examp510.m) A control system has the open-loop transfer function given in Example 5.8, i.e. 1 , K 1 G(s)H(s)  s(s  2)(s  5) A PD compensator of the form G(s)  K1 (s  a) (5:98) is to be introduced in the forward path to achieve a performance specification Overshoot Settling time (2%) less than 5% less than 2 seconds Determine the values of K1 and a to meet the specification. Original controller The original controller may be considered to be a proportional controller of gain K and the root locus diagram is shown in Figure 5.14. The selected value of K  11:35 is for a damping ratio of 0.5 which has an overshoot of 16.3% in the time domain and is not acceptable. With a damping ratio of 0.7 the overshoot is 4.6% which is within specification. This corresponds to a controller gain of 7.13. The resulting time response for the original system (K=11.35) is shown in Figure 5.20 where the settling time can be seen to be 5.4 seconds, which is outside of the specification. This also applies to the condition K=7.13. PD compensator design With the PD compensator of the form given in equation (5.98), the control problem, with reference, to Figure 5.14, is where to place the zero a on the real axis. Potential locations include: (i)ii Between the poles s  0, 2, i.e. at s  1 (ii)i At s  2 (pole/zero cancellation) (iii) Between the poles s  2, 5, i.e at s  3 134 Advanced Control Engineering 4 ζ = 0.7 3 K1(s + 1) G(s)H(s) = s (s + 2)(s + 5) K1 = 15 Imaginary Axis 2 1 0 σa K1 = 15 –1 –2 –3 –4 –9 –8 –7 –6 –5 –4 –3 Real Axis –2 –1 0 1 Fig. 5.17 Root locus diagram for compensator K1 (s  1). Option 1 (zero positioned at s  1): The cascaded compensator and plant transfer function become K1 (s  1) G(s)H(s)  (5:99) s(s  2)(s  5) The root locus diagram is shown in Figure 5.17. It can be seen in Figure 5.17 that the pole at the origin and the zero at s  1 dominate the response. With the complex loci,   0:7 gives K1 a value of 15. However, this value of K1 occurs at 0:74 on the dominant real locus. The time response shown in Figure 5.20 shows the dominant first-order response with the oscillatory second-order response superimposed. The settling time is 3.9 seconds, which is outside of the specification. Option 2: (zero positioned at s  2): The cascaded compensator and plant transfer function is G(s)H(s)  K1 (s  2) s(s  2)(s  5) (5:100) The root locus diagram is shown in Figure 5.18. The pole/zero cancellation may be considered as a locus that starts at s  2 and finishes at s  2, i.e. a point on the diagram. The remaining loci breakaway at s  2:49 and look similar to the second-order system shown in Figure 5.9. The compensator gain K1 that corresponds to   0:7 is 12.8. The resulting time response is shown in Figure 5.20 and has an overshoot of 4.1% and a settling time of 1.7 seconds, which is within specification. Classical design in the s-plane 135 4 ζ = 0.7 3 G(s)H(s) = K1(s + 2) s (s + 2)(s + 5) K1 = 12.8 Imaginary Axis 2 1 0 –1 –2 –3 –4 –9 –8 –7 –6 –5 –4 –3 Real Axis –2 –1 0 1 Fig. 5.18 Root locus diagram for compensator K1 (s  2). Option 3: (zero positioned at s  3): The cascaded compensator and plant transfer function is G(s)H(s)  K1 (s  3) s(s  2)(s  5) (5:101) The root locus diagram is shown in Figure 5.19. In this case the real locus occurs between s  5 and 3 and the complex dominant loci breakaway at b  1:15. Since these loci are further to the right than the previous option, the transient response will be slower. The compensator gain that corresponds to   0:7 is K1  5:3. The resulting time response is shown in Figure 5.20, where the overshoot is 5.3% and the settling time is 3.1 seconds. Summary: Of the three compensators considered, only option 2 met the performance specification. The recommended compensator is therefore G(s)  12:8(s  2) (5:102) Case study Example 5.11 (See also Appendix 1, examp511.m) A ship roll stabilization system is shown in Figure 5.21. The system parameters are Fin time constant Tf  1:0 seconds Ship roll natural frequency !n  1:414 rad/s 136 Advanced Control Engineering 4 3 G (s )H(s) = K1(s + 3) s (s + 2)(s + 5) ζ = 0.7 Imaginary Axis 2 1 K1 = 5.3 0 σa = –2 σb = –1.15 –1 –2 –3 –4 –9 –8 –7 –6 –5 –4 –3 Real Axis –2 –1 0 1 Fig. 5.19 Root locus diagram for compensator K1 (s  3). 1.2 Option 3 Option 2 Original system 1 Option 1 c (t ) 0.8 0.6 0.4 0.2 0 0 1 2 3 Time (s ) Fig. 5.20 Time response for the three options considered. 4 5 6 Classical design in the s-plane 137 Stabilization Fin φd(s) + Controller δd(s) 1 1 + Tfs Ship Roll Dynamics 2 δa(s) – φa(s) Ksω n 2 2 n s + 2ζωns + ω Fig. 5.21 Ship roll stabilization system. Ship roll damping ratio Ship steady-state gain   0:248 s  0:5 Performance specification Without stabilization, the step response of the roll dynamics produces a 45% overshoot and a settling time of 10 seconds. The stabilization control system is required to provide a step response with an overshoot of less than 25%, a settling time of less than 2 seconds, and zero steady-state error. (a) Proportional control: With a proportional gain K1 , the open-loop transfer function is K1 Ks !2n (5:103) G(s)H(s)  (1  Tf s)(s2  2!n s  !2n ) Inserting values K G(s)H(s)  (5:104) (s  1)(s2  0:7s  2) where K  K1 Ks !2n Open-loop poles: Open-loop zeros: (5:105) s  1, 0:35  j1:37 n  3 None m  0 Asymptote angles (Rule 5) (1  0)    60 , k  0 30 3 (1  2)    180 , k  1 2  30 (1  4) 5   300 , k  2 3  30 3 1  (5:106) (5:107) (5:108) Asymptote intersection (Rule 6) a  (1)  (0:35  j1:37)  (0:35  j1:37)  0 30 a  0:57 (5:109) (5:110) 138 Advanced Control Engineering Characteristic equation 1 giving (s  1)(s2  0  0:7s  2) s3  1:7s2  2:7s  (2  K)  0 Breakaway points: (5:111) (5:112) None Imaginary axis crossover (Rule 9) From characteristic equation (5.112) ( j!)3  1:7( j!)2  2:7(j!)  (2  K)  0 j!3  1:7!2  2:7j!  (2  K)  0 Equating imaginary parts !3  2:7!  0 !2  2:7 Equating real parts !  1:643 rad/s (5:113) 1:7!2  (2  K)  0 K  1:7!2  2  2:59 (5:114) The root locus diagram is shown in Figure 5.22. It can be seen that proportional control is not appropriate since as the controller gain K1 is increased the complex loci head towards the imaginary axis, making the response even more oscillatory than the open-loop response, until at K  2:59 (K1  2:59) the system becomes unstable. Also, since no pure integrator is present in the control loop, there will be significant steady-state errors. (b) PID control: In order to achieve an acceptable response, the complex loci need to be attracted into the left-hand-side of the s-plane. This might be achieved by placing a pair of complex zeros to the left of the open-loop poles. In addition, a pure integrator needs to be introduced. This points to a PID controller of the form G(s)  K1 (s2  bs  c) s (5:115) putting b  4 and c  8 gives a pair of complex zeros s  2  j2 The open-loop transfer function now becomes G(s)H(s)  K(s2  4s  8) s(s  1)(s2  0:7s  2) (5:116) The root locus diagram is shown in Figure 5.23. The control strategy however, has not worked. The pure integrator and the open-loop pole s  1 produce a Classical design in the s-plane 139 2 K = 2.59 1.5 K G (s) = 2 (s +1)(s + 0.7s + 2) Imaginary Axis 1 0.5 0 σa –0.5 –1 –1.5 –2 –3.5 –3 –2 –2.5 –1.5 –1 –0.5 Real Axis 0 0.5 1 1.5 0 0.5 1 1.5 Fig. 5.22 Proportional control, ship roll stabilization system. 2 1.5 2 1 Imaginary Axis G (s)H (s) = K(s + 4s + 8) 2 s (s + 1)(s + 0.7s + 2) 0.5 0 –0.5 –1 –1.5 –2 –3.5 –3 –2.5 –2 –1.5 Fig. 5.23 PID control, ship roll stabilization system. –1 –0.5 Real Axis 140 Advanced Control Engineering 4 ζ = 0.7 3 K = 10.2 2 G (s)H (s ) = K(s + 2)(s + 4s + 8) 2 s (s + 1)(s + 0.7s + 2) Imaginary Axis 2 1 K = 10.2 0 –1 –2 –3 –4 –9 –8 –7 –6 –5 –3 –4 Real Axis –2 –1 0 1 Fig. 5.24 PI%% control, ship roll stabilization system. breakaway point at s  0:6. This in turn creates a second pair of complex loci that terminate at the new open-loop zeros, leaving the original complex loci to crossover the imaginary axis as before. (c) PIDD control: If an additional open-loop zero is placed on the real axis, to the left of the open-loop pole s  1, a further breakaway point will occur to the left of the new zero. This should have the effect of bringing one pair of complex loci back to the real axis, whilst allowing the original complex loci to terminate at the complex open-loop zeros. If a new real zero is placed at s  2, the open-loop transfer function becomes K(s  2)(s2  4s  8) G(s)H(s)  (5:117) s(s  1)(s2  0:7s  2) The resulting root-locus diagram is shown in Figure 5.24. The control strategy for the root-locus diagram shown in Figure 5.24 is called PIDD, because of the additional open-loop zero. The system is unstable between K  0:17 and K  1:06, but exhibits good transient response at K  10:2 on both complex loci. Figure 5.25 shows the step response for (a) the hull roll action without a stabilizer system, and (b) the hull roll action with a controller/compensator with a control law G(s)  10:2(s  2)(s2  4s  8) s (5:118) Classical design in the s-plane 141 1.5 With Stabilizer Without Stabilizer Roll Angle 1 0.5 0 0 1 2 3 4 Time (s) 5 6 7 8 Fig. 5.25 Ship hull step response with and without stabilizers system. System performance (i) Without stabilizer system Rise time (95%) 1.3 seconds Percentage Overshoot 45% Settling time (2%) 10.0 seconds (ii) With stabilizer system Rise time (95%) Percentage overshoot Settling time (2%) With the stabilizer system, 5.5 0.14 seconds 22.8% 1.4 seconds the step response meets the performance specification. Further problems Example 5.12 Use the Routh±Hurwitz criterion to determine the number of roots with positive real parts in the following characteristic equations (a) s4  3s3  6s2  2s  5  0 Ans: two (b) s5  2s4  3s3  4s2  2s  1  0 Ans: none 142 Advanced Control Engineering Example 5.13 Find the value of the open-loop gain constant K to make the control system, whose open-loop transfer function is given below, just unstable. G(s)H(s)  K s(s  1)(s  8) Ans : 72 Example 5.14 A feedback control system has the following open-loop transfer function G(s)H(s)  K s(s  1)(s  5) (a) Sketch the root locus by obtaining asymptotes, breakaway point and imaginary axis cross-over point. (b) A compensating element having a transfer function G(s)  (s  2) is now included in the open-loop transfer function. If the breakaway point is 0:56, sketch the new root locus. Comment on stability of the system with, and without the compensator. (c) Demonstrate that for the compensated system the co-ordinates 2:375, 1:8  j 4:0 lie on the curve. What is the value of K for these points? Solution (a) a  2, b  0:47, !  j2:24 rad/s (b) With compensator, system stable for all K (c) K  23 Example 5.15 A feedback control system employing proportional control has the following openloop transfer function G(s)H(s)  K (s  1)(s2  s  1) (a) Using asymptotes, sketch the root locus diagram for the closed-loop system and find ii(i) the angles of departure from any complex open-loop poles, i(ii) the frequency of transient oscillation at the onset of instability, (iii) the value of K to give the dominant closed-loop poles a damping ratio  of 0.3 (b) To improve the steady-state performance the proportional controller is replaced by a proportional plus integral controller. The forward-path transfer function now becomes G(s)  K(s  2) s(s  1)(s2  s  1) Classical design in the s-plane 143 Demonstrate that (i) the two breakaway points occur at b1  0:623 b2  2:53 (ii) the imaginary axis crossover occurs when   0:464 Solution (a) (i) 30 , (ii) 1:414 rad/s, (iii) K  0:55 Example 5.16 (a) The laser guided missile shown in Figure 5.26(a) has a pitch moment of inertia of 90 kg m2. The control fins produce a moment about the pitch mass centre of 360 Nm per radian of fin angle . The fin positional control system has unity gain and possesses a time constant of 0.2 seconds. If all other aerodynamic effects are ignored, find the transfer functions of the control fins and missile (in pole-zero format) in the block diagram given in Figure 5.26(b). (b) You are to conduct a feasibility study to evaluate various forms of control action. Initially proportional control is to be considered. Using asymptotes only, construct the root locus diagram and give reasons why it would be unsuitable. θA(t ) G β (t ) (a) θD(s ) + β (s) U (s) G1(s) G2(s) – (b) Fig. 5.26 Laser guided missile. Missile Dynamics Fin Dynamics Controller G3(s) θA(s) 144 Advanced Control Engineering (c) An open-loop zero is now introduced at s  2. Again construct the root-locus diagram using asymptotes and comment on the suitability of the system. (d) Open-loop zeros at s  2 and s  3 are now introduced. Demonstrate that at s  2:45 the complex loci join the real axis prior to terminating at the openloop zeros. Show also that a trial point on the locus exists when j!  1:45 and the damping ratio   0:7. Sketch the root locus diagram and evaluate the controller gain that corresponds to   0:7. Solution (a) (b) (c) (d) G2 (s)  5=(s  5) G3 (s)  4=s2 System unstable for all K System stable for all K Controller gain  0:24 6 Classical design in the frequency domain 6.1 Frequency domain analysis Control system design in the frequency domain can be undertaken using a purely theoretical approach, or alternatively, using measurements taken from the components in the control loop. The technique allows transfer functions of both the system elements and the complete system to be estimated, and a suitable controller/compensator to be designed. Frequency domain analysis is concerned with the calculation or measurement of the steady-state system output when responding to a constant amplitude, variable frequency sinusoidal input. Steady-state errors, in terms of amplitude and phase relate directly to the dynamic characteristics, i.e. the transfer function, of the system. Consider a harmonic input i (t)  A1 sin !t (6:1) This can be expressed in complex exponential form i (t)  A1 e j!t (6:2) The steady-state response of a linear system will be o (t)  A2 sin(!t  ) (6:3) o (t)  A2 e j(!t) (6:4) or where  is the phase relationship between the input and output sinewaves as shown in Figure 6.1. The amplitude ratio A2 /A1 is called the modulus and given the symbol G. Thus A2  G A1 (6:5) A2  A1 G (6:6) or 14 Advanced ntrol engineering 1.5 θ i(t ) = A1 sin ωt θ i (t ) θo(t) = A2 sin(ω t – φ) θo(t ) 1 0.5 A1 A2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 ωt (rad) –0.5 φ –1 –1.5 Fig. 6.1 St         Im Re –φ 1 –φ 3 –φ 2 |G1| P1(ω) |G2| |G3| P2ω) P3(ω) Fig. 6.2       Substituting equation (6.6) into (6.3) o (t)  A1 Ge j(!t)  A1 Ge j!t ej (6:7) Classical design in the frequency domain 147 o (t)  (A1 e j!t )(Gej )  i (t)Gej' (6:8) Since G and  are functions of !, then equation (6.8) may be written o (!)  G(!)ej(!) (6:9) i For a given value of !, equation (6.9) represents a point in complex space P(!). When ! is varied from zero to infinity, a locus will be generated in the complex space. This locus, shown in Figure 6.2, is in effect a polar plot, and is sometimes called a harmonic response diagram. An important feature of such a diagram is that its shape is uniquely related to the dynamic characteristics of the system. 6.2 The complex frequency approach Relationship between s and j!. From equation (6.2) i (t)  A1 e j!t d  j!(A1 e j!t )  j!i (t) dt Taking Laplace transforms or si (s)  j!i (s) (6:10) s  j! (6:11) Hence, for a sinusoidal input, the steady-state system response may be calculated by substituting s  j! into the transfer function and using the laws of complex algebra to calculate the modulus and phase angle. 6.2.1 Frequency response characteristics of first-order systems From equation (3.23) o K (s)  G(s)  1  Ts i (6:12) For a sinusoidal input, substitute equation (6.11) into (6.12). o K ( j!)  G( j!)  1  j!T i (6:13) Rationalize, by multiplying numerator and denominator of equation (6.13) by the conjugate of (6.13), i.e. G( j!)   K(1  j!T) (1  j!T)(1  j!T) K(1  j!T) 1  !2 T 2 (6:14) 148 Advanced control engineering Equation (6.14) is a complex quantity of the form a  jb where K Real part a  1  !2 T 2 K!T Imaginary part b  1  !2 T 2 (6:15) (6:16) Hence equation (6.14) can be plotted in the complex space (Argand Diagram) to produce a harmonic response diagram as shown in Figure 6.3. In Figure 6.3 it is convenient to use polar co-ordinates, as they are the modulus and phase angle as depicted in Figure 6.2. From Figure 6.3, the polar co-ordinates are  G( j!)  a2  b2   2   (6:17) K K!T 2   1  !2 T 2 1  !2 T 2 which simplifies to give K G( j!)   1  !2 T 2 (6:18) Comparing equations (6.14) and (6.18), providing there are no zeros in the transfer function, it is generally true to say K (6:19) G( j!)   Denominator of G( j!) Im Re ∠G (jω) b= |G (jω)| a= Fig. 6.3   K 2 1+ω T 2 G (jω)             –KωT 2 2 1+ω T Classical design in the frequency domain 149 K Im ω =0 ω =∞ Re –45° 0.707K ω= l T (a) Polar Plot ∠G(j ω) G(j ω) (degrees) K 0 0.707K – 45 – 90 ω (rad/s) l T (c) l T ω (rad/s) (b) Rectangular Plot (Frequency Response) Fig. 6.4                      6.1 Modulus and phase for a first-order system ! (rad/s) G( j!) G( j!) (degrees) 0 1/T K  K/ 2 0 0 45 90 The argument, or phase angle is   b G( j!)  tan a  1  tan1 K!T 1  !2 T 2 K 1  !2 T 2 (6:20)  which gives G( j!)  tan1 !T  (6:21) 150 Advanced control engineering Using equations (6.18) and (6.21), values for the modulus and phase angle may be calculated as shown in Table 6.1. The results in Table 6.1 may be represented as a Polar Plot, Figure 6.4(a) or as a rectangular plot, Figures 6.4(b) and (c). Since the rectangular plots show the system response as a function of frequency, they are usually referred to as frequency response diagrams. 6.2.2 Frequency response characteristics of second-order systems From equation (3.42) the standard form of transfer function for a second-order system is K G(s)  1 (6:22) 2 s  !2n s  1 !2n Substituting s  j! G( j!)  1 !2n or K ( j!)  !2n ( j!)  1 (6:23) 2 K G( j!)  1  2 ! !n  j 2 (6:24)   ! !n Rationalizing gives K G( j!)   1 1  2 ! !n  2 ! !n  j 2 2  2    ! !n   ! !n 2 (6:25) Using equations (6.17) and (6.19), the modulus is K G( j!)    2 2   2 1  !!n  2 p !!n (6:26) And from equation (6.20), the argument is     2 !! n G( j!)  tan1   1  ! !n    2   6.2 Modulus and phase for a second-order system ! (rad/s) 0 !n G( j!) G( j!) (degrees) K K/2 0 0 90 180 (6:27) Classical design in the frequency domain 151 Im K Re ω=0 ζ=1 0.5K ω = ωn ζ = 0.5 K ω = ωn ζ = 0.5 2K ω = ω n Fig. 6.5           From equations (6.26) and (6.27) the modulus and phase may be calculated as shown in Table 6.2. The results in Table 6.2 are a function of  and may be represented as a Polar Plot, Figure 6.5, or by the frequency response diagrams given in Figure 6.6. 6.3 The Bode diagram The Bode diagram is a logarithmic version of the frequency response diagrams illustrated in Figures 6.4(b) and (c), and also Figure 6.6, and consists of (i) a log modus±log frequency plot (ii) a linear phase±log frequency plot. The technique uses asymptotes to quickly construct frequency response diagrams by hand. The construction of diagrams for high-order systems is achieved by simple graphical addition of the individual diagrams of the separate elements in the system. The modulus is plotted on a linear y-axis scale in deciBels, where G( j!) dB  20 log10 G( j!) The frequency is plotted on a logarithmic x-axis scale. (6:28) 152 Advanced control engineering 2.5 ζ = 0.25 2K G(j ω) 2 1.5 ζ = 0.5 K 1 ζ = 1.0 0.5K 0.5 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 ω (rad/s) ωn (a) Modulus 0 –20 ζ = 0.25 –40 ∠G(j ω) ζ = 0.5 –60 ζ = 1.0 (degrees) –80 –100 –120 –140 –160 –180 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 ω (rad/s) ωn (b) Phase Fig. 6.6     6.3.1           Summation of system elements on a Bode diagram Consider two elements in cascade as shown in Figure 6.7. G1 ( j!)  G1 ( j!)e j1 (6:29) G2 ( j!)  G2 ( j!)e (6:30) j2 Classical design in the frequency domain 153 R (jω) Fig. 6.7   G 2(jω) G 1(jω)     C (jω)   ( j!)  G1 ( j!)G2 ( j!) R  G1 ( j!) G2 ( j!)e j(1 2 ) (6:31) Hence   C   ( j!)  G1 ( j!) G2 ( j!) R  or and   C   ( j!)dB  20 log G1 ( j!)  20 log G2 ( j!) 10 10 R   C ( j!)  1  2  G1 ( j!)  G2 ( j!) R (6:32) (6:33) In general, the complete system frequency response is obtained by summation of the log modulus of the system elements, and also summation of the phase of the system elements. 6.3.2 Asymptotic approximation on Bode diagrams (a) First-order lag systems These are conventional first-order systems where the phase of the output lags behind the phase of the input. (i) Log modulus plot: This consists of a low-frequency asymptote and a highfrequency asymptote, which are obtained from equation (6.18). Low frequency (LF) asymptote: When ! 0, G( j!) K. Hence the LF asymptote is a horizontal line at K dB. High frequency (HF) asymptote: When ! 1/T, equation (6.18) approximates to G( j!)  K !T (6:34) As can be seen from equation (6.34), each time the frequency doubles (an increase of one octave) the modulus halves, or falls by 6 dB. Or alternatively, each time the frequency increases by a factor of 10 (decade), the modulus falls by 10, or 20 dB. Hence the HF asymptote for a first-order system has a slope which can be expressed as 6 dB per octave, or 20 dB per decade. 154 Advanced control engineering From equation (6.34), when !  1/T, the HF asymptote has a value of K. Hence the asymptotes intersect at !  1/T rad/s. Also at this frequency, from equation (6.18) the exact modulus has a value K G( j!)   2  Since 1/ 2 is 3 dB, the exact modulus passes 3 dB below the asymptote intersection at 1/T rad/s. The asymptotic construction of the log modulus Bode plot for a firstorder system is shown in Figure 6.8. |G (jω)| dB LF Asymptote K 3 dB HF Asymptote –6 dB/octave (–20 dB/decade) log ω 1 T Fig. 6.8                 ∠G(jω) (degrees) 0 LF Asymptote MF Asymptote –45 HF Asymptote –90 1 10T Fig. 6.9       1 T        10 T log ω Classical design in the frequency domain 155 (ii) Phase plot: This has three asymptotes . A LF horizontal asymptote at 0 . A HF horizontal asymptote at 90 . A Mid-Frequency (MF) asymptote that intersects the LF asymptote at 1/10T and the HF asymptote at 10/T (i.e. a decade either side of 1/T ). The Bode phase plot for a first-order system is given in Figure 6.9. (b) First-order lead systems These are first-order systems where the phase of the output (in steady-state) leads the phase of the input. The transfer function of a first-order lead system is G(s)  K(1  Ts) (6:35) and G( j!)  K  1  !2 T 2 G( j!)  tan1 (!T) (6:36) (6:37) The Bode diagram, given in Figure 6.10, is the mirror image, about the frequency axis, of the first-order lag system. Note that the transfer function given in equation (6.35) is also that of a PD controller. (c) Second-order systems (i) Log modulus plot LF asymptote: A horizontal line at K dB HF asymptote: When ! !n , equation (6.26) approximates to G( j!)   K ! !n 2 (6:38) From equation (6.38), an octave increase in frequency will reduce the modulus by a quarter, or 12 dB and a decade frequency increase will reduce the modulus by a factor of 100, or 40 dB. Hence the HF asymptote for a second-order system has a slope of 12 dB/octave or 40 dB/decade. The LF and HF asymptotes intersect at !  !n . Also at !n , the exact value of modulus from equation (6.26) is G( j!)  K 2 The value of the modulus relative to the LF asymptote is     K=2 1 G( j!)dB  20 log10  20 log10 K 2 (6:39) 156 Advanced control engineering |G(jω)| dB Slope = +6 dB/octave (+20 dB/decade) 3 dB K 1 T (a) Log modulus log ω ∠G(jω) 90 (degrees) 45 0 1 T (b) Phase log ω Fig. 6.10               Hence   0:25, Relative modulus  6 dB   0:5, Relative modulus  0 dB   1:0, Relative modulus  6 dB (ii) Phase plot: This has two asymptotes: . A LF horizontal asymptote at 0 . A HF horizontal asymptote at 180 . The phase curve passes through 90 at !  !n . Its shape depends upon  and is obtained from the standard curves given in Figure 6.11. Classical design in the frequency domain 157 |G(j ω)| ζ = 0.1 dB 10 ζ = 0.2 ζ = 0.4 0 ζ = 0.6 ζ = 0.8 –10 ζ = 1.0 ζ = 1.5 –20 ζ = 2.0 –30 –40 –50 –1 10 1 0 10 10 ω ωn (a) Log modulus 0 ζ = 0.1 ∠G(j ω) (degrees) ζ = 0.2 –50 ζ = 0.4 ζ = 1.5 ζ = 0.6 –100 ζ = 0.8 ζ = 1.0 ζ = 2.0 –150 –200 –1 10 0 10 ω ωn (b) Phase Fig. 6.11              1 10 158 Advanced control engineering (d) A pure integrator Consider a pure integrator of the form G(s)  K s (6:40) now G( j!)  K 0  j! Rationalizing G( j!)  K(0  j!) !2 (6:41) From equation (6.17)  K 2 !2 K G( j!)  0  4  ! ! (6:42) and from equation (6.20) G( j!)  tan1  K!=!2 0   tan1 ( )  90 (6:43) It can be seen from equation (6.42) that the modulus will halve in value each time the frequency is doubled, i.e. it has a slope of 6 dB/octave (20 dB/decade) over the complete frequency range. Note that G( j!)  K dB when !  1 G( j!)  1  0 dB when !  K The Bode diagram for a pure integrator is shown in Figure 6.12. |G(jω)| dB K ∠G(jω) –6 dB/octave (–20 dB/decade) (degrees) 0 0 –90 1.0 Fig. 6.12        K    log ω log ω Classical design in the frequency domain 159 Example 6.1 (See also Appendix 1, examp61.m) Construct, using asymptotes, the Bode diagram for 2 G(s)  1  0:5s Low Frequency asymptote is a horizontal line at K dB, (6:44) i:e: 6 dB Asymptote intersection (break frequency) occurs at 1/T, i.e. 2 rad/s. The Bode diagram is shown in Figure 6.13. 10 |G(j ω)| 5 – 6 dB/octave dB 0 –5 –10 –15 –20 –25 –30 –1 10 0 10 2 10 1 2 10 ω (rad/s) (a) Bode Gain 0 ∠G(j ω) (degrees) –20 –40 –60 –80 –100 –1 10 0 10 2 (b) Bode Phase Fig. 6.13       G(s)  /1  0:5s 1 10 2 10 ω (rad/s) 160 Advanced control engineering Example 6.2 (See also Appendix 1, examp62.m) Draw the Bode diagram for 4 0:25s2  0:2s  1 G(s)  (6:45) 40 |G(j ω)| dB 8 dB 20 12 –12 dB/octave 0 –20 –40 –60 –1 10 0 10 1 10 2 2 10 ω (rad/s) (a) Bode Gain 0 ∠G(j ω) (degrees) –50 –100 –150 –200 –1 10 0 10 1 10 2 (b) Bode Phase Fig. 6.14            K  4, !n    0:2 2 10 ω (rad/s) Classical design in the frequency domain 161 Comparing equation (6.45) with the standard form given in (6.22) 1  0:25 !2n i:e: !n  2 rad/s 2  0:2 !n i:e:   0:2 Low Frequency asymptote is a horizontal line at K dB i:e: 20 log10 (4)  12 dB The log modulus relative to the LF asymptote at !  !n is given by equation (6.39)   1 G( j!)!n  20 log10  8 dB 0:4 (Hence the absolute log modulus at !  !n is 20 dB). The Bode diagram is given by Figure 6.14. Note in Figure 6.14 that the phase curve was constructed by reading the phase from Figure 6.11(b), an octave either side of !n . Example 6.3 Construct, on log-linear graph paper, using asymptotes, and validate using MATLAB or a similar tool, the Bode diagrams for 4 s(1  2s) 1 (b) G(s)  (1  0:5s)(1  4s) 10(1  s) (c) G(s)  (1  0:2s)(1  5s) (a) G(s)  (d) G(s)  6.4 6.4.1 s(0:25s2 100  0:1s  1) Stability in the frequency domain Conformal mapping and Cauchy's theorem In Chapter 5 the stability of linear control systems were considered in the s-plane. Using a process of conformal transformation or mapping, it is possible to map a contour from one complex plane to another. It is therefore possible to transfer stability information from the s-plane to another complex plane, the F(s)-plane. The relationship between the contours in the two complex planes is given by Cauchy's theorem, which states: `For a given contour in the s-plane that encircles P poles and Z zeros of the function F(s) in a clockwise direction, the resulting 162 Advanced control engineering s1 jω Im a d s1 φ z1 F(s) c φ p1 φ p2 ∠F(s ) b φ z2 σ Re (a) s-plane Fig. 6.15     (b) F(s)-plane     s     F(s)   contour in the !(s)-plane encircles the origin a total of N times in a clockwise direction'. Where N ZP (6:46) Consider a function F(s)  (s  z1 )(s  z2 ) (s  p1 )(s  p2 ) (6:47) where z1 and z2 are zeros of F(s) and p1 and p2 are poles. Equation (6.47) can be written as F(s)  F(s)F(s) The mapping of a contour from the s-plane to the F(s)-plane is shown in Figure 6.15. From Figure 6.15 F(s)  and ab cd F(s)  z1  z2  p1  p2 (6:48) (6:49) As s1 in Figure 6.15(a) is swept clockwise around the contour, it encircles two zeros and one pole. From Cauchy's theorem given in equation (6.46), the number of clockwise encirclements of the origin in Figure 6.15(b) is N 211 6.4.2 (6:50) The Nyquist stability criterion A frequency domain stability criterion developed by Nyquist (1932) is based upon Cauchy's theorem. If the function F(s) is in fact the characteristic equation of a closed-loop control system, then Classical design in the frequency domain 163 !(s)  1  G(s)H(s) (6:51) Note that the roots of the characteristic equation are the closed-loop poles, which are the zeros of F(s). In order to encircle any poles or zeros of F(s) that lie in the right-hand side of the s-plane, a Nyquist contour is constructed as shown in Figure 6.16. To avoid poles at the origin, a small semicircle of radius ", where " 0, is included. Figure 6.17(a) shows the 1  G(s)H(s) plane when Z  P  2, i.e. two clockwise encirclements. However, if the contour is plotted in G(s)H(s) plane as shown in Figure 6.17(b), then it moves one unit to the left, i.e. encircles the 1 point. +j ω r → ∞ σ ε –j ω Fig. 6.16 s   !     Im Im Re (a) 1 + G(s)H(s) plane Fig. 6.17 "    1  G(s)H(s)   G(s)H(s)   (–1, j0) ω=∞ ω=0 ω = –∞ ω = 0 Re (b) G(s)H(s) plane 164 Advanced control engineering The Nyquist stability criterion can be stated as: `A closed-loop control system is stable if, and only if, a contour in the G(s)H(s) plane describes a number of counterclockwise encirclements of the (1, j0) point, the number of encirclements being equal to the number of poles of G(s)H(s) with positive real parts'. Hence, because there is a net clockwise encirclement of the (1, j0) point in Figure 6.17(b) the system is unstable. If, however, there had been a net counter-clockwise encirclement, the system would have been stable, and the number of encirclements would have been equal to the number of poles of G(s)H(s) with positive real parts. For the condition P  0, the Nyquist criterion is: `A closed-loop control system is stable if, and only if, a contour in the G(s)H(s) plane does not encircle the (1, j0) point when the number of poles of G(s)H(s) in the right-hand s-plane is zero'. In practice, only the frequencies !  0 to  are of interest and since in the frequency domain s  j!, a simplified Nyquist stability criterion, as shown in Figure 6.18 is: `A closed-loop system is stable if, and only if, the locus of the G( j!)H( j!) function does not enclose the (1, j0) point as ! is varied from zero to infinity. Enclosing the (1, j0) point may be interpreted as passing to the left of the point'. The G( j!)H( j!) locus is referred to as the Nyquist Diagram. An important difference between analysis of stability in the s-plane and stability in the frequency domain is that, in the former, system models in the form of transfer functions need to be known. In the latter, however, either models or a set of input±output measured open-loop frequency response data from an unknown system may be employed. Margins of stability The closer the open-loop frequency response locus G( j!)H( j!) is to the (1, j0) point, the nearer the closed-loop system is to instability. In practice, all control Im G(j ω)H(j ω) plane ω =0 (–1, j0) Re ω =∞ Stable Unstable Fig. 6.18 !       #   #    Classical design in the frequency domain 165 Im Unit circle 1 GM (–1, j0) Re PM Fig. 6.19   $ %     $ %  !    systems possess a Margin of Stability, generally referred to as gain and phase margins. These are shown in Figure 6.19. Gain Margin (GM): The gain margin is the increase in open-loop gain required when the open-loop phase is 180 to make the closed-loop system just unstable. Nyquist diagram GM  1 G( j!)H( j!)180 (6:52) Bode diagram GM  20 log10 1 G( j!)H( j!)180 (6:53) Phase Margin (PM): The phase margin is the change in open-loop phase, required when the open-loop modulus is unity, (or 0 dB on the Bode diagram) to make the closed-loop system just unstable. Phase Margin  180  G( j!)H( j!)(mod  1) (6:54) 166 Advanced control engineering Controller Plant K1 4 2 s(s + 2s + 4) R(s) + C(s) – Fig. 6.20 "      Example 6.4 (See also Appendix 1, examp64.m) Construct the Nyquist diagram for the control system shown in Figure 6.20 and find the controller gain K1 that (a) makes the system just unstable. (Confirm using the Routh stability criterion) (b) gives the system a gain margin of 2 (6 dB). What is now the phase margin? Solution Open-loop transfer function G(s)H(s)  where K s(s2  2s  4) K  4K1 (6:55) (6:56) K s3  2s2  4s K G( j!)H( j!)  3 ( j!)  2( j!)2  4j! K  2 2!  j(4!  !3 ) G(s)H(s)  Rationalizing G( j!)H( j!)  K2!2  j(4!  !3 ) 4!4  (4!  !3 )2 (6:57) From equation (6.19) K G( j!)H( j!)   4!4  (4!  !3 )2 (6:58) From equation (6.20) (4!  !3 ) 2!2   2 1 4  !  tan 2! G( j!)H( j!)  tan1 (6:59) Classical design in the frequency domain 167  6.3 Data for Nyquist diagram for system in Figure 6.20 ! (rad/s) G( j!)H( j!)(K  1) G( j!)H( j!) (deg) 0.5 1.0 1.5 2.0 2.5 3.0 4.0 5.0 0.515 105 0.278 124 0.191 150 0.125 180 0.073 204 0.043 220 0.018 236 0.0085 245 The Nyquist diagram is constructed, for K  1, at frequencies either side of the 180 point, which, from equation (6.59) can be seen to be !  2 rad/s. Using equations (6.58) and (6.59), Table 6.3 may be evaluated. (a) From equation (6.52) GM  1/0:125  8 Value of K to make system just unstable Kunstab  K  GM 188 From equation (6.56) K1 for instability  2 (b) For a GM of 2, the locus must pass through the (0:5, j0) point in Figure 6.21. This can be done by multiplying all the modulus values in Table 6.3 by four and re-drawing Figure 6.21. Alternatively, the scales of Figure 6.21 can be multiplied by a factor of four (without re-drawing). Hence the unit circle is 0:25  4 and the PM can be seen to have a value of 50 when the GM is 2.0. Value of K to give a GM of 2 is the original K times 4, i.e. 1  4  4. From (6.56) K1  1:0 Hence, to give a GM of 2 and a PM of 50 , the controller gain must be set at 1.0. If it is doubled, i.e. multiplied by the GM, then the system just becomes unstable. Check using the Routh stability criterion: Characteristic equation 1 Routh's array K 0 s(s2  2s  4) s3  2s2  4s  K  0 s0 s 1 s 2 3  K 1 2(8 2  K) K s 1 4  Thus when K  8 then the system is unstable. (6:60) (6:61) 168 Advanced control engineering Unit circle on new scale 0.1 New scale Im ω = 2.5 –1 –0.6 –0.5 Original scale –1 –0.4 ω = 2.0 –0.3 –0.2 ω = 1.5 0 –0.1 PM 0 =5 ° 0 Re 0.1 –0.1 –0.2 ω = 1.0 –0.3 –0.4 ω = 0.5 –0.5 –0.6 Fig. 6.21 !          &'( System type classification Closed-loop control systems are classified according to the number of pure integrations in the open-loop transfer function. If  K m (s  zi )  G(s)H(s)  n qi1 s (s  pk ) k1 (6:62)  Then n in equation (6.62) is the `type number' of the system and denotes the product of the factors. The system `type' can be observed from the starting point (! 0) of the Nyquist diagram, and the system order from the finishing point (! ), see Figure 6.22. System `type' and steady-state errors From the final value theorem given in equation (3.10) it is possible to define a set of steady-state error coefficients. 1. Position error coefficient Kp  lim G(s) s 0 Classical design in the frequency domain 169 G(s)H(s) = K s(1+Ts) Im Im K G(s)H(s) = (1+Ts) Re Re (a) First-order type zero system (b) Second-order type one system Im G(s)H(s) = K 2 s (1+Ts) Re (c) Third-order type two system Fig. 6.22 )  #          !    For a step input, ss  2. Velocity error coefficient 1 1  Kp (6:63) Kv  lim s G(s) s 0 For a ramp input, ess  1 Kv (6:64) 3. Acceleration error coefficient Ka  lim s2 G(s) s 0 For a parabolic input, ess  1 Ka (6:65) 170 Advanced control engineering  6.4 Relationship between input function, system type and steady-state error Input function Step Ramp Parabolic Steady-state error Type zero Type one Type two constant increasing increasing zero constant increasing zero zero constant Table 6.4 shows the relationship between input function, system type and steadystate error. From Table 6.4 it might appear that it would be desirable to make most systems type two. It should be noted from Figure 6.22(c) that type two systems are unstable for all values of K, and will require some form of compensation (see Example 6.6). In general, type zero are unsatisfactory unless the open-loop gain K can be raised, without instability, to a sufficiently high value to make 1/(1  Kp ) acceptably small. Most control systems are type one, the integrator either occurring naturally, or deliberately included in the form of integral control action, i.e. PI or PID. Stability on the Bode diagram In general, it is more convenient to use the Bode diagram in control system design rather than the Nyquist diagram. This is because changes in open-loop gain do not affect the Bode phase diagram at all, and result in the Bode gain diagram retaining its shape, but just being shifted in the y-direction. With Example 6.4 (see also Appendix 1, examp64a.m and examp64b.m), when the controller gain set to K1  1:0, the open-loop transfer function is G(s)H(s)  s(s2 4  2s  4) (6:66) Equation (6.66) represents a pure integrator and a second-order system of the form G(s)H(s)  1 1 2 s (0:25s  0:5s  1) (6:67) As explained in Figure 6.12 the pure integrator asymptote will pass through 0 dB at 1.0 rad/s (for K  1 in equation (6.67)) and the second-order element has an undamped natural frequency of 2.0 rad/s and a damping ratio of 0.5. Figure 6.23(a), curve (i), shows the Bode gain diagram for the transfer function given in equation (6.66), which has a gain margin of 6 dB (the amount the open-loop gain has to be increased to make the system just unstable. Figure 6.23(a), curve (ii), shows the effect of increasing K by a factor of two (6 dB) to make the system just unstable. For curve (ii) the open-loop transfer function is G(s)H(s)  8 s(s2  2s  4) (6:68) Figure 6.23(b) shows the Bode phase diagram which is asymptotic to 90 at low frequencies and 270 at high frequencies, passing through 180 at 2 rad/s. To Classical design in the frequency domain 171 determine the phase margin, obtain the open-loop phase when the modulus is 0 dB (on curve (i), Figure 6.23(a), this is approximately 1.1 rad/s), and subtract the phase from 180 to give a PM of 50 as shown. 30 20 System just unstable 10 (ii) Gain (dB) 0 (i) GM = 6 dB –10 –20 –30 –40 –50 –1 10 0 1 10 Frequency (rad/s) 10 (a) Bode Gain –50 Phase (degrees) –100 PM = 50° –150 –180 –200 –250 –300 –1 10 0 10 Frequency (rad/s) (b) Bode Phase Fig. 6.23 St#        1 10 172 Advanced control engineering 6.5 6.5.1 Relationship between open-loop and closed-loop frequency response Closed-loop frequency response When designing a control system it is essential to (a) ensure that the system is stable for all operating regimes (b) ensure that the closed-loop performance meets the required specification. Time domain performance specifications are described in section 3.7 and Figure 3.21. Frequency domain performance specifications are given in terms of gain and phase margins to provide adequate stability together with information relating to the closed-loop frequency response. Figure 6.24 shows the closed-loop frequency response of a control system. The closed-loop modulus is usually defined as      ( j!)  M (6:69) R  Bandwidth (!B ): This is the frequency at which the closed-loop modulus M has fallen by 3 dB below its zero frequency value. (This is not true for systems that do not operate down to dc levels.) Peak modulus (Mp ): This is the maximum value that the closed-loop modulus M rises above its zero frequency value. Peak frequency (!p ): This is the frequency that the peak modulus occurs. Note that !p < !B . Second-order system closed-loop frequency response Many closed-loop systems approximate to second-order systems. Equation (6.26) gives the general equation for modulus. If, when K is set to unity, this equation is C (j ω) Mp R (M ) (dB) 0 –3 Bandwidth ωp Fig. 6.24 "       ωB log ω (rad/s) Classical design in the frequency domain 173 squared, differentiated with respect to !2 and equated to zero (to find a maximum), then 1  (6:70) 2 1   2  (6:71) !p  !n 1  2 2  If, as a rule-of-thumb, Mp is limited to 3 dB ( 2), then from equations (6.70), (6.71) and Figure 6.11 Mp    0:38 !p  0:84!n !B  1:4!n (6:72) In general, for a unity feedback control system, the closed-loop frequency response is given by equation (6.73) C G( j!) ( j!)  R 1  G( j!) (6:73) Equation (6.73) can be expressed in rectangular co-ordinates as C X( j!)  jY( j!) ( j!)  R 1  X( j!)  jY( j!) (6:74) Hence    C  ( j!)  M  X( j!)  jY( j!)  R 1  X( j!)  jY( j!) Equation (6.75) can be expressed as an equation of a circle of the form  2  2 M2 M X( j!)  2 Y( j!)2  M2  1 M 1 (6:75) (6:76) i.e. centre radius  M 2 , 0 M2  1   M  M2  1  (6:77) Also, from equation (6.73)  C ( j!)  (X( j!)  Y( j!))  (1  X( j!)  Y( j!)) R (6:78) let N  tan  C ( j!) R (6:79) 174 Advanced control engineering Equation (6.78) can also be expressed as an equation of a circle of the form       1 2 1 2 1 N2  1 X( j!)   Y( j!)   2 2N 4 N2 (6:80) i.e. 1/2, 1/2N  N2  1 radius 2N centre (6:81) The M and N circles can be superimposed on a Nyquist diagram (called a Hall chart) to directly obtain closed-loop frequency response information. Alternatively, the closed-loop frequency response can be obtained from a Nyquist diagram using the direct construction method shown in Figure 6.25. From equation (6.73)   C   ( j!)  G( j!)  OB (6:82) R  1  G( j!) AB Also from equation (6.73)  C ( j!)  G( j!)  (1  G( j!)) R  COB  OAB (6:83) Im A C –1 ∠1+G(j ω) O 1 Re ∠G(jω ) |1+G(j ω)| |G(jω )|   ∠–  C (jω ) R  Fig. 6.25 "  B        !              Classical design in the frequency domain 175 40 M contours 30 0 dB 0.25 dB 0.5 dB Open-Loop Gain (dB) 20 1 dB –1 dB 3 dB 10 –3 dB 6 dB –6 dB 0 –10 –12 dB –20 –20 dB N contours –30 –40 –360 –40 dB –270 –180 –90 0 Open-Loop Phase (deg) Fig. 6.26 * !    Hence   ( j!)  ABO R (6:84) The Nichols chart The Nichols chart shown in Figure 6.26 is a rectangular plot of open-loop phase on the x-axis against open-loop modulus (dB) on the y-axis. M and N contours are superimposed so that open-loop and closed-loop frequency response characteristics can be evaluated simultaneously. Like the Bode diagram, the effect of increasing the open-loop gain constant K is to move the open-loop frequency response locus in the y-direction. The Nichols chart is one of the most useful tools in frequency domain analysis. Example 6.5 For the control system given in Example 6.4, determine (a) The controller gain K1 to give the best flatband response. What is the bandwidth, gain margin and phase margin? (b) The controller gain K1 to give a peak modulus Mp of 3 dB. What is the bandwidth, gain margin and phase margin? 176 Advanced control engineering (c) For the controller gain in (b), what, in the time domain, is the rise-time, settling time and percentage overshoot? Solution (a) The open-loop transfer function for Example 6.4 is given by equation (6.55) G(s)H(s)  s(s2 K  2s  4) (6:85) Figure 6.27 (see also Appendix 1, fig627.m) shows the Nichols chart for K  4 (controller gain K1  1). These are the settings shown in the Bode diagram in Figure 6.23(a), curve (i), and (b), where Gain margin  6 dB Phase margin  508 From Figure 6.27 it can be seen that the peak modulus Mp is 4 dB, occurring at !p  1:63 rad/s. The bandwidth !B is 2.2 rad/s. For the best flatband response, the open-loop frequency response locus should follow the 0 dB M contour for as wide 0 dB 30 0.25 dB 25 0.5 dB 20 ω = 0.1 1 dB –1 dB Open-Loop Gain (db) 15 ω = 0.2 3 dB 10 ω = 0.4 –3 dB 6 dB 5 PM –6 dB ω = 1.13 0 GM –5 ω = 1.63 ω = 2.0 ωB = 2.2 –12 dB –10 ω = 2.67 –15 –150° –20 –120° –90° –60° –30° –20° –10° –20 dB –200 –180 –160 –140 –120 –100 –80 Open-Loop Phase (deg) Fig. 6.27 !      +  &, K  4 –60 –40 –20 0 Classical design in the frequency domain 177 30 0.25 dB 0.5 dB 25 20 1dB –1 dB Open-Loop Gain (db) 15 3 dB ω = 2.2 10 –3 dB 6 dB 5 0 –6 dB ω = 1.58 (a) –5 ω B = 2.1 (b) ω B = 2.02 –12 dB –10 –15 ω = 2.66 –150° –20 –120° –90° –30° –20° –10° –60° –20 dB –200 –180 –160 –140 –120 –100 –80 –60 –40 –20 0 Open-Loop Phase (deg) Fig. 6.28 !      # #   $ - $%%      M ./ $ - $#%% a frequency range as possible. This is shown in Figure 6.28, curve (a). To obtain curve (a), the locus has been moved down by 2 dB from that shown in Figure 6.27. This represents a gain reduction of gain reduction factor  alog(2/20)  0:8 (6:86) Hence, for best flatband response K  4:0  0:8  3:2 Controller gain K1  K/4  3:2/4  0:8 (6:87) (6:88) From Nichols chart Gain margin  8:15 dB Phase margin  608 (6:89) Bandwidth  2:02 rad/s (b) To obtain curve (b), the locus has been moved down by 0.5 dB from that shown in Figure 6.27. This represents a gain reduction of gain reduction factor  alog(0:5/20)  0:944 (6:90) 178 Advanced control engineering 10 (b) Response with Mp = 3 dB (Bandwidth = 2.1 rad/s) 0 (a) Best flatband response (Bandwidth = 2.02 rad/s) Gain (dB) –10 –20 –30 –40 –50 –60 –1 10 0 1 10 10 Frequency (rad/s) Fig. 6.29 "  M ./ $ - $%%         # #    $ - $#%%       Hence, for a peak modulus of Mp  3 dB, K  4:0  0:944  3:8 Controller gain K1  K/4  3:8/4  0:95 (6:91) (6:92) From Nichols chart Gain margin  6:36 dB Phase margin  538 Bandwidth  2:1 rad/s (6:93) Figure 6.29 (see also Appendix 1, fig629.m) shows the closed-loop modulus frequency response. Curve (a) is the best flatband response, curve (b) is the response with Mp set to 3 dB. 6.6 Compensator design in the frequency domain In section 4.5, controllers, particularly PID controllers for closed-loop systems were discussed. In Chapter 5 it was demonstrated how compensators could be designed Classical design in the frequency domain 179 in the s-plane to improve system performance. In a similar manner, it is possible to design compensators (that are usually introduced in the forward path) using frequency domain techniques. The general approach is to re-shape the open-loop frequency response locus G( j!)H( j!) in such a manner that the closed-loop frequency response meets a given frequency domain specification in terms of bandwidth and peak modulus. PD cascade compensation: In Chapter 5, case-study Example 5.10, it was demonstrated how a cascaded PD compensator could improve both system performance and stability. However, in this chapter, Figure 6.10 gives the frequency response characteristics of a PD controller/compensator. The important thing to note about Figure 6.10 is that, in theory, above !  1/T, the log modulus increases at 6 dB/octave for evermore. In practice this will not happen because eventually system elements will saturate. But what will happen, however, is that any high frequency noise in the system will be greatly amplified. It therefore becomes necessary, in a practical application, both with PD and PID controllers, to introduce, at some suitable high frequency, a low-pass filter. 6.6.1 Phase lead compensation A phase lead compensator is different from the first-order lead system given in equation (6.35) and Figure 6.10 because it contains both numerator and denominator first-order transfer functions. (a) Passive lead compensation A passive lead network (using two resistors and one capacitor) has a transfer function of the form G(s)  1 (1  Ts) (1  Ts) (6:94) There are two disadvantages of passive lead compensation: (i) the time constants are linked (ii) the gain constant 1/ is always less than unity (called insertion loss) and additional amplification of value is required to maintain the value of the open-loop gain K. (b) Active lead compensation An active lead compensation network is shown in Figure 6.30. For an inverting operational amplifier Vo Zf (s)   Vi Zi where Zi  input impedance and Zf  feedback impedance. Now 1 1 1  R1 C1 s   C1 s  Zi R1 R1 (6:95) 180 Advanced control engineering R2 C2 R1 v i( t ) – C1 vo(t) + Fig. 6.30  -       0 Hence Zi  R1 1  R1 C1 s (6:96) Zf  R2 1  R2 C2 s (6:97) and Inserting equations (6.96) and (6.97) into (6.95) Vo R2 1  R1 C1 s (s)  Vi R1 1  R2 C2 s (6:98) or, in general G(s)  K1 1  T1 s 1  T2 s (6:99) Thus from equation (6.99) it can be seen that the system designer has complete flexibility since, K1 , T1 and T2 are not linked. For a lead network, T1 must be greater than T2 . The Bode diagram for an active lead network is shown in Figure 6.31. From equation (6.99) (1  j!T1 ) K1 (1  j!T1 )(1  j!T2 ) G( j!)  K1 (6:100)  (1  j!T2 ) (1  !2 T22 ) expanding K1 (1  j!T2  j!T1  T1 T2 !2 ) (1  !2 T22 ) (6:101) K1 (1  T1 T2 !2 )  j!(T1  T2 ) (1  !2 T22 ) (6:102) !(T1  T2 ) (1  T1 T2 !2 ) (6:103) G( j!)  giving G( j!)  From equation (6.20) tan   Classical design in the frequency domain 181 20 15 Gain dB +6 dB/octave 10 5 K dB 0 1 T1 Frequency (rad/s) 1 T2 (a) Log Modulus 60 φm 50 40 Phase (degrees) 20 10 0 1 T1 ωm 1 T2 Frequency (rad/s) (b) Phase Advance Fig. 6.31                 To find !m , differentiate equation (6.103) with respect to !, and equate to zero. This gives 1 !m   T1 T2 (6:104) 182 Advanced control engineering 70 60 50 φm (degrees) 40 30 20 10 0 Fig. 6.32 ) 0 0.5 1 1.5 2 2.5 (spacing (octaves)  # m        1/T1   1/T 3 3.5 4 - Substituting equation (6.104) into (6.103) to give m  tan1 T1  T2  2 T1 T2 (6:105) The value of m depends upon the spacing of 1/T1 and 1/T2 on the log ! axis, see Figure 6.32. Design procedure for lead compensation 1. Set K to a suitable value so that any steady-state error criteria are met. 2. Plot the open-loop frequency response and obtain the phase margin and the modulus crossover frequency. (i.e. the frequency at which the modulus passes through 0 dB) 3. Set !m to the modulus crossover frequency and estimate the phase advance m required to provide a suitable phase margin. From equations (6.104) and (6.105), determine T1 and T2 . 4. Plot the compensated system open-loop frequency response. Note that the modulus crossover frequency has now increased. Reduce the compensator gain K1 so that the modulus crossover frequency returns to its original value, and the desired phase margin is met. Case study Example 6.6 The laser guided missile shown in Figure 5.26 has an open-loop transfer function (combining the fin dynamics and missile dynamics) of G(s)H(s)  20  5) s2 (s (6:106) Classical design in the frequency domain 183 30 0.25 dB 25 0.5 dB Open-Loop Phase Gain (dB) 20 1 dB 15 3 dB 10 6 dB 5 ω = 1.9 0 –5 –10 –15 –20 –240 –220 –200 –180 –160 –140 –120 –100 –80 –60 Open-Loop Phase (deg) Fig. 6.33 !                Design a cascade lead compensator that will ensure stability and provide a phase margin of at least 30 , a bandwidth greater than 5 rad/s and a peak closed-loop modulus Mp of less than 6 dB. Solution The open-loop transfer function is third-order type 2, and is unstable for all values of open-loop gain K, as can be seen from the Nichols chart in Figure 6.33. From Figure 6.33 it can be seen that the zero modulus crossover occurs at a frequency of 1.9 rad/s, with a phase margin of 21 . A lead compensator should therefore have its maximum phase advance m at this frequency. However, inserting the lead compensator in the loop will change (increase) the modulus crossover frequency. Lead compensator design one Place !m at the modulus crossover frequency of 2 rad/s and position the compensator corner frequencies an octave below, and an octave above this frequency. Set the compensator gain to unity. Hence !m  2 rad/s 1/T1  1 rad/s 1/T2  4 rad/s K  1:0 m  36:9 184 Advanced control engineering 30 0.25 dB 25 0.5 dB 20 1 dB Open-Loop Gain (dB) 15 3 dB 10 6 dB 5 (b) (a) ω = 3.0 0 ω = 2.0 –5 –10 –15 –20 –240 –220 –200 –180 –140 –120 –160 Open-Loop Phase (deg) Fig. 6.34 !              –100 –80 –60  The compensator is therefore G(s)  (1  s) (1  0:25s) (6:107) The Nichols chart for the uncompensated and compensated system (curve (a)) is shown in Figure 6.34 (see also Appendix 1, fig634.m). From Figure 6.34, curve (a) Gain margin  2 dB Phase margin  48 Modulus crossover frequency  3:0 rad/s Figure 6.35 shows the Bode gain and phase for both compensated and uncompensated systems. From Figure 6.35, it can be seen that by reducing the open-loop gain by 5.4 dB, the original modulus crossover frequency, where the phase advance is a maximum, can be attained.   5:4 Gain reduction  alog  0:537 (6:108) 20 Classical design in the frequency domain 185 Hence the lead compensator transfer function is G(s)  0:537(1  s) (1  0:25s) (6:109) The open-loop frequency response contours for the compensator given in equation (6.109) are curves (b) in Figures 6.34 and 6.35 which produce Gain margin  7 dB Phase margin  15 Modulus crossover frequency  2 rad/s 60 40 Gain (dB) (a) (b) 20 5.4 dB Un-compensated 0 –20 –40 10 –1 10 0 1 10 2 Frequency (rad/s) (a) Bode Gain –150 (a) and (b) Phase (degrees) –180 –200 Un-compensated –250 10–1 0 2 10 Frequency (rad/s) (b) Bode Gain Fig. 6.35                  10 1 186 Advanced control engineering 20 10 11.6 dB 0 –3 C (j ω) R dB –10 –20 –30 –1 10 Fig. 6.36 "  0 3.4 10 Frequency (rad/s)              1 10  Figure 6.36 shows the closed-loop frequency response using lead compensator one and defined by equation (6.109) (modulus only). From Figure 6.36 Peak modulus Mp  11:6 dB Bandwidth  3:4 rad/s This design does not meet the performance specification. Lead compensator design two From Figure 6.34 it can be seen that to achieve the desired phase margin of at least 30 then the compensator must provide in the order of an additional 20 of phase advance, i.e. 57 in total, at the modulus crossover frequency. From Figure 6.32, this suggests four octaves between the corner frequencies. Let 1=T1 remain at 1 rad/s and Position 1=T2 at 16 rad/s (4 octaves higher). This provides m  61:98 !m  4 rad/s The design two compensator is therefore G(s)  (1  s) (1  0:0625s) (6:110) The open-loop Bode gain and phase with the lead compensator given in equation (6.110) inserted in the control loop is shown in Figure 6.37. From Figure 6.37 curve (i) Classical design in the frequency domain 187 it can be seen that the modulus crossover frequency is 3.37 rad/s, and the phase margin is (180  152:4), or 27.6 . This is close to, but does not quite achieve the specification. However, from Figure 6.37, the maximum phase advance of 145:3 occurs at 1.9 rad/s. At this frequency, the open-loop gain K is 6.8 dB. Therefore, if the open-loop gain is reduced by this amount as shown in Figure 6.37, curve (ii) then the modulus crossover frequency becomes 1.9 rad/s and the phase margin is (180 ± 145.3), or 34.7 , which is within specification. The compensator gain K1 therefore becomes   6:8 K1  alog  0:457 (6:111) 20 60 40 Gain (dB) (i) 20 6.8 dB 0 (ii) –20 –40 –1 10 0 1.9 10 Frequency (rad/s) (a) Bode Gain 3.37 1 10 –140 (i) and (ii) –145.3 Phase (degrees) –150 –152.4 –160 –170 –180 –190 –200 –1 10 Fig. 6.37 1   0 10 1.9 Frequency (rad/s) (b) Bode Phase 3.37 #                 1 10 188 Advanced control engineering 30 0.25 dB 25 0.5 dB 20 1 dB Open-Loop Gain (dB) 15 3 dB 10 6 dB 5 (a) (b) –3 dB 0 ω = 3.43 –5 –10 –15 ω = 5.09 –20 –240 –220 –200 –180 –160 –140 –120 –100 –80 –60 Open-Loop Phase (deg) Fig. 6.38 !                Figure 6.38, curve (a) shows the Nichols chart for the value of K1 given in equation (6.111). It can be seen that Mp  5 dB, but the bandwidth is 3.43 rad/s, which is outside of specification. However, because of the shape of the locus, it is possible to reduce the gain margin (18.6 dB in curve (a)) which will increase the bandwidth, but not significantly change the peak modulus, or the phase margin. Figure 6.38, curve (b) shows the open-loop gain K increased by 4.85 dB. This now has a peak modulus of 5.5 dB, a phase margin of 30.6 and a bandwidth of 5.09 rad/s, all of which are within specification. The new compensator gain K1 is therefore   4:85 K1  0:457  alog 20  0:457  1:748  0:8 (6:112) The final lead compensator is G(s)  0:8(1  s) (1  0:0625s) (6:113) Classical design in the frequency domain 189 20 C (j ω) R Lead compensator two 10 Lead compensator one (dB) 0 –3 –10 –20 –30 –1 10 0 10 3.4 5.09 1 10 Frequency (rad/s) Fig. 6.39 "         #           System frequency domain performance Closed-loop peak Mp  5:5 dB Gain margin  13:75 dB Bandwidth  5:09 rad/s Phase margin  30:68 Figure 6.39 shows, for both lead compensator designs, the closed-loop frequency response characteristics for the system. 6.6.2 Phase lag compensation Using passive components, a phase lag compensator may be constructed, whose transfer function is of the form (1  Ts) (6:114) G(s)  (1  Ts) where is a number greater than unity. Passive lag networks suffer the same disadvantages of passive lead networks as discussed earlier. The active network shown in Figure 6.30 has the transfer function given in equation (6.99) K1 (1  T1 s) G(s)  (6:115) (1  T2 s) 190 Advanced control engineering K dB –6 dB/octave Gain dB –5 –10 –15 –20 –1 10 2 1 T2 Frequency (rad/s) 1 T1 10 1 T2 Frequency (rad/s) 1 T1 10 0 Phase (degrees) –10 –20 –30 –40 –50 φm –60 –1 10 Fig. 6.40     2             When T2 is greater than T1 equation (6.115) is an active lag network, whose Bode diagram is shown in Figure 6.40. The relationships between T1 , T2 , !m and m are as given in equations (6.104) and (6.105), except, in this case, m is negative. The same comment applies to Figure 6.32 which shows the relationship between the spacing of reciprocals of T2 and T1 and m . Design procedure for lag compensation 1. Set K to a suitable value so that any steady-state error criteria are met. 2. Identify what modulus attenuation is required to provide an acceptable phase margin and hence determine the spacing between 1/T2 and 1/T1 (i.e. 6 dB attenuation requires a one octave spacing, 12 dB attenuation needs a two octave spacing, etc.). 3. Position 1/T1 one decade below the compensated modulus crossover frequency, and hence calculate !m using equation (6.104). 4. Adjust compensator gain K1 if necessary. Classical design in the frequency domain 191 Case study Example 6.7 A process plant has an open-loop transfer function G(s)H(s)  30 (1  0:5s)(1  s)(1  10s) (6:116) As it stands, when the loop is closed, the system is on the verge of instability, with a GM of 1.4 dB, a PM of 4 and a modulus crossover frequency of 1.4 rad/s. Reducing the open-loop gain K by 12 dB (i:e: K  7:5) provides an acceptable GM of 13.5 dB, PM of 52 with a modulus crossover frequency of 0.6 rad/s. However, this gain setting produces an unacceptable step steady-state error of 12%. Design a lag compensator that maintains the open-loop gain K at 30, but provides gain and phase margins, similar to setting K at 7.5. What is now the steady-state step error? Solution Required modulus attenuation is 12 dB. This reduces the modulus crossover frequency from 1.4 to 0.6 rad/s. Position 1/T1 one decade below 0.6 rad/s i.e. 0.06 rad/s. For a 12 dB attenuation, two octaves are required in the compensator, thus 1/T2 is positioned at 0.015 rad/s. From equation (6.104) !m is 0.03 rad/s, and from equation (6.105) (using a negative value), m  36:98. Hence the required lag compensator is G(s)  K1 (1  16:67s) (1  66:67s) (6:117) The compensated and uncompensated open-loop frequency response is shown in Figure 6.41. From this Figure the compensated gain margin is 12.5 dB, and the phase margin is 48 . In equation (6.117), K1 does not need to be adjusted, and can be set to unity. When responding to a step input, the steady-state error is now 4.6%. 6.7 Relationship between frequency response and time response for closed-loop systems There are a few obvious relationships between the frequency response and time response of closed-loop systems: (i) As bandwidth increases, the time response will be more rapid, i.e. the settling time will decrease. (ii) The larger the closed-loop peak Mp , the more oscillatory will be the time response. 192 Advanced control engineering 40 12 dB 20 Un-compensated Gain (dB) 0 Compensated –20 –40 –60 –1 0 10 1 T1 1 T2 10 10 1 Frequency (rad/s) 0 Un-compensated 36.9° Phase (degrees) –50 –100 Compensated –150 –200 –250 –300 1 T2 1 T1 ωm Fig. 6.41 2       –1 10 0 Frequency (rad/s)       10 1 10 #      +  &3 Since many closed-loop systems approximate to second-order systems, a few interesting observations can be made. For the case when the frequency domain specification has limited the value of Mp to 3 dB for a second-order system, then from equation (6.72)   0:38 !p  0:84!n !B  1:4!n (frequency that Mp occurs) (bandwidth) (6:118) Classical design in the frequency domain 193 Equation (3.73) gives the time for a second-order system to settle down to within a tolerance band of 2%   1 ts  ln 50 !n or ts  3:912 !n (6:119) Inserting the values in equation (6.118) into equation (6.119) gives ts  10:29 14:4  !n !B (6:120) Thus the settling time is inversely proportional to the bandwidth. Comparing equation (6.70) with equation (3.68) gives % overshoot  e2 2 Mp  100 (6:121) Hence a closed-loop system with an undamped natural frequency of 1.0 rad/s and a damping ratio of 0.38 has the following performance: . Frequency domain Mp (equation (6:70))  1:422  3:06 dB !B (equation (6:72))  1:4 rad/s: . Time domain ts (equation (6:120))  10:29 seconds % overshoot (equation (6:121))  27:5% 6.8 Further problems Example 6.8 A spring±mass±damper system has a mass of 20 kg, a spring of stiffness 8000 N/m and a damper with a damping coefficient of 80 Ns/m. The system is excited by a constant amplitude harmonic forcing function of the form F(t)  160 sin !t (a) Determine the system transfer function relating F(t) and x(t) and calculate values for !n and . (b) What are the amplitudes of vibration when ! has values of 1.0, 20 and 50 rad/s. (c) Find the value of the damping coefficient to give critical damping and hence, with this value, determine again the amplitudes of vibration for the angular frequencies specified in (b). Solution (a) !n  20 rad/s,   0:1 (b) 0.02 m, 0.1 m and 0.0038 m (c) C  800 Ns/m 0:02 m, 0:01 m and 0:0028 m 194 Advanced control engineering Example 6.9 Construct, using asymptotes and standard second-order phase diagrams, the Bode diagrams for (i) G(s)  12 (1  2s) 2 (0:0025s2  0:01s  1)   1  2s (iii) G(s)  4 1  0:5s (ii) G(s)  (iv) G(s)H(s)  0:5 s(s2  0:5s  1) When the loop is closed, will the system in (iv) be stable or unstable? Solution The system will have marginal stability. Example 6.10 A control system has an open-loop transfer function G(s)H(s)  K s(0:25s2  0:25s  1) Set K  1 and plot the Nyquist diagram by calculating values of open-loop modulus and phase for angular frequency values from 0.8 to 3.0 rad/s in increments of 0.2 rad/s. Hence find the value of K to give a gain margin of 2 (6 dB). What is the phase margin at this value of K? Solution K  0:5, Phase margin  82 Example 6.11 An open-loop frequency response test on an unknown system produced the following results: ! (rad/s) G( j!)H( j!) (dB) 0.2 28 0.4 22 0.8 16 1.6 3.0 4.0 4.6 5 6 10.7 7.5 7.3 7.0 6.0 0.9 8 10 20 40 9.3 28 36 54 G( j!)H( j!) (deg) 91 92 95 100 115 138 162 180 217 244 259 262 266 Plot the Bode diagram on log-linear paper and determine (a) The open-loop transfer function. (b) The open-loop gain constant K to give a gain margin of 4.4 dB. What is the phase margin for this value of K? (c) The closed-loop transfer function (unity feedback) for the value of K found in (b). (d) The closed-loop peak modulus Mp and bandwidth. Classical design in the frequency domain 195  6.5 Open-loop frequency response data ! (rad/s) 0.1 0.3 0.7 1.0 1.5 2.0 3.0 5.0 10.0 G(j!)H(j!) (dB) G(j!)H(j!) (deg) 17 92 7 98 0.5 112 2 123 5 150 9 180 18.5 220 33 224 51 258 Solution (a) G(s)H(s)  s(0:04s2 5:0  0:1s  1) (b) K  1:5, Phase margin  79 (c) C 37:5 (s)  3 R s  2:5s2  25s  37:5 (d) Mp  4:6 dB, !B  5:6 rad/s. Example 6.12 (a) An open-loop frequency response test on a unity feedback control system produced the data given in Table 6.5. Plot the Bode Diagram and determine the system open-loop and closed-loop transfer functions. What are the phase and gain margins? (b) A phase lead compensation network of the form G(s)  1 (1  Ts) (1  Ts) is to be introduced in the forward path. The maximum phase advance m is to be 37 and is to occur at !m  2 rad/s. Determine the expression for the phase angle  and hence prove that m and !m are as given below. Find from these expressions the values of and T and calculate values for  when !  1, 1:5, 2, 3 and 5 rad/s. Plot the compensator frequency response characteristics. m  tan1 !m  T  2 1  1   (c) Produce a table using the frequencies specified in part (a) for the compete openloop frequency response including the compensation network and an amplifier to make up the insertion loss of 1/ . Plot these results on a Nichols chart and determine (i) Maximum closed-loop peak modulus, Mp (ii) Bandwidth (to 3 dB point) 196 Advanced control engineering Solution (a) G(s)H(s)  0:7 s(0:25s2  0:5s  1) C 1 (s)  R 0:356s3  0:714s2  1:429s  1 Phase margin  66 and Gain margin  9 dB 1 (1  s) (b) G(s)  4 (1  0:25s) (c) Mp  1 dB and Bandwidth  2:7 rad/s Example 6.13 (a) A unity feedback control system has an open-loop transfer function G(s)H(s)  1 s(1  s)(1  0:5s) Construct, using asymptotes, the Bode diagram and read off values of open-loop modulus and phase for the following frequencies ! (rad/s)  0:1, 0.5, 1.0, 1.4, 2.0, 4.0, 6.0 and 10.0 You may assume that at frequencies of 1.0 and 2.0 rad/s the open-loop phase angles are 162 and 198 respectively. Plot the results between 0.1 and 2.0 rad/s on a Nichols Chart and determine (i) the phase and gain margins (ii) the maximum closed-loop modulus Mp (iii) the bandwidth to the 3 dB point (b) The performance specification calls for a maximum closed-loop modulus of 1 dB and a bandwidth of at least 1.8 rad/s. In order to achieve this, the following active lead compensation element is placed in the forward path G(s)  K1 (1  T1 s) (1  T2 s) Show that the phase advance  is given by   tan 1  !(T1  T2 ) 1  T1 T2 !2  The frequency of maximum phase advance is to occur at the frequency that corresponds to 180 on the Bode diagram constructed in section (a). The lower break frequency 1/T1 is to be half this value and the upper break frequency 1/T2 is to be twice this value. Evaluate T1 and T2 and calculate values of  for the frequencies specified in section (a). Construct the Bode diagram for the compensation element for the condition K1  1, and read off values of modulus at the same frequencies as the calculated phase values. Classical design in the frequency domain 197 (c) Using the tables of modulus and phase for the plant and compensator found in sections (a) and (b), determine values for the new overall open-loop modulus and phase when the compensator is inserted in the forward path. Plot these results on a Nichols Chart and adjust the compensator gain K1 so that the system achieves the required performance specification. What are now the values of (i) (ii) (iii) (iv) the phase and gain margins the maximum closed-loop modulus, Mp the bandwidth the compensator gain constant K1 Solution (a) (i) Phase margin  32 and Gain margin  9:6 dB (ii) Mp  5 dB (iii) Bandwidth  1:3 rad/s (b) G(s)  (c) K1 (1  1:429s) (1  0:357s) (i) Phase margin  47 and Gain margin  13:5 dB (ii) Mp  1 dB (iii) Bandwidth  1:85 rad/s (iv) K1  0:861 7 Digital control system design 7.1 Microprocessor control As a result of developments in microprocessor technology, the implementation of control algorithms is now invariably through the use of embedded microcontrollers rather than employing analogue devices. A typical system using microprocessor control is shown in Figure 7.1. In Figure 7.1 . RAM is Random Access Memory and is used for general purpose working space during computation and data transfer. . ROM, PROM, EPROM is Read Only Memory, Programmable Read Only Mem- ory and Erasable Programmable Read Only Memory and are used for rapid sources of information that seldom, or never need to be modified. . A/D Converter converts analogue signals from sensors into digital form at a given sampling period T seconds and given resolution (8 bits, 16 bits, 24 bits, etc.) . D/A Converter converts digital signals into analogue signals suitable for driving actuators and other devices. The elements of a microprocessor controller (microcontroller) are shown in Figure 7.2. Figure 7.2 shows a Central Processing Unit (CPU) which consists of . the Arithmetic Logic Unit (ALU) which performs arithmetic and logical oper- ations on the data and a number of registers, typically . . . . Program Counter ± incremented each time an instruction is executed Accumulator(s) ± can undertake arithmetic operations Instruction register ± holds current instruction Data address register ± holds memory address of data Control algorithms are implemented in either high level or low level language. The lowest level of code is executable machine code, which is a sequence of binary words that is understood by the CPU. A higher level of language is an assembler, which employs meaningful mnemonics and names for data addresses. Programs written in assembler are rapid in execution. At a higher level still are languages Digital control system design 199 Microprocessor System RAM Memory ROM PROM EPROM Memory r (kT ) c (kT ) A/D Converter u (kT ) Microprocessor Controller D/A Converter c (t ) u (t ) Plant · Sensor Fig. 7.1       program counter RAM address bus accumulator(s) ALU instruction register data bus ROM PROM EPROM data address register CPU clock Fig. 7.2         such as C and C‡‡, which are rapidly becoming industry standard for control software. The advantages of microprocessor control are . Versatility ± programs may easily be changed . Sophistication ± advanced control laws can be implemented. 200 Advanced Control Engineering The disadvantages of microprocessor control are . Works in discrete time ± only snap-shots of the system output through the A/D converter are available. Hence, to ensure that all relevant data is available, the frequency of sampling is very important. 7.2 Shannon's sampling theorem Shannon's sampling theorem states that `A function f (t) that has a bandwidth b is uniquely determined by a discrete set of sample values provided that the sampling frequency is greater than 2b '. The sampling frequency 2b is called the Nyquist frequency. It is rare in practise to work near to the limit given by Shannon's theorem. A useful rule of thumb is to sample the signal at about ten times higher than the highest frequency thought to be present. If a signal is sampled below Shannon's limit, then a lower frequency signal, called an alias may be constructed as shown in Figure 7.3. To ensure that aliasing does not take place, it is common practice to place an antialiasing filter before the A/D converter. This is an analogue low-pass filter with a break-frequency of 05s where s is the sampling frequency (s  10b ). The higher s is in comparison to b , the more closely the digital system resembles an analogue one and as a result, the more applicable are the design methods described in Chapters 5 and 6. 1.5 Original Signal f (t ) Alias 1 0.5 t 0 0 0.1 0.2 0.3 0.4 –0.5 –1 –1.5 Fig. 7.3               0.5 0.6 0.7 0.8 0.9 1 Digital control system design 201 7.3 Ideal sampling An ideal sample f  (t) of a continuous signal f (t) is a series of zero width impulses spaced at sampling time T seconds apart as shown in Figure 7.4. The sampled signal is represented by equation (7.1). f  (t) ˆ 1  f (kT)(t (71) kT) kˆ 1 where (t kT) is the unit impulse function occurring at t ˆ kT. A sampler (i.e. an A/D converter) is represented by a switch symbol as shown in Figure 7.5. It is possible to reconstruct f (t) approximately from f  (t) by the use of a hold device, the most common of which is the zero-order hold (D/A converter) as shown in Figure 7.6. From Figure 7.6 it can be seen that a zero-order hold converts a series of impulses into a series of pulses of width T. Hence a unit impulse at time t is converted into a pulse of width T, which may be created by a positive unit step at time t, followed by a negative unit step at time (t T), i.e. delayed by T. The transfer function for a zero-order hold is l[ f (t)] ˆ Gh (s) ˆ f (t ) 1 s 1 e s 1 e s Ts (72) Ts f*(t) T t 0 (a) Continuous Signal T 2T 3T 4T f (t) f *(t ) T f (kT ) 5T 6T . .. .. kT (b) Sampled Signal Fig. 7.4       Fig. 7.5     f (6T ) t 202 Advanced Control Engineering f * (t ) f(t) T T t t (a) Discrete Time Signal Fig. 7.6      7.4     (b) Continous Time Signal      The z-transform The z-transform is the principal analytical tool for single-input±single-output discrete-time systems, and is analogous to the Laplace transform for continuous systems. Conceptually, the symbol z can be associated with discrete time shifting in a difference equation in the same way that s can be associated with differentiation in a differential equation. Taking Laplace transforms of equation (7.1), which is the ideal sampled signal, gives 1  F  (s) ˆ l[ f  (t)] ˆ f (kT)e kTs (73) kˆ0 or 1  F  (s) ˆ kˆ0 Define z as   f (kT) esT k (74) z ˆ esT (75) then F(z) ˆ 1  f (kT)z k ˆ Z[ f (t)] (76) kˆ0 In `long-hand' form equation (7.6) is written as F(z) ˆ f (0) ‡ f (T)z 1 ‡ f (2T)z 2 ‡    ‡ f (kT)z Example 7.1 Find the z-transform of the unit step function f (t) ˆ 1. k (77) Digital control system design 203 f *(t ) 1.0 0 Fig. 7.7 z    T 2T 3T t 4T            Solution From equations (7.6) and (7.7) Z[1(t)] ˆ 1  1(kT)z k (78) kˆ0 or F(z) ˆ 1 ‡ z 1 ‡z 2 ‡ ... ‡ z k (79) Figure 7.7 shows a graphical representation of equation (7.9). Equation (7.9) can be written in `closed form' as Z[1(t)] ˆ z 1 z ˆ 1 1 z 1 (710) Equations (7.9) and (7.10) can be shown to be the same by long division z 1 ‡ z 1 z 0 z 1 ‡z 0 2 ‡  1 0‡1 z 1 0‡z 1 z 1 1 z 2 (711) Table 7.1 gives Laplace and z-transforms of common functions. z-transform Theorems: (a) Linearity Z[ f1 (t)  f2 (t)] ˆ F1 (z)  F2 (z) (712) 204 Advanced Control Engineering   Common Laplace and z-transforms 1 f (t) or f (kT) F(s) F(z) (t) 1 1 kTs k 2 (t 3 1(t) 1 s z 1 4 t 1 s2 (z Tz 1)2 5 e 1 (s ‡ a) z z e 6 1 a s(s ‡ a) (z 7 1 (at a 8 sin t  s2 ‡ 2 z2 z sin T 2z cos T ‡ 1 9 cos t s s2 ‡ 2 z2 z(z cos T) 2z cos T ‡ 1 sin t  (s ‡ a)2 ‡ 2 z2 ze aT sin T 2ze aT cos T ‡ e cos t (s ‡ a) (s ‡ a)2 ‡ 2 z2 z2 ze aT cos T 2ze aT cos T ‡ e e kT) at e 10 e at 11 e at at 1‡e at ) z z a s2 (s ‡ a) aT z(1 e aT ) 1)(z e aT ) zf(aT 1 ‡ e aT )z ‡ (1 e aT a(z 1)2 (z e aT ) aTe aT )g 2aT 2aT (b) Initial Value Theorem f (0) ˆ lim F(z) z!1 (713) (c) Final Value Theorem f (1) ˆ lim z!1 7.4.1  z 1 z   F(z) Inverse transformation The discrete time response can be found using a number of methods. (a) Infinite power series method Example 7.2 A sampled-data system has a transfer function 1 G(s) ˆ s‡1 (714) Digital control system design 205 If the sampling time is one second and the system is subject to a unit step input function, determine the discrete time response. (N.B. normally, a zero-order hold would be included, but, in the interest of simplicity, has been omitted.) Now Xo (z) ˆ G(z)Xi (z) (715) from Table 7.1 z z e Xo (z) ˆ T for T ˆ 1 second Xo (z) ˆ ˆ z z2  z  z 1 (716)  z  z 0368 z 1 z2 1368z ‡ 0368 (717) By long division z 1 ‡ 1368z  1368z ‡ 0368 z2 0 2 z2 1 ‡ 1503z 0 2 ‡  0 1368z ‡ 0368 0 ‡ 1368z 1368z 0368 1871 ‡ 0503z 0 ‡ 1503 1503 1 1 0503z 2056z 1 ‡ 0553z 2 (718) Thus xo (0) ˆ 1 xo (1) ˆ 1368 xo (2) ˆ 1503         Consider a system of the form Xo b0 ‡ b1 z 1 ‡ b2 z 2 ‡    (z) ˆ 1 ‡ a1 z 1 ‡ a2 z 2 ‡    Xi (719) Thus (1 ‡ a1 z 1 ‡ a2 z 2 ‡    )Xo (z) ˆ (b0 ‡ b1 z 1 ‡ b2 z 2 ‡    )Xi (z) (720) or Xo (z) ˆ ( a1 z 1 a2 z 2    )Xo (z) ‡ (b0 ‡ b1 z 1 ‡ b2 z 2 ‡    )Xi (z) (721) Equation (7.21) can be expressed as a difference equation of the form xo (kT) ˆ a1 xo (k 1)T a2 xo (k ‡ b0 xi (kT) ‡ b1 xi (k 2)T  1)T ‡ b2 xi (k 2)T ‡    (722) 206 Advanced Control Engineering In Example 7.2 Xo 1 (s) ˆ 1‡s Xi z ˆ z e T ˆ z z 0368 (723) Equation (7.23) can be written as Xo (z) ˆ 1 Xi 1 0368z (724) 1 Equation (7.24) is in the same form as equation (7.19). Hence (1 0368z 1 )Xo (z) ˆ Xi (z) or Xo (z) ˆ 0368z 1 Xo (z) ‡ Xi (z) (725) Equation (7.25) can be expressed as a difference equation xo (kT) ˆ 0368xo (k 1)T ‡ xi (kT ) (726) Assume that xo ( 1) ˆ 0 and xi (kT) ˆ 1, then from equation (7.26) xo (0) ˆ 0 ‡ 1 ˆ 1, kˆ0 xo (1) ˆ (0368  1) ‡ 1 ˆ 1368, k ˆ 1 xo (2) ˆ (0368  1368) ‡ 1 ˆ 1503, k ˆ 2 etc These results are the same as with the power series method, but difference equations are more suited to digital computation. 7.4.2 The pulse transfer function Consider the block diagrams shown in Figure 7.8. In Figure 78(a) U  (s) is a sampled input to G(s) which gives a continuous output Xo (s), which when sampled by a U(s) U *(s) G(s) T Xo(s) X o*(s) T (a) U(z) G(z) (b) Fig. 7.8      Gs  G Xo(z) Digital control system design 207 U(s) U *(s) X(s) G1(s) X *(s) Xo(s) X o*(s) G2(s) T T T (a) U(s) U *(s) X(s) G1(s) G2(s) Xo(s) X o*(s) T T (b) Fig. 7.9        synchronized sampler becomes Xo (s). Figure 7.8(b) shows the pulse transfer function where U(z) is equivalent to U  (s) and Xo (z) is equivalent to Xo (s). From Figure 7.8(b) the pulse transfer function is Xo (z) ˆ G(z) U (727) Blocks in Cascade: In Figure 7.9(a) there are synchronized samplers either side of blocks G1 (s) and G2 (s). The pulse transfer function is therefore Xo (z) ˆ G1 (z)G2 (z) U (728) In Figure 7.9(b) there is no sampler between G1 (s) and G2 (s) so they can be combined to give G1 (s)G2 (s), or G1 G2 (s). Hence the output Xo (z) is given by Xo (z) ˆ ZfG1 G2 (s)gU(z) (729) and the pulse transfer function is Xo (z) ˆ G1 G2 (z) U (730) Note that G1 (z)G2 (z) 6ˆ G1 G2 (z). Example 7.3 (See also Appendix 1, examp73.m) A first-order sampled-data system is shown in Figure 7.10. Find the pulse transfer function and hence calculate the response to a unit step and unit ramp. T ˆ 05 seconds. Compare the results with the continuous system response xo (t). The system is of the type shown in Figure 7.9(b) and therefore G(s) ˆ G1 G2 (s) Inserting values G(s) ˆ (1 e Ts ) 1 s(s ‡ 1) (731) 208 Advanced Control Engineering Xi(S) –Ts 1 s+1 1–e S Xo(S) T Fig. 7.10 !     "  Taking z-transforms using Table 7.1. G(z) ˆ (1 z 1) z(1 e T ) (z 1)(z e T ) (732)  z(1 e T ) (z 1)(z e T ) (733) or G(z) ˆ  1 z z which gives G(z) ˆ  1 z e e T T  (734) For T ˆ 05 seconds G(z) ˆ  0393 z 0607  (735) hence Xo (z) ˆ Xi  0393z 1 1 0607z 1  (736) which is converted into a difference equation xo (kT ) ˆ 0607xo (k 1)T ‡ 0393xi (k 1)T (737) Table 7.2 shows the discrete response xo (kT) to a unit step function and is compared with the continuous response (equation 3.29) where xo (t) ˆ (1 e t) (738) From Table 7.2, it can be seen that the discrete and continuous step response is identical. Table 7.3 shows the discrete response x(kT ) and continuous response x(t) to a unit ramp function where xo (t) is calculated from equation (3.39) xo (t) ˆ t 1‡e t (739) In Table 7.3 the difference between xo (kT) and xo (t) is due to the sample and hold. It should also be noted that with the discrete response x(kT), there is only knowledge of the output at the sampling instant. Digital control system design 209   kT (seconds) k 1 0 1 2 3 4 5 6 7 8 0.5 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0   1 0 1 2 3 4 5 6 7 8 xi (kT) xo (kT) xo (t) 0 1 1 1 1 1 1 1 1 1 0 0 0.393 0.632 0.776 0.864 0.918 0.950 0.970 0.982 0 0 0.393 0.632 0.776 0.864 0.918 0.950 0.970 0.982 Comparison between discrete and continuous ramp response kT (seconds) k 7.4.3 Comparison between discrete and continuous step response 0.5 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 xi (kT) xo (kT) xo (t) 0 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 0 0 0 0.304 0.577 0.940 1.357 1.805 2.275 2.757 0 0 0.107 0.368 0.723 1.135 1.582 2.050 2.530 3.018 The closed-loop pulse transfer function Consider the error sampled system shown in Figure 7.11. Since there is no sampler between G(s) and H(s) in the closed-loop system shown in Figure 7.11, it is a similar arrangement to that shown in Figure 7.9(b). From equation (4.4), the closed-loop pulse transfer function can be written as C G(z) (z) ˆ R 1 ‡ GH(z) (740) GH(z) ˆ ZfGH(s)g (741) In equation (7.40) R(s) + E*(s) E(s) G(s) T H(s) Fig. 7.11        "  C (s ) 210 Advanced Control Engineering + R(s) E *(s) E(s) – C *(s) C(s) G(s) T T H(s) Fig. 7.12           "  Consider the error and output sampled system shown in Figure 7.12. In Figure 7.12, there is now a sampler between G(s) and H(s), which is similar to Figure 7.9(a). From equation (4.4), the closed-loop pulse transfer function is now written as C G(z) (z) ˆ R 1 ‡ G(z)H(z) 7.5 (742) Digital control systems From Figure 7.1, a digital control system may be represented by the block diagram shown in Figure 7.13. Example 7.4 (See also Appendix 1, examp74.m) Figure 7.14 shows a digital control system. When the controller gain K is unity and the sampling time is 0.5 seconds, determine (a) (b) (c) (d) (e) the open-loop pulse transfer function the closed-loop pulse transfer function the difference equation for the discrete time response a sketch of the unit step response assuming zero initial conditions the steady-state value of the system output r (t ) + – e*(t ) e(t ) T Digital Controller u *( t ) microprocessor Sensor Fig. 7.13 #   "  Zero Order Hold u(t ) Plant C(t ) Digital control system design 211 R(s) + – 1–e s K –Ts 1 s(s + 2) C(s) T = 0.5 Fig. 7.14 #   "   $   %& Solution (a) G(s) ˆ K  1 e s Ts  1 s(s ‡ 2) (743) Given K ˆ 1 Partial fraction expansion  G(s) ˆ 1 e 1 ‡ 2) (744) 1 ˆ s2 (s ‡ 2) A B C ‡ ‡ s s2 (s ‡ 2) (745) Ts  s2 (s or 1 ˆ s(s ‡ 2)A ‡ (s ‡ 2)B ‡ s2 C (746) Equating coefficients gives Aˆ 025 B ˆ 05 C ˆ 025 Substituting these values into equation (7.44) and (7.45)  G(s) ˆ 1 or Taking z-transforms Ts e  G(s) ˆ 025 1  G(z) ˆ 025 1 G(z) ˆ 025  z z e z 1 1  Given T ˆ 05 seconds   z Ts 025 05 025 ‡ 2 ‡ s s (s ‡ 2) (747) 1 2 1 ‡ 2‡ s s (s ‡ 2) (748)  z 2Tz ‡ ‡ (z 1) (z 1)2 (z (z 1 2  05 ‡ ‡ 1) (z 1)2 (z z e 2T ) 1 0368) (749) (750) 212 Advanced Control Engineering Hence G(z) ˆ 025(z G(z) ˆ 025 1(z 1) 1)(z z2 ‡ 1368z 0368) ‡ (z 0368) ‡ (z (z 1)2 (z 0368) 0368 ‡ z 0368 ‡ z2 (z 1)(z 0368) 1)2 2z ‡ 1 which simplifies to give the open-loop pulse transfer function   0092z ‡ 0066 G(z) ˆ 2 z 1368z ‡ 0368 (751) (752) (753) Note: This result could also have been obtained at equation (7.44) by using z-transform number 7 in Table 7.1, but the solution demonstrates the use of partial fractions. (b) The closed-loop pulse transfer function, from equation (7.40) is  0092z‡0066 C z2 1368z‡0368  (z) ˆ R 1 ‡ 20092z‡0066 z (754) 1368z‡0368 which simplifies to give the closed-loop pulse transfer function C 0092z ‡ 0066 (z) ˆ 2 R z 1276z ‡ 0434 (755) or C 0092z 1 ‡ 0066z 2 (z) ˆ R 1 1276z 1 ‡ 0434z (756) 2 (c) Equation (7.56) can be expressed as a difference equation c(kT) ˆ 1276c(k 1)T 0434c(k 2)T ‡ 0092r(k 1)T ‡ 0066r(k 2)T (757) (d) Using the difference equation (7.57), and assuming zero initial conditions, the unit step response is shown in Figure 7.15. Note that the response in Figure 7.15 is constructed solely from the knowledge of the two previous sampled outputs and the two previous sampled inputs. (e) Using the final value theorem given in equation (7.14)    z 1 C c(1) ˆ lim (z)R(z) z!1 z R c(1) ˆ lim z!1  1 z z  0092z ‡ 0066 1 1276z ‡ 0434 (758)  z  z 1 (759) Digital control system design 213 c(kT ) 1.2 1 0.8 0.6 0.4 0.2 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 kT Fig. 7.15 '       $   %& c(1) ˆ  0092 ‡ 0066 1 1276 ‡ 0434  ˆ 10 (760) Hence there is no steady-state error. 7.6 7.6.1 Stability in the z-plane Mapping from the s-plane into the z-plane Just as transient analysis of continuous systems may be undertaken in the s-plane, stability and transient analysis on discrete systems may be conducted in the z-plane. It is possible to map from the s to the z-plane using the relationship z ˆ esT (761) now s ˆ   j therefore z ˆ e(j)T ˆ eT e jT (using the positive j value) (762) 214 Advanced Control Engineering Im P (z) σT Z= e ∠Z = ωT = 2πω/ωs Re Fig. 7.16      s     If eT ˆ jzj and T ˆ 2/s equation (7.62) can be written z ˆ jzje j 2s † (763) where s is the sampling frequency. Equation (7.63) results in a polar diagram in the z-plane as shown in Figure 7.16. Figure 7.17 shows mapping of lines of constant  (i.e. constant settling time) from the s to the z-plane. From Figure 7.17 it can be seen that the left-hand side (stable) of the s-plane corresponds to a region within a circle of unity radius (the unit circle) in the zplane. Figure 7.18 shows mapping of lines of constant  (i.e. constant transient frequency) from the s to the z-plane. ωs Im ω = 4 ωs jω 2 (a) (b) (c) (c) (b) (a) ω = ωs –σ σ=0 +σ σ 4 s-plane stable region z-plane   s    ω=0 Re ω = – ωs –ωs 2 Fig. 7.17      r=1 2 –ωs ω= 2 Digital control system design 215 jω 3ωs 8 Im 3ωs 8 ωs 8 3π 4 ωs π 4 r =1 8 σ s-plane Fig. 7.18      Re z-plane   s    jω Im x 8 x ω 9 22 x 10 x 5 x ω 6 s 8 x 7 x 1 x 2 x 3 x 4 7 x 6 x x 5 x 10 σ x 9 x 8 5 x 5 x 6 x 7 x 8 x 9 x 10 x 2 x 3 x 4 Re x´ 6 x 7 s-plane Fig. 7.19            s x 1 x z-plane    Figure 7.19 shows corresponding pole locations on both the s-plane and z-plane. 7.6.2 The Jury stability test In the same way that the Routh±Hurwitz criterion offers a simple method of determining the stability of continuous systems, the Jury (1958) stability test is employed in a similar manner to assess the stability of discrete systems. Consider the characteristic equation of a sampled-data system Q(z) ˆ an zn ‡ an 1 zn 1 ‡    ‡ a1 z ‡ a0 ˆ 0 (764) 216 Advanced Control Engineering Jury's array   0 1 z z a0 an b0 bn 1    l0 l3 m0 m2 a1 an b1 bn z2 1 2 l1 l2 m1 m1 a2 an b2 bn zn 2 3 l2 l1 m2 m0 ... ... ... ... an a1 bn b0 ... ... l3 l0 1 1 zn an a0 1 The array for the Jury stability test is given in Table 7.4 where k ˆ a0 an ck ˆ b0 bn 1 bn c0 cn dk ˆ cn an k ak 2 1 k bk (765) 2 k ck The necessary and sufficient conditions for the polynomial Q(z) to have no roots outside or on the unit circle are Condition 1 Q(1)  0 Condition 2 ( 1)n Q( 1)  0 Condition 3    ja0 j  an jb0 j  jbn 1 j Condition n jm0 j  jm2 j jc0 j  jcn 2 j    (766) Example 7.5 (See also Appendix 1, examp75.m) For the system given in Figure 7.14 (i.e. Example 7.4) find the value of the digital compensator gain K to make the system just unstable. For Example 7.4, the characteristic equation is 1 ‡ G(z) ˆ 0 (767) In Example 7.4, the solution was found assuming that K ˆ 1. Therefore, using equation (7.53), the characteristic equation is 1‡ K(0092z ‡ 0066) ˆ0 (z2 1368z ‡ 0368) (768) Digital control system design 217 or Q(z) ˆ z2 ‡ (0092K 1368)z ‡ (0368 ‡ 0066K) ˆ 0 (769) The first row of Jury's array is j z0 (0368 ‡ 0066K) z1 (0092K 1368) z2 1 (770) Condition 1: Q(1)  0 From equation (7.69) Q(1) ˆ f1 ‡ (0092K 1368) ‡ (0368 ‡ 0066K)g  0 (771) From equation (7.71), Q(1)  0 if K  0. Condition 2 ( 1)n Q( 1)  0 From equation (7.69), when n ˆ 2 ( 1)2 Q( 1) ˆ f1 1368) ‡ (0368 ‡ 0066K)g  0 (0092K (772) Equation (7.72) simplifies to give 2736 0026K  0 or K 2736 ˆ 10523 0026 (773) Im K = 9.58 z-plane 75.90 K = 60 K=1 K = 105.23 x –2 –1.5 –1 Fig. 7.20       $   %& –0.5 x 0.5 K = 0.78 1.0 Re 218 Advanced Control Engineering Condition 3: ja0 j  a2 j0368 ‡ 0066Kj  1 (774) For marginal stability 0368 ‡ 0066K ˆ 1 Kˆ 1 0368 ˆ 958 0066 (775) Hence the system is marginally stable when K ˆ 958 and 105.23 (see also Example 7.6 and Figure 7.20). 7.6.3 Root locus analysis in the z-plane As with the continuous systems described in Chapter 5, the root locus of a discrete system is a plot of the locus of the roots of the characteristic equation 1 ‡ GH(z) ˆ 0 (776) in the z-plane as a function of the open-loop gain constant K. The closed-loop system will remain stable providing the loci remain within the unit circle. 7.6.4 Root locus construction rules These are similar to those given in section 5.3.4 for continuous systems. 1. Starting points (K ˆ 0): The root loci start at the open-loop poles. 2. Termination points (K ˆ 1): The root loci terminate at the open-loop zeros when they exist, otherwise at 1. 3. Number of distinct root loci: This is equal to the order of the characteristic equation. 4. Symmetry of root loci: The root loci are symmetrical about the real axis. 5. Root locus locations on real axis: A point on the real axis is part of the loci if the sum of the open-loop poles and zeros to the right of the point concerned is odd. 6. Breakaway points: The points at which a locus breaks away from the real axis can be found by obtaining the roots of the equation d fGH(z)g ˆ 0 dz 7. Unit circle crossover: This can be obtained by determining the value of K for marginal stability using the Jury test, and substituting it in the characteristic equation (7.76). Example 7.6 (See also Appendix 1, examp76.m) Sketch the root locus diagram for Example 7.4, shown in Figure 7.14. Determine the breakaway points, the value of K for marginal stability and the unit circle crossover. Digital control system design 219 Solution From equation (7.43)  G(s) ˆ K 1 e Ts s  1 s(s ‡ 2) (777) and from equation (7.53), given that T ˆ 05 seconds   0092z ‡ 0066 G(z) ˆ K 2 z 1368z ‡ 0368 (778) Open-loop poles z2 1368z ‡ 0368 ˆ 0 (779) z ˆ 0684  0316 ˆ 1 and 0368 (780) Open-loop zeros 0092z ‡ 0066 ˆ 0 zˆ 0717 (781) From equations (7.67), (7.68) and (7.69) the characteristic equation is z2 ‡ (0092K 1368)z ‡ (0368 ‡ 0066K) ˆ 0 (782) Breakaway points: Using Rule 6 (z2 d fGH(z)g ˆ 0 dz 1368z ‡ 0368)K(0092) K(0092z ‡ 0066)(2z 1368) ˆ 0 (783) which gives 0092z2 ‡ 0132z z ˆ 0647 and 01239 ˆ 0 2084 (784) K for marginal stability: Using the Jury test, the values of K as the locus crosses the unit circle are given in equations (7.75) and (7.73) K ˆ 958 and 10523 (785) Unit circle crossover: Inserting K ˆ 958 into the characteristic equation (7.82) gives z2 0487z ‡ 1 ˆ 0 (786) The roots of equation (7.86) are z ˆ 0244  j097 (787) z ˆ 1€  759 ˆ 1€  133 rad (788) or 220 Advanced Control Engineering Since from equation (7.63) and Figure 7.16 z ˆ jzj € T (789) and T ˆ 05, then the frequency of oscillation at the onset of instability is 05 ˆ 133  ˆ 266 rad/s (790) The root locus diagram is shown in Figure 7.20. It can be seen from Figure 7.20 that the complex loci form a circle. This is usually the case for second-order plant, where  Radius ˆ jopen-loop polesj Centre ˆ (Open-loop zero, 0) (791) The step response shown in Figure 7.15 is for K ˆ 1. Inserting K ˆ 1 into the characteristic equation gives z2 1276z ‡ 0434 ˆ 0 or z ˆ 0638  j0164 This position is shown in Figure 7.20. The K values at the breakaway points are also shown in Figure 7.20. 7.7 Digital compensator design In sections 5.4 and 6.6, compensator design in the s-plane and the frequency domain were discussed for continuous systems. In the same manner, digital compensators may be designed in the z-plane for discrete systems. Figure 7.13 shows the general form of a digital control system. The pulse transfer function of the digital controller/compensator is written U (z) ˆ D(z) E (792) and the closed-loop pulse transfer function become C D(z)G(z) (z) ˆ R 1 ‡ D(z)GH(z) (793) and hence the characteristic equation is 1 ‡ D(z)GH(z) ˆ 0 (794) Digital control system design 221 7.7.1 Digital compensator types In a continuous system, a differentiation of the error signal e can be represented as u(t) ˆ de dt Taking Laplace transforms with zero initial conditions U (s) ˆ s E (795) In a discrete system, a differentiation can be approximated to u(kT) ˆ e(kT) 1)T e(k T hence 1 U 1 z (z) ˆ E T (796) Hence, the Laplace operator can be approximated to sˆ 1 z T 1 1 z ˆ (797) Tz Digital PID controller: From equation (4.92), a continuous PID controller can be written as U K1 (Ti Td s2 ‡ Ti s ‡ 1) (s) ˆ E Ti s (798) Inserting equation (7.97) into (7.98) gives U (z) ˆ E K1 Ti Td z 12 Tz Ti which can be simplified to give ‡Ti z 1 Tz z 1 Tz ‡1 U K1 (b2 z2 ‡ b1 z ‡ b0 ) (z) ˆ E z(z 1)  (799) (7100) where Td T  b1 ˆ 1 b0 ˆ b2 ˆ 2Td T    Td T ‡ ‡1 T Ti (7101) 222 Advanced Control Engineering Tustin's Rule: Tustin's rule, also called the bilinear transformation, gives a better approximation to integration since it is based on a trapizoidal rather than a rectangular area. Tustin's rule approximates the Laplace transform to sˆ 2(z 1) T(z ‡ 1) (7102) Inserting this value of s into the denominator of equation (7.98), still yields a digital PID controller of the form shown in equation (7.100) where b0 ˆ b1 ˆ b2 ˆ Td T  T 2Ti  2Td T T Td ‡1 ‡ 2Ti T 1  (7103)  Example 7.7 (See also Appendix 1, examp77.m) The laser guided missile shown in Figure 5.26 has an open-loop transfer function (combining the fin dynamics and missile dynamics) of G(s)H(s) ˆ 20 s2 (s ‡ 5) (7104) A lead compensator, see case study Example 6.6, and equation (6.113) has a transfer function of G(s) ˆ 08(1 ‡ s) (1 ‡ 00625s) (7105) (a) Find the z-transform of the missile by selecting a sampling frequency of at least 10 times higher than the system bandwidth. (b) Convert the lead compensator in equation (7.105) into a digital compensator using the simple method, i.e. equation (7.97) and find the step response of the system. (c) Convert the lead compensator in equation (7.105) into a digital compensator using Tustin's rule, i.e. equation (7.102) and find the step response of the system. (d) Compare the responses found in (b) and (c) with the continuous step response, and convert the compensator that is closest to this into a difference equation. Solution (a) From Figure 6.39, lead compensator two, the bandwidth is 509 rad/s, or 081 Hz. Ten times this is 81 Hz, so select a sampling frequency of 10 Hz, i.e. Digital control system design 223 T ˆ 01 seconds. For a sample and hold device cascaded with the missile dynamics   1 e Ts 20 G(s) ˆ (7106) 2 s (s ‡ 5) s G(s) ˆ (1 e Ts ) 20 s3 (s ‡ 5) (7107) For T ˆ 01, equation (7.107) has a z-transform of G(z) ˆ 000296z2 ‡ 001048z ‡ 00023 26065z2 ‡ 22131z 06065 z3 (7108) (b) Substituting sˆ 1 z Tz into lead compensator given in equation (7.105) to obtain digital compensator   D(z) ˆ 08 Tz‡(z 1) Tz Tz‡00625(z 1) Tz This simplifies to give D(z) ˆ 54152z 4923 z 03846 (7109) (c) Using Tustin's rule sˆ 2(z 1) T(z ‡ 1) Substituting into lead compensator D(z) ˆ This simplifies to give   T(z‡1)‡2(z 1) T(z‡1) 08T(z‡1)‡00625f2(z 1)g T(z‡1) D(z) ˆ 7467z 6756 z 0111 (7110) (d) From Figure 7.21, it can be seen that the digital compensator formed using Tustin's rule is closest to the continuous response. From equation (7.110) U 7467 6756z (z) ˆ E 1 0111z 1 1 (7111) 224 Advanced Control Engineering 2 Continuous c (kT ) 1.8 Simple method 1.6 Tustin’s rule 1.4 1.2 1 0.8 0.6 0.4 0.2 0 0 0.5 1 1.5 Fig. 7.21       2 2.5 3 3.5 4 4.5 5 kT (seconds)       Hence the difference equation for the digital compensator is u(kT) ˆ 0111u(k 7.7.2 1)T ‡ 7467e(kT) 6756e(k 1)T (7112) Digital compensator design using pole placement   Example 7.8 (See also Appendix 1, examp78.m) The continuous control system shown in Figure 7.22(a) is to be replaced by the digital control system shown in Figure 7.22(b). (a) For the continuous system, find the value of K that gives the system a damping ratio of 0.5. Determine the closed-loop poles in the s-plane and hence the values of  and . (b) Find the closed-loop bandwidth b and make the sampling frequency s a factor of 10 higher. What is the value of T? (c) For the sampled system shown in Figure 7.22(b), find the open-loop pulse transfer function G(z) when the sample and hold device is in cascade with the plant. (d) With D(z) set to the value of K found in (a), compare the continuous and discrete step responses. Digital control system design 225 R(s) + C(s) 3 s(s + 1) K – (a) R(s) + – 3 s(s + 1) –Ts 1–e s D(z) T C(s) (b) Fig. 7.22        "  (e) By mapping the closed-loop poles from the s to the z-plane, design a compensator D(z) such that both continuous and sampled system have identical closed-loop response, i.e. ˆ 05. Solution (a) The root-locus diagram for the continuous system in shown in Figure 7.23. From Figure 7.23 the closed-loop poles are sˆ 05  j0866 (7113) or ˆ 05,  ˆ 0866 rad/s and the value of K is 0.336. (b) Plotting the closed-loop frequency response for the continuous system gives a bandwidth b of 129 rad/s(0205 Hz). The sampling frequency should therefore be a factor of 10 higher, i.e. 129 rad/s(205 Hz). Rounding down to 20 Hz gives a sampling time T of 0.5 seconds. 3 (c) G(z) ˆ (1 z 1 )Z 2 (7114) s (s ‡ 1) Using transform 7 in Table 7.1 G(z) ˆ 3f(e 05 05)z ‡ (1 (z 1)(z e 15e 05 ) 05 )g 226 Advanced Control Engineering ζ = 0.5 jω K = 0.336 0.866 × –1 × –0.5 σ Fig. 7.23          "  Hence G(z) ˆ 03196(z ‡ 08467) (z 1)(z 06065) (7115) (d) With D(z) ˆ K ˆ 0336, the difference between the continuous and discrete step response can be seen in Figure 7.24. (e) Mapping closed-loop poles from s to z-plane jzj ˆ eT inserting values jzj ˆ e 0505 ˆ 0779 (7116) €z ˆ T ˆ 0866  05 ˆ 0433 rad (7117) ˆ 2488 Converting from polar to cartesian co-ordinates gives the closed-loop poles in the zplane z ˆ 0707  j0327 (7118) which provides a z-plane characteristic equation z2 1414z ‡ 0607 ˆ 0 (7119) Digital control system design 227 1.4 Discrete c (t ) Continuous 1.2 c (kT ) 1 0.8 0.6 0.4 0.2 0 0 1 Fig. 7.24    2   3 4 5 6 7 8 9 10 t, kT (seconds)      K ˆ ())* The control problem is to design a compensator D(z), which, when cascaded with G(z), provides a characteristic equation 1 ‡ D(z)G(z) ˆ 0 (7120) such that the equations (7.119) and (7.120) are identical. Let the compensator be of the form D(z) ˆ K(z a) (z ‡ b) (7121) Select the value of a so that the non-unity pole in G(z) is cancelled D(z)G(z) ˆ K(z 06065) 03196(z ‡ 08467)  (z ‡ b) (z 1)(z 06065) (7122) Hence the characteristic equation (7.120) becomes 1‡ 03196K(z ‡ 08467) ˆ0 (z ‡ b)(z 1) which simplifies to give z2 ‡ (03196K ‡ b 1)z ‡ (02706K b) ˆ 0 (7123) 228 Advanced Control Engineering 1.4 c (t ) Continuous and Discrete 1.2 c (kT ) 1 0.8 0.6 0.4 0.2 0 0 1 Fig. 7.25 +     2 3 4 5 6 7 8 9 10 t, kT (seconds)                Equating coefficients in equations (7.119) and (7.123) gives 03196K ‡ b Add 1ˆ 1414 02706K b ˆ 0607 05902K 1 ˆ (7124) (7125) 0807 or 05902K ˆ 0193 K ˆ 0327 (7126) Inserting equation (7.126) into (7.125) (02706  0327) bˆ 0607 ˆ b (7127) 0519 Thus the required compensator is D(z) ˆ U 0327(z 06065) (z) ˆ E (z 0519) (7128) Figure 7.25 shows that the continuous and discrete responses are identical, both with ˆ 05. The control algorithm can be implemented as a difference equation U (1 06065z 1 ) (z) ˆ 0327 E (1 0519z 1 ) (7129) hence u(kT) ˆ 0327e(kT) 01983e(k 1)T ‡ 0519u(k 1)T (7130) Digital control system design 229 7.8 Further problems Example 7.9 Assuming that a sample and hold device is in cascade with the transfer function G(s), determine G(z) for the following (a) G(s) ˆ 1 , (s ‡ 1) (b) G(s) ˆ 2 , (s ‡ 1)(s ‡ 2) (c) G(s) ˆ 1 , s(s ‡ 05) T ˆ 01 seconds T ˆ 05 seconds T ˆ 10 seconds Solution (a) G(z) ˆ (b) G(z) ˆ 0095 0905 z 0155(z ‡ 0606) z2 0974z ‡ 0223 0426(z ‡ 0847) 1607z ‡ 0607 (c) G(z) ˆ z2 Example 7.10 The computer control system shown in Figure 7.26 has a sampling time of 0.5 seconds (a) Find the open-loop pulse transfer function G(z) and hence determine the openloop poles and zeros for the combined sample and hold and the plant. (b) From (a) evaluate the difference equation relating c(kT), c(k 1)T, c(k 2)T, u(k 1)T and u(k 2)T. (c) If the computer has the control algorithm u(kT) ˆ 15e(kT) Plant Computer R(s) + – –Ts K T Fig. 7.26     "   $   %,( 1–e s 2 s (s+ 4) C(s) 230 Advanced Control Engineering using a tabular approach, calcuate the system response when the input is a unit step applied at kT ˆ 0 for the discrete time values of kT ˆ 0, 0.5, 1.0, 1.5, 2.0 and 2.5 seconds. Assume that at kT less than zero, all values of input and output are zero. Solution (a) G(z) ˆ 01419(z ‡ 0523) z2 1135z ‡ 0135 poles z ˆ 1, 0135 zeros zˆ 0523 (b) c(kT) ˆ 1135c(k 1)T (c) kT c(kT ) 10 0521 0 0 05 0213 2)T ‡ 01419u(k 0135c(k 15 0752 20 0889 1)T ‡ 00743u(k 2)T 25 0959 Example 7.11 A unity feedback computer control system, has an open-loop pulse transfer function G(z) ˆ 0426K(z ‡ 0847) z2 1607z ‡ 0607 (a) Determine the open-loop poles and zeros, the characteristic equation and breakaway points. (b) Using the Jury test, determine the value of K at the unit-circle crossover points. (c) Find the radius and centre of the circular complex loci, and hence sketch the root locus in the z-plane. Solution (a) poles zeros z ˆ 1, 0607 zˆ 0847 z2 ‡ (0426K 1607)z ‡ (0361K ‡ 0607) ˆ 0 breakaway points (b) K ˆ 106, 479 (c) radius ˆ 1607, centre ˆ z ˆ 0795, 25 0847, 0 Example 7.12 A unity feedback continuous control system has a forward-path transfer function G(s) ˆ K s(s ‡ 5) (a) Find the value of K to give the closed-loop system a damping ratio of 0.7. The above system is to be replaced by a discrete-time unity feedback control system with a forward-path transfer function Digital control system design 231 G(s) ˆ D(z)  1 e s Ts   1 s(s ‡ 5) (b) If the sampling time is 0.2 seconds, determine the open-loop pulse transfer function. (c) The discrete-time system is to have the identical time response to the continuous system. What are the desired closed-loop poles and characteristic equations in (i) the s-plane (ii) the z-plane (d) The discrete-time compensator is to take the form D(z) ˆ K1 (z ‡ a) (z ‡ b) Find the values of K1 and b if a is selected to cancel the non-unity open-loop pole. Solution (a) K ˆ 128 00147(z ‡ 0718) (b) G(z) ˆ (z 1)(z 0368) (c) 248  j256, 0531  j0298, (d) D(z) ˆ 1221 (z (z s2 ‡ 5s ‡ 128 ˆ 0 z2 1062z ‡ 0371 ˆ 0 0368) 0242) 8 State-space methods for control system design 8.1 The state-space-approach The classical control system design techniques discussed in Chapters 5±7 are generally only applicable to (a) Single Input, Single Output (SISO) systems (b) Systems that are linear (or can be linearized) and are time invariant (have parameters that do not vary with time). The state-space approach is a generalized time-domain method for modelling, analysing and designing a wide range of control systems and is particularly well suited to digital computational techniques. The approach can deal with (a) Multiple Input, Multiple Output (MIMO) systems, or multivariable systems (b) Non-linear and time-variant systems (c) Alternative controller design approaches. 8.1.1 The concept of state The state of a system may be defined as: `The set of variables (called the state variables) which at some initial time t0, together with the input variables completely determine the behaviour of the system for time t  t0 '. The state variables are the smallest number of states that are required to describe the dynamic nature of the system, and it is not a necessary constraint that they are measurable. The manner in which the state variables change as a function of time may be thought of as a trajectory in n dimensional space, called the state-space. Two-dimensional state-space is sometimes referred to as the phase-plane when one state is the derivative of the other.  8.1.2         233 The state vector differential equation The state of a system is described by a set of first-order differential equations in terms of the state variables (x1 , x2 , . . . , xn ) and input variables (u1 , u2 , . . . , un ) in the general form dx1 ˆ a11 x1 ‡ a12 x2 ‡    ‡ a1n xn ‡ b11 u1 ‡    ‡ b1m um dt dx2 ˆ a21 x1 ‡ a22 x2 ‡    ‡ a2n xn ‡ b21 u1 ‡    ‡ b2m um dt dxn ˆ an1 x1 ‡ an2 x2 ‡    ‡ ann xn ‡ bn1 u1 ‡    ‡ bnm um dt (8:1) The equations set (8.1) may be combined in matrix format. This results in the state vector differential equation x_ ˆ Ax ‡ Bu (8:2) Equation (8.2) is generally called the state equation(s), where lower-case boldface represents vectors and upper-case boldface represents matrices. Thus x is the n dimensional state vector   x1  x2     ..   .  (8:3) xn u is the m dimensional input vector  u1  u2   ..  . um A is the n  n system matrix  a11  a21   ..  . an1 B is the n  m control matrix  b11  b21   ..  . bn1 a12 a22 an2 ... ... ...      (8:4)  . . . a1n . . . a2n     . . . ann  b1m b2m     bnm (8:5) (8:6) 234       K C P(t ) Cy m (a) Fig. 8.1 S   P(t ) y, y , 3 y m Ky (b)           In general, the outputs ( y1 , y2 , . . . , yn ) of a linear system can be related to the state variables and the input variables y ˆ  ‡  (8:7) Equation (8.7) is called the output equation(s). Example 8.1 Write down the state equation and output equation for the spring±mass±damper system shown in Figure 8.1(a). Solution State variables x1 ˆ y x2 ˆ dy ˆ x_ 1 dt (8:8) (8:9) Input variable u ˆ P(t) (8:10) Now  From Figure 8.1(b) P(t) Fy ˆ m y Ky C y_ ˆ m y or d2 y ˆ dt2 K y m C 1 y_ ‡ P(t) m m (8:11)          235 From equations (8.9), (8.10) and (8.11) the set of first-order differential equations are x_ 1 ˆ x2 x_ 2 ˆ K x1 m (8:12) C 1 x2 ‡ u m m and the state equations become      0 0 1  x1 x_ 1   ‡ ˆ K C 1 u x2 x_ 2 m m m From equation (8.8) the output equation is  x y ˆ [1 0] 1 x2 (8:13) (8:14) State variables are not unique, and may be selected to suit the problem being studied. Example 8.2 For the RCL network shown in Figure 8.2, write down the state equations when (a) the state variables are v2 (t) and v_2 (b) the state variables are v2 (t) and i(t). Solution (a) x1 ˆ v2 (t) x2 ˆ v_2 ˆ x_ 1 (8:15) From equation (2.37) d 2 v2 dv2 ‡ RC ‡ v2 ˆ v1 (t) (8:16) dt2 dt From equations (8.15) and (8.16) the set of first-order differential equations are LC x_ 1 ˆ x2 x2 ˆ 1 x1 LC Fig. 8.2 RCL   (8:17) L R v1(t) RC 1 x2 ‡ u LC LC i(t) C v2(t) 236       and the state equations are   x_ 1 ˆ x_ 2    0 0 1  x 1 1 R  x ‡  1 u 2 LC L LC x1 ˆ v2 (t) (b) x2 ˆ i(t) (8:18) (8:19) From equations (2.34) and (2.35) di ˆ dt v2 (t) Ri(t) ‡ v1 (t) dv2 C ˆ i(t) dt Equations (8.20) and (8.21) are both first-order differential equations, and written in the form 1 x_ 1 ˆ x2 C 1 R 1 x1 x2 ‡ u x_ 2 ˆ L L L giving the state equations      0 0 1  x1 x_ 1   ‡ ˆ 1 R 1 u x2 x_ 2 L L L L (8:20) (8:21) can be (8:22) (8:23) Example 8.3 For the 2 mass system shown in Figure 8.3, find the state and output equation when the state variables are the position and velocity of each mass. Solution State variables x1 ˆ y1 x3 ˆ y2 x2 ˆ y_ 1 x4 ˆ y_ 2 System outputs y1 , y2 System inputs u ˆ P(t) (8:24) For mass m1 K2 ( y2 y1 )  Fy ˆ m1 y1 K1 y1 ‡ P(t) C1 y_ 1 ˆ m1 y1 (8:25) For mass m2  Fy ˆ m2 y2 K 2 ( y2 y1 ) ˆ m2 y2 (8:26)          237 C1 K1 P(t ) P(t ) C1y1 K1y1 y1(t ) y1, y1, 31 m1 m1 K2(y2 – y1) K2 y 2 > y1 y2(t ) m2 m2 (a) Fig. 8.3  y2, y2, 32 (b)          From (8.24), (8.25) and (8.26), the four first-order differential equations are x_ 1 ˆ x2 K1 m1 x_ 2 ˆ x_ 3 ˆ x4 K2 x_ 4 ˆ x1 m2 K2 x1 m1 C1 K2 1 x2 ‡ x3 ‡ u m1 m1 m1 K2 x3 m2 Hence the state equations are  0    K1 ‡ K2 x_ 1   x_ 2   m1  ˆ  x_ 3   0   x_ 4 K2 m2 1 C m1 0 0 K2 m1 0 K2 m2 0 0     0   x1 0 1   x2      ‡  u  m  x3   1  1   0  x4 0 0 and the output equations are  y1 y2 (8:27) ˆ  1 0 0 0 0 1   x1  0   x2  0  x3  x4 (8:28) (8:29) 238       U(s) n –1 bn –1 s n + . . . + b1s + b0 s + an –1 s Fig. 8.4     8.1.3 Y(s) n –1 + . . . + a1s + a0      State equations from transfer functions Consider the general differential equation dn y  an dtn 1 dn 1 y dy ‡    ‡ a1 ‡ a0 y ˆ bn n 1 dt dt 1 dn 1 u du ‡    ‡ b1 ‡ b0 u n 1 dt dt (8:30) Equation (8.30) can be represented by the transfer function shown in Figure 8.4. Define a set of state variables such that x_ 1 ˆ x2 x_ 2 ˆ x3 .. .. . . x_ n ˆ a0 x1 (8:31) a1 x2  an 1 xn ‡ u and an output equation y ˆ b0 x1 ‡ b1 x2 ‡    ‡ bn 1 xn Then the state equation is    x_ 1 0  x_ 2   0   ..  ..    . ˆ .     x_ n 1   0 a0 xn 1 0 0 a1 0 1 0 a2 ... ... ... ...  x    0 1  0 x  2   ..  ..   u  ‡ .    .    xn 1  0 1 1 an 1 xn (8:32) 0 0 (8:33) The state-space representation in equation (8.33) is called the controllable canonical form and the output equation is   x1  x2      y ˆ [ b0 b1 b2 . . . bn 1 ] x3  (8:34)  ..   .  xn Example 8.4 (See also Appendix 1, examp84.m) Find the state and output equations for Y 4 (s) ˆ 3 U s ‡ 3s2 ‡ 6s ‡ 2          239 Solution State equation  Output equation   x_ 1 0  x_ 2  ˆ  0 2 x_ 3     0 0 x1 1  x2  ‡  0 u 3 1 x3 1 0 6 y ˆ [4   x1 0 ] x 2  x3 0 Example 8.5 Find the state and output equations for (8:35) (8:36) Y 5s2 ‡ 7s ‡ 4 (s) ˆ 3 U s ‡ 3s2 ‡ 6s ‡ 2 Solution The state equation is the same as (8.35). The output equation is   x1 y ˆ [ 4 7 5 ] x 2  x3 8.2 (8:37) Solution of the state vector differential equation Consider the first-order differential equation dx ˆ ax(t) ‡ bu(t) dt (8:38) where x(t) and u(t) are scalar functions of time. Take Laplace transforms sX(s) x(0) ˆ aX(s) ‡ bU(s) (8:39) where x(0) is the initial condition. From equation (8.39) X(s) ˆ x(0) b ‡ U(s) (s a) (s a) (8:40) Inverse transform t ea(t x(t) ˆ eat x(0) ‡ ) bu()d (841) 0 where the integral term in equation (8.41) is the convolution integral and  is a dummy time variable. Note that eat ˆ 1 ‡ at ‡ a2 t 2 ak t k ‡  ‡ 2! k! (842) 24       Consider now the state vector differential equation x_ ˆ Ax ‡ Bu (8:43) (0) ˆ (s) ‡  (s) (8:44) Taking Laplace transforms s(s) (s Pre-multiplying by (s ) )(s) ˆ (0) ‡  (s) 1 (s) ˆ (s ) 1 (0) ‡ (s ) 1  (s) (8:45) Inverse transform t (t) ˆ et (0) ‡ e(t )  ()d (846) 0 if the initial time is t0 , then t (t) ˆ e(t t0 ) ) e(t (0) ‡ ()d (847) t0 The exponential matrix et in equation (8.46) is called the state-transition matrix F(t) and represents the natural response of the system. Hence F(s) ˆ (s ) F(t) ˆ l 1 (s ) 1 1 (848) ˆ et (849) Alternatively F(t) ˆ ‡ t ‡ 2 t2  k tk ‡  ‡ 2! k! (850) Hence equation (8.46) can be written t (t) ˆ F(t)(0) ‡ F(t )()d (851) 0 In equation (8.51) the first term represents the response to a set of initial conditions, whilst the integral term represents the response to a forcing function.     Using a state variable representation of a system, the characteristic equation is given by j(s )j ˆ 0 (852)  8.2.1         24 Transient solution from a set of initial conditions Example 8.6 For the spring±mass±damper system given in Example 8.1, Figure 8.1, the state equations are shown in equation (8.13)      0 1  0 x x_ 1  1 ‡  1 u (8:53) ˆ K C x_ 2 x2 m m m Given: m ˆ 1 kg, C ˆ 3 Ns/m, K ˆ 2 N/m, u(t) ˆ 0. Evaluate, (a) the characteristic equation, its roots, !n and  (b) the transition matrices f(s) and f(t) (c) the transient response of the state variables from the set of initial conditions y(0) ˆ 1:0, _ y(0) ˆ0 Solution _ then x1 (0) ˆ 1:0, x2 (0) ˆ 0. Since x1 ˆ y and x2 ˆ y, Inserting values of system parameters into equation (8.53) gives     x_ 1 x1 0 1 0 ˆ ‡ u x_ 2 2 3 x2 1 (a) (s   s 0 A) ˆ 0 s  1 s ˆ 3 2 0 2 1 (s ‡ 3) (8:54) From equation (8.52), the characteristic equation is j(s A)j ˆ s(s ‡ 3) ( 2) ˆ s2 ‡ 3s ‡ 2 ˆ 0 (8:55) 1, (8:56) Roots of characteristic equation sˆ 2 Compare equation (8.55) with the denominator of the standard form in equation (3.43) !2n ˆ 2 i.e !n ˆ 1:414 rad/s 2n ˆ 3 i.e  ˆ 1061 (857) (b) The inverse of any matrix A (see equation A2.17) is A 1 ˆ Adjoint A det A From equation (8.48) F(s) ˆ (s A) 1 (858) 242       Using the standard matrix operations given in Appendix 2, equation (A2.12)  (s ‡ 3) 2 Minors of F(s) ˆ 1 s  (s ‡ 3) 2 Co-factors of F(s) ˆ 1 s The Adjoint matrix is the transpose of the Co-factor matrix  (s ‡ 3) 1 Adjoint of F(s) ˆ 2 s (8:59) Hence, from equations (8.58) and (8.48)   (s ‡ 3) 1  (s ‡ 1)(s ‡ 2) (s ‡ 1)(s ‡ 2)   F(s) ˆ    2 s (s ‡ 1)(s ‡ 2) (s ‡ 1)(s ‡ 2) Using partial fraction expansions  2 1  s ‡ 1 s ‡ 2 F(s) ˆ   1 1 2 s‡1 s‡2 (8:60)  1 1 s‡1 s‡2    1 2 ‡ s‡1 s‡2 Inverse transform equation (8.61)  (2e t e 2t ) F(t) ˆ 2(e t e 2t ) t (e ( e t e 2t ) ‡ 2e 2t ) (8:61) (8:62) Note that the exponential indices are the roots of the characteristic equation (8.56). (c) From equation (8.51), the transient response is given by x(t) ˆ F(t)x(0) (8:63) Hence  x1 x2 ˆ  (2e t e 2t ) 2(e t e 2t ) x1 (t) ˆ (2e x2 (t) ˆ (e ( e t 2(e e t e 2t ) t ‡ 2e 2t ) t 2t ) e 2t )  1 0 (8:64) (8:65) The time response of the state variables (i.e. position and velocity) together with the state trajectory is given in Figure 8.5. Example 8.7 For the spring±mass±damper system given in Example 8.6, evaluate the transient response of the state variables to a unit step input using (a) The convolution integral (b) Inverse Laplace transforms Assume zero initial conditions.          243 x2(t ) 1 x1(t ) 1 t x2(t ) x1(t ) –1 (b) (a) Fig. 8.5                  ! Solution (a) From equation (8.51)   0 )   1 u()d ) 0 m Given that u(t) ˆ 1 and 1/m ˆ 1, equation (8.66) reduces to t 12 (t ) x(t) ˆ d  ) 22 (t 0  0 x(t) ˆ F(t) ‡ 0 t 11 (t 21 (t ) ) 12 (t 22 (t Inserting values from equation (8.62) t e (t ) e 2(t ) x(t) ˆ d e (t ) ‡ 2e 2(t ) 0 (866) (867) Integrating x(t) ˆ e e (t ) (t ) 1 2(t ) 2e ‡e 2(t ) Inserting integration limits ( ˆ t and  ˆ 0)  1 e t ‡ 12 e x1 ˆ 2 x2 e t e 2t 2t t (868)  (869) 0 (b) An alternative method is to inverse transform from an s-domain expression. Equation (8.45) may be written (s) ˆ F(s)(0) ‡ F(s) (s) (870) 244       x2(t ) 1.0 x1(t ) 0.5 x1(t ) 1.0 x2(t ) 1 t (a) Fig. 8.6      (b)              Hence from equation (8.61)  2 1   s ‡ 1 s ‡ 2 0  ‡ (s) ˆ F(s) 0  1 1 2 s‡1 s‡2 " 1 1 s‡1 s‡2 1 2 ‡ s‡1 s‡2 Simplifying    0 1   1 s   1 1 2  s(s ‡ 1) 2 s(s ‡ 2)   (s) ˆ    1 2 ‡ s(s ‡ 1) s(s ‡ 2)  (8:71) (8:72) Inverse transform (t) ˆ (1 1 2 (1 e 2t e t ) ‡ (1 e 2t 2t  e t) (1 ) )  (8:73) which gives  x1 x2 ˆ 1 2 t e e t ‡ 12 e e 2t (8:74) Equation (8.74) is the same as equation (8.69). The step response of the state variables, together with the state trajectory, is shown in Figure 8.6. 8.3 Discrete-time solution of the state vector differential equation The discrete-time solution of the state equation may be considered to be the vector equivalent of the scalar difference equation method developed from a z-transform approach in Chapter 7.          245 The continuous-time solution of the state equation is given in equation (8.47). If the time interval (t t0 ) in this equation is T, the sampling time of a discrete-time system, then the discrete-time solution of the state equation can be written as  T  AT A x‰(k ‡ 1)T Š ˆ e x(kT) ‡ e Bd u(kT) (875) 0 Equation (8.75) can be written in the general form x[(k ‡ 1)T] ˆ A(T)x(kT ) ‡ B(T)u(kT) (876) Note A(T) 6ˆ A and B(T) 6ˆ B Equation (8.76) is called the matrix vector difference equation and can be used for the recursive discrete-time simulation of multivariable systems. The discrete-time state transition matrix A(T) may be computed by substituting T ˆ t in equations (8.49) and (8.50), i.e. A(T) ˆ F(T) ˆ eAT (877) or A(T) ˆ ‡ AT ‡ A2 T 2 Ak T k ‡  ‡ 2! k! (878) Usually sufficient accuracy is obtained with 5  k  50. The discrete-time control matrix B(T) from equations (8.75) and (8.76) is T eA Bd B(T) ˆ (879) 0 or B(T) ˆ  Put T within the brackets B(T) ˆ Hence B(T) ˆ   1  Ak T k BT (k ‡ 1)! kˆ0  1  Ak T k‡1 kˆ0 (k ‡ 1)!  B  AT 2 A2 T 3 Ak T k‡1 ‡ ‡  ‡ T‡ B 2! 3! (k ‡ 1)! (880) Example 8.8 (See also Appendix 1, examp88.m) (a) Calculate the discrete-time transition and control matrices for the spring-massdamper system in Example 8.6 using a sampling time T ˆ 01 seconds. (b) Using the matrix vector difference equation method, determine the unit step response assuming zero initial conditions. 246       Solution (a) The exact value of A(T ) is found by substituting T ˆ t in equation (8.62) A(T) ˆ F(T) ˆ ˆ 2e 0:1  0:1 2 e   0:991 0:172 e e 0:2 0:2 0:086 0:733  0:1 e  e 0:1 e 0:2 ‡ 2e  0:2   (8:81) An approximate value of A(T ) is found from equation (8.78), taking the series as far as k ˆ 2.  0 0:1 AT ˆ 0:2 0:3 A2 T 2 ˆ 2!  0 2 1 3  0 2 0:12 1 ˆ 3 12  0:01 0:03 using the first 3 terms of equation (8.78)    1 0 0 0:1 0:01 A(T)  ‡ ‡ 0 1 0:2 0:3 0:03  0:99 0:085  0:17 0:735 0:015 0:035 0:015 0:035 (8:82) Since in equation (8.66), u() is unity, the exact value of B(T ) can be obtained by substituting T ˆ t in equation (8.69)  1 e 01 ‡ 12 e 02 2 B(T) ˆ (883) e 01 e 02  000453 B(T) ˆ (884) 00861 An approximate value of B(T ) is found from equation (8.80), taking the series as far as k ˆ 2. AT 2 A2 T 3 B(T)  ( T)B ‡ B‡ B 2! 3!    0 0005 00005  ‡ ‡ 01 0015 000117  00045  008617 (885) (b) Using the values of A(T ) and B(T ) given in equations (8.81) and (8.84), together with the matrix vector difference equation (8.76), the first few recursive steps of the discrete solution to a step input to the system is given in equation (8.86)          247 kT ˆ 0  kT ˆ 0:1  kT ˆ 0:2  kT ˆ 0:3  kT ˆ 0:4  x1 (0:1) ˆ x2 (0:1)  0:991 0:172 0:086 0:733    0 0:00453 0:00453 ‡ 1ˆ 0 0:0861 0:0861 x1 (0:2) ˆ x2 (0:2)  0:991 0:172 0:086 0:733    0:00453 0:00453 0:016 ‡ 1ˆ 0:0861 0:0861 0:0148 x1 (0:3) ˆ x2 (0:3)  0:991 0:172 0:086 0:733    0:016 0:00453 0:033 ‡ 1ˆ 0:148 0:0861 0:192 x1 (0:4) ˆ x2 (0:4)  0:991 0:172 0:086 0:733    0:033 0:00453 0:054 ‡ 1ˆ 0:192 0:0861 0:227 x1 (0:5) ˆ x2 (0:5)  0:991 0:172 0:086 0:733    0:054 0:00453 0:078 ‡ 1ˆ 0:227 0:0861 0:243 (8:86) Example 8.9 A system has a transfer function Y 1 (s) ˆ 2 U s ‡ 2s ‡ 1 The system has an initial condition y(0) ˆ 1 and is subject to a unit ramp function u(t) ˆ t. Determine (a) The state and output equations (b) The transition matrix F(s) (c) Expressions for the time response of the state variables. Solution  x_ 1 (a) x_ 2 y ˆ [1 ˆ  0 1 1 2   x1 0 u ‡ x2 1  x 0] 1 x2  s‡2 1  (s ‡ 1)(s ‡ 1) (s ‡ 1)(s ‡ 1)   (b) F(s) ˆ    1 s (s ‡ 1)(s ‡ 1) (s ‡ 1)(s ‡ 1)   x1 3e t ‡ 2te t 2 ‡ t (c) ˆ x2 2te t ‡ 1 e t  248       8.4 8.4.1 Control of multivariable systems Controllability and observability The concepts of controllability and observability were introduced by Kalman (1960) and play an important role in the control of multivariable systems. A system is said to be controllable if a control vector u(t) exists that will transfer the system from any initial state x(t0 ) to some final state x(t) in a finite time interval. A system is said to be observable if at time t0 , the system state x(t0 ) can be exactly determined from observation of the output y(t) over a finite time interval. If a system is described by equations (8.2) and (8.7) x_ ˆ Ax ‡ Bu (8:87) y ˆ  ‡  then a sufficient condition for complete state controllability is that the n  n matrix ˆ [ :  : . . . : n 1 ] (8:88) contains n linearly independent row or column vectors, i.e. is of rank n (that is, the matrix is non-singular, i.e. the determinant is non-zero. See Appendix 2). Equation (8.88) is called the controllability matrix. The system described by equations (8.87) is completely observable if the n  n matrix   n 1 T  ˆ T : T T : . . . : T  (8:89) is of rank n, i.e. is non-singular having a non-zero determinant. Equation (8.89) is called the observability matrix. Example 8.10 (See also Appendix 1, examp810.m) Is the following system completely controllable and observable?     1 x1 2 0 x_ 1  ‡ ˆ 0 3 5 x2 x_ 2  x1 y ˆ [1 1] x2 Solution From equation (8.88) the controllability matrix is ˆ [ : ] where  ˆ  2 3 0 5  1 ˆ 0   2 3 2 3 hence ˆ [ : ] ˆ 0 1 (8:90)          249 Equation (8.90) is non-singular since it has a non-zero determinant. Also the two row and column vectors can be seen to be linearly independent, so it is of rank 2 and therefore the system is controllable. From equation (8.89) the observability matrix is   ˆ T :T T where T T ˆ  2 0 3 5  1 ˆ 1  5 5 hence   ˆ T :T T ˆ  1 1 5 5 (8:91) Equation (8.91) is singular since it has a zero determinant. Also the column vectors are linearly dependent since the second column is 5 times the first column and therefore the system is unobservable. 8.4.2 State variable feedback design Consider a system described by the state and output equations _ ˆ  ‡   ˆ  (8:92) Select a control law of the form ˆ( (8:93) ) In equation (8.93), (t) is a vector of desired state variables and  is referred to as the state feedback gain matrix. Equations (8.92) and (8.93) are represented in state variable block diagram form in Figure 8.7. Substituting equation (8.93) into equation (8.92) gives _ ˆ  ‡ ( ) or _ ˆ ( ) ‡  (8:94) In equation (8.94) the matrix ( ± ) is the closed-loop system matrix. For the system described by equation (8.92), and using equation (8.52), the characteristic equation is given by j(s )j ˆ 0 (8:95) The roots of equation (8.95) are the open-loop poles or eigenvalues. For the closedloop system described by equation (8.94), the characteristic equation is j(s  ‡ )j ˆ 0 The roots of equation (8.96) are the closed-loop poles or eigenvalues. (8:96) 25       r + u x + B + – y x ∫ C A K Fig. 8.7 #                     The pole placement control problem is to determine a value of  that will produce a desired set of closed-loop poles. With a regulator, (t) ˆ  and therefore equation (8.93) becomes uˆ Kx Thus the control u(t) will drive the system from a set of initial conditions x(0) to a set of zero states at time t1 , i.e. x(t1 ) ˆ 0. There are several methods that can be used for pole placement. (a) Direct comparison method: If the desired locations of the closed-loop poles (eigenvalues) are s ˆ 1 , s ˆ 2 , . . . , s ˆ n (897) then, from equation (8.96) js A ‡ BKj ˆ (s 2 ) . . . (s 1 )(s n ˆ s ‡ n 1 s n 1 n ) (898) ‡    ‡ 1 s ‡ 0 (899) Solving equation (8.99) will give the elements of the state feedback matrix. (b) Controllable canonical form method: The value of K can be calculated directly using k ˆ [0 a 0 : 1 a2 : . . . :  n 2 an 2 : n 1 an 1 ]T 1 (8100) where T is a transformation matrix that transforms the system state equation into the controllable canonical form (see equation (8.33)). Tˆ  (8101)  where is the controllability matrix,  a1 a2  a2 a3   .  ˆ  ..   an 1 1 1 0 Note that  ˆ canonical form.   equation (8.88)  . . . an 1 1 ... 1 0     ... 0 0 ... 0 0       25 (8:102) when the system state equation is already in the controllable (c) Ackermann's formula: As with Method 2, Ackermann's formula (1972) is a direct evaluation method. It is only applicable to SISO systems and therefore u(t) and y(t) in equation (8.87) are scalar quantities. Let  ˆ ‰0 where 1 1Š 0 ... 0 (A) (8103) is the controllability matrix and (A) ˆ An ‡ n 1 An 1 ‡    ‡ 1 A ‡ 0 (8104) where A is the system matrix and i are the coefficients of the desired closed-loop characteristic equation. Example 8.11 (See also Appendix 1, examp811.m) A control system has an open-loop transfer function Y 1 (s) ˆ U s(s ‡ 4) When x1 ˆ y and x2 ˆ x_ 1 , express the state equation in the controllable canonical form. Evaluate the coefficients of the state feedback gain matrix using: (a) The direct comparison method (b) The controllable canonical form method (c) Ackermann's formula such that the closed-loop poles have the values sˆ 2, s ˆ 2 Solution From the open-loop transfer function y ‡ 4y_ ˆ u (8105) x1 ˆ y (8106) x_ 1 ˆ x2 x_ 2 ˆ 4x2 ‡ u (8107) Let Then 252       Equation (8.106) provides the output equation and (8.107) the state equation     x_ 1 0 0 1 x1 u (8:108) ‡ ˆ 1 0 4 x2 x_ 2 y ˆ [1 0]  x1 x2 (8:109) The characteristic equation for the open-loop system is     s 0 0 1   ˆ s2 ‡ 4s ‡ 0 js Aj ˆ  0 4  0 s ˆ s2 ‡ a1 s ‡ a0 (8:110) Thus a1 ˆ 4, a0 ˆ 0 The required closed-loop characteristic equation is (s ‡ 2)(s ‡ 2) ˆ 0 or s2 ‡ 4s ‡ 4 ˆ 0 (8:111) s2 ‡ 1 s ‡ 0 ˆ 0 (8:112) i.e. hence 1 ˆ 4, 0 ˆ 4 (a) Direct comparison method: From equations (8.99) and (8.111) A ‡ BKj ˆ s2 ‡ 4s ‡ 4 js   s   0 0 s   ‰ k1 k2 Š ˆ s2 ‡ 4s ‡ 4 0 4 1     s 1 0 0  2   0 s ‡ 4 ‡ k k  ˆ s ‡ 4s ‡ 4 1 2    s  1 2    k s ‡ 4 ‡ k  ˆ s ‡ 4s ‡ 4 1 2  0 1 ‡  (8:113) 0 s2 ‡ (4 ‡ k2 )s ‡ k1 ˆ s2 ‡ 4s ‡ 4 (8:114) From equation (8.114) k1 ˆ 4 (4 ‡ k2 ) ˆ 4 i:e: k2 ˆ 0 (8:115)          253 (b) Controllable canonical form method: From equation (8.100)  ˆ [0 a0 :  1 ˆ [4 0:4 ˆ [4 0 ] 1 a1 ] 4] 1 1 (8:116) now ˆ  where ˆ [B : AB]  0 AB ˆ 0  1 4 0 ˆ 1  1 4 giving ˆ Note that the determinant of From equation (8.102)  0 1 1 4 (8:117) is non-zero, hence the system is controllable. ˆ   1 4 ˆ 1 0 a1 1 1 0 Hence ˆ ˆ  0 1  1 4 4 1  1 1 ˆ 0 0 0 ˆ 1 (8:118) Thus proving that equation (8.108) is already in the controllable canonical form. Since  1 is also , substitute (8.118) into (8.116)  ˆ [4 0] ˆ [4 0] (8:119) (c) Ackermann's formula: From (8.103)  ˆ [0 1] 1 (8120) (A) From (8.117) 1 ˆ 1 1  4 1  1 4 ˆ 0 1 From (8.104) (A) ˆ A2 ‡ 1 A ‡ 0 1 0 (8121) 254       inserting values 0 (A) ˆ 1 0 ˆ 0 4 0 16  0 4 ˆ 4 0 2  4  ‡4 0 4 0 16  ‡ 0 ‡4 ‡ 1 0 0 0 1  4 0 0 4  (8122) 4 Insert equations (8.121) and (8.122) into (8.120)   4 1 4 K ˆ [0 1] 1 0 0  16 4 ˆ [0 1] 4 0 K ˆ [4 1 0] 0 4 (8123) These results agree with the root locus diagram in Figure 5.9, where K ˆ 4 produces two real roots of s ˆ 2, s ˆ 2 (i.e. critical damping). 8.4.3 State observers In section 8.4.2 where state feedback design was discussed, it was assumed that all the state variables were available for the control equation (8.93) for a regulator u ˆ (r Kx) when r ˆ 0 uˆ Kx (8124) Equations (8.124) requires that all state variables must be measured. In practice this may not happen for a number of reasons including cost, or that the state may not physically be measurable. Under these conditions it becomes necessary, if full state feedback is required, to observe, or estimate the state variables. A full-order state observer estimates all of the system state variables. If, however, some of the state variables are measured, it may only be necessary to estimate a few of them. This is referred to as a reduced-order state observer. All observers use some ^ of the actual state vector x. form of mathematical model to produce an estimate x Figure 8.8 shows a simple arrangement of a full-order state observer. In Figure 8.8, since the observer dynamics will never exactly equal the system ^ will gradually diverge. If dynamics, this open-loop arrangement means that x and x however, an output vector ^ y is estimated and subtracted from the actual output vector y, the difference can be used, in a closed-loop sense, to modify the dynamics of the observer so that the output error (y ^y) is minimized. This arrangement, sometimes called a Luenberger observer (1964), is shown in Figure 8.9.  u B x +  x ∫       C  255 y + System A B 0 1 + ∫ + Observer A Fig. 8.8 $         Let the system in Figure 8.9 be defined by x_ ˆ Ax ‡ Bu (8:125) y ˆ  (8:126) ^ of the state vector is Assume that the estimate  ^_ ˆ ^   ‡  ‡ e ( ^ ) where e is the observer gain matrix. If equation (8.127) is subtracted from (8.125), and ( _ ˆ ( (8:127) ^) is the error vector , then  e ) (8:128) and, from equation (8.127), the equation for the full-order state observer is ^_ ˆ (  e )^  ‡  ‡ e  (8:129) Thus from equation (8.128) the dynamic behaviour of the error vector depends upon the eigenvalues of ( e ). As with any measurement system, these eigenvalues 256       x + u B y x ∫ C + System A + Ke – + 1 + 0 ∫ B C y + Observer 0 A Fig. 8.9 % &           should allow the observer transient response to be more rapid than the system itself (typically a factor of 5), unless a filtering effect is required. The problem of observer design is essentially the same as the regulator pole placement problem, and similar techniques may be used. (a) Direct comparison method: If the desired locations of the closed-loop poles (eigenvalues) of the observer are s ˆ 1 , s ˆ 2 , . . . , s ˆ n then js A ‡ Ke j ˆ (s n 1 )(s ˆ s ‡ n 1 s 2 ) . . . (s n 1 n ) ‡    ‡ 1 s ‡ 0 (8130)          257 (b) Observable canonical form method: For the generalized transfer function shown in Figure 8.4, the observable form of the state equation may be written        0 0 ... 0 a0 x_ 1 x1 b0  x_ 2   1 0 . . . 0     a1      x2   b1   ..  ˆ  .. ..  ..  ‡  .. u  .  . .  .   .  x_ n 0 y ˆ [0 0 ... 1 a  n 1 x1  x2    0 . . . 0 1 ] .   ..  xn xn bn 1 (8:131) Note that the system matrix of the observable canonical form is the transpose of the controllable canonical form given in equation (8.33). The value of the observer gain matrix e can be calculated directly using    0 a0   1 a1     e ˆ  (8:132)  ..   .  n 1 an 1  is a transformation matrix that transforms the system state equation into the observable canonical form  ˆ ( T ) 1 (8:133) where  is defined in equation (8.102) and is the observability matrix given in equation (8.89). If the equation is in the observable canonical form then  ˆ . (c) Ackermann's formula: As with regulator design, this is only applicable to systems where u(t) and y(t) are scalar quantities. It may be used to calculate the observer gain matrix as follows e ˆ (A) or alternatively 1 [0 0 ... 0 1 ]T  1  0      0     e ˆ (A)  ...   ...  1 n 1  where () is defined in equation (8.104). Example 8.12 (See also Appendix 1, examp812.m) A system is described by     x_ 1 0 0 1 x1 ‡ u ˆ 1 2 3 x2 x_ 2  x1 y ˆ [1 0] x2 (8134) 258       Design a full-order observer that has an undamped natural frequency of 10 rad/s and a damping ratio of 0.5. Solution From equation (8.89), the observability matrix is    1 ˆ T : T T ˆ 0 0 1 (8:135) is of rank 2 and therefore non-singular, hence the system is completely observable and the calculation of an appropriate observer gain matrix e realizable. Open-loop eigenvalues: j ˆ s2 ‡ 3s ‡ 2 ˆ s2 ‡ a1 s ‡ a0 js (8:136) Hence a0 ˆ 2, a1 ˆ 3 And the open-loop eigenvalues are s2 ‡ 3s ‡ 2 ˆ 0 (s ‡ 1)(s ‡ 2) ˆ 0 sˆ 1, sˆ 2 (8:137) Desired closed-loop eigenvalues: s2 ‡ 2n s ‡ 2n ˆ 0 s2 ‡ 10s ‡ 100 ˆ s2 ‡ 1 s ‡ 0 ˆ 0 (8138) Hence 0 ˆ 100, 1 ˆ 10 and the desired closed-loop eigenvalues are the roots of equation (8.138) 1 ˆ 5 ‡ j866, 2 ˆ 5 j866 (8139) (a) Direct comparison method: From equation (8.130)   s    0 0 s  js  ‡ e j ˆ s2 ‡ 1 ‡ 0 0 1 2   s    2    ‡ [ 1 0 ] ˆ s2 ‡ 10s ‡ 100  ke2 3   ke1 0  1 ‡  ˆ s2 ‡ 10s ‡ 100 ke2 0  s‡3    s ‡ ke1 1    ˆ s2 ‡ 10s ‡ 100   2 ‡ ke2 s ‡ 3   ke1  s2 ‡ (3 ‡ ke1 )s ‡ (3ke1 ‡ 2 ‡ ke2 ) ˆ s2 ‡ 10s ‡ 100 (8140)          259 From equation (8.140) (3  ke1 ) ˆ 10, ke1 ˆ 7 (8:141) (3ke1 ‡ 2 ‡ ke2 ) ˆ 100 ke2 ˆ 100 2 21 ˆ 77 (8:142) (b) Observable canonical form method: From equation (8.132)  0 a0 e ˆ  1 a1  100 2 ˆ 10 3  98 ˆ 7 (8:143) From equation (8.133)  ˆ ( T ) 1 and from equation (8.102)  a ˆ 1 1  1 3 ˆ 0 1 1 0 (8:144) Since from equation (8.135) ˆ  1 0 0 , 1 T ˆ  1 0 0 1 (8:145) Thus  T  3 1 ˆ 1 0  1 0  0 3 ˆ 1 1 1 0 (8:146) and ˆ 1 1   0 1 ˆ 1 3 0 1 1 3 Since  6ˆ then A is not in the observable canonical form. From equation (8.143)    98 7 0 1 Ke ˆ ˆ 7 77 1 3 (c) Ackermann's Formula: From (8.134)   Ke ˆ (A)  1 0 1 (8:147) (8:148) 26       Using the definition of (A) in equation (8.104)  1 0 Ke ˆ (A2 ‡ 1 A ‡ 0 ) 0 1 e ˆ 8.4.4  ˆ  ˆ  2 3 6 7  98 7 1 14 98 14 77 0  7 0 77 1 ‡  0 10 20  0 0 1 ˆ  ‡ 30  1 100 0 0 100 0 1  (8149) 1 0 0 1  1 7 0 1 (8150) 77 Effect of a full-order state observer on a closed-loop system Figure 8.10 shows a closed-loop system that includes a full-order state observer. In Figure 8.10 the system equations are x_ ˆ Ax ‡ Bu y ˆ  (8151) The control is implemented using observed state variables ˆ (8152) ^  If the difference between the actual and observed state variables is (t) ˆ (t) ^(t)  ^(t) ˆ (t)  (t) then (8153) Combining equations (8.151), (8.152) and (8.153) gives the closed-loop equations _ ˆ  ˆ ( ( ) ) ‡  (8154) The observer error equation from equation (8.128) is _ ˆ ( e ) Combining equations (8.154) and (8.155) gives    _     ˆ _   e   (8155) (8156) Equation (8.156) describes the closed-loop dynamics of the observed state feedback control system and the characteristic equation is therefore js  ‡ jjs  ‡ e j ˆ 0 (8157)          26 System r=0 + u y x = Ax+Bu y = Cx – + Ke – + B +1 + y ∫ 0 C Full-Order Observer A 0 K Fig. 8.10 #     %           Equation (8.157) shows that the desired closed-loop poles for the control system are not changed by the introduction of the state observer. Since the observer is normally designed to have a more rapid response than the control system with full order observed state feedback, the pole-placement roots will dominate. ^(t) the state equations for the closed-loop system Using the state vectors x(t) and x are From equations (8.151) and (8.152) x_ ˆ Ax (8:158) BK^ x and from equation (8.129) ^_ ˆ (A x ˆ ( Ke )^  e  ^  ‡ e  )^  ‡ e  (8:159) Thus the closed-loop state equations are   _  ˆ ^_  e    e     ^  (8:160) 262       8.4.5 Reduced-order state observers A full-order state observer estimates all state variables, irrespective of whether they are being measured. In practice, it would appear logical to use a combination of measured states from y ˆ  and observed states (for those state variables that are either not being measured, or not being measured with sufficient accuracy). If the state vector is of nth order and the measured output vector is of mth order, then it is only necessary to design an (n m)th order state observer. Consider the case of the measurement of a single state variable x1 (t). The output equation is therefore y ˆ x1 ˆ  ˆ [ 1 0 . . . 0 ] (8:161) Partition the state vector ˆ  x1 e (8:162) where e are the state variables to be observed. Partition the state equations     x_ 1 b a11 1e x1 ‡ 1 u ˆ e e1 ee 2 _ e (8:163) If the desired eigenvalues for the reduced-order observer are s ˆ 1e , s ˆ 2e , . . . , s ˆ (n 1)e Then it can be shown that the characteristic equation for the reduced-order observer is js ee ‡ e 1e j ˆ (s ˆs 1e ) . . . (s n 1 ‡ (n (n n 2 2)e s 1)e ) ‡    ‡ 1e s ‡ oe (8164) In equation (8.164) ee replaces  and 1e replaces  in the full-order observer. The reduced-order observer gain matrix e can also be obtained using appropriate substitutions into equations mentioned earlier. For example, equation (8.132) becomes   oe aoe   1e a1e    e ˆ e  (8165) ..    . (n where aoe , . . . , a(n istics equation 2)e a(n 2)e 2)e are the coefficients of the open-loop reduced order characterjs ee j ˆ sn 1 ‡ a(n 2)e s n 2 ‡ a1e s ‡ aoe (8166) and e ˆ (e T 1 e) (8167)          263 where  a1 a2 .. .    e ˆ    an 2 1 and e a2 . . . an 2 a3 . . . 1 1 ... 0 0 ... 0  1 0     0 0 (8:168)   ˆ AT1e : Aee TAT1e : . . . : (Aee T)n 2 AT1e (8:169) and Ackermann's formula becomes  1  0  0   .   .  Ke ˆ (Aee )  .      A1e Anee 3   0  1 A1e Anee 2 (8170) (Aee ) ˆ Anee 1 ‡ n 2 Anee 2 ‡    ‡ 2 Aee ‡ 1 (8171)  where A1e A1e Aee .. . Define ^_ e1 ˆ x ^ x Ke y ^ˆx ^e1 x Ke y Then (8172) The equation for the reduced-order observer can be shown to be ^_ e1 ˆ (Aee Ke A1e )^ xe1 ‡ fAe1 Ke a11 ‡ (Aee x Ke A1e )Ke gy ‡ (Be Ke b1 )u (8173) Figure 8.11 shows the implementation of a reduced-order state observer.     Example 8.13 (See also Appendix 1, examp813.m) (a) In case study Example 5.10 a control system has an open-loop transfer function G(s)H(s) ˆ 1 s(s ‡ 2)(s ‡ 5) The controller was a PD compensator of the form G(s) ˆ K1 (s ‡ a) With K1 ˆ 15 and a ˆ 1, the system closed-loop poles were sˆ 3132  j3253 sˆ 0736 264       System r=0 + u y = x1 x = Ax + Bu y = Cx – Be – Keb1 0e O ---I 1e1 + + ∫ Ae1 – Kea11 + O --0e1 Reduced-Order Observer + Aee – KeA1e + + K 0 1 + Ke x1 ---Key 1 ---Ke Fig. 8.11 '              with the resulting characteristic equation s3  7s2  25s  15 ˆ 0 Demonstrate that the same result can be achieved using state feedback methods. (b) Design a reduced second-order state observer for the system such that the poles are a factor of 10 higher than the closed-loop system poles, i.e. sˆ 31:32  j32:53 which correspond to !n ˆ 45:16 rad/s and  ˆ 0:7. Solution (a) G(s)H(s) ˆ 1 s3 ‡ 7s2 ‡ 10s ‡ 0    :::::::::::::::: From equations (8.33) and (8.34)     0 0 1 0 :::::  :::::::::::::::::::  Aˆ0 0 1  B ˆ  0   ˆ [1 0 1 0 10 7      0]  265 (8:174) Open-loop characteristic equation s3 ‡ 7s2 ‡ 10s ‡ 0 ˆ 0 s3 ‡ a2 s2 ‡ a1 s ‡ a0 ˆ 0 (8:175) Closed-loop characteristic equation s3 ‡ 7s2 ‡ 25s ‡ 15 ˆ 0 s3 ‡ 2 s2 ‡ 1 s ‡ 0 ˆ 0 (8:176) Using direct comparison method   s 0    0 s    0 0 0   0  s js  ‡ j ˆ s3 ‡ 7s2 ‡ 25s ‡ 15     0 0 1 0         0  0 1  ‡  0 [ k1 k2 k3 ] ˆ s3 ‡ 7s2 ‡ 25s ‡ 15    1 0 10 7      s 1 0 0 0 0       3 2  0 s   1    ‡  0 0 0  ˆ s ‡ 7s ‡ 25s ‡ 15    0 10 s ‡ 7 k1 k2 k3      s 1 0      ˆ s3 ‡ 7s2 ‡ 25s ‡ 15 0 s 1      k1 10 ‡ k2 s ‡ 7 ‡ k3    (8:177) Expanding the determinant in equation (8.177) gives k1 ˆ 15, k2 ˆ 15, k3 ˆ 0 Hence uˆ [ 15 15   x1 0 ] x 2  x3 (8:178) since x2 ˆ x_ 1 , this is identical to the original PD controller G(s) ˆ 15(s ‡ 1) Although the solution is the same, the important difference is with state feedback, the closed-loop poles are placed at directly the required locations. With root locus, a certain amount of trial and error in placing open-loop zeros was required to achieve the desired closed-loop locations. 266       (b) Reduced-order state observer: Partitioning the system equation A in (8.174) and inserting in equation (8.164)        s 0 ke1 0 1   ‡ [ 1 0 ] ˆ s2 ‡ 2n s ‡ n 2    0 s ke2 10 7     s ke1 0  1  ‡  ˆ s2 ‡ 632s ‡ 20394   10 s ‡ 7 ke2 0     s ‡ ke1 1    ˆ s2 ‡ 1e s ‡ 0e   10 ‡ ke2 s ‡ 7  s2 ‡ (7 ‡ ke1 )s ‡ (7ke1 ‡ 10 ‡ ke2 ) ˆ s2 ‡ 632s ‡ 20394 (8179) Equating coefficients in equation (8.179) (7 ‡ ke1 ) ˆ 632 ke1 ˆ 562 (8180) (7  562 ‡ 10 ‡ ke2 ) ˆ 20394 ke2 ˆ 1636 (8181) Referring to Figure 8.11 and partitioned systems (8.174) and (8.163) Be Ae1 Aee K e b1 ˆ Ke a11 ˆ Ke A1e ˆ    0  1 0 0 0 10  562 1636 562 0ˆ   0 1 0 0ˆ 1636 0  1 562 [1 7 1636 (8182) 0] ˆ  562 1646 1 7 Inserting equation (8.182) into Figure 8.11 gives the complete state feedback and reduced observer system shown in Figure 8.12. Comparing the system shown in Figure 8.12 with the original PD controller given in Example 5.10, the state feedback system may be considered to be a PD controller where the proportional term uses measured output variables and the derivative term uses observed state variables. 8.5 Further problems Example 8.14 For the d.c. motor shown in Figure 4.14, the potential difference across the armature winding is given by equation (4.21) ea (t) eb (t) ˆ La dia ‡ Ra ia (t) dt          267 System r=0 + u – x1 0 1 0 x1 0 x2 0 0 1 x2 0 x3 0 –10 –7 x3 1 y = x1 y = [1 0 0]x 0 1 0e1 1e1 ∫ + 0 0 + 0 ---I Reduced-Order Observer 0 + –56.2 1 –1646 –7 0e1 + 0 56.2 1636 + [15 15 0] + K Ke x1 K ey 1 56.2 1636 Fig. 8.12 #                    (( where, from equation (4.20) eb (t) ˆ Kb d dt and the torque Tm (t) developed by the motor is given by equation (4.18) Tm (t) ˆ Ka ia (t) If the load consists of a rotor of moment of inertia I and a damping device of damping coefficient C, then the load dynamics are Tm (t) where C d d2 ˆI 2 dt dt is the angular displacement of the rotor. 268       (a) Determine the state and output equations when the state and control variables are x1 ˆ , x2 ˆ x_ 1 , x3 ˆ ia , u ˆ ea (b) Determine the state and output equations when the state and control variables are x1 ˆ , Solution  (a) 0     x_ 1   x_ 2  ˆ  0   x_ 3  0 ˆ [1 0 (b)    0 x3 ˆ x_ 2 ,     0  x1   0  x2  ‡    1  x Ra  3 L C I Ka I Kb La a La 0 ]x 0 x_ 1 0  x_ 2  ˆ    x_ 3 0 ˆ [1 0 1 x2 ˆ x_ 1 , 1   u  0 0 (Ka Kb ‡ Ra C) La I 0 ]x u ˆ ea   0  x1 0  1    u  x2 ‡   Ka  Ra C  x 3 ‡ La I La I    Example 8.15 Find the state and output equations for the positional servomechanism shown in Figure 8.13 when the state and control variable are x1 ˆ c(t), x2 ˆ x_ 1 , u ˆ r(t) Solution x_ 1 x_ 2  0  ˆ K m c ˆ [1 R(s)    0 1 x1 ‡  K u C x2 m m 0 ]x + 1 2 ms + Cs K – Fig. 8.13 )         %   C(s)  R(s) + 4(s + 4) (s + 16) – Fig. 8.14 #          40 s(s + 2)  269 C(s)   Example 8.16 Find the state and output equations for the closed-loop control system shown in Figure 8.14 when the state and control variables are x1 ˆ c(t), x2 ˆ x_ 1 , x3 ˆ x_ 2 , u ˆ r(t) Solution    x_ 1 0  x_ 2  ˆ  0 640 x_ 3 c ˆ [ 640 160 1 0 192     0 0 x1 1  x2  ‡  0 u 1 18 x3 0 ]x Example 8.17 Figure 8.15 shows the block diagram representation of a car cruise control system where U(s) is the desired speed, X(s) is the accelerator position and V(s) is the actual speed. (a) Find the state and output equations when the state and control variables are x1 ˆ x(t), x2 ˆ v(t), u ˆ u(t) (b) Determine the continuous-time state transition matrix F(t). (c) For a sampling time of 0.1 seconds, evaluate from F(t) the discrete-time state transition matrix A(T). Accelerator Servo U(s) + 2 s – Fig. 8.15 #      Vehicle Dynamics X(s) 3 (s + 3) V(s) 27       (d) Using the first three terms of equation (8.80), compute the discrete-time control transition matrix B(T). Using the difference equations x(k  1)T ˆ A(T)x(kT) ‡ Bu(kT) determine values for the state variables when u(kT) is a piece-wise constant function of the form kT (sec) u(kT) 0 10 0.1 15 0.2 20 0.3 25 0.4 30 Assume zero initial conditions. Solution   x_ 1 2 (a) ˆ x_ 2 3 v ˆ [0 (b) F(t) ˆ 0 3  2 u 0 1 ]x  e 2t 0 3t 3( e ‡ e 2t )  0:819 0 (c) A(T) ˆ 0:234 0:741  0:181 (d) B(T) ˆ 0:025 kT (sec) u(kT) x1 x2 e 0 10 0 0 3t 0.1 15 1.81 0.25 0.2 20 4.197 0.984 0.3 25 7.057 2.211 0.4 30 10.305 3.915 Example 8.18 The ship roll stabilization system given in case-study Example 5.11 has a forwardpath transfer function a d (s) ˆ (s ‡ 1)(s2 K ‡ 07s ‡ 2) (a) For the condition K ˆ 1, find the state and output equations when x1 ˆ a (t), x2 ˆ x_ 1 , x_ 3 ˆ x_ 2 and u ˆ d (t). (b) Calculate the controllability matrix and the observability matrix and demonstrate that the system is fully controllable and fully observable. (c) Determine the state feedback gain matrix  that produces a set of desired closedloop poles sˆ 3234  j33 sˆ 32          27 (d) Find the observer gain matrix e for a full-order state observer that produces a set of desired closed-loop poles sˆ 16:15  j16:5 sˆ 16 (e) If output a (t) ˆ x1 is measured, design a reduced-order state observer with desired closed-loop poles sˆ 1615  j165 Solution    x_ 1 0 (a)  x_ 2  ˆ  0 2 x_ 3 a ˆ [ 1 (b) 0  0 ˆ 0 1 det( ) ˆ 1 0 27 0 ]x 0 1 17     0 x1 0 1  x2  ‡  0 u 17 x3 1  1 17  019 1, rank( ) ˆ 3 System fully  1 0 ˆ 0 1 0 0 controllable  0 0 1 det( ) ˆ 1, rank( ) ˆ 3 System fully observable (c)  ˆ [ 6629 3934 7968 ] (d) e ˆ [ 85272 10472 466] (e) e ˆ [ 5303 306 ] 9 Optimal and robust control system design 9.1 Review of optimal control An optimal control system seeks to maximize the return from a system for the minimum cost. In general terms, the optimal control problem is to find a control  which causes the system _  g((t), (t), t) (9:1) to follow an optimal trajectory (t) that minimizes the performance criterion, or cost function Z t1 J h((t), (t), t)dt (9:2) t0 The problem is one of constrained functional minimization, and has several approaches. Variational calculus, Dreyfus (1962), may be employed to obtain a set of differential equations with certain boundary condition properties, known as the Euler± Lagrange equations. The maximum principle of Pontryagin (1962) can also be applied to provide the same boundary conditions by using a Hamiltonian function. An alternative procedure is the dynamic programming method of Bellman (1957) which is based on the principle of optimality and the imbedding approach. The principle of optimality yields the Hamilton±Jacobi partial differential equation, whose solution results in an optimal control policy. Euler±Lagrange and Pontryagin's equations are applicable to systems with non-linear, time-varying state equations and non-quadratic, time varying performance criteria. The Hamilton±Jacobi equation is usually solved for the important and special case of the linear timeinvariant plant with quadratic performance criterion (called the performance index), which takes the form of the matrix Riccati (1724) equation. This produces an optimal control law as a linear function of the state vector components which is always stable, providing the system is controllable. 9.1.1 Types of optimal control problems (a) The terminal control problem: This is used to bring the system as close as possible to a given terminal state within a given period of time. An example is an Optimal and robust control system design 273 (b) (c) (d) (e) automatic aircraft landing system, whereby the optimum control policy will focus on minimizing errors in the state vector at the point of landing. The minimum-time control problem: This is used to reach the terminal state in the shortest possible time period. This usually results in a `bang±bang' control policy whereby the control is set to max initially, switching to min at some specific time. In the case of a car journey, this is the equivalent of the driver keeping his foot flat down on the accelerator for the entire journey, except at the terminal point, when he brakes as hard as possible. The minimum energy control problem: This is used to transfer the system from an initial state to a final state with minimum expenditure of control energy. Used in satellite control. The regulator control problem: With the system initially displaced from equilibrium, will return the system to the equilibrium state in such a manner so as to minimize a given performance index. The tracking control problem: This is used to cause the state of a system to track as close as possible some desired state time history in such a manner so as to minimize a given performance index. This is the generalization of the regulator control problem. 9.1.2 Selection of performance index The decision on the type of performance index to be selected depends upon the nature of the control problem. Consider the design of an autopilot for a racing yacth. Conventionally, the autopilot is designed for course-keeping, that is to minimise the error e (t) between that desired course d (t) and the actual course a (t) in the presence of disturbances (wind, waves and current). Since d (t) is fixed for most of the time, this is in essence a regulator problem. Using classical design techniques, the autopilot will be tuned to return the vessel on the desired course within the minimum transient period. With an optimal control strategy, a wider view is taken. The objective is to win the race, which means completing it in the shortest possible time. This in turn requires: (a) Minimizing the distance off-track, or cross-track error ye (t). Wandering off track will increase distance travelled and hence time taken. (b) Minimizing course or heading error e (t). It is possible of course to have zero heading error but still be off-track. (c) Minimizing rudder activity, i.e. actual rudder angle (as distinct from desired rudder angle) a (t), and hence minimizing the expenditure of control energy. (d) Minimizing forward speed loss ue (t). As the vessel yaws as a result of correcting a track or heading error, there is an increased angle of attack of the total velocity vector, which results in increased drag and therefore increased forward speed loss. From equation (9.2) a general performance index could be written Z t1 J h( ye (t), e (t), ue (t), a (t))dt t0 (9:3) 274 Advanced Control Engineering Quadratic performance indices If, in the racing yacht example, the following state and control variables are defined x1  ye (t), x2  e (t), x3  ue (t), u  a (t) then the performance index could be expressed Z t1 J f(q11 x1 ‡ q22 x2 ‡ q33 x3 ) ‡ (r1 u)gdt (9:4) t0 or Z Jˆ t1 ( ‡ )dt (9:5) t0 If the state and control variables in equations (9.4) and (9.5) are squared, then the performance index become quadratic. The advantage of a quadratic performance index is that for a linear system it has a mathematical solution that yields a linear control law of the form (t) ˆ (t) A quadratic performance index for this example is therefore Z t1     Jˆ q11 x21 ‡ q22 x22 ‡ q33 x23 ‡ r1 u2 dt (9:6) (9:7) t0 Jˆ or, in general  t1 t0  [ x1  x2 Jˆ  t1    x1 0 0  x2 ‡ [u][r1 ][u] dt x3 q33 0 q22 0 q11 x 3 ] 0 0 (T  ‡ T )dt (9:8) t0  and  are the state and control weighting matrices and are always square and symmetric. J is always a scalar quantity. 9.2 The Linear Quadratic Regulator The Linear Quadratic Regulator (LQR) provides an optimal control law for a linear system with a quadratic performance index. 9.2.1 Continuous form Define a functional equation of the form f (, t) ˆ min   t1 t0 h(, )dt (9:9) Optimal and robust control system design 275 where over the time interval t0 to t1 , f (, t0 )  f ((0)) f (, t1 )   From equations (9.1) and (9.2), a Hamilton±Jacobi equation may be expressed as @f ˆ @t min h(, ) ‡  @f @ T g(, ) (9:10) For a linear, time invariant plant, equation (9.1) becomes _ ˆ  ‡  (9:11) And if equation (9.2) is a quadratic performance index  t1 (T  ‡ T )dt Jˆ (9:12) t0 Substituting equations (9.11) and (9.12) into (9.10) @f ˆ @t min T  ‡ T  ‡  @f @ T ( ‡ ) (9:13) Introducing a relationship of the form f (, t) ˆ T  where (9:14) is a square, symmetric matrix, then @f @ ˆ T @t @t  (9:15) and @f ˆ2  @  @f T ˆ 2T @  (9:16) Inserting equations (9.15) and (9.16) into (9.13) gives T @ ˆ @t   min T  ‡ T  ‡ 2T ( ‡ )  (9:17) To minimize , from equation (9.17) @[@f /@t] ˆ 2T  ‡ 2T  ˆ 0 @ (9:18) Equation (9.18) can be re-arranged to give the optimal control law opt ˆ  1 T  (9:19) 276 Advanced Control Engineering or opt ˆ (9:20)  where  ˆ  1 T (9:21) Substituting equation (9.19) back into (9.17) gives T _  ˆ T ( ‡ 2   1 T ) (9:22) since 2T  ˆ T (T ‡ ) then _ ˆ  T  ‡  1 T (9:23) Equation (9.23) belongs to a class of non-linear differential equations known as the matrix Riccati equations. The coefficients of (t) are found by integration in reverse time starting with the boundary condition T (t1 ) (t1 )(t1 ) ˆ  (9:24) Kalman demonstrated that as integration in reverse time proceeds, the solutions of (t) converge to constant values. Should t1 be infinite, or far removed from t0 , the matrix Riccati equations reduce to a set of simultaneous equations  ‡ T ‡   1 T ˆ  (9:25) Equations (9.23) and (9.25) are the continuous solution of the matrix Riccati equation. 9.2.2 Discrete form From equation (8.76) the discrete solution of the state equation is [(k ‡ 1)T] ˆ (T )(kT ) ‡ (T )(kT ) (9:26) For simplicity, if (kT ) is written as (k), then (k ‡ 1) ˆ (T )(k) ‡ (T )(k) (9:27) The discrete quadratic performance index is Jˆ N 1 (T (k)(k) ‡ T (k)(k))T (9:28) kˆ0 The discrete solution of the matrix Riccati equation solves recursively for  and reverse time, commencing at the terminal time, where (N (k ‡ 1)) ˆ [T ‡ T (T ) (N k)(T )] 1 T (T ) (N k)(T ) in (9:29) Optimal and robust control system design 277 and P(N (k ‡ 1)) ˆ [T ‡ T (N (k ‡ 1))T(N (k ‡ 1))] (T )(N T (N (k ‡ 1))] ‡ [(T ) k)[(T ) (T )(N (k ‡ 1))] (9:30) As k is increased from 0 to N 1, the algorithm proceeds in reverse time. When run in forward-time, the optimal control at step k is opt (k) ˆ (9:31) (k)(k) The boundary condition is specified at the terminal time (k ˆ 0), where T (N) (N)(N) ˆ  The reverse-time recursive process can commence with with (N 1) ˆ T. (9:32) (N) ˆ  or alternatively, Example 9.1 (See also Appendix 1, examp91.m) The regulator shown in Figure 9.1 contains a plant that is described by        x_ 1 0 0 1 x1 ‡  ˆ 1 1 2 x2 x_ 2 y ˆ [1 0] and has a performance index Jˆ Z 0 1  T  2 0   0 2  ‡  dt 1 Determine (a) the Riccati matrix (b) the state feedback matrix  (c) the closed-loop eigenvalues r=0 + x u x = Ax + Bu – K Fig. 9.1     C y 278 Advanced Control Engineering Solution (a) 0  1 1 ˆ ˆ 2 2 0 0 1 0 1  ˆ scalar ˆ 1 From equation (9.25) the reduced Riccati equation is  ‡ T ‡  p11 ˆ p21  T ˆ  p12 p22 0 1 1 2   1 T ˆ  0 1    1 p12 ˆ 2 p22 p11 p12 p21 p22 p11 p12 0 p21 p22 1 [ p21 p22 ]  1 T ˆ p12 ˆ p22 ˆ  ˆ  (9:33) 2p12 2p22 p11 p21 p22 p21 2p21 p11 1[ 0 1 ] p12 p21 p12 p22 p22 p21 p222  2p22 p12 p11 p12 p21 p22 (9:34)  (9:35) (9:36) Combining equations (9.34), (9.35) and (9.36) gives p12 p11 2p12 p22 p21 2p22 p22 p21 ‡ p11 ‡ 2p21 p12 2p22 2 0 p12 p21 p12 p22 0 1 p22 p21 p222 (9:37) ˆ Since is symmetric, p21 ˆ p12 . Equation (9.37) can be expressed as four simultaneous equations p12 p11 p12 ‡ 2 2p12 p22 p212 ˆ 0 (9:38) p12 p22 ˆ 0 (9:39) Optimal and robust control system design 279 p22 ‡ p11 p12 p12 p22 ˆ 0 2p12 2p22 ‡ p12 p222 ˆ 0 2p22 ‡ 1 (9:40) (9:41) Note that equations (9.39) and (9.40) are the same. From equation (9.38) p212 ‡ 2p12 2ˆ0 solving p12 ˆ p21 ˆ 0:732 and 2:732 Using positive value p12 ˆ p21 ˆ 0:732 (9:42) From equation (9.41) p222 ˆ 0 4p22 ‡ 1 2p12 p222 ‡ 4p22 2:464 ˆ 0 solving p22 ˆ 0:542 and 4:542 Using positive value p22 ˆ 0:542 (9:43) From equation (9.39) p11 (2  0:732) 0:542 (0:732  0:542) ˆ 0 p11 ˆ 2:403 (9:44) From equations (9.42), (9.43) and (9.44) the Riccati matrix is ˆ 2:403 0:732 0:732 0:542 (9:45) (b) Equation (9.21) gives the state feedback matrix  ˆ  1 T ˆ 1[ 0 1 ] 2:403 0:732 0:732 0:542 Hence  ˆ [ 0:732 0:542 ] (9:46) 28 Advanced Control Engineering (c) From equation (8.96), the closed-loop eigenvalues are s   s    0  ‡ j ˆ 0   0 0 1  ‰ 0:732 0:542 Š ˆ 0 ‡  1 1 2    s  1 0 0   ‡  ˆ0  1 s‡2 0:732 0:542     s 1   ˆ0   1:732 s ‡ 2:542  0 s s2 ‡ 2:542s ‡ 1:732 ˆ 0 s1 , s2 ˆ 1:271  j0:341 In general, for a second-order system, when  is a diagonal matrix and  is a scalar quantity, the elements of the Riccati matrix are  2 b p11 ˆ 2 p12 p22 p22 a21 p12 a22 r  q11 b22 r p12 ˆ p21 ˆ 2 a21  a221 ‡ (9:47) r b2  r (2p12 ‡ q22 ) p22 ˆ 2 a22  a222 ‡ r b2 9.3 The linear quadratic tracking problem The tracking or servomechanism problem is defined in section 9.1.1(e), and is directed at applying a control (t) to drive a plant so that the state vector (t) follows a desired state trajectory (t) in some optimal manner. 9.3.1 Continuous form The quadratic performance index to be minimized is  t1   ( )T ( ) ‡ T  dt Jˆ (9:48) t0 It can be shown that the constrained functional minimization of equation (9.48) yields again the matrix Riccati equations (9.23) and (9.25) obtained for the LQR, combined with the additional set of reverse-time state tracking equations _ ˆ (  1 T )T  (9:49) Optimal and robust control system design 28 Optimal Controller Plant r s –1 s = (A – BR BTP)Ts – Qr v + –1 uopt T –R B y x x = Ax + Bu C – Reverse-Time Equations Command vector Tracking vector K Fig. 9.2     where is a tracking vector, whose boundary condition is (t1 )  0 (9:50) and the optimal control law is given by opt ˆ  1 T   1 T If ˆ  1 T and  ˆ  1 T Then opt ˆ (9:51)  Hence, if the desired state vector (t) is known in advance, tracking errors may be reduced by allowing the system to follow a command vector (t) computed in advance using the reverse-time equation (9.49). An optimal controller for a tracking system is shown in Figure 9.2. 9.3.2 Discrete form The discrete quadratic performance index, writing (kT ) as (k), is Jˆ N 1 [( (k) (k))T ( (k) (k)) ‡ T (k)(k)]T (9:52) kˆ0 Discrete minimization gives the recursive Riccati equations (9.29) and (9.30). These are run in reverse-time together with the discrete reverse-time state tracking equation (N (k ‡ 1)) ˆ (T ) (N k) ‡ (T ) (N k) (9:53) 282 Advanced Control Engineering having the boundary condition (N)  0 (T ) and (T ) are the discrete transition and control matrices and are obtained by converting the matrices in the continuous equation (9.49) into discrete form using equations (8.78) and (8.80). The command vector is given by k) ˆ (N  1 T (N (9:54) k) When run in forward-time, the optimal control at time (kT ) is opt (kT ) ˆ (kT ) (kT )(kT ) (9:55) The values of (kT ) are calculated using the plant state transition equation (k ‡ 1)T ˆ (T )(kT ) ‡ (T )opt (kT ) (9:56) Example 9.2 (See also Appendix 1, examp92.m) The optimal tracking system shown in Figure 9.2 contains a plant that is described by  x_ 1 x_ 2  ˆ  ˆ  0 1 1 0 1  x1 1 x2   0 x1 1 x2  ‡   0 1 u The discrete performance index is Jˆ 200   (r1 (kT ) x1 (kT ))(r2 (kT ) kˆ0   10 0 r1 (kT ) x2 (kT )) 0 1 r2 (kT ) x1 (kT ) x2 (kT )   ‡ u(kT )2 T It is required that the system tracks the following desired state vector r1 (kT ) r2 (kT ) ˆ 1:0 sin (0:6284kT ) 0:6 cos (0:6284kT ) over a period of 0±20 seconds. The sampling time T is 0.1 seconds. In reverse-time, starting with (N) ˆ  at NT ˆ 20 seconds, compute the state feedback gain matrix (kT ) and Riccati matrix (kT ) using equations (9.29) and (9.30). Also in reverse time, use the desired state vector (kT ) to drive the tracking equation (9.53) with the boundary condition (N) ˆ 0 and hence compute the command vector (kT ). In forward-time, use the command vector (kT ) and state vector (kT ) to calculate opt (kT ) in equation (9.55) and hence, using the plant state transition equation (9.56) calculate the state trajectories. Optimal and robust control system design 283 Solution The reverse-time calculations are shown in Figure 9.3. Using equations (9.29) and (9.30) and commencing with (N)  0, it can be seen that the solution for  (and also ) settle down after about 2 seconds to give steady-state values of (kT )  [ 2:0658 1:4880 ]   8:0518 2:3145 (kT )  2:3145 1:6310 (9:57) Using equation (9.49), together with equations (8.78) and (8.80), to calculate (T ) and (T ) in equation (9.53), for T  0:1 seconds, the discrete reverse-time state tracking equation is s1 (N (k ‡ 1)) s2 (N (k ‡ 1)) ˆ 0:9859 0:2700 0:0881 0:7668 0:9952 ‡ s1 (N k) s2 (N k) 0:0141 0:0460 0:0881 r1 (N k) r2 (N k) and k) ˆ (N  s (N 1] 1 s2 (N 1[ 0 k) k)  (9:58) Desired states, Command Vector and Feedback Gains Then the command vector (in this case a scalar) is generated in reverse-time as shown in Figure 9.3. The forward-time response is shown in Figure 9.4. 4 3 k1(kT ) v(kT ) k2(kT ) 2 1 0 –1 r1(kT ) r2(kT ) –2 –3 –4 0 2 4 6 8 Fig. 9.3               12 10 Time (s) 14 16 18 20 28 Advanced Control Engineering Desired States, Actual States and Optimal Control 2 1.5 uopt (kT ) x2(kT ) 1 r2(kT ) 0.5 0 r1(kT ) x1(kT ) –0.5 –1 –1.5 0 2 6 4 Fig. 9.4      8 12 10 Time (s) 14 16 18 20      The optimal control is calculated using equation (9.55) and the values of the state variables are found using the plant state transition equation (9.56) x1 (k  1)T x2 (k  1)T  0:0950 x1 (kT ) 0:0950 0:9002 x2 (kT ) 0:9952 ‡ 0:0048 0:0950 uopt (kT ) (9:59) where (T ) and (T ) are calculated from equations (8.78) and (8.80). From Figure 9.4 it can be seen that after an initial transient period, the optimal control law takes the form of a phase lead compensator. Because of the weighting of the  matrix in the performance index, x1 (kT ) tracks r1 (kT ) more closely than x2 (kT ) tracks r2 (kT ). 9.4 The Kalman filter In the design of state observers in section 8.4.3, it was assumed that the measurements  ˆ  were noise free. In practice, this is not usually the case and therefore ^ may also be contaminated with noise. the observed state vector  9.4.1 The state estimation process State estimation is the process of extracting a best estimate of a variable from a number of measurements that contain noise. The classical problem of obtaining a best estimate of a signal by combining two noisy continuous measurements of the same signal was first solved by Weiner (1949). Optimal and robust control system design 28 His solution required that both the signal and noise be modelled as random process with known statistical properties. This work was extended by Kalman and Bucy (1961) who designed a state estimation process based upon an optimal minimum variance filter, generally referred to as a Kalman filter. 9.4.2 The Kalman filter single variable estimation problem The Kalman filter is a complementary form of the Weiner filter. Let Ax be a measurement of a parameter x and let its variance Pa be given by   2 Pa  E Ax Ax † (9:60) where Ax is the mean and Ef g is the expected value. Let Bx be a measurement from another system of the same parameter and the variance Pb is   Pb ˆ E (Bx Bx )2 (9:61) Assume that x can be expressed by the parametric relationship x ˆ Ax K ‡ Bx (1 (9:62) K) where K is any weighting factor between 0 and 1. The problem is to derive a value of K which gives an optimal combination of Ax and Bx and hence the best estimate of ^ (pronounced x hat). measured variable x, which is given the symbol  Let P be the variance of the weighted mean   P ˆ E (x x)2 (9:63) The optimal value of K is the one that yields the minimum variance, i.e. dP ˆ0 dK (9:64) Substitution of equation (9.62) into (9.63) gives P ˆ K 2 PA ‡ (1 K)2 PB (9:65) Hence K is given by From which d  2 K PA ‡ (1 dK Kˆ  K)2 PB ˆ 0 PB PA ‡ PB Substitution of equation (9.66) into (9.62) provides   PA x^ ˆ Ax (Ax PA ‡ PB (9:66) Bx ) (9:67) 286 Advanced Control Engineering x x Measurement System A x + PA Measurement System B x + PB + 0 – + PA – PB K – Fig. 9.5                 or x^  Ax K(Ax Bx ) (9:68) K is the Kalman gain and the total error variance expected is P ˆ PA K(PA PB ) (9:69) so that x^ ˆ x ‡ PA K(PA PB ) (9:70) Equation (9.70) is illustrated in Figure 9.5. 9.4.3 The Kalman filter multivariable state estimation problem Consider a plant that is subject to a Gaussian sequence of disturbances w(kT ) with disturbance transition matrix d (T ). Measurements (k ‡ 1)T contain a Gaussian noise sequence (k ‡ 1)T as shown in Figure 9.6. The general form of the Kalman filter usually contains a discrete model of the system together with a set of recursive equations that continuously update the Kalman gain matrix  and the system covariance matrix . ^ (k ‡ 1/k ‡ 1) is obtained by calculating the predicted state The state estimate  ^(k ‡ 1/k) from  ^(k ‡ 1/k)T ˆ (T )^  (k/k)T ‡ (T )(kT ) (9:71) and then determining the estimated state at time (k ‡ 1)T using ^(k ‡ 1/k ‡ 1)T ˆ  ^(k ‡ 1/k)T ‡ (k ‡ 1)f(k ‡ 1)T  (T )^ (k ‡ 1/k)Tg (9:72) The term (k/k) means data at time k based on information available at time k. The term (k ‡ 1/k) means data used at time k ‡ 1 based on information available at time k. Similarly (k ‡ 1/k ‡ 1) means data at time k ‡ 1 based on information available at time k ‡ 1. The vector of measurements is given by (k ‡ 1)T ˆ (T )(k ‡ 1)T ‡ (k ‡ 1)T (9:73) Optimal and robust control system design 287 Disturbance noise W(kT ) Plant Measurement noise v(k + 1)T Cd(T ) x(kT ) + A(T ) + u(kT ) + Forward x(k + 1)T Step y(k + 1)T + z(k + 1)T C(T ) + B(T ) Fig. 9.6             where (k  1)T is the measurement vector (T ) is the measurement matrix (k  1)T is a Gaussian noise sequence The Kalman gain matrix  is obtained from a set of recursive equations that commence from some initial covariance matrix (k/k) (k  1/k)  (T ) (k/k)T (T )  d (T )Td (T ) (k  1)  (k  1/k)T (T )f(T ) (k ‡ 1/k)T (T ) ‡ g (k ‡ 1/k ‡ 1) ˆ f (k ‡ 1)(T )g (k ‡ 1/k) (9:74) 1 (9:75) (9:76) The recursive process continues by substituting the covariance matrix (k ‡ 1/k ‡ 1) computed in equation (9.76) back into (9.74) as (k/k) until (k ‡ 1) settles to a steady value, see Appendix 1, script files kalfilc.m for the continuous solution and kalfild.m for the above discrete solution. In equations (9.74)±(9.76) d (T ) is the disturbance transition matrix  is the disturbance noise covariance matrix  is the measurement noise covariance matrix Equations (9.71)±(9.76) are illustrated in Figure 9.7 which shows the block diagram of the Kalman filter. The recursive equations (9.74)±(9.76) that calculate the Kalman gain matrix and covariance matrix for a Kalman filter are similar to equations (9.29) and (9.30) that 288 Advanced Control Engineering 0(k /k)T z(k + 1)T 0(k + 1/k + 1)T Backward Step + + K(k + 1) – + y(k + 1/k)T 0(k / k)T 0(k + 1/k)T + A(T ) C(T ) + u(kT ) B(T ) Fig. 9.7     calculate the feedback matrix and Riccati matrix for a linear quadratic regulator. The difference is that the Kalman filter is computed in forward-time, the LQR being computed in reverse-time. 9.5 Linear Quadratic Gaussian control system design A control system that contains a LQ Regulator/Tracking controller together with a Kalman filter state estimator as shown in Figure 9.8 is called a Linear Quadratic Gaussian (LQG) control system. r(kT ) LQ Optimal Controller z(kT ) uopt (kT ) Plant 0(kT ) Kalman Filter State Estimator Fig. 9.8   !  "  # !"$      Optimal and robust control system design 289 Case study Example 9.3 (See also Appendix 1, examp93.m) China clay is used in the paper, ceramics and fertilizer industries, and is washed from quarry faces, by high pressure hoses. A pressing operation reduces the moisture content in the clay to about 30%, and then the clay is extruded into small cylindrical shaped noodles. The clay noodles are then passed through the band drying oven shown in Figure 9.9 at rates varying between 2 and 15 tonnes/hour. Upon exit, the moisture content of the clay should be controlled to a desired level of between 4 and 12%, with a deviation of no more than 1%. The process air is heated by mixing the exhaust gas from a gas burner with a large quantity of dilution air to meet the specified air flow-rate into the dryer. An existing control arrangement uses a PID controller to control the temperature of the process air (measured by thermocouples) and the dry clay moisture content measured by samples taken by the works laboratory. If this is out of specification, then the process air temperature is raised or lowered. The dry clay moisture content can be measured by an infrared absorption analyser, but on its own, this is considered to be too noisy and unreliable. The important process parameters are (a) Burner exhaust temperature tb (t) ( C) (b) Dryer outlet temperature td (t) ( C) (c) Dryer outlet clay moisture content mf (t) (%) The important control parameters are (i) Burner gas supply valve angle va (t) (rad) (ii) Dryer clay feed-rate fi (t) (tonnes/hour) Process Air Wet Clay In Top Band Middle Band Dry Clay Out Lower Band Exhaust Air Fig. 9.9 %    29 Advanced Control Engineering A proposed control scheme by Drew and Burns (1992) uses an LQG design, whereby the three process parameters are controlled in an optimal manner, their values (particularly the moisture control) being estimated. System model: The dynamic characteristics of the dryer were measured experimentally. This yielded the following transfer functions Burner model G1 (s)  Tb 420 (s)  1  47s Va (9:77) G2 (s)  Td 0:119 (s)  1  200s Tb (9:78) G31 (s)  Mf 0:167 (s)  1 ‡ 440s Td (9:79) G32 (s) ˆ Mf 0:582 (s) ˆ 1 ‡ 440s Fi (9:80) Dryer model Moisture models Equations (9.79) and (9.80) can be combined to give Mf (s) ˆ 0:167Td (s) ‡ 0:582Fi (s) 1 ‡ 440s (9:81) The block diagram of the system is shown in Figure 9.10. Continuous state-space model: From equations (9.77)±(9.81) 47t_b ‡ tb (t) ˆ 420va (t) 200t_d ‡ td (t) ˆ 0:119td (t) 440m_ f ‡ mf (t) ˆ Fi(s) Clay Feed-rate (Disturbance input) Va(s) Valve Angle (9:82) 0:167td (t) ‡ 0:582fi (t) Kf Tb(s) G1(s) Moisture Dryer Burner Tb(s) Fig. 9.10 &         Tc(s) G2(s) Td(s) Kd – + G3(s) Moisture Content Mf(s) Dryer Temperature Td(s) Burner Temperature Tb(s) Optimal and robust control system design 29 Define the state variables x1  tb , x2  td , x3  mf and the control variables u1  v a and the disturbance variables w1  0, w2  0, w3  fi then equations (9.82) can now be written as x_ 1 ˆ 0:02128x1 ‡ 8:93617u1 ‡ cd11 w1 x_ 2 ˆ 0:00060x1 0:00500x2 ‡ cd22 w2 x_ 3 ˆ 0:00038x2 0:00227x3 ‡ 0:00132w3 (9:83) where cd11 and cd22 are unknown burner and dryer disturbance coefficients, and are given an arbitrary value of 0.1. The state equations are written in the form _ ˆ  ‡  ‡ d   x_ 1   0:0213 0 0  x1          x_ 2  ˆ 0:0006  x2  ‡  0:005 0     0 0:00038 0:0023 x3 x_ 3    w1 0:1 0 0     w2  ‡ 0   0 0:1 w3 0 0 0:00132 8:9362 0 0    u1 and the output equation is  tb  td mf   1 ˆ 0 0   0 0 x1 1 0  x2 0 1 x3 (9:84) Discrete system model: The discrete system model (without disturbances) is given by (k ‡ 1)T ˆ (T )(kT ) ‡ (T )(kT ) For a sampling time of 2 seconds, from equations (8.78) and (8.80)     17:4974 0:9583 0 0 ; (T ) ˆ  0:0105 (T ) ˆ  0:0012 0:9900 0 0 0 0:0008 0:9955 LQR Design: Using the quadratic performance index  1 Jˆ (T  ‡ T )dt 0 (9:85) (9:86) 292 Advanced Control Engineering where  and  are diagonal matrices  q11 0    0 q22 0 0 of the form   0 r 0 ;   11 0 q33 0 r22  (9:87) From equations (9.20) and (9.21), the optimal control law is opt ˆ  where  ˆ  1 T (9:88) The design procedure employed was to maintain  as unity scalar, and systematically vary the diagonal elements of  to achieve the performance specification. This was to maintain a dry clay moisture content of 6%, 1%, as the clay feed-rate varied from 6 to 10 tonnes/hour. Also the drying oven temperature td should not vary more than 3  C from the set point of 50  C. At each design setting, the clay feed-rate was varied according to w3 (t) ˆ 8 ‡ 2sin(0:00154t) (9:89) Some results are presented in Table 9.1. It was found that q11 had little effect, and was set to zero. From Table 9.1, the settings that meet the performance specification are   0 0 0  ˆ  0 0:5 0 rˆ1 (9:90) 0 0 20 From equation (9.25), the Riccati matrix is  0 0:1 ˆ  0:1 10:8 0:2 30 0:2 30 3670:4  (9:91) which gives, from equation (9.88), the feedback gain matrix  ˆ [ 0:0072 0:6442 1:8265 ] (9:92) The same results are also obtained from the discrete equations (9.29) and (9.30).   Variations in dryer temperature and moisture content q22 q33 3 1 0.5 0.5 0.5 0.5 1 3 3 6 10 20 Variation in temperature td ( C) Max 0.17 0.99 1.524 2.05 2.42 2.86 Min 0 0 0 2.05 2.42 2.86 Variation in moisture content (%) Max 2.09 1.74 1.5 1.27 1.1 0.89 Min 2.11 2.13 2.15 1.27 1.1 0.89 Optimal and robust control system design 293 The closed-loop eigenvalues are sˆ sˆ 0:0449  j0:0422 0:0033 (9:93) Implementation: The optimal control law was implemented by using 1 ˆ  where ˆ( (9:94) ) This is shown in Figure 9.11. A discrete simulation was undertaken using equations (9.85) and (9.86) together with a disturbance transition matrix d (T ), which was calculated using d in equation (9.84) and equation (8.80) for (T ), with a sampling time of 2 seconds.  0:1958 d (T ) ˆ  0:0001 0 0 0 0:199 0 0:0001 0:0026  (9:95) The desired state vector was  450 ˆ  50 6  (9:96) Note that the moisture content r3 is negative because of the moisture model in equation (9.79). The initial conditions were  200 (0) ˆ  30 30  (9:97) w Optimal Controller r + – e u1 K Fig. 9.11         x = Ax + Bu + Cdw Dryer y x C 29 Advanced Control Engineering and the disturbance vector  0 w 0 w3  (9:98) where w3 , the clay feed-rate was set at a value between 6 and 10 tonnes/hour. Figure 9.12 shows the time response of u1 (t), the gas-valve angle in radians. The valve angle was not allowed to have a negative value, so remained closed for the first 80 seconds of the simulation, when the dryer was cooling. The steady-state angle was 0.95 radians, or 54 . Figure 9.13 indicates the burner temperature time response tb (t). The temperature falls from its initial value, since the gas valve is closed, and then climbs with a response indicated by the eigenvalues in equation (9.93) to a steady-state value of 400  C, or a steady-state error of 50  C. Figure 9.14 shows the combined response of the dryer temperature td (t) and the moisture content mf (t), the latter being shown as a positive number. The dryer temperature climbs to 48  C (steady-state error of 2  C) and the moisture falls to 6%, with no steady-state error. In this simulation the clay feed-rate w3 (t) was constant at 8 tonnes/hour. As the band dryer is a type zero system, and there are no integrators in the controller, steady-state errors must be expected. However, the selection of the elements in the  matrix, equation (9.90), focuses the control effort on control1.4 1.2 Valve Angle (rad) 1 0.8 0.6 0.4 0.2 0 0 100 200 300 400 500 Time (s) Fig. 9.12         u (t) 600 700 800 900 1000 Optimal and robust control system design 29 450 400 Burner Temperature (°C) 350 300 250 200 150 100 50 0 0 100 200 300 400 500 600 700 800 900 1000 Time (s) Fig. 9.13             t (t) ling the moisture content, at the expense of, in particular, the burner temperature tb (t). Figure 9.15 shows the final 500 seconds of the moisture content simulation as the clay feed-rate is varied between 6 and 10 tonnes/hour. After 1 000 seconds, as the clay leaves the dryer, the moisture content is between 5.2% and 6.8%, which is within the specification of 1% of the set point of 6%. Kalman filter design: If the three stages of the covariance matrix are written as (k/k) ˆ 1 ; (k ‡ 1/k) ˆ 2 and (k ‡ 1/k ‡ 1) ˆ 3 , then recursive equations (9.74), (9.75) and (9.76) become 2 ˆ ˆ 3 ˆf 1 T ‡ d Td T T 2  f 2  g ‡ g 1 (9:99) 2 Equation set (9.99) is simpler to visualize, but remember the system matrices are the transition matrices (T ), (T ) and d (T ). Before recursion can start, values for , the measurement noise covariance matrix, and , the disturbance noise covariance matrix must be selected. Measurement noise covariance matrix : The main problem with the instrumentation system was the randomness of the infrared absorption moisture content analyser. A number of measurements were taken from the analyser and compared with samples taken simultaneously by work laboratory staff. The errors could be approximated to a normal distribution with a standard deviation of 2.73%, or a variance of 7.46. 296 Advanced Control Engineering Dryer Temperature (°C) and Moisture Content (%) 60 50 40 Dryer Temperature 30 Moisture Content 20 10 0 0 100 200 Fig. 9.14 '      300 400 500 600 Time (s) 700 800 900 1000        t (t)        mf (t) 12 Feed-rate = 6 tonnes/hr Feed-rate = 8 tonnes/hr Moisture Content (%) 10 Feed-rate = 10 tonnes/hr 8 Upper limit 6 lower limit 4 2 0 500 550 600 650 Fig. 9.15 (       700 750 800 Time (s) 850 900 950 1000 Optimal and robust control system design 297 The thermocouples measuring the burner and dryer temperatures were relatively noise-free, with standard deviations in the order of 0:1  C. The variance was therefore set at 0.01, giving   0:01 0 0 (9:100)  0 0:01 0 0 0 7:46 Disturbance noise covariance matrix : This was set as a diagonal matrix, where q11 and q22 represent changes in the burner and dryer temperatures as a result of changing heat transfer through the walls of the dryer, due to wind and variations in external temperature. On the other hand, q33 is a measure of clay feed-rate variations, and a standard deviation of 0.3 tonnes/hour seemed appropriate. In the absence of any other information, standard deviations of the burner and dryer temperatures was also thought to be in the order of 0:3  C. Thus, when these values are squared, the  matrix becomes   0:1 0 0    0 0:1 0 (9:101) 0 0 0:1 Before equations (9.99) can be run, and initial value of (k/k) is required. Ideally, they should not be close to the final value, so that convergence can be seen to have taken place. In this instance, (k/k) was set to an identity matrix. Figure 9.16 shows the diagonal elements of the Kalman gain matrix during the first 20 steps of the recursive equation (9.99). 1.2 1 Kalman Gains 0.8 k22 0.6 0.4 k11 k33 0.2 0 1 3 5 7 9 11 Step Number Fig. 9.16 '             ) 13 15 17 19 40 Measured and Filtered Moisture Content (%) 35 30 25 20 15 10 5 0 0 100 200 300 400 500 Time (s) Fig. 9.17 &               600 700 800 900 1000 Optimal and robust control system design 299 The final values of the Kalman Gain matrix  and covariance matrix  0:4408    0:0003 0  0:0003 0 ; 0:4579 0 0:0006 0:0325  0:0044 ˆ 0 0 0 0:0046 0 0 0 0:2426  were (9:102) The full LQG system, comprising of the LQ optimal controller and Kalman filter was then constructed. Figure 9.17 shows a set of moisture content measurements z3 (kT ) ^3 (kT ). together with the estimated moisture content  9.6 9.6.1 Robust control Introduction The robust control problem is to find a control law which maintains system response and error signals within prescribed tolerances despite the effects of uncertainty on the system. Forms of uncertainty include . . . . Disturbance effects on the plant Measurement noise Modelling errors due to nonlinearities Modelling errors due to time-varying parameters In previous chapters, linear models have been used to describe plant dynamics. However, in section 2.7.1 it was demonstrated that nonlinear functions could be linearized for small perturbations about an operating point. It is therefore possible to describe a nonlinear system by a series of linear models each constructed about a known operating point. If the operating point can be linked to a measurement, then a simple robust system may be constructed using an LQG approach. The feedback and Kalman gain matrices are calculated in advance for each operating point and some form of interpolation used to provide a `Gain Scheduling Controller.' The disturbance and measurement noise is taken into account by the Kalman filter. In the following example, undertaken by the author (1984), a non-linear simulation of a ship of length 161 m and displacement 17 000 tonnes was given a series of step changes in demanded rudder-angle at forward speeds of 2.572 m/s (5 knots), 5.145 m/s (10 knots) and 7.717 m/s (15 knots). At each forward speed a linear model was constructed and the  and  matrices in an LQG implementation selected to return the closed-loop eigenvalues back to some desired value (Ackermann's formula could not be used since (t) and (t) were vector, not scalar quantities). A subset of the state error variables is e1 (t) ˆ cross-track position error e2 (t) ˆ cross-track velocity error e3 (t) ˆ heading error e4 (t) ˆ heading-rate error 300 Advanced Control Engineering The feedback control is of the form opt   where the values of  for the three forward speeds are 2:572  [0:0121 5:145  [0:0029 7:717  [0:0013 1:035 7:596 0:3292 1:81 0:1532 0:8419 160:26] 25:963] (9:103) 8:047] If the forward velocity of the ship is the state variable us , a best estimate of which is given by the Kalman filter, the gain scheduling controller can be expressed as k1  0:08us 2:0 k2 ˆ 6:0us 1:8 (9:104) k3 ˆ 50:0us 2:0 k4 ˆ 2090:0us 2:72 Equation set (9.104) approximates to an inverse square law, and increases the controller gains at low speeds, where the control surfaces are at their most insensitive. In general, however, robust control system design uses an idealized, or nominal model of the plant Gm (s). Uncertainty in the nominal model is taken into account by considering a family of models that include all possible variations. The control system is said to have robust stability if a controller can be found that will stabilize all plants within the family. However, on its own, robust stability is not enough, since there may be certain plants within the family that are on the verge of instability. A controller is said to have robust performance if all the plants within the family meet a given performance specification. 9.6.2 Classical feedback control Figure 9.18 shows a classical feedback control system D(s) is a disturbance input, N(s) is measurement noise, and therefore Y(s) ˆ G(s)U(s) ‡ D(s) B(s) ˆ Y(s) ‡ N(s) U(s) ˆ C(s)(R(s) B(s)) R(s) + – Controller/Compensator U(s) E(s) C(s) (9:105) Plant D(s) + + B(s) Fig. 9.18 '        Y(s) G(s) + + N(s) Optimal and robust control system design 301 Eliminating U(s) and B(s) from equations (9.105) gives Y(s)  G(s)C(s)R(s) D(s)  1  G(s)C(s) 1  G(s)C(s) G(s)C(s)N(s) 1 ‡ G(s)C(s) (9:106) Define a sensitivity function S(s) that relates Y(s) and D(s) when R(s) ˆ N(s) ˆ 0 Y 1 (s) ˆ S(s) ˆ D 1 ‡ G(s)C(s) (9:107) and define a complementary sensitivity function T(s) ˆ 1 S(s) ˆ G(s)C(s) 1 ‡ G(s)C(s) (9:108) Thus, when N(s) ˆ 0, equation (9.106) may be written Y(s) ˆ T(s)R(s) ‡ S(s)D(s) (9:109) If T(s) ˆ 1 and S(s) ˆ 0 there is perfect set-point tracking and disturbance rejection. This requires that G(s)C(s) is strictly proper (has more poles than zeros), so that lim G(s)C(s) ˆ 0 (9:110) s!1 However, if N(s) 6ˆ 0, then equation (9.106) becomes Y(s) ˆ T(s)R(s) ‡ S(s)D(s) T(s)N(s) (9:111) Hence, if T(s) ˆ 1, there will be both perfect set-point tracking and noise acceptance. Considering the problem in the frequency domain however, it may be possible that at low frequencies T( j!) ! 1 (good set-point tracking) and at high frequencies T( j!) ! 0 (good noise rejection). 9.6.3 Internal Model Control (IMC) Consider the system shown in Figure 9.19 G(s) is the plant, Gm (s) is the nominal model, R(s) is the desired value, U(s) is the control, D(s) is a disturbance input, Y(s) is the output and N(s) is the measurement noise. C(s) is called the IMC controller and is to be designed so that y(t) is kept as close as possible to r(t) at all times. From Figure 9.19, the feedback signal B(s) is B(s) ‡ G(s)U(s) ‡ D(s) ‡ N(s) Gm (s)U(s) or B(s) ˆ (G(s) Gm (s))U(s) ‡ D(s) ‡ N(s) (9:112) If, in equation (9.112) the model is exact, i.e. Gm (s) ˆ G(s) and the disturbance D(s) and noise N(s) are both zero, then B(s) is also zero and the control system is effectively open-loop. This is the condition when there is no uncertainty. However, if Gm (s) 6ˆ G(s), and D(s) and N(s) are not zero, then B(s) expresses the uncertainty of the process. 302 Advanced Control Engineering R(s) + E(s) C(s) U(s) D(s) + G(s) Y(s) + + + – N(s) B(s) – Gm(s) + Fig. 9.19 %      &'   9.6.4 IMC performance From Figure 9.19 Y(s)  G(s)U(s)  D(s) B(s)  Y(s)  N(s) U(s) ˆ C(s)(R(s) Gm (s)U(s) (9:113) B(s)) Eliminating U(s) and B(s) from equations (9.113) gives Y(s) ˆ G(s)C(s)R(s) (1 C(s)Gm (s))D(s) ‡ 1 ‡ C(s)(G(s) Gm (s)) 1 ‡ C(s)(G(s) Gm (s)) G(s)C(s)N(s) 1 ‡ C(s)(G(s) Gm (s)) (9:114) The sensitivity function S(s) that relates Y(s) and D(s) when R(s) ˆ N(s) ˆ 0 is Y 1 C(s)Gm (s) (s) ˆ S(s) ˆ D 1 ‡ C(s)(G(s) Gm (s)) (9:115) and the complementary sensitivity function T(s) ˆ 1 S(s) ˆ C(s)G(s) 1 ‡ C(s)(G(s) Gm (s)) (9:116) Thus, when N(s) ˆ 0, equation (9.114) may be written Y(s) ˆ T(s)R(s) ‡ S(s)D(s) (9:117) If T(s) ˆ 1 there is perfect set-point tracking. This will occur if Gm (s) ˆ G(s) and C(s) ˆ 1/G(s). If S(s) ˆ 0 there is perfect disturbance rejection. Again, this will occur if Gm (s) ˆ G(s) and C(s) ˆ 1/Gm (s). Two degree-of-freedom IMC system If good set-point tracking and good disturbance rejection is required when the dynamic characteristics of R(s) and D(s) are substantially different, then it may be Optimal and robust control system design 303 D(s) R(s) Cr(s) + U(s) – G(s) Y(s) + + + B(s) Gm(s) – + N(s) + Cd(s) Fig. 9.20        &'   necessary to introduce a second controller, which provides a second degree-of-freedom of control action. A two degree-of-freedom IMC system is shown in Figure 9.20. With a two degree-of-freedom IMC system, equation (9.114) becomes Y(s)  G(s)Cr (s)R(s) (1 Cd (s)Gm (s))D(s) ‡ 1  Cd (s)(G(s) Gm (s)) 1 ‡ Cd (s)(G(s) Gm (s)) G(s)Cd (s)N(s) 1 ‡ Cd (s)(G(s) Gm (s)) (9:118) In equation (9.118) Cr (s) is designed for set-point tracking and Cd (s) for disturbance rejection. 9.6.5 Structured and unstructured model uncertainty Unstructured model uncertainty relates to unmodelled effects such as plant disturbances and are related to the nominal plant Gm (s) as either additive uncertainty `a (s) G(s) ˆ Gm (s) ‡ `a (s) (9:119) or multiplicative uncertainty `m (s) G(s) ˆ (1 ‡ `m (s))Gm (s) (9:120) Equating (9.119) and (9.120) gives `a (s) ˆ `m (s)Gm (s) (9:121) Block diagram representations of additive and multiplicative model uncertainly are shown in Figure 9.21. Structured uncertainty relates to parametric variations in the plant dynamics, i.e. uncertain variations in coefficients in plant differential equations. 304 Advanced Control Engineering ℓm(s) ℓa(s) + + Gm(s) + Gm(s) + (b) Multiplicative Uncertainty (a) Additive Mode Uncertainty Fig. 9.21 *         9.6.6 Normalized system inputs All inputs to the control loop (changes in set-point or disturbances) are generically represented by V(s). The input V(s) is found by passing a mathematically bounded normalized input V 1 (s) through a transfer function block W(s), called the input weight, as shown in Figure 9.22. Specific inputs Impulse V 1 (s)  1 V 1 (s)  1 Step W(s)  1 (9:122) W(s)  1/s Thus for specific inputs V(s)  W(s)V 1 (s)  W(s) (9:123) Sets of bounded inputs may be represented by  1 2 v (t)  2 Z 1 (v1 (t))2 dt  1 (9:124) 0 The left-hand side of equation (9.124) is called `the 2-norm of the input signal v1 (t) squared'. Norms are mathematical measures that enable objects belonging to the 1 V (s) Fig. 9.22       +   W(s) V(s)     V (s)       V(s) Optimal and robust control system design 305 same set to be compared. Using Parseval's theorem, equation (9.124) may be transformed into the frequency domain  1 2 1 v (t)  2 2 Z  2   V( j!)  d!  1 W( j!) 1 1 (9:125) For a realizable controller to exist, all external signals that enter the control loop must be bounded. 9.7 9.7.1 2 - and ¥ -optimal control Linear quadratic 2 -optimal control The scalar version of equation (9.48), when (t) is not constrained, and Q is unity, is called the Integral Squared Error (ISE), i.e. ISE ˆ Z t1 e2 (t)dt (9:126) t0 The H2 -optimal control problem is to find a contoller c(t) such that the 2-norm of the ISE (written ke(t)k22 ) is minimized for just one specific input v(t). If, in equation set (9.105) B(s) and Y(s) are eliminated and U(s) is written as C(s)E(s), then 1 fR(s) D(s) N(s)g E(s) ˆ 1 ‡ G(s)C(s) ˆ S(s)fR(s) D(s) N(s)g (9:127) Also, from equation (9.123), for a specific input V(s) ˆ W(s) (9:128) Using Parseval's theorem, from equation (9.126) the H2 -optimal control problem can be expressed in the frequency domain as Z 1 1 jE( j!)j2 d! (9:129) minke(t)k22 ˆ min c c 2 1 Substituting equations (9.127) and (9.128) into (9.129) gives Z 1 1 minke(t)k22 ˆ min jS( j!)W( j!)j2 d! c 2 c 1 (9:130) Thus the H2 -optimal controller minimizes the average magnitude of the sensitivity function weighted by W( j!), where W( j!) depends upon the specific input V( j!). In mathematical terms, the controller minimizes the 2-norm of the sensitivity function weighted by W( j!). 306 Advanced Control Engineering 9.7.2 ¥ -optimal control With H1 -optimal control the inputs V( j!) are assumed to belong to a set of normbounded functions with weight W( j!) as given by equation (9.125). Each input V( j!) in the set will result in a corresponding error E( j!). The H1 -optimal controller is designed to minimise the worst error that can arise from any input in the set, and can be expressed as minke(t)k1 ˆ min supjS( j!)W( j!)j (9:131) c c ! In equation (9.131), sup is short for supremum, which means the final result is the least upper bound. Thus the H1 -optimal controller minimizes the maximum magnitude of the weighted sensitivity function over frequency range !, or in mathematical terms, minimizes the 1-norm of the sensitivity function weighted by W( j!). 9.8 9.8.1 Robust stability and robust performance Robust stability Robust stability can be investigated in the frequency domain, using the Nyquist stability criterion, defined in section 6.4.2. Consider a Nyquist contour for the nominal open-loop system Gm ( j!)C( j!) with the model uncertainty given by equation (9.119). Let `a (!) be the bound of additive uncertainty and therefore be the radius of a disk superimposed upon the nominal Nyquist contour. This means that G( j!) lies within a family of plants  (G( j!) 2 ) described by the disk, defined mathematically as  ˆ fG : jG( j!) Gm ( j!)j  `a (!)g (9:132) and therefore j`a ( j!)j  `a (!) (9:133) If the multiplicative uncertainty in equations (9.120) and (9.121) is defined as `m ( j!) ˆ `a ( j!) Gm ( j!)C( j!) (9:134) and the bound of multiplicative uncertainty `m (!) ˆ `a (!) jGm ( j!)C( j!)j (9:135) From equation (9.135) the disk radius (bound of uncertainty) is `a (!) ˆ jGm ( j!)C( j!)j`m (!) (9:136) From the Nyquist stability criterion, let N(k, G( j!)) be the net number of clockwise encirclements of a point (k, 0) of the Nyquist contour. Assume that all plants in the family , expressed in equation (9.132) have the same number (n) of right-hand plane (RHP) poles. Optimal and robust control system design 307 Im (–1,0) Re |Gm(jω)C(jω)| |1 + Gm(jω)C(jω)| |1 + G(jω)C(jω)| for some G(jω)∈π |Gm(jω)C(jω)|lm(ω) Fig. 9.23     There will be robust stability of a specific controller C( j!) if and only if N( 1, G( j!)C( j!)) ˆ n for all G( j!) 2  (9:137) It is also necessary for the nominal plant Gm ( j!) to be stable N( 1, Gm ( j!)C( j!)) ˆ (9:138) n From Figure 9.23 robust stability occurs when the vector magnitude j1 ‡ Gm ( j!)C( j!)j (see also Figure 6.25) exceeds the disk radius jGm ( j!)C( j!)j`m (!) j1 ‡ Gm ( j!)C( j!)j > jGm ( j!)C( j!)j`m (!) for all ! or    Gm ( j!)C( j!)    1 ‡ G ( j!)C( j!)`m (!) < 1 (9:139) m Equation (9.139) uses the magnitude of the complementary sensitivity function T( j!) as defined in equation (9.108). Thus jT( j!)j`m (!) < 1 for all ! (9:140) Robust stability can therefore be stated as: `If all plants G(s) in the family  have the same number of RHP poles and that a particular controller C(s) stabilizes the nominal plant Gm (s), then the system is robustly stable with the controller C(s) if and only if the complementary sensitivity function T(s) for the nominal plant Gm (s) satisfies the following bound kT( j!)`m (!)k1 ˆ supjT( j!)`m (!)j < 1 (9:141) ! where the LHS of equation (9.141) is the infinity norm of T( j!)`m ( j!). This means that robust stability imposes a bound on the 1 norm of the complementary sensitivity function T( j!) weighted by `m (!)'. 308 Advanced Control Engineering 9.8.2 Robust performance Robust stability provides a minimum requirement in an environment where there is plant model uncertainty. For a control system to have robust performance it should be capable of minimizing the error for the worst plant (i.e. the one giving the largest error) in the family G( j!)  . For the H1 -control problem, from equation (9.131), the 1-norm of the weighted sensitivity function can be written kSW k1 ˆ supjS( j!)W( j!)j (9:142) ! If, as part of the design process, a bound is placed upon the sensitivity function jS( j!)j < jW( j!)j 1 (9:143) Should an H1 controller be found such that kSW k1 < 1 (9:144) then the bound in equation (9.143) is met. Hence, for robust performance kSW k1 ˆ supjS( j!)W( j!)j < 1 for all G( j!) 2  (9:145) ! From Figure 9.23 representing robust stability, the actual frequency response G( j!)C( j!) will always lie inside the region of uncertainty denoted by the disk, or j1 ‡ G( j!)C( j!)j  j1 ‡ Gm ( j!)C( j!)j jGm ( j!)C( j!)j`m (!) for all G( j!) 2  (9:146) giving     1   jS( j!)j ˆ  1 ‡ G( j!)C( j!) 1 jSm ( j!)j jTm ( j!)j`m (!) for all G( j!) 2  (9:147) where Sm ( j!) is the sensitivity function for the nominal plant Sm ( j!) ˆ 1 1 ‡ Gm ( j!)C( j!) (9:148) Using equation (9.147), equation (9.145) can be expressed as jSm ( j!)W( j!)j <1 1 jTm ( j!)j`m (!) for all ! (9:149) or jTm ( j!)`m (!)j ‡ jSm ( j!)W( j!)j < 1 for all ! (9:150) Optimal and robust control system design 309 D(s) R(s) + 1 (1+s)(1+2s) K – + Y(s) + B(s) Fig. 9.24 '     Robust performance then means that the closed-loop system will meet the performance specification given in equation (9.145) if and only if the nominal system is closed-loop stable (equation (9.141)) and that the sensitivity function Sm ( j!) and complementary sensitivity function Tm ( j!) for the nominal system satisfy the relationship given in equation (9.150). Example 9.4 (a) For the control system shown in Figure 9.24 produce the Bode magnitude plots for the sensitivity function S( j!) and the complementary sensitivity function T( j!) when K  10. Comment on their values. (b) For a step input, let W(s)  1/s. Produce Bode magnitude plots for S( j!)W( j!) when K  10, 50 and 100 and identify the optimal value using both H2 and H1 criteria. Use a frequency range of 0.01±100 rad/s for both (a) and (b). Solution (a) From equation (9.107) S(s) ˆ ˆ 1 1 ˆ K 1 ‡ G(s)C(s) 1 ‡ (1‡s)(1‡2s) 2s2 2s2 ‡ 3s ‡ 1 ‡ 3s ‡ (1 ‡ K) (9:151) From equation (9.108) T(s) ˆ 1 ˆ 2s2 S(s) ˆ 1  2s2 ‡ 3s ‡ 1 2 2s ‡ 3s ‡ (1 ‡ K) K ‡ 3s ‡ (1 ‡ K)  (9:152) The Bode magnitude plots for jS( j!)j and jT( j!)j are shown in Figure 9.25 for K ˆ 10. From Figure 9.25 it can be seen that up to 1 rad/s, the system has a setpoint tracking error of 0:8 dB (jT( j!)j) and a disturbance rejection of 20 dB (jS( j!)j). 310 Advanced Control Engineering (b) For a specific input of a unit step, let W(s)  1/s. Hence the weighted sensitivity function is S(s)W(s)  2s2  3s  1 sf2s2 ‡ 3s ‡ (1 ‡ K)g (9:153) The Bode magnitude plots for jS( j!)W( j!)j for K ˆ 10, 50 and 100 are shown in Figure 9.26. From Figure 9.26 it can be seen that the H2 -norm, or average value of the weighted sensitivity function (equation (9.130)) reduces as K increases and hence, using this criteria, K ˆ 100 is the best value. Using the H1 -norm as defined in equation (9.131), the maximum magnitude of the weighted sensitivity function occurs at the lowest frequency. The least upper bound therefore is 0 dB, occurring at 0.01 rad/s when K ˆ 100, so this again is the best value. Example 9.5 A closed-loop control system has a nominal forward-path transfer function equal to that given in Example 6.4, i.e. Gm (s)C(s) ˆ K s(s2 ‡ 2s ‡ 4) 10 0 |S(jω)| –10 |T(jω)| Gain (dB) –20 –30 –40 –50 –60 –70 –2 10 –1 10 0 10 Frequency (rad/s) Fig. 9.25 %         jS( ,!)j  jT ( ,!)j 1 10 2 10 Optimal and robust control system design 311 Let the bound of the multiplicative model uncertainty be 0:5(1  s) `m (s)  (1  0:25s) What is the maximum value that K can have for robust stability? Solution At frequencies below 1 rad/s, `m (!)  0:5 and at frequencies above 4 rad/s `m (!)  2:0. From equation (9.141), for robust stability T( j!)`m (!) < 1 (9:154) now T(s)  therefore Gm (s)C(s) 1  Gm (s)C(s) T(s)  T(s)  1 K s3 2s2 4s  s3 2sK2 4s K s3  2s2  4s  K 20 10 0 K = 10 |S(jω)W(jω)| –10 K = 50 –20 –30 K = 100 –40 –2 10 –1 10 0 10 Frequency (rad/s) Fig. 9.26 %                   () - . 1 10 2 10 312 Advanced Control Engineering 10 0 K = 3.5 –10 – |T(jω)lm(ω)| (dB) –20 K=2 –30 –40 –50 –2 10 –1 0 10 10 1 10 Frequency (rad/s) Fig. 9.27 %     T ( j!)`m (!)   () - / thus 0:5K(1  s) (9:155) (1  0:25s)(s3  2s2  4s  K) The Bode magnitude plot for equation (9.155) is shown in Figure 9.27 when K  2 and 3.5. In Example 6.4, when there was no model uncertainty, K for marginal stability was 8, and for a gain margin of 6 dB, K was 4. In this example with model uncertainty, from equation (9.154) marginal stability occurs with K  3:5, so this is the maximum value for robust stability. For robust performance, equation (9.150) applies. For a specific step input let W(s)  1/s now s3  2s2  4s Sm (s)  3 (9:156) s  2s2  4s  K and s(s2  2s  4) Sm (s)W(s)  3 s(s  2s2  4s  K) hence T(s)`m (s)  Sm (s)W(s)  s2  2s  4 s3  2s2  4s  K (9:157) The Bode magnitude plot of the weighted sensitivity function is shown in Figure 9.28 for K  2, 2.5 and 3.5. Optimal and robust control system design 313 10 5 2 dB 0 |S(jω)W(jω)| K=2 K = 2.5 K = 3.5 dB –5 –10 –15 –20 –2 10 –1 1 0 10 10 10 Frequency (rad/s) Fig. 9.28 %                   () - / For robust performance   Tm ( j!)  `m (!)  Sm ( j!)W( j!) < 1 for all ! (9:158) From Table 9.2 it can be concluded that: (a) The control system has robust stability up to K  3:5. (b) The H1 -norm is >1 for all values of K considered. Therefore equations (9.145) and (9.150) are not met and the system cannot be considered to have robust performance. From (b) above, it must be concluded that the controller C(s) must be something more sophisticated than a simple gain constant K.   Robust performance for Example 9.5 ! (rad/s) 0.01 1.5 K 2 2.5 3.5 2 2.5 3.5 jTm (j!)`m (!)j 0:5 ( 6 dB) 0.5 (not shown in Figure 9.27) 0.5 0.5 0.63 (not shown in Figure 9.27) 1.0 jSm (j!)W(j!)j 2:0 (6 dB) 1.58 1.12 0.96 1.05 1.26 Sum 2.5 2.08 1.62 1.46 1.68 2.26 314 Advanced Control Engineering 9.9 9.9.1 Multivariable robust control Plant equations The canonical robust control problem is shown in Figure 9.29. In Figure 9.29, 2 are the inputs to the plant m from the controller and 1 are the disturbance and noise inputs. Also, 1 are the outputs to be controlled and 2 are the outputs that are fed back to the controller. If m (s) and the plant uncertainty (s) are combined to give (s), then Figure 9.29 can be simplified as shown in Figure 9.30, also referred to as the two-port state-space representation. The state and output equations are _    1 1  2 2 1  1   11 1  12 2 2  2   21 1  22 2 (9:159) Equation (9.159) can be combined  _  1 2      1 2 1 11 21    2 12  1 2 22 (9:160) Uncertainty ∆(s) u1 y1 Plant Pm(s) u2 Controller C(s) Fig. 9.29             y2 Optimal and robust control system design 315 y1 u1 P(s) u2 y2 C(s) Fig. 9.30                Hence the augmented plant matrix (s) in Figure 9.30 is     .. ..  .   1 2   12        .              11 . (s)      .  1 . 11 12 .. . . 21 22 2 .. 21 22 (9:161) From the partitioned matrix in equation (9.161), the closed-loop transfer function matrix relating 1 and 1 is 1 1  11 (s)  12 (s) ( (s) 22 (s)) 1 (s) 21 (s), (9:162) where 2 (s) ˆ (s)2 (s) 9.9.2 (9:163) Singular value loop shaping The singular values of a complex n  m matrix , denoted by i () are the nonnegative square-roots of the eigenvalues of T  ordered such that 1  2      p p ˆ minfn, mg (9:164) The maximum singular value  of  and the minimum singular value  of  are defined by (A) ˆ kk2 (A) ˆ k 1 k2 1 if  1 exists (9:165) As with a SISO system, a sensitivity function may be defined (s) ˆ ( ‡ (s)(s)) 1 (9:166) 316 Advanced Control Engineering where (s) is the non-augmented plant matrix. For good performance (s) should be as small as possible. The complementary sensitivity function is (s)  (s) (s) (  (s)(s)) 1 (9:167) where (s) ‡ (s) ˆ (9:168) The singular value of the sensitivity function  (( j!)) and of the complementary sensitivity function  (( j!)) can be displayed as Bode plots and play an important role in robust multivariable control system design. The singular values of  determine the disturbance attenuation, and thus a performance specification may be written   (( j!))  s 1 ( j!) (9:169) (m ( j!)) ˆ 1/ (( j!)) (9:170)   (( j!))  T 1 ( j!) (9:171)   where s 1 ( j!) is a desired disturbance attenuation factor. If m (s) is a diagonal matrix of multiplicative plant uncertainty as illustrated in Figure 9.29, it can be shown that the size of the smallest stable m (s) for which the system becomes unstable is or alternatively where jT ( j!)j is the size of the largest anticipated multiplicative plant uncertainty. 9.9.3 Multivariable  and ¥ robust control The H2 -optimal control problem is to find a stabilizing controller (s) in equation (9.163) for an augmented plant (s) in equation (9.161), such that the closed-loop transfer function matrix 1 1 in equation (9.162) is minimized. Thus  Z 1 1/2 1 T min k1 1 k2 ˆ min trace(1 1 ( j!) 1 1 ( j!))d! (s) (s)  0 (9:172) where  is the complex conjugate transpose, and trace is the sum of the diagonal elements. The H1 robust control problem is to find a stabilizing controller (s) for an augmented plant (s), such that the closed-loop transfer function matrix 1 1 satisfies the infinity-norm inequality k1 1 k1 ˆ sup max (1 1 ( j!)) < 1 (9:173) ! Equation (9.173) is also called the `small gain' infinity-norm control problem. Optimal and robust control system design 317 9.9.4 The weighted mixed-sensitivity approach Multivariable loop shaping in robust control system design may be achieved using a weighted mixed sensitivity approach. As with the SISO systems described in section 9.8.2, the sensitivity function (s) given in equation (9.166) and the complementary sensitivity function (s) given in equation (9.167) may be combined with weights s (s) and T (s) to give  s (s) (s) 1 1  T (s) (s)  (9:174) where the infinity norm of 1 1 is <1 as given in equation (9.173). Equation (9.174) defines a mixed-sensitivity cost function since both (s) and (s) are penalized. Note that if s (s) weights the error and T (s) the output, the two-port augmented plant given in Figure 9.30 may be represented by Figure 9.31. Example 9.6 (See also Appendix 1, examp96.m) A plant has a transfer function G(s)  200 s3  3s2  102s  200 (9:175) given the sensitivity and complementary weighting functions Ws (s)  WT (s)  100  s 1  100s Augmented Plant u1 + . – e (9:176) 1  100s 100  s Ws(s) y G(s) . WT(s) } u2 y2 C(s) Fig. 9.31 0    )     y1 318 Advanced Control Engineering determine the singular value Bode magnitude plots for (a) (b) (c) (d) the plant G( j!) the weighting functions Ws 1 ( j!) and WT 1 ( j!) the cost function 1 1 ( j!) at its optimal value of the H1 -optimal controller C( j!) (given in Ws (s)) Find also the state-space and transfer function expressions for the controller. Solution The state-space representation of the plant G(s) is  g d  .. 102 200 . 1  3 ..     1 0 0 . 0 g  .. ˆ  0 g 1 0 . 0                               .. 0 0 200 . 0  (9:177) The singular value frequency response G( j!) is shown in Figure 9.32. The frequency response of the reciprocal of the weighting functions Ws 1 ( j!) ( ˆ 1) and WT 1 ( j!) are given in Figure 9.33. The optimal value of 1 1 is achieved when ( ˆ 0:13) and its singular value frequency response is shown in Figure 9.34. The controller single value frequency response C( j!) is illustrated in Figure 9.35. 10 0 –10 –20 |G(jω)| –30 (dB) –40 –50 –60 –70 –80 –1 10 Fig. 9.32     0 10 %       1 10 Frequency (rad/s) 2 10 Optimal and robust control system design 319 40 30 20 Gain 10 –1 WT (jω) –1 WS (jω) (dB) 0 –10 –20 –30 –40 –3 10 –1 –2 10 1 0 10 10 10 Frequency (rad/s) 2 3 10 10 Fig. 9.33 0      %       0 –2 –4 |Ty1u1(jω)| (dB) –6 –8 –10 –12 –14 –16 –18 –3 10 Fig. 9.34 1   –2 10 –1 10 0 1 10 10 Frequency (rad/s) %          ( j!)    0:13 2 10 3 10 320 Advanced Control Engineering 40 30 20 |C(jω)| (dB) 10 0 –10 –20 –30 –3 10 10 –2 –1 0 10 1 10 10 2 10 3 10 Frequency (rad/s) Fig. 9.35 '       %       jC( j!)j The state-space representation of the controller C(s) is   c c           c  c            .. . 7:976  ..  .  .. 0:009 7:763 21:653 37:164 621:89 . 0:091   ..  .  ..  0:046 2:032 3:148 2:234 81:88 . 0:582   ..  .  .. 0:435 0:107 8:807 102:25 37:78 . 8:8   ..  .  ..  0:676 0:197 13:558 3:728 162:51 . 13:66                                                            .. 0:086 0:169 0:121 0:654 11:17 . 0 (9:178) 0:01 0:002 0:004 0:015 0:137 and the controller transfer function is C(s) ˆ 159s4 ‡ 16:4  103 s3 ‡ 63:9  103 s2 ‡ 1:6  106 s ‡ 3:18  106 s5 ‡ 275s4 ‡ 20:4  103 s3 ‡ 324:8  103 s2 ‡ 3:78  106 s ‡ 37:8  103 (9:179) The results in this example were obtained using the MATLAB Robust Control Toolbox. Optimal and robust control system design 321 9.10 Further problems Example 9.7 In a multivariable optimal regulator system, the plant state equations are  x_ 1 x_ 2   0 4  1 2     x1 0 ‡ u x2 4 (9:180) y ˆ [1 0] If the performance index to be minimized is Jˆ Z 1 (T  ‡ u2 )dt (9:181) 0 (a) Determine, by hand, the elements of the Riccati matrix equation  ‡ T ‡   1 T ˆ  in the reduced Riccati (9:182) given that ˆ  2 0 0 1  (9:183) (b) Find the optimal feedback matrix  so that  ˆ  1 T (9:184) and hence calculate the closed-loop eigenvalues. Solutions  1:703 0:183 (a) ˆ 0:183 0:193 (b)  ˆ [ 0:732 sˆ 0:772 ] 2:544  j0:675 Example 9.8 A plant and measurement system are described by _ ˆ  ‡  ‡ d   ˆ  ˆ‡ (9:185) 322 Advanced Control Engineering where w(t) is a Gaussian sequence of disturbances and (t) is a Gaussian sequence of measurement noise. (t) is the measured value of (t) that is contaminated with measurement noise (t). The plant parameters are     0 0 1 0     ˆ 0  0 0 1 50  0:5  d ˆ  0 0 102 0 0:5 0 100 4:5   1   ˆ 0 0  0 0 10  0 0  1 0 (9:186) 0 1 The measurement noise and disturbance covariance matrices are     0:1 0 0 0:1 0 0  ˆ  0 0:1 0  ˆ  0 0:1 0 0 0 6 0 0 2 (9:187) (a) For a sampling time of 0.1 seconds, using equations (8.78) and (8.80) calculate the discrete-time state transition, control and disturbance matrices (T ), (T ) and d (T ). (b) Starting with an initial covariance matrix (k/k) equal to the identity matrix, perform 20 recursions of equations (9.74), (9.75) and (9.76) to compute the Kalman gain matrix (k ‡ 1) and covariance matrix (k ‡ 1/k ‡ 1). Solutions (a) (b)  0:993  (T ) ˆ  0:199 3:370  0:050  d (T ) ˆ  0:004 0:100  0:085 0:004 0:587 0:067 7:074 0:284 0:002 0:001 0:043 0:040 0:207 0:674 0:040  (k ‡ 1) ˆ  0:006 0:133  0:004  (k ‡ 1/k ‡ 1) ˆ  0:001 0:013    0:014    (T ) ˆ  0:398 6:740  0:006 0:137 0:155 0:001 0:014 0:016   0:002  0:003 0:218 0:013 0:016 1:310   Example 9.9 The plant described in Example 9.8 by equations (9.185) and (9.186) is to be controlled by a Linear Quadratic Gaussian (LQG) control scheme that consists of a LQ Regulator combined with the Kalman filter designed in Example 9.8. The Optimal and robust control system design 323 quadratic performance index to be minimized for the LQ regulator is of the form given in equation (9.181) where  10 0  0 5 0 0 0 0 1  (  1) (9:188) Using the recursive equations (9.29) and (9.30), solve, in reverse time, the Riccati equation commencing with (N)  . If the sampling time is 0.1 seconds, the values of the discrete-time state transition and control matrices (T ) and (T ) calculated in Example 9.8 may be used in the recursive solution. Continue the recursive steps until the solution settles down (when k  50, or kT  5 seconds) and hence determine the steady-state value of the feedback matrix (0) and Riccati matrix (0). What are the closed-loop eigenvalues? Solutions (0)  [ 0:106  0:581 11:474 3:406  (0) ˆ   3:406 0:153 3:952 0:163 0:064 ]  0:153  0:163  0:1086 closed-loop eigenvalues ˆ 1:230 4:816  j2:974 Example 9.10 A unity-feedback control system has a nominal plant transfer function Gm (s) ˆ 1 (s ‡ 2)(s ‡ 5) (9:189) and an integral controller in the forward path C(s) ˆ K s (9:190) If the bound of the multiplicative model uncertainty is 0:25(1 ‡ 4s) `m (s) ˆ (1 ‡ 0:25s) (9:191) 324 Advanced Control Engineering determine: (a) Expressions for the sensitivity and complementary sensitivity function S(s) and T(s) for the nominal plant. (b) The maximum value that K can have for robust stability. Solutions s3  7s2  10s s3  7s2  10s  K K T(s)  3 2 s  7s  10s  K (a) S(s)  (b) Kmax  4:5 Example 9.11 A plant has a transfer function G(s)  100 s2  2s  100 and sensitivity and complementary weighting functions Ws (s)  WT (s)  s  100 s1 s1 s  100 Find the optimal value for and hence the state-space and transfer functions for the H1 -optimal controller C(s). Solutions opt ˆ 0:0576  .. . 4:55 ..     ...     . 3:10 3:0 22:2 50:1 258:0   ..  c   .. ˆ  .. 2:99  39:6 74:5 196:1  2:7 c .   ..   ..  3:2 23:2 1871:1 . 7:44             36:3                            .         .. 0:33 1:68 1:02 49:42 0   c c C(s) ˆ s4 2:8 3:0 1:4 150:9 1:86  103 s3 ‡ 0:1898  106 s2 ‡ 0:5581  106 s ‡ 18:6031  106 ‡ 1:97  103 s3 ‡ 0:2005  106 s2 ‡ 1:3531  106 s ‡ 1:1546  106 10 Intelligent control system design 10.1 Intelligent control systems 10.1.1 Intelligence in machines According to the Oxford dictionary, the word intelligence is derived from intellect, which is the faculty of knowing, reasoning and understanding. Intelligent behaviour is therefore the ability to reason, plan and learn, which in turn requires access to knowledge. Artificial Intelligence (AI) is a by-product of the Information Technology (IT) revolution, and is an attempt to replace human intelligence with machine intelligence. An intelligent control system combines the techniques from the fields of AI with those of control engineering to design autonomous systems that can sense, reason, plan, learn and act in an intelligent manner. Such a system should be able to achieve sustained desired behaviour under conditions of uncertainty, which include: (a) (b) (c) (d) uncertainty in plant models unpredictable environmental changes incomplete, inconsistent or unreliable sensor information actuator malfunction. 10.1.2 Control system structure An intelligent control system, as considered by Johnson and Picton (1995), comprises of a number of subsystems as shown in Figure 10.1. The perception subsystem This collects information from the plant and the environment, and processes it into a form suitable for the cognition subsystem. The essential elements are: (a) Sensor array which provides raw data about the plant and the environment (b) Signal processing which transforms information into a suitable form (c) Data fusion which uses multidimensional data spaces to build representations of the plant and its environment. A key technology here is pattern recognition. 326 Advanced Control Engineering Intelligent Control System Perception Subsystem Cognition Subsystem Actuation Subsystem Environment Plant Fig. 10.1 Intelligent control system structure (adapted from Johnson and Picton). The cognition subsystem Cognition in an intelligent control system is concerned with the decision making process under conditions of uncertainty. Key activities include: (a) Reasoning, using (i) knowledge-based systems (ii) fuzzy logic (b) Strategic planning, using (i) optimum policy evaluation (ii) adaptive search and genetic algorithms (iii) path planning (c) Learning, using (i) supervised learning in neural networks (ii) unsupervised learning in neural networks (iii) adaptive learning The actuation subsystem The actuators operate using signals from the cognition subsystem in order to drive the plant to some desired states. In the event of actuator (or sensor) failure, an intelligent control system should be capable of being able to re-configure its control strategy. This chapter is mainly concerned with some of the processes that are contained within the cognition subsystem. 10.2 10.2.1 Fuzzy logic control systems Fuzzy set theory Fuzzy logic was first proposed by Zadeh (1965) and is based on the concept of fuzzy sets. Fuzzy set theory provides a means for representing uncertainty. In general, probability theory is the primary tool for analysing uncertainty, and assumes that the Intelligent control    327 uncertainty is a random process. However, not all uncertainty is random, and fuzzy set theory is used to model the kind of uncertainty associated with imprecision, vagueness and lack of information. Conventional set theory distinguishes between those elements that are members of a set and those that are not, there being very clear, or crisp boundaries. Figure 10.2 shows the crisp set `medium temperature'. Temperatures between 20 and 30  C lie within the crisp set, and have a membership value of one. The central concept of fuzzy set theory is that the membership function , like probability theory, can have a value of between 0 and 1. In Figure 10.3, the membership function  has a linear relationship with the x-axis, called the universe of discourse U. This produces a triangular shaped fuzzy set. Fuzzy sets represented by symmetrical triangles are commonly used because they give good results and computation is simple. Other arrangements include nonsymmetrical triangles, trapezoids, Gaussian and bell shaped curves. Let the fuzzy set `medium temperature' be called fuzzy set M. If an element u of the universe of discourse U lies within fuzzy set M, it will have a value of between 0 and 1. This is expressed mathematically as M (u) 2 [0, 1] (101) When the universe of discourse is discrete and finite, fuzzy set M may be expressed as Mˆ n  M (ui )/ui (102) iˆ1 In equation (10.2) `/' is a delimiter. Hence the numerator of each term is the membership value in fuzzy set M associated with the element of the universe indicated in the denominator. When n ˆ 11, equation (10.2) can be written as M ˆ 0/0 ‡ 0/5 ‡ 0/10 ‡ 033/15 ‡ 067/20 ‡ 1/25 ‡ 067/30 ‡ 033/35 ‡ 0/40 ‡ 0/45 ‡ 0/50 µ Medium Temperature 1.0 Membership Function 0.8 0.6 0.4 0.2 0 10 Fig. 10.2 Crisp set `medium temperature'. 20 30 Temperature (°C) 40 50 (103) 328 Advanced Control Engineering µ Medium Temperature 1.0 Membership 0.8 Function 0.6 M 0.4 0.2 0 10 20 30 40 Universe of Discourse (Temperature (°C)) 50 Fig. 10.3 Fuzzy set `medium temperature'. Note the symbol `‡' is not an addition in the normal algebraic sense, but in fuzzy arithmetic denotes a union operation. 10.2.2 Basic fuzzy set operations Let A and B be two fuzzy sets within a universe of discourse U with membership functions A and B respectively. The following fuzzy set operations can be defined as Equality: Two fuzzy sets A and B are equal if they have the same membership function within a universe of discourse U. A (u) ˆ B (u) for all u 2 U (104) Union: The union of two fuzzy sets A and B corresponds to the Boolean OR function and is given by A[B (u) ˆ A‡B (u) ˆ maxfA (u), B (u)g for all u 2 U (105) Intersection: The intersection of two fuzzy sets A and B corresponds to the Boolean AND function and is given by A\B (u) ˆ minfA (u), B (u)g for all u 2 U (106) Complement: The complement of fuzzy set A corresponds to the Boolean NOT function and is given by :A (u) ˆ 1 A (u) for all u 2 U (107) Example 10.1 Find the union and intersection of fuzzy set low temperature L and medium temperature M shown in Figure 10.4. Find also the complement of fuzzy set M. Using equation (10.2) the fuzzy sets for n ˆ 11 are         329 µ 1.0 Membership Function 0.8 0.6 L M 0.4 0.2 0 10 20 30 40 Universe of Discourse (Temperature (°C)) 50 Fig. 10.4 Overlapping sets `low'and `medium temperature'. L ˆ 0/0 ‡ 033/5 ‡ 067/10 ‡ 1/15 ‡ 067/20 ‡ 033/25 ‡ 0/30 ‡ 0/35 ‡    ‡ 0/50 M ˆ 0/0 ‡ 0/5 ‡ 0/10 ‡ 033/15 ‡ 067/20 ‡ 1/25 ‡ 067/30 ‡ 033/35 ‡ 0/40 ‡    ‡ 0/50 (108) (a) Union: Using equation (10.5) L‡M (u) ˆ max(0, 0)/0 ‡ max(033, 0)/5 ‡ max(067, 0)/10 ‡ max(1, 033)/15 ‡ max(067, 067)/20 ‡ max(033, 1)/25 ‡ max(0, 067)/30 ‡ max(0, 033)/35 ‡ max(0, 0)/40 ‡    ‡ max(0, 0)/50 (109) L‡M (u) ˆ 0/0 ‡ 033/5 ‡ 067/10 ‡ 1/15 ‡ 067/20 ‡ 1/25 ‡ 067/30 ‡ 033/35 ‡ 0/40 ‡    ‡ 0/50 (1010) (b) Intersection: Using equation (10.6) and replacing `max' by `min' in equation (10.9) gives L\M (u) ˆ 0/0 ‡ 0/5 ‡ 0/10 ‡ 033/15 ‡ 067/20 ‡ 033/25 ‡ 0/30 ‡    ‡ 0/50 (1011) Equations (10.10) and (10.11) are shown in Figure 10.5. (c) Complement: Using equation (10.7) :M (u) ˆ (1 0)/0 ‡ (1 0)/5 ‡ (1 0)/10 ‡ (1 033)/15 ‡ (1 067)/20 ‡ (1 1)/25 ‡ (1 067)/30 ‡ (1 033)/35 ‡ (1 0)/40 ‡    ‡ (1 0)/50 Equation (10.12) is illustrated in Figure 10.6. (1012) 330 Advanced Control Engineering µ L 1.0 Membership Function M 0.8 µ L+M (u) 0.6 µ L∩M(u) 0.4 0.2 0 10 20 30 Temperature (°C) 40 50 Fig. 10.5 `Union'and `intersection' functions. µ 1.0 Membership Function 0.8 µ ¬M(u) 0.6 0.4 0.2 0 10 20 30 Temperature (°C) 40 50 Fig. 10.6 The complement of fuzzy set M. 10.2.3 Fuzzy relations An important aspect of fuzzy logic is the ability to relate sets with different universes of discourse. Consider the relationship IF L THEN M (1013) In equation (10.13) L is known as the antecedent and M as the consequent. The relationship is denoted by AˆLM (1014) or  minfL (u1 ), M (v1 )g . . . minfL (u1 ), M (vk )g LMˆ minfL (uj ), M (v1 )g . . . minfL (uj ), M (vk )g  (1015)         331 where u1 ! uj and v1 ! vk are the discretized universe of discourse. Consider the statement IF L is low THEN M is medium (1016) Then for the fuzzy sets L and M defined by equation (10.8), for U from 5 to 35 in steps of 5   min (033, 0) . . . min (033, 1) . . . min (033, 033)  min (067, 0) . . . min (067, 1) . . . min (067, 033)    (1017) LMˆ  .. .. .. .. ..  . . . . . min (0, 0) ... min (0, 1) ... min (0, 033) which gives  0 0  0  LMˆ 0 0  0 0 0 0 0 0 0 0 0 033 033 033 033 033 0 0 033 067 067 067 033 0 0 033 067 1 067 033 0 0 033 067 067 067 033 0 0  033 033   033   033   033   0 0 (1018) Several such statements would form a control strategy and would be linked by their union A ˆ A1 ‡ A2 ‡ A3 ‡    ‡ An (1019) 10.2.4 Fuzzy logic control The basic structure of a Fuzzy Logic Control (FLC) system is shown in Figure 10.7. The fuzzification process Fuzzification is the process of mapping inputs to the FLC into fuzzy set membership values in the various input universes of discourse. Decisions need to be made regarding (a) number of inputs (b) size of universes of discourse (c) number and shape of fuzzy sets. A FLC that emulates a PD controller will be required to minimize the error e(t) and the rate of change of error de/dt, or ce. The size of the universes of discourse will depend upon the expected range (usually up to the saturation level) of the input variables. Assume for the system about to be considered that e has a range of 6 and ce a range of 1. The number and shape of fuzzy sets in a particular universe of discourse is a tradeoff between precision of control action and real-time computational complexity. In this example, seven triangular sets will be used. 332 Advanced Control Engineering Data Base Rule Base Knowledge Base FLC c (t ) u (t ) r (t ) + e (t ) Fuzzy Inference Fuzzification – Defuzzification Plant Measurement System Fig. 10.7 Fuzzy Logic Control System. Each set is given a linguistic label to identify it, such as Positive Big (PB), Positive Medium (PM), Positive Small (PS), About Zero (Z), Negative Small (NS), Negative Medium (NM) and Negative Big (NB). The seven set fuzzy input windows for e and ce are shown in Figure 10.8. If at a particular instant, e(t) ˆ 25 and de/dt ˆ 02, then, from Figure 10.8, the input fuzzy set membership values are PS (e) ˆ 07 PM (e) ˆ 04 NS (ce) ˆ 06 z (ce) ˆ 03 (1020) The fuzzy rulebase The fuzzy rulebase consists of a set of antecedent±consequent linguistic rules of the form IF e is PS AND ce is NS THEN u is PS (1021) This style of fuzzy conditional statement is often called a `Mamdani'-type rule, after Mamdani (1976) who first used it in a fuzzy rulebase to control steam plant. The rulebase is constructed using a priori knowledge from either one or all of the following sources: (a) Physical laws that govern the plant dynamics (b) Data from existing controllers (c) Imprecise heuristic knowledge obtained from experienced experts. If (c) above is used, then knowledge of the plant mathematical model is not required. The two seven set fuzzy input windows shown in Figure 10.8 gives a possible 7  7 set of control rules of the form given in equation (10.21). It is convenient to tabulate the two-dimensional rulebase as shown in Figure 10.9. Fuzzy inference Figure 10.9 assumes that the output window contains seven fuzzy sets with the same linguistic labels as the input fuzzy sets. If the universe of discourse for the control signal u(t) is 9, then the output window is as shown in Figure 10.10.         333 µ (e ) 1.0 0.8 0.6 NE NM NS Z PS –4 –2 0 2 PM PB 0.4 0.2 –6 2.5 4 6 Error (e) µ (ce ) 1.0 0.8 0.6 NE NM NS Z PS PM PB 0 0.33 0.67 1 0.4 0.2 –1 –0.67 –0.33 –0.2 Rate of Change Of Error (ce) Fig. 10.8 Seven set fuzzy input windows for error (e) and rate of change of error (ce). Assume that a certain rule in the rulebase is given by equation (10.22) OR IF e is A AND ce is B THEN u = C (1022) From equation (10.5) the Boolean OR function becomes the fuzzy max operation, and from equation (10.6) the Boolean AND function becomes the fuzzy min operation. Hence equation (10.22) can be written as C (u) ˆ max[ min (A (e), B (ce))] (1023) Equation (10.23) is referred to as the max±min inference process or max±min fuzzy reasoning. In Figure 10.8 and equation (10.20) the fuzzy sets that were `hit' in the error input window when e(t) ˆ 25 were PS and PM. In the rate of change input window when ce ˆ 02, the fuzzy sets to be `hit' were NS and Z. From Figure 10.9, the relevant rules that correspond to these `hits' are 334 Advanced Control Engineering e NB NM NS Z PS PM PB NB NB NB NB NM Z PM PB NM NB NB NB NM PS PM PB NS NB NB NM NS PS PM PB Z NB NM NS Z PS PM PB PS NB NM NS PS PM PB PB PM NB NM NS PM PB PB PB PB NB NM Z PM PB PB PB ce Fig. 10.9 Tabular structure of a linguistic fuzzy rulebase. µ (u ) 1.0 0.8 0.6 NB NM NS –6 –3 Z PS 0 3 PM PB 6 9 0.4 0.2 –9 Control Signal (u ) Fig. 10.10 Seven set fuzzy output window for control signal (u). . . . OR IF e is PS AND ce is NS OR IF e is PS AND ce is Z THEN u = PS (1024) . . . OR IF e is PM AND ce is NS OR IF e is PM and ce is Z THEN u = PM (1025)         335 Applying the max±min inference process to equation (10.24) PS (u) ˆ max[ min(PS (e), NS (ce)), min(PS (e), Z (ce))] (1026) inserting values from equation (10.20) PS (u) ˆ max[ min(07, 06), min(07, 03)] ˆ max[06, 03] ˆ 06 (1027) Applying the max±min inference process to equation (10.25) PM (u) ˆ max[ min(PM (e), NS (ce)), min(PM (e), Z (ce))] (1028) inserting values from equation (10.20) PM (u) ˆ max[ min(04, 06), min(04, 03)] ˆ max[04, 03] ˆ 04 (1029) Fuzzy inference is therefore the process of mapping membership values from the input windows, through the rulebase, to the output window(s). The defuzzification process Defuzzification is the procedure for mapping from a set of inferred fuzzy control signals contained within a fuzzy output window to a non-fuzzy (crisp) control signal. The centre of area method is the most well known defuzzification technique, which in linguistic terms can be expressed as Crisp control signal ˆ Sum of first moments of area Sum of areas (1030) For a continuous system, equation (10.30) becomes u(t) ˆ u(u)du (u)du (1031) or alternatively, for a discrete system, equation (10.30) can be expressed as u(kT) ˆ n iˆ1 ui (ui ) n iˆ1 (ui ) (1032) For the case when e(t) ˆ 25 and ce ˆ 02, as a result of the max±min inference process (equations (10.27) and (10.29)), the fuzzy output window in Figure 10.10 is `clipped', and takes the form shown in Figure 10.11. From Figure 10.11, using the equation for the area of a trapezoid 06(6 ‡ 24) ˆ 252 2 02(6 ‡ 36) ˆ 096 ˆ 2 AreaPS ˆ AreaPM (1033) From equation (10.30) u(t) ˆ (252  3) ‡ (096  6) ˆ 383 252 ‡ 096 (1034) 336 Advanced Control Engineering µ (u ) 1.0 0.8 0.6 0.4 PS 0.2 –9 PM –6 –3 0 3 Control Signal (u ) 6 9 Fig. 10.11 Clipped fuzzy output window due to fuzzy inference. Hence, for given error of 2.5, and a rate of change of error of from the fuzzy controller is 3.83. 02, the control signal Example 10.2 For the input and output fuzzy windows given in Figure 10.8 and 10.10, together with the fuzzy rulebase shown in Figure 10.9, determine (a) the membership values of the input windows e and ce. (b) the max±min fuzzy inference equations (c) the crisp control signal u(t) when e ˆ 3 and ce ˆ 03 Solution (a) When e ˆ 3 and ce ˆ 03 are mapped onto the input fuzzy windows, they are referred to as fuzzy singletons. From Figure 10.8 eˆ 3 NS (e) ˆ 05 NM (e) ˆ 05 (1035) ce ˆ 03, using similar triangles 1 Z (ce) ˆ 033 (033 03) Z (ce) ˆ 009 (1036) 1 PS (ce) ˆ 033 03 PS (ce) ˆ 091 (1037) and         337 (b) The rules that are `hit' in the rulebase in Figure 10.9 are . . . OR IF e is NS and ce is Z OR IF e is NS and ce is PS THEN u = NS (1038) . . . OR IF e is NM and ce is Z OR IF e is NM and ce is PS THEN u = NM (1039) Applying max±min inference to equation (10.38) NS (u) ˆ max[ min(NS (e), Z (ce)), min(NS (e), PS (ce))] (1040) Inserting values into (10.40) NS (u) ˆ max[ min(05, 009), min(05, 091)] ˆ max[009, 05] ˆ 05 (1041) and similarly with equation (10.39) NM (u) ˆ max[ min(NM (e), Z (ce)), min(NM (e), PS (ce))] ˆ max[ min(05, 009), min(05, 091)] (1042) ˆ max[009, 05] ˆ 05 Using equations (10.41) and (10.42) to `clip' the output window in Figure 10.10, the output window is now as illustrated in Figure 10.12. (c) Due to the symmetry of the output window in Figure 10.12, from observation, the crisp control signal is u(t) ˆ 45 Example 10.3 (See also Appendix 1, examp103.m) Design a fuzzy logic controller for the inverted pendulum system shown in Figure 10.13 so that the pendulum remains in the vertical position. The inverted pendulum problem is a classic example of producing a stable closedloop control system from an unstable plant. Since the system can be modelled, it is possible to design a controller using the pole placement techniques discussed in Chapter 8. Neglecting friction at the pivot and the wheels, the equations of motion from Johnson and Picton (1995) are x ˆ  ˆ F ‡ m`(_2 sin   cos ) M‡m g sin  ‡ cos  ` 4 3 F m`_2 sin  M‡m m cos2  M‡m (10:43) (10:44) 338 Advanced Control Engineering µ (u ) 1.0 0.8 0.6 0.4 NM NS 0.2 –9 –6 –3 0 3 Control Signal (u ) 6 9 Fig. 10.12 Fuzzy output window for Example 10.2. θ,4,5 M l G l F(t ) M x, x, 1 Fig. 10.13 An inverted pendulum. In equations (10.43) and (10.44),  is the mass and ` is the half-length of the pendulum and M is the mass of the trolley. F(t) is the applied force to the trolley in the x-direction. If it is assumed that  is small and second-order terms (_2 ) can be neglected, then x ˆ  ˆ F m` M‡m g ‡ ` 4 3 F M‡m m M‡m (10:45) (10:46)         339 If the state variables are x1 ˆ , _ x2 ˆ , x3 ˆ x and x4 ˆ x_ and the control variable is u ˆ F(t) then from equations (10.45) and (10.46), the state equations become        0 0 1 0 0 x1 x_ 1  x_ 2   a21 0 0 0  x2   b2   ˆ   ‡  u 0  x_ 3  0 0 0 1  x3 _x4 x4 a41 0 0 0 b4 (10:47) where a21 ˆ 3g(M ‡ m) `f4(M ‡ m) 3mg a41 ˆ 3gm 4(M ‡ m) 3m 3 `f4(M ‡ m) 3mg   1 3m b4 ˆ 1‡ M‡m 4(M ‡ m) (10:48) b2 ˆ 3m  and the output equation is y ˆ Cx (10:49) where C is the identity matrix. For a regulator, with a scalar control variable uˆ Kx The elements of K can be obtained by selecting a set of desired closed-loop poles as described in section 8.4.2, and applying one of the three techniques discussed. Data for simulation ` ˆ 1 m M ˆ 1 kg a21 ˆ a41 ˆ m ˆ 0:5 kg 3  9:81(1:5) ˆ 9:81 1f(4  1:5) 1:5g 3  9:81  0:5 ˆ (4  1:5) 1:5 3:27 3 ˆ 0:667 1f(4  1:5) 1:5g    1 1:5 b4 ˆ 1‡ ˆ 0:889 1:5 (4  1:5) 1:5 b2 ˆ 340 Advanced Control Engineering If the required closed-loop poles are s ˆ 2  j2 for the pendulum, and s ˆ 4  j4 for the trolley, then the closed-loop characteristic equation is s4 ‡ 12s3 ‡ 72s2 ‡ 192s ‡ 256 ˆ 0 (1050) Using Ackermann's Formula in equations (8.103) and (8.104), the state feedback matrix becomes K ˆ [ 17483 5712 3914 2936] (1051) Using the fuzzy logic approach suggested by Johnson and Picton (1995), four, three set input windows (one for each state variable) and one, three set output window has been selected as shown in Figure 10.14. Using heuristic knowledge from broom-balancing experiments, the following Mamdani-type rulebase was constructed: 1 IF  is PB and _ is PB then F is PB 2: IF  is PB and _ is Z then F is PB 3: IF  is PB and _ is NB then F is Z 4: IF  is Z and _ is PB then F is PB 5: IF  is Z and _ is Z then F is Z 6: IF  is Z and _ is NB then F is NB 10: IF  is NB and _ is PB then F is Z IF  is NB and _ is Z then F is NB IF  is NB and _ is NB then F is NB IF _ is PB then F is PB 11: IF _ is NB then F is NB 7: 8: 9: (10:52) The rulebase can be extended up to 22 rules by a further set of 11 rules replacing  _ with x and _ with x. For the rulebase given in equation (10.52), the fuzzy max±min inference process is _ min(PB (), PB ()), _ min(PB (), Z ()), _ min(Z (), PB ())] _ PB (u) ˆ max[PB (), _ min(Z (), NB ()), _ min(NB (), Z ()), _ min(NB (), NB ())] _ NB (u) ˆ max[NB (), _ min(Z (), Z ()), _ min(NB (), PB ())] _ Z (u) ˆ max[min(PB (), NB ()), _ Following defuzzification, Again, a similar inference process occurs with x and x. a crisp control force F(t) is obtained. Figure 10.15 shows the time response of the inverted pendulum state variables from an initial condition of  ˆ 0:1 radians. On each graph, three control strategies are shown, the 11 set rulebase of equation (10.52), the 22 set rulebase that includes _ and the state feedback method given by equation (10.51). x and x, For the pendulum angle, shown in Figure 10.15(a), the 11 set rulebase gives the best results, the state feedback being oscillatory and the 22 set rulebase diverging      µ (θ ) µ(4) 1.0 1.0 NB –0.1 Z 0 NB PB 0.1 θ µ (x ) µ (x ) 1.0 1.0 NB Z PB –1.0 0 NB Z PB –100 0 100 1.0 x Z    341 PB –0.5 0 NB Z –1.0 0 0.5 4 PB 1.0 x µ (F ) 1.0 F Fig. 10.14 Input and output fuzzy windows for the inverted pendulum problem. after a while. The same comments apply to the pendulum angular rate, given in Figure 10.15(b). With the trolley displacement and velocity shown in Figures 10.15(c) and (d), the state feedback, although oscillatory, give the best results since there is no steady-state error. The positional error for both rulebases increases with time, and there is a constant velocity steady-state error for the 11 set rulebase, and increasing error for the 22 set rulebase. Figure 10.15(e) shows the control force for each of the three strategies. The 11 and 22 set rulebase simulations were undertaken using SIMULINK, together with the fuzzy logic toolbox for use with MATLAB. More details on the 342 Advanced Control Engineering 0.12 0.1 11 Rule Set 22 Rule Set 0.08 Pendulum angle (rad) 0.06 0.04 0.02 0 –0.02 Pole placement –0.04 –0.06 –0.08 –0.1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 1.8 2 Time (s) (a) 0.3 Pendulum angular rate (rad/s) 0.2 Pole placement 0.1 0 –0.1 11 Rule Set –0.2 22 Rule Set –0.3 –0.4 –0.5 –0.6 –0.7 0 0.2 0.4 0.6 0.8 1 Time (s) (b) 1.2 1.4 1.6         343 1 0.8 Trolley displacement (m/s) 22 Rule Set 0.6 11 Rule Set 0.4 Pole placement 0.2 0 –0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 1.6 1.8 2 Time (s) (c) 1.2 Pole placement 1 22 Rule Set 0.8 Trolley velocity (m/s) 11 Rule Set 0.6 0.4 0.2 0 –0.2 –0.4 –0.6 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Time (s) (d) (Fig. 10.15 continued) 344 Advanced Control Engineering 35 30 Applied force to trolley (N) 25 20 11 Rule Set 15 Pole placement 22 Rule Set 10 5 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 –5 –10 Time (s) (e) Fig. 10.15 Inverted pendulum state variable time response for three control strategies. MATLAB Fuzzy Inference System (FIS) editor can be found in Appendix 1. Figure 10.16 shows the control surface for the 11 set rulebase fuzzy logic controller. 10.2.5 Self-organizing fuzzy logic control Self-Organizing Fuzzy Logic Control (SOFLC) is an optimization strategy to create and modify the control rulebase for a FLC as a result of observed system performance. The SOFLC is particularly useful when the plant is subject to timevarying parameter changes and unknown disturbances. Structure A SOFLC is a two-level hierarchical control system that is comprised of: (a) a learning element at the top level (b) a FLC at the bottom level. The learning element consists of a Performance Index (PI) table combined with a rule generation and modification algorithm, which creates new rules, or modifies existing ones. The structure of a SOFLC is shown in Figure 10.17. With SOFLC it is usual to express the PI table and rulebase in numerical, rather than linguistic format. So, for         345 60 40 20 Force (N) 0 –20 –40 –60 0.5 0.1 0.05 0 0 4 (rad/s) θ (rad) –0.05 –0.5 –0.1 Fig. 10.16 Control surface for 11 set rulebase fuzzy logic controller. Performance Index Table Rule Generation and Modification Data Base r (t ) + e (t ) Fuzzification – Rule Base Fuzzy Inference Measurement System Fig. 10.17 Self-Organizing Fuzzy Logic Control system. u (t ) Defuzzification Plant c (t ) 346 Advanced Control Engineering e NB NM NS Z PM PB NB –50 –40 –30 –20 –10 0 10 NM –42 –32 –22 –12 –2 8 18 NS –36 –26 –16 –6 4 14 24 Z –30 –20 –10 0 10 20 30 PS –24 –14 –4 6 16 26 36 PM –18 –8 2 12 22 32 42 PB –10 0 10 20 30 40 50 ce PS Fig. 10.18 Tabular structure of a numerical fuzzy rulebase. example, the fuzzy rulebase in Figure 10.9, might take the form as shown in Figure 10.18. Rulebase modification If the numerical structure of the fuzzy rulebase does not give an acceptable response, then the values in certain cells will need to be adjusted. Let the error, rate of change of error and control signal at time  be e(t), ce(t) and u(t) respectively, and assume that a given PI is a function of e(t) and ce(t). If there are unacceptable errors at time t, because of the dynamics of the plant, these will be as a result of control action taken d seconds previously, or at time (t d). The parameter d is a `delay in reward' parameter and is related to the settling time of the plant, having a typical value of between 3T and 5T, where T is the dominant time constant of the plant. The value of the PI is therefore determined using e(t d) and ce(t d) and applied to u(t) as a correction factor to the rulebase in the form IF e(t) is . . . and ce(t) is . . . THEN u(t) ˆ    ‡ PI (1053) where the PI is read from a Performance Index table of the form shown in Figure 10.19. When the values of e(t d ) and ce(t d ) are within an acceptable range, the PI tends to zero and the fuzzy rulebase settles down and convergence for the selforganizing process has been achieved. The PI table is usually designed heuristically, based upon an intuitive understanding of the learning process, and the trade-off between speed of learning and stability of the rulebase.         347 e NB NM NS Z PS PM PB NB –5 –4 –3 –3 –2 –1 0 NM –4 –3 –3 –2 –1 0 1 NS –3 –3 –2 –1 0 1 2 Z –3 –2 –1 0 1 2 3 PS –2 –1 0 1 2 3 3 PM –1 0 1 2 3 3 4 PB 0 1 2 3 3 4 5 ce Fig. 10.19 Performance Index table. 10.3 Neural network control systems 10.3.1 Artificial neural networks The human brain is comprised of many millions of interconnected units, known individually as biological neurons. Each neuron consists of a cell to which is attached several dendrites (inputs) and a single axon (output). The axon connects to many other neurons via connection points called synapses. A synapse produces a chemical reaction in response to an input. The biological neuron `fires' if the sum of the synaptic reactions is sufficiently large. The brain is a complex network of sensory and motor neurons that provide a human being with the capacity to remember, think, learn and reason. Artificial Neural Networks (ANNs) attempt to emulate their biological counterparts. McCulloch and Pitts (1943) proposed a simple model of a neuron, and Hebb (1949) described a technique which became known as `Hebbian' learning. Rosenblatt (1961), devised a single layer of neurons, called a Perceptron, that was used for optical pattern recognition. One of the first applications of this technology for control purposes was by Widrow and Smith (1964). They developed an ADaptive LINear Element (ADLINE) that was taught to stabilize and control an inverted pendulum. Kohonen (1988) and Anderson (1972) investigated similar areas, looking into `associative' and `interactive' memory, and also `competitive learning'. The back propagation training algorithm was investigated by Werbos (1974) and further developed by Rumelhart (1986) and others, leading to the concept of the Multi-Layer Perceptron (MLP). 348 Advanced Control Engineering Artificial Neural Networks have the following potential advantages for intelligent control: . . . . They They They They 10.3.2 learn from experience rather than by programming. have the ability to generalize from given training data to unseen data. are fast, and can be implemented in real-time. fail `gracefully' rather than `catastrophically'. Operation of a single artificial neuron The basic model of a single artificial neuron consists of a weighted summer and an activation (or transfer) function as shown in Figure 10.20. Figure 10.20 shows a neuron in the jth layer, where x1 . . . xi are inputs wj1 . . . wji are weights bj is a bias fj is the activation function yj is the output The weighted sum sj is therefore sj (t) ˆ N  wji xi (t) ‡ bj (1054) iˆ1 Equation (10.54) can be written in matrix form sj (t) ˆ Wj x ‡ bj (1055) The activation function f (s) (where s is the weighted sum) can take many forms, some of which are shown in Figure 10.21. From Figure 10.21 it can be seen that the bias bj in equations (10.54) and (10.55) will move the curve along the s axis, i.e. effectively 1 bias bj Synaptic Connections Activation function wj 1 x1 ∑ fj wj 2 x2 Weighted Summer xi w ji Fig. 10.20 Basic model of a single artificial neuron. yj         349 setting the threshold at which the neuron `fires'. So in the case of the hard-limiting function, if bj ˆ 0, the neuron will `fire' when sj (t) changes from negative to positive. The sigmoid activation function is popular for neural network applications since it is differentiable and monotonic, both of which are a requirement for the backpropagation algorithm. The equation for a sigmoid function is f (s) ˆ 1 1‡e (1056) sj 10.3.3 Network architecture Feedforward networks An ANN is a network of single neurons jointed together by synaptic connections. Figure 10.22 shows a three-layer feedforward neural network. The feedforward network shown in Figure 10.22 consists of a three neuron input layer, a two neuron output layer and a four neuron intermediate layer, called a hidden layer. Note that all neurons in a particular layer are fully connected to all neurons in the subsequent layer. This is generally called a fully connected multilayer network, and there is no restriction on the number of neurons in each layer, and no restriction on the number of hidden layers. f (s ) f (s ) 1.0 1.0 s (a) Hard-Limiting (Unit Step) s (b) Linear (Ramp) f (s ) f (s ) 1.0 1.0 s –1.0 s (c) Hyperbolic Tangent Fig. 10.21 Activation functions. (d) Sigmoid 350 Advanced Control Engineering b b = bias b x1 y1 b b x2 b x3 b Input layer y2 Hidden layer Output layer Fig. 10.22 Three-layer feedforward neural network. Feedback (recurrent) networks Recurrent networks are based on the work of Hopfield and contain feedback paths. Figure 10.23 shows a single-layer fully-connected recurrent network with a delay (z 1 ) in the feedback path. If, in Figure 10.23, the inputs occur at time ( ) and the outputs are predicted at time ( ‡ 1) , then the network can be represented in matrix form by y( ‡ 1) ˆ W1 y( ) ‡ W2 x( ) (1057) Equation (10.57) is in the same form as the discrete-time solution of the state equation (8.76). 10.3.4 Learning in neural networks Learning in the context of a neural network is the process of adjusting the weights and biases in such a manner that for given inputs, the correct responses, or outputs are achieved. Learning algorithms include: (a) Supervised learning: The network is presented with training data that represents the range of input possibilities, together with the associated desired outputs. The weights are adjusted until the error between the actual and desired outputs meets some given minimum value. (b) Unsupervised learning: Also called open-loop adaption because the technique does not use feedback information to update the network's parameters. Applications for unsupervised learning include speech recognition and image compression. Important unsupervised networks include the Kohonen Self-Organizing Map (KSOM) which is a competitive network, and the Grossberg Adaptive Resonance Theory (ART), which can be used for on-line learning.         351 x1(kT ) y1(k + 1)T x2(kT ) y2(k + 1)T y3(k + 1)T y1(kT ) z –1 y2(kT ) z –1 z –1 y3(kT ) Fig. 10.23 Recurrent neural network. 10.3.5 Back-Propagation The Back-Propagation Algorithm (BPA) is a supervised learning method for training ANNs, and is one of the most common forms of training techniques. It uses a gradient-descent optimization method, also referred to as the delta rule when applied to feedforward networks. A feedforward network that has employed the delta rule for training, is called a Multi-Layer Perceptron (MLP). If the performance index or cost function ) takes the form of a summed squared error function, then )ˆ M 1 (dj 2 jˆ1 yj ) 2 (1058) where dj and yi are the desired and actual network outputs respectively. Using gradient-descent, the weight increment wji is proportional to the (negative) slope wji ˆ  @J @wji (10:59) where  is a constant. From equations (10.58) and (10.59), M @J 1  @ ˆ (dj @wji M jˆ1 @wji yj ) 2 352 Advanced Control Engineering using the chain rule, M @) 1  @ ˆ (dj @wji M jˆ1 @yj yj ) 2 @yi @wji giving @J ˆ @wji M 2  (dj M jˆ1 yj ) @yj @wji (10:60) If the activation function is the sigmoid function given in equation (10.56), then its derivative is @f ˆ @sj e sj 1 ˆ 2 s j 1‡e (1 ‡ e ) sj  1 1‡e sj 2 or @f ˆ f (s) @s f (s)2 (10:61) Since f (s) is the neuron output yj , then equation (10.61) can be written as @yj ˆ yj (1 @sj yj ) (10:62) From equation (10.60), again using the chain rule, @yj @yj @sj ˆ @wji @sj @wji (10:63) If, in equation (10.54), the bias bj is called wj0 , then equation (10.54) may be written as sj ˆ N  wji xi (10:64) iˆ0 thus N N  @sj @  @wji wji xi ˆ ˆ xi ˆ xi @wji @wji iˆ0 @wji iˆ0 (10:65) Substituting equations (10.62) and (10.65) into (10.63) gives @yi ˆ yj (1 @wji yj )xi (10:66)         353 Putting equation (10.66) into (10.60) gives @) ˆ @wji M 2  (dj M jˆ1 yj )yj (1 yj )xi (10:67) or @J ˆ @wji M 2  j xi M jˆ1 (10:68) where j ˆ (dj yj )yj (1 yj ) (10:69) Substituting equation (10.68) into (10.59) gives wji ˆ  M  j xi (10:70) jˆ1 where ˆ 2 M This leads to a weight increment, called the delta rule, for a particular neuron wji (kT) ˆ j xi (10:71) where  is the learning rate and has a value of between 0 and 1. Hence the new weight becomes wji (kT) ˆ wji (k 1)T ‡ wji (kT) or wji (kT) ˆ wji (k 1)T ‡ j xi (10:72) Consider a three layer network. Let the input layer be layer one (` ˆ 1), the hidden layer be layer two (` ˆ 2) and the output layer be layer three (` ˆ 3). The backpropagation commences with layer three where dj is known and hence j can be calculated using equation (10.69), and the weights adjusted using equation (10.71). To adjust the weights on the hidden layer (` ˆ 2) equation (10.69) is replaced by   N      j ` ˆ yj (1 yj ) ` (10:73) wji j jˆ1 `‡1 354 Advanced Control Engineering Hence the  values for layer ` are calculated using the neuron outputs from layer ` (hidden layer) together with the summation of w and  products from layer ` ‡ 1 (output layer). The back-propagation process continues until all weights have been adjusted. Then, using a new set of inputs, information is fed forward through the network (using the new weights) and errors at the output layer computed. The process continues until ii(i) the performance index J reaches an acceptable low value i(ii) a maximum iteration count (number of epochs) has been exceeded (iii) a training-time period has been exceeded. For either (ii) or (iii), it may well be that a local minima has been located. Under these conditions the BPA may be re-started, and if again unsuccessful, a new training set may be required. The equations that govern the BPA can be summarized as Single neuron summation sj ˆ N  wji xi ‡ bj (10:74) iˆ1 Sigmoid activation function yj ˆ 1 1‡e (10:75) sj Delta rule wji (kT) ˆ j xi (10:76) New weight wji (kT) ˆ wji (k 1)T ‡ wji (kT ) (10:77) yj )(dj (10:78) Output layer j ˆ yj (1 Jˆ M 1 (dj 2 jˆ1 yj ) yj ) 2 (10:79) Other layers    j ` ˆ yj (1 yj )  N   ` jˆ1 wji j  (10:80) `‡1 Learning with momentum When momentum is used in the BPA, the solution stands less chance of becoming trapped in local minima. It can be included by making the current change in weight equal to a proportion of the previous weight change summed with the weight change calculated using the delta rule.         355 The delta rule given in equation (10.76) can be modified to include momentum as indicated in equation (10.81). wji (kT) ˆ (1 where )j xi ‡ wji (k 1)T (10:81) is the momentum coefficient, and has a value of between 0 and 1. Example 10.4 The neural network shown in Figure 10.24 is in the process of being trained using a BPA. The current inputs x1 and x2 have values of 0.2 and 0.6 respectively, and the desired output dj ˆ 1. The existing weights and biases are Hidden layer     1:0 1:0 1:5 Wj ˆ  0:5 2:0 bj ˆ  0:5 1:5 2:5 3:0 yj j =1 Output layer (l = 2) y0 = 1 w10 w13 w11 w12 y1 y3 y2 j =1 Hidden layer (l = 1) j =2 j =3 w30 w12 w10 w20 w11 x0 = 1 w22 x0 = 1 x0 = 1 Input layer (l = 0) x1 Fig. 10.24 Training using back-propagation. w31 w32 w21 x2 356 Advanced Control Engineering Output layer Wj ˆ [30 10] bj ˆ [ 40] 20 Calculate the output yj and hence the new values for the weights and biases. Assume a learning rate of 0.5. Solution Forward propagation Hidden layer (` ˆ 1): Single neuron summation j ˆ 1: j ˆ 2: s1 ˆ w10 ‡ w11 x1 ‡ w12 x2 s2 ˆ w20 ‡ w21 x1 ‡ w22 x2 j ˆ 3: s3 ˆ w30 ‡ w31 x1 ‡ w32 x2 or  s1  s2 s3     w12   w10 x1 w22 ‡  w20 x2 w30 w32  w11 ˆ  w21 w31 (10:82) Sigmoid activation functions ( j ˆ 1 to 3) y1 ˆ 1 1‡e y2 ˆ s1 1 1‡e y3 ˆ s2 1 1‡e s3 (10:83) Output layer (` ˆ 2) j ˆ 1: s1 ˆ w10 ‡ w11 y1 ‡ w12 y2 ‡ w13 y3 yj ˆ y1 ˆ 1 1‡e (10:84) (10:85) s1 Inserting values into equations (10.82) and (10.83)        1:0 s1 1:0 1:5  0:2  s2 ˆ  0:5 2:0 ‡  0:5 0:6 1:5 2:5 3:0 s3 s1 ˆ 2:1 y1 ˆ 0:891 s2 ˆ 0:8 y2 ˆ 0:690 s3 ˆ 3:8 y3 ˆ 0:978 Inserting values into equations (10.84) and (10.85) s1 ˆ 1:031 yj ˆ y1 ˆ 0:737 (10:86) Back propagation Output layer (` ˆ 2): From equation (10.69) j ˆ yj (1 yj )(dj yj ) Since j ˆ 1 1 ˆ 0:737(1 ˆ 0:051 0:737)(1 0:737) (10:87)         357 Delta rule wji (kT) ˆ j xi w10 ˆ 0:5  0:051  1 ˆ 0:0255 w11 ˆ 0:5  0:051  0:891 ˆ 0:0227 w12 ˆ 0:5  0:051  0:69 ˆ 0:0176 w13 ˆ 0:5  0:051  0:978 ˆ 0:0249 New weights and biases for output layer wj ˆ [ 3:0227 2:0176 1:0249] bj ˆ [ 3:975] Hidden layer (` ˆ 1): From equation (10.80)   N      wji j j ` ˆ yj (1 yj ) ` jˆ1 (10:88) `‡1 To illustrate this equation, had there been two neurons in layer (` ‡ 1), i.e. the output layer, then values for 1 and 2 for layer (` ‡ 1) would have been calculated. Thus, for layer ` (the hidden layer), the [j ]` values would be j ˆ 1: j ˆ 2: [1 ]` ˆ [y1 (1 [2 ]` ˆ [y2 (1 y1 )]` [w11 1 ‡ w21 2 ]`‡1 y2 )]` [w12 1 ‡ w22 2 ]`‡1 j ˆ 3: [3 ]` ˆ [y3 (1 y3 )]` [w13 1 ‡ w23 2 ]`‡1 However, since in this example there is only a single neuron in layer (` ‡ 1), 2 ˆ 0. Thus the  values for layer ` are j ˆ 1: [1 ]` ˆ [0:891(1 j ˆ 2: [2 ]` ˆ [0:690(1 0:891)][3:0227  0:051] ˆ 0:015 0:690)][2:0176  0:051] ˆ 0:022 j ˆ 3: [3 ]` ˆ [0:978(1 0:978)][1:0249  0:051] ˆ 0:001 Hence, using the delta rule, the weight increments for the hidden layer are w10 ˆ 0:5  0:015  1 ˆ 0:0075 w11 ˆ 0:5  0:015  0:2 ˆ 0:0015 w12 ˆ 0:5  0:015  0:6 ˆ 0:0045 w20 ˆ 0:5  0:022  1 ˆ 0:0110 w21 ˆ 0:5  0:022  0:2 ˆ 0:0022 w22 ˆ 0:5  0:022  0:6 ˆ 0:0066 w30 ˆ 0:5  0:001  1 ˆ 0:0005 w31 ˆ 0:5  0:001  0:2 ˆ 0:0001 w32 ˆ 0:5  0:001  0:6 ˆ 0:0003 (10:89) 358 Advanced Control Engineering The new weights and biases for the  10015 Wj ˆ  05022 25001 10.3.6 hidden layer now become    10075 15045 bj ˆ  0489 20066 15005 30003 (1090) Application of neural networks to modelling, estimation and control An interesting and important feature of a neural network trained using back-propagation is that no knowledge of the process it is being trained to emulate is required. Also, since they learn from experience rather than programming, their use may be considered to be a `black box' approach. Neural networks in modelling and estimation Providing input/output data is available, a neural network may be used to model the dynamics of an unknown plant. There is no constraint as to whether the plant is linear or nonlinear, providing that the training data covers the whole envelope of plant operation. Consider the neural network state observer shown in Figure 10.25. This is similar in operation to the Luenberge full-order state observer given in Figure 8.9. If the neural network in Figure 10.25 is trained using back-propagation, the algorithm will minimize the PI Jˆ N  (y(kT) ^y(kT))T (y(kT) ^y(kT)) (1091) kˆ1 Richter et al. (1997) used this technique to model the dynamic characteristics of a ship. The vessel was based on the Mariner Hull and had a length of 161 m and a displacement of 17 000 tonnes. The training data was provided by a three degree-of-freedom (forward velocity, or surge, lateral velocity, or sway and turn, or y(kT ) u(kT ) Plant y(kT ) – y(kT ) + – Neural Network y(kT ) 0(kT ) C 0(kT ) Fig. 10.25 Neural network state observer.         359 yaw-rate) differential equation model produced by Burns and was based on previous work by Morse and Price. The training file consisted of input data of the form: Time elapsed ( ), Rudder angle ( ), Engine speed n(kT ) with corresponding output data Forward velocity u(kT ), Lateral velocity v(kT), Yaw-rate r(kT). With the engine speed held constant, the rudder was given step changes of 0 , 10 , 20 and 30 . Figure 10.26 shows training and trained data for a rudder Forward (Surge) Velocity (m/s) 8 7.5 7 Actual 6.5 Neural Network 6 5.5 5 4.5 4 0 50 150 100 200 250 300 350 400 Time (s) (a) 1.2 Actual Lateral (Sway) Velocity (m/s) 1 0.8 Neural Network 0.6 0.4 0.2 0 0 20 40 60 80 100 Time (s) (b) 120 140 160 180 200 360 Advanced Control Engineering 0 Yaw-Rate (deg/s) –0.2 –0.4 Actual –0.6 –0.8 –1 –1.2 Neural Network 0 20 40 60 80 100 120 140 160 180 200 Time (s) (c) Fig. 10.26 Training and trained data for a neural network model of a Ship's Hull. angle of ‡20 (where positive is to port, or left). The input and output data was sampled every 5 seconds, during the transient period of the turn (0±300 seconds). The selected network had a 3-6-6-6-3 structure, i.e. input and output layers comprising 3 neurons in each, separated by three hidden layers of 6 neurons. During learning, 4 million epochs were trained. The learning rate and momentum were initially set at 0.3 and 0.8, but were reduced in three steps to final values of 0.05 and 0.4 respectively. Inverse models The inverse model of a plant provides a control vector u( ) for a given output vector y( ) as shown in Figure 10.27. u(kT ) y(kT ) Plant + Error – Neural Network Fig. 10.27 Neural network plant inverse model.         361 uc(kT ) Existing Controller r(kT ) + e(kT ) Error + y(kT ) Plant – – Switch y(kT ) Neural Network Controller unn (kT ) Fig. 10.28 Training a neural network controller. So, for example, with the ship model shown in Figure 10.26, the inverse model could be trained with time, forward velocity, lateral velocity and yaw-rate as input data and rudder angle and engine speed as output data. Neural networks in control Controller emulation: A simple application in control is the use of neural networks to emulate the operation of existing controllers. It may be that a nonlinear plant requires several tuned PID controllers to operate over the full range of control actions. Or again, an LQ optimal controller has difficulty in running in real-time. Figure 10.28 shows how the control signal from an existing controller may be used to train, and to finally be replaced by, a neural network controller. Error back-propagation through plant model All closed-loop control systems operate by measuring the error between desired inputs and actual outputs. This does not, in itself, generate control action errors that may be back-propagated to train a neural network controller. If, however, a neural network of the plant exists, back-propagation through this network of the system error (r(kT) y(kT)) will provide the necessary control action errors to train the neural network controller as shown in Figure 10.29. Internal Model Control (IMC) Internal Model Control was discussed in relation to robust control in section 9.6.3 and Figure 9.19. The IMC structure is also applicable to neural network control. The plant model Gm (s) in Figure 9.19 is replaced by a neural network model and the controller C(s) by an inverse neural network plant model as shown in Figure 10.30. 10.3.7 Neurofuzzy control Neurofuzzy control combines the mapping and learning ability of an artificial neural network with the linguistic and fuzzy inference advantages of fuzzy logic. Thus 362 Advanced Control Engineering + r(kT ) uc(kT ) Neural Network Controller – y(kT ) Plant Control Action Error BackPropagation Through Plant Model Error System Error Fig. 10.29 Control action error generated by system error back-propagation through plant model. d(kT ) r(kT ) + – e(kT ) Plant Inverse Model y(kT ) + u(kT ) Plant + + n(kT ) + + Plant Model – Fig. 10.30 Application of neural networks to IMC. a neurofuzzy controller has the potential to out-perform conventional ANN or fuzzy logic controllers. The general architecture of a neurofuzzy scheme is to employ neural network learning to upgrade either the membership functions or rulebase of the fuzzy logic element. The Adaptive Network based Fuzzy Inference System (ANFIS) The ANFIS neurofuzzy controller was implemented by Jang (1993) and employs a Takagi±Sugeno±Kang (TSK) fuzzy inference system. The basic ANFIS architecture is shown in Figure 10.31. Square nodes in the ANFIS structure denote parameter sets of the membership functions of the TSK fuzzy system. Circular nodes are static/non-modifiable and perform operations such as product or max/min calculations. A hybrid learning rule is used to accelerate parameter adaption. This uses sequential least squares in the forward pass to identify consequent parameters, and back-propagation in the backward pass to establish the premise parameters.      Layer 1 (Premise Parameters) Layer 2 Layer 3    363 Layer 5 Layer 4 (Consequent Parameters) x1 x2 A1 x1 w1f1 w1 w1 A2 N TT f ∑ B1 N TT w2 w2 w1f2 x2 B2 x1 x2 Fig. 10.31 The Adaptive Network based Fuzzy Inference System (ANFIS) architecture (after Craven). If the fuzzy inference system has inputs x1 and x2 and output f as shown in Figure 10.31, then a first-order TSK rulebase might be Rule 1 : If x1 is A1 and x2 is B1 then f1 ˆ p1 x1 ‡ q1 x2 ‡ r1 Rule 2 : If x1 is A2 and x2 is B2 then f2 ˆ p2 x1 ‡ q2 x2 ‡ r2 Rule n : If x1 is An and x2 is Bn then fn ˆ pn x1 ‡ qn x2 ‡ rn (1092) Where A1 . . . An , B1 . . . Bn are membership functions and p1 . . . pn , q1 . . . qn and r1 . . . rn are constants within the consequent functions. Layer 1 contains adaptive nodes that require suitable premise membership functions (triangular, trapezoidal, bell, etc). Hence y1, i ˆ 8i (xi ) (1093) Layer 2 undertakes a product or T-norm operation. y2, i ˆ wi ˆ Ai (x1 )Bi (x2 ) . . . pi (xn ) i ˆ 1, 2 . . . , n (1094) Layer 3 calculates the ratio of the firing strength of the rules i ˆ y3, i ˆ w wi n iˆ1 wi (1095) 364 Advanced Control Engineering Layer 4 generates the linear consequent functions as given in equation (10.92). Layer 5 sums all incoming signals y5, i ˆ f ˆ n  i fi ˆ w iˆ1 n iˆ1 wi fi n iˆ1 wi (1096) A limitation of the ANFIS technique is that it cannot be employed on multivariable systems. The Co-active ANFIS (CANFIS) developed by Craven (1999) extends the ANFIS architecture to provide a flexible multivariable control environment. This was employed to control the yaw and roll channels of an Autonomous Underwater Vehicle (AUV) simultaneously. Predictive Self-Organizing Fuzzy Logic Control (PSOFLC) This is an extension of the SOFLC strategy discussed in section 10.2.5 and illustrated in Figure 10.17. Predictive Self-Organizing Fuzzy Logic Control is particularly useful when the plant dynamics are time-varying, and the general architecture is shown in Figure 10.32. In Figure 10.30 the predictive neural network model tracks the changing dynamics of the plant. Following a suitable time delay, em (kT) is passed to the performance index table. If this indicates poor performance as a result of changed plant dynamics, the rulebase is adjusted accordingly. Richter (2000) demonstrated that this technique could improve and stabilize a SOFLC when applied to the autopilot of a small motorized surface vessel. PI Time Delay r(kT ) + Rulebase e(kT ) FLC – + u(kT ) + em(kT ) – – Neural Network Model Fig. 10.32 Predictive Self-Organizing Fuzzy Logic Control (PSOFLC). y(kT ) Plant      10.4    365 Genetic algorithms and their application to control system design 10.4.1 Evolutionary design techniques In any design problem there is a multi-dimensional space of possible solutions. Some of these solutions may be acceptable, but not the best (local optima) and there may exist a single best solution (global optimum). It has been shown in Chapter 9 that it is possible to obtain an optimal mathematical solution for a control system with linear plant dynamics. An alternative approach is to use `heuristics', or knowledge acquired through experience, to search for optimal solutions. One such technique is to employ a Genetic Algorithm (GA). This is a search algorithm based upon the evolutional process of natural selection of the fittest members of a given population to breed the next generation. 10.4.2 The genetic algorithm (GA) In the early 1960s Rechenburg (1965) conducted studies at the Technical University of Berlin in the use of an evolutionary strategy to minimize drag on a steel plate. Genetic algorithms were used by Holland (1975) and his students at the University of Michigan in the late 1970s and early 1980s to analyse a range of engineering problems. In particular, Goldberg (1983) used GAs to optimize the design of gas pipeline systems. The basic element of a GA is the chromosome. This contains the genetic information for a given solution and is typically coded as a binary string. For example, an eight digit binary number such as 11001001 represents a chromosome that contains eight genes. Initially, a population of chromosomes, created randomly, represent a number of solutions to a given problem. A `fitness function', which is in effect a performance index, is used to select the best solutions in the population to be parents to the offsprings that will comprise the next generation. The fitter the parent, the greater the probability of selection. This emulates the evolutionary process of `survival of the fittest'. Parents are selected using a roulette wheel method as shown in Figure 10.33. Here there are four candidate parents P1, P2, P3 and P4, having selection probabilities (from the fitness function) of 0.5, 0.3, 0.15 and 0.05 respectively. For the example in Figure 10.33, if the roulette wheel is spun four times, P1 may be selected twice, P2 and P3 once, and P4 not at all. Offsprings are produced by selecting parent chromosomes for breeding, and crossing over some of the genetic material. The amount of genetic material passed from parent to offspring is dictated by the random selection of a crossover point as indicated in Figure 10.34, where P1 and P2 are the parents, and 01 and 02 the offsprings. Mutation is allowed to occur in some of the offsprings, the amount being controlled by the mutation rate, typically a very small number. This results in the random change in a gene in an offspring, i.e. from 0 to 1. The breeding of successive generations continues until all offsprings are acceptably fit. In some cases, all offsprings will eventually have the same genetic structure, 366 Advanced Control Engineering Pointer P1 P4 P3 P2 Fig. 10.33 Roulette wheel selection. Crossover Point P1 1 1 0 0 1 0 1 1 01 1 1 0 0 P2 1 0 1 1 0 1 1 0 02 1 0 1 1 0 1 1 0 1 0 1 1 Fig. 10.34 Genetic material transfer during breeding. representing a global optimum, or in other cases, several solutions, called clustering may evolve. In this latter case, the system designer makes the decision as to which is the best solution. Example 10.5 A system has a fitness function J ˆ 1 ‡ sin ax (1097) as shown in Figure 10.35. Assume that the solution space has 31 values and that each solution can be represented by a five digit binary string ranging from 00000 to 11111. The value of a in equation (10.97) is therefore 11.6 (0.203 rad). If the population has four members, spinning a coin (heads ˆ 1, tails ˆ 0) produced the following initial population 00101 11110 00001 00011 Determine the offsprings from the initial generation and the subsequent generation. Solution From Figure 10.35 it can be seen that the optimal solution occurs when x10 ˆ 8, or x2 ˆ 01000. Table 10.1 shows the selection of parents for mating from the initial population. If a random number generator is used to generate numbers between 0.0 and 1.0, then the cumulative probability values in Table 10.1 is used as follows: Values between 0 and 0.342, Parent 1 selected Values between 0.343 and 0.488, Parent 2 selected         367 2.5 2 J = f (x) 1.5 1 0.5 0 0 10 5 15 x10 25 20 30 Fig. 10.35 Fitness function for Example 10.5. Table 10.1 Selection of parents for mating from initial population Parent 1 2 3 4 Total Mean Maximum x2 x10 J ˆ f (x) p ˆ J/J Cumulative probability Roulette wheel hits 00101 11110 00001 00011 5 30 1 3 1.848 0.792 1.201 1.571 5.412 1.353 1.848 0.342 0.146 0.222 0.290 1.000 0.250 0.342 0.342 0.488 0.710 1.000 2 1 0 1 4 1 2 Values between 0.489 and 0.710, Parent 3 selected Values between 0.711 and 1.000, Parent 4 selected The random number generator produced the following values: 0.326, 0.412, 0.862 and 0.067. Hence Parent 1 was selected twice, Parents 2 and 4 once and Parent 3 not at all. The selected parents were randomly mated with random choice of crossover points. The fitness of the first generation of offsprings is shown in Table 10.2. From Tables 10.1 and 10.2 the total fitness of the initial population was 5.412, whereas the total fitness of their offsprings was 5.956, an increase of 10%. Note that if each offspring was perfect, they would have a value of 810 , or 010002 , thus giving the maximum fitness that any population could have of 2  4 ˆ 80. The next spin of the random number generator produced values: 0.814, 0.236, 0.481 and 0.712, giving the roulette wheel hits shown in Table 10.2. The second generation of offsprings is shown in Table 10.3. From Table 10.3 the total fitness of the second generation of offsprings is 7.204, or an increase of 33% above the initial population. As things stand, since the two most significant binary digits in the second generation offsprings are 00, subsequent breeding will not 368 Advanced Control Engineering Table 10.2 Fitness of first generation of offsprings Parent 1 2 1 4 Breeding Offspring x2 x10 J ˆ f (x) j 1 00110 6 1.937 2 3 11101 00011 29 3 0.600 1.571 4 00101 5 00101 % & 11110 0010 1 % & 00011 j Total Mean Maximum p ˆ J/ J Cumulative probability Roulette wheel hits 0.325 0.325 1 0.101 0.264 0.426 0.690 0 1 1.848 0.310 1.000 2 5.956 1.489 1.937 1.000 0.250 0.325 Table 10.3 Fitness of second generation of offsprings Parent 1 4 3 4 Breeding Offspring x2 x10 J ˆ f (x) j 1 00101 5 1.848 2 3 00110 00101 6 5 1.937 1.848 4 00011 3 1.571 00110 & % 00101 00011 % & 001 01 j Total Mean Maximum 7.204 1.801 1.937 produce strings greater than 00111, or 710 . If all four offsprings had this value, then a total fitness for the population would be 7.953, which is close to, but not the ideal fitness of 8.0 as explained earlier. However, if mutation in a particular offspring changed one of the two most significant digits from 0 to 1, a perfect optimal value could still be achieved. Also to bear in mind, is the very limited size of the population used in this example. Example 10.6 The block diagram for an angular positional control system is shown in Figure 10.36. The system parameters are: Amplifier gain K2 ˆ 35 Servomotor constant K3 ˆ 15 Nm/A Field resistance Rf ˆ 20 Gear ratio n ˆ 5 Equivalent moment of inertia of motor and load Ie ˆ 13 kgm2 Sampling time T ˆ 005 seconds. Using a GA with a population of 10 members, find the values of the controller gain K1 and the tachogenerator constant K4 that maximizes the fitness function N 1  (i (kT) 0 (kT))2 T (10:98) J ˆ 100 kˆ0 when the system is subjected to a unit step at time kT ˆ 0. Perform the summation over a time period of 2 seconds (N ˆ 40). Allow a search space of 0±15 for K1 and      θi(s) + – θe(s) + Controller + K1 Amplifier Servomotor Load K2 K2 Rf n 2 Ies U(s) –    369 θo(s) Velocity Feedback nK4s Fig. 10.36 Angular positional control system. 0±1 for K4 . Assume that the solution space has 255 values and that each solution can be represented by an eight digit binary string, the first four digits representing K1 and the second four representing K4 . Solution The plant transfer function is 0 K2 K3 n (s) ˆ Rf Ie s2 U (10:99) If the state variables are x1 ˆ 0 (t) and x2 ˆ _0 (t) ˆ x_ 1 , then the state equations become   0      x_ 1 0 1 x1   ˆ ‡  K2 K3 n u x_ 2 0 0 x2 R f Ie and the output equations  0 _0  ˆ  1 0 0 1  x1 x2  Inserting values into the state equations        x_ 1 0 1 x1 0 ˆ ‡ u x_ 2 0 0 x2 10:096 (10:100) For a sampling time of 0.05 seconds, the discrete form of equation (10.100) is        1 0:05 x1 (kT) 0:0126 x1 (k ‡ 1)T ˆ ‡ u(kT) (10:101) x2 (k ‡ 1)T x2 (kT) 0 1 0:5048 From Figure 10.36 the control law is u(kT ) ˆ K1 (i (kT) where i (kT ) ˆ 1:0 for all kT > 0. x1 (kT)) nK4 x2 (kT) (10:102) 370 Advanced Control Engineering Hence values of K1 and K4 generated by the GA are inserted into equation (10.102) and the control u(kT) used to drive the discrete plant equation (10.101). The fitness function J is updated at each sampling instant to give an overall value at the end of each simulation. For a population of 10 members, 10 simulations are required per generation. Since the required search space is K1 0±15, K4 0±1, the following are examples of population membership K1 1111 0011 1001 K4 1111 0111 1100 K1 ˆ 15 K1 ˆ 3 K1 ˆ 9 K4 ˆ 1 K4 ˆ 7/15 ˆ 0467 K4 ˆ 12/15 ˆ 08 Table 10.4 shows the parent selection for mating from a randomly seeded initial population. The random numbers (0±1) from the roulette wheel spins were: 0.145, 0.422, 0.977, 0.339, 0.607, 0.419, 0.075, 0.027, 0.846, 0.047. The fitness of the first generation of offsprings is given in Table 10.5. Further breeding produced the sixth generation of offsprings given in Table 10.6. Inspection of Table 10.6 reveals that values of K1 ˆ 15, K4 ˆ 0333 produces a global maximum of J ˆ 1065. Figure 10.37 shows the unit step response of the system in Example 10.6 for (a) the maximum of the first generation of offsprings (J ˆ 841) (b) the global maximum of the sixth generation of offsprings (J ˆ 1065) Use of Schemata (Similarity templates): As the progression through generations of solutions takes place, there evolves certain similarities between genes within chromosomes. These similarities can be exploited using a similarity template or schema, that sits within a schemata framework. A schema employs a don't care symbol `*', so, for example, the sixth generation of offsprings in Table 10.6 could have employed the template 111 1 The use of schemata will aid the speed of convergence. Table 10.4 Parent selection from initial population for Example 10.6 p ˆ J/ Parent K1 K4 J 1011 0100 0001 1001 1110 0101 1001 0110 1101 0101 11 4 1 9 14 5 9 6 13 5 0.600 0.667 0.400 0.667 0.467 0.067 0.867 0.867 0.667 0.267 647 233 112 497 923 375 18 46 691 573 0.157 0.056 0.027 0.122 0.224 0.092 0.004 0.011 0.168 0.139 4115 411.5 923 1.000 0.100 0.224 1001 1010 0111 1010 0111 0001 1101 1101 1010 0100 Total Mean Maximum J Cumulative probability Roulette wheel hits 0.157 0.213 0.240 0.362 0.586 0.678 0.682 0.693 0.861 1.000 4 0 0 1 2 1 0 0 1 1 10 1 4         371 Table 10.5 Fitness of first generation of offsprings for Example 10.6 Parent Offspring j 1010 0111 1111 1001 0101 0100 0101 0001 1011 1010 1001 1001 1101 1001 1011 1010 1010 0111 1111 1001 j 1011 1001 1110 0111 0101 0001 0101 0100 1011 1001 1001 1010 1101 1010 1011 1001 1011 1001 1110 0111 Total Mean Maximum j j j j j j j j K1 K4 J 10 15 5 5 11 9 13 11 10 15 0.467 0.600 0.267 0.067 0.667 0.600 0.600 0.667 0.467 0.600 712 841 573 375 596 541 747 596 713 841 6535 653.5 841 Table 10.6 Fitness of sixth generation of offsprings for Example 10.6 Offspring K1 K4 1110 1111 1110 1111 1111 1111 1110 1110 1111 1111 14 15 14 15 15 15 14 14 15 15 0.333 0.400 0.267 0.333 0.467 0.267 0.533 0.467 0.533 0.333 0101 0110 0100 0101 0111 0100 1000 0111 1000 0101 J 1030 1029 1021 1065 970 1041 858 923 905 1065 Total Mean Maximum 9907 990.7 1065 1.2 Sixth generation θo(t) 1 0.8 First generation 0.6 0.4 0.2 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (s) 0.7 0.8 0.9 1 Fig. 10.37 Comparison between best first generation and best sixth generations solutions for Example10.6. 372 Advanced Control Engineering Other applications of Genetic Algorithms (a) Optimal control: Optimal control problems such as the linear quadratic regulator discussed in section 9.2 can also be solved using GAs. The discrete quadratic performance index given in equation (9.28) can be employed as a (minimum) fitness function directly. Alternatively, as shown in Example 10.6 the reciprocal of equation (9.28) provides a (maximum) fitness function. (b) Self-Organizing Fuzzy Logic Control: Genetic Algorithms may be used to adapt both membership functions and rulebase structures in a SOFLC system. Figure 10.38 shows an input window with three triangular fuzzy sets NB, Z and PB. Each set is positioned in its regime of operation by the centre parameter c so that, for example, NB can only operate on the negative side of the universe of discourse. The width of each set is controlled by parameter w. The chromosome string could take the form [c1 w1 c2 w2 c3 w3 ] (10103) c2 µ c1 c3 1.0 NB Z PB u w1 w3 w2 Fig. 10.38 ,aption of membership function features using genetic algorithms. If each parameter is a 4-bit string, the configuration in Figure 10.38 would be represented by [100011111000111110001111] (10104) 10.4.3. Alternative search strategies In addition to evolutionary search strategies such as GAs, there are a number of other search techniques that are employed for design optimization.         373 Simulated annealing The physical annealing process consists of heating a metal up to a prescribed temperature and then allowing it to cool slowly. During cooling, the molecules form crystals which are in a minimum energy condition. The metal, therefore, settles to a global minimum energy state. With simulated annealing, an energy term E is defined, which then becomes the performance index to be minimized. For a given energy change E at temperature T, the probability P of accepting a solution is Pˆe E kT (10105) where k is the Boltzmann constant. If the energy of the system has decreased, then the system may move to the new state, based on the probability given by equation (10.105). As cooling proceeds along a prescribed schedule, the system avoids local minima, and settles down to a global minimum energy state. Tabu search Like simulated annealing, tabu search is a technique designed to avoid the problem of becoming trapped in local optima. The procedure is basically hill-climbing, which commences at an initial solution and searches the neighbourhood for a better solution. However, the process will recognize, and avoid areas of the solution space that it has already encountered, thus making these areas `tabu'. The tabu moves are kept in a finite list, which is updated as the search proceeds. 10.5 Further problems Example 10.7 A fuzzy logic controller has input and output fuzzy windows as shown in Figure 10.39. The fuzzy rulebase is given in Figure 10.40. If defuzzification is by the centre of area method, calculate crisp control signals u(t) when the error e(t) and the rate of change of error ce(t) have the following values: (i) (ii) (iii) (iv) e(t) 0 4 1 4 ce(t) 2 1 15 15 [Answer u(t)] 667 266 301 0106 Note: For the centre of area method, use only those values inside the dotted lines in the output window. Example 10.8 The angular positional control system shown by the block diagram in Figure 10.36 is to have the velocity feedback loop removed and controller K1 replaced by a fuzzy logic controller (FLC) as demonstrated by Barrett (1992). The inputs to the FLC 374 Advanced Control Engineering µ(e) µ(ce) 1.0 1.0 0.8 0.8 0.6 0.6 NB Z PB 0.4 0.4 0.2 0.2 –5 Input Windows e 5 0 –2 (a) 0 2 ce (b) µ(u) 1.0 0.8 0.6 NB Z PB –10 0 10 0.4 0.2 Output Window u (c) Fig. 10.39 Input and output fuzzy windows for Example 10.7. e NB Z PB NB NB NB Z Z NB Z PB PB Z PB PB ce Fig. 10.40 Fuzzy rulebase for Example 10.7. are angular error e(kT) and rate-of-change of angular error ce(kT). The output from the FLC is a control signal u(kT). The input and output fuzzy windows have the same number of fuzzy sets, but different scales for the universes of discourse as shown in Figure 10.41. The fuzzy rulebase is given in Figure 10.42. If the state variables are x1 ˆ 0 (t) x2 ˆ _0 (t) ˆ x_ 1      NB NM NS ZE PS PM –1 0 1 2    375 PB 1.0 –4 –3 –2 3 4 Normalized Universe of Discourse –3 –8 –5 –2 –1 –4 –6 –4 –3 0 –2 –2 1 0 –1 0 2 2 1 4 2 6 3 4 3 e(kT ) 8 ce(kT ) 5 u(kT ) Fig. 10.41 Input and output fuzzy windows for Example 10.8. e NB NM NS ZE PS PM PB NB NB NB NM NS ZE PM PB NM NB NB NM NM PS PM PB NS NM NS NS NS PS PM PM ZE NM NS NS ZE PS PS PM PS NM NM NS PS PS PS PM PM NB NM NS PM PM PB PB PB NB NM ZE PS PM PB PB ce Fig. 10.42 Fuzzy rulebase for Example 10.8. 376 Advanced Control Engineering then the state and output equations    x_ 1 0 ˆ 0 x_ 2    1 1 ˆ _2 0 for the plant are as given in equation (10.100)     0 1 x1 u ‡ 10096 0 x2 (10:106)   0 x1 1 x2 and, for a sampling time of 0.2 seconds, the discrete form of equation (10.106) is  x1 (k ‡ 1)T x2 (k ‡ 1)T   1 0:2 ˆ 0 1     x1 (kT) 0:2019 ‡ u(kT) x2 (kT) 2:0192 (10:107) If the system, which is initially at rest when kT ˆ 0, is given a unit step input at this time, determine e(kT ), ce(kT), u(kT), x1 (kT) and x2 (kT) for values of kT ˆ 0, 0:2, 0:4 and 0.6 seconds. Assume that e(kT) ˆ (i 0 ) ˆ 1 ce(kT) ˆ d/dt(i ˆ di dt ˆ0 x1 (kT) 0 ) d0 dt d0 ˆ dt x2 (kT) Solution Table 10.7 Solution to Example 10.8 kT x1 (kT) x2 (kT) 0 0.2 0.4 0.6 0 0.2187 0.7906 1.2305 0 2.187 3.532 0.867 e(kT) 1 0.7813 0.2094 0.2305 ce(kT) u(kT) 0 2.187 3.532 0.867 1.083 0.666 1.32 0.511 x1 (k ‡ 1)T 0.2187 0.7906 1.2305 1.3007 x2 (k ‡ 1)T 2.187 3.532 0.867 0.165 Example 10.9 A neural network has a structure as shown in Figure 10.43. Assuming that all the activation functions are sigmoids, calculate the values of y12 and y22 when the inputs are (a) x1 ˆ 0:3, x2 ˆ 0:5 (b) x1 ˆ 0:9, x2 ˆ 0:1 when the weights and biases are      y12 y0 = 1 Output layer (l = 2) y22 y0 = 1 w10 w20 w21 w13 w11 w12 y11 w22 y31 y21 y11 Hidden layer w10 (l = 1)    377 w23 y31 y21 w30 w12 w20 w11 w21 x0 = 1 w22 x0 = 1 w31 w32 x0 = 1 Input layer (l = 0) x1 x2 Fig. 10.43 Neural network structure for Example 10.9. Hidden layer Output layer  1 Wj1 ˆ  3 2 2 3 1  3 1 2 2 Wj2 ˆ   2 bj1 ˆ  2 1 1 3  bj2 ˆ   3 3  Solution (a) y12 ˆ 0450, y22 ˆ 0862 (b) y12 ˆ 0405, y22 ˆ 0906 Example 10.10 In Example 10.9(b), if the target values for the outputs are d12 ˆ 0 and d22 ˆ 1, calculate new values for the weights and biases using the back-propagation algorithm. Assume a learning rate of 0.5 with no momentum term. 378 Advanced Control Engineering Solution Output layer: 1 ˆ 0:098, 2 ˆ 0:008 (Equation 10.78)     3:047 2:036 0:954 2:951 Wj2 ˆ bj2 ˆ 1:004 2:003 3:004 2:996 Hidden layer: 1 ˆ 0:0016, 2 ˆ 0:042, 3 ˆ 0:003 (Equation 10.80)     1:0007 2:00008 2:0008 Wj1 ˆ  3:019 3:0021 bj1 ˆ  1:979 1:999 0:9999 0:9985 Example 10.11 A system has a parabolic fitness function Jˆ x2 ‡ 2x (10:108) Using a genetic algorithm, find the value of x that maximizes J in equation (10.108). Assume that the solution space has 31 values in the range x ˆ 0 to 2 and that each solution can be represented by a five digit binary string ranging from 00000 to 11111. Let the population have four members and it is initially seeded by spinning a coin (heads ˆ 1, tails ˆ 0). Solution x(2) x(10) x J 01110 14 0.903 0.990591 01111 15 0.968 0.998976 10000 16 1.032 0.998976 10001 17 1.097 0.990591 Hence x ˆ 0:968 and 1.032 both give optimum solutions. Example 10.12 The closed-loop control system analysed by the root-locus method in Example 5.8 can be represented by the block diagram shown in Figure 10.44. Using root-locus, the best setting for K1 was found to be 11.35, representing a damping ratio of 0.5. Proportional Controller R(s) + E(s) K1 – Fig. 10.44 .lock diagram for Example 5.8. Plant U(s) 1 s(s + 2)(s + 5) C(s)         379 Validate, or otherwise, using a genetic algorithm that this value of K1 maximizes the fitness function J ˆ 100 N 1 c(kT))2 Tg f(r(kT) (10109) kˆ0 when the system is subjected to a unit step at time kT ˆ 0. Using a sampling time T ˆ 005 seconds, perform the summation over a time period of 10 seconds (N ˆ 200). Allow a search space of 0±100 for K1 . Assume that the solution space has 255 values and that each solution can be represented by an eight digit binary string chromosome. Use a randomly seeded initial population of 10 members. If the state variables are x1 ˆ c(t) _ ˆ x_ 1 x2 ˆ c(t) x3 ˆ c(t) ˆ x_ 2 From Figure 10.44, the plant differential equation may be written as x_ 3 ˆ 0x1 10x2 7x3 ‡ u The plant state and output equations are then        x_ 1 0 x1 0 1 0        _ 0 1  x2 ‡  0 u  x2 ˆ  0 1 0 10 7 x3 x_ 3 C ˆ [1 0 0 ]x (10110) For a sampling time of 0.05 seconds, the discrete form of equation (10.110) is        x1 (k ‡ 1)T 000002 x1 (kT) 10 00498 00011         x2 (k ‡ 1)T  ˆ  00 09889 00420  x2 (kT)  ‡  000111 u(kT)     x3 (kT) x3 (k ‡ 1)T 004201 00 04201 06948 (10111) Solution K1 (2) 00011101 00101001 00110011 00111000 10000001 10110011 K1 (10) K1 J 29 11.37 112.99 41 16.08 124.51 51 20.0 126.63 56 21.96 125.82 129 50.59 48.18 179 70.20 7.77 Thus the value of K1 that maximizes the fitness function in equation (10.109) is K1 ˆ 200. This produces an overshoot of 38% when kT ˆ 20 seconds, and represents an n of 1.847 rad/s and a of 0.303. Appendix 1 Control system design using MATLAB A1.1 Introduction MATLAB, its Toolboxes and SIMULINK have become, over a number of years, the industry standard software package for control system design. The purpose of this Appendix is to introduce the reader to some of the more useful aspects of MATLAB, and to illustrate how the software may be used to solve examples given in the main text of the book. A1.1.1 Getting started The examples given in this Appendix were generated using MATLAB Version 5.3. Once the software has been installed, MATLAB is most easily entered by clicking the MATLAB icon. Alternatively, in a Windows environment, MATLAB can be entered by clicking the following sequence Start " Programs " MATLAB for Windows" MATLAB 5.3 The user should now be in the MATLAB command window, which contains some helpful comments together with the MATLAB prompt ý. MATLAB commands are typed after the prompt, and entered using `Return' (or `Enter'). Terminating the command with `;' will suppress the result of the command being printed in the command window. Comments are preceded by the `%' symbol. A1.2 Tutorial 1: Matrix operations This tutorial introduces the reader to matrix operations using MATLAB. All text in courier font is either typed into, or printed into the command window. ý% Matrix Operations ý% To enter a matrix ýA=[1 3;5 9]; ýB=[4 7;10 0]; ýA Appendix 1 Control system design using MATLAB 381 A= 1 5 3 9 ýB B= 4 7 10 0 ý% Note that MATLAB is case sensitive ý% Matrix Addition ýA+B % Terminating with `;' will suppress `ans' ans= 5 4 15 9 ý% Matrix Multiplication ýA*B ans= 34 7 110 35 ý% Determinant of a Matrix ýdet(A) ans= 6 ý% Inverse of a Matrix ýinv(A) ans= 1:5000 0:5000 0:8333 0:1667 ý% Check ýC=inv(A); ýA*C ans= 1:0000 0:0000 0:0000 1:0000 ý% Solve AÙ 1*B ýA\B ans= 1:0000 10:5000 1:6667 5:8333 ý% Solve A*BÙ 1 ýA/B ans= 0:4286 0:2714 1:2857 1:0143 ý% Eigenvalues of a Matrix ýeig(A) ans= 0:5678 10:5678 ý% Coefficients of Characteristic Equation (asÙ 2+bs+c) ýpoly(A) ans= 1:0000 10:0000 6:0000 ý% Roots of Characteristic Equation (asÙ 2+bs+c=0) ýce=[1 10 6]; ýroots(ce) 382 Advanced Control Engineering ans= 10:5678 0:5678 ý% Note that roots(ce) and eig(A) give the same result ý% Transpose of a Matrix ýA' ans= 1 5 3 9 ý% Rank of a Matrix ýrank(A) ans= 2 ý% Create an Identity Matrix ýI=eye(3); ýI I= 1 0 0 0 1 0 0 0 1 ý% Condition of a Matrix ý% The higher the Condition Number, the more ill-conditioned the ý% matrix is ý% Log10 of Condition Number gives approx. number of decimal ý% places ý% lost due to round-off errors ýcond(A) ans= 19:2815 ý% Tutorial End The above session may be printed by clicking File " Print MATLAB may be closed by clicking File " Exit MATLAB A1.3 Tutorial 2: Time domain analysis This tutorial introduces the reader to time domain analysis using MATLAB. It uses commands from the Control System Toolbox. A list of the commands can be found using ýhelp control More information on individual commands can be obtained, for example ýhelp step will provide more detail on how to use the step command. Script files: A script file is an ASCII text file of MATLAB commands, that can be created using Appendix 1 Control system design using MATLAB 383 (a) a text editor (b) the MATLAB editor/debugger (c) a word processor that can save as pure ASCII text files. A script file should have a name that ends in `.m', and is run by typing the name of the file (without `.m') after the MATLAB prompt, or by typing the sequence File " Run Script " enter file name The advantage of a script file is that it only needs to be created once and saves the labour of continually typing lists of commands at the MATLAB prompt. The examples given in this tutorial relate to those solved in Chapter 3. Consider a first-order transfer function G(s)  1/1  s The impulse response function (Example 3.4, Figure 3.11) can be created by the following script file File name: examp34.m %impulse response of transfer function G(s)num(s)/den(s) %num and den contain polynomial coefficients %in descending powers of s clf num[1]; den[ 1 1 ]; impulse (num,den); grid; printsys(num,den,`s'); This shows how a transfer function is entered into MATLAB, where num=[1] is the numerator (K  1) and den[1 1] represents the `s' coefficient and the `s0 ' coefficient respectively. `Impulse (num, den) computes and plots the impulse response and grid produces a rectangular grid on the plot. Printsys (num, den, `s') prints the transfer function at the MATLAB prompt. A hard copy can be obtained by selecting, from the screen plot File " Print The step response of a first-order system (Example 3.5, Figure 3.13) is obtained using the step command File name: examp35.m % step response of transfer function G(s)num(s)/den(s) %num and den contain polynomial coefficients %in descending powers of s clf num[1]; den[ 1 1 ]; step(num,den); grid; printsys(num,den,`s'); 384 Advanced Control Engineering SIMULINK: The Control System Toolbox does not possess a `ramp' command, but the ramp response of a first-order system (Example 3.6, Figure 3.15) can be obtained using SIMULINK, which is an easy to use Graphical User Interface (GUI). SIMULINK allows a block diagram representation of a control system to be constructed and real-time simulations performed. With MATLAB Version 5.3, typing simulink at the MATLAB prompt brings up the SIMULINK Library Browser. Clicking on the `Create new model' icon in the top left-hand corner creates a new window called `untitled'.  icon attached to SIMULINK lists the SIMULINK options, Clicking on the &  and & Continuous lists the continuous systems options. To obtain a transfer function block, click and hold left mouse button on the `Transfer Fcn' icon under `Continuous', and drag to `untitled' window.  to close down `Continuous' and click on &  `Sources' to drag `Ramp' Click on &  'Sinks' to from Browser to `untitled' window. Close down `Sources' and click on & drag `Scope' to `untitled'. Holding down left mouse button connect `Ramp', `Transfer Fcn' and `Scope' together as shown in Figure A1.1. Double click on `Scope' to bring up scope screen, and, in `untitled', click `Simulation' and `Start'. The ramp response should appear on the scope screen. Click on the scope screen and choose autoscale (binoculars). Click print icon to obtain a hard copy of the ramp response. In the `untitled' window, click on `File' and `Save As' and save as a `.mdl' (model) file in a directory of your choice (i.e. examp36.mdl in `work'). The transfer function for a second-order system can easily be obtained in terms of !n and  using the ord2 command. This has !n and  as input arguments and generates the numerator and denominator of the equivalent transfer function. The script file sec_ord.m shows how Figure 3.19 can be generated using the ord2 and step MATLAB commands File name: sec_ord.m %Second-order system t[0: 0:1: 15]; wn1; zeta0:2; [num,den]ord2(wn,zeta); [y,x,t]step(num,den,t); zeta  0:4; [num1,den1]ord2(wn,zeta); [yl,x,t]step(num1,den1,t); zeta0:6; [num2,den2]ord2(wn,zeta); [y2,x,t]step(num2,den2,t); plot(t,y,t,yl,t,y2); grid; In sec_ord.m a user supplied common time base (t  0±15 seconds in 0.1 second intervals) has been set up. The plot command superimposes the step responses for zeta  0:2, 0.4 and 0.6. The step response for Example 3.8, the resistance thermometer and valve, shown in Figure 3.23 can be generated with script file examp38.m. Appendix 1 Control system design using MATLAB 385 1 s+1 Ramp Transfer Fcn Scope Fig. A1.1 IMULINK model for the ramp response of a first-order system. File name: examp38.m %Step response of a third-order system %G(s)ˆ12:5/(s‡0:5)(sÙ 2‡s‡25) clf numˆ[12:5]; denˆconv([ 1 0:5 ],[ 1 1 25 ]); step(num,den); grid; The transfer function is based on equation (3.75), with the input term Xi (s) ˆ 1/s removed. The denominator is input using the conv command (short for convolution), which multiplies two polynomial expressions together. A1.4 Tutorial 3: Closed-loop control systems This tutorial shows how MATLAB can be used to build up and test closed-loop control systems. The examples given relate to those solved in Chapter 4. The commands used in MATLAB to create a single model from the elements in the control loop are Command Operation series parallel feedback cloop Combines blocks in cascade, see Transformation 1, Table 4.1 Combines blocks in parallel, see Transformation 2, Table 4.1 Eliminates a feedback loop, see Transformation 4, Table 4.1 Closes the loop with unity feedback. Example 4.5 is a PI controlled liquid-level system shown in Figure 4.26. In the block diagram representation, Figure 4.27, the system parameters are K1 ˆ 1; Ti ˆ 5 seconds; Rf ˆ 15 s/m2 ; A ˆ 2 m2 ; Kv ˆ 0:1m3 /sV H1 ˆ 1 The PI controller and control valve transfer function is therefore Gc (s) ˆ 0:5s ‡ 0:1 5s and the plant transfer function is Gp (s) ˆ 15 30s ‡ 1 386 Advanced Control Engineering Since H1 ˆ 1, the system has unity feedback, and the closed-loop transfer function and step response is given by Filename: examp45.m %Example 4.5 (Liquid-Level Process Control System) %Use of series and cloop numcˆ[ 0:5 0:1 ]; dencˆ[ 5 0 ]; numpˆ[15]; denpˆ[ 30 1 ]; [numol,denol]ˆseries(numc,denc,nump,denp); [numcl,dencl]ˆcloop(numol,denol); printsys(numcl,dencl,`s'); step (numcl,dencl); grid; Case study Example 4.6.1 is a CNC machine-tool positional control system, whose block diagram representation is shown in Figure 4.31. When system parameter values are inserted, the block diagram is as shown in Figure A1.2. The closed-loop transfer function and step response is given by Filename: examp461.m %Case Study Example 4.6.1 (CNC Machine-Tool Positional Control) %Use of series and feedback numpˆ[80]; denpˆ[ 0:45 0 ]; nump1ˆ[0:365]; denp1ˆ[ 1 0 ]; numvfˆ[0:697]; denvfˆ[1]; numpfˆ[60]; denpfˆ[1]; [num,den]ˆfeedback(nump,denp,numvf,denvf); [numfp,denfp]ˆseries(num,den,nump1,denp1); [numcl,dencl]ˆfeedback(numfp,denfp,numpf,denpf); printsys(numcl,dencl,`s'); step(numcl,dencl); grid; In this example, the inner loop is solved first using feedback. The controller and integrator are cascaded together (nump1,denp1) and then series is used to find the forward-path transfer function (numfp,denfp). Feedback is then used again to obtain the closed-loop transfer function. The time response of the CNC control system is also obtained using SIMULINK as shown in Figure A1.3. Note that the variables t and x0 have been sent to workspace, an area of memory that holds and saves variables. The commands who and whos lists the variables in the workspace. The system time response can be obtained by the command plot(t,x0) Appendix 1 Control system design using MATLAB 387 Controller x d (s) + Integrator 80 0.45 s 1 s + 0.365 – Amplifier, Motor and Machine Table – Xo(s) 0.697 Tachogenerator 60 Position Transducer Fig. A1.2 CNC machine-tool positional control system. t Clock To Workspace 1 x0 To Workspace + – 0.36 Step 80 0.45s Controller Amp, Motor and Machine Table 1 s Integrator Scope 0.69 Tachogenerator 60 Position Transducer Fig. A1.3 SIMULINK simulation of CNC machine-tool positional control system. Case study Example 4.6.2 is a PID temperature control system, and is represented by the block diagram in Figure 4.33. Here, the PID control transfer function is not `proper', and the series command does not work. The forward path transfer function, with values inserted, is Gfp (s) ˆ 29:412s2 ‡ 39:216s ‡ 13:072 3s(4s ‡ 1)(8s ‡ 1) The closed-loop transfer function and step response is given by Filename: examp462.m %Case study example 4.6.2 (Temperature Control) %Use of feedback 388 Advanced Control Engineering numfpˆ[ 29:412 39:216 13:072 ]; denfpˆconv([ 3 0 ],conv([ 4 1 ],[ 8 1 ])); numtfˆ[1]; dentfˆ[1]; [numcl,dencl]ˆfeedback(numfp,denfp,numtf,dentf); printsys(numcl,dencl,`s'); step(numcl,dencl); grid; Case study Example 4.6.3 is a ship autopilot control system. The block diagram representation is given by Figure 4.37. Inserting system parameters gives a forwardpath transfer function Gfp (s) ˆ 0:2 20s2 ‡ 2s The closed-loop transfer function and step response is given by Filename: examp463.m %Case study example 4.6.3 (Ship Autopilot Control System) %Use of feedback numfpˆ[0:2]; denfpˆ[ 20 2 0 ]; numhfˆ[1]; denhfˆ[1]; [numcl,dencl]ˆfeedback(numfp,denfp,numhf,denhf); printsys(numcl,dencl,`s'); step(numcl,dencl); grid; A1.5 Tutorial 4: Classical design in the s-plane The tutorial demonstrates how MATLAB is used to generate root locus diagrams, and hence how to design control systems in the s-plane. Examples given in Chapter 5 are used to illustrate the MATLAB commands. The roots of the characteristic equation (or any polynomial) can be found using the roots command. Example 5.1 Check the stability of the system that has the characteristic equation s4 ‡ 2s3 ‡ s2 ‡ 4s ‡ 2 ˆ 0 At the MATLAB prompt type ýceˆ[ 1 2 1 4 2 ]; ýroots(ce) ansˆ 2:1877 0:35161:2843i 0:35161:2843i 0:5156 Two roots have positive real parts, hence the system is unstable. Appendix 1 Control system design using MATLAB 389 Example 5.2 What values of K1 make the following system unstable G(s)H(s) ˆ s(s2 8K1 ‡ s ‡ 2) Filename: examp52.m %Roots of denominator of closed-loop transfer function k1ˆ0:25 numˆ[8*k1]; denˆconv([ 1 0 ],[ 1 1 2 ]); [numcl,dencl]ˆcloop(num,den); roots(dencl) Running examp52.m with K1 set to 0.25, 0.15 and 0.35 gives ýexamp52 k1ˆ 0:2500 ansˆ 0:0000‡1:4142i 0:00001:4142i 1:0000 ýexamp52 k1 0:1500 ans 0:16301:3243i 0:16301:3243i 0:6740 ýexamp52 k1 0:3500 ans 0:11401:5057i 0:11401:5057i 1:2280 Hence, with K1  0:15, the system is stable, K1  0:25, the system has marginal stability and K1  0:35, the system is unstable. Example 5.8 The root locus for G(s)H(s)  K s(s  2)(s  5) can be drawn using the rlocus command as shown in examp58.m 390 Advanced Control Engineering Filename: examp58.m %Example 5.8 Simple root locus %G(s)ˆK/s(s‡2)(s‡5) clf numˆ[1]; denˆconv(conv([ 1 0 ],[ 1 2 ]),[ 1 5 ]); rlocus(num,den); axis([ 9 2 4 4 ]); %axis(`square'); With no axis command, the axes are generated automatically. Alternatively, user defined axes can be generated with axis ([xmin xmax ymin ymax ]). Using the command `square' generates the same scales on both x and y axes. With examp58.m it is easy to experiment with all three methods. Using MATLAB to design a system, it is possible to superimpose lines of constant  and !n on the root locus diagram. It is also possible, using a cursor in the graphics window, to select a point on the locus, and return values for open-loop gain K and closed-loop poles using the command [k, poles]relocfind(num, den) The script file examp58a.m shows how this is achieved Filename: examp58a.m %Example 5.8 Root locus %G(s)K/s(s  2)(s  5) clf num[1]; denconv(conv)[ 1 0 ],[ 1 2 ]),[ 1 5 ]); rlocus(num,den); axis([ 9 2 4 4 ]); zeta0:5; wn2: 2: 8; sgrid(zeta,wn); [k,poles]rlocfind(num,den) Here a line of   0:5 (  60 ) is drawn together with four !n circles (!n  2, 4, 6 and 8 rad/s.) At the MATLAB prompt, the user is asked to select a point in the graphics window. If the intersection of the complex locus with the   0:5 line is selected (see Figure 5.14), the following response is obtained ýexamp58a Select a point in the graphics window selected point 0:71431:2541i k 11:5754 poles 5:5796 0:71021:2531i 0:71021:2531i Example 5.9 is solved using examp59.m to create Figure 5.16. Appendix 1 Control system design using MATLAB 391 Filename : examp59.m %Example 5.9 Root Locus %G(s)ˆK/s(sÙ 2‡4s‡13) clf numˆ[1]; denˆconv([ 1 0 ],[ 1 4 13 ]); rlocus(num,den); axis([ 9 2 4 4 ]); zeta0:25; wn3; sgrid(zeta,wn); krlocfind(num,den) %Select k from graphic window When run, the program invites the user to select a point in the graphics window, which may be used to find the value of K when   0:25. If the last line of examp59.m is typed at the MATLAB prompt, the cursor re-appears, and a further selection can be made, in this case to select the value of K for marginal stability. This is demonstrated below ýexamp59 Select a point in the graphics window selected_point 0:7429  2:9175i k 22:9452 ýkrlocfind(num,den) Select a point in the graphics window selected_point 03:6304i k 52:7222 ý Example 5.10 uses the root locus method to design a PD controller that will allow the system 1 G(s)H(s)  s(s  2)(s  5) To meet a given time-domain specification. In examp510.m, the PD controller takes the form Gc (s)  K1 (s  2) Filename: examp510.m %Example 5.10 Root Locus %G(s)K(s2)/s(s2)(s5) clf num[ 1 2 ]; denconv(conv([ 1 0 ],[ 1 2 ]),[ 1 5 ]); rlocus(num,den); axis([ 9 2 4 4 ]); zeta0:7; wn3:5; sgrid(zeta,wn); krlocfind(num,den) %Select k from screen 392 Advanced Control Engineering numˆ[ k k*2 ]; [numcl,dencl]ˆcloop(num,den); step(numcl,dencl); grid; This produces the (pole-zero cancellation) root locus plot shown in Figure 5.18. When run, examp510.m allows the user to select the value of K1 that corresponds to  ˆ 0:7, and then uses this selected value to plot the step response. The text that appears in the command window is ýexamp510 Select a point in the graphics window selected_pointˆ 2:48572:5215i k 12.6077 ý Case study Example 5.11 uses root locus to design a ship roll stabilization system. The script file examp5ll.m considers a combined PD and PID (PIDD) controller of the form K1 (s  2)(s2  4s  8) Gc (s)  s Filename: examp511.m %Example 5.11 Root Locus %G(s)K(s2)(sÙ 24s8)/s(s1)(sÙ 20:7s2) clf numconv([ 1 2 ],[ 1 4 8 ]); denconv(conv([ 1 0 ],[ 1 1 ]),[ 1 0:7 2 ]); rlocus(num,den); axis([ 9 2 4 4 ]); zeta0:7; wn4:2; sgrid(zeta,wn); krlocfind(num,den) % Select k from screen numk*conv([ 1 2 ],[ 1 4 8 ]); [numcl,dencl]cloop(num,den); step(numcl,dencl); grid; This script file produces the root locus shown in Figure 5.24 and allows the user to select the value of K furthest from the imaginary axis that corresponds to   0:7. The command window text is ýexamp511 Select a point in the graphics window selected_point 3:20003:2607i k 10:2416 ý When K has been selected, the roll angle step response, as shown in Figure 5.25 is plotted. Appendix 1 Control system design using MATLAB 393 A1.6 Tutorial 5: Classical design in the frequency domain This tutorial shows how MATLAB can be used to construct all the classical frequency domain plots, i.e. Bode gain and phase diagrams, Nyquist diagrams and Nichols charts. Control system design problems from Chapter 6 are used as examples. Example 6.1 Construct the Bode diagram for G(s) ˆ 2 1 ‡ 0:5s Filename: examp61.m %Example 6.1 Bode Diagram %First-order system numˆ[2]; denˆ[ 0:5 1 ]; bode(num,den); The Nyquist diagram for the same system is Filename: examp61a.m %Example 6.1(a) Nyquist Diagram %First-order system numˆ[2]; denˆ[ 0:5 1 ]; nyquist(num,den); The script file examp61b.m shows how it is possible to customize a Bode diagram Filename: examp61b.m %Example 6.1(b) %Customizing a Bode Diagram clf numˆ[2]; denˆ[ 0:5 1 ]; wˆlogspace(1,2,200); %w from 10Ù 1 to 10Ù 2,200 points [mag,phase,w]bode(num,den,w) % cal mag and phase semilogx(w,20*log10(mag)),grid; xlabel(`Frequency (rad/s)'),ylabel(`Gain dB'); The logspace command allows a vector of frequencies to be specified by the user, in this case, 200 points between 101 and 102 (rad/s). The bode command has a left-hand argument [mag,phase,w] which allows the magnitude and phase to be calculated, but not displayed. The semilogx command plots the magnitude (converted to deciBels) against log frequency, and grid provides a log-linear grid. Script file examp62.m produces a second-order Bode gain diagram for Example 6.2. 394 Advanced Control Engineering Filename: examp62.m %Example 6.2 Bode Diagram %Second-order system clf numˆ[4]; denˆ[ 0:25 0:2 1 ]; wˆlogspace(1,2,200); [mag,phase,w]bode(num,den,w); semilogxw,20*log10mag,grid; xlabel(`Frequency (rad/s)'),ylabel (`Gain dB') The Nyquist diagram (! varying from  to ) is produced by examp64.m where G(s)H(s)  K s(s2  2s  4) Filename: examp64.m %Example 6.4 Nyquist Diagram %Third-order type one system num[1]; denconv([ 1 0 ],[ 1 2 4 ]); nyquist(num,den); axis([ 0:6 0:1 0:6 0:1 ]); Note that to obtain a reasonable diagram, it is usually necessary for the user to define the scales of the x and y axes using the axis command. The script file examp64a.m produces the Bode gain diagrams for the same system when K  4 and 8, see Figure 6.23(a). Filename: examp64a.m %Example 6.4(a) G(s)K/s(sÙ 22s4) %Creates Bode Gain Diagrams for K4 and 8 clf num[4]; denconv([ 1 0 ],[ 1 2 4 ]); wlogspace(1,1,200); mag,phase,w]bode(num,den,w); semilogx(w,20*log10(mag)); num[8]; [mag1,phase1,w]bode(num,den,w); semilogx(w,20*log10(mag),w,20*log10(mag1)),grid; xlabel(`Frequency (rad/s)'),ylabel (`Gain (dB)') Using the command margin (mag,phase,w) gives (a) Bode gain and phase diagrams showing, as a vertical line, the gain and phase margins. (b) a print-out above the plots of the gain and phase margins, and their respective frequencies. This is illustrated by running examp64b.m, which confirms the values given in Figure 6.23, when K  4. Appendix 1 Control system design using MATLAB 395 Filename: examp64b.m %Example 6.4(b) %G(s)ˆK/s(sÙ 2‡2s‡4) %Creates a Bode Gain and Phase Diagrams for Kˆ4 %Determines Gain and Phase Margins clf numˆ[4]; denˆconv([ 1 0 ],[ 1 2 4 ]); wˆlogspace(1,1,200); [mag,phase,w]bode(num,den,w); margin(mag,phase,w); xlabel(`Frequency(rad/s)'); Script file fig627.m produces the Nichols chart for Example 6.4 when K  4, as illustrated in Figure 6.27. The command ngrid produces the closed-loop magnitude and phase contours and axis provides user-defined axes. Some versions of MATLAB appear to have problems with the nichols command. Filename: fig627.m %Example 6.4 as displayed in Figure 6.27 %G(s)K/s(sÙ 22s4) where K4 %Nichols Chart num[4]; denconv([ 1 0 ],[ 1 2 4 ]); nichols(num,den); ngrid; axis([ 210 0 30 40 ]); Running script file fig629.m will produce the closed-loop frequency response gain diagrams shown in Figure 6.29 for Example 6.4 when K  3:8 and 3.2 (value of K for best flatband response). Filename: fig629.m %Example 6.4 as displayed in Figure 6.29 %G(s)K/s(sÙ 22s4) %Creates closed-loop Bode Gain Diagrams for K3:8 and 3.2 %Prints in Command Window Mp,k,wp and bandwidth clf num[3:8]; denconv([ 1 0 ],[ 1 2 4 ]); wlogspace(1,1,200); [numcl,dencl]cloop(num,den); [mag,phase,w]bode(numcl,dencl,w); [Mp,k]max(20*log10(mag)) wpw(k) n1; while 20*log10(mag(n))> 3,nn1; end bandwidthw(n) num[3:2]; [num2cl,den2cl]cloop(num,den); [mag1,phase1,w]bode(num2cl,den2cl,w); semilogx(w,20*log10(mag),w,20*log10(mag1)),grid; xlabel(`Frequency (rad/s)'),ylabel (`Gain)dB)') 396 Advanced Control Engineering The command cloop is used to find the closed-loop transfer function. The command max is used to find the maximum value of 20 log10 (mag), i.e. Mp and the frequency at which it occurs i.e. !p ˆ !(k). A while loop is used to find the 3 dB point and hence bandwidth = !(n). Thus, in addition to plotting the closed-loop frequency response gain diagrams, fig629.m will print in the command window: ý Mp 3:1124 k 121 wp 1:6071 bandwidth 2:1711 Case study Example 6.6 This is a laser guided missile with dynamics G(s)H(s)  20 s2 (s  5) The missile is to have a series compensator (design one) of the form G(s)  K(1  s) (1  0:25s) Figure 6.34 is generated using fig634.m and shows the Nichols Chart for the uncompensated system. Curve (a) is when the compensator gain K  1, and curve (b) is when K  0:537 (a gain reduction of 5.4 dB). Filename: fig634.m %Nichols Chart for Case Study Example 6.6 %Lead Compensator Design One, Figure 6.34 clf %Uncompensated System num[20]; den[ 1 5 0 0 ]; wlogspace(1,1,200); [mag,phase,w]nichols(num,den,w); %Compensator Gain set to unity num1[20 20]; den1conv([ 0:25 1 ],[ 1 5 0 0 ]); [mag1,phase1,w]nichols(num1,den1,w); %Compensator Gain reduced by 5.4dB num2[ 10:74 10:74 ]; den2conv([ 0:25 1 ],[ 1 5 0 0 ]); [mag2,phase2,w]nichols(num2,den2,w); plot(phase,20*log10(mag),phase1,20*log10(mag1), phase2,20*log10(mag2)) ngrid; axis([ 240 60 20 30 ]); Appendix 1 Control system design using MATLAB 397 A1.7 Tutorial 6: Digital control system design This tutorial looks at the application of MATLAB to digital control system design, using the problems in Chapter 7 as design examples. Example 7.3 To obtain the z-transform of a first-order sampled data system in cascade with a zero-order hold (zoh), as shown in Figure 7.10. Filename: examp73.m %Example 7.3 Transfer Function to z-Transform %Continuous and Discrete Step Response numˆ[1]; denˆ[ 1 1 ]; Tsˆ0:5; [numd,dend]ˆc2dm(num,den,Ts,`zoh'); printsys(num,den,`s') printsys(numd,dend,`z') subplot(121), step(num,den); subplot(122), dstep(numd,dend); The continuous to discrete command c2dm employs a number of conversion methods in the last term of the right-hand argument. These include `zoh' `foh' `tustin' zero-order hold first-order hold tustin's rule (see equation 7.102) The command subplot (mnp) creates an m-by-n array of equal sized graphs, the argument p indicates the current graph. Thus subplot (12p) produces a single row, two column array (i.e. side by side graphs). When p ˆ 1, the left-hand graph is produced and when p ˆ 2, the right-hand one is produced. Running examp73.m generates step response plots of both continuous and discrete systems, with the following text in the command window ý num/denˆ 1 s‡1 num/denˆ 0:39347 z0:60653 Example 7.4 This is a closed-loop digital control system as shown in Figure 7.14, with a plant transfer function 1 Gp (s)  s(s  2) Filename: examp74.m %Example 7.4 Open and Closed-Loop Pulse Transfer Functions %Discrete Step Response 398 Advanced Control Engineering numˆ[1]; denˆconv[ 1 0 ],[ 1 2 ]; Tsˆ0:5; [numd,dend]ˆc2dm(num,den,Ts,`zoh'); [numcld,dencld]ˆcloop(numd,dend); printsys(num,den,`s') printsys(numd,dend,`z') printsys(numcld,dencld,`z') dstep(numcld,dencld); Note that the command cloop works with both continuous and discrete systems. Running examp74.m will produce a step response plot of the closed-loop discrete system, and the open and closed-loop pulse transfer functions will be written in the command window ý num/denˆ 1 sÙ 2‡2s num/denˆ 0:09197z‡0:06606 zÙ 21:3679z0:36788 %see equation (7:53) num/den 0:09197z0:06606 zÙ 21:2759z0:43394 %see equation (7:55) The script file examp75.m simulates the Jury stability test undertaken in Example 7.5. With the controller gain K in Example 7.5 (Figure 7.14) set to 9.58 for marginal stability see equation (7.75), the roots of the denominator of the closed-loop pulse transfer function are calculated, and found to lie on the unit circle in the z-plane. Filename: examp75.m %Example 7.5 Stability in the z-plane K9:58 num[K]; denconv([ 1 0 ],[ 1 2 ]); Ts0:5; [numd,dend]c2dm(num,den,Ts,`zoh'); [numcld,dencld]cloop(numd,dend); printsys(numcld,dencld,`z') roots(dencld) Running examp75.m produces command window text ý K 9:5800 num/den 0:88107z0:63286 zÙ 20:48681z1:0007 ans 0:24340:9703i 0:24340:9703i %lies on unit circle i.e. %see equation (7:87)  RP2 IP2 1 Appendix 1 Control system design using MATLAB 399 Example 7.6 constructs the root-locus in the 0-plane for the digital control system in Example 7.4 (Figure 7.14). Filename: examp76.m %Example 7.6 Root Locus Analysis in the z-plane numˆ[1]; denˆconv([ 1 0 ],[ 1 2 ]); Tsˆ0:5; [numd,dend]ˆc2dm(num,den,Ts,`zoh'); rlocus(numd,dend); axis(`square') zgrid; kˆrlocfind(numd,dend) Note that rlocus and rlocfind works for both continuous and discrete systems. The statement `square' provides square axes and so provides a round unit circle. The command zgrid creates a unit circle together with contours of constant natural frequency and damping, within the unit circle. When examp76.m has been run, using rlocfind at the MATLAB prompt allows points on the loci to be selected and values of K identified (see Figure 7.20) ýSelect a point in the graphics window selected_pointˆ 0:2212‡0:9591i kˆ 9:7078 ýkˆrlocfind(numd,dend) Select a point in the graphics window selected pointˆ 2:08760:0117i k 60:2004 k  rlocfind(numd,dend) Select a point in the graphics window selected_point 1:00920:0117i k 103:3290 Example 7.7 A laser guided missile has dynamics G(s)H(s)  20  5) s2 (s and a compensator Gc (s)  0:8(1  s) (1  0:0625s) Script file examp77.m plots the closed-loop step responses of both the continuous system and discrete system (see Figure 7.21). In the latter case the plant pulse transfer function uses zoh, and the compensator is converted into discrete form using 400 Advanced Control Engineering Tustin's rule.   and  creates a 2 row, single column plot matrix (i.e. produces 2 plots, one beneath the other). Filename: examp77.m %Example 7.7 Digital Compensator using Tustin's Rule %Laser Guided Missile numˆ[20]; denˆconv([ 1 0 0 ],[ 1 5 ]); Tsˆ0:1; ncompˆ0:8*[ 1 1 ]; dcompˆ[0:0625 1]; [nol,dol]ˆseries(ncomp,dcomp,num,den); [ncl,dcl]ˆcloop(nol,dol); [numd,dend]ˆc2dm(num,den,Ts,`zoh'); [ncomd,dcomd]ˆc2dm(ncomp,dcomp,Ts,`tustin'); printsys(num,den,`s') printsys(numd,dend,`z') printsys(ncomp,dcomp,`s') printsys(ncomd,dcomd,`z') [nold,dold]ˆseries(ncomd,dcomd,numd,dend); [ncld,dcld]ˆcloop(nold,dold); subplot(211), step(ncl,dcl); subplot(212), dstep(ncld,dcld); The open continuous transfer functions and pulse transfer functions for the plant and compensator are printed in the command window ý num/denˆ 20 sÙ 3‡5sÙ 2 num/denˆ 0:0029551zÙ 2‡0:010482z‡0:002302 zÙ 32:6065zÙ 22:2131z0:60653 num/den %see equation (7:108) 0:8s0:8 0:0625s1 num/den 7:4667z6:7556 z0:11111 %see equation (7:110) Example 7.8 Here pole placement is used to design a digital compensator that produces exactly the step response of the continuous system. Filename: examp78.m %Example 7.8 Digital Compensator Design using Pole Placement K0:336 numkK*[3]; num[3]; Appendix 1 Control system design using MATLAB 401 denˆconv([ 1 0 ],[ 1 1 ]); Tsˆ0:5; [ncl,dcl]ˆcloop(numk,den); ncomdˆ0:327*[ 10:6065 ]; dcomd[ 10:519 ]; [numd,dend]c2dm(num,den,Ts,`zoh'); [nold,dold]series(ncomd,dcomd,numd,dend); [ncld,dcld]cloop(nold,dold); printsys(num,den,`s') printsys(numd,dend,`z') printsys(ncomd,dcomd,`z') printsys(ncl,dcl,`s') printsys(ncld,dcld,`z') subplot(211), step(ncl,dcl); subplot(212), dstep(ncld,dcld); The continuous and discrete closed-loop systems are shown in Figures 7.22(a) and (b). The digital compensator is given in equation (7.128). Script file examp78.m produces the step response of both systems (Figure 7.25) and prints the open and closed-loop continuous and pulse transfer functions in the command window ý K 0:3360 num/den 3 sÙ 2s num/den 0:31959z0:27061 z Ù 21:6065z0:60653 num/den 0:327z0:19833 z0:519 num/den 1:008 sÙ 2s1:008 num/den 0:10451zÙ 20:025107z0:053669 zÙ 32:021zÙ 21:4654z0:36846 A1.8 %see equation (7:115) %see equation (7:128) Tutorial 7: State-space methods for control system design This tutorial looks at how MATLAB commands are used to convert transfer functions into state-space vector matrix representation, and back again. The discrete-time response of a multivariable system is undertaken. Also the controllability and observability of multivariable systems is considered, together with pole placement design techniques for both controllers and observers. The problems in Chapter 8 are used as design examples. 402 Advanced Control Engineering Example 8.4 This converts a transfer function into its state-space representation using tf2ss(num, den) and back again using ss2tf(A,B,C,D,iu) when iu is the ith input u, normally 1. Filename: examp84.m %Example 8.4 transfer function to state space representation %And back again numˆ[4]; denˆ[1 3 6 2]; printsys(num,den,`s') [A,B,C,D]ˆtf2ss(num,den) [num1,den1]ˆss2tf(A,B,C,D,1); printsys(num1,den1,`s') condition_numberˆcond(A) The print-out in the command window is ýexamp84 num=denˆ : 4 sÙ 3‡3sÙ 2‡6s‡2 Aˆ 3 6 2 1 0 0 0 1 0 B 1 0 0 C 0 0 4 D 0 num/den 4:441e016sÙ 25:329e015s4 sÙ 33sÙ 26s2 condition_number 24:9599 Comparing the output with equation (8.35) it will be noticed that the top and bottom rows of have been swapped, which means that the state variables x1 and x3 have also been exchanged. This means that if the user is expecting the state variables to represent particular parameters (say position, velocity and acceleration), then the rows of and , and the columns of  might have to be re-arranged. The conversion from state-space to transfer function has produced some small erroneous numerator terms, which can be neglected. These errors relate to the condition of , and will increase as the condition number increases. Example 8.8 uses c2d to calculate the discrete-time state and control transition matrices (T ) and (T ) as given by equations (8.78), (8.80), (8.82) and (8.85). The Appendix 1 Control system design using MATLAB 403 matrix-vector difference equation (8.76) is then used to calculate the first five discrete values of the state variables when responding to a unit step input. Filename: examp88.m %Calculate state and control transition matrices Aˆ[ 0 1; 2 3 ] B[0; 1] Ts0:1 [AT,BT]c2d(A,B,Ts) %Compute discrete step response kT0 x[0; 0] u1 for i1: 5 xnew=AT*x+BT*u; %Matrix-vector difference equation (8.76) kTkTTs xxnew end The command window text is ýexamp88 A 0 1 2 3 B= 0 1 Ts 0:1000 AT 0:9909 0:0861 0:1722 0:7326 BT 0:0045 0:0861 kT 0 x 0 0 u 1 kT 0:1000 x 0:0045 0:0861 kT 0:2000 x 0:0164 0:1484 404 Advanced Control Engineering kTˆ 0:3000 xˆ 0:0336 0:1920 kTˆ 0:4000 xˆ 0:0543 0:2210 kTˆ 0:5000 xˆ 0:0774 0:2387 ý The for-end loop in examp88.m that employs equation (8.76), while appearing very simple, is in fact very powerful since it can be used to simulate the time response of any size of multivariable system to any number and manner of inputs. If and are timevarying, then (T ) and (T ) should be calculated each time around the loop. The author has used this technique to simulate the time response of a 14 state-variable, 6 input time-varying system. Example 8.10 shows the ease in which the controllability and observability matrices  and  can be calculated using ctrb and obsv and their rank checked. Filename: examp810.m %Example 8.10 %Controllability and observability Aˆ[ 2 0; 3 5 ] B[1; 0] C[ 1 1 ] D[0] Mctrb(A,B) rank_of_Mrank(M) system_orderlength(A) N(obsv(A,C)) Rank_of_Nrank(N) The command window will display ýexamp810 A 2 0 3 5 B 1 0 C 1 1 D 0 Appendix 1 Control system design using MATLAB 405 Mˆ 1 2 0 3 rank_of_M 2 system_order 2 %rank of M  system order. System completely %controllable. N 1 1 5 5 rank_of_N 1 %rank of N< system order. System is unobservable. Example 8.11 uses Ackermann's formula (acker) to calculate the elements of a regulator feedback matrix , that places the closed-loop poles at some desired location in the s-plane. Filename: examp811.m %Example 8.11 %Regulator design using pole placement %G(s)1/s(s4) num1; denconv([ 1 0 ],[ 1 4 ]); printsys(num,den,`s') %convert to state space [A,B,C,D]tf2ss(num,den); %Check for controllability; rank_of_Mrank(ctrb(A,B)) system_orderlength(A) %Enter desired characteristic equation chareqn[ 1 4 4 ] %Calculate desired closed-loop poles desiredpolesroots(chareqn) %Calculate feedback gain matrix using Ackermann's formula Kacker(A,B,desiredpoles) %Closed-loop state feedback system AsfAB*K; BsfB; CsfC; Dsf0; [numsf,densf]ss2tf(Asf,Bsf,Csf,Dsf); densf roots(densf) In examp811.m, the closed-loop transfer function is obtained and the roots of the denominator calculated to check that the closed-loop poles are at the desired locations. The output at the command window is ýexamp811 num/den 1 sÙ 24s rank_of_M 2 system_order{=} 2 % Rank of M = system order hence system % is controllable 406 Advanced Control Engineering chareqnˆ 1 4 4 desiredpolesˆ 2 2 K 0 4 densf 1 4 4 ans 2 2 % Actual closed-loop poles = desired closed-loop poles Example 8.12 shows how acker uses the transpose of the design a full-order state observer. and  matrices to Filename: examp812.m %Example 8.12 %Full-order observer design using pole placement A[ 0 1; 2 3 ] B[0; 1] C[ 1 0 ] D[0] %Check for observability; Nobsv(A,C) rank_or_Nrank(N) system_orderlength(A) %Enter desired characteristic equation chareqn[ 1 10 100 ] %Calculate desired observer eigenvalues desired eigenvaluesroots(chareqn) %Calculate observer gain matrix using Ackermann's formula Keacker(A',C',desired_eigenvalues) The command window text is ýexamp812 A 0 1 2 2 B 0 1 C 1 0 D 0 N 1 0 0 1 rank_of_N 2 system_order 2 % Rank of N = system order hence system % is observable Appendix 1 Control system design using MATLAB 407 chareqnˆ 1 10 100 desired_eigenvaluesˆ 5:00008:6603i 5:00008:6603i Ke 7:0000 77:0000 % Agrees with equation (8:150) Example 8.13 illustrates the design of a regulator combined with a reduced-order state observer. Filename: examp813.m %Example 8.13 %Regulator and reduced-order observer design %Using pole placement %Gs1=ss2s5 %Input in state-space format directly A[ 0 1 0; 0 0 1; 0 10 7 ] B[0; 0; 1] C[ 1 0 0 ] D[0] %Regulator design %Check for controllability; rank_of_Mrank(ctrb(A,B)) %Enter desired characteristic equation chareqn[ 1 7 25 15 ] %Calculate desired closed-loop poles desiredpolesroots(chareqn); %Calculate feedback gain matrix using Ackermann's formula Kacker(A,B,desiredpoles) %Reduced-order observer design A1E[ 1 0 ] AEE[ 0 1; 10 7] % See equation (8.163) obchareqn[ 1 63:2 2039:4 ] observerpolesroots(obchareqn); %Calculate observer matrix using Ackermann's formula Ke=acker(AEE', A1E', observerpoles) Note that the transposes of the partitioned matrices 1e and ee from equation (8.163) are used in acker to calculate e for the reduced-order state observer. The command window output is ýexamp813 A 0 1 0 0 0 1 0 10 7 B 0 0 1 C 1 0 0 D 0 408 Advanced Control Engineering chareqnˆ 1 7 25 15 Kˆ 15:0000 15:0000 0 A1Eˆ 1 0 AEEˆ 0 1 10 7 obchareqn 1:0e003 0:0010 0:0632 2:0394 Ke 1:0e003* 0:0562 1:6360 A1.9 % Regulator feedback matrix %Reduced-order observer matrix Tutorial 8: Optimal and robust control system design This tutorial uses the MATLAB Control System Toolbox for linear quadratic regulator, linear quadratic estimator (Kalman filter) and linear quadratic Gaussian control system design. The tutorial also employs the Robust Control Toolbox for multivariable robust control system design. Problems in Chapter 9 are used as design examples. Example 9.1 This example uses the MATLAB command lqr to provide the continuous solution of the reduced matrix Riccati equation (9.25) Filename: examp91.m %Example 9.1 %Continuous Optimal Linear Quadratic Regulator (LQR) Design A[ 0 1; 1 2 ] B[0; 1] Q[ 2 0; 0 1 ] R[1] [K,P,E]lqr(A,B,Q,R) The output at the command window is ýexamp91 A 0 1 1 2 B 0 1 Appendix 1 Control system design using MATLAB 409 Qˆ 2 0 0 1 Rˆ 1 Kˆ 0:7321 0:5425 Pˆ 2:4037 0:7321 0:7321 0:5425 Eˆ 1:27120:3406i 1:27120:3406i %State weighting matrix, see equation (9.8) %Control weighting matrix, see equation (9.8) %State Feedback gain matrix, see equations %(9.20) and (9.46) %Riccati matrix, see equation (9.45) %Closed-loop eigenvalues Example 9.2 This example solves the discrete Riccati equation using a reverse-time recursive process, commencing with (n)  0. Also tackled is the discrete state-tracking problem which solves an additional set of reverse-time state tracking equations (9.49) to generate a command vector v. Filename: examp92.m %Example 9.2 %Discrete Solution of Riccati Equation %Optimal Tracking Control Problem A[ 0 1; 1 1 ]; B[0; 1]; Q[ 10 0; 0 1]; R[1]; F[ 0:9859 0:27; 0:08808 0:76677 ]; G[ 0:9952 0:01409; 0:04598 0:08808 ]; S[0; 0]; %Initialize T0; V0; Ts0:1; [AD,BD]c2d(A,B,Ts); P[ 0 0; 0 0 ]; HBD'*P; XTs*RH*BD; YH*AD; KX Y; %Discrete reverse-time solution of the Riccati equations (9.29) %and (9.30) %Discrete reverse-time solution of the state tracking equations %(9.53) and (9.54) for i1:200 LTs*QK'*Ts*R*K; MADBD*K; PP1LM'*P*M; %Value of Riccati matrix at time (N(k1))T RIN[sin(0:6284*T); 0:6*cos(0:6284*T)]; SP1F*SG*RIN; VB'*SP1; %Value of command vector at time (N(k1))T SSP1; 410 Advanced Control Engineering TˆT‡Ts; PˆPP1; HˆBD' P; XˆTs*R‡H*BD; YˆH*AD; KˆX Y; %Value of feedback gain matrix at time %(N(k1))T end Checking values in the command window gives ýexamp92 ýA A 0 1 1 1 ýB B 0 1 ýQ Q 10 0 0 1 ýR R 1 ýTs Ts 0:1000 ýAD AD 0:9952 0:0950 0:0950 0:9002 ýBD BD 0:0048 0:0950 ýK K 2:0658 1:4880 %State weighting matrix %Control weighting matrix %Discrete-time state transition matrix %Discrete-time control transition matrix %Discrete-time steady-state feedback gain % matrix, after 200 reverse-time iterations ýP P 8:0518 2:3145 2:3145 1:6310 %Steady-state value of Riccati matrix The reverse-time process is shown in Figure 9.3. The discrete-time steady-state feedback matrix could also have been found using lqrd, but this would not have generated the command vector v. The forward-time tracking process is shown in Figure 9.4 using (kT) and v(kT) to generate opt (kT) in equation (9.55). The script file kalfilc.m uses the MATLAB command lqe to solve the continuous linear quadratic estimator, or Kalman filter problem. Appendix 1 Control system design using MATLAB 411 Filename: kalfilc.m %Continuous Linear Quadratic Estimator (Kalman Filter) Aˆ[ 0 1; 1 2 ] B[0; 1] C[ 1 0; 0 1 ] D[0] R[ 0:01 0; 0 1 ] Cd[ 0:1 0; 0 0:01 ] Q[ 0:1 0; 0 0:1 ] [K,P,E]lqe(A,Cd,C,Q,R) The command window text is ýkalfilc A 0 1 1 2 B 0 1 C 1 0 0 1 D 0 R 0:0100 0 Cd 0:1000 0 Q 0 1:0000 %Measurement noise covariance matrix 0 0:0100 %Disturbance matrix 0:1000 0 0 0:1000 K 0:1136 0:0004 0:0435 0:0002 P 0:0011 0:0004 0:0004 0:0002 E 1:05690:2589i 1:05690:2589i %Disturbance noise covariance matrix %Kalman gain matrix %Estimation error covariance matrix %Closed-loop estimator eigenvalues The script file kalfild.m solves, in forward-time, the discrete solution of the Kalman filter equations, using equations (9.74), (9.75) and (9.76) in a recursive process. The MATLAB command lqed gives the same result. Filename: kalfild.m %Discrete Linear Quadratic Estimator (Kalman Filter) %The algorithm uses discrete transition matrices A(T) and Cd(T) A[ 0 1; 2 3 ] 412 Advanced Control Engineering Cdˆ[ 0:1 0; 0 0:1 ] Cˆ[ 1 0; 0 1 ] IDˆeye(2); Tsˆ0:1 [AT,CD]ˆc2d(A,Cd,Ts) Rˆ[ 0:01 0; 0 1:0 ] Qˆ[ 0:1 0; 0 0:1 ] %Discrete solution of Kalman filter equations %Initialize P1ˆID; %Initial covariance matrixˆidentity matrix P2ˆ(AT*P1*AT')‡(CD*Q*CD'); XˆP2*C'; Yˆ(C*P2*C')‡R; KˆX/Y; P3ˆ(ID(K*C))*P2; %Solve recursive equations for i1: 20 P1P3; P2(AT*P1*AT')(CD*Q*CD'); XP2*C'; Y(C*P2*C')R; KX/Y; P3(ID(K*C))*P2; end Checking results in the command window ýkalfild A 0 1 2 3 Cd 0:1000 0 C 1 0 0 1 Ts 0:1000 AT 0:9909 0:1722 CD 0:0100 0:0009 0 0:1000 %Disturbance matrix 0:0861 0:7326 %Discrete-time state transition matrix 0:0005 0:0086 %Discrete-time disturbance transition %matrix R 0:0100 0 0 1:0000 Q 0:1000 0 0 0:1000 ýK K 0:0260 0:0002 0:0181 0:0002 %Measurement noise covariance matrix %Disturbance noise covariance matrix %Kalman gain matrix after 21 iterations Appendix 1 Control system design using MATLAB 413 Case study Example 9.3 This is a china clay band drying oven. The state and output variables are burner temperature, dryer temperature and clay moisture content. The control parameters are burner gas supply valve angle and clay feed-rate. A linear quadratic Gaussian control strategy is to be implemented. Script file examp93.m calculates the optimal feedback control matrix  and also the Kalman gain matrix e using the recursive equation (9.99). Filename: examp93.m %Linear Quadratic Gaussian (LQG) Design %Case Study Example 9.3 Clay Drying Oven %Optimal Controller A=[0:02128 0 0;0:0006 0.005 0;0 0.00038 0:00227] B[8:93617; 0; 0] Cd[ 0:1 0 0; 0 0:1 0; 0 0 0:00132 ] C[ 1 0 0; 0 1 0; 0 0 1 ] D[0] Ts2; [AT, BT] =c2d(A,B, Ts) Q[ 0 0 0; 0 0:5 0; 0 0 20 ] R[1] [K,P,E]lqr(A,B,Q,R) %Kalman Filter Re[ 0:01 0 0; 0 0:01 0; 0 0 7:46 ] Qe[ 0:1 0 0; 0 0:1 0; 0 0 0:1 ] [AT,CD]c2d(A,Cd,Ts) %Initialize %Implement equations (9:99) IDeye(3); P1=ID; %Initial covariance matrix=identity matrix P2(AT*P1*AT')(CD*Qe*CD'); XP2*C'; Y(C*P2*C')Re; KeX/Y; P3(ID(Ke*C))*P2; %Solve recursive equations for i1: 19 P1P3; P2(AT*P1*AT )(CD*Qe*CD'); XP2*C'; Y(C*P2*C')Re; KeX/Y; P3(ID(Ke*C))*P2; End Ke P3 The output at the command window is ýexamp93 A= 414 Advanced Control Engineering B 0:0213 0 0 0:0006 0:0050 0 0 0:0004 0:0023 8:9362 0 0 Cd 0:1000 0 0 0 0:1000 0 0 0 0:0013 %Disturbance matrix, equation C 1 0 0 0 1 0 0 0 1 D 0 AT BT 0:9583 0 0:0012 0:9900 0:0000 0:0008 0 0 0:9955 17:4974 0:0105 0:0000 %A(T), Ts2 seconds %B(T), equation (9.86) Q 0 0 0 0 0 0:5000 0 0 20:0000 %State weighting matrix R 1 %Control weighting matrix 0:0072 0:6442 1:8265 %Feedback gain matrix, %equation (9.92) K P 1:0e003* 0:0000 0:0001 0:0002 0:0001 0:0108 0:0300 0:0002 0:0300 3:6704 %Riccati matrix, equation %(9:91) E %Closed-loop eigenvalues, %equation (9:93) 0:04490:0422i Re Qe 0:04490:0422i 0:0033 0:0100 0 0 0:0100 0 0 0 0 %Measurement noise covariance 7:4600 %matrix, equation (9:100) 0:1000 0 0 0:1000 0 0 0 0 %Disturbance noise covariance 0:1000 %matrix, equation(9:101) CD 0:1958 0:0001 0 0:1990 0 0 %Discrete-time disturbance %transition matrix, equation %(9:95) Appendix 1 Control system design using MATLAB 415 Ke 0:0000 0:0001 0:0026 0:4408 P3 0:0003 0:0000 0:0003 0:4579 0:0000 0:0000 0:0006 0:0325 0:0044 0:0000 0:0000 0:0000 0:0000 0:0046 0:0000 0:0000 0:2426 %Kalman gain matrix after 20 %iterations, %equation (9:102) % and Figure 9:16 %Estimation error covariance %matrix, %after 20 iterations, %equation (9:102) The implementation of the LQG design is shown in Figures 9.12 through to 9.17. Example 9.6 This is a multivariable robust control problem that calculates the optimal H controller. The MATLAB command hinfopt undertakes a number of iterations by varying a parameter until a best solution, within a given tolerance, is achieved. Filename: examp96.m %Example 9.6 %Multivariable robust control using H infinity %Singular value loop shaping using the weighted mixed %sensitivity approach nug200; dng[ 1 3 102 200 ]; [ag,bg,cg,dg]tf2ss(nug,dng); ss_gmksys(ag,bg,cg,dg); w1[ 1 100; 100 1 ]; nw1neg[ 100 1 ]; dw1neg[ 1 100 ]; w2[1; 1]; w3[ 100 1; 1 100 ]; nw3neg[ 1 100 ]; dw3neg[ 100 1 ]; [TSS_1]augtf(ss_g,w1,w2,w3); [ap,bp,cp,dp]branch(TSS_); [gamopt,ss_f,ss_cl]hinfopt(TSS_,1); [acp,bcp,ccp,dcp]branch(ss_f); [acl,bcl,ccl,dcl]branch(ss_cl); [numcp,dencp]ss2tf(acp,bcp,ccp,dcp,1); printsys(nug,dng,`s') printsys(nw1neg,dw1neg,`s') printsys(nw3neg,dw3neg,`s') wlogspace(3,3,200); %[mag,phase,w]bode(nw1neg,dw1neg,w); %[mag1,phase1,w]bode(nw3neg,dw3neg,w); %semilogx(w,20*log10(mag),w,20*log10(mag1)),grid; [sv,w]sigma(ss_g); %[sv,w]sigma(ss_cl); %[sv,w]sigma(ss_f); semilogx(w,20*log10(sv)),grid; ag bg 416 Advanced Control Engineering cg dg acp bcp ccp dcp printsys(numcp,dencp,`s') The command mksys packs the plant state-space matrices    and  into a tree structure ss_g. The command augtf augments the plant with the weighting functions as shown in Figure 9.31. The branch command recovers the matrices    and  packed in TSS_. The hinfopt command produces the following output in the command window No -1 2 3 4 5 6 7 8 9 10 11 Gamma D11<ˆ1 P-Exist -----------------1:0000e‡000 OK OK 5:0000e001 OK OK 2:5000e001 OK OK 1:2500e001 OK OK 1:8750e001 OK OK 1:5625e001 OK OK 1:4063e001 OK OK 1:3281e001 OK OK 1:2891e001 OK OK 1:3086e001 OK OK 1:2988e001 OK OK P>ˆ0 S-Exist --------FAIL OK FAIL OK FAIL OK OK OK FAIL OK FAIL OK FAIL OK FAIL OK OK OK FAIL OK OK OK s>0 lam(PS)<1 C.L. ------------OK OK UNST OK OK UNST OK OK UNST OK OK STAB OK OK UNST OK OK UNST OK OK UNST OK OK UNST OK OK STAB OK OK UNST OK OK STAB Iteration no: 11 is your best answer under the tolerance: 0:0100: After eleven iterations, hinfopt identifies that in equation (9.176) has a best value of 0.13. The command sigma calculates the data for a singular value Bode diagram as shown in Figures 9.32, 9.34 and 9.35. Other information printed in the command window is given below num/den 200 sÙ 33sÙ 2102s200 %Plant transfer function num/den 100s1 s100 %W1 s (s) num/den s100 100s1 ag %W1 T (s) 3 102 200 1 0 0 0 1 0 Appendix 1 Control system design using MATLAB 417 bgˆ 1 0 0 cgˆ 0 0 200 dgˆ 0 acpˆ 0:0100 0:0022 0:0039 0:0148 0:1367 0:0086 7:7634 21:6533 37:1636 621:8932 3:1477 2:2338 8:8071 102:2531 13:5575 3:7282 81:8751 37:7767 162:5129 0:0461 2:0317 0:4353 0:1067 0:6756 0:1970 bcp 7:9756 0:0906 0:5820 8:8009 13:6595 ccp 0:0861 0:1698 dcp 0 num/den 0:1213 0:6544 %Controller %matrices, %See equation %(9.178) 11:1708 159:1184sÙ 416389:1905sÙ 363965:5785sÙ 21654830:8855s3182367:0874 sÙ 5275:687sÙ 420439:8141sÙ 3324835:0198sÙ 23782679:1393s37794:3283 %Controller transfer function, %See equation (9.179) A1.10 Tutorial 9: Intelligent control system design This tutorial uses the MATLAB Control System Toolbox, the Fuzzy Logic Toolbox and the Neural Network Toolbox. Problems in Chapter 10 are used as design examples. Example 10.3 This is the inverted pendulum control problem and, as a benchmark, is initially solved as a multivariable control problem, using pole placement (Ackermann's formula) to calculate the feedback gain matrix in examp103.m. Filename: examp103m %Regulator design using pole placement %Inverted pendulum problem A[ 0 1 0 0; 9:81 0 0 0; 0 0 0 1; 3:27 0 0 0 ] B[0; 0:667; 0; 0:889] C[ 1 0 0 0 ] D0 %Check for controllability; rank_of_Mrank(ctrb(A,B)) 418 Advanced Control Engineering %Enter desired characteristic equation chareqnˆ[ 1 12 72 192 256 ] %Calculate desired closed-loop poles desiredpolesˆroots(chareqn) %Calculate feedback gain matrix using Ackermann's formula Kˆacker(A,B,desiredpoles) The output at the command window is ýexamp103 Aˆ 0 1:0000 0 0 9:8100 0 0 0 0 0 0 1:0000 3:2700 0 0 0 B 0 0:6670 0 0:8890 C 1 0 0 0 D 0 rank_of_M 4 chareqn 1 12 72 192 256 desiredpoles 4:00004:0000i 4:00004:0000i 2:00002:0000i 2:00002:0000i K 174:8258 57:1201 39:1437 29:3578 The state-variable feedback solution was implemented in SIMULINK as shown in Figure A1.4. Inverted Pendulum, Fuzzy Logic Controller Design: The fuzzy logic controller used for the inverted pendulum problem has four input windows and one output window as shown in Figure 10.14. One version of the controller has a Mamdani-type rulebase consisting of 11 rules as given in equation (10.52). The MATLAB Fuzzy Inference System (FIS) Editor can be entered by typing at the MATLAB prompt ý fuzzy This brings up the main menu screen as shown in Figure A1.5. Double-clicking on the `theta' icon brings up the membership function editor. Figure A1.6 shows the NB fuzzy set being given the trapizoidal (trapmf) membership function [1 1 0:10]. Other membership functions include gaussmf (Gaussian), trimf (triangular) and gbellmf (generalized bell). For further information type ý help fuzzy Returning to the main menu and double-clicking on the centre box entitled `Pendulum 11' (mamdani) will bring up the FIS rule editor, as shown in Figure A1.7. Highlighted are the antecedents and the consequent of Rule 1. Appendix 1 Control system design using MATLAB 419 theta 174 tdot 57.1 + + + + Scope x′ = Ax+Bu y = Cx+Du Scope1 Inverted pendulum x 39.1 Scope2 xdot Scope4 Scope3 29.3 Fig. A1.4 Inverted pendulum control system design using pole placement theta Pendulum11 tdot (mamdani) x f xdot FIS Name: And method Pendulum11 min Or method max Implication min Aggregation max FIS Type: mamdani Current Variable Name Type Range Fuzzification centroid System "Pendulum11": 4 inputs, 1 output, and 11 rules Fig. A1.5 Main menu of Fuzzy Inference System (FIS) editor. Help Close Membership function plots FIS Variables NB plot points: 181 Z PB 1 theta f tdot 0.5 x 0 –0.1 –0.08 –0.06 –0.04 xdot 0.02 0 –0.02 0.04 Input variable “theta” 0.06 0.08 Current Membership Function (click on MF to select) Current Variable Name Name NB theta Type Type input Params Range [–0.1 0.1] Display Range [–0.1 0.1] Ready Fig. A1.6 FIS membership function editor. trapmf [–1 –1 –0.1 0] Help Close 0.1 Appendix 1 Control system design using MATLAB 421 1. If (theta is PB) and (tdot is PB) then (f is PB) (1) 2. If (theta is PB) and (tdot is Z) then (f is PB) (1) 3. If (theta is PB) and (tdot is NB) then (f is Z) (1) 4. If (theta is Z) and (tdot is PB) then (f is PB) (1) 5. If (theta is Z) and (tdot is Z) then (f is Z) (1) 6. If (theta is Z) and (tdot is NB) then (f is NB) (1) 7. If (theta is NB) and (tdot is PB) then (f is Z) (1) 8. If (theta is NB) and (tdot is Z) then (f is NB) (1) 9. If (theta is NB) and (tdot is NB) then (f is NB) (1) 10. If (tdot is PB) then (f is PB) (1) 11. If (tdot is NB) then (f is NB) (1) If not Connection or x is tdot is NB Z PB none NB Z PB none NB Z PB none and and and theta is not Then f is xdot is NB Z PB none NB Z PB none not not not Weight and 1 Delete rule Add rule Change rule Help FIS Name: Pendulum11 Close Fig. A1.7 FIS rule editor. force x′ = Ax+Bu y = Cx+Du theta tdot Inverted pendulum Fuzzy Logic Controller x xdot Fig. A1.8 Simulink implementation of inverted pendulum fuzzy logic control problem. 422 Advanced Control Engineering When editing is complete, the controller is stored as a .fis file, in this case pendulum11.fis. The inverted pendulum fuzzy logic control problem can now be implemented in SIMULINK as shown in Figure A1.8. The fuzzy logic icon is obtained by opening the fuzzy logic toolbox within the Simulink Library Browser, and dragging it across. Running the simulation as it stands in Figure A1.8 will bring up a MATLAB error because the properties of the fuzzy logic controller have not been defined. At the MATLAB prompt, type ý fismat=readfis This will allow you to select from a directory a suitable stored filename, i.e. pendulum11.fis. The system will respond with fismatˆ name: `Pendulum11' type: `mamdani' andMethod: `min' orMethod: `max' defuzzMethod: `centroid' impMethod: `min' aggMethod: `max' input: [14 struct] output: [11 struct] rule: [111 struct] This means that the fuzzy logic controller parameters have been placed in the workspace under `fismat', and that the simulation can now proceed. More details on the properties of the fuzzy logic controller can be found by typing ý out=getfis(fismat) The system will respond with Name ˆ Pendulum11 Type ˆ mamdani NumInputsˆ4 InLabelsˆ theta tdot x xdot NumOutputsˆ1 OutLabelsˆ f NumRules ˆ11 AndMethod ˆmin OrMethod ˆmax ImpMethod ˆmin AggMethod ˆmax DefuzzMethod ˆcentroid Outˆ Pendulum 11 The results of the pole placement and the 11 rule and 22 rule fuzzy logic controllers are compared in Figure 10.15. Figure 10.16 shows the _ control surface, also generated using the FIS Editor. Appendix 1 Control system design using MATLAB 423 1 neuron output layer purelin activation function 1 neuron input layer 10 neuron hidden layer tansig activation function Fig. A1.9 Demonstration neural network. The MATLAB Neural Network Toolbox: This Toolbox was not used in the Examples given in Chapter 10. For details on the Toolbox, type ý help nnet To demonstrate how the Toolbox is used, consider a neural network with a structure shown in Figure A1.9. The script file neural1.m trains and runs the network. Filename: neural1.m %Feedforward Back-propagation Neural Network %Network structure: 1:10(tansig):1(purelin) %PˆInput values Pˆ[ 0 1 2 3 4 5 6 7 8 ]; %TˆTarget values Tˆ[ 0 0:84 0:91 0:14 0:77 0:96 0:28 0:66 0:99 ]; plot(P,T,`o'); %Use Levenberg-Marquardt back-propagation training netnewff([ 0 8 ],[ 10 1 ], `tansig'`purelin',`trainlm'); Y1sim(net,P); plot(P,T,P,Y1,`o'); net:trainParam:epochs50; nettrain(net,P,T); Y2sim(net,P); plot(P,T,P,Y2,`o');  is a vector of inputs and  a vector of target (desired) values. The command newff creates the feed-forward network, defines the activation functions and the training method. The default is Levenberg±Marquardt back-propagation training since it is fast, but it does require a lot of memory. The train command trains the network, and in this case, the network is trained for 50 epochs. The results before and after training are plotted. Appendix       Matrix: An m  n matrix  is an array of elements with m rows and n columns, and is written as  a11  a21   ˆ  ..  . am1 a12 a22 .. . ... ... am2 . . . amn a1n a2n .. .      (A2:1) If m ˆ n,  is a square matrix. Vector: A column vector  is  x1  x2   ˆ  ..  . xm      (A2:2) A row vector  is  ˆ [ y1 y2 . . . yn ] (A2:3) Null matrix: This has all elements equal to zero. 0 0 ˆ  ...  0 0 0 .. . 0  ... 0 ... 0   (A2:4) ... 0 Diagonal matrix: This is a square matrix with all elements off the diagonal equal to zero.  c11 ˆ 0 0 0 c22 0  0 0  c33 (A2:5) Appendix  2 Matrix algebra 425 Identity matrix: This is a diagonal matrix and is normally denoted by .  1  ˆ 0 0 with all diagonal elements equal to unity,  0 0 1 0 1 0 (A2:6) Symmetric matrix: This is a square matrix where elements aij ˆ aji .   5 8 9  ˆ 8 4 2 9 2 3    (A2:7)  Transpose of a matrix: The transpose of a matrix , denoted by T , is formed by interchanging its rows and columns.   2 4 5  ˆ 3 1 9 (A2:8) 6 8 4  2 T ˆ  4 5 3 1 9  6 8 4 (A2:9) Determinant of a matrix: Given a 2  2 matrix   a11 a12 ˆ a21 a22 (A2:10) Its determinant is det  ˆ a11 a21 a12 ˆ a11 a22 a22 a21 a12 (A2:11) Minors of an Element: The minor Mij of element aij of det  is the determinant formed by removing the ith row and the jth column from det . 8 det  ˆ 4 9 M23 ˆ 6 3 5 2 1 7 8 6 ˆ 9 5 14 (A2:12) Cofactor of an Element: The cofactor Cij of element aij of det  is defined as ij ˆ ( 1)(i‡j) Mij 426 Advanced Control Engineering In general, the determinant of a square matrix is given by det  ˆ n X aik Cik (expanding along the ith row) kˆ1 or det  ˆ m X akj Ckj (expanding along the jth column) (A2:13) kˆ1 Given 2 3 5 05 9 2 4  ˆ 41 3 6 8 Expanding along the first column gives 4 5 3 8 9 8 9 ˆ 2(27) 1( 4) ‡ 6( 15) 0 det  ˆ 2 ˆ 3 0 1 4 5 ‡6 32 (A2:14) Singular matrix: A matrix is singular if its determinant is zero. Nonsingular matrix: A matrix is nonsingular if its determinant is not zero. Adjoint of a matrix: The adjoint of an n  n matrix is the transpose of the matrix when all elements have been replaced by their cofactors. 3T 2 C11 C12 . . . C1n 6 C21 C22 . . . C2n 7 7 6 adj  ˆ 6 .. (A2:15) .. 7 .. 4 . . 5 . Cn1 ... Cn2 Cnn Inverse of a matrix: An n  n matrix  has an inverse  1 , which satisfies the relationship  1  ˆ  1 ˆ (A2:16) The inverse of  is given by  1 ˆ adj  det  (A2:17) Addition and subtraction of matrices: The sum of two matrices ‡ˆ is given by aij ‡ bij ˆ cij the difference between two matrices  ˆ (A2:18) Appendix 2 Matrix algebra 427 is given by bij ˆ cij aij (A2:19) Multiplication of matrices: The product of two matrices  ˆ  is given by cij ˆ n X (A2:20) aik bki kˆ1 Multiplication by a constant ˆ   a11 a21 ka11 k ˆ ka21 a12 a22  ka12 ka22  (A2:21) Note that in general, multiplication is not commutative, i.e.  6ˆ . Trace of a matrix: The trace of an n  n matrix is the sum of the diagonal elements of the matrix. tr  ˆ a11 ‡ a22 ‡    ‡ ann (A2:22) Rank of a matrix: The rank of a matrix is equal to the number of linearly independent rows or columns. The rank can be found by determining the largest square submatrix that is nonsingular. If 2 3 1 2 3 (A2:23)  ˆ 40 4 15 1 2 3 since det  is zero, the 3  3 matrix is singular. Consider a submatrix   1 2 sub ˆ 0 4 The determinant of sub is 4, hence the rank of  is the size of sub , i.e. 2. (A2:24) References and further reading Ackermann, J. (1972) Der Entwurf Linearer Regelungssysteme im Zustandsraum, Regelungstechnik und Prozessdatenverarbeitung, 7, pp. 297±300. Anderson, J.A. (1972) A Simple Neural Network Generating an Interactive Memory, Mathematical Biosciences, 14, pp. 197±220. Anderson, B.D.O. and Moore, J.B. (1979) Optimal Filtering, Prentice-Hall, Englewood Cliffs, NJ. Anderson, B.D.O. and Moore, J.B. (1990) Optimal Control, Prentice-Hall, Englewood Cliffs, NJ. AÊstroÈm, K.J. and Wittenmark, B. (1984) Computer Controlled Systems, Prentice-Hall, Inc., Englewood Cliffs, NJ. AÊstroÈm, K.J. and Wittenmark, B. (1989) Adaptive Control, Addison-Wesley, Reading, Mass. Athans, M. (1971) The Role and Use of the Stochastic Linear-Quadratic-Gaussian Problem in Control System Design, IEEE Trans. on Automatic Control AC-16, 6, pp. 529±551. Atherton, D.P. (1982) Nonlinear Control Engineering, Van Nostrand Reinhold, London. Bellman, R. (1957) Dynamic Programming, Princeton University Press, Princeton, NJ. Bennett, S. (1984) Nicholas Minorsky and the automatic steering of ships, IEEE Control Systems Magazine, 4, pp. 10±15. Bode, H.W. (1945) Network Analysis and Feedback Amplifier Design, Van Nostrand, Princeton, NJ. Brown, M. and Harris, C. (1994) Neurofuzzy Adaptive Modelling and Control, Prentice-Hall International (UK) Hemel Hempstead, UK. Burns, R.S. (1984) The Automatic Control of Large Ships in Confined Waters, PhD Thesis, University of Plymouth (then Plymouth Polytechnic). Burns, R.S. (1989) Application of the Riccati Equation in the Control and Guidance of Marine Vehicles. In: The Riccati Equation in Control, Systems, and Signals, Pitagora Editrice, Bologna, Italy, pp. 18±23. Burns, R.S. (1990) The Design, Development and Implementation of an Optimal Guidance System for Ships in Confined Waters, Proc: Ninth Ship Control Systems Symposium, Naval Sea Systems Command, Department of the Navy, Bethesda, USA, 9±14 September, 3, pp. 386±401. Burns, R.S. (1991) A Multivariable Mathematical Model for Simulating the Total Motion of Surface Ships. In: Proc. European Simulation Multiconference, The Society for Computer Simulation International, Copenhagen, Denmark, 17±19 June. Burns, R.S. (1995) The Use of Artificial Networks for the Intelligent Optimal Control of Surface Ships, IEEE Journal of Oceanic Engineering, 20(1); Special Issue: Advanced Control & Signal Processing for Oceanic Applications, 20(1), pp. 66±72. Burns, R.S. (1997) The Application of Artificial Intelligence Techniques to Modelling and Control of Surface Ships. In: Proc. 11th Ship Control Systems Symposium, Southampton UK, April, 1, 77±83. References and further reading 429 Burns, R.S. (1997) Intelligent Manufacturing, Journal of Aircraft Engineering and Aerospace Technology, MCB University Press, 69(5), pp. 440±446. Burns, R.S. and Richter, R. (1995) A Neural Network Approach to the Control of Surface Ships, Journal of Control Engineering Practice, International Federation of Automatic Control, Elsevier Science, 4(3), pp. 411±416. Burns, R.S., Richter, R. and Polkinghorne, M.N. (1995) A Multivariable Neural Network Ship Mathematical Model. In: Marine Technology and Transportation, Graczyk, T., Jastrzebski, T., Brebbia, C.A. and Burns R.S. (eds.), Southampton U.K., Computational Mechanics. Burns, R.S., Sutton, R. and Craven, P.J. (2000) A Multivariable Online Intelligent Autopilot Design Study. In: The Ocean Engineering Handbook, El-Hawary, F. (ed.), CRC Press, Boca Raton, Florida, pp. 252±259. Cadzow, J.A. and Martens, H.R. (1970) Discrete-Time and Computer Control Systems, Prentice-Hall, Inc., Englewood Cliffs, N.J. Chiang, R.Y. (1988) Modern Robust Control Theory, PhD Dissertation, USC. Chiang, R.Y. and Safonov, M.G. (1992) Robust Control Toolbox for Use with MATLAB. Users Guide, MathWorks. Chu, C.C. (1985) H-Optimization and Robust Multivariable Control, PhD Thesis, University of Minnesota, Minneapolis, MN. Craven, P.J. (1999) Intelligent Control Strategies for an Autonomous Underwater Vehicle, PhD Thesis, Department of Mechanical and Marine Engineering, University of Plymouth, UK. Craven, P.J., Sutton, R. and Burns, R.S. (1997) Intelligent Course Changing Control of an Autonomous Underwater Vehicle. In: Twelfth International Conference on Systems Engineering, Coventry, UK, September, 1, pp. 159±164. Demuth, H. and Beale, M. (1993) Neural Network Toolbox for Use with MATLAB ± User's Guide, The MathWorks, Inc., Natick, Mass. Dorato, P. (ed.) (1987) Robust Control, IEEE Press, New York. Dorf, R.C. (1992) Modern Control Systems, 6th ed., Addison-Wesley, Reading, Mass. Dove, M.J., Burns, R.S. and Evison, J.L. (1986) The use of Kalman Filters in Navigation Systems ± Current Status and Future Possibilities. In: Proc. of the Int. Conf. on Computer Aided Design, Manf. and Operation in the Marine and Offshore Industries, Keramidas, G.A. and Murthy, T.K.S. (eds.), Springer-Verlag, Washington, DC, pp. 361±374. Drew, B.L. and Burns, R.S. (1992) Simulation of Optimal Control and Filtering of an Industrial China Clay Dryer. In: European Simulation Symposium on Simulation and AI in Computer Aided Techniques, The Society for Computer Simulation, Dresden, 5±8 November, pp. 531±535. Dreyfus, S.E. (1962) Variational Problems with Inequality Constraints, J. Math. Anal. Appl, 4, p. 297. Dutton, K., Thompson, S. and Barraclough, B. (1997) The Art of Control Engineering, Addison-Wesley-Longman, Harlow, Essex. Evans, W.R. (1948) Graphical Analysis of Control Systems, Transactions of the AIEE, 67, pp. 547±551. Francis, B.A. (1987) A Course in H Control Theory, Springer-Verlag, New York. Franklin, G.F., Powell, J.D. and Workman, M.L. (1990) Digital Control of Dynamic Systems, 2nd ed., Addison-Wesley, Menlow Park, CA. Goldberg, D.E. (1983) Computer-aided gas pipeline operation using genetic algorithms and rule learning (Doctoral dissertation, University of Michigan). Dissertation Abstracts International, 44(10), p. 3174B (University Microfilms No. 8402282). Goldberg, D.E. (1989) Genetic Algorithms in Search, Optimization & Machine Learning, Addison-Wesley Publishing Company, Inc., Reading, Mass. Grace, A., Lamb, A.J., Little, J.N. and Thompson, C.M. (1992) Control System Toolbox for Use with MATLAB ± User's Guide, The MathWorks, Inc., Natick, Mass. 430 Advanced Control Engineering Grimble, M.J., Patton, R.J. and Wise, D.A. (1979) The design of dynamic ship positioning control systems using extended Kalman filtering techniques, IEEE Conference, Oceans '79, CA, San Diego. Grimble, M.J. and Johnson, M.A. (1988) Optimal Control and Stochastic Estimation: Theory and Application, Vols 1 and 2, John Wiley & Sons, Chichester, UK. Healey, M. (1967) Principles of Automatic Control, The English Universities Press, London. Hebb, D.O. (1949) The Organization of Behaviour, Wiley, New York. Holland, J.H. (1975) Adaption in natural and artificial systems, The University of Michigan Press, Ann Arbor. Hughs, T.P. (1971) Elmer Sperry: Inventor and Engineer, Johns Hopkins Press, Baltimore. pp. 232±233. James, H.M., Nichols, N.B. and Phillips, R.S. (1947) Theory of Servomechanisms, McGrawHill, New York. Jang, J.S.R. (1993) ANFIS: Adaptive Network-based Fuzzy Inference System, IEEE Transactions on Systems, Man and Cybernetics, 23, pp. 665±685. Johnson, J. and Picton, P. (1995) Designing Intelligent Machines, Vol. 2, Concepts in Artificial Intelligence, Butterworth-Heineman (in association with The Open University), Oxford, UK. Jury, E.I. (1958) Sampled-Data Control Systems, John Wiley & Sons, New York. Kalman, R.E. (1961) On the General Theory of Control Systems. In: Proceedings of the First International Congress IFAC, Moscow 1960: Automatic and Remote Control, Butterworth & Co., London, pp. 481±492. Kalman, R.E. and Bucy, R.S. (1961) New Results in Linear Filtering and Prediction Theory, J. of Basic Eng., Trans. of the Am. Soc. of Mech. Eng., pp. 95±108. Kohonen, T. (1988) Self-Organization and Associative Memory, Springer-Verlag, Berlin. Kuo, B.C. (1980) Digital Control Systems, Holt, Rinehart and Winston, Inc., New York. Kurzweil, R. (1990) The Age of Intelligent Machines, M.I.T. Press, Cambridge, Mass. Laub, A.J. (1979) A Schur Method for Solving Riccati Equations, IEEE Trans. on Automat. Contr., AC-24, pp. 913±921. Lehtomaki, N.A., Sandell, Jr., N.R. and Athans, M. (1981) Robustness Results in LinearQuadratic Gaussian Based Multivariable Control Designs, IEEE Trans. on Automat. Contr., AC-26(1), pp. 75±92. Leigh, J.R. (1985) Applied Digital Control, Prentice-Hall International, Englewood Cliffs, NJ. Luenberger, D.G. (1964) Observing the State of a Linear System, IEEE Trans. Military Electronics, MIL-8, pp. 74±80. Lyapunov, A.M. (1907) ProbleÁme geÂneÂral de la stabilite du mouvement. In: Ann. Fac. Sci., Toulouse, 9, pp. 203±474 (Translation of the original paper published in 1893 in Comm. Soc. Math. Kharkow). MacFarlane, A.G.J. and Kouvaritakis, B. (1977) A design technique for linear multivariable feedback systems, International Journal of Control, 25, pp. 837±874. Mamdani, E.H. (1976) Advances in linguistic synthesis of fuzzy controllers, Int. J. Man & Mach. Studies, 8(6), pp. 669±678. Maxwell, J.C. (1868) On Governors. In: Proceedings of the Royal Society of London, 16. Mayr, O. (1970) The Origins of Feedback Control, M.I.T. Press, Cambridge, Mass. McCulloch, W.S. and Pitts, W.H. (1943) A logical calculus of ideas immanent in nervous activity, Bulletin of Mathematical Biophysics, 5, pp. 115±133. Merritt, H.E. (1967) Hydraulic Control Systems, John Wiley and Sons, New York. Minorski, N. (1922) Directional stability of automatically steered bodies, J. American Society of Naval Engineers, 34, pp. 280±309. Minorski, N. (1941) Note on the angular motion of ships. Trans. American Society of Mech. Eng., 63, pp. 111±120. References and further reading 431 Morari, M. and Zafiriou, E. (1989) Robust Process Control, Prentice-Hall, Inc., Englewood Cliffs, NJ. Mos cinÂski, J. and Ogonowski, Z. (eds.) (1995) Advanced Control with MATLAB and SIMULINK, Ellis Horwood, Hemel Hempstead, UK. Nyquist, H. (1932) Regeneration Theory, Bell System Technical Journal, 11, pp. 126±147. Ogata, K. (1995) Discrete-Time Control Systems, 2nd ed., Prentice-Hall, Inc., Upper Saddle River, NJ. Ogata, K. (1997) Modern Control Engineering, 3nd ed., Prentice-Hall, Inc., Upper Saddle River, NJ. Payne, H.J. and Silverman, L.M. (1973) On the Discrete Time Algebraic Riccati Equation, IEEE Trans. Automatic Control, AC-18, pp. 226±234. Pearson, A.R., Sutton, R., Burns, R.S. and Robinson, P. (2000) A Kalman Filter Approach to Fault Tolerance Control in Autonomous Underwater Vehicles. In: Proc. 14th International Conference on Systems Engineering, Coventry, 12±14 September, 2, pp. 458±463. Phillips, C.L. and Harbor, R.D. (2000) Feedback Control Systems, 4th ed., Prentice-Hall, Inc., Upper Saddle River, NJ. Polkinghorne, M.N. (1994) A Self-Organising Fuzzy Logic Autopilot for Small Vessels, PhD Thesis, School of Manufacturing, Materials and Mechanical Engineering, University of Plymouth, UK. Polkinghorne, M.N., Roberts, G.N. and Burns, R.S. (1994) The Implementation of a Fuzzy Logic Marine Autopilot. In: Proc. IEE Control 94, Warwick, UK, March 2, pp. 1572±1577. Pontryagin, L.S., Boltyanskii, V.G., Gamkrelidze, R.V. and Mishchenko, E.F. (1962) The Mathematical Theory of Optimal Processes, John Wiley & Sons, New York. Postlethwaite, I., Edward J.M. and MacFarlane, A.G.J. (1981) Principal gains and principal phases in the analysis of linear mulltivariable feedback systems, IEEE Transactions on Automatic Control, AC-26, pp. 32±46. Raven, F. (1990) Automatic Control Engineering, 2nd ed., McGraw-Hill, New York. Rechenburg, I. (1965) Cybernetic solution path of an experimental problem, Royal Aircraft Establishment Translation No. 1122, B.F. Toms (trans.), Farnborough, Hants, Ministry of Aviation, Royal Aircraft Establishment. Rezevski, G. (ed.) (1995) Designing Intelligent Machines, Vol. 1, Perception, Cognition and Execution, Butterworth-Heineman (in association with The Open University), Oxford, UK. Riccati, J.F. (1724) Animadversiones In Aequationes Differentiales, Acta Eruditorum Lipsiae. Re-printed by Bittanti, S. (ed.) (1989) Count Riccati and the Early Days of the Riccati Equation, Pitagora Editrice, Bologna, Milano. Richter, R. (2000) A Predictive Fuzzy-Neural Autopilot for the Guidance of Small Motorised Marine Craft, PhD Thesis, Department of Mechanical and Marine Engineering, University of Plymouth, UK. Richter, R., Burns, R.S., Polkinghorne, M.N. and Nurse, P. (1997) A Predictive Ship Control using a Fuzzy-Neural Autopilot. In: Eleventh Ship Control Systems Symposium, Southampton, UK, 14±18 April, 1, pp. 161±172. Rosenblatt, F. (1961) Principles of Neurodynamics: Perceptrons and the Theory of Brain Mechanisms, Spartan Press, Washington, DC. Rosenbrock, H.H. (1974) Computer Aided Control System Design, Academic Press, New York. Routh, E.J. (1905) Dynamics of a System of Rigid Bodies, Macmillan & Co., London. Rumelhart, D.E., Hinton, G.E. and Williams, R.J. (1986) Learning internal representations by error propagation. In: Parallel Distributed Processing, Rumelhart, D.E. and McClelland, J.L. (eds.), M.I.T. Press, Cambridge, Mass. Safanov, M.G. (1980) Stability and Robustness of Multivariable Feedback Systems, M.I.T. Press, Cambridge, Mass. Schwarzenbach, J. and Gill, K.F. (1979) System Modelling and Control, Edward Arnold, London. 432 Advanced Control Engineering Shannon, C.E. and Weaver, W. (1949) The mathematical theory of communication, University of Illinois Press, Urbana. Smith, O.J.M. (1957) Closer Control of Loops with Dead Time, Chem. Eng. Progress, 53(5), pp. 217±219. Sperry, E.A. (1922) Automatic Steering. Trans. Soc. Naval Arch. & Marine Eng., XXX, pp.53±57. Sugeno, M. (ed.) (1985) Industrial Applications of Fuzzy Control, Elsevier Science Publishers BV, North-Holland. Sutton, R. and Jess, I.M. (1991) A Design Study of a Self-Organising Fuzzy Autopilot for Ship Control. In: IMechE, Proc. Instn. Mech. Engrs., 205, pp. 35±47. Sutton, R. and Marsden, G.D. (1997) A Fuzzy Autopilot Optimized using a Genetic Algorithm, Journal of Navigation, 50(1), pp. 120±131. Sutton, R., Burns, R.S. and Craven, P.J. (2000) Intelligent Steering Control of an Autonomous Underwater Vehicle, Journal of Navigation, 53(3), pp. 511±525. The MathWorks Inc. (1993) SIMULINK Numerical Simulation Software ± Reference Guide, The MathWorks Inc., Natick, Mass. Tong, R.M. (1978) Synthesis of fuzzy models for industrial processes, Int. J. General Systems, 4, pp. 143±162. Van Dyke Parunak, H. (1990) Focus on Intelligent Control, Inter. J. of Integrated Manufacturing, pp. 1±5. Werbos, P. (1974) Beyond Regression: New Tools for Prediction and Analysis in the Behavioural Sciences, Thesis in Applied Mathematics, Harvard University. Widrow, B. (1987) The Original Adaptive Neural Net Broom-Balancer. In: Proc. IEEE Int. Symp. Circuits and Systems, pp. 351±357. Widrow, B. and Hoff, M.E. (1960) Adaptive switching circuits. In: IEEE WESCON Convention Record, IRE, New York, pp. 96±104. Widrow, B. and Smith, F.W. (1964) Pattern recognising control systems. In: Computer and Information Sciences, Ton, J.T. and Wilcox, R.H. (eds.), Spartan Books, Cleaver Hume Press, pp. 288±317. Wiener, N. (1949) The Extrapolation, Interpolation and Smoothing of Stationary Time Series, John Wiley, New York. Yan, J., Ryan, M. and Power, J. (1994) Using fuzzy logic ± Towards intelligent systems, Prentice-Hall International (UK), Hemel Hempstead, UK. Zadeh, L.A. (1965) Fuzzy Sets. In: Information and Control, 8, pp. 338±353. Zames, G. (1966) On the Input±Output Stability of Time-Varying Non-Linear Feedback Systems. Parts I and II. IEEE Trans. on Automat. Contr., AC-11(2 & 3), pp. 228± 238, 465±476. Zames, G. (1981) Feedback and Optimal Sensitivity: Model Reference Transformations, Multiplicative Seminorms and Approximate Inverses, IEEE Trans. on Automat. Contr., AC-26, pp. 301±320. Ziegler, J.G. and Nichols, N.B. (1942) Optimum Settings for Automatic Controllers, trans. ASME, 64, pp. 759±768. Index A/D converter 198 Acceleration 14, 17 Acceleration due to gravity 29 Acceleration error coefficient 169 Accelerator pedal 13 Acceptable transient response in the s-plane 122 Accumulator(s) 198 Acker 405 Ackermann's formula 251, 253, 257, 259, 263, 299, 340 Activation function 348 Activation functions hard-limiting 349 hyperbolic tangent 349 linear 349 sigmoid 349 Active: lead compensation 179 lead compensation element 196 phase lag compensator 189 Actual: heading 9, 101 rudder angle 9 temperature 7 value 10 Actuating: device 10 element 10 force 8 Actuation subsystem 326 Actuator saturation 91 Adaptive linear element (ADLINE) 347 Adaptive network based fuzzy inference system (ANFIS) 362 Adaptive search and genetic algorithms 326 Addition and subtraction of matrices 426 Additive uncertainty 303 Address bus 199 Adjoint matrix 242 Adjoint of a matrix 426 Aerodynamic drag 13 Aerodynamic forces 8 Ailerons 7 Air gap flux 72 Aircraft elevator control 7 Airliner 12 Aliasing 200 Amplitude ratio 145 Amplitudes of vibration 193 Analogue: circuits 10 control signal 9 signal 10 Anderson 347 Angle criterion 123 Angle of departure 131, 142 Angles of departure and arrival 126 Angular: displacement 33, 61 position 19 positional control system 106 velocity 19, 60 Antecedent 330 Antecedent-consequent linguistic rules 332 Anti-aliasing filter 200 Applied torque 19 Approximate linear relationship 28 Argand Diagram 148 Argument 149±150 Arithmetic logic unit (ALU) 198 Armature: constant 73 control 71 controlled dc servo-motor 75 current 72 excitation voltage 73 inductance 73 resistance 73 winding 73 Artificial intelligence (AI) 3, 325 Artificial neural networks (ANNs) 3, 347 ASCII 382 Assembler 198 434 Index Asymptote angles 127, 131, 137 Asymptote intersection 126, 127, 131, 137 Asymptote intersection (break frequency) 159 Asymptote intersection: first-order system 154 Asymptote intersection: second-order system 155 Asymptotes 142 Asymptotic approximation: Bode diagrams 153 Asymptotic construction: Bode plot 154 Athans 3 Augmented plant matrix (s) 315 Augtf 416 Author 299 Autonomous systems 325 Autopilot 273 Autoscale 384 Auxiliary polynomial 117 Average magnitude of sensitivity function 305 Axis 390 Axon 347 Back emf 73 Back-propagation 356, 362 Back-propagation algorithm (BPA) 347, 351, 377 Band drying oven 289 Bandwidth 175±179, 183, 186, 188±189, 191±192, 194±197, 200, 222 Bandwidth B † 172 Bang-bang control 7, 273 Barrett 373 Bell Telephone Laboratories 2 Bellman 3, 272 Best estimate of measured variable 285 Best flatband response 175±178 Bias 348 Bilinear transformation 222 Bill of materials 4 Binary word 198 Biological neurons 347 Black box approach 358 Block diagram 4 form 63 manipulation 67 reduction 66 transformation theorems 67, 68 with interaction 68 Blocks in cascade 207 Bode 2 Bode 393 Bode diagram 151±152, 165, first-order system 154, 159 lead compensator 185 pure integrator 158 second-order system 157, 160 active lead network 180 Boltzmann constant 373 Boolean AND function 333 Boolean OR function 333 Bound of multiplicative uncertainty 306 Bound of the multiplicative model uncertainty 311, 323 Boundary of a system 4 Bounded inputs 304 Branch 416 Breakaway points 121, 126, 127, 138, 142, 218±20, 230 Break-frequency 200 Breeding of successive generations 365 Bucy 3, 285 Bulk modulus 77 Burner 6 exhaust temperature tb t† 289 gas supply valve angle va t† 289 model 290 Burns 290, 299, 359 C and C‡‡ 199 C2d 402 C2dm 397 Canonical robust control problem 314 Capacitance 21 Capacitive element 22, 25 Capacity requirements planning 4 Car cruise control system 269 Cartesian co-ordinates 226 Cascade 65 Cauchy's theorem 161 Central processing unit (CPU) 198 Centre of area method 335 Centrifugal speed governor 1 Chain rule 352 Characteristic equation 2, 50, 114±116, 120, 127±128, 131, 138, 220, 227, 230, 240±241, 260, 262, 264 Index 435 Characteristic equation: sampled-data system 215 Chiang 3 Chromosome 365 Clf 383 Clipped fuzzy output window 335±336 Cloop 385 Closed form 203 Closed-loop 6 bandwidth 224 characteristic equation 114, 252, 265 control system 63 damping ratio 126 dynamics of observed state feedback control system 260 eigenvalues 249, 277, 280, 321, 323 eigenvalues: band dryer 293 equations 260 frequency response 172±173, 178, 186, 189, 225 modulus 172 peak magnitude Mp 194 peak Mp 189, 191 poles 118, 225, 249 pulse transfer function 209±210, 212, 220 state equations 261 system matrix (A ± ) 249 temperature control system 107 time-constant 83, 108 transfer function 63, 107, 194 transfer function matrix 315 zeros 118 Clustering 366 CNC machine-tool positional control 92 Co-active ANFIS (CANFIS) 364 Coefficient of discharge 29, 78 Cofactor of an element 425 Co-factors 242 Cognition subsystem 325 Combined transfer function 65 Combining blocks in cascade 67 Combining blocks in parallel 67 Command vector (kT) 282±283 Command vector (t) 281 Compensated modulus crossover frequency 190 Compensator 133 characteristics 133 design 133 design in the frequency domain 178 gain constant 197 Competitive learning 347 Complementary sensitivity function 307 multivariable system 316 T(s) (classical control) 301 T(s) (internal model control) 302 Tm j† 309 Complete state feedback 266 Completing the square 53, 88 Complex: dominant loci 135 exponential form 145 frequency approach 147 plane 119 quantity 148 space 148 variables 2 zeros 138 Compressibility effects 77 Computer numerically controlled (CNC) machine tool 3, 8 Cond 382 Conditions of uncertainty 325 Conformal mapping 161 Conical pendulum 1 Conjugate 147 Consequent 330 Consistent right-hand system of coordinates 101 Constant: acceleration input 42 amplitude harmonic forcing 193 multiplication 38 position input 41 velocity 14 velocity input 42, 107 Constrained functional minimization 272 Continuity equation 31, 77 Continuous 384 cycling method 91 solution of the matrix Riccati equation 276 system 225 -time solution of state equation 245 -time state transition matrix  t† 269 Control: algorithm 198, 228 column 7, 8 engineering 4 equation 254 fins 32, 143 436 Index Control: (continued ) input 4, 5 law 140 matrix 233 moment 9 of an autonomous underwater vehicles (AUV) 364 signal 6, 7, 9, 10 strategy 140 surfaces 7, 8 system 6, 10 system design 10 system designer 12 system toolbox 408, 417 variable (inverted pendulum) 339 variables 291 vector (t) 248 weighting matrix  274 Controllability 248 matrix  248, 251, 270 Controllable 248±249 canonical form 238, 251, 253 canonical form method 250, 251, 253 Controlled variable 4, 5, 12 Controller 5±7, 10, 93 emulation (neural network) 361 transfer function 320 Controlling device 10 Conv 385 Conventional set theory 327 Convolution integral 38, 239, 242 Cost function 272 Course changing 9 Course-keeping 9, 273 Covariance matrix 288 : band dryer 299  k ‡ 1=k ‡ 1† 322 Craven 364 Create new model 384 Crisp control signal 335±336 Crisp set 327 Critical damping 51±52, 61, 112, 193, 254 coefficient 51 Crossover point 365 Cross-sectional area 29±30 Cross-track: error 273 position error 299 velocity error 299 Ctrb 404 Current 4, 9, 22 D/A converter 198 Damped natural frequency 54, 59, 62 Damping 15±16 coefficient 17, 19, 33, 61, 193, 267 element 16 ratio 49, 51±52, 55, 62, 100, 133, 144, 193, 230, 258, 378 Dashpot 16, 92 Data: address register 198 bus 199 for Nyquist diagram 167 fusion 325 dc motor 266 dc servo-motor 9, 71, 93 Decibels 151 Defuzzification process 335 Degrees-of-freedom 100 Delay in reward parameter 346 Delimiter 327 Delta rule 351, 353±355, 357 Demanded rudder angle 9 Dendrites 347 Derivative action time 90 Design: in the s-plane 132 of control systems 12 procedure: lag compensation 190 Desired: closed-loop characteristic equation 251 closed-loop eigenvalues 258 closed-loop poles 231, 271 eigenvalues 262 heading 9, 101 set of closed-loop poles 250 state trajectory (t) 280 state vector: band dryer 293 state vector (kT) 282 state vector (t) 281 temperature 6±7 value 4, 6, 10 value of closed-loop eigenvalues 299 Det(A) 381 Determinant of a matrix 425 Determination of: K on root loci 126 points on root loci 126 real closed-loop pole 130 Diagonal matrix 424 Index 437 Difference equation 202, 206, 208, 210, 212, 228±229 digital compensator 224 method 205 Differential equation 2±3, 14, 19, 21, 26, 30, 32±34, 36, 39, 202 with constant coefficients 15 Digital: circuits 10 compensator 216, 222±223 compensator design 220 compensator design using pole placement 224 compensator types 221 control system design 198, 210 error signal 8 feedback signal 8 format 8 PID controller 221, 222 signal 10 Direct comparison method 250±252, 256, 258, 265 Direct construction method 174 Discrete: performance index 282 quadratic performance index 276, 281 reverse-time state tracking equation 281, 283 solution of the matrix Riccati equation 276 solution of the state equation 276 system model: band dryer 291 Discrete-time 200 compensator 231 control matrix B(T) 245 control transition matrix B(T) 270 response 204, 210 solution of state equation 244 state transition matrix A(T) 245, 269 system 231 unity feedback control system 230 Discretized universe of discourse 331 Discriminant 50 Disturbance: attenuation 316 attenuation factor 316 effects 12 input 4±5 noise covariance matrix 287 noise covariance matrix : band dryer 297 rejection 303 transition matrix d T† 286±287 transition matrix d T†: band dryer 293 variables 291 Disturbances 9 Dominant: closed-loop poles 142 first-order response 134 Don't care symbol `*' 370 Drew 290 Dreyfus 272 Dryer: clay feed-rate fi t† 289 model 290 outlet clay moisture content mf t† 289 outlet temperature td t† 289 Drying oven 34 Dummy time variable 239 Dynamic: behaviour 13±14 characteristics 10, 12, 14 programming 3, 272 response 10 system 35 Eig(A) 381 Eigenvalues 255 Elastic element 15 Electrical: networks 23 noise 12 system 13, 21, 25, 27 Electrohydraulic servovalve 7 Electromagnetic force 31 Electrostatic equation 22, 26 Elements of the Riccati matrix  280 Elevator 7±8 control 7 Eliminating: a feedback loop 67 a forward loop 67 Embedded microcontrollers 198 Empirical approach 91 Energy output 5 Engine torque 13 Envelope of exponential form 110 Epoch 360 Equating: imaginary parts 128, 131, 138 real parts 128, 131, 138 438 Index Equation: of a circle 173±174 of motion 18±20 Equivalent: block diagram 67 damping coefficient 21 mass 94 moment of inertia 21 time constant 58±59 Erasable programmable read only memory (EPROM) 198 Error 7 back-propagation through plant model 361 coefficients 83 detector 106 signal 64 -actuated system 6 Estimate ^ of actual state vector 254 Euler-Lagrange equations 272 Evans 2, 119 Evolutionary process 365 Executable machine code 198 Exhaust pressure 76 Experimental determination of system time constant using step response 46 Exponential: indices 242 matrix eAt 240 External forces 17 Eye 382 Factored roots 39 Feedback 385 Feedback: amplifier 2 control system 6, 63 gain matrix: band dryer 292 path 6 sensor 10 Feedforward neural network 349 Feel simulator 8 Field: coil 33 constant 74 control 74 controlled d.c. motor 33 controlled dc servo-motor 75±76, 104 current 33 File 384 Filtering effect 256 Fin: positional control system 32, 143 time constant 135 Final: lead compensator 188 state (t) 248 value theorem 38, 82±84, 168, 212 Firebrick walls 34 First-order: differential equation 15, 23, 27, 43, 60, 236 element 62 lag systems 153 lead system 155 linear system 15 sampled-data system 208 system 18 type zero system 169 Fismat 422 Fitness function 365±366, 370, 379 positional control system 368 Fixed control strategy 12 Flow: gain 79 -pressure coefficient 79 -rate 27 Fluid: damper 33, 61, 104 systems 27 Flyball governor 1 Flywheel 19 Foh 397 Forms of uncertainty 299 Forward: propagation 356 speed 13, 28 speed loss 273 velocity 4 Forward-path 6 transfer function 63, 65, 107 Fourier 2 Fourier's Law 25 Free-body diagram 17±18, 20, 28, 52 Frequency: of maximum phase advance 196 of transient oscillation 56 Frequency domain 2, 145 analysis 145, 175 performance specifications 172 specification 179, 192 Index 439 Frequency response 2 characteristics: lag compensator 190 diagram 150 diagrams 151 Frictional moment 19 Full-order: observer 258 state observer 254±255, 260, 271 Fully connected multilayer network 349 Function of time 35 Fuzzification process 331 Fuzzy 418 Fuzzy: conditional statement 332 inference 332 input window 332 logic 3, 326 max operation 333 max-min inference 340 min operation 333 output window 334 relations 330 rulebase 332, 336, 374 Fuzzy logic: control (FLC) 331 controller 3, 373 toolbox 341, 417 Fuzzy set operations: complement 328, 329 equality 328 intersection 328, 329 union 328, 329 Fuzzy set theory 326±327 Fuzzy sets 326 Gain: margin (GM) 165±166, 175±178, 184, 188±189, 196 reduction 184 reduction factor 177 scheduling controller 299±300 Gas: burner 34, 97 fire 5 solenoid valve 6, 97 solenoid valve and burner 10 Gaussian noise sequence  k ‡ 1† 286±287 Gearbox 92±93 General: form of a digital control system 220 performance index 273 second-order transfer function 40 Generalized: control problem 81 second-order system response to a unit step input 52 second-order transfer function 122 transfer function 238 Generic elements 10 Genetic: algorithm (GA) 365 information 365 material 365 structure 365 Getfis 422 Global: minimum energy state 373 optimum 365 Goldberg 365 Governor 2 Gradient-descent optimization 351 Graphical addition 151 user interface (GUI) 384 Grid 383 Grimble 3 Grossberg adaptive resonance theory (ART) 350 Gyro-compass 9, 102 H1 norm 3, 310 -control problem 308 -optimal control 306 H2 -norm 310 -optimal control problem 305 Hall chart 174 Hamiltonian function 272 Hamilton±Jacobi equation 275 partial differential equation 272 Harmonic input 145 response diagram 146±148 Head 29±30 Heading 4 error 273, 299 -rate error 299 440 Index Heat 26 flow 25 loss 7 sink 26±27 source 26 Heave 4 Hebb 3, 347 Hebbian learning 347 Help 382 Heuristics 365 Hidden layer 349 High: frequency noise 179 level language 198 -frequency (HF) asymptote: first-order system 153 -speed jet 7 Hinfopt 415 Holland 365 Hospital operating theatres 7 Hull 9 dynamics 101 transfer function 102 Human vagueness 3 Hunting 2 Hurwitz 2, 112 determinants 113 Hydraulic: actuators 75 cylinder 8 damping ratio 81 gain 81 natural frequency 81 servomechanism 8, 106 Hydrodynamic resistance 28 Ideal sampling 201 Identity matrix 425 Imaginary axis: crossover 126, 128, 131, 138 crossover point 142 Imaginary part 148 Implementation of reduced-order state observer 263 Impulse 383 Impulse: function 41 response of first-order system 44 Inductance 21 Inductive element 22 Industrial standards rooms 7 Infinite power series method 204 Infinity norm 307 Inflow 29±30 Information technology (IT) 325 Infrared absorption analyser 289 Initial: conditions 39 state t0 † 248 value theorem 38 Input: function 36 fuzzy set membership values 332 layer 349 variable 234 vector 233 weight 304 Inputs 4 Insertion loss 195 Instability 2 Instantaneous change 14 Instruction register 198 Integral: action time 84 control action 170 squared error (ISE) 305 wind-up 91 Intelligent behaviour 325 control system 3, 325 Internal model control (IMC) 301, 361 International Federation of Automatic Control (IFAC) 3 Inv(A) 381 Inverse: Laplace transforms 242 model 360 of a matrix 426 square law 300 transform 38, 54, 59, 243 z-transformation 204 Inverted: pendulum 347 pendulum system 337 James Watt 1 Jang 362 Johnson 325, 337, 340 Index 441 Jury 215 stability test 215 test 218, 230 Jury's array 216±217 Kalman 3, 248, 276, 285 filter 3, 285, 287±288 filter design: band dryer 295 gain 286 gain matrix K 286±288 gain matrix K: band dryer 299 gain matrix K k ‡ 1† 322 Kang 362 Kinematic relationships 21 Knowledge-based systems 326 Kohonen 3, 347 self-organizing map (KSOM) 350 Lag compensator 191 Laplace 2 and z-transforms 204 transform 36, 39, 79, 94, 102, 202 transform of a time derivative 37 transform pairs 37±38, 88 transforms 98, 147, 239±240 Laser guided missile 32, 143, 182, 222 Lead: compensator 222 compensator design 183, 186 Lead-lag compensation 92 Lead-screw 9, 92±93 Leakage: coefficient 78 flow-rate 77 Learning rate 353, 360, 377 Levenberg-Marquardt backpropagation training 423 Line of constant damping ratio 129, 132 Linear: bearings 31 differential equation 15, 27±28 displacement transducer 92 lumped parameter elements 15 phase-log frequency plot 151 relationship 14, 29 systems 2, 15 Linear quadratic: Gaussian (LQG) control scheme 288, 322 H2 -optimal control 305 regulator (LQR) 274, 288 tracking problem 280 Linearity 37 Linearization of nonlinear functions 27 Linearize 27 hydrodynamic resistance 28 Linearized: equation 31 outflow 86 relationship 30 spool-valve analysis 78 valve resistance 29 Linearly independent 249 Linear-quadratic-Gaussian (LQG) control 3 Lines of constant: settling time 214 transient frequency 214 Linguistic label 332 Liquid-level process control system 85 Load: damping coefficient 106 flow-rate 76, 79 moment of inertia 106 on hydraulic actuator 80 pressure 76 Local: minima 354 optima 365 Log modulus plot 153 Log modus-log frequency plot 151 Logarithmic decrement 56 Logspace 393 Low frequency (LF) asymptote 159 first-order system 153 Low level language 198 Low-cost applications 7 Low-pass filter 179 LQ control 3 Lqe 410 Lqed 411 Lqr 408 Lqrd 410 Luenberger observer 254 Lyapunov 2 M and N: circles 174 contours 175 442 Index Machine: intelligence 325 table 8, 9, 93 Magnetic compass 9 Magnitude criterion 124, 129, 132 Major loop 64 Mamdani 3, 332 -type rule 332 -type rulebase (inverted pendulum) 340 Mapping: closed-loop poles from s to z-plane 226 from s to z-plane 213 from s to z-plane 214 Margin 394 Marginal stability 91, 126, 218±219, 312 Margins of stability 164 Mariner Hull 103, 358 Mass 13, 15, 17, 26 Master production schedule 3 Material requirements planning (MRP) system 3±4 Mathematical model 4, 13±15, 21, 25, 27, 35±36, 55, 254 MATLAB 109, 133, 161, 341 command window control system toolbox 382 editor/debugger 383 fuzzy inference system (FIS) editor 344 robust control toolbox 320 toolboxes 380 Matrix 424 of multiplicative plant uncertainty 316 Riccati equation 272, 276, 280, 323 vector difference equation 245±246 Matrix operations: 380 A  B 381 A  B 381 AnB 381 A=B 381 A' 382 Max 396 Maximum: closed-loop peak modulus Mp 195 closed-loop peak Mp 196±197 magnitude of weighted sensitivity function infinity norm 306 phase advance m 187, 195 principle 3, 272 Max-min: fuzzy inference 336 fuzzy reasoning 333 inference 337 inference process 333, 335 Maxwell 2 McCulloch 347 Measured: elevator angle 7 open-loop frequency response data 164 value 6, 10 Measurement: matrix C(T) 287 noise covariance matrix  287 noise covariance matrix : band dryer 295 vector k ‡ 1†T 287 Mechanical: levers 10 system 13, 15±17 Membership function  327 Microcomputers 10 Microcontroller 198 Microprocessor control 198 Mid-frequency (MF) asymptote 155 Minimum energy control problem 273 Minimum-time control problem 273 Minor control loop 9, 64 Minors 242 Minors of an element 425 Mixed-sensitivity cost function 317 Mksys 416 Model: of a single artificial neuron 348 of band dryer system 290 Modulus 145, 147±148, 150±152 and phase for a first-order system 149 and phase for a second-order system 150 attenuation 190±191 crossover frequency 182±184, 186±187, 191 Moisture models 290 Moment of inertia 17, 19, 33, 61, 104, 143, 267 Momentum (learning with) 354, 360 Momentum coefficient 355 Morse 359 Motor shaft 20 Motor vehicle 13±14 Moving a: summing point ahead of a block 67±68 summing point beyond a block 67 take-off point ahead of a block 67 take-off point beyond a block 67 Index 443 -synthesis theory 3 Multi-layer perceptron (MLP) 347, 351 Multiple: input, multiple output (MIMO) systems 232 loop systems 64 Multiplication: by a constant 427 of matrices 427 Multiplicative uncertainty 303, 306 Multivariable: H1 robust control 316 H2 robust control 316 loop shaping 317 robust control 314 systems 232, 245, 248 Mutation rate 365 Networks 23 Neural network state observer 358 toolbox 417 Neurofuzzy control 361 Newff 423 Newton's second law of motion 17, 29, 52 Ngrid 395 Nichols 395 Nichols chart 175±178, 196±197 Nichols 2 Nichols chart: lead compensator 184, 188 uncompensated laser guided missile 183 Nominal plant model Gm s† 300 Non-linear 27, 232 function 27 Non-singular 248±249, 258 matrix 426 Non-zero determinant 248±249 Normal cross sectional area 25 Normalized system inputs 304 Null matrix 424 Number of: clockwise encirclements 162 distinct root loci 125, 218 pure integrations in the open-loop transfer function 168 roots with positive real parts 141 Nyquist 393 Nyquist 2, 162 contour 163 diagram 164±168, 170, 174, 194 frequency 200 stability criterion 162, 164, 306 Observability 248 matrix  248±249, 257, 270 Observable 248 canonical form 257, 259 canonical form method 257, 259 Observed state variables 260 Observer: design 256 gain matrix Ke 255, 257, 271 transient response 256 Obsv 404 Offspring chromosomes 365 Ohm's Law 22, 26 On-governors 2 On-off control 7 Onset of instability 142 Open-loop characteristic equation 265 control system 5 eigenvalues 249, 258 frequency response data 195 frequency response locus 176 frequency response test 194 gain constant 83, 115, 119, 124, 142 poles 119±120, 127, 130, 219, 249 pulse transfer function 210, 212, 224, 229±231 reduced order characteristic equation 262 time constant 108 transfer function 63±64, 115, 166, 191, 194, 222 zeros 119±120, 127, 130, 144, 219 Operating point 27 Operational amplifier 179 Optical pattern recognition 347 Optimal: control law 3, 272, 275, 281 control law: band dryer 292 control policy 272 control problem 272 control system 272 feedback matrix K 321 filter 3 minimum variance filter 285 trajectory (t) 272 444 Index Optimum: design 3 policy evaluation 326 Ord2 384 Orifice theory 78 Oscillation 7 Oscillatory second-order response 134 Other applications of genetic algorithms: optimal control 372 self-organizing fuzzy logic control 372 Outflow 29±30 Output: equation 234±235, 237±239 equation (inverted pendulum) 339 equation: band dryer 291 error  ^† 254 layer 349 shaft 20 (t) 248 Outputs 4 Overall: closed-loop transfer function 64, 66, 68, 95 differential equation 31 Overdamped 61 Overdamping 112 Overshoot 57, 62 133, 137, 193 Parabolic: fitness function 378 function 42 Parallel 385 Parametric relationship 285 Parent chromosomes 365 Partial fraction 39, 47, 53, 88 expansion 211, 242 Passive electrical network 34, 60 lead compensation 179 phase lag compensator 189 PD 133, 179 cascade compensation 179 compensator 263 control 92 controller 331 Peak: closed-loop modulus Mp 183 frequency p † 172 Peak modulus Mp † 172, 175±176, 179, 186, 188 Percentage overshoot 104, 141, 176, 193 Percentage overshoot of first peak 55 Perception subsystem 325 Perceptron 347 Perfect set-point tracking 301±302 Performance: criterion 3, 272 index 272±273, 321, 351, 354 index (PI) table 344, 346 specification 10, 137 Periodic time 96 Phase 152 advance 186 advance m 182 angle 147±150 lag compensation 189 lead compensation 179 lead compensation network 195 lead compensator 284 margin (PM) 165±166, 175±178, 182±184, 187±190, 194±196 relationship 145 -plane 232 Physical: characteristics 13 laws 10 system 13±14 PI 133, 170 control 85 control law 84 Picton 325, 337, 340 PID 97, 133, 170, 179 control 138 control action 89 controller 108, 289 controllers for closed-loop systems 178 PIDD control 140 Piece-wise constant function 270 Pilot 8 Piston 8 Pitch 4 moment of inertia 32 Pitts 347 Plant 4±6, 10 state transition equation 282 Plot 384 Pneumatic elements 10 Polar co-ordinates 148 plot 147, 150±151 Index 445 Pole: angles 123 locations: s and z-planes 215 vector magnitudes 124 Pole/zero cancellation 134 Pole-zero format 143 Poly(A) 381 Pontryagin 3, 272 Population of chromosomes 365 Position error coefficient 168 Positional: feedback 106 servomechanism 268 Positive feedback 70 Potentiometer 6 Power: amplifier 93 series method 206 Predictive self-organizing fuzzy logic control (PSOFLC) 364 Pressure 27 difference 8 -flow-rate characteristics for a spool-valve 80 Price 359 Primary feedback signal 64 Principle of optimality 272 Principle of Superposition 69, 71 Printsys 383 Probability  of accepting a solution 373 of selection 365 theory 326 Process: air 289 plant 191 reaction curve 99 reaction method 90, 108 Program counter 198 Programmable read only memory (PROM) 198 Propeller 28, 60 angular velocity 28 Proper 387 Proportional: control 7, 82, 137, 142 control of a first-order plant 82 controller 133 controller gain 116 gain constant 82 plus derivative (PD) control 92 plus integral (PI) control 84 plus integral plus derivative (PID) control 89 Pulse transfer function 206±207, 220 Pure integrator 138, 158, 170 asymptote 170 Quadratic performance index 274±275, 291 Ramp 384 function 36, 42 response of first-order system 47 Random access memory (RAM) 198 number generator 367 Rank 248±249 Rank 382 Rank of a matrix 427 Ratio of successive peaks 99, 109 RC network 2 RCL network 235 Read only memory (ROM) 198 Readfis 422 Real: part 148 shift theorem 38 -time computational complexity 331 Rearranging summing points 67 Recent approaches 12 Rechenburg 365 Recommended compensator 135 Rectangular plot 150, 175 Recursive: discrete-time simulation 245 steps 246 Reduced: block diagram 69 matrix Riccati equation 276, 321 observer system 266 Riccati equation 278 second-order state observer 264 -order observer gain matrix e 262 -order state observer 254, 262, 266, 271 Reduction gearbox 19 Regeneration Theory 2 Regulator 254 control problem 273 regulator problem 273 446 Index Relationship between m and the spacing of 1=T1 and 1=T2 182 frequency response and time response: closed-loop systems 191 open-loop and closed-loop frequency response 172 Relative modulus 156 Relocfind 390 Removing a block from a feedback loop 67 forward path 67 Repeated roots 39 Resistance 13, 21 thermometer 6, 58 Resistive element 22, 25 Resolution 10, 198 Reverse-time: recursive process 277 state tracking equations 280 Riccati matrix: band dryer 292  277, 279, 288 (kT) 282 Richter 358, 364 Rise time 57, 104, 141, 176 Rlocus 389 Robust: control 3 control problem 299 control toolbox 408 design 3 multivariable control system design 316 performance 300, 308±309, 312±313 stability 300, 306±307, 311±313, 324 Roll 4 dynamics 137 Room temperature control system 6 Root locus: analysis: z-plane 218 asymptotes 125 construction rules 125 construction rules: z-plane 218 locations on real axis 126, 218 method 119 diagram 119 Roots 381 Roots: of characteristic equation 2, 49, 51, 112, 118, 120±122, 126, 163, 218, 241±242 with positive real parts 114 Rosenblatt 3, 347 Rotation about yaw axis 101 Rotational: damper 16 spring 16 l system 17 Roulette wheel selection 365 Routh 2, 112 stability criterion 166±167 Routh's array 113, 116, 128, 167 special cases: a zero in the first column 117 special cases: all elements in a row are zero 117 Routh±Hurwitz stability criterion 113, 126, 141, 215 Rudder 9±10 activity 273 angle 101 angle sensor 9 Rule-of-thumb 58, 91, 200 Rumelhart 347 Rzevski 3 S domain 36 algebraic equations 36 Safanov 3 Sampled-data system 204 Sampling: frequency !s † 200, 214, 222, 224 period T 198 time T 201, 225 Satellite control 273 Save as 384 Schema 370 Schemata 370 Scope 384 Script files 382±383 Second-order: complex roots 39 differential equation 15, 24±25 element 62 linear system 15 real roots 39 system 18, 58, 170, 280 system closed-loop frequency response 172 transfer functions 61 type one system 169 Index 447 Selection of: parents for mating 367 performance index 273 Self-organizing fuzzy logic control (SOFLC) 344 Semilogx 393 Sensitivity function multivariable system 315 S(s) (classical control) 301 S(s) (internal model control) 302 Sm j† 308 Sensor 5±6 array 325 Series 385 Servomechanism 7, 107 Servomotor 9 Set heading 9 Set of: differential equations 272 first-order differential equations 233, 235 Set-point tracking 303 Settling time 57, 96, 104, 133, 137, 141, 176, 191, 193 Several inputs acting simultaneously 69 Sgrid 390 Shaft encoder 8±9 Shannon's sampling theorem 200 Ship 28, 60 autopilot 100 autopilot control system 9, 102 roll damping ratio 137 roll natural frequency 135 roll stabilization system 135, 270 steady-state gain 137 Sigma 416 Sigmoid: activation function 354 function 352 Signal: processing 325 take-off point 64 Simplified Nyquist stability criterion 164 Simulated annealing 373 Simulation 384 SIMULINK 341, 380, 384 library browser 384 Simultaneous equations 59 Single input, single output (SISO) systems 232 Single neuron summation 354 Single-layer fully-connected recurrent network 350 Singular 249 matrix 426 value loop shaping 315 values of a complex matrix 315 Sinks 384 Slope: 12 dB per octave ( 40 dB per decade) 155 6 dB per octave ( 20 dB per decade) 153, 158 Small: gain infinity-norm control problem 316 perturbation theory 28 perturbations 27, 79 perturbations of spool valve and actuator 75 Smith 347 Solenoid valve 31 Solution: of the state vector differential equation 239 space 369 Sources 384 Specific: heat at constant pressure 26 inputs 304 Specification 96 Speed: control system 104 of convergence 370 Spool-valve: controlled linear actuator 75±76 movement 7 Spring stiffness 16 Spring-mass-damper system 17±18, 51, 193, 234, 241±242, 245 Square 390 ss_g 416 Ss2tf 402 Stability 2 criteria 2 in the frequency domain 161 in the z-plane 213 of a closed-loop system 114 on the Bode diagram 170±171 Stabilize 9 Stable and unstable time responses 111 Stable systems 110 448 Index Standard: components 39 form of transfer function for a first-order system 44 forms of transfer functions for a secondorder system 49 methodology 12 Start 384 Starting point 125, 218 State equation 235±239, 241, 252, 233 (inverted pendulum) 339 State equations: band dryer 291 from transfer functions 238 State feedback: gain matrix 249, 251 gain matrix K(kT) 282 matrix 250 matrix (inverted pendulum) 340 matrix K 277, 279 State: estimation 284 observer 254, 261 of a system 232±233 trajectory 242±244 State variable: step response 244 time response 243 State variables 232±236, 238, 242, 244, 254, 291 inverted pendulum 339 State vector 233 differential equation 233, 240 (kT) 282 State weighting matrix 274 State-space 232 approach 232 formulation 3 representation of controller 320 State-transition matrix  t† 240 Static characteristics 10 Steady-state: error 36, 48, 62, 81, 108, 132 error coefficients 168 gain 52 gain constant 44, 49, 62 period 36 response 35 terms 110 Steam mass flow-rate 1 Steering gear 9±10, 101 Step 383 Step: function 41 input function 62 Step response 137, 220 analysis 55 function 55 of first-order system 45 performance specification 57 Stiffness 15, 33, 61 Structured model uncertainty 303 Subplot 397 Sugeno 3, 362 Summation of log modulus 153 phase 153 system elements 152 Summed squared error function 351 Summing point 6 point symbol 64 Supervised learning 350 learning in neural networks 326 Supply pressure 76 Survival of the fittest 365 Sutton 3 Symmetric matrix 425 Symmetry of root loci 125, 218 Synapses 347 Synaptic reaction 347 System 4 covariance matrix  286 dynamics 15, 35 frequency domain performance 189 inputs 236 matrix 233 outputs 236 performance 141 response 4, 36 System type: and steady-state errors 168 classification 83, 85, 168±169 Systems with multiple inputs 69 Tabu search 373 Tachogenerator 9, 95, 104 Takagi 362 Temperature 5 control 7 Index 449 control system 97 differential 25 rise 26 Term: k=k† 286 k ‡ 1=k† 286 k ‡ 1=k ‡ 1† 286 Terminal control problem 272 Termination point 125, 218 Tf2ss 402 Thermal: capacitance 26, 34, 97, 108 conductivity 25 dynamics of room 97 resistance 26, 34, 108 resistance of walls 98 systems 25 Thermocouple 6 Thermometer 98, 108 Thermostatic control 7 Thickness 25 Third-order: differential equation 15 linear system 15 transient response 59 type two system 169 Three-term control action 89 Time constant 44, 48, 59, 60, 62 Time domain 35, 36 analysis 35 differential equations 36 performance specifications 172 Time invariant 232 Time response 35±36, 59, 60, 62, 191 of burner temperature: band dryer 295 of gas-valve angle: band dryer 294 of higher-order systems 58 Time-variant 12, 232 Tolerance band 193 Tong 3 Torsional spring 33, 61 Total fitness of: offsprings 367 population 367 Total response 36 Trace of a matrix 427 Tracking control problem 273 vector (t) 281 Train 423 Training data 358 file 359 Transfer fcn 384 Transfer function 39±40, 60, 62 approach 41, 63 Transformation matrix  250 Transient: analysis of discrete systems 213 errors 36, 81 period 36, 58 response 35, 242 response of a second-order system 50 terms 110 Transition matrix  s† 247 Translational: damper 16 spring 15 system 17 Transportation lag 90 Transpose of a matrix 425 Trial point 144 TSS_ 416 Turbulent flow conditions 27 Tustin 397 Tustin's rule 222, 223 Two degree-of-freedom IMC system 302 Two-mass system 237 Two-port state-space representation 314 Type number 168 Ultimate: gain 91 period 91 Undamped natural frequency 49, 52, 62, 193, 258 Underdamped 61, 112 second-order system 55 Unit circle 214, 218 crossover 218±219, 230 Unit impulse 41 function 201 Unit parabolic function 42 Unit ramp 48 function 42, 208±247 Unit step: function 37, 41 input 52, 62 response 54, 60±61 response function 58 450 Index Unity feedback: computer control system 230 continuous control system 230 control system 196 Unity gain second-order system 62 Universe of discourse U 327, 332 Unstable systems 110 Unstructured model uncertainty 303 Unsupervised learning 350 learning in neural networks 326 Valve 58 flow area 29 Variance of the weighted mean P 285 Variational calculus 272 Vector 424 of measurements k ‡ 1†T 286 Vehicle 14 model 14 Velocity 16 error coefficient 169 feedback 92, 106 Vessel 9 Voltage 22 Volume of hydraulic fluid 76 Volumetric flow-rate 29 strain 77 stress 77 Walking beam feedback linkage 106 Wall 26 Watt governor 1 Waves 4 , 9 Weighted mixed-sensitivity approach 317 sensitivity function 310, 312 summer 348 Weights and biases 357±358, 376±377 Werbos 347 Wheel traction force 13 While 396 Who 386 Whos 386 Widrow 347 Widrow-Hoff 3 Wiener 3, 284 Wind 4, 9 Xlabel 393 Yaw hydrodynamics coefficients 101 Zadeh 3 Zero: angles 123 determinant 249 modulus crossover 183 steady-state error 137 vector magnitudes 124 -order hold 201, 202 Zgrid 399 Ziegler-Nichols 99, 108 methods 90 Zoh 397 Z-plane 217, 220 characteristic equation 226 Z-transform 202 theorems: initial value theorem, final value theorem 204 theorems: linearity 203