Introductory Notes. Course Material I.I. University of Applied Sciences Bremerhaven Course Material. Simulation and Process Control [ PDV / PEET9 ]

Similar documents
2.161 Signal Processing: Continuous and Discrete Fall 2008

Review of Linear Time-Invariant Network Analysis

A New Closed-loop Identification Method of a Hammerstein-type System with a Pure Time Delay

Time Response Analysis (Part II)

Math 4381 / 6378 Symmetry Analysis

Unit 2: Modeling in the Frequency Domain Part 2: The Laplace Transform. The Laplace Transform. The need for Laplace

ECEN 420 LINEAR CONTROL SYSTEMS. Lecture 2 Laplace Transform I 1/52

1. First-order ODE s

2 Ordinary Differential Equations: Initial Value Problems

10 Transfer Matrix Models

Problem Set 3: Solution Due on Mon. 7 th Oct. in class. Fall 2013

Control Systems I. Lecture 6: Poles and Zeros. Readings: Emilio Frazzoli. Institute for Dynamic Systems and Control D-MAVT ETH Zürich

2.2 SEPARABLE VARIABLES

Autonomous Equations / Stability of Equilibrium Solutions. y = f (y).

Overview Lecture 1. Nonlinear Control and Servo systems Lecture 1. Course Material. Course Goal. Course Material, cont. Lectures and labs.

Lecture 7: Laplace Transform and Its Applications Dr.-Ing. Sudchai Boonto

Definition of the Laplace transform. 0 x(t)e st dt

e st f (t) dt = e st tf(t) dt = L {t f(t)} s

Spotlight on the Extended Method of Frobenius

Process Dynamics, Operations, and Control Lecture Notes 2

Basic Procedures for Common Problems

3 First order nonlinear equations

Modeling and Simulation Revision IV D R. T A R E K A. T U T U N J I P H I L A D E L P H I A U N I V E R S I T Y, J O R D A N

z = 1 2 x 3 4 y + 3 y dt

Lecture 5: Linear Systems. Transfer functions. Frequency Domain Analysis. Basic Control Design.

ChE 6303 Advanced Process Control

ECE 3620: Laplace Transforms: Chapter 3:

Time Response of Systems

Laplace Transforms Chapter 3

Singular Value Decomposition Analysis

MODELING OF CONTROL SYSTEMS

Control Systems I. Lecture 5: Transfer Functions. Readings: Emilio Frazzoli. Institute for Dynamic Systems and Control D-MAVT ETH Zürich

Subband Coding and Wavelets. National Chiao Tung University Chun-Jen Tsai 12/04/2014

SEPARABLE EQUATIONS 2.2

The Laplace Transform

Section B. Ordinary Differential Equations & its Applications Maths II

Raktim Bhattacharya. . AERO 632: Design of Advance Flight Control System. Preliminaries

Cyber-Physical Systems Modeling and Simulation of Continuous Systems

Raktim Bhattacharya. . AERO 422: Active Controls for Aerospace Vehicles. Dynamic Response

Course Requirements. Course Mechanics. Projects & Exams. Homework. Week 1. Introduction. Fast Multipole Methods: Fundamentals & Applications

Modeling and Simulation Revision III D R. T A R E K A. T U T U N J I P H I L A D E L P H I A U N I V E R S I T Y, J O R D A N

LECTURE NOTES - VIII. Prof. Dr. Atıl BULU

Uncertainty and Robustness for SISO Systems

Lecture 13 Date:

Contents. Dynamics and control of mechanical systems. Focuses on

1.1 The Equations of Motion

Transform Solutions to LTI Systems Part 3

Curriculum: MechEng, UC Berkeley

Lecture 1a. Complex numbers, phasors and vectors. Introduction. Complex numbers. 1a.1

EE 330 Lecture 25. Small Signal Modeling

Lecture 4: Numerical solution of ordinary differential equations

Systems Engineering/Process Control L4

Index. Index. More information. in this web service Cambridge University Press

Use of Differential Equations In Modeling and Simulation of CSTR

EE/ME/AE324: Dynamical Systems. Chapter 7: Transform Solutions of Linear Models

Identification Methods for Structural Systems. Prof. Dr. Eleni Chatzi System Stability - 26 March, 2014

MATHEMATICAL MODELING OF CONTROL SYSTEMS

CHAPTER 10: STABILITY &TUNING

9.5 The Transfer Function

( ) ( = ) = ( ) ( ) ( )

I Laplace transform. I Transfer function. I Conversion between systems in time-, frequency-domain, and transfer

GATE EE Topic wise Questions SIGNALS & SYSTEMS

Linear Systems Theory

Control System. Contents

LINEAR SYSTEMS. J. Elder PSYC 6256 Principles of Neural Coding

Physics of Tsunamis. This is an article from my home page: Ole Witt-Hansen 2011 (2016)

MAS107 Control Theory Exam Solutions 2008

Control Systems. Laplace domain analysis

Engineering Mathematics I

Introduction to Differential Equations. National Chiao Tung University Chun-Jen Tsai 9/14/2011

Chapter 6: The Laplace Transform. Chih-Wei Liu

LTI Systems (Continuous & Discrete) - Basics

Week 3 September 5-7.

INTRODUCTION TO DIFFERENTIAL EQUATIONS

Lecture 12. AO Control Theory

Development of Dynamic Models. Chapter 2. Illustrative Example: A Blending Process

7.2 Relationship between Z Transforms and Laplace Transforms

D(s) G(s) A control system design definition

f(t)e st dt. (4.1) Note that the integral defining the Laplace transform converges for s s 0 provided f(t) Ke s 0t for some constant K.

Dr. Ian R. Manchester

MATH 23 EXAM 1 REVIEW PROBLEMS

Lecture 2: Separable Ordinary Differential Equations

Some of the different forms of a signal, obtained by transformations, are shown in the figure. jwt e z. jwt z e

Ordinary Differential Equations n

Introduction. Performance and Robustness (Chapter 1) Advanced Control Systems Spring / 31

Laplace Transform Analysis of Signals and Systems

Identification of Nonlinear Dynamic Systems with Multiple Inputs and Single Output using discrete-time Volterra Type Equations

Theoretical Models of Chemical Processes

Initial Value Problems for. Ordinary Differential Equations

Laplace Transforms. Chapter 3. Pierre Simon Laplace Born: 23 March 1749 in Beaumont-en-Auge, Normandy, France Died: 5 March 1827 in Paris, France

Control Systems I. Lecture 7: Feedback and the Root Locus method. Readings: Jacopo Tani. Institute for Dynamic Systems and Control D-MAVT ETH Zürich

CHAPTER 13: FEEDBACK PERFORMANCE

3.0 PROBABILITY, RANDOM VARIABLES AND RANDOM PROCESSES

Section 8: Differential Equations

2.161 Signal Processing: Continuous and Discrete Fall 2008

Chapter 2 Basic Conservation Equations for Laminar Convection

The Laplace Transform

Process Modelling, Identification, and Control

Identification Methods for Structural Systems

Solutions for Tutorial 10 Stability Analysis

Transcription:

I Universit of Applied Sciences Bremerhaven Course Material I Introductor Notes Simulation and Process Control [ ] S Part : Process Modeling Process Control has a great impact on qualit and safet in industrial production. It is therefore important for a process engineer to have a sound knowledge of control principles. Closel related to control is the modeling of processes. Man modern controllers are model-based. The process model can be also be used to simulate the process and the closed loop without risking harmful experiments with real sstems. A model is also a ver valuable tool to improve the controllabilit (the best dnamic performance of a sstem under closed loop control) of a process. S Part 2: S Part 3: S Part 4: Simulation Process Control Advanced Controller Design (IMC, optional MPC) In this course we will cover the following topics (theoreticall and in the lab): S Modelling of essential process elements S Process Simulation using MATLAB/Simulink (optional HYSYS) S Simplifing models for control purposes S Standard industrial controllers S SISO closed loops and stabilit S Internal model control (IMC) S Simulation of closed loops S Option: Model predictive control (MPC) Revision: V. Date: September 23 I.I Course Material The most recent course material is available on the web site: http://www.hs---bremerhaven.de/kmueller/ Prof.Dr.-Ing.KaiMüller Institute for Electrical Engineering and Control An der Karlstadt 8 D---27568 Bremerhaven I hope that everbod in m class enjos the introduction in this fascinating subject. Tel: +49 47 48 23 --- 45 FAX: +49 47 48 23 --- 48 E --- Mail: kmueller@hs --- bremerhaven.de Bremerhaven, September 23 Kai Müller <kmueller@hs---bremerhaven.de> Tel: (47) 4823 --- 45

II Univ.ofAppl.Sciences Bremerhaven---IAE III Univ.ofAppl.Sciences Bremerhaven---IAE II Table of Contents Process Modeling.... First Model: Gravit flow tank....2 Control of the flow tank... 5 2 Modeling --- Sstematic Approach... 6 2. Model of a phsical situation... 6 3 Analtical solutions of differential equations... 7 4 Simulator (numerical simulation)... 8 4. Principle of operation... 8 4.2 Example: numerical integration of the gravit flow tank model (Euler formula)... 9 5 Modeling of a Continuous Stirred Tank Reactor (CSTR)... 5. Example: Modeling a simple CSTR... 2 6 Endothermal and Exothermal Chemical Reactions... 4 7 Modeling a Nonisothermal CSTR... 7 8 Linearization... 2 8. Linearization of the gravit flow tank... 2 8.2 Modern Control Approach (Feedback Linearization) (this is the smbol for extremel hard stuff)... 22 9 Perturbation Variables (nothing reall new)... 23 9. Exercise: Linearization of the Arrhenius Nonlinearit... 24 Transfer Function... 26. Signal Representation in Frequenc Domain (Laplace-Transform)... 26.2 Exercises... 28.3 Important Laplace Function Computation Rules... 29.4 Deriving the Transfer Function from Differential Equations... 29.4. Frequenc Domain Model of the Gravit Flow Tank... 3.4.2 EXERCISE: Comparison of the Nonlinear and the Linearized Model 3 Level Control for the Gravit Flow Tank... 32 2 Calculation with Transfer Functions and Signals... 33 2. Serial Connection (Multiplication)... 34 2.2 Parallel Connection (Addition)... 35 2.3 Closed Loops... 35 3 Elementar Transfer Functions... 38 3. Proportional gain... 38 3.2 Integrator... 39 3.3 Differentiation... 4 3.4 First Order Lag... 4 3.5 Lead-Lag Element... 42 4 Frequenc Analsis of Transfer Functions... 44 4. General Form of a Real Rational Transfer Function... 44 4.2 Frequenc Response... 45 4.2. Frequenc Response example... 47 4.3 Bode Diagram... 48 4.4 Nquist Diagram... 49 5 Poles and Zeros... 5 5. Example: Transformation into Pole-Zero Form... 5 5.2 Frequenc Response of the Pole-Zero Form... 5 5.3 Dependenc of the Magnitude of the Bode Diagram on the Zeros and Poles... 54 5.3. All-pass Transfer Function... 55 6 Non Real Rational Transfer Functions... 56 7 Stabilit... 58 8 Closed Loop Stabilit... 6 8. Example: Stabilit of a Closed Loop sstem... 6 8.2 Closed Loop Stabilit and the Nquist Diagram... 63 8.3 Phase and Gain Distance... 65 9 Controller Design b Specification of Gain and Phase Distances... 67 9. Example: Controlling a 3. Order Lag with a Proportional Controller.. 68

IV Univ.ofAppl.Sciences Bremerhaven---IAE 9.. Design K for Gain Distance rd =.8... 68 9..2 Design K for Phase Distance Ψ d = π/3... 7 2 Controller Design... 72 2. Controller Tpes... 72 2.2 Selecting the Suitable Controller... 74 2.3 Standard Configurations... 75 2.3. First Order Sstem... 75 2.3.2 Integrator Process... 76 2.3.3 Second Order Sstem... 77 2.3.4 Other Sstems... 79 Process Modeling Modeling requires understanding of operation, objectives, constraints and uncertainties of the process. A model for control purposes must describe the dnamic behavior (not onl the stead-state). It should be as simple as possible in order to keep the number of parameters small.. First Model: Gravit flow tank q 2 Heuristic Methods... 79 2. Tu-Tg-Methods (Tu-T-Methods)... 8 2.2 Ziegler-Nichols-Tpe Methods... 8 22 Level Control of an Uncoupled Three-Tank Sstem... 83 22. Mechanical Control of the Simplified Sstem... 83 22.2 P and I Control of the Complete Nonlinear Sstem... 84 23 Frequenc and Time domain and Analsis of LTI (Linear Time Invariant) Sstems... 85 24 ImpactofZerosandPolesonProcessProperties... 86 25 References... 87 tank A h pipe q A Fig.: Gravit flow tank With the aid of two fundamental principles a model can be derived: S S conservation of mass conservation of energ. These principles limit the possible actions of the sstem. We need additional (mechanical) laws which describe how a sstem can behave. Without proof a general answer gives the so called Hamilton s variational principle: The motion of a sstem takes place in such a wa that the integral t2 t (T + W)dt (.)

2 3 is an extremum (Hamilton s variational principle). T denotes the total kinetic energ and W denotes the work of the external forces. Don t get headaches with equation (.) --- we will not use it here. I introduce this remarkabl general formula just to present a complete set of formulas to describe sstem in fig... We know from elementar mechanics that the fluid from the tank flows out of the pipe due to gravitational force. We assume an incompressible fluid with densit ρ.thevolumeinthe tank is given b V = A h (.2) and the total mass in the tank is therefore m = ÃA h. (.3) If the level of the tank changes b a small amount h the potential energ change is L = mg h = ÃA hg h. (.4) If the area A is ver large compared to A then the change of h is ver small compared tothespeedofthefluidinthepipe.thismeanswehaveakineticenergonlonthepipe where T = 2 mv2, (.5) m = ÃA h. (.6) ( h is negative). With (.6) equation (.5) can be written as T = 2 ÃA hv2. (.7) The sum of both energies must be zero L + T = ÃA hg h 2 ÃA hv2 =. (.8) Solving (.8) for the speed leads to v = 2gh. (.9) This result is a special form of the Bernoulli equation. The velocit of the fluid in the pipe depends not on the densit ρ or the area A. Now we can derive the output flow q = A v = A 2gh. (.) Fig.2: input flow q output flow q Tank Gravit tank sstem The dependenc of the output flow from the height h is known. We can complete the model if we know the effect of the input flow on the height h. Thevalueh represents the potential energ of the sstem and is denote as a state variable. Theinputflowincreasesh while the output flow decreases h. In mathematical terms this is described b the differential equation (follows from the conservation of mass) dv dt = q q. (.) The volume in the tank (2.53) depends onl on the height dv dt = d dt A h = A dh dt = q q. (.2) Substituting q b (.) gives A dh dt = q A 2gh. (.3) Usuallthedifferentialequationiswrittenintheform A dh dt + 2g A h = q (.4) with the state variable on the left side and the input variable on the right. For the purpose of simulation eq. (.3) should be written in another form. Man (dnamic) simulation tools (MATLAB/Simulink, ACSL, Octave) require this form dh dt = q A 2gh. (.5) A A This is called the state equation (differential equation for the state variable). (.) is called the output equation (depenc of the output from the state variable). A mathematical description of a process model consists of state and output equations. For a large process there can be hundreds of equations. The input flow q structure. is assumed to be an input value. Our Sstem has thus the following Fig..3 shows the Simulink simulation block diagram --- a graphical representation of equations (.) and (.5).

4 5 It can be seen that there is a close relation between the input and output flow rate. But the form of the curves differ ver much. This is tpical for a dnamic sstem. Often the stead-state (as time goes towards infinit) is important for operation of the process. This follows easil from the differential equations. A stead-state arrives when all signals (especiall the state variables) remain constant. We just have to solve the state equations for the case that all derivatives are zero. In our example we arrive from (.3) to = q A 2gh. (.6) If the input flow rate q is constant, than as time goes towards infinit the constant height becomes h ss = q2 2gA 2 (.7) For this height the input and output flow rates are identical. Of course, the process design engineer must ensure that this stead-state tank level is less than the tank height! Fig.3: Simulink block diagram of the gravit flow tank.2 Control of the flow tank If the behavior of the flow tank is not suitable for a specific process the flow tank properties can be changed to meet the demands. A tpical example is the control of the tank level h. pump control valve q h ref h --- controller h A valve q level sensor A Fig.4: Simulation result for a pulse-tpe input flow rate q Fig.5: Level control of the gravit flow tank

6 7 The tank level is measured b a sensor. The measurement is compared to a reference value h ref. The difference (control error) is feed to the controller which generates the the input signal for a control valve to change the input flow rate q. If the controller is properl designed the tank level remains nearl constant regardless of the output flow rate q.the signal q can be regarded as a disturbance value for the tank level h. As we can see, a controller can change the original sstem s behavior so that it becomes much more suitable for technical applications. A poorl designed controlled sstem can be worse than an uncontrolled sstem. In our case a bad controller ma cause heav oscillations in the tank level. 2 Modeling -- Sstematic Approach phsical situation Model of phsical situation S S S In most cases the independent variable is the time t. It is characteristic for a dnamic model that the outputs depend on the time. In distributed sstems we also have geometrical dimensions as independent variables (e.g. x,, z). Especiall in control sstems the independent variable can also be the frequenc ω. Determine input signals Input signals are external signals that have an impact on the sstem (forces, currents, input flows, concentrations etc.). Determine output signals Output signals are outputs of the sstem which depend the inputs and the sstem dnamics. Inputs and outputs are functions of the independent variable(s). Determine state variables This is most complicated. The state variables are all degrees of freedom of a sstem. Often these variables represent energies (like temperature, velocities, or positions) butthisisnotalwasthecase. The state variables must determine the complete state of the sstem. Since state variables depend on the used coordinate sstem, the variables are not unique. The number of state variables determines the order n of a sstem. no Identification and verification Satisfactor? es Useful prediction and design In our first example the sstem was first order. This is the simplest dnamic sstem. Ever state variable has an associated differential equation. Thestatevariablescharacterizethestateofthesstem.Thedifferentialequationsofthe state variables describe how the inputs affect the change of the state variables. The output variables depend on the state of the sstem and sometimes also on the input variables. This relations are called output equations. Fig.6: Flow diagram of the modeling process (after Russel and Denn, 972) 3 Analtical solutions of differential equations 2. Model of a phsical situation S Select independent variables The model should produce the sstem response as a function of the independent variable(s). These variables have arbitrar values (within phsical reasonable bounds, of course). We will set our focus to the solution to ordinar differential equations (ODEs). In most cases time is the independent variable. We will not cover here the so called partial differential equations (PDEs). PDEs occur in process sstems when the solution depends also on space coordinates (distributed sstems). Analtical solutions for a set of differential equation are difficult to find whenever the ODE is nonlinear in the parameters. Unfortunatel this is often the case for processes.

8 9 If the input functions are not mathematical functions (like step, sine etc.) an analtical solution is not possible. It is therefore common practice to perform a numerical integration of ODEs and PDEs, respectivel. 4 Simulator (numerical simulation) A numerical simulation can easil solve an number of (nonlinear) ODEs with arbitrar input signal waveforms. However, numerical simulations do not provide exact solutions. Instead the approximate the exact solution b an finite number of discrete simulation steps. As a rule of thumb one ma sa that the smaller the step size the more precise is the numerical integration. On the other hand a small step size results in a high computation time. 4. Principle of operation A digital simulator discretizes the time axis (or whatever the independent variable is). The step size is denoted as h. From the ODE the derivative is known. From the current value of the state variable the simulation performs a single step. After one step the time t is advanced to t +stepsize. t := t + h. (.8) Fig.7: known: ẋ = f (t, x), x(t ) Approximation of x(t +h) using the derivative at x(t ) x(t + h) = x(t ) + h f (t, x ) Euler integration x x k f(t, x ) x k+ h t t +h t It can be shown, that the procedure converges towards the exact solution if h. If h is chosen to large the result can be totall useless. In practical applications the step size h is determined b experiment. Other, more sophisticated integration formulas use a variable stepsize. The Euler formula is the simplest form for solving differential equations. Simulators offer usuall a broad ranges of methods. These methods all have advantages and disadvantages for certain processes. Among these, the most popular are the so called Runge-Kutta formulas. Here is a list of the most important integration methods: Algorithm step order Euler fixed Runge-Kutta fixed 2 U Runge-Kutta fixed 4 Runge-Kutta-Fehlberg variable 2 U Runge-Kutta-Fehlberg variable 5 Gear s Stiff variable variable Adams-Moulton variable variable Themostcommonmethodsaremarkedwith U. 4.2 Example: numerical integration of the gravit flow tank model (Euler formula) The model consists of the state (differential) equation dh dt = q A 2gh. (.9) A A and the output equation q = A v = A 2gh. (.2) For a numerical solution we must know the phsical data of the process. We assume normalized values and choose: h(t = ) =.5 (initial value of h) q = (no input flow rate) 2g =.2 A A Equation (.9) then simpl becomes dh dt =.2 h. (.2) For numerical integration we must also choose a step size. Unfortunatel the smbols for step size and tank level are both h. Thus, we will denote the step size here as t. Selecting t =., the recursive formula for the computation of h(k) becomes

h(t + t) = h(t ) + dh t = h(t dt ).2 h(t ). (.22) h(t ) (feed stream) q F, c if As ou can see, ou onl need the (known) information on h(t )tocalculate h(t + t). These kind of integration methods are called explicit formulas. The next step is the advance in time V t := t + t. (.23) q, c i Following is the result of the numerical computation of (.9) for t =. and t =.. tank level h.6.5.4.3.2 t =. Fig.9: CSTR schematic An input flow rate (index f denotes feed stream) contains concentrations of various substances. For the sake of simplicit we assume an incompressible fluid and the same densit ρ for all substances. It follows from the conservation of mass d dt (ÃV) = Ã f q f Ãq. (.24) Let us denote the substances in the feed stream as A, B, C... and the reaction products as M, N, P... and so on. Fig.8:. t =. ---. 5 5 time t Gravit flow tank running empt --- simulation with step size t =. and t =.. While the result with t =. is ver closed to the exact values the simulation with t =. give useless results (note: negative tank levels!). 5 Modeling of a Continuous Stirred Tank Reactor (CSTR) The CSTR tpe reactor is ver common in industr, although more complicated than the reactor we will model. The schematic is shown in fig..9. If chemical reaction occur then the following must hold (α)a + βb + μm + νn +. (.25) The coefficients α, β, μ, ν,... are called coefficients, usuall integer or fractions of integers. Without loss of generalit α can alwas be selected to be, sincewe candivide (.25) b α. Rate of disappearance of A b reaction per unit volume = r. (intrinsic reaction rate) With the above definition we can formulate the state equations for all substances in the CSTR d dt c A V = qf c Af qc A Vr, (.26) d dt c B V = qf c Bf qc B βvr, (.27) d dt c M V = qcm + μvr, (.28) d dt c N V = qcn + νvr (.29) (or more equations for complex processes). The equations are more complicated than the first seem, because r is not constant and depends on concentrations and temperature. For man processes r can assumed to have the form

2 3 r = kc a A cb B, (.3) where k depends on temperature and the exponents are strongl related to α and β. (sometimes the are identical a = α, b = β). 5. Example: Modeling a simple CSTR A reactor is fed b to species A and B with their specific feed rates q fa and q fb. (feed stream) q fa, c fa V =const. c B, c B, c M q fb, c fb q = q fa + q fb d dt c B V = qfb c fb qc B βvr, (.36) d dt c M V = qcm + μvr. (.37) With constant V, β = 2, μ = and (.3) we arrive at dc A = q fa dt V c fa q fa + q fb c V A r, (.38) dc B = q fb dt V c fb q fa + q fb c V B 2r, (.39) dc M = q fa + q fb c dt V M + r. (.4) A process block diagram is drawn in fig... q fa q fb CSTR production rate PR purit PU Fig.: Process diagram of the CSTR example Fig.: CSTR schematic The concentrations are c fa and c fb. The process operates at a constant volume, i.e. the sum of the feed rates is equal to the output flow rate q fa + q fb = q. (.3) A chemical reaction takes place, where M is formed as A + 2B M. (.32) We assume a constant temperature, so k is constant and the intrinsic reaction rate thus becomes r = k c A c 2 B. (.33) Several outputs can be defined, one of the most important are the production rate and the purit PR = qc M = q fa + q fb c M, (.4) c M PU :=. (.42) c A + c B + c M Note: this is not an general definition of purit. The definition (.42) just makes sense in this particular case. The design objective here is to design input flow rates q fa and q fb, so that the process generates high purit substance M at a high production rate. The signal flow in the CSTR can be visualized b the block diagram in fig..2 using the equations (.3)-(.42). Once a block diagram is drawn it is relativel eas to enter a sstem in an simulator program. The concentrations in the input flow rate are fixed c fa =.5, c fb =.7. (.34) From (.32) follows β =2 and μ =. The state equations become d dt c A V = qfa c fa qc A Vr, (.35)

4 5 q fa c fa --- --- rv V V ċ A r c A k In a batch reactor we do not have kinetic energies and the potential energ remains constant. It is sufficient to consider thermal energ which changes according to thermal power from either heating, cooling and chemical reactions. If we have a simple reaction A M (.43) then the rate of heat generation is (or heat consumption rate) is given b q fb q c fb β --- --- V ċ B c B Q G = λvr, (.44) where λ is the heat of reaction and r is the reaction rate. The coefficient λ is negative for exothermic reactions and positive for endothermic reactions. If there is no input or output flow rate the conservation of mass gives d dt dc c A V = V A = Vr. (.45) dt The concentration c M increases as c A decreases --- V ċ M c M c M c A + c B + c M PU V dc M = rv. (.46) dt At time t = we assume that c M = and c A = c A. PR The process heat changes the internal energ of the sstem (conservation of energ, chemical energ E C is converted to thermal energ U) Fig.2: CSTR block diagram du dt = Q G = λvr. (.47) It is assumed that no heat transfer occurs (thermal insulation). The reaction rate r = kc A, (.48) 6 Endothermal and Exothermal Chemical Reactions With endothermal and exothermal reactions we must consider the internal energ or heat U. in flowing sstems it is convenient to work in terms of the enthalp H = U + pv (p = pressure, V = volume). In a batch reactor at constant volume and constant pressure it is sufficient to use U instead of H. i.e. the factor k depends in an extremel nonlinear form on temperature T (Arrhenius or Van t-hoff form) k = k e E RT (.49) (R is the ideal gas constant, E is the activation energ, T is the absolute temperature). The factor E/R is in the range of 5. K. Of course, if several substances are involved in the reaction then the reaction rate depends on more terms than outlined in (.48). The energies under consideration are T (kinetic energ), L (potential energ), U thermal energ, E C chemical energ.

6 7.9.8.7.6.5.4.3.2. 2 3 4 5 6 7 8 9 Fig.5: initial conditions T c A Ãc λ p r T k e k c E A RT --- Detailed block diagram of the batch reactor (thermall insulated) Fig.3: Nonlinearit of the reaction rate k = f(t) Substituting U in (.47) b ρvc p T (c p = heat capacit) results in dt dt = Ãc λ c p A k e E RT. (.5) Note that λ is negative for exothermic reactions. This is a nonlinear ODE for the reactor temperature. The output of the sstem is the amount of the component M M = ÃVc M = ÃV ca c A. (.5) The sstem is a homogenous sstem, i.e. it has no inputs. The block diagram is shown in fig..4. Fig.4: Batch reactor Block diagram of the sstem T c A M } state variables A detailed block diagram of the batch reactor using equations is drawn in fig..5. 7 Modeling a Nonisothermal CSTR Using the elements of the previous sections we can model a real process. A cut-awa view of the reactor is shown in fig..6. We assume a component A that reacts irreversibl at a specific reaction rate r to form a component M A r M. (.52) The intrinsic reaction rate is assumed to be proportional to the concentration of A in the tank r = kc A = c A k e E RT. (.53) For the components A and M we can derive the equations from the conservation of mass. The amount of components depend on the input flow, the output flow and the chemical reaction in the tank d VcA = q dt c A qc A rv, (.54) d VcM = q dt c M qc M + rv. (.55) The second equation (.55) is not necessar because the production of component M is exactl the same as the decrease of A. The heat generation due to reaction is given b Q G = λvr. (.56) Note that λ is negative here (Q G >, exothermal reaction). Heat transfer between the process at temperature T and the cooling water at temperature T J is

8 9 Q = ÀA H T TJ. (.57) The coefficient κ is the heat transfer coefficient, and A H is the heat transfer area. q J, T J top view q J, T J water jacket du dt = q Ãc P T qãc P T ÀA H (T T J ) λvr. (.6) power from input flow rate power from output flow rate heat transfer power chemical reaction power If we operate the reactor at constant volume we can use (.58) to obtain an ODE for the reactor temperature T ÃVc dt P dt = q Ãc P T qãc P T ÀA H (T T J ) λvr. (.6) Note, that r depends also on temperature (.53). The same holds for the cooling jacket. The internal energ of the cooling water depends on the input and output power and the heat transfer from the reactor (feed stream) q, c A, T du J = q dt J à J T J q J à J T J + ÀA H (T T J ) = q J à J TJ T J + ÀAH (T T J ). (.62) q J, T J With U J = à J V J c J T J (.62) can be written as q J, T J cut-awa view c A, T dt à J V J c J J = q dt J à J c J TJ T J + ÀAH (T T J ). (.63) The whole sstem can be described b the three state equations (.54), (.6), and (.63). If the reactor volume V is kept constant then the state equations can be written in the following final form (input flow rate q must be equal to q) dc A = q dt V c A q V c A r, (.64) q (effluent stream) dt dt = q V T T ÀA H ÃVc P (T T J ) λ Ãc P r, (.65) Fig.6: Nonisothermal continuous stirred tank reactor With the heat capacit c P of the liquid the internal energ is given b U = ÃVc P T (.58) The internal energ is changed b power dw = P. (.59) dt We have to sum up all power streams that change the internal energ dt J = q J ÀA TJ T dt V J + H (T T J à J V J c J ). (.66) J The sstem model is of 3. order (3 state variables). The first two are nonlinear due to the exponential temperature dependenc of r, the last ODE is linear. This can be easil seen when we rewrite (.64) and (.65) with explicit temperature dependencies dc A = q dt V c A q V c A c A k e E RT, (.67) dt dt = q V T T ÀA H ÃVc P (T T J ) λ Ãc P c A k e E RT. (.68)

2 2 As the sstem becomes more complex a detailed block diagram is not ver helpful to understand the sstem. F u u 8 Linearization Controller design is much easier when a sstem in linear. Unfortunatel most process models a more or less nonlinear. A function f(x) is linear when the following holds f (ax) = af(x) a <. (.69) In other words: the sstem behavior does not depend the amplitude of x. For instance a square root function does not satisf (.69) ax = a x a x. (.7) Linearization of a sstem is the approximation of the sstem at a specific point of operation (equilibrium point, stead-state). An nonlinear function = F(u) (.7) where derivatives exist at x can be written as a Talor-series expansion in the form + = F(u ) + F u + u 2 F 2 u u 2! 2 + 3 F 3 u u u 3! 3 (.72) u u Since = F(u ) it is obvious that = F u + 2 F 2 u u u 2! 2 + 3 F 3 u u u 3! 3 (.73) u u If u is small then can be expressed as F u u u. (.74) This is a linear dependenc since (.69) holds. The graphical interpretation is shown in fig..7. Fig.7: u Linearization at an equilibrium point This principle can be applied to the linearization of models. One of the main problems when linearizing a sstem is finding an equlibrium point since the sstem is nonlinear. This is often done b numerical methods. 8. Linearization of the gravit flow tank The gravit flow tank state equation dh dt = q A A 2g A h. (.75) can be linearized around the equilibrium point (follows from dh/dt =,index ss denotes the stead-state equilibrium point) h ss = q2 ss 2gA 2. (.76) We insert the deviations from the equilibrium point h = h ss + h into (.75) we obtain Since h ss d dt (h ss + h) = q A A is constant we obtain 2g A h. (.77) d h = f (q dt, h) = q A 2g A A h. (.78) The first order Talor series expansion of (.78) gives d h f dt q q + f h. q =q h ss h=h ss = q A 2g A 2A h ss h. (.79) u

22 23 The state equation is now a linear function of h (and q, of course). Keep in mind that this is onl valid if the deviation from the operating point (i.e. h ) is kept relativel small. h ref controller v A q gravit flow tank (nonlinear real sstem) h 8.2 Modern Control Approach (Feedback Linearization) --- (this is the smbol for extremel hard stuff) control computer A 2g h Feedback of signals can change a sstem behavior. Most processes (even complex sstems) can be perfectl linearized b state variable feedback. This is called feedback linearization. The idea is quite simple: replace the nonlinear part b a new input. In the equation dh dt = q A A 2g A h (.8) the complete right side is replaced b the new variable v := q A 2g A h. (.8) A Then, equation (.8) simpl becomes dh dt = v (.82) which is a perfectl linear sstem. If the (artificial) input v remains zero then the tank level remains constant (independent of the output flow!). The variable v can be regarded a a virtual input to the new sstem. From (.8) the real input can be calculated q = A v + A 2gh. (.83) The following block diagram illustrates the procedure. Fig.8: Process seen b the controller Feedback linearized sstem The process appears to the controller as perfectl linear and is eas to control. 9 Perturbation Variables (nothing reall new) v Perturbation is closel related to linearization. We start from an equilibrium point (a possible stead-state point of operation). All variables are written in the form x := x + x, (.84) where x denotes the operating point and x is the perturbation variable. B Talor series expansion and neglecting all higher order term it is possible to obtain an linear sstem of ODEs which describe the sstem in the neighborhood of the operating point. The result is a linear sstem which contains onl the perturbation variables. h Example: dx = f dt = x 3 x x 2 + u, (.85) dx 2 = f dt 2 = x x 2 2. (.86) An equilibrium point where the derivatives are zero is

24 25 x = 3 u, x 2 =. (.87) ThefirstorderTalorexpansiongives With the constants f := αc A c 2 B e E RT, k := αc 2 B e E RT, d x f dt (x, x 2, u ) + f x x + f x x 2 x,x 2,u x,x 2,u + f u x,x 2,u u (.88) It is characteristic for an equilibrium point that f (x, x 2, u) is zero. Carring out the derivatives we obtain (note: equation sign is not mathematicall correct but used for convenience) k 2 := 2αc A c B e E RT, k 3 := αc A c 2 B theequation(.92)canbewrittenintheform E RT 2 e E RT. (.93) f f + k c A + k 2 c B + k 3 T. (.94) This form clearl demonstrates the linear approximation of (.9). d x = (3x 2 dt + x 2 ) x x x 2 + u. (.89) Appling a first order Talor expansion to (.86) gives d x 2 = x 2 dt 2 x + 2x x 2 x 2. (.9) t Fig.9: Interpretation of a perturbation variable 9. Exercise: Linearization of the Arrhenius Nonlinearit Calculate the first order Talor expansion of the expression f (c A, c B, T) = αc A c 2 B e E RT (.9) at the operating point c A, c B and T. Solution f αc A c 2 B e E RT + αc B e E RT c B c A + 2c A c B + c A c B E RT 2 T (.92)

26 27 Transfer Function From conservation of energ and mass the differential equations of a process can be derived. Differential equation are a description in time domain (for ODEs the time t is the independent variable). The analsis of the process behavior and the controller design is much easier with a frequenc domain representation of the process. The frequenc domain (transfer function) exists, iff the model is linear. The main advantage of the frequenc domain is that instead of a set of differential equations the process can be described b algebraic equations. In frequenc domain the dnamic model of a process consists of algebraic equations.. Signal Representation in Frequenc Domain (Laplace-Transform) In the frequenc domain all signals are function of the independent variable s. Thesignals are the Laplace-transforms of the time domain functions. The Laplace transform is defined as x(s) = x(t)e st dt. (2.) Note that the Laplace-transform requires functions of the form x(t) =, t <. (2.2) Usuall no one reall carries out the integral (2.). Instead, tables are used to transform functions of time into the s-domain. But (2.) is not difficult to appl as we see from the transformation of the step function σ(t) = t < t Since σ(t) is constant from to, the Laplace-transform of (2.3) becomes σ(s) = (2.3) e st dt = s e st = s. (2.4) The Laplace-transform is also denoted as x(s) = L x(t). (2.5) The inverse is also an integral (over s) x(t) = 2πj and is denoted as c+j c j x(s)e st ds (2.6) x(t) = L x(s). (2.7) However, there is no need to solve the integrals (2.53) or (2.6). Solutions for the most common signals can be found in tables. The following table lists some functions in the t- and s-domain (incomplete list). f(s) f(t) s s 2 s n t t n (n )! e s + α αt t n (s + α) n (n )! e αt α s 2 + α 2 sin(αt) s s 2 + α 2 cos(αt) Since the Laplace-transform is linear, the following equation holds L f (t) + g(t) = L f (t) + L g(t). (2.8) Complex functions can be transformed b splitting them up into elementar functions. The elementar functions can then be transformed b tables. Example: What is time domain function for the Laplace function x(s) = s + 5 (s + )(s + 3)? (2.9)

28 29 Splitting up (2.9) into elementar function (fraction decomposition) gives x(s) = 2 s + s + 3. (2.) From this we find and L 2 s + = 2e t (2.) L s + 3 = e 3t (2.2) Thus, the inverse function in time-domain is the sum of (2.) and (2.2) x(t) = L x(s) = 2e t e 3t. (2.3).2 Exercises. Given are the following function in the frequenc domain (Laplace-transforms). Find elementar functions (partial fraction decomposition) which can be transformed into time domain functions, i.e. compute (t) = L (s). a) (s) = 2 (s + )(s + 2) b) (s) = 2 (s + )(s + 2)(s + 3) c) (s) = s s 2 + 2s 8 d) (s) = 5 + s (s ) 3 (s 2) 2 SOLUTIONS: a) (s) = 2 s + 2 s 2 b) (s) = s + 2 s + 2 + s + 3 c) (s) = 3 s 2 + 2 s + 4 (t) = 2e t 2e 2t (t) = e t 2e 2t + e 3t (t) = 3 e 2t 2e 4t d) (s) = s + 3 (s ) 2 + 6 (s ) 3 2 s 2 + 7 (s 2) 2 (t) = 2e t + 3te t + 3t 2 e t 2e 2t + 7te 2t.3 Important Laplace Function Computation Rules The Laplace-transform is among control engineers ver popular. The complex integration and differentiation operations in time-domain become simple in frequenc domain (Laplace function). Differentiation: time domain frequenc domain ḟ(t) sf (s) f (+ ).. f (t) s 2 f (s) sf (+ ) ḟ(+ ) (n) f (t) s n f (s) s n (n ) f (+ ) f (+ ) Integration: time domain t f (τ)dτ final value (t ): lim t + value at (t +): lim t + f (t) = lim s sf(s) f (t) = lim s sf(s) frequenc domain s f (s) Differentiation in frequenc domain simpl means multiplication b s. The succeeding terms [like ---f(+)] result from the restriction f(t) = for t < (discontinuit). Ifthe function is for t + than a first order differentiation is equal to the multiplication of f(s) b s. Integration in frequenc domain is equal to the division of f(s) b s. Differential equations in time domain become algebraic equations in frequenc domain..4 Deriving the Transfer Function from Differential Equations A linear differential equation of the form dx dt + a x = b (2.4)

3 3 can be transformed into Laplace domain b using the differentiation rule from section.3 sx(s) x(t =+) + a x(s) = b (s). (2.5) If x(t=+) = than (2.5) can be solved for x(s) s + a x(s) = b (s), (2.6) x(s) = b s + a (s). (2.7) Input and output are related b the algebraic term G(s) := b s + a. (2.8) G(s) is the transfer function and we write Fig 2.: x(s) = G(s) (s). (2.9) (s) G(s) x(s) Dnamic sstem in frequenc domain The transformation into frequenc domain requires a linear sstem. To convert a nonlinear model in state-space form into frequenc domain the model has to be linearized..4. Frequenc Domain Model of the Gravit Flow Tank The model of the gravit flow tank dh dt = q A A 2g A h (2.2) can be linearized at the equilibrium point q ss and h ss d h = q A 2g h. (2.2) dt A 2A h ss Appling the differentiation rule to (2.2) gives (assuming h() = ) s h = q A 2g h. (2.22) A 2A h ss We can now solve the algebraic equation for h(s) A h = s + A 2A 2g h ss The transfer function in a standard notation becomes G(s) = 2hss A 2h ss q (2.23) A g. (2.24) s + g A We can also express (2.24) in terms of q ss in that we replace h ss = q ss. (2.25) 2g A We obtain the transfer function G(s) = q ss A 2 g A q ss A 2 g s +. (2.26) Transfer functions of first order are defined b gain V and a time constant T G(s) = V Ts+. (2.27) Both gain V and time constant T depend on the operating point q ss V = q ss A 2 g, T = A q ss A 2 g. (2.28) Both coefficients increase linear with the stead-state input low rate q ss. T has the dimension of time [T] = m2 m 3 s m 4 m = s. (2.29) s 2.4.2 EXERCISE: Comparison of the Nonlinear and the Linearized Model The following simulation demonstrates the qualit of the linearized model at an operating point q ss and h ss.

32 33 G V = T V s +. (2.32) control valve q u h ref h --- controller h A q Fig 2.2: Simulation model for the comparison of the nonlinear and the linearized model a) Select different stead state operating points and prove the validit of the linearized model. b) Find operation modes where the linearized model give unusable results. Level Control for the Gravit Flow Tank The closed loop sstem is shown in fig. 2.3. The tank level is measured b a level sensor. The difference of the level reference value h ref and the level h is processed b controller and the output signal affects the input flow rate q with a control valve. Fig 2.3: Level control scheme level sensor An analtical solution can be found if the linearized model of the tank G(s) = V Ts+. (2.33) is used. From the block diagram in frequenc domain the closed loop transfer function can be derived. valve tank h ref e u q V h controller T V s + Ts+ --- K(s) G V (s) G(s) A To design a controller the valve dnamics has to be known. We assume a first order dela of the control valve (T V is the dela time constant) Fig 2.4: Tank level control block diagram dq T V dt + q = u. (2.3) In frequenc domain (2.3) can be written as q = T V s + u (2.3) The transfer function of the control valve is 2 Calculation with Transfer Functions and Signals In frequenc domain the output of a dnamic sstem is simpl the product of the transfer function with the input signal

34 35 (s) = G(s) u(s). (2.34) It is common practice to drop the argument (s) and write (2.34) as = Gu. (2.35) The following two sstems serve as example processes to illustrate various operations on transfer functions G = V T s +, G 2 = T 2 s. (2.36) G = V T s + T 2 s. (2.4) 2.2 Parallel Connection (Addition) If transfer functions are connected according to fig. 2.7 the resulting transfer function G is the sum of both functions G and G 2. 2. Serial Connection (Multiplication) u G h If a signal enters G and the output enters G 2 this is denoted as a serial connection. u h G G 2 Fig 2.7: G 2 h 2 Parallel connection of two transfer functions Fig 2.5: Serial connection of two transfer functions From the block diagram follows h = G u, (2.37) = G 2 h. (2.38) Substituting h in (2.38) b (2.37) gives = G 2 G u. (2.39) Since G 2 G gives the same result the sstem in 2.6 has the same transfer function as the sstem in fig. 2.5. Of course, for a given signal u the signal h differs from h 2. No difference will be observed on signal. Fig 2.6: u G 2 h 2 G Serial connection of two transfer functions The resulting transfer function becomes for both cases G = G 2 G. (2.4) The example process becomes The output signal is the sum = h + h 2. (2.42) Since h = G u and h 2 = G 2 u it follows and thus = G u + G 2 u = G + G 2 u. (2.43) G = G + G 2. (2.44) The resulting transfer function becomes G = V T s + + T 2 s = V T 2 s + T s + T 2 s T s + = V T 2 + T s + T 2 s T s +. (2.45) It can be seen that the computation of transfer functions becomes just a matter of algebraic equations. 2.3 Closed Loops A closed loop transfer function is a sstem that contains feedback. The effect of the feedback on the sstem can also be computed since it onl changes the resulting transfer

36 37 function. Feedback configurations can be ver different. Using the results of the previous sections the possible configurations can be reduced to the ones in fig. 2.8 and fig. 2.9. u h G G 2 For negative feedback (fig. 2.9) the resulting transfer function is G = G + G G 2. (2.52) Of course, one of the transfer function be be just, i.e. if G 2 = than a negative feedback results in G = G + G. (2.53) Fig 2.8: Positive feedback u h G --- The corresponding block diagram is show in fig. 2.. u h G --- Fig 2.: Negative feedback (unit gain feedback) G 2 Fig 2.9: Negative feedback Let us first calculate the effect of positive feedback. Therefore, we use the internal signal h. h = u + G 2. (2.46) The output signal depends simpl on G = G h. (2.47) Eliminating h from both equations gives If the closed loop consists of more than two transfer functions the following formula allows immediate calculation of the closed loop transfer function G F G CL = (negative feedback). (2.54) + G OL G F G CL = (positive feedback). (2.55) G OL G F is the forward transfer function which is is the direct line between input and output ofthecompletesstem. Thetransferfunction G OL contains all transfer function which form the open loop, i.e. if the closed loop is opened at an position. = G u + G2 ). (2.48) u e G G 2 Equation (2.48) can now be solved for G G 2 = G G 2 = G u, (2.49) --- open loop point = G G G 2 u. (2.5) G 3 The resulting transfer function for positive feedback becomes Fig 2.: Calculating the closed loop transfer function G = G G G 2. (2.5) The forward function is the product G G 2. The transfer functions G and G 2 are in the direct line between the input u and the output. The transfer function G OL is the product

38 39 of all open loop functions when the closed loop is opened (for instance at the marked position) G OL = G G 2 G 3. Since we have negative feedback (most common for control sstems) the closed loop transfer function becomes u K G CL = G G 2. (2.56) + G G 2 G 3 Of course, the calculation can be carried out in several steps, for instance e = u G G 2 G 3 e, (2.57) = G G 2 e. (2.58) From (2.57) follows e = u (2.59) + G G 2 G 3 Fig 2.2: Proportional gain This relation is pure algebraic in both time and frequenc domain. The transfer function is also known as the P-controller (proportional gain controller). The step response is similar to the step function itself. (t) K and with (2.58) we arrive at the same result (2.56). The resulting transfer function (2.56) looks complicated but it can be often simplified. The example in fig. 2.9 gives the transfer function Fig 2.3: Step response of the proportional gain element t G CL = G = + G G 2 V T s+ + V T s+. (2.6) T 2 s The complicated form of (2.6) becomes much simpler when Numerator and Denominator are multiplied b (T s+)t 2 s T G CL = V 2 s. (2.6) T s + T2 s + V it can be easil seen that the closed loop sstem has a completel different structure than the open loop transfer function. If the open loop transfer function is real rational than the closed loop transfer function is real rational too. 3.2 Integrator = T i t u(τ)dτ + σ(t) (2.63) The value is the initial condition at time t =. The function σ(t) istheunitstepfunction σ(t) = for t < for t. (2.64) u T i 3 Elementar Transfer Functions Ever complex transfer function consists of elementar functions. Following is a list of elementar functions. The smbol is derived from the step response of the sstem. Fig 2.4: Integrator Examples: acceleration and speed of a mass, flow rate and tank level, voltage and current in inductance 3. Proportional gain = Ku (2.62) Integration in frequenc domain is merel division b s G(s) = T i s (2.65)

4 4 The step response is the product of the transfer function and σ(s) (s) = F(s)σ(s) = T i s s = T i s 2. (2.66) where δ(t) is the impulse or Dirac function. (t) Transformation back in time domain gives (() = ) (t) = t. (2.67) T i (t) T i t Fig 2.7: Step response of the differentiator The impulse function is infinite for t =. It is zero otherwise. It can be regarded as lim (t) (2.72) Á where (t) is the function in fig. 2.8. t Fig 2.5: Step response of the integrator (t) Á 3.3 Differentiation Á = T D du dt (2.68) Fig 2.8: Function (t) t Fig 2.6: u Differentiation T D The impulse function is a snthetic (pure mathematical) test function. The integral of (t) and δ(t) is (t)dt = δ(t)dt =. (2.73) Examples: current as function of voltage across a capacitor, speed as function of position Differentiation in frequenc domain is merel multiplicationb s (assuming u(t=) = ) G(s) = T D s. (2.69) The step response is the product of the transfer function and σ(s) 3.4 First Order Lag T d dt + = V u (2.74) (s) = F(s)σ(s) = T D s s = T D. (2.7) Transformation back in time domain gives u V T (t) = T D δ(t), (2.7) Fig 2.9: First Order Lag

42 43 The transfer function F(s) = V T s + is part of man processes. Step response: (s) = F(s)σ(s) = V T s + V T (2.75) s = s + s = A s + B (2.76) T s + T Thecoefficientsarecomputedas A = V and B = --- V so can be written as (s) = V s V s + T. (2.77) Backtransformation from frequenc domain into time domain gives (t) = V e t T. (2.78) Appling the differentiation rule give the Laplace transform T V s + = T D su + u. (2.8) The relation / u is the transfer function G(s) = u = T D s + T V s + The step response is simpl the product of G(s) and the step function σ(t) (2.8) (s) = G(s)σ(s) = T D s + T V s + s. (2.82) The function (2.82) can be decomposed to a sum of simpler expressions = T D s + T V s + s = T D s + T V s s + T V = T V A s + B s + T V. (2.83) Fig 2.2:.8.6.4.2 2 3 4 5 time t Step response of the first order lag The coefficients A and B are A = T D T + = T V, B = V T = T D T V. (2.84) V T V Finall, (2.83) can be written as = T D s + T V s + s = s + T D T V T V s +. (2.85) T V From this form a direct transformation to time domain can be carried out (t) = + T D T V T V e t T V (2.86) The step response depends on the relation of T D and T V. (fig. 2.2). 3.5 Lead-Lag Element Since the transfer function is a rational function it ma contain a s-polnomial in the numerator. A transfer function of first order with s in numerator and denominator is called a lead-lag-element. Sometimes this function is used as a controller. The differential equation is d T V dt + = T du D dt + u. (2.79)

44 45.6.4.2.8.6.4.2 Fig 2.2: T D =,5T V T D =,5T V 2 3 4 5 Step response of the lead-lag element The coefficients of the linear differential equation and the coefficient of the numerator and denominator polnomial of the transfer function are the same. The coefficients on the right hand side of the differential equation (associated with the input u of the sstem) appear in the numerator polnomial. The coefficients on the left hand side of the differential equation (associated with the output of the sstem) appear in the denominator polnomial. 4.2 Frequenc Response If the input of a linear sstem is sinusoidal than the output is also sinusoidal. 4 Frequenc Analsis of Transfer Functions The ke to stabilit analsis of closed loop sstems is the frequenc analsis of sstems. This is ver eas if the sstem has a transfer function representation. 4. General Form of a Real Rational Transfer Function We start from a linear differential equation of order n (input u, output ) Thefrequencoftheoutputsignalisexactlthesameastheinputfrequenc. This is true for ever linear sstem and therefore for ever transfer function. Of course, a pure sinusoidal signal on the output of a sstem can be observed onl for t. The sstem dnamics usuall cause transients which differ from the sinusoidal form. To illustrate this the following plot shows the response of the transfer function G(s) =.5s s 2 + s + 2. (2.9) (n) + an (n ) + + a ẏ + a.8 input output = b (m) (m ) m u + b m u + + b u. + b u. (2.87).4 Transforming (2.87) into time domain with all initial values and derivatives equal to zero gives s n + a n s n + + a s + a ---.4 = s m b m u + s m b m u + + sb u + b u, (2.88) ---.8 s n + a n s n + + a s + a = s m b m + s m b m + + sb + b u. (2.89) The general form of a real rational transfer function follows from (2.89) G(s) = b ms m + b m s m + + b s + b s n + a n s n + + a s + a. (2.9) Fig 2.22: 5 5 2 25 3 time t Output of G(s) for a sine input signal The output signal is not sinusoidal in the beginning but eventuall it became pure sinusoidal. For the input and output sine functions the differential equation (2.87) must be satisfied. The input and output signals ca be written as

46 47 u(t) = u^sin ωt, (t) = ^sin(ωt + Ô). (2.92) The calculations will become much easier when the complex form is used u(t) = u^ 2j e jωt e jωt, (t) = ^ 2j e j(ωt+ô) e j(ωt+ô). (2.93) The general form of the differential equation can be written as the two sums n k= a (k) k = m i= b i u (i), (2.94) where m n and a n =. The derivatives in (2.94) are simple when the form in (2.93) is used. Each derivative of the exponential functions is equal to the multiplication with the same complex factor. The n-th derivative of u(t) and (t) become (n) u = d n u u^ dtn = (jω)n 2j ejωt ( jω) n u^ 2j e jωt, (2.95) (n) d n ^ = dtn = (jω)n 2j ej(ωt+ô) ( jω) n ^ 2j e j(ωt+ô). (2.96) The derivatives in (2.94) can now be replaced ^ n 2j ej(ωt+ô) k= = u^ 2j ejωt m a k (jω) k ^ i= 2j e j(ωt+ô) n k= b i (jω) i u^ 2j e jωt m i= a k ( jω) k a i ( jω) i. (2.97) Splitting up (2.97) for positive and negative frequencies we obtain two equations which must be both satisfied ^ 2j ejωt e n jô k= ^ 2j e jωt e n jô a k (jω) k = u^ 2j ejωt m k= The ratio of output/input gives and ^ u^ e jô = m i= n k= i= a k ( jω) k = u^ 2j e jωt m b i (jω) i b i (jω) i, (2.98) i= b i ( jω) i. (2.99) a k (jω) k = G(jω), (2.) ^ u^ e jô = m i= n k= b i ( jω) i a k ( jω) k = G( jω). (2.) For negative frequencies (2.) we obtain obtain the same result as for positive frequencies (2.), so it is sufficient to consider positive frequencies. The sinusoidal transfer characteristic is given b evaluating the transfer function G(s) on the imaginar axis G(jω). The transfer function on the imaginar axis G(jω) is denoted as the frequenc response of a sstem. The frequenc response consists of the magnitude G(jω) and the phase Ô. For an given ω the value of G(jω) is a complex number The magnitude G(jω) := z = a + jb = z e jô. (2.2) G(jω) = z = ^ is the ratio of the output and input amplitude. The angle Ô = arctan b a = arctan Im G(jω) Re G(jω) u^ is the phase difference between output and input u signal (for sinusoidal signals). 4.2. Frequenc Response example The transfer function G(s) = 2s + on the imaginar axis jω is defined as the frequenc response (2.3) (2.4) (2.5) G(jω) = 2jω + = + j 2ω. (2.6) The magnitude becomes

48 49 G(jω) =. (2.7) 4ω 2 + The calculation of the phase is more complicated. We can multipl (2.6) b the complex conjugate of the denominator G(jω) = j 2ω + j 2ω j 2ω = j 2ω + 4ω 2. (2.8) The real and imaginar parts are Re G(jω) = + 4ω 2, Im G(jω) = j 2ω + 4ω 2. (2.9) Therefore the angle becomes Ô = arctan Im G(jω) Re G(jω) 4.3 Bode Diagram = arctan 2ω = arctan 2ω. (2.) The diagram G(jω) vs. w and Ô vs. ω is denoted as Bode diagram. For a better readabilit logarithmic scales are used. Bode diagram: Magnitude G(jω) [log] vs. ω [log], phase Ô vs. ω [log]. The Bode diagram for (2.6) is shown in fig. 2.23. G(jω) phase --- --- 2 --- 3 --- 2 --- 2 --- --- 2 --- 3 --- 4 --- 5 --- 6 --- 7 --- 8 --- 9 Fig 2.23: Bode diagram of the transfer function (2.5) 4.4 Nquist Diagram frequenc ω [rad/s] Another possible diagram of the frequenc response is the Nquist diagram. Nquist diagram: real part Re{G(jω)} vs. imaginar part Im{G(jω)}. The frequenc ω is the parameter of the curve. Ever point belongs to a specific frequenc ω. The Nquist diagram of the above example is drawn in fig. 2.24.

5 5 Fig 2.24: imaginar part. ---. ---.2 ---.3 ---.4 ---.5 ω Ô = π 4 ω = ω =.2.4.6.8 real part Nquist diagram The magnitude of G(jω) is the distance from the origin to the Nquist curve. The angle Ô can be measured from the real axis to the line from the origin to the Nquist diagram. Of course, Bode and Nquist diagram show the same results. As ω goes to the magnitude becomes zero and the phase Ô becomes -π /2. ω For ever zero q i the transfer function becomes zero, for ever pole p k the transfer function goes towards infinit lim G(s) =, lim G(s) =. (2.2) s q i s pk Ever polnomial can be written in the factored form P(s) = a n s n + a n s n + + a s + a = a n s p s p2 s p n (2.3) or, more compact P(s) = n a k s k = a n n s pk. (2.4) k= k= The pole-zero form of a transfer function is defined as G(s) = b m m s qi i= n s pk k=. (2.5) The conversion of a transfer function with nominator and denominator polnomial in pole-zero form requires calculation of the zeros of both polnomials. This is not a trivial task when the order n of a polnomial becomes greater than 2 or 3. 5 Poles and Zeros The transfer functions we have seen so far are real rational. The consist of a numerator and denominator polnomial. The zeros of the numerator polnomial are denoted as zeros of the transfer function. The zeros of the denominator polnomial are denoted as poles of the transfer function. The number of zeros of a polnomial is the same as the order of the polnomial, so general form of the transfer function G(s) = b ms m + b m s m + + b s + b s n + a n s n + + a s + a. (2.) has m zeros and n poles. For an phsical (so called causal) sstem m n holds. 5. Example: Transformation into Pole-Zero Form The transfer function G(s) = 3s2 + 3s 6 (2.6) s 3 + 4s 2 + 3s has zeros q =, q 2 = --- 2 and poles at p =, p 2 = ---, p 3 = --- 3. Since b m =3 the pole-zero form is G(s) = b 2 s q s q2 s p s p2 s p3 = 3(s )(s + 2) s(s + )(s + 3). (2.7) 5.2 Frequenc Response of the Pole-Zero Form The frequenc response of a sstem in pole-zero form gives deep insight into the role of the poles and zeros. Of course, the result is exactl the same as the frequenc of the transfer

52 53 function with nominator and denominator polnomials, but in can be understood much better. The frequenc response is defined as the transfer function on the imaginar axis G(jω) = b m m jω qi i= n jω pk k=. (2.8) The numerator consists of the product of all distances from the jω-axis to the zeros of the sstem. The denominator is the product of all distances from the jω-axis to allpoles ofthe sstem. In polar coordinates we get The diagram belongs to the transfer function G(s) = s + s 2 + 3s + 3.25 which has the zero q =- andthepoles p /2 = -,5±j. Each zero in left half plane causes a phase change of Ô =+π/2. Each zero in right half plane causes a phase change of Ô = --- π/2. (2.2) G(jω) = = b m m jω qi e jô i i= n. jω pk e jô k k= b m m jω qi i= n jω pk k= e j m Ô i n Ô i= k= k. (2.9) The frequenc response is the product of all distances from jω to all zeros divided b all products from jω to all poles of the transfer function. The resulting phase angle is the sum of the distances to the zeros minus all distances to the poles. This is illustrated b fig. 2.25. This diagram is called the s plane where s = σ+jω. The real part of s is denoted as σ and the imaginar part of s is denoted as ω. jω--- q p jω--- p jω--- p 2 p 2 q Ô p2 Im(s) jω s Re(s) Ô p Ô q Each pole in left half plane causes a phase change of Ô = --- π/2. Each pole in right half plane causes a phase change of Ô =+π/2. It does not matter if a pole or zero is real or complex conjugate. The Bode diagram of (2.2) verif the above statements. Phase (deg) Magnitude (db) --- 5 --- --- 5 --- 2 --- 25 45 --- 45 --- 9 --- Frequenc (rad/sec) Fig 2.25: Frequenc response of the zero-pole form Fig 2.26: Bode diagram for (2.53)

54 55 5.3 Dependenc of the Magnitude of the Bode Diagram on the Zeros and Poles Since the magnitude of the Bode diagram is the evaluation of the transfer function on the imaginar axis G(jω). The influence of the zeros and poles of the transfer function can be seen if the magnitude of G(s) is plotted over the s plane. 5.3. All-pass Transfer Function An important tpe of function is the so-called all-pass function. An all-pass function has a magnitude of one for all frequencies (thus the name). Poles and zeros are smmetric with respect to the imaginar axis. It can be easil determined since it has the form N( s) G(s) =. (2.2) N(s) An example is the 2nd order transfer function which satisfies (2.2) poles G(s) = s2 s +.25 s 2 + s +.25. (2.22) The zeros (zeros of the numerator polnomial) are q 2 =.5 j (2.23) zero imaginar axis and the poles (zeros of the denominator polnomial) are p 2 =.5 j (2.24) Fig 2.27: Magnitude of G(s) The zero causes a hole in the surface and ever pole creates a mountain. The intersection of the surface with the imaginar axis (σ = ) gives the Bode diagram. From the diagram a ver important rule can be derived: imaginar axis The pole nearest to the imaginar axis has the greatest impact on the Bode diagram and therefore affects the sstem behavior more then other poles. This poles are called the dominating pole (or complex conjugate pole pair, respectivel). The zero nearest to the imaginar axis has the greatest impact on the Bode diagram and therefore affects the sstem behavior more then other zeros. This zero are called the dominating zero (or complex conjugate zero pair, respectivel). Since we have onl one complex conjugate pole pair and onl one zero the definition of the dominating poles and zeros makes no sense here. Fig 2.28: Magnitude of G(s) Although the poles and zeros have a great impact on the magnitude of G(s) themagnitude on the imaginar axis, i.e. the frequenc response is equal to one for all frequencies. However, the phase change is 36 for the frequenc range from to. This is shown in the Bode diagram 2.29.

56 57 Phase (deg) Magnitude (db).8.6.4.2 ---.2 ---.4 ---.6 ---.8 --- --- 9 --- 8 --- 27 velocit of the conveor belt is v than the output q 2 has exactl the same form as q. In mathematical terms we can write q 2 (t) = q (t T D ). (2.25) q v c(x, t) q 2 Fig 2.29: --- 36 --- 2 Frequenc (rad/sec) Bode diagram of the all-pass function Thestepresponseinfig.2.3showsthetimedomainpropertiesof G(s). Amplitude Fig 2.3:.4.2.8.6.4.2 ---.2 2 4 6 8 2 Time (sec) Step response of the all-pass function An all-pass function is ver difficult to control since it seems operate in the wrong direction. 6 Non Real Rational Transfer Functions A special transfer characteristic occurs for transportation processes (in a pipeline for instance). Fig. 2.3 shows an example, where a material is moved b a distance d. If the d Fig 2.3: Example for a transportation process: conveor belt The dead time T D is the time needed for the transportation along the distance d T D = d v. (2.26) The transfer function can be derived from the Laplace transform definition x(s) = x(t)e st dt. (2.27) We obtain for q 2 (s) = q (t T D )e st dt. (2.28) Substituting t--- T D b τ gives (lower bound of integral becomes τ = --- T D ) q 2 (s) = q (τ)e s(τ+td) dτ = q e std (τ)e sτ dτ. (2.29) T D T D Since q (τ) = for τ < we arrive at q 2 (s) = e st D q (τ)e sτ dτ = e st q (s). (2.3)

58 59 Thus, the transfer function for a dead time process becomes G(s) = e st D. (2.3) This is a transcendental function. For s = jω the frequenc response G(jω) = e jωt D. (2.32) is shown in fig. 2.32. Phase (deg) Magnitude (db) Fig 2.32: 8 6 4 --- 2 2 --- 4 --- 6 --- 8 --- --- 45 --- 9 --- 35 --- 8 --- Frequenc (rad/sec) Frequenc response of a dead time process The magnitude remains unit while the phase dela increases unlimited with frequenc. 7 Stabilit The most important propert of a sstem is stabilit. There are several definitions of stabilit. A practical definition is the BIBO stabilit (bounded input bounded output): BIBO stabilit: A sstem is BIBO stable if the sstem responds with a bounded output when the input is bounded. If the input and output of a sstem satisf u(t) M, (t) M 2 t (2.33) and M and M 2 positive and bounded than the sstem is BIBO stable. In general, BIBO stabilit is difficult to prove. A widel used sufficient condition for stabilit is the Lapunov stabilit theor. However, the results from one nonlinear sstem cannot be transferred to another sstem; each sstem must be tested individuall. For a linear sstem the BIBO stabilit is equivalent to the following test: A linear sstem is BIBO stable iff the integral the sstem s impulse response magnitude is bounded. Let g(t) the step response of the sstem then g(t) dt < (2.34) must hold. If we use the the transfer function in zero-pole form G(s) = b m m s qi i= n s pk k= (2.35) the impulse response is the same as G(s) because of the impulse function δ(s) =. Splitting (2.35) up to elementar functions gives g(s) = G(s) = n A k (2.36) s p k k= (if all poles are distinct). If multiple poles occur the proof is more complicated but give the same result. The time domain function becomes g(t) = L g(s) = n Ae p k t. (2.37) k= It is obvious that (2.34) is finite iff all poles p k have negative real parts. A linear sstem is stable iff all poles are in the left half plane. In other words: if an pole is in the right half plane, the sstem is unstable. An example for an unstable sstem is G(s) = s 2.2s +.. (2.38)

6 6 The poles d p 2 =. j (2.39) are in the right half plane so the sstem is unstable. The can be seen also from the impulse response g(t). w --- e K u G Amplitude Fig 2.33: 8 6 4 2 --- 2 --- 4 --- 6 --- 8 --- 5 5 2 25 Time (sec) Impulse response Fig 2.35: Closed loop The most important closed loop transfer functions are from w to and from d to (the controlled variable) = KG + KG w, (2.4) = G + KG d. (2.4) All closed loop transfer functions have the common factor +KG =+G OL (the open loop function G OL is the product of all open loop transfer functions). To analze the closed loop stabilit the poles of the closed loop sstem can be calculated. If all poles are in the left half plane than the closed loop sstem is stable. 8. Example: Stabilit of a Closed Loop sstem Process 8 Closed Loop Stabilit We have analzed the stabilit of an open loop sstem (all poles must be in the left half plane). In a controlled sstem the loop is closed. This changes the behavior of the sstem and, of course, changes the zeros and poles. The standard problem is shown in fig. 2.34. Fig 2.34: e K Transfer functions in open loop u d K is the controller and G is the process to be controlled. The signal d is an assumed disturbance signal. Closing the loop introduces a new input w which is the reference value. G G = (s + ) 3 (2.42) Controller (proportional controller) K = 4. (2.43) The open loop function becomes G OL = KG = 4 (s + ) 3 (2.44) and thus the closed loop transfer function from w to gives G OL 4 (s+) 3 G CL = = + G OL + 4 The denominator polnomial becomes (s+) 3 = 4 (s + ) 3. (2.45) + 4

62 63 N(s) = (s + ) 3 + 4 = s 3 + 3s 2 + 3s + 5. (2.46) The poles of the closed loop sstem (zeros of N) are p = 2.587, p 2 3 =.26 j.375. (2.47) The step response of (2.45) is badl damped but stable. Amplitude Fig 2.36:.4.2.8.6.4.2 5 5 2 25 3 Time (sec) Step response of the controlled sstem A much better performance is obtained b the controller Amplitude K =.2 s + s. (2.48).4.2.8.6.4.2 2 4 6 8 2 4 6 8 Time (sec) Fig 2.37: Closed loop with controller (2.48) The closed loop sstem reaches ver fast the final value (exactl the reference value without stead state error) and shows an excellent damping. 8.2 Closed Loop Stabilit and the Nquist Diagram It seems to be a ver demanding task to find a suitable controller since the calculation of the closed loop is a complicated function G CL = T := KG + KG. (2.49) This important transfer function is denoted as T(s). Nquist found a surprisingl simple solution to this problem. The approach is based on the Nquist diagram of then open loop transfer function KG. The Nquist diagram is a plot of real and imaginar part of a transfer function on the imaginar axis jω. It is eas to see that T(s) becomes infinite if the denominator +KG becomes zero. This happens for KG(jω) =. (2.5) In other words: if KG(jω) has a magnitude of and a phase of 8 then T(jω) becomes infinite. Obviousl the --- is the critical point in the Nquist diagram of KG, i.e. the Nquist diagram of the open loop sstem. The important contribution of Nquist is that the closed loop stabilit can be concluded from the open loop Nquist diagram. --- Im.5 ---.5 --- ---.5 --- 2 --- 2.5 KG --- 3 --- ---.5.5.5 2 2.5 3 3.5 4 Fig 2.38: Nquist diagram of (2.44) ω Re

64 65 Fig. 2.38 shows the open loop Nquist diagram from ω =to. It can be easil seen that the curve does not touch the critical point ---. Nquist rule (. version): The closed loop sstem is stable when the Nquist curve does not encircle or reach the point ---. The Nquist rule can be explained (no mathematical proof) from the mapping propert of the transfer function KG. Ever pole p k of the close loop sstem maps KG(p k ) to --- (the closed loop transfer function becomes infinite). If all poles of the closed loop are in the left half plane the map of the imaginar axis jω results in a curve left of the point ---. The process (2.42) with a gain of 5 has the following open loop Nquist diagram of KG. Im --- --- 2 --- 3 --- 4 --- 5 --- 6 --- 7 --- 8 --- --- 9 --- 4 --- 2 2 4 6 8 2 Fig 2.39: Nquist diagram for a controller gain K =5 As can be seen on the closed loop step response on the following figure, the closed loop is unstable. This can also be seen from the open loop Nquist diagram since the point --- is encircled b the Nquist curve. Re Amplitude 8 6 4 2 --- 2 --- 4 --- 6 --- 8 2 4 6 8 2 4 6 Time (sec) Fig 2.4: Closed loop step response for a controller gain K =5 Without proof the following is the complete Nquist rule (includes the. version). Nquist rule: The closed loop sstem is stable when the Nquist curve encircles the point --- p/2 times, where p is the number of open loop unstable poles. The. version of the Nquist rule is for stable open loop sstems onl. Since the majorit of control problems are open loop stable, the first version of the Nquist rule is often sufficient. 8.3 Phase and Gain Distance The Nquist diagram does not onl answer the question if a closed loop sstem is stable or not. Two parameters describe the degree of stabilit : the gain and the phase distances. A good indicator for stabilit from the Nquist diagram is the nearest distance from the point --- to the Nquist curve. Unfortunatel this distance is hard to calculate. Therefore we will use two eas computable measurements of stabilit.

66 67 Im 9 Controller Design b Specification of Gain and Phase Distances The Nquist rule and especiall the gain and phase distances allow the controller design based on the open loop transfer function. There are two rules for a good performance control sstem. The can be derived from the closed loop and open loop transfer functions Ψ d ωd Re G OL = KG, G CL = T := G OL + G OL = KG + KG. (2.53). Make G OL (jω) =KG(jω) as large as possible. This follows from the closed loop transfer function. The theoretical optimum is Fig 2.4: Phase distance T(jω) =, (2.54) The phase distance Ψ d is the angle from the real axis to the angle where the magnitude of G OL becomes. The frequenc where G OL becomes one is denoted as ω d which is achieved for G OL (jω). Remember that T is the transfer function from reference value to the controlled variable. Ψ d := π + Ô(ω d ), G OL (ω d ) =. (2.5) Im w e K T(s) u d G r d --- ω π Re Fig 2.43: Closed loop and definition of T(s) The other purpose of control is minimizing the effect of disturbance signals d. Let us look at the transfer function from d to = G + KG d. (2.55) It is obvious that G OL (jω) =KG(jω) would also be a perfect solution. Fig 2.42: Gain distance The gain distance r d is the distance from --- to the crossing point of the Nquist curve with real axis. The frequenc where Ô becomes --- π is denoted as ω π r d := + G OL (ω π ), Ô(ω π ) = π. (2.52) With large Ψ d and r d the closed loop stabilit increases.

68 69 d G + KG Ô = 3arctan(ω). (2.6) The calculation of w --- e K u G r d := + G OL (ω π ), Ô(ω π ) = π. (2.6) requires ω π. For this frequenc is phase angle becomes -π Ô(ω π ) = 3arctanω π =! π. (2.62) Fig 2.44: Closed loop and definition of G + KG Unfortunatel stabilit requires a second rule which makes the controller design nontrivial. 2. Keep the Nquist diagram as far as possible from the critical point ---. Use the gain distance and phase distance as a quantitative measurement for the second rule. 9. Example: Controlling a 3. Order Lag with a Proportional Controller A process where temperature can be changed b heating or cooling can often be described b a 3. order lag model. For simplicit we assume the process (example from section 8.2) G(s) = (s + ) 3. (2.56) The controller is a P-tpe controller with onl one parameter K(s) = V R. (2.57) The open loop transfer function becomes V R G OL = KG = (s + ) 3. (2.58) Therefore ω π = tan π 3 =.732. (2.63) For this frequenc KG(jω π ) becomes and thus V R KG(jω π ) = + ω 2 π 3 (2.64) r d = + KG(ω π ) = + ω 2 3. (2.65) π This is a design equation for V R = rd + ω 2 3 π With the values for r d and ω p get get V R (2.66) V R = (.8) +.732 2 3 =.6. (2.67) Following are the Nquist diagram and the step response of the closed loop sstem. From the first rule V R should be made ver large. According to the second rule V R is limited because if V R becomes to large the Nquist curve touches ---. 9.. Design K for Gain Distance r d =.8 The calculation of the gain distance requires the magnitude and phase of KG(jω) V R KG(jω) = + ω 2 3, (2.59)

7 7.2 ---.2 ---.4 ---.6 ---.8 --- ---.2 ---.4 ---.2.2.4.6.8.2.4.6 Fig 2.45: Nquist diagram (r d =.8) Fig 2.46: Amplitude.8.7.6.5.4.3.2. 5 5 Time (sec) Step response of the closed loop sstem 9..2 Design K for Phase Distance Ψ d = π/3 In man cases a phase distance of π/3 is considered to be sufficient. We need the frequenc ω d where KG(jω d ) becomes unit V R KG(jω d ) = + ω 2 3 =! (2.68) d The phase distance is Ψ d =! π 3 = π 3arctanω d. (2.69) Solving for ω d gives ω d = tan 2π 3 3 =.839. (2.7) With (2.68) we can solve for Fig 2.47: Amplitude Fig 2.48: V R =.2 ---.2 ---.4 ---.6 ---.8 --- ---.2 ---.4 ---.6 Ψ d + ω 2 d 3 = 2.225. (2.7) ---.8 --- ---.5.5.5 2 2.5 Nquist diagram (Ψ d = π/3).9.8.7.6.5.4.3.2. 2 4 6 8 2 4 6 Time (sec) Step response of the closed loop sstem The damping is quite low. A greater phase distance would increase stabilit and therefore the damping.

72 73 2 Controller Design K(s) = V R u V R Most controller design methods are open loop designs. Our two design rules. Make G OL (jω) =KG(jω) as large as possible. Fig 2.5: Proportional controller 2. Keep the Nquist diagram as far as possible from the critical point ---. K(s) = T i s u T i refer also to the open loop transfer function KG. The design process can now be formulated: Fig 2.5: Integral controller S S Find a controller K so that the product KG becomes ver large. A high controller gain is therefore desirable. The controller should keep the Nquist diagram awa from the --- b appropriate gain and appropriate phase. Fig 2.52: T K(s) = D s T * s + Differential controller u T D 2. Controller Tpes In general a controller can b an suitable transfer function. However, some controller tpes are standard and exist as prebuild industr controllers. These standard controller cover the majorit of control tasks (more than 9% of all applications). The differential controller is never used as a controller but it is often a part of combinations of the above elements. The time constant T * is small compared to T D but necessar because the numerator order must not be greater than the denominator order (causal sstem restriction). The P, I, and D controllers are often used in combination. Combination means parallel operation (addition) not serial connections. The most popular tpes are PI, PD, and PID. PI controller: The controller is the resulting sum of a P and an I controller K(s) = V R + T i s = V R T i s +. (2.72) T i s The PI controller has a negative real zero and a pole in the origin. The standard notation of the PI controller is K(s) = V R T n s + T n s u V R T n Fig 2.49: Siemens industr controller The standard controllers are PID tpes, where the letters stand for P proportional I integral D derivative Fig 2.53: PD controller: PI controller The controller is the resulting sum of a P and a D controller K(s) = V R + T D s T * s + = V R T * + T D s + VR T *. (2.73) s +

74 75 The PD controller has a negative real zero and a negative pole. The standard notation of the PD controller is Fig 2.54: PID controller: K(s) = VR T D s + T s + PD controller The controller is the resulting sum of a P, I and a D controller K(s) = V R + T i s + T D s T * s + u T D T = V R T I T * + T D T i s 2 + VR T i + T * s + T i s T * s +. (2.74) The PD controller has two zeros with negative real parts (possibl complex) and a negative pole. The standard notation of the PD controller is write with two real zeros Fig 2.55: K(s) = V R TD s + TV s + T i s T * s + PID controller 2.2 Selecting the Suitable Controller Foragivenprocessapropercontrollertpehastobefound.Asaruleofthumbahigher order process requires a higher order controller (this follows also from the theor of optimal controllers). Some design guidelines help us to find out a good controller tpe: () Use a controller with integral action (integrator). (2) Make the open loop sstem as simple as possible (pole-zero-cancellation). Guideline () ensures stead-state accurac. An integrator has unlimited gain for frequenc (an integrator has a pole at zero). This makes makes the Nquist diagram infinite (highl desirable). But we must ensure that the Nquist diagram does not encircle or pass through the point ---. u Guideline (2) simplifies the design process. If the open loop sstem KG is simple than an closed loop sstem becomes also simple. If the closed loop sstem has an order > 2 than an analtic solution becomes difficult. We can solve the design process for high order sstems analticall b using the Nquist diagram or the calculation of the closed loop poles. The numerical computation of phase and gain distances is alwas possible. If the closed loop sstem is first order than the closed loop pole can be placed anwhere in the left half plane. The position of the pole determines the closed loop sstem speed. The real part of the closed loop pole determines the controlled sstem speed. If the sstem is made too fast the actuator value become unrealisticall high. If the closed loop sstem is 2nd order than the denominator of the closed loop sstem can be compared to the standard 2nd order form or s ω 2 + 2D s ω + ω 2 s 2 + 2Dω s + ω 2 (2.75), (2.76) respectivel. Suitable values for D are greater than 2. The natural frequenc ω determines the speed of the closed loop sstem. The natural frequenc ω determines the controlled sstem speed. If the sstem is made too fast the actuator value become unrealisticall high. 2.3 Standard Configurations The following standard problems show the application of the above design guidelines. 2.3. First Order Sstem A first order sstem has the parameters gain and time constant (or pole) G(s) = V T s +. (2.77) Possible controller tpes are P, I and PI. The PI controller offers the possibilit to cancel the pole be a controller zero. The process pole is replaced b a pole in the origin. As an examplewewilldesignan I-controller

76 77 K(s) = T i s. (2.78) The closed loop sstem becomes V T = KG + KG = T i s T s+ = + V T i T T i s T s+ s 2 + T i s + V = T i T s V 2 + T. (2.79) i s + V The denominator can be compared to the standard form (2.75) ω 2 = T i T, V V T i V = 2D ω. (2.8) Solving (2.8) for D (and replacing of ω ) gives D = T i. (2.8) 2 V T This is a design equation for V if (2.8) is written in the form T i = 4D 2 V T (2.82) 2.3.2 Integrator Process Integrator processes occurs if a tank is filled or a thermall insulated reactor is heated up. The transfer function is G(s) = (2.83) T s An integrating controller is difficult to design because the second integrator (of the controller) would cause a phase shift of ---π. Itis verlikel thatthe Nquistrule isviolated. Suitable controllers for in integrator process are P- or PD-controllers. The closed loop sstem of (2.83) with a P- (proportional) controller becomes K = V R (2.84) T = KG + KG = The closed loop pole V R T i s + V R T i s = V R =. (2.85) T i s + V T R i s + V R p = V R (2.86) T i can be placed anwhere in the left half plane (positive controller gain). The closed loop step responses (T i =) for p = --- 2 (V R =2) and p = --- (V R = ) are shown in the following figures. 2.8.6 actuator value u.4.2 controlled variable.8.6.4.2.5.5 2 2.5 3 3.5 4 4.5 5 time t Fig 2.56: Closed loop sstem step response (V R =2) 9 8 7 6 actuator value u 5 4 3 2 controlled variable.5.5 2 2.5 3 3.5 4 4.5 5 time t Fig 2.57: Closed loop sstem step response (V R = ) The closed loop sstem with V R = ismuchfasterthanwith V R = 2 but the actuator value is possibl much too high (peak is ). 2.3.3 Second Order Sstem The second order sstem is the most complex sstem where an analtic solution can be found. Suitable controllers are P-, PI- and PID controllers. The reason wh high order controller can be used is the possibilit of pole-zero-cancellations.

78 79 An example for pole-zero-cancellation is the 2. order lag transfer function G = T s + T2 s + and the PI-controller K = V R T n s + T n s (2.87). (2.88) From the rule (2) it is advisable to simplif the open loop transfer function T KG = V n s + R T n s T s + T2 s +. (2.89) B choosing Tn = T or T n = T 2 we cancel a pole of the process with a zero of the controller. The remaining open loop sstem lead to a simple closed loop sstem which can be easil designed. Usuall T n is made equal to the greatest time constant (the greatest dela). Let us assume T 2 > T, thus T n becomes T 2. The remaining open loop transfer function is simpl V R KG = T n s T s +. (2.9) This is essentiall the same problem as in 2.3.. The closed loop becomes V R T = T n T s 2 = + T n s + V R T n T s V 2 + T n s + R V R. (2.9) The comparison with the standard 2nd order transfer function (2.75) gives D = T n (2.92) 2 V R T or V R = 4D 2 T n T. (2.93) Since T n = T 2 (2.93) becomes finall V R = 4D 2 T 2 T. (2.94) The step response of the closed loop is shown in fig. 2.58. The plant was G = (s + )(3s + ). (2.95).4.2.8.6.4.2 actuator value u controlled variable 5 5 time t Fig 2.58: Closed loop step response for D =.8 2.3.4 Other Sstems Sstems which do not fall into the last categories are harder to control. Several methods exist for finding a more or less good controller. S S S S S Use advanced powerful controller design methods (developed in the 8 s and 9 s). Tr to shape the Nquist diagram with appropriate controllers. Experimental controller parameter tuning (ver popular in industr). Use Fuzz control (closel related to the approach above). Use heuristic approximations (Ziegler-Nichols, Chien-Hrones-Reswick, Oppelt, to name a few). These methods are also ver popular in industr. 2 Heuristic Methods Heuristic methods are non-mathematical methods to derive the parameters of a controller. The rules have been found b a large number of experiments. Man applications have shown that these rule can lead to functional control sstems. Heuristic methods are widel used in process control. However, the methods are approximations and there is alwas a risk that the control sstem will not work properl. The heuristic methods are ver eas to appl. In some industrial controller the are implemented as auto-tuners. These controllers have a build-in mechanism to measure step responses of a process and tune itself automaticall after evaluating the step response.

8 8 2. T u -T g -Methods (T u -T -Methods) These methods use two characteristic values of a measured step response. The values are denoted as T u and T g. step response (t) V G Fig 2.59: Measurement of T u and T g 2. derivative becomes zero T u T g time t The measurement of T g make onl sense if the step response reaches a final value. An additional parameter is V G, the stead-state process gain. For sstems with unlimited step response (integrating sstems) the quantit T is used instead. step response (t) k i T 2. derivative becomes approximatel zero T u T time t Fig 2.6: Measurement of T u and T for integrating processes The parameter T can be found b a geometric construction as in fig. 2.6. Once T u -T g or T u -T have been determined the controller parameters can be looked up in a table. We will use the famous Oppelt-rules wich are derived especiall for chemical processes. Table A: Oppelt-rules for non-integrating processes = T u -T g -rules Controller tpe gain integration time constant derivative time constant PD V R =.2T g /(T u V G ) T D =.22-.5 T u PID V R =.2T g /(T u V G ) T n =2T u T D =.42T u Table B: Oppelt-rules for integrating processes = T u -T -rules Controller tpe gain integration time constant P V R =.5/(k i T u ) PI V R =.42/(k i T u ) T n =5.8T u derivative time constant PD V R =.5/(k i T u ) T D =.5T u PID V R =.4/(k i T u ) T n =3.2T u T D =.8T u Remark: the assumed (ideal) PID controller is defined here as K(s) = V R + T n s + T D s. (2.96) 2.2 Ziegler-Nichols-Tpe Methods Ziegler-Nichols design rules are ver clever and work quite well in practical applications. However, the necessar experiments for the design process are not allowed in man cases, because it becomes necessar to destabilize the closed loop! Ziegler-Nichols assumes the same (ideal) PID controller (2.96) as Oppelt. The gave also rules for tuning a PI controller. Ziegler-Nichols tuning begins with a proportional controller, who s gain is increased until undamped oscillations occur. --- K = V krit real process G T krit Controller tpe gain integration time constant P V R = T g /(T u V G ) PI V R =.8T g /(T u V G ) T n =3T u derivative time constant Fig 2.6: Proportional gain controller with variable gain The gain where undamped oscillations occur is denoted as V krit the period of the oscillation is denoted as T krit. When these quantities are known the controller parameters can be looked up in the following table.

82 83 Table C: Ziegler-Nichols tuning rules Controller tpe gain integration time constant PI V R =.45V krit T n =.85T krit derivative time constant Lab PID V R =.6V krit T n =.5T krit T D =.2T krit 22 Level Control of an Uncoupled Three-Tank Sstem 22. Mechanical Control of the Simplified Sstem Fig. L. shows the tank level control of the last tank in a three-tank sstem. The input is the input flow rate into the first tank. The output of one tank is the input to the next stage. The output flow of the last tank can be regarded as a disturbance signal. ::: Fig L.: Level control of an uncoupled three-tank sstem Each tank can be described b the differential equation

84 85 dh i+ = q dt i q i+i, q i+ = ch i+. (L.) The tank level h 3 is the control variable which is feed back to the controller. The controller in the first simulation (E IRT, RWTH Aachen) is a mechanical realization (proportional gain controller). The gain can be adjusted b the position of the joint. The reference value is the height of the joint (cannot be changed). a) Investigate the sstem properties for different controller gains. What happens when the controller gain is small? What happens when the controller gain becomes high? What is is the optimal gain? Lab 2 23 Frequenc and Time domain and Analsis of LTI (Linear Time Invariant) Sstems 22.2 P and I Control of the Complete Nonlinear Sstem The following block diagram shows the closed loop level control of the three tank sstem. Subsstems are used to describe the nonlinear behavior of each tank. a) Investigate the influence of poles and zeros on the properties of the sstem Use ictools -> Analsis of linear Sstems. Pole-zero configurations: --- real pole --- complex pole pair --- real pole and real zero --- complex pole pair and complex real pair Fig L.2: Simulation of the controlled sstem with P- and I-tpe controllers b) Use the Matlab ltiview and the command sinresp (from the course home page) and analze the following transfer functions: G = 2 G =. G = 2 G = s G = s + 2 G = 2s + s + G = s 2 + G = s 2 +.3s + G = s 2 + s a) Select the proportional (P) controller (b using the manual switch)) and find the optimal gain parameter. b) Select the integral (I) controller and tune the integral gain parameter. c) Discuss the results for the proportional controller and the integral controller.