process control

261

Upload: lunokhod-rover

Post on 22-Jan-2016

390 views

Category:

Documents


2 download

DESCRIPTION

Process Control

TRANSCRIPT

Page 1: Process Control

Introduction toProcess Control

GOAL� To give an introduction to and motivation for why process

control is important in chemical process industry�

��� Introduction

Process control is very important in chemical process industry� It is necessaryto use control to operate the processes such that the energy� and raw materialsare utilized in the most economical and e�cient ways� At the same time itis necessary that the product ful�lls the speci�cations and that the processesoperate in a safe way� In this chapter we will give an overview of what ismeant by control and give examples of how process control is used in chemicalplants� Section ��� gives a short overview why control is necessary and howit is used� The idea of feedback is introduced in Section ���� To be able todesign control systems it is necessary to understand how the processes work�Models of dierent kinds and complexities are thus of great importance� This isexempli�ed in Section �� using some typical unit operations� Typical processcontrol concepts are illustrated using a simple example in Section ���� Anoverview of the course is given in Section ����

��� Why Control�

In a control system the available manipulated variables are used to ful�ll thespeci�cations on the process output despite in uence of disturbances� SeeFigure ���� The variables of the process that are measurable are called processoutputs� The variables that are available for manipulation are called processinputs� The desired performance of the system or plant can be speci�ed interms of a desired value of the output� This is called set point or referencevalue� The performance of the system is also in uenced by measurable or�most commonly� unmeasurable disturbances� The task of the controller is todetermine the process input or control signal such that the performance of

Page 2: Process Control

� Chapter � Introduction to Process Control

ReferenceInput

Controller Process

Disturbance

Output

Figure ��� A simple feedback system�

the total system is as good as possible� The performance can be measured inmany dierent ways� For instance� we may want to minimize the variation inthe output or minimize the energy consumption�

The main idea of process control is feedback� which implies that the mea�sured signals are used to calculate the control signals� I�e�� that informationis fed back into the process� This turns out to be a very important and usefulconcept that frequently can be used� In our daily life we are surrounded bymany dierent control systems� Examples are�

� Thermostats in showers

� Heating and cooling systems in buildings

� Temperature and concentration controls within the human body

� Frequency and voltage control in power network

� Speed and path following when riding bikes or driving cars

Some of these control systems are easy to understand and explain while othersare very di�cult to analyze� but they are all based on the idea of feedback�

A control system in a chemical plant has many dierent purposes�

� Product speci�cations� The outgoing product must ful�ll the speci�cationswith respect to� for instance� quality or purity�

� Safety� The plant must be operated such that the safety regulations forpersonnel and equipment are met�

� Operational constraints� Due to environmental and process considerationsit is necessary to keep certain variables within tight bounds�

� Economical� The control system must ensure that energy and raw mate�rials are used as economically as possible�

These tasks can be seen as plant�wide goals that must be ful�lled� To do so itis necessary to divide the operation of the plant into subtasks and subgoals�These are then further subdivided until we reach the bottom line� which con�sists of simple control loops with few inputs and outputs and with quite wellde�ned goals� The main building blocks in process control are simple feedbackcontrollers� The purpose of the course is to develop an understanding for howthese building blocks can be used to create a control system for a large plant�

Process design

The purpose of the process design is to determine suitable operational condi�tions for a plant or unit process� Examples are concentrations of feed� temper�atures� and through�put� These conditions may then determine sizes of tanksand pipes in the plant� The process design must also be done such that the

Page 3: Process Control

��� Why Control� �

25 75

50

Heater Mixer Thermocouple

PowerAmplifier

Measurement

Difference

ErrorDesired temperature

Figure ��� A simpli�ed picture of a thermostat for heating of water�

process has su�ciently degrees of freedom for control� This means that thecontrol system has su�ciently many signals that it can be manipulated suchthat it is possible to maintain the plant at the desired operational points� Thepossibility to make good control is very much in uenced by the process design�A good design will help the control engineer to make a good control system� Abad design can on the other hand hamper the construction of a good controlsystem for the plant� It is therefore important that control aspects are takeninto consideration already at the design stage of the processes�

Optimization and constraints

In the process design we try to �nd the optimum operating conditions forthe process� The optimization has to be done with respect to e�ciency andeconomy� The optimization also has to be done within the constraints for theprocess� It is usually done on a plant�wide basis� The control system is thendesigned to keep the process at the desired operation point�

The wonderful idea of feedback

The main purpose of a typical control system is to assure that the outputsignal is as close to the reference signal as possible� This should be donedespite the in uence of disturbances and uncertainties in the knowledge aboutthe process� The main advances of feedback are

� Makes it possible to follow variations in the reference value�

� Reduces the in uence of disturbance�

� Reduces the in uence of uncertainties in the process model�

� Makes it possible to change the response time of the closed loop systemcompared with the open loop system�

��� Feedback Systems

The idea of feedback will be illustrated using two examples�

Example ����ThermostatA simpli�ed picture of a thermostat is shown in Figure ���� The purpose of thethermostat is to keep the temperature in the water constant� The temperatureof the water is measured using a thermocouple� The thermocouple gives anelectrical signal that is compared with an electrical signal that represents thedesired temperature� The comparison is made in a dierential ampli�er� Thisgives an error signal that is used to control the power of the heater� Theheater can be controlled by a relay or contactor in which case the power is

Page 4: Process Control

� Chapter � Introduction to Process Control

Watertemperature

Σ+

_

Power

WaterAmplifier

Error signalDesiredtemperature

Figure ��� Block diagram of the thermostat in Figure ����

Σ Controller Processe u x y

d

Σ

−1

yr

Figure ��� Block diagram of a simple feedback system�

switched on or o� To obtain a better control the heater can be controlledby a thyristor� It is then possible to make a continuous change in the power�The thermostat is an example of a feedback system� where the control signalis determined through feedback from the measured output� The feedback isnegative since an increase in the water temperature results in a decrease inthe power�

To describe processes from a control point of view we often use blockdiagrams� Figure ��� shows a block diagram for the thermostat system� Theblock diagram is built up by rectangles and circles� which are connected bylines� The lines represents signals� The rectangles or blocks show how thesignals in uence each other� The arrows show the cause�eect direction� Thecircle with the summation symbol shows how the error signal is obtainedby taking the dierence between the desired temperature and the measuredtemperature� Notice that one symbol in the block diagram can representseveral parts of the process� This gives a good way to compress informationabout a process� The block diagram gives an abstract representation of theprocess and shows the signal �ow or information �ow in the process�

The example above shows how a simple control system is built up us�ing feedback� The next example gives a more quantitative illustration of thebene�ts with feedback�

Example ����Simple feedback systemConsider the process in Figure ��� Assume that the process is described by apure gain Kp� i�e�

y � x� d � Kpu� d �����

where d is an output disturbance� The gain Kp determines how the controlsignal u is ampli�ed by the process� Let the desired set point be yr � One wayto try to reach this value is to use the control law

u � Kcyr �����

with Kc � ��Kp� The output then becomes

y � yr � d

Page 5: Process Control

��� Feedback Systems �

The control law ����� is an open loop controller� since it does not use themeasurement of y� We see� however� that the controller does not reduce theeect of the disturbance d� Further� if Kc is �xed� a change in the processgain from Kp to Kp ��Kp will change the output to

y � �� ��Kp

Kp�yr � d

The error between the desired value and the output is then

e � yr � y � ��Kp

Kpyr � d

This implies that a ��� change in Kp results in a ��� change in the error�i�e�� there is no reduction in the sensitivity to errors in the knowledge aboutthe process�

Let us now measure the temperature� calculate the deviations from thedesired value and use the controller

u � Kc�yr � y� � Kce �����

This is a proportional controller� since the control signal is proportional to theerror e between the reference value and the measured output� The controller����� is also a feedback controller with negative feedback from the measuredoutput� The proportional factor Kc is the gain of the controller� The totalsystem is now described by

y � Kpu� d � KpKc�yr � y� � d

Solving for y gives

y �KcKp

� �KcKpyr �

�� �KcKp

d ����

The control error is given by

e � yr � y ��

��KcKpyr � �

� �KcKpd �����

From ���� it follows that the output will be close to the reference value if thetotal gain Ko � KcKp is high� This gain is called the loop gain� Further theerror is inversely proportional to the return di�erence Kd � � �KcKp� Theloop gain can be interpreted in the following way� Assume that the processloop is cut at one point �the loop is opened� and that a signal s is injected atthe cut� The signal that comes back at the other end of the cut is

s� � �KcKps � �Kos

The signal is ampli�ed with the loop gain� It also changes sign because of thenegative feedback� The dierence between the signals s and s� is

s� s� � �� �KcKp�s � Kds

This explains why Kd is called the return dierence�

Page 6: Process Control

� Chapter � Introduction to Process Control

The in uence of the disturbance is inversely proportional to the returndierence� It will thus be possible to obtain good performance by havinga high gain in the controller� The negative feedback makes the closed loopsystem insensitive to changes in the process gain Kp� A change in Kp toKp ��Kp gives �for d � ��

y �

��� �

� �Kc�Kp � �Kp�

�yr

or

e ��

� �Kc�Kp ��Kp�yr

The in uence of a change in the process gain is now highly reduced when theloop gain is high�

To summarize it is found that the negative feedback controller reduces thein uence of the disturbance and the sensitivity to uncertainties in the processparameters�

The example above shows that the stationary error reduces when thecontroller gain increases� In practice� there is always a limit on how muchthe gain can be increased� One reason is that the magnitude of the controlsignal increases with the gain� see ������ Another reason is that the closedloop system may become unstable due to dynamics in the process� These twoaspects will be dealt with in detail further on�

Figure �� is the prototype block diagram for a control system� It canrepresent many dierent systems� In the course we will concentrate on how tomodel the process and how to determine which type of controller that shouldbe used�

��� Dynamical Models

The process model used in Example ��� is of course much too simple� Mostprocesses are complicated technical systems that are di�cult to model andanalyze� To design control systems it is necessary to have a mathematicalmodel for the process to be controlled� Usually the processes can be describedby a hierarchy of models of increasing complexity� How complex the modelshould be is determined by the intended use of the model� A large part ofthe time devoted to a control problem is therefore spent on the modeling ofthe process� The models can be obtained in dierent ways� Either througha priori knowledge about the underlying phenomena or through experiments�Usually the two approaches have to be combined in order to obtain a goodmodel� The problem of modeling is illustrated using some examples�

Example ����Drum boiler power unitTo describe a drum boiler power system it can be necessary to use dierentmodels� For production planning and frequency control it can be su�cientto use a model described by two or three equations that models the energystorage in the system� To construct a control system for the whole unit itmay be necessary to have a model with ����� equations� Finally to modeltemperature and stresses in the turbine several hundreds of equations must beused�

Page 7: Process Control

��� Dynamical Models �

h a

A

q in

qout

Figure ��� Tank with input and output �ows�

Example ����Flow systemConsider the tank system in Figure ���� It is assumed that the output ow qoutcan be manipulated and that the input ow qin is determined by a previouspart of the process� The input ow can be considered as a disturbance andthe output ow as the control or input variable� The level in the tank is theoutput of the process� The change in the level of the tank is determined bythe net in ow to the tank� Assume that the tank has a constant area A� Therate of change in the volume V is determined by the mass balance equation

dV

dt� A

dh

dt� qin � qout �����

where h is the level in the tank� The system is thus described by a �rst orderdierential equation� Equation ����� gives a dynamic relation between theinput signal qout and the output signal h� It is the rate of change of the outputthat is in uenced by the input not the output directly�

Example ����Chemical reactorFigure ��� is a schematic drawing of a chemical reactor� The ow and concen�trations into the reactor can change as well as the ow out of the reactor� Thereaction is assumed to be exothermic and the heat is removed using the coolingjacket� The reaction rate depends on the concentrations and the temperaturein the reactor� To make a crude model of the reactor it is necessary to modelthe mass and energy balances� The detailed model will be discussed in Chap�ter �� The example shows that the models quickly increase in complexity andthat the relations between the inputs and output can be quite complex�

The examples above hint that the modeling phase can be di�cult andcontains many di�cult judgments� The resulting model will be a dynamicalsystem described by linear or nonlinear ordinary dierential or partial dier�ential equations� Modeling and analysis of such processes are two importantproblems on the way towards a good control system�

��� An Example

Before starting to develop systematic methods for analysis and design of con�trol systems we will give a avor of the problems by presenting a simple ex�ample that illustrates many aspects of feedback control�

Page 8: Process Control

� Chapter � Introduction to Process Control

Figure ��� Continuous stirred tank reactor �CSTR��

qA qB

a

hArea A

Figure �� Schematic diagram of the process�

Problem Description

Consider the problem of controlling the water level in a tank� A schematicpicture of the process is shown in Figure ���� The tank has two inlets and oneoutlet� The ow qA which can be adjusted is the control variable� The owqB � which comes from a process upstream is considered as a disturbance�

The objective is to design a control system that is able to keep the waterat a desired level in spite of variations in the ow qB� It is also required thatthe water level can be changed to a desired level on demand from the operator�

Modeling

The �rst step in the design procedure is to develop a mathematical model thatdescribes how the tank level changes with the ows qA and qB � Such a modelcan be obtained from a mass balance as was done in Example ��� A massbalance for the process gives

Adh

dt� �qout � qA � qB � �a

p�gh� qA � qB �����

Page 9: Process Control

��� An Example

qout

ho

2gho

h

Linear approximation

a

Figure �� Relation between outlet �ow and level and its linear approximation�

where A is the cross section of the tank� a the eective outlet area and hthe tank level� When writing equation ����� a momentum balance �Bernoulli�sequation� has been used to determine the outlet velocity as

p�gh� This means

that the out ow is given by

qout � ap�gh �����

As a �rst step in the analysis of the model we will assume that the in ows areconstant� i�e� qA � qA and qB � qB � The level in the tank will then also settleat a constant level h� This level can be determined from ������ Introducingh � h� qA � qA and qB � qB into the equation we �nd that

�ap�gh � qA � qB � �

Notice that the derivative dh�dt is zero because h is constant� The systemis then said to be in steady state which means that all variables are constantwith values that satisfy the model� Solving the above equation gives

h ��qA � qB�

�ga������

This equation gives the relation between the tank level and the in ow andout ow in steady state� The model ����� is di�cult to deal with because it isnonlinear� The source of the nonlinearity is the nonlinear relation between theout ow qout and level h� This function is shown in Figure ���� For small devia�tions around a constant level h the square root function can be approximatedby its tangent i�e��

qout � ap

�gh � ap�gh � a

rg

�h�h� h� � qout � a

rg

�h�h� h�

Introduce the deviations from the equilibrium values

y � h� h

u � qA � qA

v � qB � qB

Page 10: Process Control

� Chapter � Introduction to Process Control

Equation ����� can then be approximated by

Ad

dt�h� h� � �a

p�gh � a

rg

�h�h� h� � qA � qB

� �ar

g

�h�h� h� � �qA � qA� � �qB � qB�

This equation can be written as

dy

dt� ��y � �u� �v ������

where

� �a

A

rg

�h�ap�gh

�Ah�qA � qB�Ah

� ��A

Of physical reasons we have � � �� Notice that �� is the ratio between thetotal ow through the tank and the tank volume�

Since ������ is of �rst order it can be solved analytically� The solution is

y�t� � e��ty��� �

tZ

e���t���� �u��� � v���� d�

If u � u and v � v are constant we get the solution

y�t� � e��ty��� �

tZ

e���t��� d� ��u � v

� e��ty��� ��

��� e��t

��u � vo�

From this solution we can draw several conclusions� First assume that u�v ��� The output y�t� will then approach zero independent of the initial valuey���� The speed of the response is determined by �� A small value of � gives aslow response� while a large value of � gives a fast response� Also the responseto changes in u and v is determined by the open�loop parameter �� We havethus veri�ed that there will be a unique steady state solution at least if thelinear approximation is valid�

From the solution we also see that the output in steady�state is changedby Kp � ��� if the input is changed by one unit� Kp is called the static gainof the process�

Proportional Control

A typical control task is to keep the level at a constant value yr in spite ofvariations in the inlet ow qB � It may also be of interest to set the value yrat dierent values� The value yr is therefore called the reference value or setpoint� A simple controller for the process ������ is given by

u � Kc�yr � y� ������

Page 11: Process Control

��� An Example ��

This is called a proportional controller because the control action is propor�tional to the dierence between the desired value yr �the set point� and theactual value of the level� Eliminating u between equations ������ and ������gives

dy

dt� ��y � �Kc�yr � y� � �v

� ���� �Kc�y � �Kcyr � �v������

which is a �rst order dierential equation of the same form as ������� If thereare no disturbances i�e� v � �� the equilibrium value of the level is obtainedby putting dy

dt � � in ������� This gives

y ��Kc

� � �Kcyr �

KpKc

� �KpKcyr ������

where Kp � ��� is the static gain of the process� The level y will thus not beequal to the desired level yr� They will� however� be close if the product KpKc

is large� Compare with the discussion based on static models in Section ����

Proportional and Integral Control

A drawback with the proportional controller ������ is that the level will notbe at the desired level in steady state� This can be remedied by replacing theproportional controller by the controller

u � Kc�yr � y� �Ki

tZ

�yr���� y���� d� �����

This is called a proportional and integrating controller because the controlaction is a sum of two terms� The �rst is proportional to the control error andthe second to the time integral of the control error�

The error must be zero if there is a steady state solution� This can be seenfrom ������ If u is constant then the error e � yr � y must be zero becauseif it is not then u cannot be constant� Notice that we do not know if thereexist a steady state solution� The output may� for example� oscillate or growwithout settling�

To analyze the closed loop system the variable u is eliminated between������ and ������ Taking the derivatives of these equations we get

d�y

dt�� �

dy

dt� �

du

dt� �

dv

dt

du

dt� Kc

�dyrdt

� dy

dt

��Ki

�yr � y

�Multiplying the second equation by � and adding the equations gives

d�y

dt�� ��� �Kc�

dy

dt� �Kiy � �Kc

dyrdt

� �Kiyr � �dv

dt������

This equation describes how the level y is related to the set point yr and thedisturbance ow v�

Page 12: Process Control

�� Chapter � Introduction to Process Control

We �rst observe that if the disturbance ow v and the set point are con�stant a possible steady state value �all derivatives are zero� for the outputis

y � yr

The controller will thus give a closed loop system such that the output hasthe correct value�

Equation ������ is a second order dierential equation with constant coef��cients� Systematic methods of dealing with such equations of arbitrarily highorder will be developed in Chapter �� Before methods have been developedwe can still understand how the system behaves by making a simple analogy�The motion of a mass with damping and a restraining spring is also describedby equation ������� The mass is �� the damping coe�cient is � � �Kc andthe spring constant is �Ki� The behavior of the system can be understoodfrom this mechanical analog� If the spring constant is positive it will pushthe mass towards the equilibrium� If the spring constant is negative the masswill be pushed away from the equilibrium� The motion will be damped if thedamping coe�cient is positive� but not if the damping is negative� From thisintuitive reasoning we �nd that the system is stable if the spring constant andthe damping constant are positive i�e��

�� �Kc � �

�Ki � �

The damping can thus be increased by increasing Kc and the spring coe�cientcan be increased by increasing Ki� With a negative sign of Ki the springcoe�cient is negative and the system will not reach an equilibrium� Thiscorresponds to positive feedback�

Feedforward

It follows from Equation ������ that changes in the disturbance ow will re�sult in changes of the level� The control laws ������ and ����� are purefeedback strategies i�e�� they will generate control actions only when an errorhas occurred� Improved control laws can be obtained if the disturbance v ismeasured� By replacing the proportional control law ������ with

u � Kc�yr � y�� v

we �nd that Equation ������ is replaced by

dy

dt� �y � �Kc�yr � y� ������

The eects of the disturbance ow is thus completely eliminated� The controllaw ������ is said to have a feedforward action from the measured disturbance�The PI controller can be modi�ed in a similar manner�

��� Overview of the Course

The example in Section ��� contains several of the essential steps requiredto analyze and design a controller� All calculations were very simple in thisparticular case because both the model and the controller were simple� Tounderstand control systems and to solve control problems it is necessary tomaster the following areas�

Page 13: Process Control

�� Overview of the Course ��

� Modeling� To derive the necessary mathematical equations that describethe process�

� Analysis� To understand how inputs and disturbances are in uencingthe process outputs�

� Synthesis� To determine a suitable control structure and the parametersof the controller such that the speci�cations are ful�lled�

� Implementation� To choose the hardware that makes it possible toimplement the controller�

The goal of the course in process control is to give an ability to constructand understand a control system for a larger plant� To reach this goal it isnecessary to solve many subproblems� Chapter � gives a thorough treatmentof the modeling process� The methodology is illustrated by several examplesdrawn from chemical engineering� The modeling results in dynamical modelsfor the process� The models are mostly nonlinear� To be able to analyze theprocess it is necessary to simplify the models� This is done by linearizing themodels� Linear models form the basis for the analysis of the processes� One ofthe goals of Chapter � is to give insights to make it possible to determine thebehavior of the system by studying the model� The processes will be describedin dierent ways� Each way will give dierent insights�

Chapter explores the idea of feedback that was introduced in Examples��� and ��� and in Section ���� Stability� transient and steady�state perfor�mance are discussed� Chapter � is devoted to an understanding of the per�formance of PID controllers� which is the main standard controller in processcontrol� P� I� and D stand for Proportional� Integrating� and Derivative� Thesethree terms form the backbones of the standard process controller� Control ofbatch processes� start�up� shut�down� and alarms are handled using sequentialor logical control� Chapter � shows how this is done based on Boolean algebraand programmable logical controllers �PLCs��

The simple feedback controllers discussed in Chapters and � can becombined in dierent ways to form more complex control systems� Dier�ent concepts and ideas are introduced in Chapter � and �� How to handlecouplings between dierent control loops is discussed in Chapter �� How toimplement the controllers is discussed in Chapter ��� Special emphasis is puton implementation using computers�

Page 14: Process Control

Process Modelsfor Control Analysisand Design

GOAL� To introduce graphical� behavioral and mathematical repre�

sentations for processes and other control system elements� To in�

troduce the concept of dynamical mathematical models and ways to

obtain dynamical process models� To introduce linear process models

and in particular general linear state space models�

��� Why Models�

To obtain an understanding of control systems and their design it is mostimportant to be able to describe the control system elements including theprocesses and their disturbances� Process control systems often seem compli�cated� since they contain a relatively large number of dierent parts� Theseparts may represent many dierent branches of technology e�g� chemistry� biol�ogy� electronics� pneumatics� and hydraulics� To work eectively with controlsystems it is essential to master eective ways to describe the system and itselements� Such descriptions must be able to provide an overview of the systemfunction and also make it possible to penetrate into the detailed behavior ofindividual elements� To cover a broad range several dierent representationsof control systems are used� This chapter gives dierent ways of describingcontrol systems� Other representations are given in Chapter �� The bulkof this chapter focuses upon development of typical process models for con�trol analysis and design purposes� In addition many of the important controlconcepts are introduced�

Graphical representations� introduced in Section ��� provide a qualitativeimpression of the system function� Four graphical representations are used�General process layouts� which provide an overview� process ow sheets� whichshow the components of the plant� process and instrumentation diagrams�which also include the instruments for measurement control and actuation�and block diagrams� The latter represent the information ow and the control

��

Page 15: Process Control

��� Why Models� ��

function of the system�Behavioral representations are introduced in Section ���� They represent

the process behavior to speci�c process inputs such as step disturbances� Theserepresentations may be obtained in a conceptually appealing way� just by intro�ducing the desired form of disturbance at the process input and measuring theoutput� Such a representation is called an input�output representation� Oncethe process is operating a behavioral representation may be obtained and usedto quantitatively represent the process behavior to this type of disturbance�

Mathematical models are used for quantitative description of a system�These models describe the approximate function of the system elements inmathematical form� A combination of block diagram and mathematical mod�els is an eective method to provide an overview and detailed description ofthe function of a system� The system function can then be related to thereal process using a process ow sheet and a general process layout� Math�ematical modeling principles are introduced in Section ��� In Section ���models for a number of processes are given� which lead to sets of ordinarydierential equations� Process examples which lead to models consisting ofsets of partial dierential equations are given in Section ���� The state spacemodel is introduced as a generalization of the above process models in Section���� Typical process disturbances are introduced subsequently� The nonlinearterms are linearized leading to a general linear state space model which willbe used throughout the notes� A state space model gives a detailed descrip�tion of an internal structure of a system� In contrast input�output modelsonly describe the relationship between the process inputs and outputs� Theidea of also modeling disturbances is introduced in Section ���� Two dierenttypes of disturbances are discussed� These types are stochastic or random anddeterministic disturbances� In addition typical operation forms of chemicalprocesses are de�ned� In Section ��� a few methods are given for determina�tion of a mathematical model from experimental data� This methodology is incontrast to the derivation of models from a physical�chemical basis used abovein Sections ��� and ���� Combinations of the approaches are also given� Thiswhole subject is called process or system identi�cation� Finally in Section ����a summary of the material presented in this chapter is given�

��� Graphical Representations

Traditionally pictures have been important aids within the art of engineering�The earliest textbooks for engineers were� e�g� the picture books over variousmechanisms by Leonardo da Vinci� Various forms of graphical representationsare used within all branches of technology� especially with the advent of digitalpicture processing� Pictures are eective means to provide an overview andalso to stimulate intuition� Many dierent graphical methods have been usedwithin control for system description� Four of these are described below�

General process layouts

A simpli�ed process �or plant� sketch is often an eective means to provide anoverview of a process to be controlled� This sketch should show the dierentprocess �or plant� components� preferably in a stylized form to provide clarity�A schematic layout of a simple process is shown in Figure ���� A layout ofa more complicated plant site is shown in Figure ���� Note that there are

Page 16: Process Control

�� Chapter � Process Models for Control Analysis and Design

recycle

feed

separator

reactor

coolantsystem

coolant

Figure ��� Schematic layout of a simple process�

Ethylene Polyethylene

Crudeoil

NH3 PolymersUrea

Figure ��� Schematic layout of a more complex plant site�

Reaktor Värmeväxlare Separator

A

B

C

rest

Figure ��� Process �owsheet for a simple plant with a reactor heat exchanger and adistillation column�

no standards or rules for these drawings� However� good pictures are easilyidenti�ed�

Process �ow sheets

Within the process industry a limited number of unit operations and reactortypes are used� Therefore a set of almost international standard symbols havebeen introduced for the dierent components� Similar standards have beenintroduced by the power generation and the sanitation industries� A process ow sheet is illustrated in Figure ����

Page 17: Process Control

��� Graphical Representations ��

B

A

REAKTOR

DEST

ILLA

TIO

NSKO

LONN

KONDENSOR

VVX

Kylvatten

Kylvatten

Produkt C

KOKARE

Topprodukt

ÅngaVVXKylvatten

TRUMMA

TCT

L

T

LC

TC

T

TC

L

LCL

T TC

LC

FC F

FC F PCP

Figure ��� Simpli�ed process and instrumentation �PI� diagram for the process in Fig�ure ���� Signal connections are indicated with dashed lines� Controllers are indicated bycircles with text CC concentration control FC �ow rate control LC level control and TCtemperature control�

Process and instrumentation diagrams

To illustrate the combined process and instrumentation system a set of stan�dard symbols have been proposed and is applied within the process and controlindustry� These diagrams are often referred to as PI �Process and Instrumen�tation� diagrams� A simple example is shown in Figure ��� The PI diagram isa factual representation of the combined process and instrumentation systemhardware�

Block diagrams

For understanding process control and its design the information ow is es�sential� whereas the speci�c implementation technology� e�g� electrical� me�chanical or pneumatic� only is of secondary importance� Therefore a stylizedpictorial representation has been developed to describe the information owin a control system� This pictorial representation is called a block diagram andis illustrated in Figure ���� The fundamental principle is to enhance the signalor information ow and to suppress other details� The elements of a controlsystem are represented by rectangular blocks� The blocks are connected bylines with arrows� The direction of the arrows illustrates cause and eectin the interaction among the various elements� Designations of the variablesrepresented by the lines are shown next to the lines� Each block thus hasinputs and outputs� The inputs are control signals and disturbances and theoutputs are controlled signals and measurements� as indicated in Figure ���b�The input�output relationship may be shown within a block� A circle is usedto indicate a summation where the signs may be shown next to the arrows�Simple rules to manipulate block diagrams are given in Chapter �� The blockdiagram is an abstract representation of a system� the usage of which requireshabits and thoughts to relate the abstract picture to the technical reality� Theabstract representation has the big advantage that many dierent technicalsystems have the same block diagram� Thus their fundamental control prob�lems are the same as long as the processes ful�ll the validity assumptions forthe block diagram�

Page 18: Process Control

�� Chapter � Process Models for Control Analysis and Design

a)

ProcessController

Process Σ

b)

Σ Σ

−1

xu y

d

e

Input u Output y

Disturbance d

xState variable

yr

Figure ��� Block diagram for simple process in a� open loop and b� closed loop�

��� Behavioral Representations

The behavior of processes and control system elements may be represented bythe measured process response to a speci�c disturbance� e�g� a step� a pulse�an impulse or a periodic signal� A representation of the process behaviorin response to an input disturbance is called an input�output model� In thenext chapter it will be shown how the process behavior may be described ormodeled using dierent input�output representations� Models which representthe process or system input�output behavior are called external models� Suchmodels may be obtained by experimenting directly on an operating process�they can� however� also be obtained by developing mathematical models basedupon a fundamental engineering understanding of the principle mechanismsinside the process� Development of this type of internal representation isdescribed in the next two sections�

��� Mathematical Models

The graphical representations of a control system provide an overview of thesystem and a qualitative understanding of its function� In order to obtaina more quantitative representation a mathematical description may be used�These descriptions are usually called mathematical models� A mathematicalmodel is an abstract approximate representation which renders it possible tocompute the system behavior when the system input is known� Mathematicalmodels may� within their range of validity� be used to determine how a processbehaves in speci�c situations� A mathematical model may be used for�

� Determining suitable or optimal operating conditions for a process�

� Determining suitable or optimal start�up conditions to reach a desiredoperating point�

� Determining suitable or optimal timing in sequenced operations�

� Determining controller parameters�

� Finding location of errors�

Page 19: Process Control

��� Mathematical Models �

� Operator training�

In addition mathematical models can be very useful for simulation of haz�ardous conditions� and hence for establishing safety procedures� Often themodels used for such purposes must be more detailed than needed for controlsystem tuning simulations� The latter example of simulating hazardous condi�tions illustrates that the needed complexity of a model depends upon the goalof the model usage� When using and developing models it is very importantto keep this goal in mind in order to develop a model of suitable complexity�When developing models for control system simulation and control tuning itis often essential to be able to investigate the speed of the control system re�sponse� and the stability of the controlled system� Dynamic models are thusneeded at least for the dynamically dominating parts of the process�

Mainly two dierent views on mathematical models are used in processcontrol� The simplest considers an external representation of a process whichis conceptually closely connected to the block diagram where the process isconsidered as a black box� The mathematical model then speci�es an outputfor each value of the input� Such an external model is called an input�outputmodel� If available such a model can provide an e�cient representation ofthe process behavior around the operating point where it is obtained� Input�output models was introduced in the previous section in this chapter and willbe used throughout the course� In the alternative view a process is mod�eled using fundamental conservation principles using physical� chemical andengineering knowledge of the detailed mechanisms� With these models it isattempted to �nd key variables� state variables� which describe the character�istic system behavior� Thus such a model may be used to predict the futuredevelopment of the process� This type of model is called an internal model ora state space model�

Development of state space models is the main subject of the remainder ofthis chapter� The contents of this section are organized as follows� The basisfor development of conservation law models is �rst outlined� then the degreesof freedom of a model and thereafter dimensionless variables are introduced� Anumber of models are developed for understanding process dynamics for pro�cess control� The examples are organized such that �rst two relatively simpleprocesses are modeled� in a few dierent settings� This approach is chosen inorder to illustrate some of the eects of process design upon process dynamics�Some of these eects can have consequences for the resulting control design�This aspect is illustrated by investigating the degrees of freedom available forcontrol in some of the �rst examples� Thereafter the concepts of equilibriumand rate based models are introduced� These concepts are each illustrated byone or two examples� All the models developed in this section contain ordinarydierential equations possibly in combination with algebraic equations� Thecomplexity of the models increase through the section from just a single lineardierential equation to sets of a possibly large number of nonlinear equationsfor a distillation column�

Linear system

Linear systems play an important role in analysis and design of control sys�tems� We will thus �rst introduce the useful concepts of linearity� time invari�ance and stability� More formal de�nitions are given in Chapter ��

� A process is linear if linear combinations of inputs gives linear combina�tions of outputs�

Page 20: Process Control

� Chapter � Process Models for Control Analysis and Design

� A process is time invariant if it behaves identically to the same inputs ordisturbances at all times�

� Stability implies that small disturbances and changes in the process orinputs lead to small changes in the process variables�

Linearity implies� for instance� that doubling the amplitude of the input givetwice as large output� In general� stability is a property of a particular solution�and not a system property� For linear� time invariant processes� however� itcan be shown that if one solution is stable then any other solution also willbe stable� thus in these special cases a process may be called stable� Stableprocesses were often called self�regulating in the early control literature� sincethey dampen out the eect of disturbances�

Mathematical modeling principles

To describe the static and dynamic behavior of processes mathematical mod�els are derived using the extensive quantities which according to the laws ofclassical physics �i�e� excluding particle physics phenomena� are conserved�The extensive quantities most important in process control are�

� Total mass

� Component mass

� Energy

� Momentum

The variables representing the extensive quantities are called state variablessince they represent the system state� The changes in the system or processstate are determined by the conservation equations� The conservation principlefor extensive quantity K may be written for a selected volume element V of aprocess phase

Accumulationof K in Vunit time

�F low of Kinto V

unit time�

F low of Kout of Vunit time

�Generationof K in Vunit time

�Consumptionof K in Vunit time

�����

The balance must be formulated for each of the relevant phases of the processand expressions for the quantity transfer rates between the phases must beformulated and included in the ow terms� Note that by convention an in owof quantity into a phase is positive on the right hand side of ������ Thetype of dierential equation resulting from application of the conservationprinciple depends upon the a priori assumptions� If the particular phase can beassumed well mixed such that there are no spatial gradients and the quantityis scalar �e�g� temperature or concentration� then the conservation balancemay be formulated for the whole volume occupied by the phase� In that casean ordinary dierential equation results� Other types of models� i�e� wherespatial gradients are essential� yield partial dierential equations� These areillustrated in Section ���� Some of the most often applied conservation balancesfor the case of ideal mixing are listed below� Note that the momentum balanceusually plays no role in this case�

Total mass balance

d�V

dt�Xi�allinlets

�ivi �Xi�alloutlets

�ivi �����

Page 21: Process Control

��� Mathematical Models ��

Component j mass balance

dcjV

dt�Xi�allinlets

cj�ivi �Xi�alloutlets

cj�ivi � rjV �����

Total energy balance

dE

dt�Xi�allinlets

�iViHi �Xi�alloutlets

�iViHi �X

k�allphaseboundaries

Qk �W ����

where�c molar concentation �moles�unit volume�E total energy� E � U �K � Pv volume ow rateH enthalpy in per unit massK kinetic energyP potential energyQ net heat received from adjacent phaser net reaction rate �production�� mass densityU internal energyV volumeW net work done on the phase

The energy balance can often be simpli�ed� when the process is not movingdE�dt � dU�dt� For a liquid phase furthermore dU�dt � dH�dt� The speci�centhalpy is here often simpli�ed using a mean mass heat capacity� e�g� for aliquid phase� Hj � Cpj�Tj � T� where T is the reference temperature forthe mean heat capacity� For accurate calculations an appropriate polynomialshould be used to evaluate the speci�c enthalpy Cpj � e�g� Smith and van Ness�������

Static relations

If the process variables follow input variable changes without any delay thenthe process is said to be static� The behavior then may be described by theabove equations with the time derivatives equal to zero� In that case themodel for well mixed systems is seen to be a set of algebraic equations� Ifthese equations are linear �see Chapter �� in the dependent variables then thisset of equations has one solution only provided the model is well posed� i�e�the number of equations correspond to the number of dependent variables�See Appendix C� If the static equations are nonlinear then multiple solutionsmay be possible� The wellposedness of the model may be investigated byinvestigating the number of degrees of freedom of the model� Since this analysisalso provides information about the number of free variables for control it ismost useful for control design�

Analysis of the degrees of freedom

Once a model is derived� the consistency between the number of variables andequations may be checked� by analyzing the degrees of freedom� This may bedone by identifying the following items in the model�

� The number of inputs and disturbance variables � Nu

Page 22: Process Control

�� Chapter � Process Models for Control Analysis and Design

� The number of dependent variables� Nx

� The number of equations� Ne

The number of degrees of freedom Nf is determined by

Nf � Nx �Nu �Ne �����

Note that input and disturbance variables are determined by the externalworld� The degrees of freedom is only determined by the number of vari�ables and the equations relating these variables and does not depend on theparameters in the model�

In order to solve for the dependent variables it is necessary to specify Nf

operating variables� which usually are inputs and disturbances to the process�Now the following possibilities exist�

Nf � � There are more equations than variables� and there is in general nosolution to the model�

Nf � � In this case the model is directly solvable for the dependent variables�but there are no degrees of freedom left to control or regulate theprocess�

Nf � � There are more variables than equations� Thus in�nitely many so�lutions are possible� Nf variables or additional equations must bespeci�ed in order to be able to obtain a �nite number of solutions�a single in the linear case� to the model�

Note that usually Nf � Nu thus the degrees of freedom are used to pinpointthe possible controls and disturbances� If Nf �� Nu then either the model orthe process design should be reconsidered� Note that when an input variableis selected as an actuator variable to ful�ll a measured control objective� thenthe control loop introduces an additional equation thus reducing the numberof degrees of freedom with one� Later it will be clear that selection of controlvariable is one of the important choices of process control design�

Dimensionless variables

Once the model is formulated� some of its properties may be more easily re�vealed by introducing dimensionless variables� This is achieved by determininga nominal operating point to de�ne a set of nominal operating conditions� Thisset is then used as a basis for the dimensionless variables� One advantage ofthis procedure is that it may be directly possible to identify time constantsand gains in the process models� Thus one can directly obtain insight intothe process behavior� This methodology will be illustrated on several of themodels�

��� Models of Some Chemical Engineering Unit Processes

This section gives simple mathematical models for some unit processes thatare common in chemical plants� The idea is to show how the methodology inthe previous section can be used to derive mathematical models�

Hint for the reader� Use this and the following section to get an idea of thesteps in mathematical model building� There are examples and subexamples�The examples give the most fundamental model� while the subexamples givespecializations�

Page 23: Process Control

��� Models of Some Chemical Engineering Unit Processes ��

hv=c h

Laminar flowTurbulent flow

v=h/R

vin

Figure ��� Level tank with exit valve�

Liquid level storage tank

The following example for liquid ow through a storage tank illustrates de�velopment of a model� The example also illustrates the possible in uence ofthree dierent types of downstream equipment upon the model� Finally theexample discusses dierent choices of manipulated variable for controlling thelevel�

Example ����Liquid level in storage tankThe objective of modeling the level tank in Figure ��� is to understand itsdynamics and to be able to control the tank level� The in ow vin is assumed tobe determined by upstream equipment whereas three cases will be consideredfor the out ow� The level of the tank may be modeled using a total massbalance over the tank contents� The liquid volume V � Ah� h is the tanksurface level over the outlet level and A the cross sectional area� which isassumed independent of the tank level� Subscript in denotes the inlet and vthe volume ow rate

d�Ah

dt� �invin � �v

Assuming constant mass density the following balance results

Adh

dt� vin � v �����

Compare Example �� and Section ���� Although this clearly is a �rst orderdierential equation the behavior depends upon what determines the in� andout ows� In order to illustrate the machinery the degrees of freedom willbe analyzed and dimensionless variables will be introduced� The degrees offreedom in equation ����� are determined as follows�

The possible input and disturbance variables vin and v� Nu � �

The model variable h� Nx � �

The equation� Ne � �

Hence Nf � Nu�Nx�Ne � �� �� � � �� Thus only if the in� and out owsare determined or known one way or another� this model may be solved�

The simple tank system is thus described by one dierential equation� Wethen say that the system is of �rst order�

The equation ����� gives a generic model for a storage tank� The in owis determined by the upstream equipment� while the out ow will depend onthe tank and its outlet� If the in ow is given then the out ow needs to bedetermined� Here three cases will be considered

Page 24: Process Control

�� Chapter � Process Models for Control Analysis and Design

0 2 4 60

0.5

1 tau_p=0.1

tau_p=1

R=1

tau_p=0.1

tau_p=1

R=0.5

Time t

Level h

Figure �� Step response of level tank with laminar out�ow� Di�erent values of the staticgain and the residence time are shown�

� Laminar out ow

� Turbulent out ow

� Externally �xed out ow

Subexample ������Laminar out�ow through a valveFirst there is assumed to be a �ow resistance in the out�ow line� This resistance may beexerted by the tube itself or by a valve as indicated in Figure ���� In analogy with Ohm�slaw the out�ow� in this case� may be written v h�R where R is the linear valve resistance�Inserted into ����� the following model results

Adh

dt vin � �

Rh ��� �

The steady state solution� indicated with superscript �� is obtained by setting the timederivative equal to zero� thus

h� Rv�in �����

From ����� the parameter R is seen to describe how strongly a change in the steady stateinlet �ow rate a�ects the steady state level� Thus R is properly called the static gain of theprocess� The dynamic model may now be written

�pdh

dt �h�Rvin �����

where �p AR� Notice that �p has dimension time and it is called the time constant of theprocess� Equation ����� is a linear constant coe�cient �rst order di�erential equation whichcan be directly integrated� If the inlet �ow disturbance is a unit step disturbance at timezero� where the tank level initially was zero� then the solution is directly determined to be

h�t� R��� e�t��p

�������

This response is shown in Figure �� together with the inlet �ow disturbance for a numberof parameter values� Note that the curves may all be represented by one curve by scalingthe axes h�R and t��p� The larger gain R the larger the steady state level will become� Asmall �p gives a fast response� while a long time constant gives a slow response�

Page 25: Process Control

��� Models of Some Chemical Engineering Unit Processes ��

Subexample ������Turbulent out�ow through a valveLet a be the cross sectional area of the outlet� If a�h is small we can use Bernoulli�s equation

v ap�gh c

ph

where g is the gravitation constant� This implies that the out�ow is proportional to thesquare root of the tank level� This also implies that the pressure drop over the valve resistanceis �P � v�� Thus the following model results by inserting into equation �����

Adh

dt vin � c

ph ������

In this case a nonlinear �rst order di�erential equation results� The steady state solution ish� �v�in�c�

�� thus the static gain in this case varies with the size of the disturbance� Inthis particular case the nonlinear model equation ������ with a step input may be solvedanalytically� In general� however� it is necessary to resort to numerical methods in order tosolve a nonlinear model�

Subexample ������Externally �xed out�owThe out�ow v is now determined� e�g� by a pump or a constant pressure di�erence betweenthe level tank and the connecting unit� Equation ����� now becomes

Adh

dt vin � v ������

or

�dh

dt u

where both v and vin are independent of h� Further � A and u vin � v� If the in�and out�ows are constant� then� depending upon the sign of the right hand side the tanklevel will rise or fall until the tank �oods or runs empty� The level will only stay constantif the in� and out�ows match exactly � This type of process is called a pure integration ora pure capacitance because the integration rate is solely determined by the input variables�The � is in this case the time needed to change the volume by vin � v assuming a constant�ow rate di�erence� Note that for ������ both the in� and out�ows may be disturbances� orexternally set variables� Such a purely integrating process most often is controlled since itdoes not have a unique steady state level�

The behavior of the three exit ow situations modeled in Subexamples������� are illustrated in Figure ��� for a� the �lling of the tanks and b� thebehavior in response to a step disturbance in inlet ow rate�

Subexample ������Dimensionless variablesDimensionless variables are introduced using design information about the desired nominaloperating point hnom� Dividing ����� by the nominal production rate vnom and introducingthe dimensionless variables

xh h

hnom

uv�in vinvnom

uv v

vnom

the following equation is obtained

Ahnomvnom

dxhdt

�dxhdt

vinvnom

� v

vnom uv�in � uv ������

where � is seen to be the nominal volume divided by the nominal volume �ow rate� Thus �is the nominal liquid �lling time for the tank if the out�ow is zero�

Subexample ������Control of liquid storage processIn practice liquid storage processes are most often controlled either by a control system� orby design e�g� of an outlet weir to maintain the level� The �rst possibility is considered inthis case� As control objective it is selected to keep the level around a desired value� Thelevel may easily be measured by a �oat or by a di�erential pressure cell with input lines

Page 26: Process Control

�� Chapter � Process Models for Control Analysis and Design

0 5 10 150

0.5

1

1.5

Laminar

Turbulent Pump

a)

Time t

Level h

0 5 10 151

1.1

1.2

1.3

Laminar

Turbulent

Pump

b)

Time t

Level h

Figure �� Dynamic behavior of level tanks with exit �ow rate determined by valve withlaminar �ow valve with turbulent �ow and pump� a� Filling of the tanks to a nominalvolume� b� Response to a ��� increase in inlet �ow rate from rest� All parameters are �except the di�erence between pump in� and out�ow which is ���

from the top and bottom of the tank� From the model development the following inputs anddisturbances and degrees of freedom result

Laminar Turbulent Externally �xedNu vin vin vin� vNx h h hNe ��� � ������ ������Nf � � �

In the �rst two cases the outlet �ow is described by an equation involving the dependentvariable the outlet resistance� A possible manipulated variable could be the inlet �ow ratein all three cases� In that case the outlet �ow rate would be a disturbance in Subexample������ In the case of outlet �ow through a resistance then variations in this resistance maybe a possible disturbance� which� however� is not included in the model as a variable� but asa parameter embedded into coe�cients of the process model�Now consider the inlet �ow rate as a disturbance� Then in the case of externally �xed out��ow� this exit �ow rate is most conveniently selected as manipulated variable to ful�ll thecontrol objective� For the case of �ow through an outlet resistance variation of this resis�tance by changing the valve position is a feasible way to control the process� This selectionof manipulated variable� however� leads to a variable process gain and time constant in thelaminar �ow case� See ������ Note that this selection of control variable introduces an equa�tion between the �ow resistance and the level R f�h�� Thus a process model with timevarying coe�cients results� Note also that in this case the selection of manipulated variabledoes not reduce the number of degrees of freedom� since both Nu and Ne are increased by ��However� a rather complex model�and process�results� In order to avoid such complica�tions one may decide to change the design into one where the out�ow is determined by theexternal world� Even though a valve is used in the outlet� by measuring the outlet �ow rateand controlling the valve position to give the desired �ow rate� Such a loop is often used inpractice�

Subexample ������Two tanks in seriesLet two tanks be connected in series such that the out�ow of the upper tank is the in�ow tothe lower tank� The system is then described by the two di�erential equations for the levels

Page 27: Process Control

��� Models of Some Chemical Engineering Unit Processes ��

Qv, T

vin, Tin

Figure ��� Process diagram of a continuous stirred tank �CST� heater or cooler�

in the tank� compare �������

A�dh�dt

�c�ph� � vin

A�dh�dt

c�ph� � c�

ph�

Continuous stirred tank heater or cooler

The next example introduces a type of operation which often occurs in variousforms in chemical plants� First a model for the heated liquid is developed�Thereafter two dierent types of heating are modeled� i�e� electrical resistanceheating and heating by condensing steam in a submerged coil� For the lattermodel which consists of two dierential equations� an engineering assumptionis introduced� which reduces the model to one algebraic and one dierentialequation� Finally the degrees of freedom are investigated for the dierentheaters�

Example ����Continuous stirred tank �CST� heater or coolerA continuous stirred tank heater or cooler is shown in Figure ���� This typeof operation occurs often in various forms in chemical plants� It is assumedthat the liquid level is constant� i�e� v � vin� Thus only a total energy balanceover the tank contents is needed to describe the process dynamics� In the�rst model it is simply assumed that the energy ux into the tank is Q kW�Assuming only negligible heat losses and neglecting the contribution by shaftwork from the stirrer the following energy balance results

dV �CpT

dt� vin�inCpTin � v�CpT � Q

Assuming constant heat capacity and mass density� the balance may be sim�pli�ed

V �CpdT

dt� v�Cp�Tin � T � �Q �����

In the case of a heater the energy may be supplied from various sources�here �rst an electrical resistance heating and then steam condensing within aheating spiral are considered�

Page 28: Process Control

�� Chapter � Process Models for Control Analysis and Design

Subexample ������Electrical resistance heatingIn this case the capacitance of the heating element is assumed negligible compared to thetotal heat capacitance of the process� The model ������ can now be written on the form

�dT

dt �T � Tin �KQ ������

where � V�v and K ���v�Cp�� which is similar to ������ Fixing Tin T �in and Q Q�

gives the steady state solutionT � T �

in �KQ�

Thus the static gain K ���v�Cp� is inversely proportional to the steady state �ow rate�

Subexample ������Dimensionless variablesIntroduce a nominal heating temperature Tnom � and a nominal volumetric �ow rate vnom�Equation ������ may be divided by vnom�CpTnom Qnom which is the nominal or designpower input

V

vnom

d�

TTnom

�dt

v

vnom

�Tin � T �

Tnom�

Q

Qnom

Introduce the dimensionless variables xT T�Tnom � xT�in Tin�Tnom � uv v�vnom�u Q�Qnom � and the parameter �nom V�vnom � i�e� the liquid residence time� The aboveequation may then be written

�nomdxTdt

uv�xT�in � xT � � u ������

The steady state solution gives

x�T x�T�in �u�

u�v x�T�in � kpu

Thus the static gain kp ��u�v is inversely proportional to the steady state �ow rate�

Subexample ������Stirred heaterIf there is no through��ow of liquid� i�e� a stirred heater� then equation ������ with v �gives

� �dxTdt

Q ���� �

Note that here � � V �Cp� Just as in Subexample ����� a pure integration results� However�in this case the assumption of negligible heat loss no longer is reasonable when the system iscooled by the environment� In that case a heat loss through the tank wall and insulation maybe modeled as Qa UA�T �Ta�� where UA is the product of the total transfer coe�cient U �the total transfer area A� and index a denotes ambient conditions� Thus the energy balancebecomes

V �CpdT

dt Q� UA�T � Ta�

or

�dT

dt �T � Ta �KQ ������

where � �V �Cp���UA� and K ���UA�� Heating systems often have much longer coolingthan heating times� since UA � �� i�e� Q in�uences much stronger than Qa� This type ofprocess design gives rise to a control design problem Should the control be designed to bee�ective when heating up or when the process operates around its steady state temperaturewhere it is slowly cooling but perhaps heated fast� The main problem is that the actuator�energy input� only has e�ect in one direction� Often this problem is solved by dividing theheating power and only using a small heater when operating around steady state conditions�

Subexample ������CST with steam coilThe energy is assumed to be supplied by saturated steam such that the steam pressureuniquely determines the steam condensation temperature Tc� where index c denotes con�densation� In this case the heat capacity of the steam coil both may be signi�cant� thusrequiring formulation of an energy balance for two phases The liquid phase in the tank andthe wall of the steam coil� The energy transfered from the condensing steam to the steamwall is modeled using a �lm model

Qc hc�wAc�w�Tc � Tw�

Page 29: Process Control

��� Models of Some Chemical Engineering Unit Processes �

and the transfer from the wall to the liquid

Q hw�lAw�l�Tw � T �

where hi�j is a �lm heat transfer coe�cient between phase i and j� Thus the two balancesbecome �rst for the tank contents� with index l� based upon equation ������

Vl�lCp�ldT

dt vl�lCp�l�Tin � T � � hw�lAw�l�Tw � T � ������

and for constant heat capacity and density for the wall� with index w

Vw�wCp�wdTwdt

hc�wAc�w�Tc � Tw�� hw�lAw�l�Tw � T � ������

The process is now described by two �rst order di�erential equations� The input or manipu�lated variable is now Tc and the disturbance is Tin� The wall temperature Tw is an internalvariable in the model�

Subexample ������Quasi�stationarity of the wall temperatureIf the wall to liquid heat capacity ratio

b Vw�wCp�w

Vl�lCp�l

is small then the wall temperature may be assumed almost steady� such that the wall tem�perature is virtually instantaneously determined by the steam and liquid temperatures� Thisapproximation will only be valid if dTw

dt is small� For systems where such an approximationdoes not hold special investigations are necessary� Provided the above assumption is validthe quasi steady wall temperature may be found from the quasi�steady version of equation������

� ��hc�wAc�w � hw�lAw�l�Tw � hc�wAc�wTc � hw�lAw�lT

or

Tw hc�wAc�wTc � hw�lAw�lT

hc�wAc�w � hw�lAw�l������

Inserting into ������ gives

Vl�lCp�ldT

dt �vl�lCp�lT � vl�lCp�lTin

�hw�lAw�l

hc�wAc�w � hw�lAw� l�hc�wAc�wTc � hw�lAw�lT �

The model is now reduced to a �rst order system�

Subexample ������Degrees of freedom for heatersThe degrees of freedom in the above heat exchanger models may be seen in the followingtable

Subex� ����� ����� ����� �����Nu � �Q� Tin� v� � �Q�Ta� � �Tc� Tin� v� � �Tc� Tin� v�Nx � �T � � �T � � �T� Tw� � �T� Tw�Ne � ������ � ������ � ������������� � �������������Nf � � � �

In the above four cases it seems most relevant to select a representative variable for the energyinput as an actuator to achieve a control objective such as keeping the process temperatureconstant� Note that in Subexample ����� one equation is algebraic�

Evaporator

The following example introduces a single stage evaporator which is a processwhich may be modeled using three dierential equations� First such a model isderived without specifying the heating source� Then condensing vapor is used�and the degrees of freedom for control are discussed� This discussion presents

Page 30: Process Control

� Chapter � Process Models for Control Analysis and Design

Q

Feed

Liquid

VaporV

W

F,c

F in, cin

Figure ���� Schematic drawing of an evaporator �feed of dilute salt solution� or of athermal �ash drum �feed of a solvent mixture��

the problem of selecting among a number of dierent actuators in order tosatisfy the control objectives� This problem setting will later in the courseturn out to be typical for chemical processes� Finally a model for a multistageevaporator is given� where the number of dierential equations is proportionalto the number of stages in the evaporator� Often four to six stages is appliedin industrial practice�

Example ����EvaporatorAn evaporator is schematically shown in Figure ����� This sketch may be con�sidered as a crude representation of evaporators� diering in details such asenergy source or type of liquid to be evaporated� i�e� whether the main productis a concentrated solution or the produced saturated vapor� The general fea�tures of evaporators are that a liquid�vapor mixture is produced by the supplyof energy through a heating surface� The produced vapor is separated fromthe liquid and drawn o to the downstream unit� The feed solution is assumedto contain a dissolved component to be concentrated with the feed concentra�tion cin �kg�kg solution�� The following additional simplifying assumptionsare made

i� Vapor draw�o or consumption conditions speci�ed� thus setting the va�por production rate V �kg�h��

ii� The produced vapor is saturated

iii� Low pressure� i�e� �g � �l

iv� Negligible heat losses

Indices l and g denote liquid and gas phase respectively� The assumptionof saturated vapor implies that the evaporator pressure is determined by thetemperature� Following assumption iii� only liquid phase mass balances will beconsidered� Thus three balances are required to model this evaporator� Totalmass� component mass and total energy� Again the energy input is initiallyassumed to be Q kW� In this example the writing is simpli�ed by using massunits� i�e� the liquid hold up is mass W kg� mass ow rate is F kg�h and the ow rate of the produced vapor is V kg�h� The liquid mass density is assumedconstant�

dW

dt� Fin � F � V ������

d�Wc�dt

� Fincin � Fc

d�WHl�dt

� FinHl�in � FHl � VHg � Q

Note that the energy balance is expanded compared to Example ��� due to

Page 31: Process Control

��� Models of Some Chemical Engineering Unit Processes ��

the produced vapor� and that the energy content in the gas phase has beenneglected in the accumulation term� The latter is reasonable due to assump�tion iii�� which gives Hg � Cp�g�T � T� � � Where the heat of vaporization is assumed independent of temperature which is reasonable at low pressure�The component and energy balances may be reduced by dierentiating theleft hand side and using the total mass balance equation ������

Wdc

dt� Fincin � Fc� c

dW

dt� Fin�cin � c� � cV ������

WdHl

dt� Fin�Hl�in �Hl�� V �Hg �Hl� � Q �����

The evaporator is thus described by the three dierential equations �������������� and ������ The �nal form of the model depends upon what determinesthe vapor production rate V �

Subexample ������Condensing vapor heated evaporatorIn this case the produced vapor is assumed condensed at a surface through which heat isexchanged to a lower temperature Tc in a downstream process unit� An energy balance overthe condensation surface� indexed c� gives

V �Hg �Hl� UcAc�T � Tc� ������

where the heat capacity of the heat exchanging wall has been considered negligible� a totalheat transfer coe�cient Uc� and area Ac are used� Provided Tc is known the above equationde�nes the vapor rate which may be introduced into the equations above� Together with thevapor supplied energy Q UvAv�Tv � T � and the expressions for the speci�c enthalpy ofthe liquid and gas phase equation ������ becomes

WCp�ldT

dt FinCp�l�Tin � T �� UcAc�T � Tc� � UvAv�Tv � T � ������

Thus a model for an evaporator stage consists of three di�erential equations� ������� �������and �������

Subexample ������Degrees of freedom for evaporator stageThe variables and equations are directly listed as

Nu � Fin� F� cin� Tin� Tc� TvNx � W�c� TNe � ��������������������

Thus the degrees of freedom are �� Assuming the inlet conditions cin and Tin to be deter�mined by upstream equipment leaves four variables as candidates for actuators F � Fin� Tcand Tv� The control objectives may be formulated as controlling

� liquid level

� liquid temperature

� outlet concentration

� vapor production rate�

Thus the control con�guration problem consists in choosing a suitable loop con�guration�i�e� selecting suitable pairs of measurement and actuator�

Subexample ������Dimensionless variablesDimensionless variables will now be introduced in the evaporator model in Subexample ������De�ning the nominal feed �ow rate Fnom� nominal concentration cnom and a nominal liquidheat �ow Qnom FnomCp�l�Tnom normalized variables can be introduced into equations������� ������� ������� and ������

�dxwdt

uf�in � uf � xV ���� �

Page 32: Process Control

�� Chapter � Process Models for Control Analysis and Design

where � Wnom�Fnom� xw W�Wnom � uf�in Fin�Fnom� uf F�Fnom� and xV V�Fnom� The component balance is normalized by dividing with the nominal concentrateproduction rate Fnomcnom and de�ning xc c�cnom

�xwdxcdt

uf�in�xc�in � xc� � xV xc ������

Similarly for the energy balance by dividing with Qnom and de�ning xT �T � T����Tnometc�

�xwdxTdt

uf�in�xT�in � xT �� �

�c�xT � xT�c� �

�v�xT�v � xT � ������

where �i �Cp�lWnom���UinAin� for i c and v� The vapor production rate may benormalized similarly

xV V

Fnom

UcAcWnomCp�l�TnomCp�lWnomFnom�Hg �Hl�

�xT � xT�c� �

�cg�xT � xT�c� ������

where g �Cp�l�Tnom���Hg � Hl� often will be relatively small due to a large heat ofvaporization� Thus a model for an evaporator stage consists of the four last equations�

Subexample ������Multistage evaporatorThe evaporator model may be directly extended to a multistage evaporator� The model forthe j�th stage using the same assumptions as above� directly can be formulated from ���� ��������� For simplicity it is assumed that the stages have identical parameter values� Notingthat both the entering liquid �old index in� and the supply vapor �old index v� comes fromstage j � �� whereas the produced vapor is condensed in stage j � �� the following modelresults

�dxw�jdt

uf�j�� � uf�j � xV�j ������

�xw�jdxc�jdt

uf�j���xc�j�� � xc�j� � xV�jxc�j ������

�xw�jdxT�jdt

uf�j���xT�j�� � xT�j�

� �

�c�xT�j � xT�j��� �

�v�xT�j�� � xT�j� ������

xV�j�� �

�cg�xT�j � xT�j��� ������

The above equations for j �� � � � �N with speci�ed inlet �j �� and downstream conditions�j N � �� may be directly solved by using a di�erential equation solver�

Subexample ������Degrees of freedom for multistage evaporatorAssuming N stages and with inlet conditions indexed with in �i�e� j �� the following tablemay be formed

Nu N � � uf�j � uf�in� xc�in� xT�in� xV�inNx �N xW�j� xc�j� xT�j � xV�jNe �N

Thus Nf N � �� These free variables may be utilized to control

� Each liquid level

� The production rate of concentrate

� The concentrate concentration Thus leaving two degrees to be determined by the ex�ternal world� these could be the inlet concentration xc�in and temperature xT�in�

Equilibrium and rate processes

The processes in the above examples have been simple� and their behavior havebeen determined by transfer rate coe�cients� This type of processes are calledrate processes� When developing and designing chemical processes in generaltwo basic questions are� can the processes occur and how fast� The �rstquestion is dealt with in courses on thermodynamics� and the second questionin courses on chemical reaction engineering and transport phenomena� In a

Page 33: Process Control

��� Models of Some Chemical Engineering Unit Processes ��

number of industrially important processes� such as distillation� absorption�extraction and equilibrium reactions a number of phases are brought intocontact� When the phases are not in equilibrium there is a net transfer betweenthe phases� The rate of transfer depends upon the departure from equilibrium�The approach often taken when modeling equilibrium processes is based uponequilibrium assumptions� Equilibrium is ideally a static condition in which allpotentials balance� and no changes occur� Thus in engineering practice theassumption is an approximation� which is justi�ed when it does not introducesigni�cant error in the calculation� In recent years rate based models have beendeveloped for some of these multiphase processes which has made it possibleto check the equilibrium models� Especially for multicomponent mixtures itmay be advantageous to go to rate based models� which� however� are muchmore elaborate to solve�

Modeling of equilibrium processes is illustrated in the following with a ash and a distillation column� The previous example with an evaporator alsoused an equilibrium approach� through the assumption of equilibrium betweenvapor and liquid phases� Rate processes is also illustrated in the last exampleof this section with a continuous stirred tank reactor�

Equilibrium processes

As a phase equilibrium example� which is of widespread usage in chemicalprocesses� vapor�liquid equilibrium is considered� The equilibrium conditionis equality of the chemical potential between the vapor and liquid phases� Forideal gas �Dalton�s law� and ideal liquid phase �Raoult�s law� this equalityimplies equality between the partial pressures

Py�j � xjPj and P �

NcXj��

xjPsatj

where P is the total pressure� xj and y�j the j�th component liquid and equi�librium vapor mole fractions� Nc is the number of components� and P sat

j isthe pure component vapor pressure� The pure component vapor pressure is afunction of temperature only� and may be calculated by the empirical Antoineequation

lnP satj � A� B

T � Cwhere A� B and C are constants obtainable from standard sources� In prac�tice� few systems have ideal liquid phases and at elevated pressures not evenideal gas phases� For many systems it is possible to evaluate their thermo�dynamic properties using models based upon grouping atoms and�or uponstatistical properties of molecules� These models may provide results in termsof equilibrium vaporization ratios or K values

y�j � Kj�T P x� � � � xNc y� �� yNc�xj

The usage of thermodynamic models to yield K values is adviceable for com�plex systems� To obtain simple� i�e� fast� calculations for processes with fewcomponents at not too high pressure relative volatility � may be used

�i�j �

y�ixi

y�jxj

Page 34: Process Control

�� Chapter � Process Models for Control Analysis and Design

Reboiler

Bottom product

Feed

Condenser

Accumulator

Top product

Recycling

L i+1,xi+1

L i,xiVi,yi

Vi −1,yi −1

F, z f

B, xB

V, yN

L, xD

D, xD

MD, xD

Mi

Tray N

Tray i

Tray 1

Figure ���� Tray distillation column

The relative volatilities are reasonably constant for several systems� Note thatfor a binary mixture the light component vapor composition becomes

y� ��x

� � x��� ��������

Distillation column

A typical equilibrium process is a distillation column�

Example ����Distillation column for separating a binary mixtureA schematic process diagram for a distillation column is shown in Figure �����The main unit operations in the process are reboiler� tray column� condenserand accumulator from which the re ux and the distillate are drawn� A modelwill be developed for a binary distillation column� It is straightforward togeneralize the model to more components� by including additional componentbalances and using an extra index on the concentrations� The main simplifyingassumptions are�

i� Thermal equilibrium on the trays

Page 35: Process Control

��� Models of Some Chemical Engineering Unit Processes ��

ii� Equimolar counter ow� i�e� Vi�� � Vi constant molar gas ow rate

iii� Liquid feed enters at bubble point on feed tray�

iv� Ideal mixing is assumed in each of reboiler� trays� condenser and accu�mulator�

v� A total condenser is used�

vi� Negligible vapor holdup� i�e� moderate pressure

In the present example the pressure will be assumed �xed by a vent toatmosphere from the accumulator� In a closed distillation column with a totalcondenser the pressure would be mainly determined by the energy balancesaround the reboiler and condenser� but these will be omitted in this model�

Thus the balances included here are total mass and light component oneach tray� These are written for the i�th tray� with molar holdup Mi and liquidphase light component concentration xi� Introducing LN�� � L� xN�� � xD�and with y determined by the liquid concentration in the reboiler we get

dMi

dt� Li�� � Li � F��i� f� ������

dMixidt

� Li��xi�� � Lixi � V �yi�� � yi� � Fzf��i� f� ������

for i � � � � � N � where

��i� f� �

�� for i � f �� for i �� f�

F feed ow rate and zf feed composition and yi is the vapor phase concen�tration of the light component on tray i� The liquid ow rate from each traymay be calculated using� e�g� Francis weir correlation

Li � k�i

�Mi �Mo

A�i

����

������

where

�i molar liquid density kmole�m�

Mo liquid holdup at zero liquid ow kmole

A tray cross sectional area m�

k coe�cient m����s

If there is complete equilibrium between the gas and liquid phase on a tray�then yi � y�i � where the equilibrium composition is determined using an ap�propriate thermodynamic model� But most often the gas and liquid are notcompletely in equilibrium on a tray� this additional eect may be accountedfor by using the Murphree tray e�ciency

Em �yi � yi��y�i � yi��

������

often the tray e�ciency varies between the rectifying and stripping sections�

Page 36: Process Control

�� Chapter � Process Models for Control Analysis and Design

Q

vin, cA,in

v, cA

Figure ���� Stirred tank reactor �STR� with possibility for feed addition and productwithdrawal

Reboiler �index B�

dMB

dt� L� � �V �B� �����

dMBxBdt

� L�x� � �V � B�xB �����

where V the boil up rate or vapor ow rate is determined by the energy inputto the reboiler�

Condenser and accumulator The condenser model is simple for a totalcondenser with assumption vi�� Here simply the vapor is assumed to be con�densed to liquid with the same composition� i�e� xc � yN � The accumulatoror distillate drum �index D� model becomes

dMD

dt� V � �L�D� �����

dMDxDdt

� V xc � �L�D�xD �����

where subscript D indicates thus also the distillate composition�The model is described by ��N ��� �rst order dierential equations� The

main disturbances will be feed ow rate and composition� F � zf � The possiblemanipulated variables will be V � L� D� B these may be combined in a numberof ways to control the four degrees of freedom� �It is left as an exercise toshow that there indeed are four degrees of freedom�� Two actuators shouldbe used to maintain the levels in the reboiler and distillate drum� and theremaining two actuators for controlling the top and bottom compositions asneeded� This problem in distillation control will be dealt with later in thiscourse�

Stirred tank reactor �STR�

Stirred tanks are used often for carrying out chemical reactions� Here a fewexamples will be given to illustrate some of the control problems� First ageneral model will be formulated subsequently it will be specialized to a cooledexothermic continuous reactor�

Example ����Stirred tank reactor �STR�A simple stirred tank is shown in Figure ����� The tank can be cooled and�orheated in a for the moment unspeci�ed manner� The liquid phase is assumed

Page 37: Process Control

��� Models of Some Chemical Engineering Unit Processes ��

well mixed� and the mass density is assumed constant� Thus the followinggeneral balances result for a liquid phase reaction A � B with the reactionrate r mol�s for conversion of the reactant�

Total massd�V

dt� �invin � �v

Reactant component mass

dnAdt

�dV cAdt

� vincA�in � vcA � V r

If a solvent is used an additional component mass balance is needed� For theproduct the mass balance becomes

dnBdt

�dV cBdt

� vincB�in � vcB � V r

note that� � MAcA �MBcB �MScS �

Xj�A�

B and S

Mjcj

where subscript S designates solvent�

EnergydH

dt� �invin Hin � �v H �Q�W ����

Since the mass density is assumed constant the total and reactant mass balanceequations are modi�ed as in the evaporator example

�dx

dt� uv�in � uv �����

�dxAdt

� uv�in�xA�in � xA�� �r

cA�nom�����

The variables have been made dimensionless through normalization�The energy balance may be reduced� albeit with some eort� as follows�

Noting that enthalpy is a state function H � H�P T nj� j � � � � � N thetotal dierential may be written

dH � H

PdP �

H

TdT �

Xj

H

njdnj � �CpV dT �

Xj

!H�dnj

where !H� is the partial molar enthalpy of component j� Note that the enthalpydependence on pressure has been assumed negligible which is reasonable forliquid mixtures at normal pressure� The time derivative of enthalpy may bedetermined using the component balances

dH

dt� �CpV

dT

dt� !HA�vincA�in � vcA � V r�

� !HB�vincB�in � vcB � V r� � !HS�vincS�in � vcS�

� �CpVdT

dt� vin

Xj

cj�in !H� � vXj

!H�cj � ���HB �HA��V r

Page 38: Process Control

�� Chapter � Process Models for Control Analysis and Design

Since!H��T � � !H��T� �MjCp�j�T � T�

the above summations may be written

Xj

cj !H��T � �Xj

cj !H��T� �Xj

cjMjCp�j�T � T� � � H�T� � �Cp�T � T�

where the enthalpy and heat capacity for the mixture have been de�ned as H�T� �

Pj cj

!H��T��� and Cp �P

j cjMjCp�j��� Thus

dH

dt� �CpV

dT

dt� vin�in Hin�T� � vin�inCp�in�T � T�

� v�Cp H�T�� v�Cp�T � T�� ��� !H�T ��V r

Inserting the above equation into the energy balance equation ���� and uti�lizing

H�T � � H�T� � Cp�T � T�

gives directly

�CpVdT

dt� vin�Cp�in�Tin � T � � ��� !H�T ��V r �Q�W

Normalizing this energy balance with �Cpvnom�Tnom and de�ning the dimen�sionless temperature xT � T��Tnom gives

�dxTdt

� uv�in�xT�in � xT � �

����H�T ��r�

Q

V�W

V

��

�Cp�Tnom�����

where constant properties have been assumed�

Subexample ������Exothermic Continuous Stirred Tank Reactor �CSTR�An example reaction which can display many of the facets of chemical reactors is a simpleconversion A� products which is exothermic� This reaction scheme may be an approxima�tion for more complicated reactions at special conditions� A simpli�ed reactor model willnow be developed� The reaction rate is assumed to be �rst order in the reactant and tofollow an Arrhenius temperature dependence with the activation energy Ea� thus

r k exp��Ea

RT

�cA k exp ����� exp

����� Tnom

T

��cA ������

where T � Ea�R� R is the gas constant and � T ��Tnom� With these de�nitions���k exp����� �r becomes the reaction rate at the nominal conditions� The dimension�less concentration is xA cA�cAnom Inserting the reaction rate in the component balanceequation ������ gives

�dxAdt

uv�in�xA�in � xA�� �

�rexp

����� �

xT��xA

uv�in�xA�in � xA��Dm exp����� �

xT��xA

������

where Dm ���r is called the Damk�hler number�Even though the reaction is exothermic it may initially require heating in order to

initiate the reaction then cooling may be required to control the reaction rate� The heat�ing and cooling is assumed achieved by manipulating the temperature of a heating�coolingmedium� This medium may be in an external shell or in an internal coil� The models for theheating�cooling medium energy balance will depend upon the actual cooling system� here it

Page 39: Process Control

��� Models of Some Chemical Engineering Unit Processes �

simply will be assumed that the medium temperature Tc is perfectly controlled� Thus therate of removing energy from the medium is

Q UA�Tc � T �

Inserting the reaction rate expression and energy removal rate into the energy balance equa�tion gives when shaft energy is assumed negligible

�dxTdt

uv�i�xT�in � xT � � Dm exp ���� �

xT�xA �

�c�xT�c � xT � ������

where the dimensionless adiabatic temperature rise is

���H�T ��ca�nom

�Cp�Tnom

�Tadb�Tnom

������

where �Tadb is the dimensional adiabatic temperature rise� and �c �vnomCp

UA� Thus the

CSTR model consists of the reactant mass balance equation ������ and equations ������ and������� This model is clearly nonlinear due to the exponential temperature dependence inthe reaction rate expression and this dependence will be a function of � and of the adiabatictemperature rise for the particular reaction�

��� Distributed Parameter Processes

In many chemical processes the exchange and�or reactions occur with a non�uniform spatial distribution� Such processes are often tubular perhaps withpacking material in order to enhance interphasial contact� Often counter�current ow directions are statically most e�cient� such as in tubular heatexchangers� Fixed bed processes� such as �xed bed reactors is another exampleof distributed processes� Traditionally processes with spatially distributedexchange and�or reaction processes are called distributed parameter processeseven though it is the variables which have the distribution� In this chapterthe phrase distributed processes will often be used�

Mathematical models for distributed processes often should include thedistributed aspects in order to provide a description of the process behaviorwhich is su�ciently accurate for good control system design� Such a dis�tributed model is obtained by setting up a model for a dierential volumeelement of the process phases� Thus giving partial dierential equations� Inthis section a few examples of such distributed models will be given� These willinclude a simple tubular ow delay� a steam heated tubular heat exchanger�and a tubular furnace� The essential distributed element is the tubular ow inthese three examples� Clearly other types of distributed elements exist suchas heat conduction through a rod or mass diusion through a packed bed�Numerical solution of distributed models will be illustrated by using simpleapproximations to the spatial derivatives� thus giving sets of ordinary dier�ential equations� These approximate models may be used to illustrate thedynamic behavior and for understanding control system design for distributedprocesses similarly to models which are directly formulated as ordinary dier�ential equations�

Example ����Transport delay or dead timeA simple example of a distributed process is a pure transport delay illustratedin Figure ����� In such a delay a stream ows through a pipe of length L� cross�sectional area A and with the plug ow volume velocity v� thus the residence

Page 40: Process Control

� Chapter � Process Models for Control Analysis and Design

Process 1 Process 2

A v

L

Figure ���� Transport delay�

Condensate

Saturated vapor

vin=v

Tin(t)

0 l L

Δl

T(t,l=L)

Figure ���� Double tube heat exchanger heated by condensing vapor�

or delay time inside the pipe is

� �AL

v

This delay implies that any change occurring in the stream properties as con�centration or energy content at the tube inlet only will be seen in the outletafter the delay or dead time� thus for the dependent variable x

xeffluent�t� � xinlet�t � ��

Note that this relation may be rewritten using a spatial length variable alongthe pipe� �script l� which is zero at the inlet and equal to the pipe length Lat the outlet� thus the dependent variable is a function of two independentvariables

x�t l � L� � x�t� � l � ��

In the example above the dependence of the spatial dimension is so simplethat it may be described using a pure delay or dead time� Delays play animportant role in many processes and also in obtaining measurements fromliquid streams� Understanding the physical background for a process delayoften constitute an important part in understanding the process dynamics�

Example ��� Condensing vapor heated tubular heat exchangerIn a double tube as illustrated in Figure ��� a liquid to be heated ows inplug ow in the inner tube and is heated from the outer tube by a condensingvapor� This process will be modeled by energy balances for the liquid in theinner tube and for the tube wall for a volume element of length �l as shown onFigure ���� The vapor is assumed to be saturated and with a well controlledpressure� The cross sectional area is assumed constant along the tube length�

Page 41: Process Control

�� Distributed Parameter Processes ��

Thus the energy balances become

dA�l�CpT �t l�dt

� �CpvA �T �t l�� T �t l��l��

� hiPi�l �Tw�t l�� T �t l��

dAw�l�wCp�wTw�t l�dt

� hyPy�l �Tc � Tw�t l��� hiPi�l �Tw�t l�� T �t l��

where axial heat conductivity has been neglected in the tube wall and P isthe tube perimeter� where index i and y are for inner and outer� Indices w� cand f are used for the wall� condensing vapor and uid �only when needed�respectively� Taking the limit as �l � � a partial dierential equation isobtained� note that constant properties are assumed

A�Cp T �t l� t

� �A�Cpv T �t l� l

� hiPi �Tw�t l�� T �t l��

Aw�wCp�w Tw�t l�

t� hyPy �Tc � Tw�t l��� hiPi �Tw�t l�� T �t l��

Introducing dimensionless length coordinate z � l�L and dimensionless de�pendent variables xT�in � Tin��Tnom the following equations are obtained bydividing the �rst with A�Cpvnom�Tnom and the second with Aw�wCp�w�Tnom

� xT �t z�

t� �uv xT �t z�

z�

�f�w�xT�w�t z�� xT �t z�� ������

� xT�w t

��

�w�c�xTc � xT�w�� �

�w�f�xT�w�t z�� xT �t z�� ������

where � is the uid residence time� uv � v�vnom� �f�w � �CpA��hiPi�� �w�f ��wCp�wAw��hiPi� and �w�v � �wCp�wAw��hyPy�� To solve this model initialstate functions must be known� i�e� xT �t � � z� and xT�w�t � � z�� If thesolution starts at steady state these may be obtained by solution of the steadystate versions of the above two dynamic equations� In addition an inlet condi�tion must be speci�ed� i�e� xT �t z � ��� The solution of a partial dierentialequation model requires an approach to handle the partial derivatives� Thisis usually done through an approximation scheme as illustrated later in thissection�

To control a double pipe heat exchanger the condensing vapor pressuremight be used as actuator� The disturbances may in that case be inlet temper�ature� liquid ow rate� i�e� uv and perhaps varying heat transfer parametersas fouling develops�

Example ���Process furnaceA process furnace is shown schematically in Figure ����� Process Furnaces areused to heat vapors for subsequent endothermic processing� Fuel is being com�busting in the �rebox which encloses the vapor containing tube� In speciallydesigned furnaces reactions may occur in the furnaces� e�g� thermal crackingof high viscosity tars to short chain unsaturated carbohydrides� particularlyethylene� In this example� however� no reactions are assumed to occur inthe furnace tube vapor phase� To simplify the modeling the following mainassumptions are used

i� The �re box is isothermal�

Page 42: Process Control

�� Chapter � Process Models for Control Analysis and Design

l=L

l=0

Vapor feed

F, Tin

Figure ���� A schematic illustration of a �re box with tube to be heated in a processfurnace�

ii� A su�cient amount of air is present to allow complete combustion of fuel�

iii� The heat loss through the insulation is described by the �re box insulatione�ciency� �B�

iv� Vapor is assumed ideal�

v� Material properties are assumed constant�

vi� A single tube is assumed to be representative� i�e� in uence of neighboringtubes is neglected�

With these assumptions energy balances for vapor� tube wall and the �reboxare needed� The length along the tubes is indicated by l as in the previousexample�

Tube vapor phase

dA�lCp�T �t�l�dt

� FCp�T �t l�� T �t l��l�� � hiPi�l�Tw�t l�� T �t l��

Tube wall

dAw�l�wCp�wTw�t l�dt

� ��Py�l�TB�t�� Tw�t l��� hiPi�l�Tw�t l�� T �t l��

Fire box

dWBCBTB�t�dt

� FfHf�f�Z L

��Py�T �

B�t��T �w�t l��dl�BgFfCp�g�TB�t��To�

Where

F is the mass ow rate of vapor kg� s

Cp the heat capacity of vapor J�� kg K�

� the thermal emissivity of the tube surface

� is the Stefan�Boltzman constant J�s�m��K�

WB the �re box mass kg

CB and Fire box speci�c thermal capacity J�kg�K

Ff fuel mass ow rate kg�s

Hf fuel heating value J�kg

Bg is the mass faction of gas produced by fuel combustion�

Page 43: Process Control

�� Distributed Parameter Processes ��

With assumption iv� the pressure P � �RT�M is constant �where R is thegas constant and M the mean molecular weight�� thus the accumulation termin the vapor phase energy balance is zero� Dimensionless distance z � l�L anddependent variables xT�i � Ti��Tnom are introduced� In addition a thermalresidence time for the tube is introduced

� ��wCpAwL

CpFnom�����

Thus the three equations above become �rst for the vapor

� � �uF xT �t z� z

� c�xT�w�t z�� xT �t z�� ������

where c � hiPiL��CpF � and uF � F�Fnom�

Tube wall

� xT�w t

� crad�x�T�B�t�� x�T�w�t z��� c�xT�w�t z�� xT �t z�� ������

where crad � ��Py�T �nomL��CpFnom��

Fire box

�B xT�B t

� uF�f ��f�cg�f�xT�B�t��xTo���cradrZ �

�x�T�B�t��x�T�w�dz ������

whereuF�f � Ff�Ff�nom

cg�f � BgCp�g�Tnom�Hf

r � CpFnom�Tnom��FfnomHf�

The latter expression for r is the ratio of nominal vapor energy ow to thatcombusted�

Approximation of Distributed Process Models

The partial dierential equations describing the dynamics of distributed pro�cesses may be solved numerically in a multitude of ways� Here only a simpleprocedure� which approximates the spatial derivatives locally with �nite dif�ferences will be illustrated� In this simple approach the length coordinate issubdivided into N equidistant sections of length �z � ��N � The �rst orderderivative then may be approximated using a backwards �rst order dierencequotient

x

z

����i

�xi � xi��

�z� O��z�� ������

or using a central dierence quotient

x

z

����i

�xi�� � xi��

��z�O��z�� ������

which has smaller truncation error than the backwards dierence quotient�The usage of the backwards approximation is illustrated in the next exampleon condensing vapor heated tubular exchanger in one of the previous examples�

Page 44: Process Control

�� Chapter � Process Models for Control Analysis and Design

Example ����Approximating condensing vapor tubular heat exchanger

The partial dierential equation in the tubular heat exchanger example isdirectly converted into the following set of ordinary dierential equations usingequation ������

�dxT�i�t�

dt� �uvN �xT�i�t�� xT�i���t�� �

�f�w�xT�w�i�t�� xT�i�t�� ������

�dxT�w�i�t�

dt�

�w�c�xT�c�t�� xT�w�i�t��� �

�w�f�xT�w�i�t�� xT�i�t�� ������

where i � � � � � �N and xT��t� � xT�in�t�� This set of equations may bedirectly solved using a solver for ordinary dierential equations� Note thatthe approximate model for the uid phase is equivalent to approximating thetubular plug ow with a sequence of CST�heat exchangers each of the size��N � Perhaps due to this physical analogy the backwards dierence is quitepopular when approximating distributed models� even though this approxi�mation numerically is rather ine�cient�

Several more sophisticated approximation methods exist for partial dif�ferential equation models� In one type of methods the partial derivatives areapproximated globally using polynomials or other types of suitable functions�in which case the internal points no longer are equidistantly distributed overthe spatial dimension� Such methods may often yield much higher accuracyusing just a few internal points than that obtained with �nite dierence meth�ods using several scores of internal points� Thus such approximations may bepreferred when requiring an e�cient approximation with a low order model�

�� General Process Models

In the two previous sections it was demonstrated how approximate mathemat�ical models for a large class of processes can be represented by sets of ordinarydierential equations� In this section this view will be exploited by intro�ducing vector notation in order to represent a possibly large set of ordinarydierential equations by a single vector dierential equation� This equationdescribes the dynamics of the process represented by the selected dependentvariables called state variables and the inputs� The state equations will� ingeneral� be nonlinear� Close to steady states linear approximations will oftenbe su�cient� Therefore linearization is introduced as an approximation bywhich process models may be represented by sets of linear dierential equa�tions� This set may be conveniently handled using vector matrix notation�The resulting vector dierential equation is labeled a linear state space model�See Appendix C�

Vector notation

In the two preceding sections a number of dierential equations have beendeveloped for approximate modeling of the dynamic behavior of a number of

Page 45: Process Control

�� General Process Models ��

processes� In general a set of dierential equations results�

dx�dt

� f��x� x� � � � xn u� u� � � � um�

dx�dt

� f��x� x� � � � xn u� u� � � � um�

������

dxndt

� fn�x� x� � � � xn u� u� � � � um�

This set of dierential equations may be e�ciently represented in a notationusing vector notation� i�e� column vectors for each of the process states x� theprocess inputs u� and for the right hand sides f as follows

x �

x�x����xn

� u �

u�u����um

� f �

f�f����fn

� Thus giving the state vector di�erential equation

dx

dt� f�x u� ������

The states are the variables which accumulate mass� energy� momentum etc�Given the initial values of the states and the input signals it is possible topredict the future values of the states by integrating the state equations� Notethat some of the time derivatives may have been selected to be �xed as zero�e�g� by using a quasi�stationarity assumption� In that case these equationsmay be collected at the end of the state vector by suitable renumbering� Incase of e�g� more complicated thermodynamics additional algebraic equationsmay have to be satis�ed as well� However� for the present all equations willbe assumed to be ordinary dierential equations�

The models for measurements on the process� which are assumed to bealgebraic may similarly be collected in a measurement vector

y� � h��x� x� � � � xn u� u� � � � um����

���

yp � hp�x� x� � � � xn u� u� � � � um�

De�ning vectors containing the p measurements and measurement equations

y �

y�y����yp

� h �

h�h����hp

� gives the measurement vector equation

y � h�x u� ������

Page 46: Process Control

�� Chapter � Process Models for Control Analysis and Design

Example �����Tank with turbulent out owThe tank with turbulent out ow is discussed in Subexample ������ The systemis described by ������� which can be written as

dh

dt� � c

A

ph�

�Avin

This is a �rst order nonlinear state equation� Introducing

x � h

u � vin

givesdx

dt� � c

A

px�

�Au � f�x u�

Example �����CST with steam coilConsider the continuous stirred tank with steam coil in Subexample ����� Thesystem is described by ������ and ������� Introduce the states and the inputs

x �

� x�x�

� �

� T

Tw

� u �

� u�u�

� �

�TinTc

� This gives the state equations

dx

dt� Ax�Bu

where

A �

�� vlVl� hw�lAw�l

Vl�lCp�l

hw�lAw�l

Vl�lCp�l

hw�lAw�l

Vw�wCp�w�hc�wAc�w � hw�lAw�l

Vw�wCp�w

� B �

�vlVl

�hc�wAc�w

Vw�wCp�w

� Assuming that T is the output we get the output equation

y �� � �

� x

The system is a linear second order system with two input signals�In general� the dierential and algebraic equations ������ and ������ will

be nonlinear� For testing control designs it is often essential to use reasonableapproximate process models which most often consist of such a set of nonlineardierential equations� This set may be solved using numerical methods col�lected in so called dynamic simulation packages� One such package is Simulinkthat is used together with Matlab�

Page 47: Process Control

�� General Process Models ��

Steady state solution

When operating continuous processes the static process behavior may be de�termined by solution of the steady state equations obtained by setting thetime derivative to zero in equation ������

� � f�x u� �����

The steady state solution is labeled with superscript �� x and u� E�g� theoperating conditions u may be speci�ed and then x is determined by solvingequation ������ The solution of this set of equations is trivial if f containslinear functions only� Then just one solution exists which easily may be de�termined by solving the n linear equations� In general� however� f containsnonlinear functions which makes it possible to obtain several solutions� In thatcase it may be important to be able to specify a reasonable initial guess in or�der to determine the possible operating states� Large program packages calledprocess simulators are used in the chemical industry for solving large sets ofsteady state equations for chemical plants� Such plants often contain recyclestreams� Special methods are used for this purpose in order to facilitate thesolution procedure�

Linearization

To develop an understanding for process dynamics and process control it isvery useful to investigate the behavior of equations ������ and ������ aroundsteady state solutions� where many continuous processes actually operate� Themathematical advantage of limiting the investigation to local behavior is thatin a su�ciently small neighborhood around the steady state linear models areoften su�cient to describe the behavior� Such linear models are amenable forexplicit solution� for control design� and for usage in regulation and control�Linearization is carried out by performing a Taylor series expansion of thenonlinear function around the steady state solution� For the i�th equation thismay be written

dxidt

� fi�x u�

� fi�x� x� � � � xn u� u� � � � um�

� fi�x u� �

fi x�

����

�x� � x�� � � � �� fi xn

����

�xn � xn�

� fi u�

����

�u� � u�� � � � �� fi um

����

�um � um�

� higher order terms

�� fi�x u� � fi x�

����

�x� � x�� � � � �� fi xn

����

�xn � xn�

� fi u�

����

�u� � u�� � � � �� fi um

����

�um � um�

where the partial derivatives are evaluated at x � x and u � u� Theexpansion has been truncated to include only linear terms in the variables�These terms have the constant coe�cients given by the partial derivativesevaluated at the steady state solution� Inserting the steady state solutionequation ����� and de�ning variables which describe only deviations from the

Page 48: Process Control

�� Chapter � Process Models for Control Analysis and Design

steady state solution� !xj � xj � xj with j � � � � � n and !uj � uj � uj wherej � � � � � m� The above equation may be written

dxidt

�d!xidt

� fi x�

����

!x� � � � �� fi xn

����

!xn � fi u�

����

!u� � � � �� fi um

����

!um

� ai�!x� � � � �� ain!xn � bi�!u� � � � �� bim!um

������

where the partial derivatives evaluated at the steady state have been denotedby constant

aij � fi xj

����

and bij � fi uj

����

Thus by performing a linearization a constant coe�cient dierential equationhas been obtained from the original nonlinear dierential equation� This resultmay be generalized to all n dierential equations in equation ������� thus giving

d!x�dt

� a��!x� � � a�n!xn � b��!u� � � b�m!um

���

d!xidt

� ai�!x� � � ain!xn � bi�!u� � � bim!um

���

d!xndt

� an�!x� � � ann!xn � bn�!u� � � bnm!um

This set of equations may be written as the linear constant coe�cient vectordierential equation

d!xdt

� A!x�B!u ������

where the vectors are

!x �

x� � x�x� � x�

���xn � xn

� !u �

u� � u�u� � u�

���um � um

� and the constant coe�cient matrices are�

A �

a�� a�� � � � a�na�� a�� � � � a�n���

���� � �

���an� an� � � � ann

� and B �

b�� b�� � � � b�mb�� b�� � � � b�m���

���� � �

���bn� bn� � � � bnm

� Thus the general nonlinear state space dierential equation ������ has beenlinearized to obtain the general linear state space equation ������� In anal�ogy herewith the nonlinear measurement equation ������ may be linearized as

Page 49: Process Control

�� General Process Models �

shown below� �rst for the i�th equation�

yi � hi�x u� � hi�x� x� � � � xn u� u� � � � up�

� hi�x u� �

hi x�

����

�x� � x�� � � hi xn

����

�xn � xn�

� hi u�

����

�u� � u�� � � hi um

����

�um � um�

� higher order terms

�� hi�x u� �

hi x�

����

�x� � x�� � � hi xn

����

�xn � xn�

� hi u�

����

�u� � u�� � � hi um

����

�um � um�

Now introducing deviation variables for states� inputs as above and here forthe measurements also� i�e� !yi � yi � yi � where yi � hi�x u� gives thefollowing constant coe�cient measurement equation

!yi � ci�!x� � � cin!xn � di�!u� � � dim!um ������

where the partial derivatives evaluated at the steady state are denoted withthe constants

cij � hi xj

����

and dij � hi uj

����

Note that the dij constants only appear when an input aects the outputdirectly� Note also that if a state is measured directly then the C matrixcontains only one nonzero element in that row� Equation ������ also may beconveniently written as an algebraic vector equation� in analogy with the statespace equation ������ above� as

!y � C!x �D!u ������

where the constant matrices are

C �

c�� c�� � � � c�nc�� c�� � � � c�n���

���� � �

���cp� cp� � � � cpn

� and D �

d�� d�� � � � d�md�� d�� � � � d�m���

���� � �

���dp� dp� � � � dpm

� Thus the general nonlinear state space model consisting of the two vectorequations developed early in this section have been approximated with twolinear and constant coe�cient vector equations which are called general linearstate space model

d!xdt

� A!x� B!u

!y � C!x �D!u������

This general linear state space model may be used for describing the behav�ior of chemical processes in a neighborhood around the desired steady statesolution�

Page 50: Process Control

� Chapter � Process Models for Control Analysis and Design

Example �����LinearizationConsider the nonlinear system

dx

dt� �x� � ��u� u� � f�x u�

y � x� � h�x u�

We will now linearize around the stationary value obtained when u � �� Thestationary point is de�ned by

x � �u � �

y �

Notice that the system has two possible stationary points for the chosen valueof u� The functions f and h are approximated by

f

x� �xu

f

u� �x� � ��� �u�

and h

x� �x

h

u� �

When x � �� we getd!xdt

� �!x� �!u

!y � �!xand for x � � we get

d!xdt

� !x� �!u

!y � !x

Example �����Liquid level storage tankThe storage tank with turbulent out ow is described in Subexample ������ Letthe system be described by

dh

dt� � a

A

p�gh�

vinA

where vin is the input volume ow� h the level� A the cross sectional area ofthe tank� and a the cross sectional area of the outlet pipe� The output is thelevel h� We will now determine the linearized model for the stationary pointobtained with the constant in ow vin� From the state equation we get

vin � ap

�gh ������

A Taylor series expansion gives

dh

dt�d!hdt

� � a

A

p�gh �

vinA� a

�A

p�g�h �h� h� �

�A�vin � vin�

Introduce the deviationsx � h� h

u � vin � vin

y � h� h

Page 51: Process Control

�� General Process Models ��

0 2 4 6 8 100

0.5

1

1.5

2

Time t

Level h

Figure ���� A comparison between the linearized system �full lines� and the nonlineartank model �dashed lines�� The out�ow is shown when the in�ow is changed from � to anew constant value� The tank is linearized around the level ��

Using ������ we then obtain the �rst order linear system

dx

dt� ��x � �u

y � x������

where

� �a

�A

p�g�h �

ap�gh

�Ah�

vin�V

� � ��A

V � Ah

For small deviations from the stationary in ow vin the tank can be describedby the linear equation ������� Figure ���� shows how well the approximationdescribes the system� The approximation is good for small changes around thestationary point� Figure ���� shows a comparison when the in ow is turnedo� Notice that the linearized model can give negative values of the level�

�� Disturbance Models

One main reason for introducing control of processes is to reduce the eect ofdisturbances� The character and the size of disturbances limit� together withthe process dynamics� the controlled process behavior� In order to promoteunderstanding of such limitations it is useful to be able to describe distur�bances mathematically� Two characteristically dierent types of disturbanceswill be discussed one where the disturbances are of simple shape for some ofwhich mathematical models are given� These simple disturbances are often

Page 52: Process Control

�� Chapter � Process Models for Control Analysis and Design

0 2 4 6 8 10−1

−0.5

0

0.5

1

Time t

Level h

Figure ��� A comparison between the linearized system �full lines� and the nonlineartank model �dashed lines�� The level is shown when the in�ow is turned o��

used to investigate process and control dynamics� The other disturbance typeis more complicated and no models will be given� Thereafter the occurrenceof disturbances as seen from a control loop this leads to introduction of twostandard types of control problems� Finally various operation forms for pro�cesses are described and viewed in the perspective of the two standard controlproblems and combinations thereof�

Disturbances can have dierent origins when seen from a controlled pro�cess� Three or four origins will be discussed� Finally dierent types of processoperation forms will be discussed to introduce the control problems arisingtherefrom�

Disturbance character

The simple disturbance types have simple shapes which also are simple tomodel mathematically� Four of these are shown in Figure ����� The pulse isused to model a disturbance of �nite duration and with �nite area �energy��The pulse may often be approximated by its mathematical idealization theunit impulse of in�nitely short duration and unit area shown in Figure ����c�These simple disturbances may be modeled as outputs of dynamic systemswith an impulse input� Thus the analysis of a process with disturbances maybe reduced to the standard problem of analyzing the impulse response of asystem which contains the combined model of the disturbance and the process�

In some cases disturbances have a much more complex character and itmay be advantageous to use a statistical description� Even for this type ofdisturbance the concept of modeling disturbances as outputs of dynamicalsystems is most useful� Then the generic disturbance used is so called whitenoise� i�e� an unregular statistical signal with a speci�ed energy content�

Page 53: Process Control

��� Disturbance Models ��

δ(t−t0)

a) b)

c) d)

Figure ��� Four of the most usual disturbance functions� a� Step� b� �Rectangular�pulse� c� Impulse� d� Sine wave�

Controller ΣΣ Σ

−1

ProcessLoaddisturbance

Reference input

Measurementnoise

Output

Figure ���� Block diagram of closed loop with showing possible disturbance sources�

Process disturbances

Disturbances can enter in dierent places in a control loop� Three places areindicated in Figure ����� One disturbance location is seen when a change inproduction quality is desired� Here the purpose of the control system is totrack the desired change in quality as closely as possible and possibly to per�form the grade change as fast as possible� This type of control problem iscalled servo or tracking control� Clearly a process start�up may be considereda perhaps complex set of servo problems� The command signals applied usu�ally have a simple form though� A second location for disturbances is loaddisturbances which act upon the process� Such loads may be� e�g� varyingcooling requirements to a cooling ow control loop on a CST�reactor� or vary�ing requirements of base addition to a fermentation where pH is controlledby base addition� This second type of disturbance gives rise to what is calleda regulation or disturbance rejection control problem� In chemical processeschanges in loads often also is of simple form� but occur at unknown pointsin time� e�g� due events elsewhere in the plant� Another type of disturbancemay be noise such as measurement noise i�e� the dierence between a processvariable and it�s measurement or such as process noise� i�e� where the noisesource may be process parameters which may vary during operation� e�g� dueto fouling or to catalyst activity changes� Measurement noise can both havesimple form� e�g� step like calibration errors and pulse like measurement errorsand have more complex form�

Page 54: Process Control

�� Chapter � Process Models for Control Analysis and Design

Process operation forms

Process plants may be viewed as operating in mainly three dierent operationforms all of which often are found within a large plant site�

� Continuous operation where the product is produced continuously at con�stant quality and rate�

� Batch operation where the product is produced in �nite amounts� the sizeof which is determined by the process equipment� The batch processingtime may be from hours to weeks�

� Periodic operation where part of the process is operated deliberately pe�riodically�

The boundaries between these operation forms are not sharp� Continuousoperation must be started by a so called startup procedure consisting of asequence of operations to bring the process from the inoperative state to thedesired operating conditions� At the end of continuous operation the processmust go through a shut down sequence as well� Thus continuous operationmay be viewed as a batch operation with a very long batch time� There maybe several years between startups� Similarly a sequence of successive batchoperations may be considered a periodic operation �with a slightly broader def�inition than given above�� Thus the distinction introduced above is determinedby the frequency of the transient operations which is lowest in continuous andhighest in periodic operation� During the transient phases the actions to betaken are a sequence of starts of pumps opening of valves etc� and purpose forthe control loops is to reach speci�ed set points� thus we have a sequence ofservo or tracking problems� During the production phase the control problemwill be of disturbance rejection type�

��� Process Identi�cation

Throughout Sections ��� ���� and ��� the models have been formulated basedupon physical and chemical engineering principles� Even though the modelingprinciples are well established� model parameters are often uncertain� due toinherent inaccuracies of the underlying correlations for� e�g� transport param�eters not to mention kinetic parameters� Thus for control applications it isoften desirable to get improved estimates for model parameters on an actualoperating plant� In this section some of the methods will be brie y mentioned�A more thorough introduction may be found in the referenced literature�

The external and the internal modeling approaches discussed in Section��� and �� also have their counterparts in identi�cation� In the external modelapproach a black box impulse or step response model is identi�ed directly fromexperimental data� Whereas in the internal model approach parameters in thenonlinear internal model or in linearized versions are estimated from exper�imental data� Examples of methods used for obtaining data and estimatingparameters may be described by the following three methodologies� Transientanalysis� frequency analysis and parametric identi�cation� Finally the appli�cation of neural nets to identify and represent process dynamics is noted�

Page 55: Process Control

��� Process Identi cation ��

Transient analysis

A linear time invariant process may be completely described by it�s step orimpulse response� These responses can be determined by relatively simpleexperiments� The desired disturbance� step or �im��pulse� is introduced whenthe system is at rest and the output is recorded or stored� To make the impulseresponse analysis it is important that the pulse duration is short relative to theprocess response time� The disturbance may be in one of the process variables�or if measurement is di�cult� then a suitable� e�g� radioactive� tracer may beused� The advantage of transient analysis is that it is simple to perform� butit is sensitive to noise and disturbances� A single disturbance may ruin theexperiment�

Frequency analysis

If a sine wave is introduced into a stable linear time invariant process then theoutput will also be a sine wave with the same frequency but shifted in time�The amplitude ratio between the input and output sine waves and the phaseshift between input and output are directly related to the process dynamicsand parameters �see Chapter ��� By reproducing the experiment for a num�ber of frequencies the frequency function� consisting of the amplitude and thephase shift as a functions of frequency� for the process may be obtained� Theadvantage of frequency analysis is that the input and output signals may bebandpass �ltered to remove slow disturbances and high frequency noise� thusproviding relatively accurate data� The frequency function may be determinedquite accurately by using correlation techniques� The main disadvantage offrequency analysis is that it can be very time consuming� This disadvantagemay be partially circumvented by using an input signal which is a linear com�bination of many sine waves� This methodology is called spectral analysis�

Both transient and frequency analysis require estimation of process pa�rameters from the experimentally determined data� These parameters maybe obtained using relatively simple methods depending upon the particularmodel� If a linear time invariant model is used then the estimation may beperformed relatively simply�

Parametric identi�cation

For linear time invariant models an alternative method to frequency and spec�tral analysis is parametric identi�cation� In this methodology the parametersare directly determined from experimental data� The methodology may beillustrated by the following procedural steps�

� Determination of model structure

� Design of and carrying out experiment

� Determination of model parameters� i�e� parameter estimation

� Model validation

The model structure may be chosen as a black box model� but it is possibleto use available process knowledge� to reduce the number of unknown param�eters� The experiment can be carried out by varying the process inputs usinge�g� sequences of small positive and negative steps and measuring both in�puts and outputs� The experimental design consists in selecting suitable sizeand frequency content of the inputs� The experiments may� if the processis very sensitive� be carried out in closed loop� where the input signals may

Page 56: Process Control

�� Chapter � Process Models for Control Analysis and Design

be generated by feedback� An important part of the experimental design isto select appropriate �ltering of data to reduce the in uence of disturbances�The unknown model parameters may be determined such that the measure�ments and the calculated model values coincide as well as possible� Once themodel parameters have been obtained� it is important to establish the validityof the model� e�g� by predicting data which has not been used for parame�ter estimation� For linear time invariant models the parametric identi�cationmethodology is as eective as spectral analysis in suppressing the in uence ofnoise�

Neural nets

Neural nets represent a methodology which yields a dierent representation ofprocess dynamics from the above mentioned� The methodology is behavioral�in that measured input�output data obtained during normal operation is usedto catch the process dynamics�

� Selection of net structure�

� Determination of net parameters�

At present it seems that many observations are needed to �x the net param�eters� which may limit the applicability of the method� But the applicationof neural nets may be an interesting alternative for complex processes if mea�surements are inherently slow and conventional mathematical models are notavailable�

��� Summary

We have in this chapter seen how mathematical models can be obtained fromphysical considerations� The model building will in general lead to state spacemodels that are nonlinear� To be able to analyze the behavior of the pro�cess and to design controllers it is necessary to linearize the model� This isdone by making a series expansion around a working point or nominal point�We then only consider deviations around this nominal point� Finally a shortintroduction to the identi�cation problem was given�

Page 57: Process Control

Analysis ofProcess Dynamics

GOAL� Di�erent ways to represent process dynamics are introduced

together with tools for analysis of process dynamics�

��� Introduction

The previous chapter showed how to obtain dynamical models for varioustypes of processes� The models can be classi�ed in dierent ways� for instance

� Static or dynamic

� Nonlinear or linear

� Time�variant or time�invariant

� Distributed or lumped

Models were derived for dierent types of chemical processes� In Chapter � wefound that two tanks connected in series can be described by a second ordersystem� i�e� by two dierential equations� We also found that the exothermiccontinuous stirred tank reactor can be described by a similar second ordersystem� It is then convenient to handle all systems in a systematic way inde�pendent of the physical background of the model�

In this chapter we will take a systems approach and unify the treatmentof the models� The models are treated as abstract mathematical or systemobjects� The derived properties will be valid independent of the origin ofthe model� The mathematical properties can afterwards be translated intophysical properties of the speci�c systems� The di�culty to make a globalanalysis of the behavior of general systems leads to the idea of local behavioror linearization around a stationary point� In most control applications thisis a justi�ed approximation and we will see in this chapter that this leads toconsiderable simpli�cations� The class of systems that we will discuss in thefollowing is linear time�invariant systems� The goal with this chapter is toanalyze the properties of such systems� We will� for instance� investigate thebehavior when the input signals are changed or when disturbances are acting

��

Page 58: Process Control

�� Chapter � Analysis of Process Dynamics

on the systems� It will then be necessary to solve and analyze ordinary lineardierential equations� The linear time�invariant systems have the nice prop�erty that they can be completely described by one input�output pair� Theproperties of the system can thus be determined by looking at the response ofthe system for one input signal� for instance a step or an impulse� This prop�erty will make it possible for us to draw conclusions about the systems withoutsolving the dierential equations� This will lead to considerable simpli�cationsin the analysis of process dynamics�

Section ��� gives formal de�nitions of linearity and time�invariance� Sec�tion ��� shows how we can solve dierential equations� The most importantidea is� however� that we can gain much knowledge about the behavior of theequations without solving them� This is done using the Laplace transform� Wewill call this the time domain approach� The state equation in matrix formis solved in Section ��� The connection between the higher order dierentialequation form and the state space form is derived in Section ���� This sectionalso discusses how to determine the response of the systems to dierent inputsignals� Simulation is a good tool for investigating linear as well as nonlin�ear systems� Simulation is brie y discussed in Section ���� Block diagramsare treated in Section ���� Another way to gain knowledge about a dynam�ical system is the frequency domain approach discussed in Section ���� Theconnections between the time domain and the frequency domain methods aregiven in Section ����

��� Linear Time�Invariant Systems

Linear time�invariant systems will �rst be de�ned formally�

Definition ����Linear systemConsider a system with input u and output y� Let �u� y�� and �u� y�� betwo input�output pairs� The system is linear if the input signal au��bu� givesthe output ay� � by��

Definition ����Time�invariant systemLet �u�t� y�t�� be an input�output pair of a system� The system is time�invariant if the input shifted � time units gives an output that is shifted bythe same amount� i�e�� �u�t� �� y�t� ��� is also an input�output pair�

A time�invariant system obeys the translation principle� This implies that theshape of the response to a signal does not depend on when the signal is ap�plied to the system� Linear time�invariant systems also obey the superpositionprinciple� This implies that if �u y� is an input�output pair then �Lu Ly� isalso an input�output pair when L is an arbitrary linear operator�

Example ����Examples of linear operatorsAddition and subtraction of signals are linear operators� Other examples oflinear operators are dierentiation and integration

L�y�t� �dy�t�dt

L�y�t� �Z t

y��� d�

Page 59: Process Control

��� Linear Time�Invariant Systems �

A linear time�invariant system is conveniently described by a set of �rst orderlinear dierential equations

dx�t�dt

� Ax�t� �Bu�t�

y�t� � Cx�t� �Du�t������

This is called an internal model or state space model� Let n be the dimensionof the state vector� We will also call this the order of the system�

In Chapter � it was shown how simple submodels could be put togetherinto a matrix description as ������ This model representation comes naturallyfrom the modeling procedure� The model ����� describes the internal behaviorof the process� The internal variables or state variables can be concentrations�levels� temperatures etc� in the process� At other occasions it may be su�cientto describe only the relation between the inputs and the outputs� This leadsto the concept of external models or input�output models� For simplicity wewill assume that there is one input and one output of the system� Equation����� then de�nes n � � relations for n � � variables �x� y� and u�� We cannow use these equations to eliminate all the state variables x and we will getone equation that gives the relation between u and y� This equation will be an�th order ordinary dierential equation�

dny

dtn� a�

dn��y

dtn��� � any � b

dmu

dtm� b�

dm��u

dtm��� � bmu �����

Later in this section we will give a general method how to eliminate x from����� to obtain the input�output model ������ The solution of this equationwill now be discussed� Before deriving the general solution we will �rst givethe solution to a �rst order dierential equation�

Example ����Solution of a �rst order dierential equationConsider the �rst order linear time�invariant dierential equation

dx�t�dt

� ax�t� � bu�t�

y�t� � cx�t� � du�t������

The solution to ����� is given by

x�t� � eatx��� �Z t

ea�t���bu��� d� ����

That ���� is the solution to ����� is easily veri�ed by taking the derivative of����� This gives

dx

dt� aeatx��� �

d

dt

�eat

Z t

e�a�bu���d�

� aeatx��� � aeat Z t

e�a�bu���d� � eat e�atbu�t�

� aeatx��� � a

tZ

ea�t���bu���d� � bu�t�

� ax�t� � bu�t�

Page 60: Process Control

� Chapter � Analysis of Process Dynamics

0 2 4 6 8 100

1

2

b=0.5

b=1

b=2

Time t

State x

Figure ��� The solution ����� for a � �� and b � �� � and � when x�� � andu�t� � ��

0 2 4 6 8 100

0.5

1

1.5

a=-2−1

−0.5

Time t

State x

Figure ��� The solution ����� for a � ��� �� and �� when b�a � �� x�� � andu�t� � ��

The �rst term on the right hand side of ���� is the in uence of the initialvalue and the second term is the in uence of the input signal during the timeinterval from � to t� If a � � then the in uence of the initial value will vanishas t increases� Further� the shape of the input signal will in uence the solution�For instance if u�t� � u is constant then

x�t� � eatx��� �b

a�eat � ��u

The steady state value is �b�a if a � �� A change in b changes the steadystate value of x� but not the speed of the response� see Figure ���� The speedof the response is changed when a is changed� see Figure ���� The speed ofthe response becomes faster when a becomes more and more negative�

Solution of dierential equations are in general treated in courses in math�ematics� One way to obtain the solution is to �rst �nd all solutions to thehomogeneous equation� i�e� when the driving function is zero and then �ndone solution to the inhomogeneous equation� We will not use this method inthese lecture notes� since it usually gets quite complicated�

��� Laplace Transform

To solve general linear dierential equations with constant coe�cients we in�troduce a new tool� Laplace transform� This is a method that is often used inapplied mathematics� The Laplace transform gives a way to get a feel for thebehavior of the system without solving the dierential equations in detail� The

Page 61: Process Control

��� Laplace Transform ��

Laplace transform will thus make it possible to qualitatively determine howthe processes will react to dierent types of input signals and disturbances�

The Laplace transform will be used as a tool and the mathematical detailsare given in courses in mathematics�

De�nition

The Laplace transform is a transformation from a scalar variable t to a complexvariable s� In process control t is the time� The transformation thus impliesthat time functions and dierential equations are transformed into functionsof a complex variable� The analysis of the systems can then be done simply byinvestigating the transformed variables� The solution of dierential equationsis reduced to algebraic manipulations of the transformed system and the timefunctions�

Definition ����Laplace transformThe Laplace transform of the function f�t� is denoted F �s� and is obtainedthrough

F �s� � Lff�t�g �Z �

�e�stf�t� dt �����

provided the integral exists� The function F �s� is called the transform of f�t��

Remark� De�nition ����� is called the single�sided Laplace transform� In thedouble�sided Laplace transform the lower integration limit in ����� is ��� Inprocess control the single�sided transform has been used by tradition since wemostly can assume that the initial values are zero� The reason is that we studysystems subject to disturbances after the system has been in steady state�

It is also possible to go back from the transformed variables to the time func�tions by using inverse transformation�

Definition ����Inverse Laplace transformThe inverse Laplace transform is de�ned by

f�t� � L��fF �s�g � ���i

Z ��i�

��i�estF �s� ds �����

Example ����Step functionLet f�t� be a unit step function

f�t� �n � t � �� t � �

The transform is

F �s� �Z �

�e�st dt �

��e

�st

s

��

��s

Example ����Ramp functionAssume that f�t� is a ramp

f�t� �n � t � �at t � �

Page 62: Process Control

�� Chapter � Analysis of Process Dynamics

The transform is

F �s� �Z �

�ate�st dt �

a

s�

Example ����Sinusoidal functionAssume that f�t� � sin��t�� Then

F �s� �Z �

�sin��t�e�st dt

�Z �

eit � e�it

�ie�st dt

���i

��e

��s�i�t

s � i��e��s�i�t

s� i�

��

��

s� � ��

Properties of the Laplace transform

The Laplace transform of a function exists if the integral in ����� converges�A su�cient condition is thatZ �

jf�t�je�t dt �� �����

for some positive �� If jf�t�j � Me�t for all positive t then ����� is satis�edfor � � �� The number � is called the convergence abscissa�

From the de�nition of the Laplace transform it follows that it is linear�i�e�

Lfa�f��t� � a�f��t�g � a�Lff��t�g� a�Lff��t�g � a�F��s� � a�F��s�

Since the single�sided Laplace transform is used F �s� does not contain anyinformation about f�t� for t � �� This is usually not a drawback in processcontrol since we can de�ne that the systems are in steady state for t � � andlet the inputs start to in uence the systems at t � ��

One of the properties of the Laplace transform that makes it well suitedfor analyzing dynamic system is�

Theorem ����Laplace transform of a convolutionLet the time functions f��t� and f��t� have the Laplace transforms F��s� andF��s� respectively� Then

L�Z t

f����f��t� �� d�

�� F��s�F��s� �����

The theorem implies that the transform of a convolution between two signalsis the product of the transforms of the two functions� The integral on the lefthand side of ����� occurred in ���� and will show up when solving ����� and������

The following two theorems are useful when analyzing dynamical systems�

Page 63: Process Control

��� Laplace Transform ��

Theorem ����Final value theoremLet F �s� be the Laplace transform of f�t�� Then

limt��

f�t� � lims�

sF �s�

if the limit on the left hand side exists�

Theorem ����Initial value theoremLet F �s� be the Laplace transform of f�t�� Then

limt�

f�t� � lims��

sF �s�

if the limit on the left hand side exists�

These two theorems can be used to obtain steady state and starting values ofsolutions to dierential equations�

To obtain the Laplace transform of a model like ����� it is necessary toderive the transform for a time derivative of a signal�

Theorem ����Laplace transform of time derivativeLet f�t� have the Laplace transform F �s�� Then

L�df�t�dt

�� sF �s� � f���

where f��� is the initial value of the function f�t��

Proof� The theorem is proved using partial integration�

If the initial values are zero then taking the time derivative corresponds to mul�tiplication by s� If the dierential equation has initial values the expressionsbecome more complex� Appendix A contains a summary of some propertiesof the Laplace transform� From Table A�� it is� for instance� seen that inte�gration in the time domain corresponds to division by s in the transformedvariables�

The Laplace transform will be used together with a table of transformpairs for basic time functions� A table of Laplace transforms is found inAppendix A� Table A���

Solution of di�erential equations using Laplace transform

Consider the linear ordinary dierential equation with constant coe�cients

dny

dtn� a�

dn��y

dtn��� � any � b

dmu

dtm� b�

dm��u

dtm��� � bmu �����

where u�t� is a known time function such that u�t� � � for t � �� Assumethat all initial values are zero� The Laplace transform of ����� is

�sn � a�sn�� � � an� Y �s� � A�s�Y �s�

� �bsm � b�s

m�� � � bm�U�s� � B�s�U�s�������

where U�s� is the Laplace transform of u�t�� Solving for Y �s� gives

Y �s� �B�s�A�s�

U�s� � G�s�U�s� ������

Page 64: Process Control

�� Chapter � Analysis of Process Dynamics

G�s� is called the transfer function of the system� Equation ������ shows thatusing the Laplace transform it is possible to split the transform of the outputinto an input dependent part and a system dependent part�

The time function y�t� is now obtained through inverse transformation�This is not done by using ������ but by using the table of transform pairs givenin Appendix A� The �rst step is to make a partial fraction expansion of theright hand side of ������ into �rst and second order terms� Assume that

U�s� �Bf �s�Af �s�

This implies that we must compute the roots of the equations

A�s� � �

Af �s� � �

Assume the the roots are p� � � � pn and r� � � � rr respectively� If the rootsare distinct the the Laplace transform of the output can be written as

Y �s� �c�

s� p�� � cn

s � pn�

d�s � r�

� � drs � rr

������

Using the table in Appendix A and the linearity property the time function isgiven by

y�t� � c�ep�t � � cne

pnt � d�er�t � � dre

rr t

If the roots are complex it is convenient to combine the complex conjugateroots to obtain second order terms with real coe�cients� If the root pi has themultiplicity ki the time function is of the form

Pki���t�epit

where Pki���t� is a polynomial of degree less than ki� Compare Table A������

Example ����Multiple roots of A�s�Let the system be described by

Y �s� � G�s�U�s� ��

�s� ���U�s�

and let the input be an impulse� i�e�� U�s� � �� Using Table A����� gives thatthe Laplace transform

Y �s� ��

�s � ���

corresponds to the time function

y�t� �t�

�e��t

The methodology to solve dierential equations using the Laplace trans�form is illustrated using two examples�

Page 65: Process Control

��� Laplace Transform ��

Example ���Second order equationDetermine the solution to the dierential equation

d�y

dt��

dy

dt� �y � u�t� ������

where the input u�t� � � sin �t and with the initial conditions

y��� � �dy

dt� � when t � �

The dierential equation ������ can now be solved using Laplace transform�Taking the transform of the equation and the driving function gives

�s� � s� ��Y �s� ���

s� �

The transform of the output is

Y �s� ���

�s� � s� ���s� � ��

���s� ���s� ���s� � �

��

s� �� �

���

s � �� �

��s

s� � � �

���

s� �

�����

The table now gives

y�t� � e�t � ���e��t � �

��cos �t� �

��sin �t

Using the Laplace transform is thus a straight forward and easy way to solvedierential equations�

Example ���ODE with initial valueLet the system be described by

dy

dt� ay � u

with y��� � y and let u be a unit ramp� i�e� u�t� � t� t � �� Laplacetransformation of the system gives� see Appendix A�

sY �s�� y � aY �s� ��s�

Y �s� �y

s � a�

�s��s� a�

�y

s � a�

A

s� a�Bs � C

s�

The coe�cients in the partial fraction expansion must ful�ll the relation

As� � Bs� �Bas � Cs � Ca � �

which givesA � ��a�

B � ���a�C � ��a

The solution to the equation is now

y�t� � e�aty ��a�e�at � �

a��

t

a

The in uence of the initial value will decrease as t increases if a � ��

Page 66: Process Control

�� Chapter � Analysis of Process Dynamics

��� Solution of the State Equation

Hint for the reader� If you feel uncertain about matrices and eigenvaluesof matrices you should now read Appendix B before proceeding�

The previous section showed a way to solve a higher order dierential equationusing the Laplace transform� We will now see how the state equation ����� canbe solved in two dierent ways� The model ����� is described in matrix formby n �rst order dierential equations� The solution is similar to the solutionof the �rst order system in Example ����

Theorem ����Solution of the state equationThe state equation ����� has the solution

x�t� � eAtx��� �Z t

eA�t���Bu��� d�

y�t� � Cx�t� �Du�t�������

where A and B are matrices and eAt is the matrix exponential de�ned inAppendix B�

Proof� To prove the theorem ������ is dierentiated with respect to t� Com�pare Example ���� This gives

dx�t�dt

� AeAtx��� �AeAtZ t

e�AtBu��� d� � eAte�AtBu�t�

� A

�eAtx��� �

Z t

eA�t���Bu��� d�

��Bu�t�

� Ax�t� �Bu�t�

The solution thus satis�es ������

Remark� As in Example ��� the solution ������ consists of two parts� The�rst part depends on the initial value of the state vector x���� This part isalso called the solution of the free system or the solution to the homogeneoussystem� The second part depends on the input signal u over the time intervalfrom � to t�

The exponential matrix is an essential part of the solution� The characteristicsof the solution is determined by the matrix A� The matrix eAt is called thefundamental matrix or the state transition matrix of the linear system ������The in uence of the B matrix is essentially a weighting of the input signals�

The role of the eigenvalues of A

We will now show that the eigenvalues of the matrix A play an importantrole for the solution of ������ The eigenvalues of the quadratic matrix A areobtained by solving the characteristic equation

det�I � A� � � ������

The number of roots to ������ is the same as the order of A� Let us �rst

Page 67: Process Control

��� Solution of the State Equation ��

assume that the A matrix in ����� is diagonal� i�e�

A �

� � � � � � �� � � � � � ����

� � ����

� � � � � � n

� For a diagonal matrix the diagonal elements i are the eigenvalues of A� Noticethat we may allow i to be a complex number� The matrix exponential is then

eAt �

e��t � � � � � �� e��t � � � � ����

� � ����

� � � � � � e�nt

� The eigenvalues of the A matrix will thus determine the time functions thatbuild up the solution� Eigenvalues with positive real part give solutions thatincrease with time� while eigenvalues with negative real part give solutionsthat decay with time�

If A has distinct eigenvalues then it is always possible to �nd an invertibletransformation matrix T such that

TAT�� � " � diag#� � � � n$

where " is a diagonal matrix with the eigenvalues of A in the diagonal� Intro�duce a new set of state variables

z�t� � Tx�t� ������

thendz

dt� T

dx

dt� TAx� TBu � TAT��z � TBu � "z � TBu

The solution z�t� of this equation contains exponential functions of the forme�it� When we have obtained the solution z�t� we can use ������ to determinethat x�t� � T��z�t� will become linear combinations of these exponentialfunctions� We can now conclude that if A has distinct eigenvalues then thesolution x�t� to ����� will be a linear combination of the exponential functionse�it�

To give the solution to ����� for a general matrix A we need to introducethe concept of multiplicity of an eigenvalue� The multiplicity of an eigenvalueis de�ned as the number of eigenvalues with the same value� If the matrixA has an eigenvalue i with multiplicity ki then it can be shown that thecorresponding time function in eAt becomes

Pki���t�e�it

where Pki���t� is a polynomial of t with a maximum degree of ki � ��

Example ����Eigenvalues with multiplicity twoAssume that

A �

��� �� ��

Page 68: Process Control

�� Chapter � Analysis of Process Dynamics

This matrix has the eigenvalue �� with multiplicity �� The matrix exponentialis

eAt �

� e�t �� e�t

� Now change A to

A �

��� �� ��

� which also has the eigenvalue �� with multiplicity �� The matrix exponentialis now

eAt �

� e�t te�t

� e�t

� To summarize the solution of the free system is a sum of exponential functionsPki���t�e

�it where i are the eigenvalues of the matrix A� Real eigenvaluescorrespond to real exponential functions� The characteristic equation ������can also have complex roots

� � � i�

Such a root corresponds to the solution

e�t � et�it � et�cos�t� i sin�t�

How the solutions depend on � and � is treated in detail in Section ���� Eachexponential term de�nes a mode to the free system� If all eigenvalues of thematrix A have negative real part then all the components of the state vectorwill approach zero independent of the initial value� when the input is zero�The system is then said to be stable� If A has any eigenvalue with positive realpart then the system is unstable� since at least one exponential will increasewithout bounds� We will later show how we can use the eigenvalues of A todraw conclusions about the system without explicitly solving the dierentialequations�

Laplace transform solution of the state equation

The solution ������ can also be obtained using the Laplace transform� Takingthe transform of ����� gives

sX�s�� x��� � AX�s� � BU�s�

Y �s� � CX�s� �DU�s�

Notice that we include the initial value of x� Solving for X�s� gives

�sI �A�X�s� � x��� �BU�s�

X�s� � �sI � A���x��� � �sI �A���BU�s�������

Similar to the scalar case it can be shown that

L����sI �A����� eAt

See Appendices A and � Further the inverse transform of the second term inthe right hand side of ������ is a convolution

L����sI �A���BU�s���Z t

eA�t���Bu���d�

Page 69: Process Control

��� Solution of the State Equation �

We thus get

x�t� � eAtx��� �Z t

eA�t���Bu���d�

y�t� � Cx�t� �Du�t�

which is the same as �������

��� Input�Output Models

In Sections ��� and �� we have shown how the dierential equations ����� and����� can be solved� In this section we will further investigate the connectionbetween the two representations� Especially we will look for possibilities todetermine the gross features of the system without explicitly solving the dif�ferential equations� Assuming x��� � � in ������ we get the Laplace transformof the output

Y �s� ��C�sI �A���B �D

�U�s� � G�s�U�s� ������

G�s� is the transfer function of the system� The transfer function gives theproperties of the system and can be used to determine its behavior withoutsolving the dierential equations� We may write

G�s� � C�sI �A���B �D �B�s�A�s�

������

where B�s� and A�s� are polynomials in the Laplace variable s� Notice that

A�s� � det�sI �A�

i�e� the characteristic polynomial of the matrix A� see ������� The degree ofA�s� is n� where n is the dimension of the state vector� B�s� is of degree lessor equal n� By examining the eigenvalues of the matrix A or the roots of thedenominator of the transfer function we can determine the time functions thatconstitute the output of the system�

Remark� Traditionally A and B are used for notations of the matrices in����� as well as for the polynomials in ������� When there is a possibility forconfusion we will use arguments for the polynomials� i�e� we write A�s� andB�s��

From ������ and ������ we get

A�s�Y �s� � B�s�U�s�

or

�sn � a�s

n�� � � an�Y �s� �

�bs

m � b�sm�� � � bm

�U�s�

where n � m� Taking the inverse transform gives ������ The connection be�tween the state space form ����� and the input�output form ����� is summarizedby the following theorem�

Page 70: Process Control

� Chapter � Analysis of Process Dynamics

Theorem ����From state space to input�output formThe input�output form of ����� is given by

Y �s� ��C�sI �A���B �D

�U�s� �

B�s�A�s�

U�s�

whereA�s� � det�sI � A� � sn � a�s

n�� � � an

B�s� � bsm � b�s

m�� � � bm m n

Remark �� If the system has several inputs and outputs then G�s� will be amatrix� The elements in G�s� are then rational functions in s� Element �i j�gives the in uence of the j�th input on the i�th output�

Remark �� There are also ways to go from the input�output form to statespace form� This is sometimes referred to as realization theory� The state thenintroduced will� however� not have any physical meaning�

Example �����From state space to input�output formDerive the input�output relation between u and y for the system

%x �

��� �� �

� x�

� ��

� u

y �� � �

� x� �u

First compute

�sI � A��� �

� s � � ���� s

� ��

��

s� � �s� �

� s �� s� �

� Equation ������ gives

Y �s� �

�� � �� � s �

� s � �

� � �

� �s� � �s� �

� �

�U�s�

�s � �

s� � �s� �� �

�U�s� �

�s� � �s� �s� � �s� �

U�s� �B�s�A�s�

U�s�

The dierential equation relating the input and the output is thus

d�y

dt�� �

dy

dt� y � �

d�u

dt�� �

du

dt� u

For a second order system like in Example ���� it may be as easy todirectly eliminate x� and x� to obtain the input�output form� In general� itis� however� easier to use the general formula given in Theorem ���� There arealso computer programs� such as Matlab that can do the calculations�

Page 71: Process Control

��� Input�Output Models ��

Impulse response

Consider the solution ������ to the state space equation� Let the input be animpulse� i�e�

u�t� � ��t�

then

x�t� � eAtx��� �Z t

eA�t���B���� d� � eAtx��� � eAtB

andy�t� � CeAtx��� � CeAtB �D��t�

If the initial value x��� is zero then

y�t� � CeAtB �D��t� � h�t�

The function h�t� is called the impulse response of the system� The impulseresponse can physically be interpreted as the output when the input is animpulse� Once again it is seen that the fundamental matrix eAt plays animportant role� Consider the solution of the state equation when the initialvalue of the state is zero and when the input has been applied from ��� Inanalogy with ������ we get

x�t� �

tZ��

eA�t���Bu��� d�

y�t� � Cx�t� �Du�t�

Using the de�nition of the impulse response we �nd that

y�t� � C

tZ��

eA�t���Bu��� d� �Du�t�

tZ��

�CeA�t���B �D��t� ��

�u��� d�

tZ��

h�t � ��u��� d�

We have now proved the following theorem�

Theorem ���Input�output relationAssume that the process has the impulse response h�t� and that the initialvalue is zero� The output generated by the input is then given by

y�t� �Z t

��

u���h�t� �� d� �Z �

u�t � ��h��� d� ������

Remark� The impulse response h�t� is also called the weighting function�

Page 72: Process Control

�� Chapter � Analysis of Process Dynamics

0 2 4 6 8 100

0.5

1Upper tank

0 2 4 6 8 100

0.5

1Lower tank

0 2 4 6 8 100

0.5

1Upper tank

0 2 4 6 8 100

0.5

1Lower tank

0 2 4 6 8 100

0.5

1Upper tank

0 2 4 6 8 100

0.5

1Lower tank

a)

b)

c)

Figure ��� Impulse responses as function of time� The level of the upper and lowertanks of the two tank system system when the input is an impulse in the in�ow and whenT� � � � �� a� T� � ��� b� T� � �� c� T� � ����

Example �����Impulse response of a two tank system

A series connection of two liquid tanks� compare Subexample ������ and Ex�ample ����� can be described by the state equations �in linearized form�

%x �

���� ��� ���

� x�

� �

� u

y �� � �

� x

where the states are the level in the tanks� u the in ow to the upper tankand y the level in the lower tank� T� � ���� � and T� � ���� are the timeconstants of the two tanks� Figure ��� shows the impulse response for dierentvalues of T� when T� � � � �� The �gure shows the response of both tanks�The upper tank is a �rst order system with a speed that depends on the timeconstant T�� A small value of T� gives a very rapid response of the upper tankand the total system behaves almost like a �rst order system�

When T� � T� the response is smoothened and it takes some time beforethe level of the second tank reacts� When T� � T� then it is the response timeof the �rst tank that dominates the response�

Step response

The input signal is now assumed to be a unit step de�ned as

u�t� � S�t� �n � t � �� t � � ������

Page 73: Process Control

��� Input�Output Models ��

0 2T 4T 6T0

K

y

Time

Output

Figure ��� Step response of the system in Example �����

The solution ������ can now be written as

x�t� � eAtx��� �Z t

eA�t���BS��� d�

� eAtx��� � eAtA����e�At � I�B

� eAtx��� �A���eAt � I�B

The last equality is obtained since A�� and eAt commute� i�e�� A��eAt �eAtA��� See Appendix B� Finally� for x��� � � we get

y�t� � CA���eAt � I�B �D t � �

The step response of a system can easily be obtained by making a step changein the input and by measuring the output� Notice that the system must be insteady state when the step change is made� The initial values will otherwisein uence the output� compare ������� There are several ways to determinea controller for a system based on the knowledge of the step response� seeChapters and ��

Example �����Step response of a �rst order systemConsider a �rst order system with the transfer function

G�s� �K

� � Ts

and determine its step response�The Laplace transform of the output is

Y �s� �K

� � Ts

�s�K

s� KT

� � Ts

Using the table in Appendix A we get the step response

y�t� � K��� e�t�T

�������

Figure �� shows the step response of the system� The parameter T determineshow fast the system reacts and is called the time constant� A long timeconstant implies that the system is slow� From ������ we see that the steadystate value is equal to K� We call K the gain of the system� Further y�T � �K��� e��� � ����K� The step response thus reaches ��� of its steady statevalue after one time constant� The steady state value is practically reachedafter ��� time constants� Further the initial slope of the step response is%y��� � K�T � This can also be obtained by the initial value theorem�

Page 74: Process Control

�� Chapter � Analysis of Process Dynamics

Example �����Step response of liquid level storage tankThe linearized model of the liquid level storage tank was derived in Exam�ple ����� see ������� The input is the input ow and the output is the level�The transfer function is

G�s� ��

s � ������

where

� �ap

�gh

�Ah

� ��A

Equation ����� can be written as

G�s� ����s� � �

�h

ap�gh

s�Ah

ap

�gh� �

�K

sT � �

This is of the same form as transfer function in Example ���� with

K �

p�gh

ag

T �Ap�vh

ag

Figure �� can then represent the step response also for this system� The gainand the time constant depend on the process and the linearizing point h� Anincrease in the tank area A increases T � A decrease in the outlet area a willincrease K and T and the response will be slower� An increase in the levelwill also increase the gain and time constant�

The connection between G�s� and h�t�

We have shown how the response to a general input can be represented usingeither the step response or the impulse response� Equation ������ is an input�output model that is fundamental and will be used several times in the sequel�Applying ����� on ������ gives

Y �s� � L�Z t

��

u���h�t� �� d�

�� H�s�U�s� ������

where H�s� is the Laplace transform of h�t�� To obtain the second equalitywe have assumed that u�t� � � for t � �� Equation ������ also implies thatthe transfer function is the Laplace transform of the impulse response� i�e�

Lfh�t�g � H�s� � G�s�

Compare �������

Causality and steady state gain

There are several important concepts that can be de�ned using impulse andstep responses�

Page 75: Process Control

��� Input�Output Models ��

Definition ����CausalityA system is causal if a change in the input signal at time t does not in uencethe output at times t � t�

For a causal system the impulse response has the property

h�t� � � t � �

Assume that the impulse response is decaying in magnitude when t goes toin�nity such that Z �

jh�t�j dt ��

It then follows from ������ that a bounded input gives a bounded output��Such systems are called input�output stable systems� see Chapter ��

Previous in this section it was shown that the system will reach station�arity for a constant input if all eigenvalues of A have negative real part� From����� and ����� it is easy to compute the steady state gain of the process whenthe input is constant� In stationarity or steady state all the derivatives arezero� This gives the following expressions for the steady state gain when theinput is a unit step

K � �CA��B �D

�bman

�Z �

h�t� dt

The invertibility of A will be discussed in connection with stability in Chap�ter �

The steady state gain K gives the relation between the input and theoutput in steady state� If the input changes by �u then the output willchange by K�u in steady state� Compare Example ����

Di�erent representations of input�output models

The processes have been described using state space models and input�outputmodels above� The connection between the two types of descriptions wasdiscussed using the Laplace transform� The input�output model correspondingto ����� is

Y �s� ��C�sI �A���C �D

�U�s� � G�s�U�s� ������

when the initial value is equal to zero� The transfer function G�s� is thuseasily computed from the state space representation�

The transfer function can be written in several forms

G�s� �bs

m � b�sm�� � � bm

sn � a�sn�� � � an�B�s�A�s�

������

� K�s� z���s� z�� �s� zm��s � p���s� p�� �s� pn�

� K

Qmi���s� zi�Qni���s� pi�

������

� K�sl�� � Tz�s� �� � Tzm�s�sk�� � Tp�s� �� � Tpn�s�

� K�

Qm�

i���� � Tzis�

sk�lQn�

i���� � Tpis�������

�c�

s� p�� � cn

s � pn�

nXi��

cis � pi

������

Page 76: Process Control

�� Chapter � Analysis of Process Dynamics

Im s

1 Re s

i

Figure ��� Singularity diagram for the process G�s� � K�s� ����s� � �s� ���

Remark� To obtain ������ from ������ it is assumed that all roots of A�s� aredistinct� i�e� have multiplicity �� If A�s� has complex roots then pi �Tpi� arecomplex� Similar for B�s��

The denominator A�s� of G�s� is called the characteristic polynomial ofthe process and it is obtained as

A�s� � det�sI �A� �nYi��

�s� pi�

Compare ������� The roots of the characteristic polynomial pi are the poles orthe modes of the process� Notice that the poles of the system are the same asthe eigenvalues of the matrix A in the state space representation ������ Theroots of the numerator B�s� of G�s� are the zeros of the process� K � G���is the steady state gain of the process� The parameters Tpi � ���pi in ������are called the time constants of the process�

Using ������ the impulse response of the process ������ is given by

h�t� � L�� fG�s�g �nXi��

ciepit

The poles �or time constants� thus determines which exponential functionsthat are present in the time responses of the system� Apart from the modes ofthe process we also get the in uence of the modes of the input signal� compare������� The parameters ci determine the weight of each mode� The processzeros are thus an indirect measure of these weights� The poles and the zeros areimportant to determine the time response of a system� It is therefore commonto represent a process graphically by its singularity diagram� The poles arerepresented by crosses and the zeros by circles in the complex s�plane� seeFigure ���� To fully specify the transfer function from the singularity diagramit is also necessary to specify the steady�state gain of the system�

Page 77: Process Control

�� Simulation ��

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

Time

Out

put

Figure ��� Step response of the system G�s� � ��s � ����s� � �s � �� plotted usingMatlab�

��� Simulation

A full solution of a dierential equation can be complicated and it can bedi�cult to get a feel for the nature of the solution� One illustrativeway is to usesimulation to investigate the properties of a system� Through simulation it ispossible to �nd out how dierent parameters in uence the solution� Simulationis therefore a very good complement to analytical methods�

The simulation package Simulink developed by MathWorks is one com�monly used general simulation package� Simulink is based on a graphicalinterface and block diagram symbols� Transfer functions� poles and zeros�step responses� and impulse responses are easily computed directly in Matlab�Simulations will be used throughout the lecture notes to investigate systemsand dierent types of controllers�

Example �����Step response simulation using MatlabThe step response of the system in Figure ��� for K � � can be obtained inMatlab using the commands

K���

A��� � ���

B��� ���

sys�tfKB�A��

�y�t�x��stepsys� ��

plott�y�

xlabel�Time��

ylabel�Output��

The step response is plotted in Figure ����

Page 78: Process Control

�� Chapter � Analysis of Process Dynamics

Σ

Σ

G1 G2

G1

G2

G1

−G2

Figure �� Three basic connections of subsystems�

�� Block Diagram Representation

A control system often consists of several subsystems� These may be dierentparts of the process� sensors� controllers� and actuators� It is thus importantto be able to describe the full system� Block diagrams and transfer functionsare good tools in this aspect� For linear systems each subsystem �block� can bedescribed by a transfer function� The subsystems can be connected in dierentways� There are three basic couplings�

� Series connection

� Parallel connection

� Feedback

See Figure ���� Let each subsystem have the transfer function Gi and let thetotal transfer function from the input to the output be G�

Series connection�G�s� � G��s�G��s�

Parallel connection�G�s� � G��s� �G��s�

Feedback�

G�s� �G��s�

� �G��s�G��s�

When connecting the subsystems it is necessary that the dierent systems donot load each other or interact� This implies� for instance� that the outputsignal of the �rst block in the series connection does not change when the sub�system G� is connected� Figure ��� shows two examples with noninteractionand interaction� The two tanks in ����b� are interacting� since the level in the�rst tank is dependent of the level in the second tank� If there is an interaction

Page 79: Process Control

�� Block Diagram Representation �

a) b)

Figure �� Two systems of connected tanks� a� Noninteracting tanks� b� Interactingtanks�

Σ Controller Actuator Subprocess 1

Subprocess 2

Sensor

Reference Output

Figure ��� Subdivision of a system into smaller blocks�

between subsystems it is necessary to treat them as one system� For instance�the two tanks in Figure ����b� must be treated together�

Example �����Subdivision of a systemIn the modeling phase it is advantageous to divide the system into severalsubprocesses� This makes it possible to build up a library of standard units�The units are then connected together into the total system� Figure ��� showsa typical blockdiagram with blocks for subprocesses� sensor� controller andactuator� for instance a value�

The three basic couplings can be used to simplify a complex system toderive the total transfer function from the input to the output� A straightforward way to derive the total transfer function from inputs to the outputis to introduce notations for the internal signals and write down the relationsbetween the signals� The extra signals are then eliminated one by one untilthe �nal expression is obtained� Another way to simplify the derivation is theso called backward method� The method can be used on systems without innerfeedback loops�

Example �����The backward methodConsider the system in Figure ���� and derive the total transfer function fromU�s� and V �s� to Y �s�� Start from the output end of the block diagram andwrite down the expression for the Laplace transform of the output� This isexpressed in signals coming from the left� These signals are then expressed inother signals and so on� For the example we have

Y �s� � G��V � Y��

� G��V � G�E�

� G��V � G��H�U �H�Y ��

Page 80: Process Control

� Chapter � Analysis of Process Dynamics

Σ ΣY (s)

V (s)

E (s)U (s) Y1(s)G1(s) G2(s)

s( )

H1(s)

−H2

Figure ���� The system in Example �����

Σ

V(s)

U(s) Y(s)

Gd (s)

Gp (s)

Figure ���� Block diagram of process with input and disturbances�

After some training it is easy to write down the last expression directly withoutintroducing the internal variables Y� and E� The expression for the Laplacetransform of the output is now given as

Y �s� �G�G�H�

� � G�G�H�U�s� �

G�

� �G�G�H�V �s�

�� Frequency Domain Models

Hint for the reader� The material in this section is not needed until thediscussion of stability in Section ��

Motivation

Periodic or oscillatory signals are usually unnatural in chemical engineeringapplications� For electrical and mechanical processes it is more natural todiscuss responses of systems to sinusoidal inputs� The frequency domain ap�proach is� however� a very useful way to get an additional way to analyze adynamical system� The frequency response that will be introduced below canbe interpreted as a frequency dependent &gain' of the process� The frequencyresponse makes it possible to determine which frequencies that will be ampli��ed or attenuated� Based on the frequency response of an open loop system itis easy to determine if a closed loop system is stable or not� It is also possibleto determine suitable controllers based on the frequency response� Finally� themethod gives a new interpretation of the transfer function of the system�

Figure ���� shows a block digram of a process with disturbances� Theinput u�t� and the disturbance v�t� act on the process via the transfer functionsGp�s� and Gd�s�� respectively� The disturbance can� for instance� be a step� an

Page 81: Process Control

��� Frequency Domain Models ��

impulse� or a periodic signal� The steady state in uence of a step disturbanceis given by the steady state gain Gd���� The disturbance may also be periodic�Examples of periodic or almost periodic disturbances are

� Measurement noise due to hum from the power supply�

� Unbalances in rotating mechanical parts�

� In uence of daily variation in outdoor temperature�

� Variation in feed concentration to a unit process�

In Section ��� we showed how a linear system could be characterized by givingits step or impulse response� In this section we will investigate how periodicinputs or disturbances in steady state are in uencing the output of the process�An example is given before the general results are derived�

Example ����Frequency response of a �rst order systemAssume that the process is described by

Y �s� � G�s�U�s� �b

s� aU�s� ������

where a � � and assume that the input signal is a sinusoidal signal u sin�t�The Laplace transform of the input is

U�s� �u�

s� � ��

This gives

Y �s� �b

s� a

u�

s� � ��

�bu�

�� � a�

��

s� a�

a� s

s� � ��

The �rst part on the right hand side has an inverse transform which is adecaying exponential since a � �� This part will thus vanish as t increases� Thesecond term represents sinusoidal signals with frequency �� Asymptoticallywe get

ya�t� � bu

�a

�� � a�sin�t � �

�� � a�cos�t

�� uA��� sin��t� �����

where

A��� �bp

�� � a�������

���� � � arctan�

a� n� ������

The derivation above shows that asymptotically the response to a sinusoidalinput is a sinusoidal output with the same frequency but with a change inamplitude and phase� The excitation with a single frequency forces the outputto vary with the same frequency� To derive the result we used that the systemis linear and stable� We can thus regard the sinusoidal response determined byA��� and ���� as frequency dependent gain and phase shift� The responsesof the system ������ to sinusoidal inputs of dierent frequencies are shown in

Page 82: Process Control

�� Chapter � Analysis of Process Dynamics

0 10 20 30 40 50

−2

0

2omega=0.2

0 10 20 30 40 50

−2

0

2omega=1

0 10 20 30 40 50

−2

0

2omega=5

Time t

Time t

Time t

Figure ���� The input �dashed� and output �full� when the signal sint is applied tothe system ����� with zero initial value when a � � b � � and �a� � ��� �b� � ���c� � ��

Figure ����� The in uence of the transient is seen in Figure ����� In the �gurey��� �� �� but there will be a transient even when y��� � �� This is due tothe response from the stable pole in �a� The gain and phase as functions ofthe frequency is given in Figure ���� The amplitude of the output A��� isdecreasing with increasing input frequency� The phase dierence between theinput and the output is increasing with increasing frequency�

Using the same idea as in the example it is possible to derive the sinusoidalresponse of a general stable system� Let the system have the transfer functionG�s�� which has all poles in the left half s�plane� The system is of order n�The Laplace transform of the output is now

Y �s� � G�s�u�

s� � ��

�nX

j��

cjs � pj

�d�

s� i��

d�s� i�

�����

The coe�cients d� and d� can be obtained by multiplying ����� by s � i�and s � i� respectively and evaluating the result for s � �i� and s � i�respectively� This gives

d� � �u�iG��i��

d� �u�iG�i��

The asymptotic time function is then

ya�t� �u�i

��G��i��e�it �G�i��eit�

������

Page 83: Process Control

��� Frequency Domain Models ��

0 2 4 6 8 10

−1

0

1

Input u

0 2 4 6 8 10−1

0

1

2

Output y

Time t

Time t

Figure ���� The input and output when the signal sint is applied to the system �����when a � � b � � � � and y�� � ��

0 5 10 15 200

1

2

Amplitude

0 5 10 15 20−100

−60

−20

Phase

a)

b)rad/s

rad/s

Figure ���� The frequency dependence �in linear scales� of �a� the gain A�� given by������� �b� the phase shift given by �������

G�i�� and G��i�� are complex numbers that can be expressed in Cartesianor polar coordinates� see Figure ����� If the complex number is written in

Page 84: Process Control

�� Chapter � Analysis of Process Dynamics

Im

b

a Re

ϕ

−ϕ

G(iω)

G(−iω)

G(iω) = a+ib

G(−iω) = a−ib

Figure ���� Polar representation of G�i� and G��i��

Cartesian coordinates G�i�� � a� ib then

jG�i��j�pa� � b�

argG�i�� � � � arctanb

a

In polar coordinates

G�i�� � jG�i��jei G��i�� � jG��i��je�i � jG�i��je�i

where jG�i��j is the absolute value and � is the argument of G�i��� Equation������ can now be written as

ya�t� � ujG�i��jei�t� �� e�i�t� �

�i� ujG�i��j sin��t� �����

We have thus shown that the gain or amplitude function is given by

A��� � jG�i��j ������

and the argument or phase function is given by

���� � argG�i�� � arctanImG�i��ReG�i��

������

The derivation shows that the asymptotic response to a sinusoidal input is asinusoidal output with the same frequency� The amplitude and phase changesare determined by the transfer function� The function G�i�� is the transferfunction evaluated along the positive imaginary axis� i�e�� for s � i�� Thisfunction is called the frequency function or the frequency response of the pro�cess� The physical interpretation of the frequency function is how easy or dif��cult it is for signals of dierent frequencies to pass through the system� This

Page 85: Process Control

��� Frequency Domain Models ��

Im

Reω ∞=

ω

ω = 0

ba

Figure ���� Nyquist diagram of a �rst order system�

knowledge is important to be able to determine how signals and disturbancesof dierent nature will in uence the output of the system� The frequency curveof the process also determines how fast it is possible to control the system�

Applying sinusoidal signals to a process and measuring the asymptoticresult is one way of experimentally determining the transfer function of aprocess� This is a method that is easy to use� for instance� on electrical circuitsand systems� In chemical process control applications it is more di�cult touse the frequency response method for identi�cation� Some of the reasons are�for instance� the di�culty to operate the process in open loop when sinusoidalinputs are fed into the system� Further� the time constants are usually quitelong� This implies that it takes long time before the transient has vanished�The procedure must then be repeated for many dierent frequencies� Evenif the transfer function is not determined by applying periodic signals to theprocess the frequency function contains much information about the process�It is thus important to be able to qualitatively determine the response of thesystem by &looking' at the frequency function� Several design methods arebased on manipulations of the frequency function� The frequency function isusually presented graphically using Nyquist diagram or Bode diagram�

Nyquist diagram

The Nyquist diagram is a plot of the frequency function G�i�� in the complexplane� The amplitude and phase �or equivalently the real and imaginary parts�are plotted as functions of the frequency� Drawing the Nyquist diagram byhand is usually time consuming and is preferably done using a computer�

Example ����Nyquist diagram of a �rst order systemThe Nyquist diagram of the �rst order system in Example ���� is shown inFigure ����� In this example the frequency function is half a circle with diam�eter jb�aj�

Bode diagram

It is usually quite time consuming to draw the Nyquist curve of a system with�out using a computer� The construction of the frequency curve is� however�easier if the amplitude and the phase are drawn separately as functions of thefrequency using logarithmic diagrams� This is called a Bode diagram� Theamplitude curve gives log jG�i��j as function of log�� The phase curve shows���� as function of log�� There are dierent standard units to measure theamplitude� We will use the unit decilog �dl� de�ned as

�� decilog � log ��

Page 86: Process Control

�� Chapter � Analysis of Process Dynamics

Other units are decibel �dB�� and neper �N�� Their relations are

�� dl � �� dB � ����� N

The frequency is measured in rad�s and the phase in radians or degrees� Fur�ther� we introduce the notations octave and decade to indicate a doubling anda tenfold change� respectively� in the frequency�

Guidelines for drawing Bode diagrams

We will now give some guidelines how to draw or sketch a Bode diagram� It is�rst assumed that the transfer function is of �nite order� The transfer functioncan then be factorized as

G�s� � K� �s� z���s� z�� �s� zm�sk�s� p���s� p�� �s� pl�

� K�� � Tz�s��� � Tz�s� �� � Tzms�sk�� � Tp�s��� � Tp�s� �� � Tpls�

Complex poles or zeros can be written on the form

s� � ���s� ��

or

� � ��sT � �sT ��

A �nite order system can thus be written as a product of factors of the form

K

sn

�� � sT �n

�� � ��sT � �sT ���n

where n is a positive or negative integer� The logarithm of the transfer functionis a sum of logarithms of such factors� i�e�

log�G�G� Gn� � logG� � logG� � � logGn ������

Further for the argument we have the relation

arg�G�G� Gn� � argG� � argG� � � argGn ������

The total Bode diagram is thus composed of the sum of the Bode diagrams ofthe dierent factors� Equations ������ and ������ also explains the choice ofthe scales of the axis of the Bode diagram�

Bode diagram of G�s� � K� If G�s� � K and K � � then log jG�i��j �logK and argG�i�� � �� If K � � then argG�i�� � ��� The Bode diagramis thus two straight horizontal lines� Figure ���� shows the Bode diagram ofG�s� � �� The magnitude is constant and the phase is �� for all frequencies�

Page 87: Process Control

��� Frequency Domain Models ��

100

101

10-1 100 101

Mag

nitu

de

-50

0

10-1 100 101

Phas

e [d

eg]

Frequency [rad/s]

100

101

10-1 100 101

-50

0

10-1 100 101

Figure ��� Bode diagram for the transfer function G�s� � ��

Bode diagram of G�s� � sn� In this case

log jG�i��j � n log�

argG�i�� � n���

The argument curve is thus a horizontal straight line� The amplitude curveis also a straight line with the slope n in the logarithmic scales� Figure ����shows the Bode diagram of G�s� � ��s�� The slope of the magnitude is �� inthe log�log scales� The phase is constant ������Bode diagram of G�s� � �� � sT �n� For this type of terms we have

log jG�i��j � n logp� � ��T �

argG�i�� � n arctan�T

When �T � � it follows that log jG�i��j � � and argG�i�� � �� For highfrequencies� �T � �� we get log jG�i��j � n log�T and argG�i�� � n����The amplitude curve has two asymptotes

log jG�i��j� � low frequency asymptotelog jG�i��j� n log�T high frequency asymptote

The low frequency asymptote is horizontal and the high frequency asymp�tote has the slope n� The asymptotes intersect at � � ��jT j� which is calledthe break frequency� The argument curve has two horizontal asymptotes

argG�i�� � � low frequency asymptoteargG�i�� � n�

� TjT j high frequency asymptote

The Bode diagram for n � � is shown in Figure ����� There is a good agree�ment between the amplitude curve and the asymptotes except around thebreak frequency�

Page 88: Process Control

�� Chapter � Analysis of Process Dynamics

10-2

10-1

100

101

102

10-1 100 101

Mag

nitu

de

-200

-150

-100

-50

0

10-1 100 101

Phas

e [d

eg]

Frequency [rad/s]

10-2

10-1

100

101

102

10-1 100 101

-200

-150

-100

-50

0

10-1 100 101

Figure ��� Bode diagram for the transfer function G�s� � ��s��

100

101

10-1 100 101

Mag

nitu

de

0

20

40

60

80

100

10-1 100 101

Phas

e [d

eg]

Frequency [rad/s]

100

101

10-1 100 101

0

20

40

60

80

100

10-1 100 101

Figure ���� Bode diagram for the transfer function G�s� � � � sT �

Page 89: Process Control

��� Frequency Domain Models �

10-1

100

101

10-1 100 101

Mag

nitu

de

-150

-100

-50

0

10-1 100 101

Phas

e [d

eg]

Frequency [rad/s]

10-1

100

101

10-1 100 101

-150

-100

-50

0

10-1 100 101

10-1

100

101

10-1 100 101

-150

-100

-50

0

10-1 100 101

10-1

100

101

10-1 100 101

-150

-100

-50

0

10-1 100 101

10-1

100

101

10-1 100 101

-150

-100

-50

0

10-1 100 101

10-1

100

101

10-1 100 101

-150

-100

-50

0

10-1 100 101

10-1

100

101

10-1 100 101

-150

-100

-50

0

10-1 100 101

Figure ���� Bode diagram for the transfer function G�s� � ���� � ��sT � s�T �

�when

�� �� �� �� � and �� � � gives the upper magnitude curve and the steepest phasecurve�

Bode diagram of G�s� � �� � ��sT � s�T ��n� In this case

log jG�i��j � n

�log��

�� ��T ���

� ����T ��

argG�i�� � n arctan

����T

�� ��T �

The amplitude curve has two asymptotes

log jG�i��j� � low frequency asymptotelog jG�i��j� �n log�T high frequency asymptote

The asymptotes intersects at the break frequency � � ��T � The argumentcurve has two horizontal asymptotes

argG�i�� � � low frequency asymptoteargG�i�� � n� high frequency asymptote

Figure ���� shows the Bode diagram for n � ��� The deviation of the ampli�tude curve from the asymptotes can be very large and depends on the damping��

The Bode diagram of a rational �nite�order transfer function can now beobtained by adding the amplitude and phase curves of the elementary factors�

Page 90: Process Control

Chapter � Analysis of Process Dynamics

loglGl Break points

2

0

2

3

0.1 0.5 1 2 ω

− 2

Figure ���� Construction of the Bode diagram for the transfer function

G�s� � ����s������

s��s����s�������s���in Example �����

Example �����Drawing a Bode diagramThe procedure to draw a Bode diagram is illustrated on the system

G�s� �����s� �����

s��s� � ��s� ������s� ��

�������� ��s��

s� �� � � ����s� � ��s��� �� � ���s�

�����

The diagram is obtained from the elementary functions

G��s� � ����s��

G��s� � �� � ��s��

G��s� ��� � � ����s� � ��s��

���G��s� � �� � ���s���

The break frequencies of the transfer function are � � ���� ���� and �� Theasymptotes of the amplitude curve are straight lines between the break fre�quencies� For low frequencies G�s� � ���� s��� The slope of the low fre�quency asymptote is thus ��� It is also necessary to determine one point onthe asymptote� At � � � we have

log jG�i�j� log ���� � �� � ��� �dl�

Another way to determine a point on the asymptote is to determine when theasymptote crosses the line jG�i��j� �� i�e�� when log jG�i��j � �� In this casewe get � � ���� The low frequency asymptote can now be drawn� see Figure����� The lowest break frequency at � � ��� corresponds to a double zero �thefactor G� above�� The slope of the asymptote then increases to � after thisbreak frequency until the next break frequency at � � ���� This correspondsto the factor G�� which has two complex poles� At this frequency the slopedecreases to ��� The last break frequency at � � � corresponds to the factorG�� which is a single pole� The slope then becomes ��� The construction of

Page 91: Process Control

��� Frequency Domain Models �

10-3

10-2

10-1

100

101

102

10-2 10-1 100 101

Mag

nitu

de

-300

-250

-200

-150

-100

-50

10-2 10-1 100 101

Phas

e [d

eg]

Frequency [rad/s]

10-3

10-2

10-1

100

101

102

10-2 10-1 100 101

-300

-250

-200

-150

-100

-50

10-2 10-1 100 101

Figure ���� The Bode diagram of the transfer function G�s� � ����s������

s��s����s�������s���in

Example �����

the asymptotes is now �nished and can be checked by observing that at highfrequencies log jG�i��j � �� log� � log ���� The slope of the high frequencyasymptote is thus �� and it has the value jG�i��j� ������ at � � ���

It is easy to construct the asymptote of the amplitude curve� The �nalshape of the amplitude curve is obtained by adding the contributions of thedierent elementary factors� It is only necessary to make adjustments aroundthe break frequencies� To make the adjustments we can use the standardcurves in Figures ���� and ����� The phase curve is obtained by adding thephase contributions for the dierent factors� This has to be done graphicallyand is more time consuming than drawing the asymptotes� The complete Bodediagram for the system ����� is shown in Figure ����� The frequency �c forwhich

jG�i�c�j � �

is called the cross�over frequency� For comparison the Nyquist diagram isshown in Figure �����

The example above shows that it is easy to sketch the Bode diagram� but it canbe time consuming to draw it in detail� There are many computer programsthat can be used to draw Bode diagrams� One example is Matlab� It is�however� important to have a feel for how both Nyquist and Bode diagramsare constructed�

Time delays are important modeling blocks� A time delay has the non�rational transfer function� see Appendix A�

G� �s� � e�s� �����

Page 92: Process Control

� Chapter � Analysis of Process Dynamics

-5

-4

-3

-2

-1

0

1

-5 -4 -3 -2 -1 0 1

Im

Re

Figure ���� The Nyquist diagram of the same system as in Figure �����

-150

-100

-50

0

10-1 100 101

Phase

Figure ���� Bode diagram �phase only� for the time delay ������ when � � ��

The frequency curve is de�ned by

jG��i��j � je�i� j � �

argG��i�� � arg e�i� � ��� �rad�

The amplitude curve is thus a horizontal line and the phase is decreasing withincreasing frequency� See Figure ����

Nonminimum phase systems

The frequency responses of the time delay ����� and of G�s� � � have thesame amplitude functions� but dierent phase functions� This implies thatit is not possible to determine the amplitude function uniquely if the phasefunction is given� H� W� Bode has shown that the following is true

argG�i��� ����

Z �

log jG�i��j � log jG�i���j�� � ���

d� �����

Page 93: Process Control

��� Frequency Domain Models �

0 2 4 6 8 10−1

0

1

b=-1

0.5

1

2

Time t

Output

Figure ���� Step response of the system ������ for di�erent values of b�

Equation ����� is called Bodes relation� A system for which equality holds iscalled a minimum phase system� If the phase curve is below the upper limitgiven by ����� the system is called a nonminimum phase system�

Example �����Nonminimum phase systemsThe time delay ����� and

G�s� ��� s

� � s

are nonminimum phase systems�

Nonminimum phase systems are in general di�cult to control� The reason isthat such systems have extra phase shifts which will in uence the stabilityproperties of a closed loop system� All systems with right half plane zeros arenonminimum phase systems� Many nonminimum phase systems are inverseresponse systems� i�e� the step response starts in the &wrong direction'� Thiswill also make it di�cult to control a nonminimum phase system�

Example �����Inverse response systemConsider the system

G�s� ��� bs

�� � s�������

The step response is shown in Figure ���� for some values of b� The system isnonminimum phase and has an inverse response when b � ��

��� Transients and Frequencies

It is possible to get a quite good feel for the response of a system to dierentinput signals without solving the dierential equations� This is obtained byusing the relation between the time responses and the poles and the zeros

Page 94: Process Control

� Chapter � Analysis of Process Dynamics

of the transfer function of the system� It is also useful to look at the Bodediagram of the system� We will here assume that the system is described by atransfer function that is given in any of the forms �������������� the singularitydiagram� or the Bode diagram�

Stability and steady state response

The step response or impulse response are obtained by calculating the inverseLaplace transforms� From the solution of dierential equations discussed inSections ��� and �� we know that the dierent poles pi give rise to timeresponses of the form exp�pit�� Poles with negative real parts give stableresponses �decaying in magnitude�� while poles with positive real parts leadto time signals that grow in magnitude without bounds�

The steady state value of the step response can be obtained from the �nalvalue theorem �Theorem ���� or equivalently from G���� provided the systemis stable�

Transients

By the transient of a systemwe mean the time from the application of the inputuntil the system has reached or almost reached a new steady state value� Thetransient is dominated by the poles that are closest to the origin or equivalentlyby the longest time constants of the system� By determining the poles fromthe transfer function or from the singularity diagram it is possible to get a feelfor the time scale of the system� This knowledge can also be obtained fromthe break frequencies in the Bode diagram of the system�

If the system has several time constants Ti we can de�ne an equivalenttime constant of the system as

Teq �nXi��

Ti

The transient of the system is then ��� time the equivalent time constant�compare Example ����� Another way to measure the length of the transientis the solution time� This is usually de�ned as the time it takes before theresponse is within � � of its steady state value�

Example �����Solution time of �rst order systemConsider the �rst order system in Example ����� The time to reach within��� of the �nal value is the ��� solution time� and is given by

K��� e�Ts�T

�� ����K

orTs � �T ln ���� � �T

The solution time to reach ��� of the steady�state value is analogously givenby

Ts � �T ln ���� � �T

Page 95: Process Control

��� Transients and Frequencies �

0 2 4 6 8 100

1

2

3

Tz1=5

Tz1=2.5

Tz1=1

Tz1=0

Time t

Output

Figure ���� Step response of ������ for di�erent values of Tz��

In�uence of zeros

It is much more di�cult to determine the in uence of a zero then the in uenceof a pole� From ������ we see that the zeros are a measure of the weight ofthe dierent modes of the system� Let the system be described by

G�s� � �� � Tz�s�G�s� ����

The in uence of Tz� will now be determined� The step response is given by

y�t� � L��fG�s��sg� Tz�L��fG�s�g

The response is a weighted sum of the step and impulse responses of the systemG�s�� �Remember that the impulse response of a system is the derivative ofthe step response�� The step response of ���� is dominated by the stepresponse of G when Tz� is small� For large values of Tz� the shape of the stepresponse of ���� is dominated by the impulse response of G�

Example �����In uence of a zero in the step responseConsider the system

G�s� � �� � Tz�s��

�s� ���s� �������

The step response of ����� for dierent Tz� is shown in Figure �����

Page 96: Process Control

� Chapter � Analysis of Process Dynamics

Im s

Re s

Cricket Software

ζω0

ω0 ωd

Figure ��� The poles of the transfer function �������

0 5 10 150

0.5

1

1.5

2

om*t

z=0z=0.1

z=0.3

z=0.7

z=1

z=2

Figure ��� The step response of the system �������

Frequencies

The Bode diagram show the amplitude and phase changes when a sinusoidalsignal is fed into the system� If the Bode diagram has peaks then the systemwill amplify signals of these frequencies� Compare Figure ����� A step is asignal that contains many dierent frequencies� Some of these frequencies willbe more ampli�ed than others and this can be seen in the step response of thesystem� The speed of the response also depends on the frequency response�The higher frequencies the system lets through the faster the response of thesystem will be� The speed of the response will thus depend on the cross�overfrequency� �c� of the system�

Example �����Second order systemLet the system have the transfer function

G�s� ���

s� � ���s � �������

The location of the poles are shown in Figure ����� The step responses fordierent values of � are shown in Figure ����� The step response is less and lessdamped the lesser the parameter � is� This parameter is called the dampingof the system� The frequency of the response of the system when � � � is�� The parameter � is called the natural frequency of the system� Using theLaplace transform table in Appendix A we �nd that the frequency in the step

Page 97: Process Control

��� Transients and Frequencies �

(a) (b)

(c) (d)

(e) (f)

1 1

11

1 1

Figure ���� Singularity diagram for systems with the transfer functions �a� �s�� � �b�

�s�s���

� �c� �s�� �d� �

�s����� �e�

���

s������s���

when � � ��� and � � ��� �f�� �s��

� ��s����

response is�d � �

p�� ��

This frequency is called the damped frequency of the system� The peak in theBode diagram of ������ see Figure ����� occurs at �d� The oscillation periodof the response for � � � is Td � ����d� The solution time of ����� is

Ts � ���

� � � � ���

Figures ��������� show the singularity diagrams� the step responses� the im�pulse responses� and the Bode diagrams for six dierent systems� From theexamples it is possible to see some of the connections between the dierentrepresentations of a system�

Page 98: Process Control

� Chapter � Analysis of Process Dynamics

0 2 4 6 8 100

0.5

1

0 2 4 6 8 100

40

0 5 10 15 200

1

2

0 2 4 6 8 100

5

10

0 5 10 15 200

0.5

1

0 5 10 15 20−1

0

1

a)

c)

e)

b)

d)

f)

Figure ���� Step responses as functions of time for the systems with the transfer func�tions in Figure �����

0 2 4 6 8 100

0.5

1

0 2 4 6 8 100

5

10

0 5 10 15 20−1

0

1

0 2 4 6 8 100

0.5

1

0 5 10 15 200

0.2

0 5 10 15 20−1

0

1

a)

c)

e)

b)

d)

f)

Figure ���� Impulse responses as functions of time for the systems with the transferfunctions in Figure �����

��� Summary

In this chapter we have given many tools which can be used for analysisof process dynamics� Starting from the modeling in Chapter � we obtainedstate space �internal� or input�output models� Using ������ it is possible to

Page 99: Process Control

���� Summary

10-1

100

10-1 100 101

Magnitude

-100

-80

-60

-40

-20

0

10-1 100 101

Phase

10-2

10-1

100

101

10-1 100 101

Magnitude

-200

-150

-100

10-1 100 101

Phase

a) b)

10-2

10-1

100

101

102

10-1 100 101

Magnitude

-200

-150

-100

10-1 100 101

Phase

10-3

10-2

10-1

100

101

10-1 100 101

Magnitude

-400

-300

-200

-100

0

10-1 100 101

Phase

c) d)

10-2

10-1

100

101

10-1 100 101

Magnitude

-200

-150

-100

-50

0

10-1 100 101

Phase

10-1

100

101

10-1 100 101

Magnitude

-300

-200

-100

0

10-1 100 101

Phase

e) f)

Figure ���� Bode diagrams for the systems with the transfer functions in Figure �����

Page 100: Process Control

� Chapter � Analysis of Process Dynamics

transform from state space form for a higher order dierential equation or atransfer function form�

Using the models we can analyze the properties of the systems� For in�stance� we can look at the response solving the dierential equations� Thisis done using Theorem ��� or the Laplace transform method� In Section ����Eq� ������� we found that the response of a system subject to a general inputsignal can be divided into two parts� One part depends on the property ofthe system� poles and zeros� and one part depends on the type of input signalthat is acting on the system� One key observation is that the eigenvalues ofthe matrix A in ����� are the same as the poles of the transfer function�

The observations above make it possible to get a qualitative feel for howthe system will respond to a change in the input signal� This is done without�nding the full solution of the dierential equations� The steady state gain�poles� and zeros reveal the gross behavior and time scales of a system�

The frequency response G�i�� is another way of representing a process�G�i�� determines how a sinusoidal signal is ampli�ed and delayed when passingthrough a system� There are also good design tools that work directly withthe frequency curve either in a Nyquist or a Bode diagram�

To be able to construct good controllers for a system it is necessary tomaster the dierent kinds of representations and to have a knowledge aboutthe relation between them�

Page 101: Process Control

Feedback Systems

GOAL� The idea of feedback is introduced� It is shown how feedback

can be used to reduce in�uence of parameter variations and process

disturbances� Feedback can also be used to change transient proper�

ties�

��� The Idea of Feedback

The idea of feedback was introduced in Chapter �� It was shown� for a staticand a �rst order system� that feedback can be used to change the propertiesof a system� This idea will now be generalized and new properties of feed�back systems will be derived and analyzed� The dierent properties are �rstillustrated on some simple examples before the general problems are discussed�

Feedback control systems and their general properties are discussed inSection ��� The simplest form of feedback is on�o control� This type ofcontrol is� for instance� implemented using a relay� On�o control is discussedin Section ��� In the example in Chapter � it was found that the propertiesof the feedback system became better when the gain in the controller wasincreased� In general� it is not possible to use a very high gain in the controllersince the system may start to oscillate or become unstable� Stability is de�nedand ways to investigate stability are introduced in Section ��

A temperature control system

We will now investigate the eects of feedback on a simple example� A modelfor a continuous stirred tank heater was derived in Example ���� The processis shown in Figure ��� Assuming constant heat capacity and mass density weget the model� see ������

V �CpdT �t�dt

� v�Cp�Tin�t�� T �t�� � Q�t�

where � is the density� V the volume of the tank� Cp speci�c heat constant ofthe liquid� and v the volume ow rate in and out the tank� Let the input bethe heat Q into the system and the output the liquid temperature T in thetank� The disturbance is the input temperature Tin� It is convenient to regard

��

Page 102: Process Control

�� Chapter � Feedback Systems

Q

Temperature T

v, Tin

v, T

Figure ��� Stirred tank heater process�

ΣK1

1+T1s

Q(s)

T in(s)

T(s)

Figure ��� Block diagram of the stirred tank heater process�

all variables as deviations from stationary values� For instance� Tin � � thenimplies that Tin is at its normal value� The system can also be written as

T�dT �t�dt

� T �t� � KQ�t� � Tin�t� ����

The process gain K and the time constant T� of the process are given by

K ��

v�CpT� �

V

v

Notice that the time constant T� has dimension time� Taking the Laplacetransform of the dierential equation ���� gives

T �s� �K

� � T�sQ�s� �

�� � T�s

Tin�s� ����

The system can be represented by the block diagram in Figure ��� We willassume that the parameters and the time scale are such that K � � andT� � �� The purpose is to use the input Q�t� to keep the output T �t� close tothe reference value Tr�t� despite the in uence of the disturbance Tin�

We will now investigate the dynamic behavior of the output temperature�when the reference value Tr and the disturbance Tin are changed�

Open loop response

Assume that the input Q is zero� i�e� no control� and that the disturbance isa unit step� I�e�� the inlet temperature is suddenly increased� Notice that thedesired value in this case is Tr � �� We don�t want T to deviate from thisvalue�

The Laplace transform of the output is

T �s� ��

� � T�s �s

and the time response is� see Table A������

T �t� � �� e�t�T�

Page 103: Process Control

��� The Idea of Feedback ��

0 1 2 3 4 50

0.5

1

1.5 Output

0 1 2 3 4 5

−2

−1

0

Input

Tin

Kc=0Kc=1Kc=2Kc=5

Kc=0Kc=1Kc=2Kc=5

Time t

Time t

Figure ��� The temperature of the system ����� and the control signal when the dis�turbance is a unit step at t � � for di�erent values of the gain in a proportional controllerKc � � � and �� The desired reference is Tr � � Kc � gives the open loop response�

The temperature in the tank will approach the inlet temperature as a �rstorder system� The output is shown in Figure ��� �The curve when Kc � ���The change in the input temperature will cause a change in the tank temper�ature� The new steady state value will be the same as the input temperature�Physically this is concluded since all the liquid will eventually by replaced byliquid of the higher temperature� This is also found mathematically from ����by putting the derivative equal to zero and solving for T � The time to reachthe new steady state value is determined by the time constant of the openloop system T�� It takes ��� time constants for the transient to disappear�

Proportional control

A �rst attempt to control the system is to let the input heat Q be proportionalto the error between the liquid temperature and the reference temperature�i�e� to use the proportional controller

Q�t� � Kc�Tr�t�� T �t�� � Kce�t� ����

If the temperature is too low then the heat is increased in proportion to thedeviation from the desired temperature� Kc is the �proportional� gain of thecontroller� Figure �� also shows the response and the control signal whenusing the controller ���� for dierent values of the controller gain� The steadystate error will decrease with increasing controller gainKc� We also notice thatthe response becomes faster when the gain is increased� This is easily seen byintroducing ���� into ����� This gives

T�dT �t�dt

� T � KKc�Tr�t�� T �t�� � Tin�t�

Page 104: Process Control

�� Chapter � Feedback Systems

orT�

� �KKc

dT �t�dt

� T �KKc

� �KKcTr�t� �

�� �KKc

Tin�t� ���

If we assume that Tr � � we see that in steady state

T ��

��KKcTin

The error thus decreases with increasing controller gain� Equation ��� is alsoa �rst order dierential equation with the new time constant

T�c �T�

� �KKc

This implies that the speed increases with increasing controller gain� Theproportional controller will� for this process� always give a steady state errorindependent of how large the controller gain is�

Proportional and integral control

To get rid of the steady state gain due to the step disturbance we have tochange the controller structure� One way is to introduce a proportional andintegral controller �PI�controller�� This controller can be written as

Q�t� � Kc

�e�t� �

�Ti

Z t

e��� d�

�����

where the error e�t� � Tr�t� � T �t�� The �rst term is proportional to theerror and the second to the integral of the error� The second term will keepchanging until the error is zero� This implies that if there exists an equilibriumor steady state then the error must be zero� It may� however� happen that thesystem never settles� This is the case when the closed loop system becomesunstable� Figure � shows the response to disturbances when Kc � � and fordierent values of Ti� As soon as the integral term is used the steady stateerror becomes zero� The speed of the response can be changed by Kc and Ti�

From the basic equations ���� and ���� it is easy to show that the steadystate error always will be zero if Ti is �nite� Taking the derivative of the twoequations and eliminating dQ

dt gives the closed loop system

T�d�T

dt�� �� �KKc�

dT

dt�KKc

TiT � KKc

dTrdt

�KKc

TiTr �

dTindt

Assuming steady state �i�e� all derivatives equal to zero� gives that T � Tr�Later in the chapter we will give tools to investigate if there exists a steadystate solution for the system�

Figure �� shows the closed loop performance when the reference value ischanged from � to � at t � � and when the disturbance Tin is a unit step att � �� The controller is a PI controller with Kc � ��� and Ti � ����

Page 105: Process Control

��� The Idea of Feedback ��

0 1 2 3 4 5−0.5

0

0.5

1 Output

0 1 2 3 4 5−2

−1

0

Input

Tin

Ti=∞

Ti=1Ti=0.25

Ti=0.04

Ti=∞Ti=1

Ti=0.25

Ti=0.04

Time t

Time t

Figure ��� Response of the system ����� when the disturbance is a unit step at t � ��The PI�controller ����� is used with Kc � � and Ti � � � ��� and ��� The desiredreference value is Tr � �

0 2 4 6 8 100

0.5

1

1.5 Output

0 2 4 6 8 10

0

1

2 Input

Time t

Time t

Figure ��� Reference and load disturbance for the temperature control system using aPI�controller Kc � ��� and Ti � ���� The liquid temperature and the control signal areshown�

Sensitivity reduction

Feedback will decrease the sensitivity of the closed loop system to changes in

Page 106: Process Control

�� Chapter � Feedback Systems

0 1 2 3 4 50

0.5

1

1.5 Output

Time t

Figure ��� The sensitivity to��� change in the �ow through the tank when the systemis controlled with a PI�controller with Kc � � and Ti � ����

the dynamics of the process� Consider the process controlled by the propor�tional controller ����� The closed loop gain is given by

Kcl �KKc

� �KKc

Assume thatKKc � � then a ��� change inKKc will giveKcl � #���� ����$�The sensitivity will be less when KKc is increased� For instance KKc � ��gives Kcl � #��� ����$ after a ��� change in KKc�

The process gain and the time constant are inversely proportional to the ow v� Figure �� shows the closed loop performance after a step in thereference value when a PI�controller is used and when the ow through thetank v is changed ��� compared to the nominal value�

Unmodeled dynamics

We will now increase the complexity of the systemmodel by assuming that thetemperature is measured using a sensor with dynamics� It is assumed that themeasured value Tm is related to the true temperature by the transfer function

Tm�s� ��

� � TssT �s�

The sensor has the time constant Ts� but the gain is one� Figure �� shows thetemperature and the control signal when the PI�controller ���� is used withTm instead of T � The closed loop system will be unstable for some parametercombinations� Which parameter combinations that give unstable systems arediscussed later in this chapter�

Summary

In this section we have seen that feedback can be used to change the transientand steady state properties of a closed loop system� Also the in uence of thedisturbances are reduced through feedback� To obtain a steady state errorthat is zero it is necessary to have an integrator in the controller� Finally� itwas found that the closed loop system may become unstable�

The results of the example can be generalized� but the gross features willbe the same independent of the process that is controlled�

Page 107: Process Control

��� Feedback Control ��

0 1 2 3 4 5−0.5

0

0.5

1 Output

0 1 2 3 4 5

−2

−1

0

Input

Tin

Ti=∞Ti=1

Ti=0.25

Ti=0.04

Ti=∞Ti=1

Ti=0.25

Ti=0.04

Time t

Time t

Figure �� Temperature control using PI�controller and sensor dynamics� The liquidtemperature and the control signal are shown when Tin is a unit step Ts � �� Kc � �and Ti �� � ��� and ��� Compare Figure ����

��� Feedback Control

In the previous sections we have discussed simple control problems and haveseen how feedback can improve the properties of the system� These resultswill now be generalized� In this section we will investigate properties of closedloop systems� when dierent kinds of controllers are used�

Stationary errors

Important tasks for a control system are to make the output follow a referencesignal and to eliminate disturbances� The reference value or disturbance can bepiecewise constant� linearly increasing or decreasing ramps etc� An importantquestion is how large the stationary errors are for dierent kinds of referencesignals and disturbances� Also it is important to know how to eliminate apossible steady state error� In Section �� we found that it was necessary tohave integrators in the system to be able to eliminate stationary errors� Thegeneral situation will now be treated�

Consider the system in Figure ��� The reference signal and the distur�bance are generated by sending impulses into dynamic systems� To generatea step we let Gr�s� or Gv�s� be equal to ��s or for a ramp we use ��s�� TheLaplace transform of the error is

E�s� ��

� � G�s�Gr�s�� G��s�

� � G�s�Gv�s� ����

where G � G�G�� Further Gr and Gv are the transforms of the referencesignal and the disturbance� respectively� The �nal value theorem gives

e��� � lims�

sE�s�

Page 108: Process Control

�� Chapter � Feedback Systems

Σ Σ

– 1

vy

G1 G2

yr

Gv

Gr

δr (t)

δv (t)

e

Figure �� Simple feedback system with reference and disturbance signal generation��r�t� and �v�t� are impulses�

This relation can always be used as long as the closed loop system is stable�To gain more insight we will assume that

G�s� �K�� � q�s� � � �� qm��s

m���sn�� � p�s � � � �� pmsm�

�KQ�s�snP �s�

The open loop system is parameterized to show the number of integrators��i�e�� poles in the origin� and a gainK� The open loop system has n integrators�Notice that Q��� � P ��� � �� The parameter K can be interpreted as thegain when the integrators have been removed� Further we let

G��s� �K�Q��s�smP��s�

G��s� �K�Q��s�sn�mP��s�

where Q���� � Q���� � P���� � P���� � � and n�m � ��We �rst investigate the in uence of a reference value� Assume that yr is

a step� i�e� Gr � a�s� The �nal value theorem gives

e��� � lims�

snP �s�asnP �s� �KQ�s�

�a��� �K� n � �

� n � �

When yr is a ramp� i�e� Gr � b�s�� we get

e��� � lims�

snP �s�snP �s� �KQ�s�

bs�

��� n � �

b�K n � �

� n � �

It is possible to continue for more complex reference signal� but the pattern isobvious� The more complex the signal is the more integrators are needed toget zero steady state error� The calculations are summarized in Figure ���

Remark� It must be remembered that the stability of the closed loop systemmust be tested before the �nal value theorem is applied�

Page 109: Process Control

��� Feedback Control �

0 2 4 6 8 100

1

2

0 2 4 6 8 100

1

2

0 2 4 6 8 100

1

2

0 2 4 6 8 100

4

8

0 2 4 6 8 100

4

8

0 2 4 6 8 100

4

8

n=0

n=1

n=2

Step Ramp

Figure ��� The output and reference values as functions of time for di�erent number ofintegrators n when the reference signal is a step or a ramp�

Let us now make the same investigation for disturbances when the refer�ence value is zero� Now

E�s� � � G��s�� � G�s�

Gv�s�

� � snP �s�snP �s� �KQ�s�

K�Q��s�sn�mP��s�

Gv�s�

� �smK�P��s�Q��s�snP �s� �KQ�s�

Gv�s�

Let the disturbance be a step� i�e� Gv � a�s� The �nal value theorem gives

e��� � lims�

�smK�P��s�Q��s�asnP �s� �KQ�s�

���aK���� �K� n � �� m � �

�a�K� n � �� m � �

� n � m� m � �

When v is a ramp� i�e� Gv � b�s�� we get

e��� � lims�

�smK�P��s�Q��s�snP �s� �KQ�s�

bs�

���� n � �� m � �

�b�K� n � m� m � �

� n � m� m � �

Once again the number of integrators and the gain determine the value of thestationary errors�

Page 110: Process Control

�� Chapter � Feedback Systems

ContrFlowreference

Flow

Figure ���� Flow control�

Example ����Stirred tank heaterConsider the simulation in Figure ��� where the stirred tank heater is con�trolled by a P�controller� In this case G��s� � KKc and G��s� � ����� T�s��A unit step in Tin gives the stationary error ������KKc�� which is con�rmedby Figure ���

Where to place the integrators

It was shown above that it is important to have integrators in the system toeliminate stationary errors� If the process does not have any integrator wecan introduce integrators in the controller� Consider the system in Figure ���The transfer function from yr and v to e is given by ����� If yr is a step thene will be zero in steady state if there is an integrator in either G� or G�� If v isa step it is necessary to have an integrator in G� to obtain zero steady state�It is not su�cient with an integrator in G�� To eliminate load disturbances itmay be necessary to introduce integrators in the controller even if the processcontains integrators�

Uncertainty reduction

Above it has been shown how feedback can be used to reduce the in uence ofdisturbances entering into the system� We will now show how feedback canbe used to make the system less sensitive to variations in parameters in theprocess�

Example ����Nonlinear valveControl of ows is very common in chemical process control� Control valveshave� however� often a nonlinear characteristic relating the ow to the openingof the valve� For simplicity� we assume that the valve is described by the staticnonlinear relation

y � g�u� � u� � u �

where u is the valve opening and y is the ow through the valve� Smallchanges in the opening �u will give small changes in the ow �y� The changeis proportional to the derivative of the valve characteristic� i�e�

�y � g��u��u � �u�u

The gain thus changes drastically depending on the opening� When u � ���the gain is ��� and when u � � it is �� This nonlinearity can be reducedby measuring the ow and controlling the valve position� see Figure ����Assume that there are no dynamics in the system and that the controller is aproportional controller with gain K� The system is then described by

e � yr � y

y � g�Ke�

Page 111: Process Control

��� Feedback Control ���

0 0.5 10

0.2

0.4

0.6

0.8

1 y

Closed loop

Open loop

u, yr

Figure ���� Input�output relations for the open loop system and the closed loop systemwhen K � �� Notice that the input to the open loop system is u while it is yr for theclosed loop system�

Σy

G0Gf

Gy

yr

Figure ���� Closed loop system�

This gives the relation

yr � y ��Kg���y� � y �

�K

py � f�y�

where g�� is the inverse function� The gain of the closed loop system is giventhrough

�yr � f ��y��y

or

�y ��

f ��y��yr �

�Kpy

� � �Kpy�yr �

�Ku

� � �Ku�yr

If K is su�ciently high the gain of the closed loop system will be close to �and almost independent of u� Figure ��� shows the input output relations forthe open loop and the closed loop systems�

Consider the block diagram in Figure ���� The transfer function from yrto y is given by

Gc�s� �Gf�s�Go�s�

� � Go�s�Gy�s�����

We will �rst investigate how variations in the transfer functions in uence theresponse from the reference value to the output� One way to do this is todetermine the sensitivity when there is a small change in the transfer function�

Page 112: Process Control

��� Chapter � Feedback Systems

Σ Processyue

– 1

yr

Figure ���� Block diagram of process with on�o� control�

Let a transfer function G depend on a transfer function H � We de�ne therelative sensitivity of G with respect to H as

SH �dG

dH HG

This can be interpreted as the relative change in G� dG�G� divided by therelative change in H � dH�H � For the transfer function Gc in ���� we have

SGf� �

SGo ��

� � GoGy

SGy � � GoGy

� �GoGy

It is seen that a relative change in Gf will give the same relative change inGc� As long as the loop gain GoGy is large then SGo will be small� Thiswill� however� cause SGy to become close to one� From a sensitivity point ofview it is crucial that the transfer functions Gf and Gy are accurate� Thesetransfer functions are determined by the designer and can be implementedusing accurate components�

The sensitivity with respect to G is often called the sensitivity functionand is denoted by S� Further� T � �SGy is called the complementary sensi�tivity function� Notice that

S � T � �

This implies that both sensitivities can�t be small at the same time�

��� On�o� Control

On�o control is one of the simplest way of making control� The control signalis either at its maximum or at its minimum value depending on the sign ofthe error signal� This makes it very easy and cheap to implement an on�ocontroller� A simple relay or contactor can be used as the active element inthe controller� On�o control is used� for instance� in thermostats�

Let e be the control error and umax and umin be the largest and small�est values� respectively� of the control signal� The on�o controller is thendescribed by

u �

�umax e � �

umin e � �����

where e � yr � y� The control law ���� is a discontinuous function� Figure��� shows a block diagram of a control system with an on�o controller� Theproperty of the on�o controller is illustrated on a simple process�

Page 113: Process Control

��� On�o� Control ���

T T

aT/b bT/a

aKT

bKT1

a

– b

u

y

Time

Time

0

Figure ���� Step response of integrator with time delay when using an on�o� controller�

Example ����On�o control of integrator with time delayAssume that the process is an integrator with a time delay� The process isdescribed by

dy�t�dt

� Ku�t� T � ����

Equation ���� has the solution

y�t� � y�t� �K

Z t�T

t��Tu��� d�

The step response of the closed loop system is shown in Figure ��� Theoutput of the process is composed of straight lines� Due to the delay theoutput will change direction T time units after the error has changed sign�This results in an oscillation in the output� The period of the oscillation is

Tp � T �� � a�b� b�a�

and the peak�to�peak value is

A � �a� b�KT

where umax � a and umin � �b� The output has the mean value

ym � yr ����a� b�KT

Page 114: Process Control

��� Chapter � Feedback Systems

e

e(t)

t

ep(t)

Td

Figure ���� Error prediction using ep � e � Tddedt�

The mean value is equal to the reference value only if a � b� The amplitudeof the oscillation is in many cases so small that it can be tolerated� Theamplitude can be decreased by decreasing the span in the control signal�

The limit cycle oscillation is characteristic for on�o systems� The originof the oscillation is the inertia or the dynamics of the system� It takes sometime before the output reacts to a change in the control signal� One way toimprove the control is to predict the error to be able to change the sign of thecontrol signal before the error changes sign� The controller thus becomes

u �

�umax ep � �

umin ep � ������

where ep is the prediction of e� A simple way to predict the error is to makean extrapolation along the tangent of the error function� see Figure ���� Theprediction is given by

ep�t� � e�t� � Tdde�t�dt

�����

The time Td is called prediction time or prediction horizon� The controller����� using ����� has a derivative action� since the control signal dependson the derivative of the error signal� The prediction time Td must now bedetermined� Intuitively the prediction horizon should be chosen to be thetime it takes for the control signal to in uence the output of the process� Forthe process in Example �� it is natural to chose Td � T �

The prediction time can be determined experimentally in the followingway� Disconnect the controller from the process and measure the output ofthe process� Manually the control signal is given its maximum value� Theoutput then increases and the control signal is switch to its minimum valuewhen the output is equal to the reference value� The prediction time is chosenas

Td � k��yv

�����

where �y is the overshoot� see Figure ���� v is the slope when the output isequal to the reference value and k� is an empirically determined factor aboutequal to one� Since many processes have asymmetric responses one shouldrepeat the experiment approaching the reference value from above as is alsoshown in Figure ����

Page 115: Process Control

��� On�o� Control ���

Time

Input

Time

Output

Slope v

Slope v

ΔyΔy

Figure ���� Empirical determination of the prediction horizon in an on�o� controller�

Small signal properties

The on�o controller is discontinuous for e � �� This may cause problemswhen the error is small� The control signal will oscillate between its twovalues� This is called chattering when the oscillation is fast� The oscillationin the control signal can also be caused by high frequency measurement noise�In many situations the oscillations in the control signal will be harmless� sincethe oscillation in the output may be very small� If the actuator is mechanicalthe oscillation may cause wear and should thus be avoided�

Example ����ChatteringConsider the process and controller in Example �� and assume that the timedelay is small� The step response of the closed loop system is shown in Figure���� The control signal chatter with a high frequency� The frequency of thechattering is inversely proportional to the time delay�

One way to avoid the chattering is to introduce a longer delay in thecontroller� This can be done by using a relay with hysteresis� see Figure ����If the width of the hysteresis is larger than the peak to peak amplitude ofthe measurement noise then the noise will not give rise to oscillations� Thefrequency of the oscillation depends on the width of the hysteresis�

An extension of the on�o controller is to introduce more levels than two�In the extreme case we may have in�nite many level between the maximumand minimum values of the control signal� We then get a controller that islinear for small values of the error� The controller has the form

u �

��umax e � e

ub � e�e�

�umax � umin� jej e

umin e � �ewhere ub � �umax�umin���� This is a proportional controller with saturation�The quantity �e determines the interval where the control action is linear and

Page 116: Process Control

��� Chapter � Feedback Systems

0 2 4 6 8 100

0.5

1

1.5 Output

0 2 4 6 8 10

−0.5

0

0.5Input

Time t

Time t

Figure ��� Chatter in process with small time delay�

u

e

2e0

Figure ��� The characteristic of a relay with hysteresis�

is called the proportional band� The value u should correspond to the controlsignal that gives the desired reference value�

The controller with linear action is more complex than the pure on�ocontroller since the actuator now must be able to give a continuous range ofcontrol signals to the process�

Summary

On�o control is a simple and robust form of control� The controller� however�often gives a closed loop system where the output and the control signals os�cillates� These oscillations can often be tolerated in low performance controlsystems� The properties of the on�o controller can be improved by introduc�ing derivative or predictive action�

Page 117: Process Control

��� Stability ���

��� Stability

When solving dierential equations in Chapter � we found that the systemwas unstable if any of the poles have positive real part� In this section wewill discuss methods to determine stability without solving the characteristicequation� We will also give methods to determine the stability of a closed loopsystem by studying the open loop system�

De�nitions

Stability can be de�ned in dierent way and we will give some dierent con�cepts� Stability theory can be developed for nonlinear as well as linear systems�In this book we limit the stability de�nitions to linear time�invariant systems�In Section ��� we found that the solution of a dierential equation has twoparts� one depending on the initial values and one depending the input signal�We will �rst determine how the initial value in uences the system output� Itis thus �rst assumed that u�t� � ��

Definition ����Asymptotic stabilityA system is asymptotically stable if y�t�� � when t�� for all initial valueswhen u�t� � ��

Definition ����StabilityA system is stable if y�t� is bounded for all initial values when u�t� � ��

Definition ����InstabilityA system is unstable if there is any initial value that gives an unboundedoutput even if u�t� � ��

From ������ we �nd that the stability is determined by the eigenvalues ofthe A matrix or the roots of the characteristic equation� The system is asymp�totically stable if the real part of all the roots are strictly in the left half plane�If any root has a real part in the right half plane� then the system is unstable�Finally if all roots have negative or zero real part then the system may bestable or unstable� If the imaginary roots are simple� i�e� have multiplicityone� then the system is stable� To summarize we have the following stabilitycriteria for linear time invariant systems�

� A system is asymptotically stable if and only if all the roots pi to thecharacteristic equation satisfy Re pi � ��

� If any pi satis�es Re pi � � then the system is unstable�

� If all roots satisfy Re pi � and possible purely imaginary roots are simplethen the system is stable�

For a system with input signal we can de�ne input�output stability in thefollowing way�

Definition ����Input�output stabilityA system is input�output stable if a bounded input gives a bounded outputfor all initial values�

Without proof we give the following theorem�

Theorem ���

For linear time�invariant systems asymptotic stability implies stability andinput�output stability�

Page 118: Process Control

��� Chapter � Feedback Systems

Σ K

– 1

yyr(s+1)

2

s3

Figure ���� Block diagram of a nonlinear system�

0 10 200

5

10

Output

Time t

Figure ���� The output of the system in Figure ���� for di�erent magnitudes of the stepin the reference signal�

Asymptotic stability is thus the most restricted concept� In the followingwe will mean asymptotic stability when discussing stability� The dierence isonly possible poles on the imaginary axis�

Stability of nonlinear systems

Above stability of a system was de�ned� This is only possible if the system islinear and time�invariant� For nonlinear systems it is only possible to de�nestability for a solution of the system� This implies that a nonlinear systemmay be stable for one input signal� but unstable for another input signal�

Example ����Stability of a nonlinear systemConsider the system in Figure ���� The system contains a nonlinearity whichis a saturation in a valve� Figure ��� shows the response of the system inFigure ��� for dierent magnitudes of the reference signal� The closed loopsystem is stable if the magnitude is small� but unstable for large magnitudes�

Page 119: Process Control

��� Stability ��

Stability criteria

There are several ways to determine if a system is �asymptotically� stable�

� Direct methodsNumerical solution of the characteristic equation

� Indirect methodsRouth�s algorithmNyquist�s criterion

The direct solution of the characteristic equation is easily done for �rst or sec�ond order systems� For higher order systems it is necessary to use a numericalmethod to determine the poles of the system� Using computers there are goodroutines for �nding eigenvalues of a matrix�

Rouths algorithm

The English mathematician Routh published in ���� an algorithm to test ifthe roots of a polynomial are in the left half plane or not� The algorithm givesa yes�no answer without solving the characteristic equation�

Consider the equation

F �z� � azn � bz

n�� � a�zn�� � b�z

n�� � � � a � � �����

It is assumed that the coe�cients ai and bi are real� This implies that theroots of the equation are real or complex conjugate pairs� The equation canthen be factorized into factors of the form z � � or z� � �z � �� A necessarycondition for all roots of ����� to be in the left half plane is that for all factors� � �� � � �� and � � �� This implies that all the coe�cients in ����� mustbe positive� To obtain su�cient conditions we form the table

a a� a� � � �

b b� b� � � �

c c� c� � � �

d d� d� � � ����

����

wherec � a� � ab��b

c� � a� � ab��b���

ci � ai�� � abi���b���

d � b� � bc��c

d� � b� � bc��c���

di � bi�� � bci���c���

Page 120: Process Control

�� Chapter � Feedback Systems

x x x x x x

x x x x x x

x x x

Upper left Upper right

Lower right

Lower left

New element

Figure ���� An illustration of the computations in Routh�s table�

Each row is derived from the two previous ones using the simple algorithmillustrated in Figure ���� Each new element in a row is obtained from the twoprevious rows� Make an &imaginary rectangle' of which the right hand side isone step to the right of the element that has to be computed� Label the corners(upper left�� (upper right�� (lower left�� and (lower right�� The computation thatis done over and over again can be expressed as�

(new element� � (upper right�� (upper left� (lower right�(lower left�

If any of the �upper right� or �lower right� elements do not exist then a zero isintroduced� The procedure is repeated until n� � rows are obtained� where nis the degree of the equation ������ The algorithm fails if any of the elementsin the �rst column becomes zero� All roots to ����� are then not in the lefthalf plane� For n � and n � � the table is formed in the following ways

n � n � �x x x x x xx x � x x xx x x x �x � x xx x �

x

In the table x represents a number and � represents the zeros that haveto be introduced to build up the table� We now have�

Theorem ����Routh�s stability testThe number of sign changes in a� b� c� d� � � � �i�e� in the �rst column of����� is equal to the number of roots in the right half plane of F �z��

Example ����Routh�s tableLet the closed loop system have the characteristic equation

s� � �s� � ��s� � ��s� � ���s� ��� � �

Is the system stable�We �rst observe that all coe�cients are positive� which implies that the

Page 121: Process Control

��� Stability ���

necessary condition for stability is satis�ed� Form the table ����

� �� ���� �� ���

�� ��� ��� ������� ����

The �rst column has two sign changes �from � to �� and from ���� to �����The equation thus has two roots in the right half plane� The roots are locatedin ���� ����i����� and ����� ����i�

Observe that we can multiply a row with any arbitrary positive numberwithout changing the next row or the number of sign changes� This is done inthe table below and the the old row is put within parentheses�

� �� ����� �� ����� �� ���

��� ������ ��� ��� ���

����� ���� ����

The �rst column has still two sign changes �from � to �� and from �� to�����

Routh�s algorithm is used to determine if a closed loop system is stable�The algorithm can also be used to determine for which values of a parameterthat the system is stable� This can be useful� for instance� in connection withprograms for symbolic algebraic manipulations� Routh�s method does not giveany insight into how the system should be changed to make the system stable�

Example ���Routh�s table with parameterAssume that a negative unity feedback loop is closed around the open loopprocess

G�s� �K

s�s� ���s� ��

The characteristic equation of the closed loop system is

s�s� ���s� �� �K � s� � �s� � �s�K � � �����

Routh�s table becomes� �� K

��K��K

The system is thus stable if ��K�� � � and if K � � i�e� for � � K � ��

Page 122: Process Control

��� Chapter � Feedback Systems

Σ

– 1

A

G0 (s)B

Figure ���� Simple feedback system�

Example ���Stirred tank heater with sensor dynamicsConsider the stirred tank heater with sensor dynamics and let the controllerbe a PI�controller� For which values of Ti is the closed loop system stablewhen K � Kc � T� � � and Ts�����

The closed loop system has the transfer function

KKc�s� ��Ti�s�� � T�s�

� �KKc�s� ��Ti�

s�� � T�s��� � Tss�

The characteristic equation is

s�� � T�s��� � Tss� �KKc�s� ��Ti� � �

For the speci�c values of the parameters we get

s� � ��s� � ��s� ���Ti � �

Routh�s table gives� ��

����Ti

��� ����Ti

��Ti

The system is stable if � � ��Ti � ��� The smallest value of the integrationtime is Ti � ����� compare Figure ���

Nyquists theorem

Consider the block diagram with the standard con�guration in Figure ����The frequency function of the open loop system is G�i��� If we can �nd afrequency �c such that

G�i�c� � �� �����

then the system will oscillate with the frequency �c� This can intuitively beunderstood in the following way� Cut the loop at the point A and inject a si�nusoidal with the frequency �c� The signal will then in stationarity come backto the point B with the same amplitude and the same phase� The negativefeedback will compensate for the minus sign on the right hand side of ������By connecting the points A and B we would get a sustaining oscillation� If

Page 123: Process Control

��� Stability ���

the amplitude of the signal in B is less than the amplitude in A we wouldget a a signal with decreasing amplitude when the points are connected� Ifthe amplitude in B is larger then we would get an oscillation with increasingamplitude� This intuitively discussion is almost correct� It is� however� neces�sary to consider the full frequency function to determine the stability of theclosed loop system� Harold Nyquist used the principle of arguments and thetheory of analytical functions to show the results strictly� We will only give asimpli�ed version of the full Nyquist�s theorem�

Theorem ����Simpli�ed Nyquist�s theoremConsider the simple feedback system in Figure ���� Assume that

�i� G�s� has no poles in the right half plane

�ii� G has at most one integrator

�iii� the static gain of G �with the possible integrator removed� is positive�

Then the closed loop system is stable if the point �� is to the left of thefrequency curve �Nyquist curve� G�i�� for increasing values of ��

Figure ��� shows four cases where it is assumed that the conditions �i���iii� in the theorem are ful�lled� Cases a� and c� gives stable closed loopsystems while b� and d� give unstable closed loop systems�

The Nyquist�s theorem is very useful since it uses the frequency function�From the curve it is possible to determine for which frequencies the curve isclose to ��� This gives a possibility to determine a suitable compensation ofthe open loop system such that the closed loop system will become stable�Frequency compensation methods are discussed in Chapter �� It is also im�portant to point out that the closed loop stability is obtained from the openloop frequency function G�i���

Nyquist�s theorem can also be used when the Bode diagram is given� Wethen have to check that the argument of the frequency function is above �����when the absolute value is equal to one�

Practical stability

From a practical point of view it is not good to have a system that is close toinstability� One way to increase the degree of stability is to require that thepoles should be in a restricted region of the left hand plane� For instance� wecan require that the poles have a real part that is smaller than �� � � or thatthe poles are within a sector in the left half plane� Another way to measurethe degree of stability is given by the amplitude margin Am and the phasemargin �m� These margins are de�ned in the Nyquist or Bode diagrams� seeFigure ��� Let the open loop system have the loop transfer function G�s�and let � be the smallest frequency such that

argG�i�� � ��

and such that argG�i�� is decreasing for � � �� The amplitude margin orgain margin is then de�ned as

Am ��

jG�i��jFurther� let the cross over frequency �c be the smallest positive frequency suchthat

jG�i�c�j � �

Page 124: Process Control

��� Chapter � Feedback Systems

Re G

Im G

−1

a) Stable

Re G

Im G

−1

b) Unstable

Re G

Im G

−1

c) Stable

Re G

Im G

−1

d) Unstable

Figure ���� Illustration of the simpli�ed Nyquist�s theorem�

The phase margin �m is then de�ned as

�m � � � argG�i�c�

In words the amplitude margin is how much the gain can be increased beforethe closed loop system becomes unstable� The system is unstable if Am � ��The phase margin is how much extra phase lag �or time delay� that is allowedbefore the closed loop system becomes unstable�

Typical values to get good servo properties are Am � � � � and �m � ��� ����

Example ����Amplitude and phase marginsConsider the system in Example ����� The Bode diagram is shown in Figure����� From the �gure it can be found that the phase margin is about ��� andthe amplitude margin is ��� The phase is ����� for � � ���� The amplitudeand phase margins can also be determined from the Nyquist diagram in Figure�����

��� Summary

In this chapter we have shown how to analyze the properties of a closed loopsystem� It was found that speed and robustness towards parameter variationscould be increased by increasing the loop gain of the system� This leads�however� in most cases to loss of stability of the closed loop system� Ways totest stability have been introduced� The Nyquist and Bode diagrams give goodinsights into the properties of the closed loop system� In the analysis of systemswe try to derive methods� which make it possible to determine properties ofthe closed loop systems without solving the dierential equations describingthe closed loop system� These methods thus give better intuitive feeling forthe behavior and ways to change the properties than by a straight forward

Page 125: Process Control

��� Summary ���

Re G

Im G1Am

ϕm

ω0

ωc

1

ϕm

1

−180

ω

ω

G0 (iω)

ωc ω0

1Am

arg G0(iω)

Figure ���� De�nition of the amplitude margin Am and the phase margin m in theNyquist and Bode diagrams�

mathematical solution of the dierential equations� The following chaptersintroduce design methods� which make it possible to alter the behavior of thesystems to make them satisfy our speci�cations�

Page 126: Process Control

PID Controllers

GOAL� To discuss di�erent aspects of the PID controller� Tuning

procedures and implementation aspects are treated�

��� Introduction

Many control problems can be solved using a PID�controller� This controlleris named after its function which can be described as

u�t� � Kc

��e�t� � �

Ti

tZe��� d� � Td

de�t�dt

�� � P � I �D �����

where u is the controller output� and e is the error� i�e� the dierence betweencommand signals yr �the set point� and process output y �the measured vari�able�� The control action is thus composed of three terms� one part �P� isproportional to the error� another �I� is proportional to the integral of the er�ror� and a third �D� is proportional to the derivative of the error� Special casesare obtained by only using some of the terms i�e� P� I� PI� or PD controllers�The PI controller is most common� It is also possible to have more compli�cated controllers e�g� an additional derivative term� which gives a PIDD or aDPID controller� The name PID controller is often used as a generic name forall these controllers�

The PID controller is very common� It is used to solve many control prob�lems� The controller can be implemented in many dierent ways� For controlof large industrial processes it was very common to have control rooms �lledwith several hundred PID controllers� The algorithm can also be programmedinto a computer system that can control many loops� This is the standardapproach today to control of large industrial processes� Many special purposecontrol systems also use PID control as the basic algorithm�

The PID controller was originally implemented using analog techniques�The technology has developed through many dierent stages� pneumatic� relayand motors� transistors and integrated circuits� In this development muchknow�how was accumulated that was embedded into the analog design� Inthis process several useful modi�cations to the &textbook' algorithm given by

���

Page 127: Process Control

��� Introduction ���

����� were made� Many of these modi�cations were not published� but keptas proprietary techniques by the manufacturers�

Today virtually all PID controllers are implemented digitally� Early im�plementations of digital PID controllers were often a pure translation of the&textbook' algorithm which left out many of the good extra features of theanalog design� The failures renewed the interest in PID control�

It is essential for any user of control systems to master PID control� tounderstand how it works and to have the ability to use� implement� and tunePID controllers� This chapter provides this knowledge� In Section ��� we willdiscuss the basic algorithm and several modi�cations of the linear� small�signalbehavior of the algorithm� These modi�cations give signi�cant improvementsof the performance� Modi�cations of the nonlinear� large�signal behavior of thebasic algorithm are discussed in Section ���� This includes integrator windupand mode changes� Section �� deals with controller tuning� This coverssimple empirical rules for tuning as well as tuning based on mathematicalmodels� PID�control of standardized loops is discussed in Section ���� InSection ��� we discuss implementation of PID controllers using analog anddigital techniques and Section ��� gives a summary�

��� The Control Algorithm

In this section the PID algorithm will be discussed in more detail� Propertiesof proportional� integral� and derivative action will be explained� Based onthe insight gained we will also make several modi�cations of the small�signalbehavior of the algorithm� This will lead to an improved algorithm which issigni�cantly better than the basic algorithm given by ������

Proportional Action

A proportional controller can be described by

u � Kc�yr � y� � ub � Kce� ub �����

The control signal is thus proportional to the error� Notice that there is also areset or a bias term ub� The purpose of this term is to provide an adjustmentso that the desired steady state value can be obtained� Without the reset�integrating� term it is necessary to have an error to generate a control signalthat it dierent from zero� The reset term can be adjusted manually to givethe correct control signal and zero error at a desired operating point�

Equation ����� holds for a limited range only because the output of acontroller is always limited� If we take this into account the input outputrelation of a proportional controller can be represented as in Figure ���� Therange of input signals where the controller is linear is called the proportionalband� Let pB denote the proportional band and umin and umax the limits ofthe control variable� The following relation then holds

Kc �umax � umin

pB�����

Compare the discussion of the linear on�o controller in Section ��� Theproportional band is given in terms of the units of the measured value or inrelative units� It is in practice often used instead of the controller gain� Aproportional band of ��� thus implies that the controller has a gain of ��

Page 128: Process Control

��� Chapter � PID Controllers

u

e

Proportional band

Slope = Gain

umax

umine0−e0

Figure ��� Input�output relation of a proportional controller�

0 5 10 15 200

0.5

1

1.5Set point and measured variable

0 5 10 15 20

−2

0

2

4

6 Control variable

Kc=5

Kc=2

Kc=1

Kc=5

Kc=2Kc=1

Time t

Time t

Figure ��� Illustration of proportional control� The process has the transfer functionGp�s� � �s� ����

The properties of a proportional controller are illustrated in Figure ����This �gure shows the step response of the closed loop system with proportionalcontrol� The �gure shows clearly that there is a steady state error� Theerror decreases when the controller gain is increased� but the system thenbecomes oscillatory� It is easy to calculate the steady state error� The Laplacetransforms of the error e � yr � y is given by

E�s� ��

� � Gp�s�Gc�s�Yr�s�

where Yr is the Laplace transforms of the command signal� With Gp��� � �and Gc��� � Kc � � we �nd that the error due to a command signal is ���as is seen in the �gure�

Page 129: Process Control

��� The Control Algorithm ��

1+sTi

1

Σ uKce

ub

Figure ��� Controller with automatic reset�

Integral Action

Early controllers for process control had proportional action only� The resetadjustment ub in ����� was used to ensure that the desired steady state valuewas obtained� Since it was tedious to adjust the reset manually there was astrong incentive to automate the reset� One way to do this is illustrated inFigure ���� The idea is to low pass �lter the controller output to �nd the biasand add this signal to the controller output� It is straight forward to analyzethe system in Figure ���� We get

U�s� � KcE�s� ��

� � sTiU�s�

Solving for U we get

U�s� � Kc�� ��sTi

�E�s�

Conversion to the time domain gives

u�t� � Kc

��e�t� � �

Ti

tZe��� d�

�� � P � I ����

which is the input�output relation for a PI controller� Parameter Ti� whichhas dimension time� is called integral time or reset time� The properties of aPI controller are illustrated in Figure ��� The �gure illustrates that the ideaof automatic reset or PI control works very well in the speci�c case�

It is straight forward to show that a controller with integral action willalways give a correct steady state� To do this assume that there exist a steadystate� The process input� the output� and the error then are then constant�Let e denote the error and u the process input� It follows from the controllaw ���� that

u � Kc�e � teTi

This contradicts the assumption that u is a constant unless e is zero� Theargument will obviously hold for any controller with integral action� Notice�however� that a stationary solution may not necessarily exist�

Another intuitive argument that also gives insight into the bene�ts ofintegral control is to observe that with integral action a small control errorthat has the same sign over a long time period may generate a large controlsignal�

Sometimes a controller of the form

u�t� � Ki

tZe��� d� � I �����

is used� This is called an I controller or a �oating controller� The name oating relates to the fact that with integral control there is not a directcorrespondence between the error and the control signal�

Page 130: Process Control

�� Chapter � PID Controllers

0 5 10 15 200

0.5

1

1.5Set point and measured variable

0 5 10 15 200

1

2

Control variable

Ti=1Ti=2

Ti=5

Ti=∞

Ti=1

Ti=2

Ti=5

Ti=∞

Time t

Time t

Figure ��� Illustration of PI control� The process has the transfer function Gp�s� ��s� ���� The controller has the gain Kc � ��

ep

epB

A

e

t t+Td Time

Error

Figure ��� The predictive nature of proportional and derivative control�

Derivative Action

A controller with proportional action has a signi�cant disadvantage becauseit does not anticipate what is happening in the future� This is illustrated inFigure ��� which shows two error curves� A and B� At time t a proportionalcontroller will give the same control action for both error curves� A signi�cantimprovement can be obtained by introducing prediction�

A simple way to predict is to extrapolate the error curve along its tangent�This means that control action is based on the error predicted Td time unitsahead� i�e�

ep�t� Td� � e�t� � Tdde�t�dt

�����

Page 131: Process Control

��� The Control Algorithm ���

0 5 10 15 200

0.5

1

Set point and measured variable

0 5 10 15 20

−2

0

2

4

6 Control variable

Td=0.1

Td=0.5

Td=2

Td=0.1Td=0.5Td=2

Time t

Time t

Figure ��� Illustration of the damping properties of derivative action� The process hasthe transfer function Gp�s� � �s� ���� The gain is Kc � � and Td is varied�

This gives the control law

u�t� � Kc

�e�t� � Td

de�t�dt

�� P �D �����

which is a PD controller� With such a controller the control actions for thecurves A and B in Figure ��� will be quite dierent� Parameter Td� which hasdimension time� is called derivative time� It can be interpreted as a predictionhorizon�

The fact that control is based on the predicted output implies that it ispossible to improve the damping of an oscillatory system� The properties ofa controller with derivative action are illustrated in Figure ���� This �gureshows that the oscillations are more damped when derivative action is used�

Notice in Figure ��� that the output approaches an exponential curve forlarge values of Td� This can easily be understood from the following intuitivediscussion� If the derivative time is longer than the other time constants ofthe system the feedback loop can be interpreted as a feedback system thattries to make predicted error ep small� This implies that

ep � e� Tdde

dt� �

This dierential equation has the solution e�t� � e���e�t�Td� For large Td theerror thus goes to zero exponentially with time constant Td�

A drawback with derivative action is that parameter Td has to be chosencarefully� Industrial PID controllers often have potentiometers to set the pa�rameters Kc� Ti� and Td� Because of the di�culty in adjusting derivative timeTd the potentiometer for Td is made so that derivative action can be switched

Page 132: Process Control

��� Chapter � PID Controllers

o� In practical industrial installations we often �nd that derivative action isswitched o�

Use of derivative action in the controller has demonstrated that predic�tion is useful� Prediction by linear extrapolation has� however� some obviouslimitations� If a mathematical model of a system is available it is possible topredict more accurately� Much of the thrust of control theory has been touse mathematical models for this purpose� This has led to controllers withobservers and Kalman �lters� This is discussed in Chapter ��

Limitation of Derivative Gain

A pure derivative can and should not be implemented� because it will give avery large ampli�cation of measurement noise� The gain of the derivative mustthus be limited� This can be done by approximating the transfer function sTdas follows

sTd � sTd� � sTd�N

�����

The transfer function on the right approximates the derivative well at lowfrequencies but the gain is limited to N at high frequencies� The parameterN is therefore called maximum derivative gain� Typical values of N are in therange ������ The approximation given by Eq� ����� gives a phase advance of��� for low frequencies� For � �

pN�Td the phase advance has dropped to

���

Modi�cation of Set Point Response

In the basic algorithm given by ����� the control action is based on errorfeedback� This means that the control signal is obtained by �ltering the controlerror� Since the error is the dierence between the set point and the measuredvariable it means that the set point and the measured variable are treatedin the same way� There are several advantages in providing separate signaltreatments of those signals�

It was observed empirically that it is often advantageous to not let thederivative act on the command signal or to let it act on a fraction of thecommand signal only� The reason for this is that a step change in the commandsignal will make drive the output of the control signal to its limits� This mayresult in large overshoots in the step response� To avoid this the derivativeterm can be modi�ed to

D�s� �sTd

� � sTd�N��Yr�s�� Y �s�� �����

If the parameter � is zero� which is the most common case� the derivativeaction does not operate on the set point�

It has also been found suitable to let only a fraction � of the commandsignal act on the proportional part� The PID algorithm obtained then becomes

U�s� � Kc

��Yr�s�� Y �s��

�sTi

�Yr�s�� Y �s��

�sTd

� � sTd�N��Yr�s�� Y �s��

� ������

where U Yr� and Y denote the Laplace transforms of u� yr � and y� The idea toprovide dierent signal paths for the process output and the command signal

Page 133: Process Control

��� The Control Algorithm ���

0 20 40 600

0.5

1

1.5 Set point and measured variable

0 20 40 600

1

2

3 Control variable

beta=1

beta=0.5beta=0

beta=1beta=0.5

beta=0

Time t

Time t

Figure �� Response of system to setpoint changes and load disturbances for controllerwith di�erent values of parameter ��

is a good way to separate command signal response from the response to loaddisturbances� Alternatively it may be viewed as a way to position the closedloop zeros�

The advantages of a simple way to separately adjust responses to load dis�turbances and set points are illustrated in Figure ���� In this case parametersKc� Ti� and Td are chosen to give a good response to load disturbances� With� � � the response to set point changes has a large overshoot� which can beadjusted by changing parameter ��

There are also several other variations of the PID algorithm that are usedin commercial systems� An extra �rst order lag may be used in series with thecontroller to obtain a high frequency roll�o� In some applications it has alsobeen useful to include nonlinearities� The proportional term Kce can thus bereplaced by Kcejej or by Kce

�� Analogous modi�cations of the derivative termhave also been used�

Velocity Algorithms

The PID algorithms described so far are called position algorithms because thealgorithm gives the controller output� In some cases it is natural to perform theintegration outside the algorithm� A typical case is when the controller drivesa motor� In such a case the controller should give the velocity of the controlsignal as an output� Algorithms of this type are called velocity algorithms�The basic form of a velocity algorithm is

U�s� � Kc

�sE�s� �

�TiE�s�� s�Td

� � sTd�NY �s�

�������

Notice that the velocity algorithm in this form can not be used for a controllerthat has no integral action because it will not be able to keep a stationaryvalue�

Page 134: Process Control

��� Chapter � PID Controllers

Other Parameterizations of the Controller

The algorithm given by ����� or the modi�ed version ������ are called a nonin�teracting PID controller or a parallel form� There are other parameterizationsof the controllers� This is not a major issue in principle� but it can causesigni�cant confusion if we are not aware of it� Therefore we will also give someof the other parameterizations� To avoid unnecessary notations we show thealternative representations in the basic form only�

An alternative to ����� that is common in commercial controllers is

G��s� � K�c

�� � sT �i��� � sT �d�sT �i �� � sT �d�N

��������

This is called an interacting form or a series form� Notice that this is theform naturally obtained when integral action is implemented as automaticreset� See Figure ���� Simple calculations show that the parameters of ������and ����� are related by

Kc � K�c

T �i � T �dT �iT

�d

Ti � T �i � T �d

Td �T �iT

�d

T �i � T �d

������

Since the numerator poles of ������ are real the parameters of ������ can becomputed from ����� only if

Ti � Td �����

Then

K�c �

K

�� �

r�� Td

Ti

T �i �Ti�

�� �

r�� Td

Ti

�������

T �d �Ti�

���

r�� Td

Ti

There are also many other parameterizations e�g�

G�s� � K �Ki

s�Kds

or

G�s� � K ��T ��i s

� T ��d s

These forms typically appeared when programmers and other persons withno knowledge about control started to develop controllers� These parameter�izations have caused a lot of confusion as well as lost production when theseforms have been confused with ����� without recognizing that the numericalvalues of the parameters are dierent�

Page 135: Process Control

��� The Control Algorithm ���

Summary

The dierent control actions P� I� and D have been discussed� An intuitiveaccount of their properties have been given� Proportional control provides thebasic feedback action� integral action makes sure that the desired steady stateis obtained and derivative action provides prediction� which can be used tostabilize an unstable system or to improve the damping of an oscillatory sys�tem� The advantages of modifying the idealized algorithm given by Equation����� to

U�s� � Kc

��Yr�s�� Y �s� �

�sTi

�Yr�s�� Y �s��

�sTd

� � sTd�N��Yr�s�� Y �s��

� ������

have been discussed� This formula includes limitation of the derivative gainand facilities for separate control of response to load disturbances and setpoint changes� The controller in ������ has six parameters� the primary PIDparameters Kc� Ti� Td� and maximum derivative gain N � further parameters� and � are used for set point weighting�

��� Anti�Windup and Mode Switches

Many properties of a control system can be understood from linear analysisof small signal behavior� The reason for this is that a control system tries tokeep process variables close to their equilibrium� There are� however� somenonlinear phenomena that must be taken into account� There are inherentlimitations in the output of any actuator� The speed of a motor� the motion ofa linear actuator� the opening of a valve� or the torque of an engine are alwayslimited� Another source of large changes is that real systems can operate indierent modes� The behavior of a system during mode changes can naturallynot be understood from linear analysis� In this section we will discuss theseaspects of PID control that must be considered when designing a good controlsystem� The discussion will result in modi�cations of the large signal behaviorof the PID controller�

Integrator Windup

The combination of a saturating actuator and a controller with integral ac�tion give rise to a phenomena called integrator windup� If the control erroris so large that the integrator saturates the feedback path will be broken be�cause the actuator will remain saturated even if the process output changes�The integrator� being an unstable system� may then integrate up to a verylarge value� When the error changes sign the integral may be so large that ittakes considerable time until the integral assumes a normal value again� Thephenomena is also called reset windup� It is illustrated in Figure ���� whichshows a simulation of a process with a PI controller� The process dynamicscan be described as an integrator and the process input is limited to the range����� u ����� The controller parameters are Kc � � and Ti � �� Whena command signal in the form of a unit step is applied the computed controlsignal is so large that the process actuator saturates immediately at its highlimit� Since the process dynamics is an integrator the process output increases

Page 136: Process Control

��� Chapter � PID Controllers

0 10 200

0.5

1

1.5

2 Output y and yref

0 10 20

−0.2

0

0.2

Control variable u

Time t

Time t

Figure �� Illustration of integrator windup�

linearly with rate ��� and the error also decreases linearly� The control signalwill� however� remain saturated even when the error becomes zero because thecontrol signal is given by

u�t� � Kce�t� � I

The integral has obtained a large value during the transient� The controlsignal does not leave the saturation until the error has been negative for asu�ciently long time to reduce the value of the integral� The net eect isa large overshoot� When the control signal �nally leaves the saturation itchanges rapidly and saturates again at the lower actuator limit�

Anti�windup

In a good PID controller it is necessary to avoid integrator windup� There areseveral ways to avoid integrator windup� One possibility is to stop updatingthe integral when the actuator saturates� This is called conditional integration�Another method is illustrated in the block diagram in Figure ���� In thismethod an extra feedback path is provided by measuring the actuator outputand forming an error signal �es� as the dierence between the actuator output�yr� and the controller output �v�� This error is fed back to the integratorthrough the gain ��Tt� The error signal es is zero when the actuator doesnot saturate� When the actuator saturates the extra feedback path tries tomake the error signal es equal zero� This means that the integrator is resetso that the controller output tracks the saturation limits� The method istherefore called tracking� The integrator is reset to the saturation limits ata rate corresponding to the time constant Tt which is called the trackingtime constant� The advantage of this scheme for anti�windup is that it canbe applied to any actuator as long as the actuator output is measured� Ifthe actuator output is not measured the actuator can be modeled and an

Page 137: Process Control

��� Anti�Windup and Mode Switches ���

Σ Σ

Σ

−y

v u

e

+−

a)

Kc

Kc

Ti

1s

1Tt

es

KcTds

Actuator

Σ Σ

Σ

−y

v u

e

+−

b)

Kc

Kc

Ti

1s

1Tt

es

KcTds

Actuatormodel Actuator

Figure ��� Controller with anti�windup� A systemwhere the actuatoroutput is measuredis shown in a� and a system where the actuator output is estimated from a mathematicalmodel is shown in b��

equivalent signal can be generated from a mathematical model as shown inFigure ���b�� It is thus useful for actuators having a dead�zone or an hysteresis�

Figure ���� shows the improved behavior obtained with a controller havinganti�windup based on tracking� The system simulated is the same as in Figure���� Notice the drastic improvement in performance�

Bumpless Mode Changes

Practically all PID controllers can run in at least two modes� manual and au�tomatic� In the manual mode the controller output is manipulated directly bythe operator typically by push buttons that increase or decrease the controlleroutput� When there are changes of modes and parameters it is important toavoid switching transients�

Since a controller is a dynamic system� it is necessary to make sure that thestate of the system is correct when switching between manual and automaticmode� When the system is in manual mode� the controller produces a controlsignal that may be dierent from the manually generated control signal� It isnecessary to make sure that the value of the integrator is correct at the timeof switching� This is called bumpless transfer� Bumpless switching is easy toobtain for a controller in incremental form� This is shown in Figure ����� Theintegrator is provided with a switch so that the signals are either chosen from

Page 138: Process Control

��� Chapter � PID Controllers

0 10 200

0.5

1

1.5

2 Output y and yref

0 10 20

−0.2

0

0.2

Control variable u

Time t

Time t

Figure ���� Illustration of controller with anti�windup using tracking� Compare withFigure ����

1+sTi

1

Σ°° °

+−

y

M

Ay r

MCU

Inc PD

°° °

+−

y

M

Ay r

MCU

°° °

+−

y

M

Ay r

MCU

Inc PD

1+sTi

1

Σu

c)

b)

a)

u

u1s

Inc PID

Figure ���� Controllers with bumpless transfer from manual �M� to automatic �A� mode�The controller in a� is incremental� The controllers in b� and c� are special forms of positionalgorithms� The controller in c� has anti�windup� MCU is a Manual Control Unit�

the manual or the automatic increments� Since the switching only in uencesthe increments there will not be any large transients�

A related scheme for a position algorithm where integral action is imple�

Page 139: Process Control

��� Anti�Windup and Mode Switches ��

Σ

Σ

Σ

Σ

Σ ° °°e

A

M u

yPD

y r 1Tm

1Tr

1Tr

1Tr

1s

1s

+−

+−

u c

Figure ���� PID controller with bumpless switching between manual �M� and automatic�A� control�

mented as automatic reset is shown in Figure ����b�� Notice that in this casethe tracking time constant is equal to T �i �

More elaborate schemes have to be used for general PID algorithms onposition form� Such a controller is built up of a manual control modules andone PID module each having an integrator� See Figure �����

Bumpless Parameter Changes

It is also necessary to make sure that there are no unnecessary transientswhen parameters are changed� A controller is a dynamical system� A changeof the parameters of a dynamical system will naturally result in changes ofits output even if the input is kept constant� Abrupt changes in the outputcan be avoided by a simultaneous change of the state of the system� Thechanges in the output will also depend on the chosen realization� With aPID controller it is natural to require that there be no drastic changes in theoutput if the parameters are changed� when the error is zero� This holds forall incremental algorithms because the output of an incremental algorithm iszero when the input is zero irrespective of the parameter values� It also holdsfor a position algorithmwith the structures shown in Figure ����b� and ����c��For a position algorithm it depends� however� on the implementation� Assumee�g� that the state chosen to implement the integral action is chosen as

xI �

tZe��� d�

The integral term is then

I �Kc

TixI

A change of Kc or Ti then results in a change of I and thus an abrupt changeof the controller output� To avoid bumps when the parameters are changed

Page 140: Process Control

�� Chapter � PID Controllers

L t

y(t)

Slope R

Figure ���� Determination of parameters R and L from the unit step response of aprocess�

the state should be chosen as

xI �Kc

Ti

tZe��� d�

The integral term then becomes

I � xI

With this realization a sudden change parameters will not give a sudden changeof the controller output�

��� Tuning

To make a system with a PID controller work well it is not su�cient to havea good control algorithm� It is also necessary to determine suitable values ofthe controller parameters� The parameters are Kc� Ti� Td� N � Tt� �� �� umin

and umax� The primary parameters are

� Controller gain Kc

� Integral time Ti� Derivative time TdMaximum derivative gain N can often be given a �xed default value e�g� N ���� The tracking time constant �Tt� can be chosen in the range Td Tt Ti�In some implementation it has to be equal to Ti in other cases it can bechosen freely� Parameters umin and umax should be chosen inside but close tothe saturation limits� Parameters � and � should be chosen between � and ��Parameter � can often be set to zero�

There are two dierent approaches to determine the controller parameters�One method is to install a PID controller and to adjust the parameters untilthe desired performance is obtained� This is called empirical tuning� The othermethod is to �rst �nd a mathematical model of the process and then applysome control design method to determine the controller parameters� Manygood tuning procedures combine the approaches�

Much eort has been devoted to �nd suitable techniques for tuning PIDcontrollers� Signi�cant empirical experience has also been gathered over manyyears� Two empirical methods developed by Ziegler and Nichols in ���� thestep response method and the ultimate�period method� have found wide spreaduse� These methods will be described in the following� A technique based on

Page 141: Process Control

��� Tuning ���

mathematical modeling will also be given�

The step response method�

In this method the unit step response of the process is determined experimen�tally� For a process where a controller is installed it can be done as follows�Connect a recorder to the measured variable� Set the controller to manual�Change the controller manually� Calculate scale factors so that the unit stepresponse is obtained� The procedure gives a curve like the one shown in Figure����� Draw the tangent to the step response with the steepest slope� Find theintersection of the tangent with the axes are determined graphically� See Fig�ure ����� The controller parameters are then given from Table ���� To carryout the graphical construction it is necessary that the step response is suchthat it is possible to �nd a tangent with the steepest slope�

The Ziegler�Nichols method was designed to give good response to loaddisturbances� The design criterion was to achieve quarter�amplitude�damping�QAM�� which means that the amplitude of an oscillation should be reduced toone quarter after one period of the oscillation� This corresponds to a relativedamping of � � ���� for a second order system� This damping is quite low� Inmany cases it would be desirable to have better damping this can be achievedby modifying the parameter in Table ����

A good method should not only give a result it should also indicate therange of validity� In the step response method the transfer function of theprocess is approximated by

G�s� � Kpe�sL

� � sT������

It has already been shown how parameter L can be determined� This pa�rameter is called the apparent dead�time because it is an approximation of thedead�time in the process dynamics� Parameter T which is called apparent timeconstant can be determined by approximating the step response as is indicatedin Figure ���� The ratio

� � L�T

is useful in order to characterize a control problem� Roughly speaking a processis easy to control if � is small and di�cult to control if � is large� Ziegler�Nichols tuning is applicable if

���� � L�T � ��� ������

Table ��� PID parameters obtained from the Ziegler Nichols step response method Rand L are obtained from Figure ���� and a � RL�

Controller type Kc Ti Td

P ��a

PI ����a �L

PID ����a �L ���L

Page 142: Process Control

��� Chapter � PID Controllers

L L+T t

y(t)

Figure ���� Determination of apparent dead�timeL and apparent time constant T fromthe unit step response of a process�

The Ultimate�Sensitivity Method

This method is based on the determination of the point where the Nyquistcurve of the open loop system intersects the negative real axis� This is doneby connecting the controller to the process and setting its parameters so thatpure proportional control is obtained� The gain of the controller is then in�creased until the closed loop system reaches the stability limit� The gain �Ku�when this occurs and the period time of the oscillation �Tu� is determined�These parameters are called ultimate gain and ultimate period� The controllerparameters are then given by Table ���� The ultimate sensitivity method isalso based on quarter amplitude damping� The numbers in the table can bemodi�ed to give a better damped system�

Let Kp be the static gain of a stable process� The dimension free numberKpKu can be used to determine if the method can be used� It has beenestablished empirically that the Ziegler�Nichols ultimate sensitivity methodcan be used if

� � KpKu � �� ������

The parameters Ku and Tu are also easy to determine from the Bodediagram of the process� The physical interpretation of Ku is how much thegain can be increased before the system becomes unstable� This implies thatthe ultimate gain is the same as the amplitude margin of the system� Thefrequency of the oscillation is the frequency when the phase is equal to �����which is denoted �� compare Section �� This gives

Ku � Am

Tu ����

Table ��� PID parameters obtained from Ziegler�Nichols ultimate sensitivity method�

Controller type Kc Ti Td

P ���Ku

PI ���Ku Tu����

PID ���Ku Tu�� Tu��

Page 143: Process Control

��� Tuning ���

K big, Ti big

K good, Ti big

K small, Ti big

K big, Ti good

K good, Ti good

K small, Ti good

K big, Ti small

K good, Ti small

K small, Ti small

Figure ���� Tuning chart for a PI controller�

Example ����Ziegler�Nichols tuning from Bode diagramConsider the system in Example ����� In Example �� we found that Am � ��and that the phase was ����� at � � ���� rad�s� This gives

Ku � ��

Tu ������

� ���

From Table ��� we get the following values for a PID controller Kc � ���Ti � ���� and Td � �����

Manual Tuning

The Ziegler�Nichols tuning rules give ballpark �gures� Experience has shownthat the ultimate sensitivity method is more reliable than the step responsemethod� To obtain systems with good performance it is often necessary todo manual �ne tuning� This requires insight into how control performance isin uenced by the controller parameters� A good way to obtain this knowledgeis to use computer simulations� A good experiment is to introduce set pointchanges and load disturbances� Manufacturers of controllers also provide tun�ing charts that summarizes experiments of this type for standard cases� Anexample of such a chart is given in Figure ����� Based on experiments rulesof the type

Increasing the gain decreases steady state error and stability

Increasing Ti improves stability

Increasing Td improves stability

can be used for the manual tuning� Notice� however� that simpli�ed rules ofthis type have limitations� We will illustrate the tuning rules and the use ofmanual �ne tuning by two examples

Page 144: Process Control

��� Chapter � PID Controllers

0 20 40 600

0.5

1

1.5 Set point and measured variable

0 20 40 600

1

2

3 Control variable

a)b)

c)

a)b)

c

Time t

Time t

Figure ���� Simulation of PI controllers obtained by a� the step response method b�the ultimate sensitivity method and c� by manual �ne tuning�

Example ����PI ControlConsider a system with the transfer function

G�s� ��

�s� ���

Let us �rst apply the step response method� In this case we can �nd thesteepest slope of the tangent and apparent dead�time analytically� Straightforward calculations give L � ���� The apparent time constant is obtainedfrom the condition T � L � � Hence T � ���� and L�T � ����� Table ���then gives Kc � ���� and Ti � ��� for a PI controller�

Applying the ultimate sensitivity method we �nd that � � � gives theintersection with the negative real axis� I�e�

G�i �� � �����

This implies that Ku � and Tu � ����� Since Kp � � it follows thatKuKp � � The ultimate sensitivity method can thus be applied� Table ���gives the Kc � ��� and Ti � ����

Figure ���� we show a simulation of the controllers obtained� In the sim�ulation a unit step command is applied at time zero� At time t � �� a distur�bance in the form of a negative unit step is applied to the process input� The�gure clearly shows the oscillatory nature of the responses due to the designrule based on quarter amplitude damping� The damping can be improved bymanual tuning� After some experimentation we �nd the parameters Kc � ���and Ti � �� This controller gives better damping� The response to the loaddisturbance is however larger than for the Ziegler�Nichols tuning�

Page 145: Process Control

��� Tuning ���

0 20 40 600

0.5

1

1.5 Set point and measured variable

0 20 40 600

1

2

3

4 Control variable

a)b)

c)

a)b)

c)

Time t

Time t

Figure ��� Simulation of PID controllers obtained by a� the step response method b�the ultimate sensitivity method and c� by manual �ne tuning�

Example ����PID ControlConsider the same system as in the previous example but now use PID control�The step response method� Table ���� gives the parameters Kc � ����� Ti ������ Td � ���� for a PID controller� Applying the ultimate sensitivity methodwe �nd from Table ��� Kc � ��� Ti � ��� and Td � ������

Figure ���� shows a simulation of the controllers obtained� The poordamping is again noticeable� Manual �ne tuning gives the parameters Kc ������ Ti � ����� Td � ������ and � � � which gives signi�cantly better damp�ing� Notice that it was necessary to put � � � in order to avoid the largeovershoot in response to command signals�

Model Based Tuning

Strictly speaking the Ziegler�Nichols methods are also based on mathematicalmodels� Now we will� however� assume that a mathematical model of the pro�cess is available in the form of a transfer function� The controller parameterscan then be computed by using some method for control system design� Wewill use a pole�placement design technique�

PI control of a �rst order system

The case when the process is of �rst order will now be considered� Assumethat the process dynamics can be described by the transfer function

Gp�s� �b

s� a������

In Laplace transform notation the process is thus described by

Y �s� � Gp�s�U�s� ������

Page 146: Process Control

��� Chapter � PID Controllers

A PI controller is described by

U�s� � Kc

��Yr�s�� Y �s� �

�sTi

�Yr�s�� Y �s��

�������

Elimination of U�s� between ������ and ������ gives

Y �s� � Gp�s�Kc�� ��sTi

�Yr�s�� Gp�s�Gc�s�Y �s�

where

Gc�s� � Kc� � sTisTi

Hence

�� � Gp�s�Gc�s��Y �s� � Gp�s�Kc�� ��sTi

�Yr�s� ������

The characteristic equation for the closed loop system is thus

� �Gp�s�Gc�s� � � �bKc�� � sTi�sTi�s� a�

� �

which can be simpli�ed to

s�s� a� � bKcs �bKc

Ti� s� � �a� bKc�s�

bKc

Ti� � �����

The closed loop system is thus of second order� By choosing the controller pa�rameters any characteristic equation of second order can be obtained� Let thedesired closed loop poles be ��� i�

p�� ��� The closed loop characteristic

equation is thens� � ���s � �� � � ������

Identi�cation of coe�cients of equal powers of s in ����� and ������ gives

a� bKc � ���

bKc

Ti� ��

Solving these linear equations we get

Kc ���� � a

b

Ti ����� a

��

������

This method of designing a controller is called pole�placement because thecontroller parameters are determined in such a way that the closed loop char�acteristic polynomial has speci�ed poles� Notice that for large values of � weget

Kc � ���b

Ti � ���

The controller parameters thus do not depend on a� The reason for this is sim�ply that for high frequencies the transfer function ������ can be approximatedby G�s� � b�s� The signi�cance of approximating the �rst order process byan integrator is that for the controlled process the behavior around � is ofmost relevance� That behavior is often well determined by using G�s� � b�s�

Page 147: Process Control

��� Tuning ���

Command Signal ResponseWith controller parameters given by Equation ������ the transfer function

from the command signal to the process output is

G�s� ��� � �Tis���

s� � ���s � ��������

The transfer function thus has a zero at

s � � ��Ti

The position of the zero can be adjusted by choosing parameter �� Parameter� thus allows us to also position a zero of the closed loop system� Notice thatthe process ������ does not have any zeros� The zero is introduced by thecontroller if � �� �� For large values of � the zero becomes s � ���������With � � � this gives a noticeable increase of the overshoot� To avoid thisovershoot the parameter � should be smaller than �������

PID control of a second order system

The case when the process is of second order will now be considered� Assumethat the process dynamics can be described by the transfer function

Gp�s� �b

s� � a�s � a�������

In Laplace transform notation the process is described by

Y �s� � Gp�s�U�s� ������

A PID controller is described by

U�s� � Kc

��Yr�s�� Y �s� �

�sTi

�Yr�s�� Y �s�� � sTd��Yr � Y �s��

�������

To simplify the algebra we are using a simpli�ed form of the controller �N ���� Elimination of U�s� between ������ and ������ gives

Y �s� � Gp�s�Kc

�� �

�sTi

� �sTd

�Yr�s�� Gp�s�Gc�s�Y �s�

where

Gc�s� � Kc� � sTi � s�TiTd

sTi

is the controller transfer function Hence

�� � Gp�s�Gc�s��Y �s� � Gp�s�Kc�� ��sTi

� �sTd�Yr�s�

The characteristic equation for the closed loop system is

� �Gp�s�Gc�s� � � �bKc�� � sTi � s�TiTd�sTi�s� � a�s� a��

� �

Page 148: Process Control

��� Chapter � PID Controllers

which can be simpli�ed to

s�s� � a�s� a�� � bKcTds� � bKcs�

bKc

Ti�

s� � �a� � bKcTd�s� � �a� � bKc�s�

bKc

Ti� �

������

The closed loop system is thus of third order� An arbitrary characteristicpolynomial can be obtained by choosing the controller parameters� Specifyingthe closed loop characteristic equation as

�s�����s�����s���� � s���������s�����������s���� � � ������

Equating coe�cients of equal powers of s in ������ and ������ gives the equa�tions

a� � bKcTd � ��� � ���

a� � bKc � �� � ������

bKc

Ti� ���

Solving these linear equations we get

Kc ��� � ������ � a�

b

Ti ��� � ������ � a�

���

Td ��� � ���� � a��� � ������ � a�

������

Notice that for large values of � this can be approximated by

Kc � �� � ������

b

Ti � � � �����

Td � �� ���� � �����

�����

The controller parameters then do not depend on a� and a�� The reason forthis is that the transfer function ������ can be approximated by G�s� � b�s�

for high frequencies�Notice that with parameter values ����� the polynomial

� � sTi � s�TiTd

has complex zeros� This means that the controller can not be implemented asa PID controller in series form� Compare with Equation �������

Command signal responseIt has thus been shown that he closed loop poles of a system can be

changed by feedback� For the PID controller they are in uenced by parametersKc� Ti and Td� The zeros of the closed loop system will now be considered�

Page 149: Process Control

��� Tuning ��

With controller parametersKc� Ti and Td given by Equation ������ the transferfunction from the command signal to the process output is

G�s� ������ � �sTi � �s�TiTd��s� � ���s� ����s� ���

������

The transfer function thus has a zero at the zeros of the polynomial

� � �sTi � �s�TiTd

The zeros of the transfer function can thus be positioned arbitrarily by choos�ing parameters � and �� Changing the zeros in uences the response to com�mand signals� This is called zero placement� Parameter � is normally zero�The transfer function ������ then has a zero at

s � � ��Ti

By choosing

� ��

��Ti�

��

�� � ������ � a�������

The zero will cancel the pole at s � ��� and the response to command signalsis thus a pure second order response� For large values of � ������ reduces to

� � ��� � ����

More Complex Models

It has thus been demonstrated that it is straight forward to design PI andPID controllers for �rst and second order systems by using pole�zero place�ment� From the examples we may expect that the complexity of the controllerincreases with the complexity of the model� This guess is indeed correct aswill be shown in Chapter �� In that chapter we will also give precise conditionsfor pole�placement�

In the general case the transfer function from command signal to processoutput has two groups of zeros� one group is the process zero and the othergroup is zeros introduced by the controller� Only those zeros introduced bythe controller can be placed arbitrarily� The two cases discussed are special inthe sense that the two process have no zeros�

Summary

In this section we have discussed several methods to determine the parametersof a PID controller� Some empirical tuning rules� the Ziegler�Nichols stepresponse method� and the Ziegler�Nichols ultimate sensitivity method was �rstdescribed� They are the prototypes for tuning procedures that are widely usedin practice� Tuning based on mathematical models were also discussed� Asimple method called pole�zero placement was applied to processes that couldbe described by �rst and second order models�

If process dynamics can be described by the �rst order transfer function������ the process can be controlled well by a PI controller� With PI controlthe closed loop system is of second order and its poles can be assigned arbitrary

Page 150: Process Control

�� Chapter � PID Controllers

values by choosing parameters Kc and Ti of the PI controller� The closed looptransfer function from command signal to output has one zero which can beplaced arbitrarily by choosing parameter � of the PI controller�

If process dynamics can be described by the second order transfer function������ the process can be controlled well by a PID controller� The closed loopsystems of third order and its poles can be placed arbitrarily by choosingparameters Kc� Ti� and Td of the PID controller� The closed loop transferfunction from command signal to process output has two zeros� They can beplaced arbitrarily by choosing parameters � and � of the PID controller�

��� Standardized Control Loops

In process control applications there are many standardized control loops� Ex�amples are control of ow� pressure� level� temperature� and concentration� Inthe following some guidelines are given to facilitate the choice of the controllersand some general rules for controller parameter settings are given� The rulesshould be used with some caution since there are large variations within thedierent classes of control loops�

Flow and Liquid Pressure Control

These types of processes are� in general� fast� The time constants are in theorder of ���� seconds� Measurement disturbances can be considerable andusually of high frequency� but low amplitude� For these types of processes PIcontrollers are generally used� The derivative term is not used due to the highfrequency measurement noise� The controller gain should be moderate�

Gas pressure control

Gas pressure control does in general only require P control or PI control withsmall amount of integral action� The gain in the controller can be high�

Level Control

Due to splashing and wave formation the measurements are usually noisy andPI controllers are used� Level control can be used for dierent purposes� Oneuse of a tank is to use it as a buer tank� In those cases it is only important tolimit the level to the capacity of the tank� This can be done with a low gainP controller or a PI controller with long reset time� In other occasions� suchas reactors and evaporators� it can be crucial to keep the level within strictlimits� A PI controller with a short reset time should then be used�

Temperature Control

Temperature control loops are in general very slow with time constants rangingfrom minutes to hours� The noise level is in general low� but the processesoften have quite considerable time lags� To speed up the temperature controlit is important to use a PID controller� The derivative part will introduce apredictive component in the controller�

Page 151: Process Control

��� Standardized Control Loops ���

+V1 V2

Z2

Z1−

ı

Figure ��� Standard circuit with an operational ampli�er�

Concentration Control

Concentration loops can have long time constants and a variable time delay�The time delays may be due to delays in analyzing equipment� PID controllersshould be used if possible� The derivative term can sometimes not be useddue to too much measurement noise� The controller gain should in general bemoderate�

��� Implementation of Controllers

Controllers can be implemented in many dierent ways� In this section it isshown how PID controllers can be realized using analog and digital techniques�

Analog Implementation

The operational ampli�er is an electronic ampli�er with a very high gain�Using such ampli�ers it is easy to perform analog signal processing� Signalscan be integrated� dierentiated and �ltered� Figure ���� shows a standardcircuit� If the gain of the ampli�er is su�ciently large� the current I is zero�Using Ohm�s law� we then get the following relation between the input andoutput voltages

V�V�

� �Z�Z�

������

By choosing the impedances Z� and Z� properly� we obtain dierent types ofsignal processing� Choosing Z� and Z� as resistors� i�e� Z� � R� and Z� � R��we get

V�V�

� �R�

R�������

Hence we get an ampli�er with gain R��R�� Choosing Z� as a resistance andZ� as a capacitance� i�e� Z� � R and Z� � ��sC� we get

V�V�

� � �RCs

������

which implements an integrator� If Z� is chosen as a series connection of aresistor R� and a capacitor C� and Z� is a resistor R�� we get

Z�Z�

�R�

R� � ��sC��

R�C�s

� �R�C�s�����

This corresponds to the approximate dierentiation used in a PID controller�

Page 152: Process Control

��� Chapter � PID Controllers

R2

C1R1

R3

C2

R

R

yr

y

u+_

_

+

R4

R4

Figure ���� Analog circuit that implements a PID controller�

By combining operational ampli�ers with capacitors and resistors� we canbuild up PID controllers� e�g� as is shown in Figure ����� This circuit imple�ments a controller with the transfer function

G�s� � Kc�� � sTi��� � sTd�sTi�� � sTd�N�

�����

where the controller parameters are given by

Kc � R�R���R�R� �R���

Ti � R�C�

Td � R�C�

N � R��R� � �

There are many other possibilities to implement the controller� For large inte�gration times the circuit in Figure ���� may require unreasonable componentvalues� Other circuits that use more operational ampli�ers are then used�

Digital Implementations

A digital computer can neither take derivatives nor compute integrals exactly�To implement a PID controller using a digital computer� it is therefore neces�sary to make some approximations� The proportional part

P �t� � Kc ��yr�t�� y�t�� �����

requires no approximation since it is a purely static relation� The integralterm

I�t� �Kc

Ti

tZe��� d� �����

is approximated by a rectangular approximation� i�e�

I�kh� h� � I�kh� �Kch

Tie�kh� ����

The derivative part given by

TdN

dD

dt�D � �KcTd

dy

dt�����

is approximated by taking backward dierences� This gives

D�kh� �Td

Td �NhD�kh� h�� KcTdN

Td �Nh�y�kh�� y�kh� h�� �����

Page 153: Process Control

�� Implementation of Controllers ���

Program

Clock

Figure ���� A simple operating system�

This approximation has the advantage that it is always stable and that thesampled data pole goes to zero when Td goes to zero� The control signal isgiven as

u�kh� � P �kh� � I�kh� �D�kh� �����

This approximation has the pedagogical advantage that the proportional� in�tegral� and derivative terms are obtained separately� There are many otherapproximations� which are described in detail in textbooks on digital control�

To introduce a digital version of the anti�windup scheme� we simply com�pute a signal

v�kh� � P �kh� � I�kh� �D�kh� �����

The controller output is then given by

u � sat�v umin umax� �

�umin if v � umin

v if umin v umax

umax if u � umax

�����

and the updating of the integral term given by Equation ���� is replaced by

I�kh� h� � I�kh� �Kch

Tie�kh� �

h

Tr�u�kh�� v�kh�� ������

To implement the controller using a digital computer� it is also necessaryto have analog to digital converters that convert the set point yr and themeasure value y to a digital number� It is also necessary to have a digitalto analog converter that converts the computed output u to an analog signalthat can be applied to the process� To ensure that the control algorithm getssynchronized� it is also necessary to have a clock so that the control algorithmis executed once every h time units� This is handled by an operating system�A simple form of such a system is illustrated in Figure �����

The system works like this� The clock gives an interrupt signal each sam�pling instant� When the interrupt occurs� the following program is executed�

Analog to digital �AD� conversion of yr and y

Compute P from �����

Compute D from �����

Compute v � P � I �D

Compute u from �����

Digital to analog �DA� conversion of u

Compute I from ������

Wait for next clock pulse

Page 154: Process Control

��� Chapter � PID Controllers

��� REM

�������������������������������

� PID REGULATOR �

� AUTHOR� K J Astrom �

�������������������������������

��� REM FEATURES

DERIVATIVE ON MEASUREMENT

ANTI WINDUP

��� REM VARIABLES

YR SET POINT

Y MEASUREMENT

U REGULATOR OUTPUT

��� REM PARAMETERS

K GAIN

TI INTEGRAL TIME

TD DERIVATIVE TIME

TR RESET TIME CONSTANT

N MAX DERIVATIVE GAIN

H SAMPLING PERIOD

UL LOW OUTPUT LIMIT

UH HIGH OUTPUT LIMIT

��� �

��� REM PRECOMPUTATIONS

��� AD�TDTD�N�H�

��� BD�K�TD�NTD�N�H�

��� BI�K�HTI

��� BR�HTR

��� REM MAIN PROGRAM

��� YR�PEEK����

��� Y�PEEK����

��� P�K�B�YR Y�

��� D�AD�D BD�Y YOLD�

��� V�P�I�D

��� U�V

��� IF U�UL THEN UL

��� IF U�UH THEN UH

��� U�POOKE����

��� I�I�BI�YR Y��BR�U V�

��� YOLD�Y

��� RETURN

END

Listing ��� BASIC code for PID controller�

When the interrupt occurs� digital representations of set point yr and measuredvalue y are obtained from the analog to digital conversion� The control signalu is computed using the approximations described earlier� The numericalrepresentation of u is converted to an analog signal using the DA converter�The program then waits for the next clock signal� An example of a completecomputer code in BASIC is given in Listing ����

The subroutine is normally called at line ���� The precomputations start�ing at line ��� are called when parameters are changed� The purpose ofthe precomputations is to speed up the control calculations� The command

Page 155: Process Control

�� Implementation of Controllers ���

PEEK����� reads the analog signal and assigns the value yr to it� The com�mand POKE����� executes an DA conversion� These operations require thatthe AD and DA converters are connected as memory mapped IO�

Incremental Algorithms

Equation ����� is called position algorithm or an absolute algorithm� In somecases it is advantageous to move the integral action outside the control al�gorithm� This is natural when a stepper motor is used� The output of thecontroller should then represent the increments of the control signal and themotor implements the integrator� Another case is when an actuator with pulsewidth control is used� In such a case the control algorithm is rewritten so thatits output is the increment of the control signal� This is called the incrementalform of the controller� A drawback with the incremental algorithm is that itcannot be used for P or PD controllers� If this is attempted the controllerwill be unable to keep the reference value because an unstable mode� whichcorresponds to the integral action is cancelled�

Selection of Sampling Interval and Word Length

The sampling interval is an important parameter in a digital control system�The parameter must be chosen su�ciently small so that the approximationsused are accurate� but not so small that there will be numerical di�culties�

Several rules of thumb for choosing the sampling period for a digital PIDcontroller are given in the literature� There is a signi�cant dierence betweenPI and PID controllers� For PI controllers the sampling period is related tothe integration time� A typical rule of thumb is

h

Ti� ���� ���

when Ziegler�Nichols tuning is used this implies

h

L� ���� �

where L is the apparent dead�time or equivalently

h

Tu� ���� ���

where Tu is the ultimate period�With PID control the critical issue is that the sampling period must be

so short that the phase lead is not adversely aected by the sampling� Thisimplies that the sampling period should be chosen so that the number hN�Tdis in the range of ��� to ���� With N � �� this means that for Ziegler�Nicholstuning we have

h

L� ����� ����

orh

Tu� ������� ������

Controllers with derivative action thus require signi�cantly shorter samplingperiods than PI controllers�

Page 156: Process Control

��� Chapter � PID Controllers

Commercial digital controllers for few loops often have a short �xed sam�pling interval on the order of ��� ms� This implies that PI control can be usedfor processes with ultimate periods larger than ��� s but that PID controllerscan be used for processes with ultimate periods larger than �� s�

From the above discussion it may appear advantageous to select the sam�pling interval as short as possible� There are� however� also drawbacks bychoosing a very short sampling period� Consider calculation of the integralterm� Computational problems� such as integration o�set may occur due tothe �nite precision in the number representation used in the computer� As�sume that there is an error� e�kh�� The integrator term is then increased ateach sampling time with

Kch

Tie�kh� ������

Assume that the gain is small or that the reset time is large compared tothe sampling time� The change in the output may then be smaller than thequantization step in the DA�converter� For instance� a ���bit DA converter�i�e�� a resolution of ������ should give su�ciently good resolution for controlpurposes� Yet if Kc � h � � and Ti � ����� then any error less than ��� ofthe span of the DA converter gives a calculated change in the integral part lessthan the quantization step� There will be an oset in the output if the integralpart is stored with the same number of digits as used in the DA converter�One way to avoid this is to use higher precision in the internal calculationsthat are less than the quantization level of the output� Frequently at least �bits are used to implement the integral part in a computer� in order to avoidintegration oset� It is also useful to use a longer sampling interval whencomputing the integral term�

�� Conclusions

In this chapter we have discussed PID control� which is a generic name for aclass of controllers that are simple� common� and useful� The basic controlalgorithm was discussed in Section ��� where we discussed the properties ofproportional� integral� and derivative control� The proportional action pro�vides the basic feedback function� derivative action gives prediction and im�proves stability� integral action is introduced so that the correct steady statevalues will be obtained� Some useful modi�cations of the linear behavior ofthe control algorithm� Large signal properties were discussed in Section ���� Aparticular phenomena called integral windup was given special attention� Thisled to another modi�cation of the algorithm by introducing the anti�windupfeature� In Section �� we discussed dierent ways of tuning the algorithmboth empirical methods and methods based on mathematical models� Thedesign method introduced was pole�zero placement� The controller parame�ters were simply chosen to give desired closed loop poles and zeros� In Section��� we �nally discussed implementation of PID controllers� This covered bothanalog and digital implementation�

This chapter may be viewed as a nutshell presentation of key ideas ofautomatic control� Most of the ingredients are here� More sophisticated con�trollers dier from PID controller mainly in the respect that they can predictbetter� The pole�placement design method can also be applied to more com�plex controllers� The implementation issues are also similar�

Page 157: Process Control

Design ofSingle Loop Controllers

GOAL� To demonstrate how more complex control schemes are built

up using simple feedback loops in linear and nonlinear couplings

��� Introduction

The feedback controller developed in Chapters and � is a very powerful tool�which can provide e�cient control and thus ensure stable operation of manysimple processes� The simple feedback controller suers� however� from twobasic shortcomings one which originate from the necessity of the measurementof the controlled variable and another which originates in varying operatingconditions�

� A deviation has to be registered between the controlled variable and thesetpoint before any corrective action is taken by the controller�

� If operating conditions vary signi�cantly then stability of simple feedbackmay be threatened due to varying process parameters�

Methods to deal with some aspects of these limitations are given in this chap�ter� The fact that a deviation must be registered before any corrective actioncan be taken implies that simple feedback is not very useful for processes withlarge delays relative to the dominating time constants� In many processes itmay be possible to measure secondary process variables� which show the eectof disturbances before it is seen in the controlled variable� This leads to theidea of using a secondary loop to aid the primary control loop� This usage ofmultiple loops� called cascade control� is very widespread in the process indus�tries to improve the performance of simple feedback� Other ways of handlingdisturbances and large delays using process models are discussed in Chapter�� The ultimate case of this �rst basic limitation� occurs when the desired con�trolled variable cannot be measured� then simple feedback cannot be applied�and one must resort to using secondary process measurements to estimate thedesired controlled variable� Such methods require also process models�

���

Page 158: Process Control

��� Chapter Design of Single Loop Controllers

There are many instances where it may be advantageous to use nonlin�ear couplings to improve the behavior of simple feedback control� Four suchcases related to varying operating conditions are mentioned below� In manyprocesses it is known a priori that certain ow rates should stay in a �xedratio to maintain the product quality� such a relationship may be achieved bymeasuring one �or both� ow rate��s� and then by a type of feedforward keepthe other ow such that the ratio stays constant� This type of feedforwardlike control is called ratio control� In processes where the operating conditionschange over fairly wide ranges� e�g� with market driven variations in productdemands it may be desirable to retune the controllers quite often in order toachieve acceptable performance� This retuning may be avoided by switchingbetween pretuned controller parameter sets as the production level changes�Scheduling of controller settings in this manner is called gain scheduling� Thismethod is introduced as one way of handling varying linear process charac�teristics� In processes where a large operating range is required it may benecessary to change the actuator variable� e�g� from heating to cooling� suchchanges may be accomplished using what is called split range controllers� Forprocesses where the operating regime may change during operation and createundesirable behavior it may be necessary to use interlocks and selectors forprotection and safety reasons�

In summary this chapter deals with improving the behavior of feedbackcontrol using �rst a linear and then nonlinear functions� which are built aroundthe simple feedback loop� The main application of these techniques stemsfrom operating the processes under varying conditions� The implementationof these functions have been simpli�ed tremendously by the digital computer�Therefore the techniques described in this chapter have reached widespreadusage in the process industries� The next section introduces the linear cascadecontrollers� The nonlinear couplings are dealt with in Section ��� where ratiocontrol is discussed� Feedforward control is treated in Section ��� Section ���deals with varying linear process characteristics� Gain scheduling is treated inSection ���� The conclusions of the chapter are summarized in Section ����

��� Cascade Control

Often it is di�cult to meet the desired performance requirements for a givenprimary measurement and actuator with a simple feedback loop design� Thedi�culty may arise from disturbances� the eect of which are only seen in themeasured variable� thus any corrective action by the controller only can occurafter this fact has been observed� The di�culty in meeting the performancerequirements may also arise from varying process parameters� In both casesapplication of an additional measurement and an additional controller to sup�ply the setpoint to the primary controller may yield the desired performanceimprovement� This application of more controllers and measurements to ful�llperformance requirements on one primary controlled variable is called cascadecontrol� Cascade control is introduced below using a heating system example�which may be found in a process furnace or boiler but also in say a waterheater in a household� Thereafter the general principles for cascade controlare introduced� and con�guration and crude design guidelines are given�

Page 159: Process Control

�� Cascade Control ��

Processfluid feed

TrTC TT

Figure ��� A process diagram for a process furnace with schematic control system�

Processfluid feed

Fr

FC FT

TrTC TT

Figure ��� A process furnace with schematic cascade control system�

A process furnace

A process diagram for a process furnace is illustrated in Figure ���� Fuel issupplied to the burners� The energy input is determined by the fuel valve�The process uid exit temperature is measured� and a control loop to controlthis temperature manipulating the fuel valve is shown� The disturbances arepressure and temperature of the fuel and temperature of the process uid�Disturbances in fuel pressure are common� Cancellation hereof with the singleloop controller shown in Figure ��� is slow since the pressure eect is only seenwhen the process uid temperature changes� To improve the control systemperformance the fuel owrate may be measured and controlled locally using asecondary controller� Then the setpoint of this secondary controller is given bythe primary controller� as illustrated in Figure ���� This cascade controller hasmany improved properties compared to the single control loop shown in Figure���� It is intuitively clear that fuel supply pressure variations now rapidlymay be compensated by the secondary ow controller� and that this couplingalso may be able to compensate for a nonlinear fuel valve characteristic� asdemonstrated in Chapter � The question remains whether this coupling maybe able to improve the performance to disturbances in the primary loop� Toascertain the intuitive claims and the latter question a little analysis is helpfulas follows in the next subsection�

Page 160: Process Control

�� Chapter Design of Single Loop Controllers

ΣΣ Gp2Gc2

Gd1Gd2

Y1

Yr2Gc1

E1Yr1

Y2

E2

D2 D1

Gp1Σ ΣX1X2

−Gt1

−Gt2

Figure ��� Block diagram of a cascade control system�

Analysis of cascade control

As illustrated above cascade control normally includes a primary controller�which also is called a master controller� and a secondary controller� which alsois called a slave controller� To assist analysis a block diagram for cascadecontrol is drawn in Figure ���� Here the following symbols are used�

Ei�s� Error signal � Yri�s�� Yi�s� for loop iDi�s� Disturbance for loop iGci�s� Controller transfer function for loop iGdi�s� Disturbance transfer function for loop iGpi�s� Process transfer function for loop iGti�s� Transmitter transfer function for loop iXi�s� State variable to be measured for loop iYi�s� Measured variable for loop iYri�s� Reference value for measured variable for loop i

In terms of this block diagram the process furnace has the measurement of owrate of fuel for the inner loop and of temperature of the process uid for theouter loop� Note also that in this block diagram for cascade control the valvetransfer function in the process furnace case is Gp� and that the disturbancetransfer function Gd� depends upon whether fuel pressure or inlet temperaturedisturbance is considered� From this block diagram some properties of cascadecontrol may be developed by formulating a transfer function for the primaryloop� and analyzing this transfer function for two extreme cases of secondarycontroller design� In the following analysis the Laplace variable argument sis omitted from variables and transfer functions in the formulas for clarity ofreading�

A general transfer function for the cascade controller is formulated usingthe block diagram manipulation rules� First the transfer function for thesecondary loop is formulated� From Figure ��� it is noted that

X� � Gd�D� �Gp�Gc��Yr� � Y��

Y� � Gt�X�

Thus by insertion and elimination

X� �Gd�

� � Gt�Gp�Gc�D� �

Gp�Gc�

� �Gt�Gp�Gc�Yr� � Hd�D� �Hr�Yr� �����

Page 161: Process Control

�� Cascade Control ���

Σ

Gd1

Y1

Yr2Gc1

E1Yr1

D2D1

Gp1ΣX1X2Gp2Gc2

1+L2

Σ

Gd2

1+L2

−Gt1

Figure ��� Simpli�ed block diagram of the cascade control system in Figure ��� withL� � Gt�Gp�Gc��

Using the two transfer functions de�ned through the last equality� the blockdiagram may simpli�ed as shown in Figure ��� For the primary loop thetransfer function is determined analogously to the secondary loop� using thetransfer functions de�ned in equation ����� for the secondary loop

X� � Gd�D� � Gp�X�

Inserting ����� and the relations for the primary controller

Yr� � Gc��Yr� � Y�� and Y� � Gt�X�

gives

X� �Gd�D� � Gp�Hd�D� �Gp�Hr�Gc�Yr�

� � Gt�Gp�Hr�Gc������

The characteristic equation for the primary loop may be obtained using thetransfer functions for the secondary loop in �����

� �Gt�Gp�Hr�Gc� ��� Gt�Gp�Gc� � Gt�Gp�Gp�Gc�Gc�

� � Gt�Gp�Gc������

To obtain some insight the primary loop transfer function in ����� is investi�gated in two limiting cases�

i� The secondary controller is not used� i�e� Gc� � �� and Gt� � �� hence thetransfer function simpli�es to

X� �Gd�D� � Gp�Gd�D� �Gp�Gp�Gc�Yr�

� � Gt�Gp�Gp�Gc�����

ii� The secondary controller is perfect� This ideal case of perfect controlcan be obtained if it is possible to realize a controller with high gainover the relevant frequency range� This may be achieved for a �rst orderprocess even though the parameters are uncertain� That this ideal controlis indeed feasible in a more general sense� for processes without delays andright half plane zeros� is shown in Chapter �� Realization of perfect controldoes� however� in this latter case require that the process parameters areperfectly known� Assuming that the transfer functions Gp� and Gt� doabide with these limitations� the transfer function for the secondary loopequation ����� simpli�es to

X� � �D� �G��t� Yr� � G��

t� Yr�

Thus the primary loop transfer function in equation ����� simpli�es to

X� �Gd�D� � G��

t� Gp�Gc�Yr�

� �G��t� Gt�Gp�Gc�

�����

Page 162: Process Control

��� Chapter Design of Single Loop Controllers

Comparison of the two extreme case transfer functions in equations ����and ������ in case of a fast measurement in the secondary loop� shows thepossible advantages of cascade over single loop control�

� The secondary loop may cancel disturbances in D� perfectly�

� With perfect control in the secondary loop� the cascade controller will beinsensitive to parameter variations in Gp��

� In case of signi�cant parameter variations in Gp� a consequence of theprevious point is that it is possible to tune the primary cascade controllerin ����� better than the single loop controller in ���� towards disturbancesD� in the primary loop� as well as for setpoint changes in Yr��

Cascade control may be extended to include several loops in inner cascade� Thecontrol system performance may be improved until a limit which is reachedwhen all state variables are measured� In this case cascade control developsinto state variable feedback� This subject is dealt with in Chapter ��

Guidelines for design of cascade controllers

The design considerations deal with selection of the secondary measurement�choice of controller and controller tuning�

The choice of secondary measurement is essential� since the secondaryloop dynamics ideally should enable perfect control of this loop� Thereforethe following guidelines should be followed when screening measurements fora secondary loop�

i� The secondary loop should not contain any time delay or right half planezero�

ii� The essential disturbance to be cancelled should attack in the secondaryloop�

If it is not possible to ful�ll these two requirements then the advantages ofcascade control are diminished� and a closer analysis should be carried out towarrant such an application�

When the secondary measurement is selected� the control structure is�xed� Then the controller form and tuning parameters remain to be �xed�It is di�cult to give general guidelines since the choices are determined bythe process dynamics and the disturbance properties� However� some rules ofthumb regarding the secondary controller form may be useful�

� The secondary controller can often be selected as a pure P�controller� D�action may be included to improve the bandwidth of the secondary loop�In this case the reference signal should not be dierentiated� I�action isprobably only bene�cial if Gp� contains signi�cant time delay�

Note that by this design of the secondary loop an oset is left to be eliminatedby the primary loop� which also handles other slow disturbances�

Tuning of cascade controllers is carried out as for simple controllers� onecontroller at a time� The innermost controller is tuned �rst� In the case oftwo controllers in a cascade it is a sensible rule to tune the inner loop withoutovershoot�

If model�based design is applied then the controller form is determinedby the process dynamics� and the tuning by the accuracy of the process in�formation� as discussed in Chapter �� Note that application of perfect controlrequires precise knowledge of process parameters except if the process may be

Page 163: Process Control

�� Cascade Control ���

represented by �rst order dynamics where a high controller gain may be usedto compensate for parameter variations�

Integrator windup in cascade controller

Elimination of integrator windup in cascade controllers require special consid�eration� The di�culties may be illustrated using Figure ���� Integral windupin the secondary loop may be eliminated as described in Chapter �� Thismethod may� however� not be applied in the primary loop unless its outputsignal Yr� also saturates� In other words information about saturation has tobe transferred from the secondary to the primary loop� This problem may besolved by de�ning two operation modes for the controller�

� Regulation� The reference and measurement are inputs and the controllergenerates a normal output�

� Tracking� The reference� measurement and actuator limits are inputs�

Thus in the tracking mode the controller function as a pure observer� whichonly ensures that the controller state is correct� One simple implementationis illustrated below for a PI controller code�

Input yr� y� umin� umax

Output u

Parameters k� ti

e�yr�y

v�ke�i

u� if v�umin then umin else if v�umax then v else umax

i�i�u�v�kehti

end

This algorithm is the same as was used to eliminate integral windup dueto actuator saturation in Chapter �� The only dierence is that the actuatorsaturation limits umin and umax are considered as inputs to the controller� Thecontroller is switched to the tracking mode by setting these limits equal to themeasured signal in the secondary loop� when the secondary loop saturates�

��� Ratio Control

In the process industries it is often desirable to maintain a �xed ratio betweentwo variables� One example is two feed streams to a chemical reactor where itis desirable to maintain the molar ratio in order to ensure the proper stoichio�metric mixture for the reaction� Another example is two ows in a separationprocess� such as the re ux ratio� i�e� ratio of re ux ow to distillate ow� in adistillation column� Ratio control is extensively used in the process industries�Below two implementation methods for ratio control will be discussed and onewill be illustrated upon an air�fuel ratio control of a combustion process�

In Figure ��� the two ratio control schemes are shown� with the output ucontrolling y and yr being the reference ratio variable�

a� In scheme a� the ratio of the two measured variables is calculated andcompared to the desired ratio r� The formed deviation is

ea � r � y

yr�����

Page 164: Process Control

��� Chapter Design of Single Loop Controllers

a)y

y

b)

PI

−1

Σ

Π

Σyr

y

yr

+

PIuea

r−y

reb

ryr

yr

u

Figure ��� Block diagram for two implementations of ratio PI control� The desired ratioof y�yr is r� The symbol � designates multiplication� designates division�

b� In scheme b� the denominator variable yr is multiplied with the desiredratio� thus forming the desired value ydesired for y� The deviation is formed

eb � ryr � y �����

In both cases the controller output is generated from the error signal with aconventional PI �or PID� controller function� It follows from the two errorequations that if the error is zero then

r �y

yr�����

Thus both schemes ful�ll their purpose of keeping the ratio constant at steadystate�

The main dierence between the two schemes is seen by �nding the gainof the two error signals as yr varies� These gains may be determined by �ndingthe partial derivative of the error with respect to the varying variable yr

ka � ea yr

����y

�y

y�r�����

kb � eb yr

����y

� r ������

Thus the gain is variable in the a� scheme but constant in the b� scheme�Both schemes are commonly used in practice� but the b� scheme is appliedmost often due to the constant gain�

A ratio controller can be built from a conventional PI or PID controllercombined with a summation and multiplier� These are often supplied as oneunit� since this control function is so common� where the controller can beswitched from a ratio to a normal controller�

Example ����Air�fuel ratio to a boiler or a furnaceControlling a boiler or a furnace it is desirable to maintain a constant ratiobetween air and fuel� Air is supplied in excess to ensure complete combustionof the fuel� The greater the air excess the larger is the energy loss in thestack gases� Therefore maintaining an optimal air excess is important foreconomical and environmental reasons� A con�guration to achieve this goalusing ratio control is shown in Figure ���� The fuel ow is controlled by a PIcontroller� The air ow is controlled by a ratio controller where fuel ow isthe ratio variable� This con�guration includes also a bias b� which for safetyreasons ensures an air ow even when no fuel ow is available� Evaluation ofthe control error gives

e � rFf � b� Fair ������

Page 165: Process Control

�� Ratio Control ���

PI

PI

Ratio regulator

b

Fr

_

_

Σ

Π

Σ Σ

Fuel

r

FairAir

Ff

Figure ��� Con�guration for air�fuel ratio control to a boiler or a furnace�

Measurabledisturbance

Σ

Control signal

Feedforwardu

vProcess

yGf Gp

Gv

Figure �� System with measurable disturbance�

Thus the static ow characteristic is� Fair � rFf � b�

��� Feedforward

The previous chapters showed some of the advantages with feedback� Oneobvious limitation of feedback is that corrective actions of course can notbe taken before the in uence is seen at the output of the system� In manyprocess control applications it is possible to measure the disturbances cominginto the systems� Typical examples are concentration or temperature changesin the feed to a chemical reactor or distillation column� Measurements of thesedisturbances can be used to make control actions before anything is noticedin the output of the process� It is then possible to make the system respondmore quickly than if only feedback is used�

Consider the process in Figure ���� Assume that the disturbance can bemeasured� The objective is to determine the transfer function Gf such thatit is possible to reduce the in uence of the measurable disturbance v� This iscalled feedforward control� The system is described by

Y � GpU �GvV � �GpGf �Gv�V

Page 166: Process Control

��� Chapter Design of Single Loop Controllers

The disturbance is totally eliminated from the output if

Gf � �Gv

Gp������

Feedforward is in many cases very eective� The great advantage is that rapiddisturbances can be eliminated by making corrections before their in uencesare seen in the process output� Feedforward can be used on linear as well asnonlinear systems� Feedforward can be regarded as a built�in process model�which will increase the performance of the system� The main drawback withfeedforward is that it is necessary to have good process models� The feed�forward controller is an open loop compensation and there is no feedback tocompensate for errors in the process model� It is therefore common to combinefeedforward and feedback� This usually gives a very eective way to solve acontrol problem� Rapid disturbances are eliminated by the feedforward part�The feedback takes care of unmeasurable disturbances and possible errors inthe feedforward term�

To make an eective feedforward it is necessary that the control signalcan be su�ciently large� i�e� that the controller has su�ciently large controlauthority� If the ratio of the time constants in Gp and Gv is too large thenthe control signals become large� To illustrate this assume that the transferfunctions in Figure ��� are

Gp �kp

� � TpsGv �

kv� � Tvs

The feedforward controller given by ������ becomes

Gf � �kvkp � � Tps

� � Tvs

The high frequency gain is kvTp��kpTv�� If this ratio is large then the feedfor�ward controller has high gain for high frequencies� This will lead to di�cultiesif the measurement is corrupted by high frequency noise� Also if the pole ex�cess �I�e� the dierence between the number of poles and zeros in the transferfunction�� is larger in Gp than in Gv the feedforward controller will resultin derivatives of the measured signal� One way to avoid the high frequencyproblem with feedforward is to only use a static feedforward controller� i�e� touse Gf���� This will also reduce the need for accurate models�

Example ����FeedforwardConsider the tank system in Figure ���� The level is controlled using the input ow� The output ow is a measurable disturbance� It is assumed that there isa calibration error �bias� in the measurement of the output ow� The tank isdescribed by an integrator� i�e� Gp � ��s� and the valve as a �rst order system

Gvalve�s� ��

s� �

The feedforward controller is in this case given by

Gf �s� ��

Gvalve�s�� s� �

Page 167: Process Control

�� Feedforward ���

Σ

Manipulate input

Measureddisturbance

Bias

Disturbance

ΣΣ Σ

Σ

– 1

TankValve

BiasDisturbance v

Gf

yr Control-ler

Figure �� Tank system with measurable disturbance�

The controller will thus contain a derivation� The derivative can be approxi�mated by the high pass �lter

s � s

� � Tds

The feedforward is implemented as

Gf��s� �s

� � Tds� � ������

or as the static feedforward controller

Gf���� � � �����

Figure ��� shows the response to a step disturbance when Td � ��� and when������ and ����� are used� The reference value is zero� Also the responsewithout feedforward is shown� The response is greatly improved by includingthe dynamics in the feedforward controller� A bias in the measurement willcause a drift in the output� since the controller does not have any feedbackfrom the output level�

Assume that the controller is extended with a feedback part� Figure ����shows the output and input when both feedforward and feedback are used�The example shows the advantage of combining feedforward with feedback�

Feedforward from the reference signal

The reference signal can also be regarded as a measurable disturbance� whichcan be used for feedforward� Figure ���� shows one way to do this� A referencemodel is included in the block diagram� The purpose with the model is to give

Page 168: Process Control

��� Chapter Design of Single Loop Controllers

0 2 4 6 8 10−0.5

0

0.5

1

1.5 Output, bias=0

0 2 4 6 8 10−0.5

0

0.5

1

1.5 Output, bias=-0.05

a)

b)

(6.14)

(6.13)

Without feedforward

(6.14)

(6.13)

Without feedforward

Time t

Time t

Figure ��� Feedforward control of the process in Figure ��� using ������ and ������ withTd � �� when the disturbance is a unit step� The response without feedforward i�e� theopen loop response is also shown� �a� No bias� �b� Bias�����

0 10 20 30 40 500

0.5

1

1.5

2 Output

0 10 20 30 40 50

−10

−5

0

5 Input

a)

b)

Without feedforward

With feedforward

Time t

Time t

Figure ���� Feedforward and feedback control of the process in Figure ��� using ������with Td � �� and bias����� �a� Output with and without feedforward� �b� Input withfeedforward� The reference signal is a unit step at t � and the load disturbance is a unitstep at t � ���

a reference trajectory for the system to follow� The feedforward part of thecontroller will speed up the response from changes in the reference signal�The feedback controller corrects errors between the reference model and thetrue output from the system� The feedback then accounts for unmeasurable

Page 169: Process Control

�� Feedforward ��

ΣΣReference model

Controller Process

– 1

Feed- forward

Figure ���� Model following and feedforward�

disturbances and errors in the feedforward part of the controller�

��� Varying Process Characteristics

In many cases the process statics and dynamics vary with changing operatingconditions� A simple example is a control valve� which generally has a nonlin�ear valve characteristic� Therefore the gain will vary with the valve opening�i�e� with the operating point� A similar argument is valid for all nonlinearprocesses where the static characteristics� and thus the static gain varies withthe operating conditions� In most processes the dynamics also depend uponthe actual operating point� For instance� many time constants and delays areoften inversely proportional to the production rate� Dynamics are also af�fected by aging� such as catalyst deactivation in chemical reactors and foulingon heat exchange surfaces�

When signi�cant parameter variations are encountered simple feedbackcontrol may not be su�cient to ensure stable operation� For example� the gainmargin used in the Ziegler�Nichols ultimate gain tuning method is two� Thusif parameter variations make the gain at the cross over frequency increaseswith more than a factor of two stability will be lost with such a design� Tohandle signi�cantly varying parameters a number of possibilities exist�

� Local feedback

� Gain scheduling

� Nonlinear feedback

� Adaptive feedback

Local feedback

In connection with feedback sensitivity analysis in Chapter � it was shownthat a simple feedback control system could be made relatively insensitiveto parameter variations if the control gain could be made large� To achievethis high gain the process dynamics should be of �rst order� thus very localfeedback is required� As demonstrated in Section ��� such local feedback maybe used as a secondary loop in a cascade controller�

Gain scheduling

In some instances the variations in process statics and dynamics are uniquelyrelated to measurable variables� In many process plants some time constantsand delays vary inversely proportional to the production level� In these cases

Page 170: Process Control

�� Chapter Design of Single Loop Controllers

Process parameters

Design Estimation

yController Process

u

cu

Controllerparameters

Specification

Figure ���� Block diagram for an adaptive controller�

a set of controllers may be designed to cover the expected range of operatingconditions� The controller parameters are then tabulated as a function of theoperating conditions� The applied controller parameters are found throughinterpolation in the tables or by development of a functional relationship�These smoothing features are applied to facilitate transfer between controllerparameters as the operating conditions vary� a consideration which is quiteimportant in practical applications� Development of functional relationshipsbetween controller parameters and indicators for operating conditions can befacilitated by using models in normalized form as derived in Chapter �� Gainscheduling is discussed in more detail in the next section�

Nonlinear feedback

In some cases it may be possible to apply a feedback controller with a nonlinearfunction to compensate for parameter variations� In its simplest form thisnonlinearity may compensate for the static nonlinearity only� An examplewould be the application of a speci�c valve characteristic to compensate for aprocess nonlinearity� This can be regarded as a special case of gain scheduling�Examples of nonlinear compensation is found in Section ����

Adaptive feedback

If the process dynamics cannot be related in a simple way to the operatingcharacteristics� then adaptive feedback or adaptive control may be applied� Inan adaptive controller the parameters of the controller are modi�ed to takechanges in the process or the disturbances into account� A typical block di�agram for an adaptive controller is shown in Figure ����� In the block (Es�timation� the parameters of a model of the process are estimated recursively�The estimates are updated each time new measurements are available� Theestimated parameters are then used in the block (Design� to determine theparameters of the controller� To do the design it is also necessary to givespeci�cations for the desired response of the closed loop system� The processcontrolled by an adaptive controller will have two feedback loops� One fastloop� which consists of the conventional controller� The second loop is� in gen�eral� slower and is the estimation and the design of the controller� The schemein Figure ���� is sometimes called indirect adaptive control� since the controllerparameters are obtained indirectly via the estimated process model� It is alsopossible to design an adaptive controller where the controller parameters areestimated directly� This is called direct adaptive control� The block (Design� is

Page 171: Process Control

�� Varying Process Characteristics ���

Commandsignal

Controller Process

scheduleGain

Controlsignal Output

Controllerparameters condition

Operating

u y

Figure ���� Block diagram for controller with gain scheduling�

then eliminated� The direct adaptive controller is obtained by reparameteriz�ing the process model such that the controller parameters are introduced� Todo so the speci�cations of the closed loop system are used�

This whole area of adaptive control has lead to a signi�cant theoreticaldevelopment of especially single loop adaptive control� as described in )str*mand Wittenmark ������� Adaptive single loop controllers are now commer�cially available and in use in tens of thousands of industrial loops�

��� Gain Scheduling and Nonlinear Feedback

In many situations it is known how the dynamics of a process change withthe operating conditions of the process� One source for the change in dynam�ics may be nonlinearities that are known� It is then possible to change theparameters of the controller by monitoring the operating conditions of theprocess� This idea is called gain scheduling� since the scheme was originallyused to accommodate changes in process gain only� Gain scheduling is a non�linear feedback of special type� it has a linear controller whose parameters arechanged as a function of operating conditions in a preprogrammed way� SeeFigure ����� Note that the operating condition here is considered as a measur�able signal� This signal is considered to vary considerably slower than otheroutputs� The idea of relating the controller parameters to auxiliary variablesis old� but the hardware necessary to implement it easily was not availableuntil computers were used to implement the controllers� To implement gainscheduling with analog techniques it is necessary to have function generatorsand multipliers� Such components have been quite expensive to design andoperate� Gain scheduling has thus only been used in special cases� such as inautopilots for high�performance aircraft� Gain scheduling is easy to implementin computer�controlled systems� provided that there is support in the availablesoftware and is now frequently used�

Gain scheduling based on measurements of operating conditions of theprocess is often a good way to compensate for variations in process parametersor known nonlinearities of the process� There are many commercial processcontrol systems in which gain scheduling can be used to compensate for staticand dynamic nonlinearities� Split�range controllers that use dierent sets ofparameters for dierent ranges of the process output can be regarded as aspecial type of gain scheduling controllers�

Page 172: Process Control

��� Chapter Design of Single Loop Controllers

The principle

It is sometimes possible to �nd auxiliary variables that correlate well withthe changes in process dynamics� It is then possible to reduce the eectsof parameter variations simply by changing the parameters of the controlleras functions of the auxiliary variables� see Figure ����� Gain scheduling canthus be viewed as a feedback control system in which the feedback gains areadjusted using feedforward compensation� The concept of gain schedulingoriginated in connection with development of ight control systems� In thisapplication the Mach number and the dynamic pressure are measured by airdata sensors and used as scheduling variables�

A main problem in the design of systems with gain scheduling is to �ndsuitable scheduling variables� This is normally done based on knowledge ofthe physics of a system� In process control the production rate can often bechosen as a scheduling variable� since time constants and time delays are ofteninversely proportional to production rate�

When scheduling variables have been determined� the controller parame�ters are calculated at a number of operating conditions� using some suitabledesign method� The controller is thus tuned or calibrated for each operatingcondition� The stability and performance of the system are typically eval�uated by simulation� particular attention is given to the transition betweendierent operating conditions� The number of entries in the scheduling tablesis increased if necessary� Notice� however� that there is no feedback from theperformance of the closed�loop system to the controller parameters�

It is sometimes possible to obtain gain schedules by introducing nonlineartransformations in such a way that the transformed system does not dependon the operating conditions� The auxiliary measurements are used togetherwith the process measurements to calculate the transformed variables� Thetransformed control variable is then calculated and retransformed before itis applied to the process� The controller thus obtained can be regarded ascomposed of two nonlinear transformations with a linear controller in be�tween� Sometimes the transformation is based on variables obtained indirectlythrough state estimation�

One drawback of gain scheduling is that it is an open�loop compensa�tion� There is no feedback to compensate for an incorrect schedule� Anotherdrawback of gain scheduling is that the design may be time�consuming� Thecontroller parameters must be determined for many operating conditions� andthe performance must be checked by extensive simulations� This di�culty ispartly avoided if scheduling is based on nonlinear transformations�

Gain scheduling has the advantage that the controller parameters can bechanged very quickly in response to process changes� Since no estimation ofparameters occurs� the limiting factors depend on how quickly the auxiliarymeasurements respond to process changes�

Design of gain scheduling controllers

It is di�cult to give general rules for designing gain scheduling controllers�The key question is to determine the variables that can be used as schedulingvariables� It is clear that these auxiliary signals must re ect the operatingconditions of the plant� Ideally there should be simple expressions for how thecontroller parameters relate to the scheduling variables� It is thus necessaryto have good insight into the dynamics of the process if gain scheduling is tobe used� The following general ideas can be useful�

Page 173: Process Control

� Gain Scheduling and Nonlinear Feedback ���

y

T si

1___+1K ( )

- 1

f ( ).yr u v

Σ

Controller Valve Process

G (s)0

-1

Figure ���� Block diagram of a simple feedback loop with a nonlinearity�

0 20 40 60 80 1000.2

0.3

Output and reference signal

0 20 40 60 80 1001

1.1

Output and reference signal

0 20 40 60 80 100

5

5.2Output and reference signal

Time t

Time t

Time t

Figure ���� Step responses for PI control of the simple �ow loop in Figure ��� at di�erentoperating conditions� The parameters of the PI controller are K � ��� Ti � �� Furtherf�u� � u and G��s� � ���s� ���

� Linearization of nonlinear actuators

� Gain scheduling based on measurements of auxiliary variables

� Time scaling based on production rate

� Nonlinear transformations

The ideas are best illustrated by some examples�

Example ����Nonlinear actuatorA simple feedback loop with a nonlinear valve is shown in Figure ���� Letthe static valve characteristic be

v � f�u� � u� u � �

Linearizing the system around a steady�state operating point shows that theloop gain is proportional to f ��u�� It then follows that the system can performwell at one operating point and poorly at another� This is illustrated by thestep responses in Figure ����� One way to handle this type of problem is tofeed the control signal u through an inverse of the nonlinearity� It is oftensu�cient to use a fairly crude approximation�

Page 174: Process Control

��� Chapter Design of Single Loop Controllers

y r Σ PI

c uf

v y

Process

^f

1−

1−

Figure ���� Compensation of nonlinear actuator using an approximate inverse�

0 0.5 1 1.5 20

5

10

15

20

Approximate nonlinearity

Nonlinearity

Figure ��� The nonlinear valve characteristic v � f�u� � u and a two line approxima�

tion �f �

Let f�� be an approximation of the inverse of the valve characteristic� Tocompensate for the nonlinearity� the output of the controller is fed throughthis function before it is applied to the valve� See Figure ����� This gives therelation

v � f�u� � f� f���c��

where c is the output of the PI controller� The function f� f���c�� should have

less variation in gain than f � If f�� is the exact inverse� then v � c�Assume that f�u� � u� is approximated by two straight lines as shown in

Figure ����� Figure ���� shows step changes in the reference signal at three dif�ferent operating conditions when the approximation of the inverse of the valvecharacteristic is used between the controller and the valve� Compare with theuncompensated system in Figure ����� There is a considerable improvementin the performance of the closed�loop system� By improving the inverse it ispossible to make the process even more insensitive to the nonlinearity of thevalve�

The example above shows a simple and very useful idea to compensate forknown static nonlinearities� In practice it is often su�cient to approximatethe nonlinearity by a few line segments� There are several commercial single�loop controllers that can make this kind of compensation� DDC packagesusually include functions that can be used to implement nonlinearities� Theresulting controller is nonlinear and should �in its basic form� not be regardedas gain scheduling� In the example there is no measurement of any operatingcondition apart from the controller output� In other situations the nonlinearityis determined from measurement of several variables�

Gain scheduling based on an auxiliary signal is illustrated in the followingexample�

Page 175: Process Control

� Gain Scheduling and Nonlinear Feedback ���

0 20 40 60 80 1000.2

0.3

Output and reference signal

0 20 40 60 80 1001

1.1

Output and reference signal

0 20 40 60 80 1005

5.1

Output and reference signal

Time t

Time t

Time t

Figure ��� Simulation of the system in Example ��� with nonlinear valve and compen�sation using an approximation of the valve characteristic�

Example ����Tank systemConsider a tank where the cross section A varies with height h� The model is

d

dt

�A�h�h

�� qi � a

p�gh

where qi is the input ow and a is the cross section of the outlet pipe� Letqi be the input and h the output of the system� The linearized model at anoperating point� qin and h� is given by the transfer function

G�s� ��

s � �

where

� ��

A�h�� �

qin�A�h�h

�ap�gh

�A�h�h

A good PI control of the tank is given by

u�t� � K�e�t� �

�Ti

Ze��� d�

where

K ���� � �

and

Ti ���� � �

��

Page 176: Process Control

��� Chapter Design of Single Loop Controllers

This gives a closed�loop system with natural frequency � and relative damping�� Introducing the expressions for � and � gives the following gain schedule�

K � ���A�h�� qin�h

Ti ����� qin

�A�h�h��

The numerical values are often such that �� ���� The schedule can then besimpli�ed to

K � ���A�h�

Ti ����

In this case it is thus su�cient to make the gain proportional to the crosssection of the tank�

The example above illustrates that it can sometimes be su�cient to mea�sure one or two variables in the process and use them as inputs to the gainschedule� Often it is not as easy as in this example to determine the controllerparameters as a function of the measured variables� The design of the con�troller must then be redone for dierent working points of the process� Somecare must also be exercised if the measured signals are noisy� They may haveto be �ltered properly before they are used as scheduling variables�

�� Conclusions

Linear and nonlinear couplings of simple controllers have been treated in thischapter� By expanding the controller structure to include several measure�ments and loops it is possible to improve the performance of the closed loopsystem� Cascade� ratio� and feedforward control are very useful in processcontrol�

Gain scheduling and nonlinear compensation are good ways to compensatefor known nonlinearities� With such schemes the controller adapts quickly tochanging conditions� One drawback of the method is that the design maybe time�consuming� Another drawback is that the controller parameters arechanged in open loop� without feedback from the performance of the closed�loop system� This makes the method impossible to use if the dynamics of theprocess or the disturbances are not known accurately enough�

Page 177: Process Control

Model Based Controllers

GOAL� To show how to use a process model in the controller to

improve the control�

�� Introduction

In the previous chapters we have discussed how to design simple controller�such as PID�controllers� We have also used the simple controllers in dierentcombinations� cascade� ratio etc� In this chapter we will see how the perfor�mance of the control can be improved by including more process knowledgeinto the controllers� The main idea is to base the calculation of the controlsignal on a model of the process� This type of controllers is called model basedcontrollers�

Dead times are common in many process control applications� In Section��� we show how the eect of dead times can be reduced by predicting the out�put of the process by using a process model� General model based controllersare considered in Section ���� When using cascade controllers we found thatit can be advantageous to use several measurement signals� This concept willbe generalized in Section ��� where we introduce state feedback� The idea isto use all states of the process for feedback� This makes it possible to placethe poles of the closed loop system arbitrarily� However� in most practicalsituations it is not possible to measure all the states� Using a model of theprocess we can instead estimate them from the available measurements� Thisleads to the concept of estimators or observers� The feedback is then basedon the estimated states�

�� Dead Time Compensation

Dead times or transportation delays are common in industrial processes� Thedead times always appear when there is a transportation of material throughpipes or at conveyer belts� Further� it is common that sensors cannot be placeddirectly at the process� It may be necessary to make the analysis in specialequipment in the laboratory� This will introduce time delays� There may alsobe time delays since valves and actuators are placed at some distance from the

���

Page 178: Process Control

��� Chapter Model Based Controllers

process that is being controlled� One should try to minimize the time delaysin the process by making a good physical process design� There are� however�many situations where time delays cannot be avoided�

From a dynamical point of view there is little dierence between a timedelay and a series connections of many �rst order subprocesses� We have therelation

limn��

��

� � sT�n

�n

� e�sT

It is therefore possible to approximate many industrial processes by a transferfunction of the form

G�s� �K

�� � sT���� � sT��e�sT �����

This is incidentally the approximation that Ziegler and Nichols used whenderiving their rules of thumb for tuning of PID�controllers� A process of theform ����� is di�cult to control using a PID�controller when T is of aboutthe same magnitude as or longer than T� � T�� We will in this section derivecontrollers that make it possible to improve the control of processes with timedelays� The main idea was introduced by O� J� M� Smith in ����� Thesecontrollers are often called Smith predictors or Smith controllers� The mainlimitations of Smith predictors are that they need a model of the processincluding the time delay� This model is incorporated in the controller� Usinganalog equipment it is di�cult to implement long time delays� This impliedthat the Smith predictors had a very limited impact until the controllers couldbe implemented in digital form� Using a computer it is easy to implement timedelays� One limitation is� however� that the Smith predictors cannot be usedfor unstable processes as will be discussed later in this section�

The following example shows the di�culties using PID�controllers for con�trol of processes with time delays�

Example ���PI�control of a time delay processConsider the process

dy�t�dt

� ����y�t� � u�t� � �����

This is a �rst order process with the transfer function

G�s� ��

� � �se��s

Equation ����� can� for instance� be a model of a paper machine� where the timedelay is caused by the transport of the paper through the machine� Figure ���shows the performance when a PI�controller is used� The controller has a gainof ��� and a reset time of ��� time units� It is necessary to have low gain tokeep down the oscillations in the response� Both the step response and theresponse to an input load disturbance are shown�

If the process to be controlled has a dead time there will always be a delayin the response to the input signal� The behavior can� however� be improvedcompared with a conventional PI�controller�

Page 179: Process Control

�� Dead Time Compensation ��

0 20 40 600

0.5

1

1.5 Output and reference

0 20 40 600

0.4

0.8

Input

Time t

Time t

Figure �� Output and control signal when the process ����� is controlled by a PI�controller� The reference signal is changed at t � and an input load disturbance occursat t � ��

Σe u yyr

Gr G1

−1

Figure �� The closed loop system when there is no time delay in the process�

Smith predictor

In connection with the on�o control in Chapter it was found that predictionof the error signal could be very useful� The same idea is used in the Smithpredictor� Assume that the controlled process has the transfer function

Gp�s� � e�sTG��s�

First we design a controller for the process under the assumption that thereis no time delay� i�e� T � �� Denote the obtained controller Gr�s�� The closedloop system without time delay is then given by

Gc�s� �G��s�Gr�s�

� �G��s�Gr�s������

See Figure ���� Now let the process with time delay be controlled using thecontroller Grd�s�� This gives the closed loop system

Gcd�s� �Gp�s�Grd�s�

� � Gp�s�Grd�s��

e�sTG��s�Grd�s�� � e�sTG��s�Grd�s�

����

Page 180: Process Control

�� Chapter Model Based Controllers

Σe u y

Σ GpGryr

−1

−(1−e−sT

)G1

Grd

Figure �� Block diagram for Smith�s dead time compensation�

Due to the time delay we can not choose Grd�s� such that Gcd�s� � Gc�s�� Itis� however� possible to choose the controller such that

Gcd�s� � e�sTGc�s�

This implies that the response of the system ���� is the same as that of �����delayed T units� The shape of the response is the same as for the systemwithout time delay� It is only delayed due to the inevitable dead time in theprocess� This gives

e�sTG��s�Grd�s�� � e�sTG��s�Grd�s�

� e�sT G��s�Gr�s�� �G��s�Gr�s�

Solving for Grd gives

Grd�s� �Gr�s�

� � ��� e�sT �G��s�Gr�s������

Notice that the controller given by ����� includes a time delay and a model ofthe process� The controller Grd can be interpreted as a feedback around thecontroller Gr� see Figure ���� We may write the control signal as

U�s� � Gr�s� #Yr�s�� Y �s�$�GrG�

�U�s�� e�sTU�s�

�Introducing Ym�s� � e�sTG��s�U�s� gives

U�s� � Gr�s��Yr�s�� Y �s�� esTYm�s� � Ym�s�

������

The �rst part of the controller ����� is the same as if the process does nothave any time delay� The two last terms are corrections that compensatefor the time delay in the process� The term esTYm�s� � G��s�U�s� can beinterpreted as a prediction of the process output� Notice that this signal isrealizable� The controller must store the input signals used during the delayT � I�e� the time signal corresponding to e�sTU�s�� This makes it di�cultto make an analog implementation of the Smith predictor for processes withlong time delays� Using computers where the control signal is constant overthe sampling intervals it is only necessary to store some sampled past valuesof the control signals� The Smith predictor has thus become very useful afterthe advent of computers for process control�

Page 181: Process Control

�� Dead Time Compensation ���

0 20 40 600

0.5

1

1.5 Output and reference

0 20 40 600

0.4

0.8

Input

Time t

Time t

Figure �� Output and control signal when the process ����� is controlled using a Smithpredictor� The reference signal is changed at t � and an input load disturbance occurs att � ��

Example ���Smith predictor control of time delay processConsider the process in Example ���� A PI�controller is designed for theprocess without any time delay� The parameters are chosen such that the stepresponse will give the same overshoot as in Figure ���� This give a gain of �and a reset time of �� The controller gain is �ve times larger than for direct PI�control of the process with time delay� Figure �� shows the performance whenthe Smith predictor is used� The closed loop system is much faster at changesof the reference value� Also the recovery after the input load disturbance isfaster� Compare Figure ����

Interpretation of the Smith predictor

We will now make interpretations of the Smith predictor that give better un�derstanding for the behavior of the closed loop system� Assume that the designis based on an approximate model of the process e�s �T G��s�� Introducing inputand output disturbances we may rewrite the block diagram in Figure ��� intoFigure ���� The part of the diagram denoted (Model� is used to generate themodel output ym�t�� There would be no problems with the time delay if thesignal at point A was available for measurement� The model is instead used togenerate the signal at point B� I�e� we make an indirect measurement of thedesired signal� This signal is a prediction of the output T time units ahead�If the model and the process coincide and if there are no disturbances theny�t� � ym�t� and the feedback is eliminated� The feedback signal is thus onlyused to compensate for model errors and disturbances� For a perfect modeland no disturbances we get the system in Figure ���� which is an open loopsystem�

Page 182: Process Control

��� Chapter Model Based Controllers

ΣΣu yΣ Σ

n

Cricket Software

AProcess

Model

ΣB

Controller

l

G1

−G1

e−sT

e−sT −ym

Gr

−1

yr

Figure �� Block diagramof the Smith predictor based on an approximateprocess model�

Σyuyr Gr

−G1

G1 e−sT

Figure �� The system when the outer loop in Figure ��� is removed�

Drawbacks

The Smith predictor has some serious drawbacks� Consider the block diagramin Figure ��� and assume that the model and the process are identical� Theclosed loop system is then described by

Y � e�sTG�Gr

� �G�GrYr �

��� e�sT

G�Gr

� � G�Gr

��N � e�sTG�L

������

Ym � e�sTG�Gr

� �G�GrYr � e�sT

G�Gr

� �G�Gr

�N � e�sTG�L

�The response to the reference value is as desired�

In�uence of disturbances From ����� it follows that the transfer functionfrom measurement noise N to the output is given by

GN �

��� e�sT

G�Gr

� �G�Gr

For a well designed servo we expect that low frequency disturbances can beeliminated� i�e�

GN ��� � �

The transfer function GN is thus small for low frequencies� Let �B be thebandwidth of the closed loop system� For s � i�� where � � � �B we haveapproximately

G�Gr

� �G�Gr� �

Page 183: Process Control

�� Dead Time Compensation ���

Furthere�iT � ��

when �T � �� If the time delay is such that �BT � � then there are fre�quencies for which GN � �� The feedback will thus amplify the disturbancesfor certain frequencies� Some of the problems with measurement disturbancescan be avoided by replacing the block with �� in Figure ��� by a low pass�lter with a low frequency gain of ��

Unstable processes The transfer function from the load disturbance L tothe output is given by

GL �

��� e�sT

G�Gr

� � G�Gr

�e�sTG�

We can approximate this transfer function by

GL ���� e�sT

�e�sTG�

at least for frequencies up to the bandwidth of the closed loop system� Wesee that the system essentially behaves like the step response to the open loopsystem� Compare Figure ���� If the system G� is unstable then the outputwill grow to in�nity and so will ym� The Smith predictor can thus not be usedfor unstable systems� For the case with only one unstable pole of G� at theorigin then there will be a bias in the output and the signal ym will grow�

Example ���Smith predictor control of an unstable systemLet the process be an integrator with a time delay� i�e�

Gp�s� ��se��s

Let the controllerGr be a PI�controller with gain � and reset time �� Figure ���shows the in uence of an input load disturbance of magnitude ���� Both themodel output ym and the predicted signal in point B in Figure ��� are growingin magnitude� The unlimited growth of ym makes the controller impossible touse in practice when the process is unstable�

The limitation that the open loop system must be stable is important toobserve� One way to circumvent the problem is to �rst stabilize the open loopsystem using a simple feedback and then design the dead time compensation�

Summary

Using predictive control based on Smith predictor makes it possible to sub�stantially improve the performance when the process has a time delay� Acontroller is �rst designed for the process assuming that the time delay iszero� The obtained controller is then easily modi�ed as shown in Figure ����It is� however� important to know that the Smith predictor can amplify cer�tain frequencies of the disturbances� Further� it is required that the open loopsystem is stable�

Page 184: Process Control

��� Chapter Model Based Controllers

0 10 20 30 40−1

0

1Output, model output, and reference

0 10 20 30 40−0.5

0.5

Input

0 10 20 30 400

0.2

Input load disturbance

ym

yyr

Time t

Time t

Time t

Figure � Smith predictor control of an integrator with a time delay�

yyr

Σ

Σy

b)

– 1

yr u

a)u

Gr

Gr

Gp

Gp

−Gp

Figure � Open loop control� a� Feedforward compensation� b� Modi�cation of a� butwith the same transfer function from yr to y�

�� Internal Model Control

We will in this section generalize the ideas used to derive the Smith predictor�Using Internal Model Control �IMC� is one way to combine the advantageswith open loop control �feedforward� and closed loop control� Consider theblock diagram in Figure ��� a�� which is an open loop loop compensation� Asimple way to design a feedforward compensation is to choose

Gr�s� � G��p �s� �����

This will give perfect following of the reference signal yr for all frequencies�One way to modify the block diagram in Figure ��� a� is shown in Figure

Page 185: Process Control

�� Internal Model Control ���

Σ

Σy

b)

– 1

yr u

a)yyr u

– 1

Σ

Σ

−Gp−Gp

Gp

GpGrf

Grf

Figure �� Feedback control� a� Simple feedback system� b� Modi�cation of a� but withthe same transfer function from yr to y�

��� b�� Provided Gp � Gp the two block diagrams have the same transferfunctions from yr to y� There are many practical limitations that make itimpossible to use ������ First the controller will be unstable if the processhas right half plane zeros� Secondly� a time delay in the process will give theunrealizable term esT in the controller� Thirdly� the system will not be robustagainst uncertainties in the process model� We will therefore later modify����� to make a more practical and robust controller� This will give &perfect'control only for the low frequency range�

We may also start with the closed loop structure in Figure ��� a�� Thecontroller Grf can be designed to give the desired closed loop system� Thisdesign is more complicated than for the feedforward compensation discussedabove� For instance� the stability of the closed loop system must be tested�One way to rearrange the block diagram is shown in Figure ��� b�� By choosing

Grf �Gr

�� Gr Gp

we can reduce the block diagram into Figure ����� Notice that the feedbacksignal can be interpreted as an estimate of the in uence of the disturbance�This implies that both the open loop and feedback structures can be trans�formed into this structure� which is called the internal model structure� Wewill now analyze some of its properties� First it is seen that if there are nodisturbances d � � and if Gp � Gp then there is no feedback signal and thesystem is reduced to the block diagram in Figure ��� a�� However� when thereis a mismatch between the model and the true process or if there are dis�turbances then the feedback loop is active and we can reduce the sensitivitycompared with the feedforward structure�

Special design methods have been developed for internal model control�Special emphasis has been given to stability and robustness of the closed loopsystem� In these lecture notes we will only discuss some simple cases of IMC�

Page 186: Process Control

��� Chapter Model Based Controllers

Σ

Σ

Σy

– 1

yr uGr Gp

−Gp

d

d

Figure ��� The structure of the internal model controller�

Properties of IMC

The block diagram of the IMC is given in Figure ����� It follows that

Yr�s�� Y �s� ��� GpGr

� � �Gp � Gp�Gr

�Yr�s��D�s�� �����

U�s� �Gr

� � �Gp � Gp�Gr

�Yr�s��D�s�� ������

Y �s� ��

� � �Gp � Gp�Gr

�GpGrYr�s� � ��� GpGr�D�s�

�������

where E�s� � Yr�s��Y �s�� The stability of the IMC is given by the followingtheorem�

Theorem ���Stability of IMCAssume that Gp � Gp in the internal model structure� The total system isstable if and only if Gr and Gp are stable�

Proof� A necessary and su�cient condition for stability is that the character�istic equations of ������ and ������ have roots with negative real parts� Thisgives the conditions

�Gr

�Gp � Gp � �

�GpGr

��Gp

�Gp � Gp� � �

For Gp � Gp this reduces to�Gr

� �

�GpGr

� �

This implies that all poles of both the process and the controller must havenegative real parts�

Remark� If the process is unstable then it can be stabilized with a conven�tional feedback controller before the IMC is used�

We will �rst assume that the process is stable and factorize the processmodel into

Gp�s� � Gpa�s� Gpm�s� ������

wherej Gpa�i��j � � ��

Page 187: Process Control

�� Internal Model Control ���

Gpa�s� is called an allpass transfer function� In general it has the form

Gpa�s� � e�sTYi

�s � zis� z�i

where zi are the right half plane zeros of Gp� Further z�i is the complexconjugate of zi� The allpass function Gpa contains the nonminimum phaseparts of Gp� The transfer function Gpm�s� is thus minimum phase and stable�since Gp�s� is assumed to be stable�� Further we factorize V �s� as

V �s� � Va�s�Vm�s� ������

in the same way as Gp in ������ where V �s� � Yr�s� or V �s� � �D�s�� I�e� wecan look at either the servo problem or the regulator problem� Without proofwe give the following theorem�

Theorem ���IMC for stable processes �Morari and Za�riou �������Assume that Gp � Gp and Gp is stable� Factor Gp and V according to ������and ������ respectively� The controller that minimizes the integral square error�ISE� Z �

e��t� dt �����

for both the servo and the regulator problems is given by

Gr�s� �� Gpm�s�Vm

��� � G��pa Vm

��

������

where the operator � �� denotes that after a partial expansion of the operandall terms involving the poles of G��

pa are omitted�

Remark� When the input v is a step we get the controller

Gr�s� �� Gpm�s�

���������

and when v is a ramp

Gr�s� �� Gpm�s�

������ d Gpa�s�

ds

�����s�

s�

Example ���ISE minimizing controller for a step inputLet the process be

Gp�s� ��� s

�s� ���s� ��e�s

� e�s�� s

� � s s � ��s� ���s� ��

� Gpa�s� Gpm�s�

The controller minimizing the ISE criterion ����� is given by

Gr�s� ��s� ���s� ��

s� �

Page 188: Process Control

��� Chapter Model Based Controllers

which is stable but contains derivations� since there are more zeros than poles�Notice that the zero in the right half plane of the process is mirrored in theimaginary axis to obtain the controller�

Using the controller ������ gives the closed loop system

Y �s� � GpaYr�s� � ��� Gpa�D�s�

This implies that Gpa contains the process dynamics that are limiting theperformance of the closed loop system�

The IMC ������ is in many practical situations not a feasible controller dueto uncertainties� The controller usually has too high gain at high frequencies�Further� the controller may contain derivations� i�e� it is not proper� This isthe case if the controller has more zeros than poles� compare Example ���One way to modify the &optimal' controller is to introduce a low pass �lterGm and use the controller

Gr �Gm

Gpm

������

where Gm is determined by the designer� To get correct steady state value itis necessary to choose Gm��� � �� The selection of Gm should be based on themodel error Gp � Gp� In practice one may use quite simple �lters� For stepreference signals or disturbances we may use

Gm�s� ��

�Tms � ��n������

where n is selected to make Gr proper� The time constant Tm determines thespeed of the closed loop system� When the reference signal or the disturbanceis a ramp we can use

Gm�s� �nTms� ��Tms � ��n

������

It is interesting to interpret the IMC in a conventional feedback structureas in Figure ��� a�� Using ������ and ������ to eliminate Yr we get in thedisturbance free case

U�s� �Gr

�� GpGr

E�s� � GrfE�s� ������

Using the compensation ����� gives a controller Grf with in�nite gain� Thecontroller ������ gives instead

Grf �Gr

�� Gr Gp

�Gm

Gpm � GpGm

�Gm

Gpm��� GpaGm�������

So far we have assumed that the process is stable� Many processes inchemical plant contain integrators� The controller ������ can be shown to be&optimal' also when the process contains one integrator� For other cases werefer to the literature given in the end of the chapter�

Design algorithm for IMC

The following steps can be used to design an internal model controller for stepsin the reference value�

Page 189: Process Control

�� Internal Model Control ��

�� Factorize Gp into Gp � Gpa

Gpm

according to ������

�� De�ne the controller

Gr �Gm

Gpm

�� Choose the structure of Gm according to ������ or �������

� Tune the parameter Tm�We have here only given the basic ideas behind the IMC� In the literature

one can �nd muchmore analysis and design rules for internal model controllers�

Example ���IMC design of �rst order system with time delayWe can now use the IMC approach to design a controller for the process inExample ���� The transfer function of the process is

Gp�s� ��

� � �se��s ������

In this caseGpa�s� � e��s

Gpm�s� ��

� � �s

Assuming

Gm�s� ��

� � Tms

gives the controller

Gr�s� �� � �s

��� � Tms�������

Figure ���� shows the response to a reference value change and to an inputload disturbance when Tm � ��

PID�controller interpretation of IMC

The IMC can be considered as a special way of doing the design such that itis easy to predict the in uence of the design parameters on the closed loopsystem� We have introduced the model Gm and the parameter Tm to specifythe closed loop performance� After the design we can interpret the resultingcontrollerGrf given by ������ as a conventional feedback controller� For simpleprocess models Grf can be translated into a conventional PID�controller�

Example ���PI�interpretation of IMCLet the process model be

Gp � K

� � T�s

and choose

Gm ��

� � Tms

This gives the IMC controller

Gr �� K � �

T�s� � Tms

Page 190: Process Control

� Chapter Model Based Controllers

0 20 40 600

0.5

1

1.5 Output and reference

0 20 40 600

0.4

0.8

Input

Time t

Time t

Figure ��� The output of the process ������ when using the IMC controller ������ fora reference value change and an input load disturbance when Tm � ��

Using ������ we get

Grf ��� T�s KTms

� T�

KTm

�� �

� T�s

which can be interpreted as a PI�controller with the parameters

Kc � T�

KTm

Ti � T�

In this case the IMC can be regarded as a special way of tuning a PI�controller�This is another way to see that there will be no stationary error when yr or dare steps�

The example above can be generalized to other simple forms of the process�Table ���� which is adopted from River et al� ������� gives the connectionbetween the parameters of the IMC and the parameters in the PID�controller

Kc

�e�t� �

�Ti

Z t

e��� d� � Tdde�t�dt

������

Summary of IMC

The internal model control can be viewed as a generalization of PID�control�lers� where we are using a model of the process to improve the performance ofthe system� The structure of the IMC makes it easier to tune the controller�since it is more transparent how the design parameters are in uencing theclosed loop system�

Page 191: Process Control

�� State Space Controllers ��

Table �� The connection between the IMC parameters and the parameters in the PID�controller ������ when n � � is used in ������ and v is a step�

Process Gp KcK Ti Td

K

Ts� �T

TmT �

K

�T�s � ���T�s � ��T� � T�Tm

T� � T�T�T�

T� � T�K

T �s� � ��Ts� ���TTm

��TT

��K

s

�Tm

� �

K

s�Ts� ���Tm

� T

�� State Space Controllers

In connection with cascade controllers it was found that the use of severalmeasurements considerably can improve the performance of the control� Inthe ultimate case we could measure all the states in a system� In this section wewill discuss properties of controllers based on state feedback� Let the processbe described by the n�th order system

dx

dt� Ax�Bu

y � Cx������

For simplicity we assume that the system has one input and one output� Pro�vided that all states are available for measurement we can use the state feed�back controller

u�t� � lryr�t�� Lx�t� ������

where L is a row vector� Using this controller gives the closed loop system

dx

dt� �A� BL�x� Blryr

y � Cx

The dynamics of the closed loop system is now determined by the n eigenvaluesof the matrix A�BL� With luck it should be possible to use the n degrees offreedom in the L vector to determine the n eigenvalues of A�BL� The exactconditions are given by the following theorem�

Theorem ���Pole�placement through state feedbackIt is possible to arbitrarily place the poles of the system ������ using thecontroller ������ provided the matrix

Wc ��B AB A�B � � � An��B

� ������

has rank n�

Remark �� The matrix Wc is called the controllability matrix of the system�������

Remark �� The theorem is valid also for MIMO systems�

Page 192: Process Control

�� Chapter Model Based Controllers

Example ��Pole�placementLet the system ������ have the matrices

A �

��� ��� �

� B �

� ��

� Assume that

L �� l� l�

� ������

and that the desired closed loop poles are �� and ��� The desired closed loopcharacteristic equation is thus

s� � �s� � � �

We �rst test the condition ������

det�B AB

� � det

� � ��� �

� �

The condition in Theorem ��� is thus satis�ed� Using the L vector ������ weget

A� BL �

���� l� ��� l��� l� �l�

� which has the characteristic equation

det�sI �A �BL� � s� � �� � l� � l��s� �� �l� � �l� � �

This gives the system of equations

� � l� � l� � �

�� �l� � �l� � �

which can be solved for l� and l�� The solution

L �� � �

� gives the desired closed loop performance�

Theorem ��� implies that the designer may assign any closed loop polesas long as Wc has full rank� The choice of the closed loop poles will� however�in uence robustness� magnitudes of control signals etc� Another way to ap�proach the design problem is based on optimization theory� The designer thende�nes a loss function� One example is a quadratic loss function of the form

Z �

�xT �t�Q�x�t� � uT �t�Q�u�t�

�dt ������

The controller that minimizes ������ is called the Linear Quadratic controller�since it minimizes the quadratic loss function for linear systems� The resultingcontroller is a state space feedback of the form �������

Page 193: Process Control

�� State Space Controllers ��

yu Σ

Σ

Σ x x

A

B

K

A

CB

Observer

Processx1

s

1s

−C

Figure ��� The structure of the estimator �������

Observers

The state feedback controller requires that all states are available for measure�ment� In most situations this is not possible� For instance� when controllinga distillation column this would require that the concentrations at each traywould be known� We can instead use the process knowledge to indirectlyobtain the unknown states of the system�

Assume that the system is described by

dx

dt� Ax�Bu

y � Cx������

We could try to mimic the performance of the system by creating a model ofthe process and use the same inputs to the model as to the true process� Wecould use the model

d xdt

� A x�Bu

y � C x

This solution is only feasible if the process is stable� i�e� the eigenvalues ofA have negative real part� In this case the in uence of the initial values willdecrease after some time and the state x will approach x� To increase the speedof the convergence and to be able to handle unstable systems we introduce afeedback in the model in the following way�

d xdt

� A x�Bu �K�y � y�

y � C x������

The correction y � y will compensate for the mismatch between the state inthe system and the state in the model� The system ������ is called a stateobserver or state estimator� The estimator has the structure in Figure �����Using the de�nition of y we get

d xdt

� �A�KC� x �Bu �KCx

Page 194: Process Control

�� Chapter Model Based Controllers

Observer Processu yx

−L

Figure ��� Controller based on observer and state feedback�

Introducing the error +x�t� � x�t�� x�t� we get the relation

d+xdt

� �A�KC�+x ������

If the system ������ is stable it follows that the error +x will decay with time�The free design parameter is the gain K that we can use to in uence theeigenvalues of the matrix A�KC� We have the following theorem�

Theorem ���State observerAssume that the matrix

Wo �

C

CA

CA�

���CAn��

� ������

has rank n� It is then possible to �nd a matrix K such that the observer in������ has an arbitrarily characteristic polynomial�

Remark �� The matrix Wo is called the observability matrix of the system�������

Remark �� The theorem is valid also for MIMO systems�Using a model it is possible to reconstruct all the internal states of the

system from input�output measurements� The observer or estimator is anindirect way of making measurements� The estimated states can be usedas such to get information about the system� but they can also be used forfeedback� The controller ������ can be replaced by

u�t� � lryr�t�� L x�t�

The structure of the closed loop system based on observer and state feedbackis shown in Figure �����

Controllability and observability

The rank conditions on Wc and Wo in Theorems ��� and �� �rst appeared asalgebraic conditions to be able to solve the pole�placement and the observerproblems� The rank conditions have� however� much deeper system theoreticalinterpretations� We will here only brie y discuss the concepts of controllabilityand observability�

Controllability Let the system be described by the nth order state spacemodel

dx

dt� Ax�Bu

y � Cx�����

Is it possible to determine the control signal such that the system can reachany desired state� It will� however� not be possible to halt the system at all

Page 195: Process Control

�� State Space Controllers ��

state� The states may be positions and velocities and it is not possible tostop at a position and have a non�zero velocity� We thus have to modify ourquestion and ask if it is possible to determine the control signal such that wewill pass through any state of the system� If this is possible we say that thesystem is controllable� A test for controllability is if the controllability matrixWc de�ned in ������ has rank n� The controllability depends on the internalcoupling between the states and how the control signal in uences the states�i�e� the A and B matrices�

Example ��Parallel coupling of identical systemsConsider the system

dx�dt

� ax� � u

dx�dt

� ax� � u

We can regard the system as a parallel coupling of two identical �rst ordersystems� This system is not controllable since

Wc �

� � a

� a

� has rank �� We can also realize this by making a transformation of the states�Introduce the new states

z� � x�

z� � x� � x�

The equation for the state z� is given by

dz�dt

�d�x� � x��

dt� �

This implies that it is not possible to control the dierence between the twostates�

Observability Given the system ����� we may ask if it is possible to recon�struct the states of the system given only the input and output signals� If thisis the case we say the the system is observable� The system is observable if theobservability matrixWo given by ������ has rank n� There may be states thatcan�t be obtained from the measurements� These states are unobservable�

Kalman�s decomposition R� E� Kalman developed the concepts of con�trollability and observability in the beginning of the �����s� He also showedthat a general system can be decomposed into four dierent subsystems� Onepart is both controllable and observable� one is controllable but not observ�able� one is not controllable but observable� and the fourth subsystem is neithercontrollable nor observable� The connection between the four subsystems isshown in Figure ��� for the case when it is possible to diagonalize the system�From the �gure we also see that it is only the part that is both controllableand observable that determines the input output relation� i�e� the transferfunction of the system� This implies that the system is both controllable andobservable only if the transfer function

G�s� � C�sI �A���B �D

is of order n� If controllability or observability is lost the there will be apole�zero cancellation in the transfer function�

Page 196: Process Control

�� Chapter Model Based Controllers

Σyu

Sco

Sco

Sco

Sco

Figure ��� Illustration of Kalman�s decomposition of a system that is possible to diag�onalize� Index c implies that the subsystem is controllable and index �c that the subsystemis uncontrollable� The index o is used in the same way for observability�

Example ���Kalman�s decompositionConsider the diagonal system

dx

dt�

��� � � �� �� � �� � �� �� � � �

� x�

�����

� u

y �� � � � �

� x

We see directly that the states x� and x� can�t be in uenced by the controlsignal neither directly nor through some other states� Also we see that it is notpossible to get information about the states x� or x� through the output� It isonly the state x� that is both controllable and observable� The controllabilityand observability matrices are

Wc �

�� �� � ��� �� ��� � � �� � � �

� Wo �

�� � � �

�� � �� �� � � �

�� � ��� �

� Both matrices have rank �� The transfer function of the system is

G�s� ��

s� �

Three poles and zeros are cancelled in G�s� and the input�output behavior isdetermined by a �rst order system even if the total system is of order �

The concepts of controllability and observability are very important andcan be used at the design stage of the process to test for possible controldi�culties�

�� Conclusions

We have in this chapter introduced more complex controllers that all are basedon the inclusion of a model in the controller� Using the model is one way of

Page 197: Process Control

�� Conclusions ��

predicting unmeasurable signals in the process� &Measurements' are insteaddone on the model and used to improve the performance of the system� Thedead time compensation requires realization of a time delay� This is best doneusing a computer and a sampled data controllers�

We have shown that it is possible to obtain indirect or &soft' measure�ments of the states by using an observer� The estimated states can be usedfor feedback to place the poles of the closed loop system�

There are other model based controllers that are based on sampled datatheory� Model Predictive Control� Dynamic Matrix Control� and Model Al�gorithmic Control are typical methods of this type� Based on a sampled datamodel of the process the output is predicted and the control signal is chosensuch that a loss function is minimized� These types of controllers have beenvery useful when there are time delay and also when having constraints on thestates or the control signals�

Page 198: Process Control

Sequencing Control

GOAL� To give a brief overview of sequencing control and to intro�

duce GRAFCET�

�� Introduction

The history of logical nets and sequential processes starts with batch process�ing� which is very important in many process industries� This implies thatcontrol actions are done in a sequence where the next step depends on someconditions� Simple examples are recipes for cooking and instructions or manu�als for equipment� Washing machines� dish washers� and batch manufacturingof chemicals are other examples� The recipes or instructions can be dividedinto a sequence of steps� The transition from one step to the next can bedetermined by a logical expression� In this chapter logical and sequencingcontrollers are presented�

Sequencing control is an integrated part of many control systems� and canbe used for batch control� start�up and shut�down procedures� interlooks� andalarm supervision� When implementing such systems it is useful to be awareof the notations and traditions in sequence control as it developed before itstarted to be integrated with automatic control� This chapter will start bygiving a brief background starting with logic or Boolean algebra� that playsan important role and is presented in Section ���� The axioms and basic rulesfor evaluation of logical expressions are given� Logical expressions are some�times also called combinatory networks� Using combinational networks and amemory function it is possible to build so called sequential nets� Section ���is devoted to sequencing controllers� One way to present function procedures�that is becoming a popular industrial notation� is to use GRAFCET� which isdescribed in Section ���

�� Background in Logical Nets and Boolean Algebra

Logical nets can be implemented in many dierent ways� for instance� us�ing clever mechanical constructions� relays� transistors� or computers� The

��

Page 199: Process Control

��� Background in Logical Nets and Boolean Algebra �

a b Ra

b

R

a

bR& a

bR≥ 1

ba R

a

b

( )R

( )

Ra b

(a)

(b)

(c)

(d)

(e)

a⋅ b a+b

ab R

Figure �� Di�erent ways to represent the logical expressions a b and a� b �a� Booleanalgebra� �b� Relay symbols� �c� Ladder symbols� �d� Logical circuit symbols �Americanstandard�� �e� Logical circuit symbols �Swedish standard��

computer implementations are often called PLC �Programmable Logical Con�troller� systems� An earlier notation was PC �Programmable Controller� sys�tems� This was used before PC became synonymous with personal computer�Logical systems are built up by variables that can be true or false� i�e� thevariables can only take one of two values� For instance� a relay may be drawnor not� an alarm may be set or not� a temperature may be over a limit ornot� The output of a logical net is also a two�valued variable� a motor maybe started or not� a lamp is turned on or o� a contactor is activated or not�The mathematical basis for handling this type of systems is Boolean algebra�This algebra was developed by the English mathematician George Boole inthe �����s� It was� however� not until after about a century that it became awidely used tool to analyze and simplify logical circuits�

Logical variables can take the values true or false� These values are oftenalso denoted by � �true� or � �false�� Boolean algebra contains three operationsor� and� and not� We have the following notations�

and� a b a and b a � bor� a� b a or b a � bnot� !a not a �a

The expression a b is true only if both a and b are true at the sametime� The expression a � b is true if either a or b or both a and b are true�Finally the expression !a is true only if a is false� In the logical circuit symbolsa ring on the input denotes negation of the signal and a ring on the outputdenotes negation of the computed expression� The and and or expressionscan also be interpreted using relay symbols as in Figures ��� and ���� Theand operator is the same as series connection of two relays� There is only aconnection if both relays are drawn� The or operator is the same as parallelconnection of two relays� There is a connection whenever at least one of therelays are drawn� The relay or ladder representation of logical nets is oftenused for documentation and programming of PLCs� We will use the moreprogramming or computer oriented approach with and �� This usually gives

Page 200: Process Control

� Chapter � Sequencing Control

a b R

a

bR&

ab R

( )Ra b

(a)

(b)

(c)

(d)

(e)

a⋅ b

Figure �� Di�erent ways to represent the logical expression a �b �a� Boolean algebra��b� Relay symbols� �c� Ladder symbols� �d� Logical circuit symbols �American standard���e� Logical circuit symbols �Swedish standard��

more compact expressions and is also more suited for algebraic manipulations�Exactly as in ordinary algebra we may simplify the writing by omitting theand�operator� i�e� to write ab instead of a b�

To make the algebra complete we have to de�ne the unit and zero elements�These are denoted by � and � respectively� We have the following axioms forthe Boolean algebra�

!� � �!� � �� � a � �� � a � a� a � a� a � �a� a � aa� !a � �a !a � �a a � a!!a � a

We further have the following rules for calculation

a� b � b� a Commutative lawa b � b a Commutative lawa �b� c� � a b� a c Distributive lawa �b c� � �a b� c Associative lawa� �b� c� � �a� b� � c Associative law

a� b � !a !b de Morgan�s law

a b � !a� !b de Morgan�s law

A logical net can be regarded as a static system� For each combination ofthe input signals there is only one output value that can be obtained�

In many applications it can be easy to write down the logical expressionsfor the system� In other applications the expressions can be quite complicated

Page 201: Process Control

��� Background in Logical Nets and Boolean Algebra ��

and it can be desirable to simplify the expressions� One reason for making thesimpli�cation is that the simpli�ed expressions give a clearer understanding ofthe operation of the network� The rules above can be used to simplify logicalexpressions� One very useful rule is the following

a� a b � a � � a b � a �� � b� � a � � a �����

One way to test equality between two logical expressions is a truth table� Thetruth table consists of all combinations of the input variables and the evalu�ation of the two expressions� Since the inputs only can take two values therewill be �n combinations� where n is the number of inputs� The expressions areequal if they have the same value for all combinations�

Example ���Truth table

For instance ����� is proved by using the table�

a b a� ab a

� � � �� � � �� � � �� � � �

To the left we write all possible combinations of the input variables� Tothe right we write the value of the expressions of the left and right hand sidesof ������ The last two columns are the same for all possible combinations of aand b� which proves the equality�

There are systematic methods to make an automatic reduction of a logicalexpression� The methodologies will only be illustrated by an example�

Example ���Systematic simpli�cation of a logical network

Consider a logical network that has three inputs a� b� and c and one output y�The network is de�ned by the following truth table�

a b c y

v � � � �v� � � � �v� � � � �v� � � � �v� � � � �v� � � � �v� � � � �v� � � � �

The dierent combinations of the inputs are denoted vi� where the index icorresponds to the evaluation of the binary number abc� I�e� the combinationabc � ��� corresponds to the number � ���� ���� � � �� The expressionfor the output y can be expressed in two ways� either as the logical or of thecombinations when the output is true or as the negation of the logical or ofthe combinations when the output is false� Using the �rst representation we

Page 202: Process Control

�� Chapter � Sequencing Control

Memory CPU Programming module

Bus

Input modules Output modules

I/O unit

Sensors Actuators

Figure �� Block diagram for a PLC system�

can writey � v� � v� � v� � v� � v�

� !abc� a!b!c� a!bc� ab!c� abc

� bc�!a� a� � a!b�!c� c� � ab�!c� c�

� bc� a!b� ab � bc� a�!b� b�

� a� bc

The �rst equality is obtained from the truth table� The second equality isobtained by combining the terms v� with v�� v� with v�� and v� with v�� It ispossible to use v� two times since v� � v� � v�� The simpli�cations are thengiven from the computational rules listed above�

The second way to do the simpli�cation is to write

!y � v � v� � v�

� !a!b!c� !a!bc� !ab!c

� !a!b�!c� c� � !a!c�!b� b�

� !a!b� !a!c � !a�!b� !c�

This givesy � !!y � !a�!b� !c� � a � bc

which is the same as before�Using the methodology described in the example above it is possible to

reduce a complicated logical expression into its simplest form� A more formalpresentation of the methods are outside the scope of this book�

PLC implementation

Most PLC units are implemented using microprocessors� This implies thatthe logical inputs must be scanned periodically� A typical block diagram isshown in Figure ���� The execution of the PLC program can be done in thefollowing way�

Page 203: Process Control

��� Background in Logical Nets and Boolean Algebra ��

�� Input�copying� Read all logical input variables and store them in I�Omemory�

�� Scan through the program for the logical net and store the computedvalues of the outputs in the I�O memory�

�� Output�copying� Send the values of output signals from the I�O memoryto the process�

� Repeat from ��

The code for the logical net is executed as fast as possible� The time forexecution will� however� depend on the length of the code� The I�O�copyingin Step � is done to prevent the logical signals to change value during theexecution of the code� Finally all outputs are changed at the same time� Theprogramming of the PLC�unit can be done from a small programming moduleor by using a larger computer with a more eective editor�

The programming is done based on operations such as logical and� logicalor� and logical not� Also there are typically combinations such as nand andnor� which are de�ned as

a nandb � a b � !a� !b

a nor b � a� b � !a !bFurther there are operations to set timers� to make conditional jumps� to in�crease and decrease counters etc� The speci�c details dier from manufacturerto manufacturer�

�� Sequencing Controllers

The logical nets in the previous section are static systems in the sense thatthe same values of the input signals all the time give the same output sig�nals� There are� however� situations where the outputs should depend on theprevious history of the input signals� To describe such systems we introducememory or states� We then obtain a sequential net or a sequential process�Sequences can either be serial or parallel� As the name indicates the serialsequences are run through one step at a time in a series� In parallel sequenceswe allow several things to happen in parallel with occasional synchronizationbetween the dierent lines of action� A typical example of a parallel sequenceis the assembly of a car� Dierent subparts of the car� for instance� motor andgearbox� can be assembled in parallel� but the �nal assembly cannot be donebefore all subparts are ready�

A sequence can be driven in dierent ways� by time or by events� Atypical time driven sequence is a piece of music� Time driven sequences canbe regarded as feedforward control� The chain of events is trigged by the clockand not by the state of the system� An event driven sequence is a feedbacksystem� where the state of the system determines what will happen next�

Example ���Simple event driven sequential netConsider the system described in Figure ��� It can describe a school day� Ithas two states �break� and �lesson�� When the bell rings we get a transitionfrom one state to the other� Which output we get depends on the currentstate and the input signal� If starting in the state �break� and there is no bellringing we stay in the state break� When the bell calls we get transition tothe state �lesson��

Page 204: Process Control

�� Chapter � Sequencing Control

Input: BellOutput: Leave class room

Input: BellOutput: Go to class room

Input: No bellOutput: Study

Input: No bellOutput: Play

Break Lesson

Figure �� Simple sequential net for describing a school day�

Delay

Delay

Delay

Input

State

Output

New state

Logical net

Figure �� Synchronous sequential net as combinationof logical net and delay or memoryelements�

A sequential net can be described by a state graph such as in Figure ���The state graph shows the transitions and the outputs for dierent inputsignals� The sequential net can also be described by a truth table� which mustinclude the states and also the conditions for transitions� The sequential netis thus described by the maps

new state � f�state inputs�

output � g�state inputs�

Notice the similarity with the state equations for continuous time and dis�crete time systems� The dierence is that the states� inputs� and outputs onlycan take a �nite number of values� Sequential nets can be divided into syn�chronous and asynchronous nets� In synchronous nets a transition from onestate to another is synchronized by a clock pulse� which is the case when thenets are implemented in a computer� A synchronous sequential net can be im�plemented as shown in Figure ���� In asynchronous nets the system goes fromone state to the other as soon as the conditions for transition are satis�ed�The asynchronous nets are more sensitive to the timing when the inputs arechanging� In the sequel we will only discuss the synchronous nets�

There are many ways to describe sequences and sequential nets� A stan�dard is now developing based on GRAFCET� developed in France� GRAFCETstands for &Graphe de Commande Etape�Transition' �Graph for Step�Transi�tion Control�� GRAFCET with minor modi�cations is passed as an IEC �In�ternational Electrotechnical Commission� standard� IEC ��� The way to

Page 205: Process Control

��� Sequencing Controllers ��

Q

T •

V1

L1

L0

V2

Figure �� Process for batch water heating�

describe sequential nets is called function charts� GRAFCET is a formalizedway of describing sequences and functional speci�cations� This can be donewithout any consideration of how to make the hardware implementation� Thefunctional speci�cations are easy to interpret and understand� Computerizedaids to program and present sequences have also been developed�

Another way to describe sequences and parallel actions is Petri nets� Petrinets are directed graphs that can handle sequential as well as parallel se�quences� Sometimes the formalism for Petri nets makes it possible to investi�gate for instance reachability� It is then possible to �nd out which states thatcan be reached by legitimate transitions� This knowledge can be used to testthe logic and to implement alarms�

�� GRAFCET

The objective of GRAFCET is to give a tool for modeling and speci�cation ofsequences� The main functions and properties of GRAFCET will be describedin this section� A simple example is used to illustrate the concepts�

Example ���Heating of waterConsider the process in Figure ���� It consists of a water tank with two levelindicators� a heater� and two valves� Assume that we want to perform thefollowing sequence�

�� Start the sequence by pressing the button B� �Not shown in Figure �����

�� Fill water by opening the valve V� until the upper level L� is reached�

�� Heat the water until the temperature is greater than T � The heating canstart as soon as the water is above the level L�

�� Empty the water by opening the valve V� until the lower level L isreached�

� Close the valves and go to Step � and wait for a new sequence to start�

From the natural language description we �nd that there is a sequence ofwaiting� �lling� heating� and emptying� Also notice that the �lling and heatingmust be done in parallel and then synchronized� since we don�t know whichwill be �nished �rst�

Page 206: Process Control

�� Chapter � Sequencing Control

p p

a) b)

c) d)

e) f)

g) h)

p

Figure � GRAFCET symbols� �a� Step �inactive�� �b� Step �active�� �c� Initial step��d� Step with action� �e� Transition� �f� Branching with mutually exclusive alternatives� �g�Branching into parallel paths� �h� Synchronization�

GRAFCET speci�cations

A function chart in GRAFCET consists of steps and transitions� A step corre�sponds to a state and can be inactive� active� or initial� See Figure ����a���c��Actions associated with a step can also be indicated� see Figure ����d�� Atransition is denoted by a bar and a condition when the transition can takeplace� see Figure ����e�� A step is followed by a transition� branching withmutually exclusive alternatives� or branching into parallel sequences� Parallelsequences can be synchronized� see Figure ����h�� The synchronization takesplace when all the preceding steps are active and when the transition conditionis ful�lled� The function chart in GRAFCET for the process in Example ��is shown in Figure ���� The sequence starts in the step Initial� When B � �we get a transition to Fill �� where the valve V� is opened until the level L isreached� Now two parallel sequences starts� First the heating starts and we geta transition to Temp when the correct temperature is reached� At this stagethe other branch may be �nished or not and we must wait for synchronizationbefore the sequence can be continued� In the other branch the �lling continuesuntil level L� is reached� After the synchronization the tank is emptied untillevel L is reached thereafter we go back to the initial state and wait for a newsequence to start�

The example can be elaborated in dierent ways� For instance� it mayhappen that the temperature is reached before the upper level is reached�

Page 207: Process Control

��� GRAFCET ��

Init

Fill 1

Heat Q Fill 2

T

Temp Full

Empty

B

V1

V1

L1

L0

V2

1

L0

Figure � GRAFCET for the process and sequences in Example ����

The left branch is then in step Temp� The water may� however� becometoo cool before the tank is full� This situation can be taken into accountmaking it possible to jump to the step Heat if the temperature is low� Inmany applications we need to separate between the normal situation� andemergency situations� In emergency situations the sequence should be stoppedat a hazardous situation and started again when the hazard is removed� Insimple sequential nets it can be possible to combine all these situations intoa single function chart� To maintain simplicity and readability it is usuallybetter to divide the system into several function charts�

GRAFCET rules

To formalize the behavior of a function chart we need a set of rules how stepsare activated and deactivated etc� We have the following rules�

Rule �� The initialization de�nes the active step at the start�

Rule �� A transition is �rable if�i� All steps preceding the transition are active �enabled��ii� The corresponding receptivity �transition condition� is true�

A �rable transition must be �red�

Rule �� All the steps preceding the transition are deactivated and all thesteps following the transition are activated�

Rule � All �rable transitions are �red simultaneously�

Rule �� When a step must be both deactivated and activated it remains activewithout interrupt�

For instance� Rule � is illustrated in Figure ���� One way to facilitate theunderstanding of a functional speci�cation is to introduce macro steps� Themacro step can represent a new functional speci�cation� see Figure ����� The

Page 208: Process Control

�� Chapter � Sequencing Control

1 2

3

1 2

3

1 2

3

1 2

3

a = 1 or 0 a = 0

a) Not enabled b) Enabled but not firable

a = 1

c) Firable d) After the change from c)

• •

• • •

Figure �� Illustration of Rule ��

Macro step

Figure ��� Zooming of a macro step in GRAFCET�

macro steps make it natural to use a top�down approach in the construction ofa sequential procedure� The overall description is �rst broken down into macrosteps and each macro step can then be expanded� This gives well structuredprograms and a clearer illustration of the function of a complex process�

Page 209: Process Control

��� Summary �

�� Summary

To make alarm� supervision� and sequencing we need logical nets and sequen�tial nets� Ways to de�ne and simplify logical nets have been discussed� Theimplementation can be done using relays or special purpose computers� PLCs�GRAFCET or function charts is a systematic way of representing sequentialnets that is becoming a popular industrial notation and thus important to beaware of� The basic properties of function charts are easy to understand andhave been illustrated in this chapter� The analysis of sequential nets have notbeen discussed and we refer to the literature�

A characteristic of sequencing control is that the systems may becomevery large� Therefore� clarity and understandability of the description aremajor concerns� Boolean algebra and other classical methods are well suitedfor small and medium size problems� However� even though they look verysimple� they have an upper size limit where the programs become very di�cultto penetrate� There is currently a wish to extend this upper limit further byusing even simpler and clearer notations� GRAFCET is an attempt in thisdirection�

Page 210: Process Control

Control ofMultivariable Processes

GOAL� To discuss decoupling and design of controllers for multivari�

able systems�

��� Introduction

So far we have mainly discussed how to analyze simple control loops� I�e��control loops with one input and one output �SISO systems�� Most chemicalprocesses contain� however� many control loops� Several hundred control loopsare common in larger processes� Fortunately� most of the loops can be designedfrom a single�input single�output point of view� This is because there is noor weak interaction between the dierent parts of the process� Multiloopcontrollers� such as cascade control� were discussed in Chapter �� In cascadecontrol there are several measurements� but there is still only one input signalto the process�

In many practical cases it is necessary to consider several control loopsand actuators at the same time� This is the case when there is an interactionbetween the dierent control loops in a process� A change in one input mayin uence several outputs in a complex way� If the couplings or interactionsare strong it may be necessary to make the design of several loops at thesame time� This leads to the concept of multi�input multi�output systems�MIMO systems�� We will in this chapter generalize the multiloop controlinto multivariable control� The distinction is not well de�ned� but we will withmultivariable control mean systems with two or more actuators and whereall the control loops are design at the same time� A fundamental problem inmultivariable control is how the dierent measurements should be used by thedierent actuators� There are many possible combinations� We have so faronly discussed simple systems where the use of the measurements has been&obvious'� The controllers have typically been PID controllers with simplemodi�cations�

Multivariable systems will be introduced using a couple of examples�

��

Page 211: Process Control

��� Introduction ���

TC

LC

Fi,Ti

Tr

L

L r

F,T

Feed

Figure ��� Level and temperature control in a tank�

Example ����Shower

A typical example of a coupled system is a shower� The system has two in�puts� ow of hot and cold water� and two outputs� total ow and temperature�Changing either of the ows will change the total ow as well as the temper�ature� In this case the coupling is &strong' between the two input signals andthe two output signals� In the daily life we have also seen that the control of ow and temperature in a shower can be considerably simpli�ed by using athermostat mixer� This will reduce the coupling and make it easier to makethe control�

Example ����Level and temperature control in a tank

Consider the heated tank in Figure ���� The ow and temperature of thefeed are the disturbances of the process� The level is controlled by the outletvalve� The temperature in the tank is controlled by the steam ow through theheating coil� A change in feed temperature Ti or the temperature setpoint Trwill change the steam ow� but this will not in uence the level in the tank� Achange in the feed ow Fi or the level setpoint Lr will change the output owF and thus the content in the tank� This will also in uence the temperaturecontroller that has to adjust the steam ow� There is thus a coupling betweenthe level control and the temperature control� but there is no coupling fromthe temperature loop to the level loop�

Example ����Level and temperature control in an evaporator

Consider the evaporator in Figure ���� In this process there is an interactionbetween the two loops� The temperature control loop will change the steam ow to the coil� This will in uence both the produced steam and the level� Inthe same way a change in the output ow will change both the level and thetemperature� In the evaporator there is an interaction between both loops�

One�way interaction has in previous chapters been handled by using feed�forward� In this chapter we will discuss how more complex interactions canbe handled� Design of MIMO systems can be quite complex and is outsidethe main theme of this course� It is� however� of great importance to be ableto judge if there is a strong coupling between dierent parts of the process�Also it is important to have a method to pair input and output signals� Inthis chapter we will discuss three aspects of coupled systems�

� How to judge if the coupling in the process will cause problems in thecontrol of the process�

Page 212: Process Control

��� Chapter � Control of Multivariable Processes

Fi,Ti,c i

F,T,c

Concentrate

TC

LC

Producedsteam

Saturatedsteam

Feed

Tr

Lr

L

Figure ��� Level and temperature control in an evaporator�

Σ

Σ

G11

G21

G12

G22

y1

y2

u1

u2

Figure ��� Coupled system with two inputs and two outputs�

� How to determine the pairing of the inputs and outputs in order to avoidthe coupling�

� How to eliminate the coupling in the process�

An example of a coupled system is given in Figure ���� The system hastwo input signals and two output signals� Let Gij be the transfer functionfrom input j to output i and introduce the vector notations for the Laplacetransforms of the outputs and inputs

Y �s� �

� Y��s�Y��s�

� U�s� �

�U��s�U��s�

� then

Y �s� �

�G���s� G���s�G���s� G���s�

� U�s� � G�s�U�s�

G�s� is called the transfer function matrix of the system� This representationcan be generalized to more inputs and outputs� Another way of describing amultivariable system is by using the state space model

dx

dt� Ax� Bu

y � Cx �Du

where the input u and output y now are vectors�

Page 213: Process Control

��� Stability and Interaction ���

ΣG11

G21

G12

G22Σ ΣGc2

Process

y1

y2

u2

Σ Gc1

−1

u1

yr2

yr1

−1

Figure ��� Block diagram of a system with two inputs and outputs� The system iscontrolled by two simple controllers Gc� and Gc��

Σ Gc1

−1

u1y1

y2u2 =0

yr1

Figure ��� The system in Figure ��� when only the �rst loop is closed�

��� Stability and Interaction

To understand some of the problems with coupled systems we will discuss theprocess in Figure ��� This can be a block diagram of the evaporator in Figure���� The process is described by

Y��s� � G��U��s� �G��U��s�

Y��s� � G��U��s� �G��U��s������

and the controllers by

U��s� � Gc� �Yr��s�� Y��s�� �Loop ��

U��s� � Gc� �Yr��s�� Y��s�� �Loop �������

The situation with only Loop � closed is shown in Figure ���� The closedloop system is now described by

Y� �G��Gc�

� � G��Gc�Yr�

Y� � G��U� �G��Gc�

� �G��Gc�Yr�

Page 214: Process Control

��� Chapter � Control of Multivariable Processes

Σ Gc1u1 y1

y2

−1

Σ Gc2u2

−1

yr2

yr1

Figure ��� Illustration of the in�uence of u� on y� through the second loop�

With obvious changes we can also write down the expressions when Loop � isclosed and Loop � open� The characteristic equations for the two cases are

� �G��Gc� � � �����

and� �G��Gc� � � ����

Now consider the case in Figure �� with both loops closed� Using ����� toeliminate U� and U� from ����� gives

�� �G��Gc��Y� � G��Gc�Y� � G��Gc�Yr� � G��Gc�Yr�

G��Gc�Y� � �� � G��Gc��Y� � G��Gc�Yr� � G��Gc�Yr�

Using Cramer�s rule to solve for Y� and Y� gives

Y� �G��Gc� � Gc�Gc��G��G�� � G��G���

AYr� �

G��Gc�

AYr�

Y� �G��Gc�

AYr� �

G��Gc� �Gc�Gc��G��G�� �G��G���A

Yr�

where the denominator is

A�s� � �� �G��Gc���� � G��Gc���G��G��Gc�Gc� �����

If G�� � G�� � � then there is no interaction and the closed loop system isdescribed by

Y� �G��Gc�

� �G��Gc�Y�r

Y� �G��Gc�

� �G��Gc�Y�r

The closed loop system is in this case stable if each loop is stable� i�e� if allthe roots of ���� and ����� are in the left half plane� With interaction thestability of the closed loop system is determined by the polynomial A�s� in������ Notice that the stability of the closed loop system depends on both thecontrollers and the four blocks in G� The interaction through the second loopis illustrated in Figure ���� The bold lines indicate the in uence of u� on y�through the second loop�

The controllers must be tuned such that the total system is stable� Sinceany of the loops may be switched into manual control� i�e� the loop is open� it

Page 215: Process Control

��� Stability and Interaction ���

is also necessary that each loop separately is stable� The closed loop systemmay be unstable due to the interaction even if each loop separately is stable�The interaction in the system may destabilize the closed loop system and thismakes it more di�cult to do the tuning� The following example points outsome of the di�culties of tuning multivariable controllers�

Example ����Stability of multivariable systemAssume that the process in Figure �� has the transfer functions

G�� ��

���s� �G�� �

�s� �

G�� ��

���s� �G�� �

���s� �

and the proportional controllers Gc� � Kc� and Gc� � Kc�� Tuning each loopseparately each loop will be stable for any positive gain� The characteristicequation for the total system is

����s� � �������� �Kc� �Kc��s�

� ����� � ���Kc� � ���Kc�� ���Kc�Kc��s�

� �� � ���Kc� � ���Kc�� ���Kc�Kc��s

� �� �Kc� � �Kc� � �Kc�Kc�� � �

A necessary condition for stability is that all coe�cients are positive� The onlyone that may become negative is the last one� This implies that a necessarycondition for stability of the closed loop system is

� �Kc� � �Kc� � �Kc�Kc� � �

This condition is violated when the gains are su�ciently high�

Generalization

The computations above were done for a ��� system with simple proportionalcontrollers� We will now consider a system with a general transfer functionmatrix and a general controller matrix� Let the system be described by

Y �s� � Go�s�U�s�

and the controller by

U�s� � Gr�s� �Yr�s�� Y �s��

Both Go and Gr are transfer function matrices of appropriate orders� Elimi�nating U�s� gives

Y �s� � Go�s�Gr�s��Yr�s�� Y �s��

Solving for Y �s� gives

Y �s� � �I �Go�s�Gr�s����Go�s�Gr�s�Yr�s� � Gcl�s�Yr�s� �����

where I is the unit matrix� The closed loop transfer function matrix is Gcl�s��When evaluating the inverse in ����� we get the denominator

A�s� � det �I �Go�s�Gr�s��

Page 216: Process Control

��� Chapter � Control of Multivariable Processes

The characteristic equation of the closed loop system is thus

A�s� � det �I �Go�s�Gr�s�� � � �����

This is in analogy with the SISO case� Compare ������� The closed loopsystem is thus stable if the roots of ����� are in the left hand plane�

How di�cult is it to control a MIMO system

The simple examples above point out some of the di�culties with MIMOsystems� How di�cult it is to control a MIMO system depends on the systemitself� but also on how we are choosing and pairing the measurements andinput signals�

Controllability The concept of controllability was introduced in Section��� This is one way to measure how easy it is to control the system� Let Wcr

be a square matrix consisting of n independent columns of the controllabilitymatrix Wc� One measure of the controllability of the system is detWcr� Thisquantity will� however� depend on the chosen units and can only be used as arelative measure when comparing dierent choices of input signals�

Resiliency One way to measure how easy it is to control a process is theconcept of resiliency introduced in Morari ������� The Resiliency Index �RI�depends on the choice of inputs and measurements� but is independent of thechosen controller� It is thus a measure based on the open loop system that isindependent of the pairing of the control signals and measurements� The RI isde�ned as the minimum singular value of the transfer function matrix of theprocess Go�i��� i�e�

RI � �min���

The singular values �i of a matrix A are de�ned as

�i �pi

where i are the eigenvalues of the matrix ATA� The smallest in magnitudeis called the minimum singular value� A large value of RI indicates that thesystem is easy to control� The RI can be de�ned for dierent frequenciesor only be based on the steady state gain matrix of the process� The RIis dependent on the scaling of the process variables and should be used tocompare dierent choices of inputs and outputs� All signals should be scaledinto compatible units�

��� Control of Multivariable Systems

In this section we will sketch a design procedure for multivariable systems� Todo so we will need some additional tools� A tool for determining the pairingof variables is given in the next section� Example �� showed that the totalsystem may be unstable even if each control loop is stable� There is thus aneed for a way of determining if a chosen pairing is good or bad�

Page 217: Process Control

��� Control of Multivariable Systems ���

The Niederlinski index

We will now consider a situation when a pairing of variables have been ob�tained� Information about the stability of the proposed controller structurecan be obtained using the Niederlinski index� The method was proposed inNiederlinski ������ and a re�ned version in Grosdidier et al ������� The theo�rem gives a su�cient condition for instability and is based on the steady gainmatrix of the process�

Theorem ����Su�cient condition for instability� Grosdidier et al ������Suppose that a multivariable system is used with the pairing u��y�� u��y��� � ��un�yn� Assume that the closed loop system satis�es the assumptions

�� Let Goij�s� denote the �i j��th element of the open loop transfer functionmatrix Go�s�� Each Goij�s� must be stable� rational� and proper� Furtherde�ne the steady state gain matrix K � Go���

�� Each of the n feedback controllers contains integral action�

�� Each individual control loop is stable when any of the other n � � loopsare opened�

If the closed loop system satis�es Assumptions ���� then the closed loop systemis unstable if

detKQni�� kii

� �

where kii are the diagonal elements of K�

Remark �� Notice that the test is based on the steady state gain of the openloop process� Further the pairing is such that ui is paired with yi� This can beobtained by a suitable reordering of the open loop transfer function matrix�

Remark �� The theorem gives a su�cient� but not necessary condition forinstability� which can be used to eliminate unsuitable pairings of variables�

A transfer function is proper if the degree of the denominator is the sameor larger than the degree of the numerator� I�e� the number of poles are thesame or larger than the number of zeros�

A design procedure

Luyben ������ suggests a design procedure for MIMO systems consisting ofthe following steps�

�� Select controlled variables using engineering judgment�

�� Select manipulated variables that gives the largest resiliency index� RI�

�� Eliminate impossible variable pairings using the Niederlinski index�

� Find the best pairing from remaining set�

�� Tune the controllers�

The selection of control variables must be based on good knowledge of theprocess to be controlled� There is usually a dierence between the quantitiesthat one primarily want to control and the variables that are easily availablefor measurement without any time delay� for instance� due to laboratory tests�A typical example is composition in distillation columns that can be di�cultand expensive to measure� Instead temperatures in the column are measuredand controlled�

When several possibilities to manipulate the process are available one canuse the Morari reciliency index to select the input that is most eective� This

Page 218: Process Control

��� Chapter � Control of Multivariable Processes

can be done based on the open loop model without having determined thestructure of the controller� Only the outputs and inputs are selected not howthey should be used for control�

The Niederlinski index can be used to eliminate possible bad pairingsof variables� The pairing can be based on the relative gain array describedin the next section� The pairing of variables now gives the structure of thecontroller� A simple way to approach the design is to consider one loop atthe time� Simple PID controllers can be used in many situations� It can�however� be necessary to &detune' the controller setting obtained after theone�loop�at�the�time tuning� This is due to the stability problem from to theinteraction discussed earlier� One way to detune a PID controller is to changethe parameters to

Kdetunedc � Kc��

T detunedi � Ti �

T detunedd � Td �

where Kc� Ti� and Td are the PID parameters obtained� for instance� throughZiegler�Nichols tuning� The detuning factor � should be greater than �� Typ�ical values� according to Luyben ������� are between ��� and � An increaseof � will make the system more stable� but also more sluggish� The factor �can be determined through trial�and�error� but also by analyzing the closedloop characteristic equation�

After the tuning there may still be too much interaction between thedierent loops� To avoid this a decoupler may be determined for the process�This is discussed in Section ����

��� Relative Gain Array

There are many ways to determine the coupling or interaction in a MIMOsystem� The Relative Gain Array �RGA� was introduced by Bristol in ����as a way to determine the static coupling in a system� The RGA can beused to �nd an appropriate pairing of inputs and outputs� The drawbackof RGA is that only the coupling for reference value changes is investigated�In process control it is often more important to consider load disturbances�The Relative Disturbance Gain �RDG� introduced by McAvoy is one way tochange the focus to the disturbances� The idea behind the RGA is to studythe stationary gain K � G��� of the process and to introduce a normalization�The normalization is necessary to eliminate the eect of scaling of the variablesin the process�

Consider Figure ���� which is a multivariable system with the same num�ber of inputs as outputs� All inputs except uj are controlled� We will nowinvestigate the stationary changes in the outputs yi� when uj is changed� I�e�we will study the stationary value of

�yi�uj

where the � denotes the change in the variable� Introduce

kij � Gij��� ��yi�uj

when �uk � � k �� j

Page 219: Process Control

��� Relative Gain Array ��

Process

Ref. value

Con-troller

uj yi

Figure �� A controlled multivariable system�

The steady state gain K � G��� is a matrix with the elements kij �To obtain a normalization we also study a second situation� Consider the

situation in Figure ���� Assume that the control of the system is so good thatonly yi is changed when uj is changed� Introduce

lij ��yi�uj

when �yk � � k �� i

The coupling through the static gain G��� is easy to obtain� when the transferfunction matrix is known� The normalization through lij is more di�cult todetermine� We will derive the normalization for a system with two inputs andoutputs and then give the general expression�

Example ����The normalization for a system with two inputs and outputsAssume that the steady state behavior of the system is described by

�y� � k���u� � k���u��y� � k���u� � k���u�

We �rst determine l��� In this case �y� � �� which gives

�u� � �k��k��

�u�

Using this in the second equation above gives

�y� �

�k�� � k��k��

k��

��u�

or

l�� ��y��u�

� �k��k�� � k��k��k��

� �detKk��

where detK is the determinant of the matrix with the elements kij � In thesame way we can determine

l�� �detKk��

l�� �detKk��

l�� � �detKk��

Page 220: Process Control

�� Chapter � Control of Multivariable Processes

The matrix with the elements ��lij is thus given by

�detK

� k�� �k���k�� k��

� ��K��

�TThe relative gain array �RGA� is now de�ned as a matrix " with the elements

ij �kijlij

The example above can be generalized� The relative gain array is de�nedas

" � K � �K���T

�����

where � denotes the element�by�element �Schur� product of the elements in Kand �K���T � Notice that it is not a conventional matrix multiplication thatis performed�

From ����� it follows that it is su�cient to determine the stationary gainK � G��� of the open loop system� The relative gain array matrix " is thegiven through ����� and an element by element multiplication of two matrices�The RGA has the properties

nXi��

ij �nX

j��

ij � �

I�e� the row and the column sums are equal to unity� This implies that for a�� � system only one element has to be computed� The rest of the elementsare uniquely determined� For a � � � system four elements are needed todetermine the full matrix�

A system is easy to control using single�loop controllers if " is a unit ma�trix or at least diagonal dominant after possible permutations of rows and�orcolumns�

Example ����Non�interacting systemAssume that

K �

� � a

b c

� then �

K���T

� � �ab

� c �b�a �

� and

" �

� � �� �

� By interchanging the rows or the columns we get a unit matrix� The systemis thus easy to control using two non�interacting controllers�

A system has di�cult couplings if " has elements that are larger than ��This implies that some elements must be negative since the row and columnsums must be unity�

Page 221: Process Control

��� Relative Gain Array ���

Table ��� The RGA for a � � system�

� Pairing Remark

���� � �

� �

��� u� � y�

u� � y�No interaction

���� � �

� �

��� u� � y�

u� � y�No interaction

����

���� ���� ����

���� ����

��� u� � y�

u� � y�Weak interaction

���� � ���� �

��� u� � y�

u� � y�Di�cult interaction

Pairing of inputs and outputs

By determining the relative gain array " is is possible to solve the �rst problemstated in the Section ���� The RGA matrix can also be used to solve the secondproblem� I�e� it can be used to pair inputs and outputs� The inputs andoutputs should be paired so that the corresponding relative gains are positiveand as close to one as possible

Example ���Pairing �Let the RGA be

" �

� ��

��

� The RGA and the pairing for dierent values of are shown in Table ���� Theinteraction when � � is severe and the system will be di�cult to controlwith two single loops�

Example ���Pairing �Assume that a system has the transfer function matrix

G�s� �

��

s� ��

s � ��

s� ��

s � �

� The static gain is given by

K �

� � ���� �

� and we get �

K���T

� � ���� �

� " �

� � ���� �

� Since " has elements that are larger than one we can expect di�culties whencontrolling the system using single�input single�output controllers�

Page 222: Process Control

��� Chapter � Control of Multivariable Processes

F1, x1=0.8

F2, x2=0.2 F, x

Figure �� Mixing process where total �ow and mixture should be controlled�

Example ����Pairing �Assume that a system has the transfer function matrix

G�s� ��

�s� ���s� ��

� s� � s

�� s� �

� The static gain is given by

K �

����� ��� ��

� and we get �

K���T

��� �� ��

� " �

� � �� �

� This system should be possible to control using two simple controllers� since" is a unit matrix�

Example �����Mixing processConsider the mixing process in Figure ���� The purpose is to control the total ow F and the composition x at the outlet� The inputs are the ows F�and F�� The desired equilibrium point is F � ��� and x � ���� The inputcompositions are x� � ��� and x� � ���� Which inputs should be used tocontrol F and x respectively�

The mass balances give

F � F� � F�

Fx � F�x� � F�x�

Solving for the unknown ows give F� � ������ and F� � ������ The systemis nonlinear and we can�t directly determine the gain matrix at the desiredequilibrium point� One way is to calculate the RGA using perturbation� As�sume that F� is changed one unit and assume that F� is kept constant� Thisgives F � ��� and x � ������ and�

�F�F�

�F�

���� �

In the same way we change F� by one unit but is keeping x constant� Thisgives �

�F�F�

�x

������

� ����

Using the de�nition of the RGA we get

�� �

��F�F�

�F��

�F�F�

�x

��

�����

��

Page 223: Process Control

��� Relative Gain Array ���

D(s) G(s)m u y

T(s)

Figure ��� A system with decoupling matrix D�

and the full relative gain matrix becomes

" �

� ���� �������� ����

� where we have assumed that the inputs are in the order F�� F� and the outputsF � x� The interaction will be minimized if we choose the pairing F�F� andx�F�� There will� however� be a noticeable coupling since the elements areclose in size�

The relative gain array method only considers the static coupling in asystem� There may very well be di�cult dynamic couplings in the processthat is not detected through the RGA methods� Dierent ways to circumventthis problem have been discussed in the literature� The Relative DynamicArray �RDA� method is one way to also consider the dynamic coupling insome frequency ranges�

��� Decoupling

In this section we will give a short discussion of how to improve the control ofa multivariable system with coupling� One way is to use theory for design ofmultivariable systems� This is� however� outside the scope of this course� Asecond way that can be eective is to introduce decoupling in a MIMO system�This is done by introducing new signals that are static or dynamic combina�tions of the original control signals� After the introduction of a decouplingmatrix it can be possible to design the controllers from a single�input single�output point of view� Consider the system in Figure ���� The matrix D�s� isa transfer function matrix that will be used to give decoupling by introducingnew control signals m�t�� We have

Y �s� � G�s�U�s� � G�s�D�s�M�s� � T �s�M�s�

The idea is to determine D�s� such that the total transfer function matrixT �s� � G�s�D�s� has a decoupled structure� Ideally T �s� should be a diag�onal matrix� By specifying T we may solve for D provided the matrix G isinvertible� We will make the computations for a system with two inputs andtwo outputs� Assume that T and G are given as

T �

�T�� �� T��

� G �

�G�� G��

G�� G��

� The decoupling matrix is now given by

D �

�D�� D��

D�� D��

� ��

detG

� G��T�� �G��T���G��T�� G��T��

� �����

Page 224: Process Control

��� Chapter � Control of Multivariable Processes

0 5 10 15

0

1y1, yr1

0 5 10 15

0

1y2, yr2

0 5 10 15

−4

0

4u1, u2

1

2

1

2

1

2

0 5 10 15

0

1y1, yr1

0 5 10 15

0

1y2, yr2

0 5 10 15

−4

0

4

1

2

1

2

1

2

u1, u2

a) b)

Figure ���� The process in Example ��� controlled by two PI controllers� �a� y� y� andthe control signals u� and u� when the reference value of y� is changed� �b� Same as �a�when the reference value of y� is changed�

Equation ����� can give quite complicated expressions for D� One choice isobtained by considering the diagonal elements D�� and D�� as parts of thecontroller and interpret D�� and D�� as feedforward terms in the controller�We may then choose

D �

� � �G���G��

�G���G�� �

� This gives

T � GD �

�G�� �G��G���G�� �� G�� � G��G���G��

� With this special choice we have obtained a complete decoupling of the system�There may� however� be di�culties to make a realization of the decoupling�There may be pure derivations in D�

An other solution to the decoupling problem is obtained by the choice

D��� � G�����T ���

This results in a decoupling in steady state�

Example �����DecouplingConsider the system in Example ���� Figure ���� shows the outputs andcontrol signals when the system is controlled by two PI controllers withoutany decoupling� The output y� changes much� when the reference value to y�

Page 225: Process Control

��� Decoupling ���

0 5 10 15

0

1y1, yr1

0 5 10 15

0

1y2, yr2

0 5 10 15

−4

0

4u1, u2

1

2

1

2

1

2

0 5 10 15

0

1y1, yr1

0 5 10 15

0

1y2, yr2

0 5 10 15

−4

0

4

1

2

1

2

1

2

u1, u2

a) b)

Figure ���� Same as Figure ��� but with stationary decoupling�

is changed� Figure ���� shows the same experiment as in the previous �gure�but when a stationary decoupling is done using

D �

� � ���

�� �

� This gives

T �s� �

��� s

�s� ���s� ��s

��s� ���s� ��

��

��s� ��

� The RGA matrix of the decoupled system is

" �

� � �� �

� The system should now be possible to control using two separate controllers�This is also veri�ed in the simulation shown in Figure ����� There is� how�ever� still a dynamic coupling between the two loops� A complete dynamicdecoupling is shown in Figure ����� In this case we use

D �

� � ��s� �s� �

�� �

� which gives

T �s� �

��� s

�s� ���s� ���

��� s

�s� ���s� ��

Page 226: Process Control

��� Chapter � Control of Multivariable Processes

0 5 10 15

0

1y1, yr1

0 5 10 15

0

1y2, yr2

0 5 10 15

−4

0

4u1, u2

1

2

1

2

1

2

0 5 10 15

0

1y1, yr1

0 5 10 15

0

1y2, yr2

0 5 10 15

−4

0

4

1

2

1

2

1

2

u1, u2

a) b)

Figure ���� Same as Figure ���� but with dynamic decoupling�

��� Summary

Multivariable systems can be analyzed with the relative gain array method�It is only necessary to compute the static gain of the open loop system todetermine the relative gain array �RGA� "� If " through permutations ofrows and columns can become a unit matrix or a diagonal dominant matrixthen the system can be controlled by simple SISO controllers� The RGAmethod can also be used to pair inputs and outputs�

We also have shown how it is possible to create new input signals suchthat the system becomes decoupled either in a static sense or in a dynamicsense�

Page 227: Process Control

Sampled�data Control

GOAL� To give an introduction to how computers can be used to

implement controllers�

� �� Introduction

Computers are more and more used to control processes of dierent kinds� InChapter � we have seen how a PID�controller can be implemented in a com�puter� In this chapter we will give an overview of sampled�data systems andhow computers can be used for implementation of controllers� Standard con�trollers such as PID�controllers have over the years been implemented usingmechanical� pneumatic� hydraulic� electronic� and digital equipment� Mostmanufactured PID�controllers are today based on microprocessors� This isdone because of the cost bene�ts� If the sampling frequency is high the con�trollers can be regarded as continuous time controllers� The user can makethe tuning and installation without bothering about how the control algo�rithm is implemented� This has the advantage that the operators do not haveto be re�educated when equipment based on new technology is installed� Thedisadvantage is that the full capacity of sampled�data systems is not used�

Some advantages of using computers to control a process are�

� Increased production

� Better quality of the product

� Improved security

� Better documentation and statistics

� Improved exibility

One of the most important points above is the increased exibility� It is� inprinciple� very simple to change a computer program and introduce a newcontroller scheme� This is important in industrial processes� where revisionsalways are made� New equipment is installed and new piping is done etc�

In this chapter we will give some insights into sampled�data systems andhow they can be used to improve the control of processes� Section ���� isan introduction of sampling� Some eects of the sampling procedure� such asaliasing� are covered in Section ����� Sampled�data systems are conveniently

���

Page 228: Process Control

��� Chapter �� Sampled�data Control

described by dierence equation� Some useful ideas are introduced in Section����� Approximation of continuous time controllers are discussed in Section���� Computer implementation of PID�controllers is treated in Section �����General aspects of real�time programming are discussed in Section ����� wherealso commercial process control systems are discussed�

Some historical remarks

The development of process control using computers can be divided into �vephases

Pioneering period � ����Direct�digital�control period � ����Minicomputer period � ����Microcomputer period � ����General use of digital control � ����

The years above give the approximate time when dierent ideas appeared�The �rst computer application in the process industry was in March ����

at the Port Arthur� Texas� re�nery� The project was a cooperation betweenTexaco and the computer company Thomson Ramo Woodridge �TRW�� Thecontrolled process was a polymerization unit� The system controlled �� ows��� temperatures� � pressures� and � compositions� The essential function ofthe computer was to make an optimization of the feeds and recirculationsof the process� During the pioneering period the hardware reliability of thecomputers was very poor� The Mean Time Between Failures �MTBF� forthe central processing unit could be in the range ������ hours� The taskof the computer was instead to compute and suggest the set�point valuesto the conventional analog controllers� see Figure ���� a�� The operator thenchanged the set�points manually� This is called operator guide� With increasedreliability it became feasible to let the computers change the set points directly�see Figure ���� b�� This is called set�point control� The major tasks of thecomputers were optimization� reporting� and scheduling� The basic theory forsampled�data system was developed during this period�

With increasing reliability of the computers it became possible to replacethe conventional controllers with algorithms in the computers� This is calledDirect Digital Control� �DDC�� see Figure ���� c�� The �rst installation usingDDC was made at Imperial Chemical Industries �ICI� in England in ����� Acomplete analog instrumentationwas replaced by one computer� a Ferranti Ar�gus� The computer measured �� variables and controlled directly ��� valves�At this time a typical central processing unit had a MTBF of about ����hours� Using DDC it also became more important to consider the operatorinterfaces� In conventional control rooms the measured values and the con�trollers are spread out over a large panel� usually covering a whole wall in aroom� Using video displays it became possible to improve the information owto the process operators�

Integrated circuits and the development of electronics and computers dur�ing the end of the sixties lead to the concept of minicomputers� As the nameindicates the computers became smaller� faster� cheaper� and more reliable�Now it became cost�eective to use computers in many applications� A typ�ical computer from this time is CDC ���� with an addition time of � �sand a multiplication time of � �s� The primary memory was in the range����k words� The MTFB for the central processing unit was about �� ���hours� The computers were now equipped with hardware that made it easy

Page 229: Process Control

���� Introduction ��

Computer

Process

Analogcontroller

Instrument

Operatordisplay

a)

Operator

Process

Analogcontroller

Operatordisplay

Operator

b)

Set-point

Operator

c)

Operatordisplay

Process

ComputerComputer

Set-point

Figure ���� Di�erent ways to use computers� a� Operator guide� b� Set�point control�c� Direct Digital Control �DDC��

to connect them to the processes� Special real�time operating systems weredeveloped which made it easier to program the computers for process controlapplications�

The development with very large scale integration �VLSI� electronics madeit possible to make a computer on one integrated circuit� Intel developed the�rst microprocessors in the beginning of the seventies� The microprocessorsmade it possible to have computing power in almost any equipment such assensors� analyzers� and controllers� A typical standard single loop controllerbased on a microprocessor is shown in Figure ����� This type of standardcontrollers are very common in the industry� Using a microprocessor makesit possible to incorporate more features in the controller� For instance� auto�tuning and adaptivity can be introduced�

From the beginning of the eighties the computers have come into moregeneral use and the development have continued both on the hardware andthe software� Today most control systems are built up as distributed systems�The system can be easily expanded and the reliability has increased withthe distributed computation and communication� A typical architecture of adistributed control system is shown in Figure ����� Typically a workstationhas today a computing capacity of �� or more MIPS �Million Instructions PerSecond� and a memory of ��� Mbyte�

Page 230: Process Control

�� Chapter �� Sampled�data Control

Figure ���� A standard microprocessor�based single�loop controller for process control��By courtesy of Alfa Laval Automation Stockholm Sweden��

I 0 I 0 I 0 I 0I 0I 0

PROCESS

Process Bus Process Bus

Local operatorstation

ProcessComputer

ProcessComputer

MIS

LAN

PC

Main Control RoomProcess Engineer's

Workstation Process Control Lab

OS OS

Figure ���� Architecture of a distributed control system�

� �� Sampled�data Systems

In the context of control and communication samplingmeans that a continuoustime signal is replaced by a sequence of numbers� Figure ��� shows thesignals in the dierent parts of the system when a process is controlled using acomputer� The output of the process is sampled and converted into a numberusing a analog�to�digital �A�D� converter� The sampler and converter areusually built into one unit� The sampling times are determined by the real�time clock in the computer� The sampled signal is represented as a digitalnumber� Typically the converter has a resolution of ���� bits� This implies

Page 231: Process Control

���� Sampled�data Systems ���

D/A -converter

Computer A/D -converter

Process

Holdcircuit

Operatordisplay

Sampler

u(t) y(t)

y(t)u(t)

t t

t t

yt

y t

u t

u t

Figure ���� Computer control of a process�

that the sampled signal is quantized both in time and amplitude� The timebetween the sampling instances is called the sampling period� The sampling isusually periodic� i�e� the times between the samples are equal� The samplingfrequency �s and the sampling period h are related through

�s ���h

The controller is an algorithm or program in the computer that determines thesequence of control signals to the process� The control signals are convertedinto an analog signal by using a digital�to�analog �D�A� converter and a hold�circuit� The hold circuit converts the sequence of numbers to a time�continuoussignal� The most common hold circuit is the zero�order�hold� which keepsthe signal constant between the D�A conversions� The end result is that theprocess is controlled by a piece�wise constant signal� This implies that theoutput of the system can be regarded as a sequence of step responses for theopen loop system� Due to the periodicity of the control signal there will be aperiodicity also in the closed loop system� This makes it di�cult to analyzesampled�data systems� The analysis will� however� be considerably simpli�edif we only consider the behavior of the system at the sampling points� Wethen only investigate how the output or the states of the system is changedfrom sampling time to sampling time� The system will then be described byrecursive or di�erence equations�

Aliasing

When sampling the output of the process we must choose the sampling pe�riod� Intuitively it is clear that we may loose information if the sampling is toosparse� This is illustrated in Figure ����� where two sinusoidal signals are sam�pled� The sinusoidal signals have the frequencies ��� and ��� Hz respectively�When sampling with a frequency of � Hz the signals have the same value ateach sampling instant� This implies that we can�t distinguish between the sig�nals after the sampling and information is lost� The high frequency signal canbe interpreted as a low frequency signal� This is called aliasing or frequencyfolding� The aliasing problem may become serious in control systems when

Page 232: Process Control

��� Chapter �� Sampled�data Control

0 5 10−1

0

1

Time

Figure ���� Illustration of aliasing� The sinusoidal signals have the frequencies �� and�� Hz respectively� The sampling frequency is � Hz�

Steam

Pressure

PumpFeedwater

Condensedwater

Temperature

Valve

To boiler

2 min

38 min

Tem

pera

ture

2.11 min

Time

Pre

ssu

re

Figure ���� Process diagram for a feedwater heating system of a boiler�

the measured signal has a high frequency component� The sampled signalwill then contain a low frequency alias signal� which the controller may try tocompensate for�

Example �����Aliasing

Figure ���� is a process diagram of feedwater heating in a boiler of a ship�A valve controls the ow of water� Unintentionally there is a backlash inthe valve positioner due to wear� This causes the temperature to oscillate�Figure ���� shows a sampled recording of the temperature and a continuoustime recording of the pressure� The sampling period of the temperature is� min� From the temperature recording one might believe that there is anoscillation with a period of �� min� Due to the physical coupling between thetemperature and the pressure we can conclude that also the temperature musthave an oscillation of ���� min� The �� min oscillation is the alias frequency�

Page 233: Process Control

���� Sampled�data Systems ���

0 10 20 30

−1

0

1(a)

0 10 20 30

−1

0

1(b)

0 10 20 30

−1

0

1

Time

(c)

0 10 20 30

−1

0

1

Time

(d)

Figure ��� Usefulness of a pre�lter� a� Signal plus sinusoidal disturbance� b� The signal�ltered through a sixth�order Bessel �lter� c� Sample and hold of the signal in a�� d� Sampleand hold of the signal in b��

Can aliasing be avoided� The sampling theorem by Shannon answersthis question� To be able to reconstruct the continuous time signal from thesampled signal it is necessary that the sampling frequency is at least twice ashigh as the highest frequency in the signal� This implies that there must beat least two samples per period� To avoid the aliasing problem it is necessaryto �lter all the signals before the sampling� All frequencies above the Nyquistfrequency

�N ��s�

��

hshould ideally be removed�

Example �����Pre�lteringFigure ���� a� shows a signal �the square wave� disturbed by high frequencysinusoidal measurement noise� Figure ���� c� shows the sample and hold ofthe signal� The aliasing is clearly visible� The signal is then pre�ltered beforethe sampling giving the signal in Figure ���� b�� The measurement noise iseliminated� but some of the high frequency components in the desired signalare also removed� Sample and hold of the �ltered signal is shown in Figure���� d�� The example shows that the pre�ltering is necessary and that we mustcompromise between the elimination of the noise and how high frequencies thatare left after the �ltering� It important that the bandwidth of the pre�lter isadjusted to the sampling frequency�

� �� Description of Sampled�data Systems

In this section we will brie y discuss how to describe sampled�data systems�The idea is to look at the signals only at the sampling points� Further� wewill only discuss the problem when the sampling interval h is constant� Letthe process be described by the continuous time state�space model

%x�t� � Ax�t� �Bu�t�

y�t� � Cx�t�������

Page 234: Process Control

��� Chapter �� Sampled�data Control

Assume that the initial value is given and that the input signal is constantover the sampling interval� The solution of ������ is now given by �B���� Lett and t � h be two consecutive sampling times�

x�t� h� � eAhx�t� �Z t�h

teA�t���Bu��� d�

� eAhx�t� �Z t�h

teA�t���B d� u�t�

� eAhx�t� �Z h

eA�

B d� � u�t�

� ,x�t� � -u�t�

In the second equality we have used the fact that the input is constant overthe interval #t t � h$� The third equality is obtained by change of integrationvariable � � � t � � � A dierence equation is now obtained� which determineshow the state is changed from time t to time t � h�

x�t� h� � ,x�t� � -u�t�

y�t� � Cx�t�������

The sampled data system is thus described by a dierence equation� Thesolution of the dierence equation is obtained recursively through iteration�In the same way as for continuous time systems it is possible to eliminatethe states and derive an input output model of the system� Compare Section��� Transform theory plays the same role for sampled data systems as theLaplace transform for continuous time systems� For sampled�data systemsthe z�transform is used� We can also introduce the shift operator q� which isde�ned as

qy�t� � y�t� h�

i�e� multiplication by the operator q implies shift of the time argument onesampling period ahead� Multiplication by q�� is the same as backward shift�Using the shift operator on ������ gives

qx�t� � ,x�t� � -u�t�

Solving for x�t� givesx�t� � �qI � ,��� -u�t�

Compare ������� The input�output model is thus

y�t� � C �qI � ,��� -u�t� � H�q�u�t� ������

where H�q� is called the pulse transfer function� Equation ������ correspondsto a higher order dierence equation of the form

y�t� � a�y�t� h� � a�y�t� �h� � � any�t� nh�

� b�u�t � h� � � bnu�t� nh������

The output of the dierence equation ����� is thus a weighted sum of previousinputs and outputs� See Figure �����

Page 235: Process Control

���� Description of Sampled�data Systems ���

Output y

Input u

Time

−a2

−a1

b2 b1

t−2h t−h t t+h

Figure ��� Illustration of the di�erence equation y�t� � a�y�t � h� � a�y�t � �h� �b�u�t� h� � b�u�t� �h��

Example �����Recursive equationAssume that a sampled�data system is described by the recursive equation

y�t� ��� ���y�t� � ���u�t� ������

where y��� � � and u�t� � � when t � �� We can now compute the output of�������

t u�t� y�t�� � �� � ���� � ���� � ���� � ������ � ������ � ������ � ������ � ������ � ������� � �������

������

� � ����The stationary value can be obtained by assuming that y�t� �� � y�t� �

y��� in ������� This gives

y��� ����

�� ���� ����

Given a continuous time system and assuming that the control signal isconstant over the sampling period is is thus easy to get a representation thatdescribes how the system behaves at the sampling instants� Stability� control�lability� observability� etc can then be investigated very similar to continuoustime systems� There are also design methods that are the same as for contin�uous time systems� This is� however� outside the scope of this book�

Page 236: Process Control

��� Chapter �� Sampled�data Control

Algorithmy(kh)u(kh)

Clock

A-Dy(t)u(t)

G(s)≈

D-A

H(q)

Figure ���� Approximating a continuous time transfer functionG�s� using a computer�

� �� Approximations

It is sometimes of interest to make a transformation of a continuous timecontroller or a transfer function into a discrete time implementation� This canbe done using approximations of the same kind as when making numericalintegration� This can be of interest when a good continuous time controller isavailable and we only want to replace the continuous time implementation bya sampled�data implementation� See Figure �����

The simplest ways are to approximate the continuous time derivative us�ing simple dierence approximations� We can use forward di�erence �Eulersapproximation�

dy

dt� y�t� h�� y�t�

h������

or backward di�erencedy

dt� y�t�� y�t� h�

h������

Higher order derivatives are obtained by taking the dierence severaltimes� These types of approximations are good only if the sampling period isshort� The forward dierence approximation corresponds to replacing each sin the transfer function by �q � ���h� This gives a discrete time pulse trans�fer function H�q� that can be implemented as a computer program� Usingbackward dierence we instead replace all s by ��� q����h�

Example �����Dierence approximationAssume that we want to make a dierence approximation of a transfer function

G�s� ��

s� �

The system is thus described by the dierential equation

dy�t�dt

� ��y�t� � �u�t�

Using forward dierence approximation we get

dy

dt� y�t � h�� y�t�

h� ��y�t� � �u�t�

Rearrangement of the terms gives the dierence equation

y�t� h� � ��� �h�y�t� � �hu�t�

Page 237: Process Control

���� Approximations ���

Con-troller

Set point

Level

Figure ����� Level control of a two�tank system�

Using backward dierence approximation we instead get

dy

dt� y�t�� y�t� h�

h� ��y�t� � �u�t�

or

y�t� ��

� � �h�y�t� h� � �hu�t��

The choice of the sampling interval depends on many factors� For theapproximations above one rule of thumb is to choose

h�c � ���� � ���

where �c is the crossover frequency �in rad�s� of the continuous time system�This rule gives quite short sampling periods� The Nyquist frequency will beabout ���� time larger than the crossover frequency�

Example �����Approximation of a continuous time controllerConsider the process in Figure ������ There are two tanks in the process andthe outlet of the second tank is kept constant by a pump� The control signal isthe in ow to the �rst tank� The process can be assumed to have the transferfunction

Gp�s� ��

s�s � ��������

i�e� there is an integrator in the process� Assume that the system is satisfac�torily controlled by a continuous time controller

Gc�s� � s � ���s � ���

������

We now want to implement the controller using a computer� Using Eulerapproximation gives the approximation

H�q� �

q � �h

� ���

q � �h

� ����

q � � � ���hq � � � ���h

�������

The crossover frequency of the continuous time system ������ in cascade with������ is �c � ��� rad�s� The rule of thumb above gives a sampling period ofabout ��� � ����

Page 238: Process Control

��� Chapter �� Sampled�data Control

0 2 4 6 8 100

1

Output

0 2 4 6 8 100

1

Output

0 2 4 6 8 100

1

Output

0 2 4 6 8 10

−2

2

Input

0 2 4 6 8 10

−2

2

Input

0 2 4 6 8 10

−2

2

Input

a)

b)

c)

Figure ����� Process output and input when the process ����� is controlled by �����and the sampled�data controller ����� when a� h � ��� b� h � ��� c� h � ��� Thedashed signals are the output and input when the continuous time controller is used�

Figure ����� shows the output and the input of the system when it iscontrolled by the continuous time controller ������ and the sampled�data con�troller ������� for dierent sampling times�

� �� Sampled�data PID Controllers

Digital implementation and approximation of the PID controller was discussedin Section ����

� �� Real�time Programming

In connection with the implementation of the PID controller we described thetypical steps in a computer code for a controller� An algorithm can containthe following steps

Precompute

Loop

AD conversion

Compute output

DA conversion

Update controller states

End of loop

It is important to stress the division of the computations into two parts� Ev�erything that can be precomputed for the next sampling instant is done afterthe DA conversion� When the most recent measurements are obtained after

Page 239: Process Control

��� Real�time Programming ��

the AD conversion only the necessary computations are done to calculate thenext control signal� The rest of the calculations� such as update of the statesof the controller� are done during the time to the next sample� Compare thediscussion of the digital implementation of the PID controller in Section ����

To implement one or two controllers in a computer is not any larger prob�lem� In general� we need many more controllers and also a good operatorcommunication� The dierent controllers must be scheduled in time and thecomputer must be able to handle interrupts from the process and the operator�

It is natural to think about control loops as concurrent activities that arerunning in parallel� However� the digital computer operates sequentially intime� Ordinary programming languages can only represent sequential activ�ities� Real�time operating systems are used to convert the parallel activitiesinto sequential operations� To do so it is important that the operating systemssupport time�scheduling� priority� and sharing of resources�

The problem of shared variables and resources is one of the key problemsin real�time programming� Shared variables may be controller coe�cients thatare used in the controller� but they can also be changed by the operator� Itis thus necessary to make sure that the system does not try to use data thatis being modi�ed by another process� If two processes want to use the sameresource� such as input�output units or memory� it is necessary to make surethat the system does not deadlock in a situation where both processes arewaiting for each other� The programming of the control algorithms has tobe done using a real�time programming language� Such languages containexplicit notations for real�time behavior� Examples of real�time languages areAda and Modula���

� � DDC�packages

Most manufacturers of control equipment have dedicated systems that aretailored for dierent applications� DDC�packages are typical products thatcontain the necessary tools for control and supervision� They contain aids forgood operator interaction and it is possible to build complex control schemesusing high level building blocks� The systems are usually centered around acommon database� that is used by the dierent parts of the system� A typicalDDC�package contains functions for

Arithmetic operations

Logical operations

Linearizing

Selectors and limiters

Controllers

Input�output operations

There may be many dierent controllers available� Typical variants are

PID controllers in absolute or velocity form

PID controllers with pulse train output

Cascade controllers

Ratio controllers

Filters

Auto�tuning of controllers

Page 240: Process Control

�� Chapter �� Sampled�data Control

Adaptive controllers

Today it is also more and more common that the user can include algorithmsthat are tailored to the applications� The controllers may then contain complexcomputations�

The operator communication is usually built up around video displays�where the operator can select between overviews or detailed information aboutdierent parts of the process� The operator can also study trend curves andstatistics about the process� The controllers can be switched between auto�matic� manual� and possibly also auto�tuning� The use of DDC�packages hasconsiderably increased the information available and the possibilities for theoperators to run the processes more e�ciently�

� � Summary

In this chapter we have given a short overview of some aspects of sampled�datasystems� It is important to consider the danger of aliasing� All signals mustthus be �ltered before they are sampled� We may look at computers as onlyone new way of making the implementation and don�t take the full advantageof the capacity of the computer� This leads to simple dierence approximationsof continuous time transfer functions� It is� however� important to point outthat using a computer it is also possible to make more complex and bettercontrollers� We can use information from dierent parts of the process� Wecan also make more extensive calculations in order to improve the quality ofthe control�

Page 241: Process Control

A

Laplace transform table

GOAL� To give the basic properties of the Laplace transform�

This appendix gives the basic properties of the Laplace transform in TableA��� The Laplace transform for dierent time functions are given in Table A���

The Laplace transform of the function f�t� is denoted F �s� and is obtainedthrough

F �s� � Lff�t�g �Z �

�e�stf�t� dt

provided the integral exists� The function F �s� is called the transform of f�t��The inverse Laplace transform is de�ned by

f�t� � L��fF �s�g � ���i

Z ��i�

��i�estF �s� ds

���

Page 242: Process Control

��� Appendix A Laplace transform table

Table A�� Properties of the Laplace transform�

Laplace transform F �s� Time function f�t�

� F��s� F��s� f��t� f��t� Linearity

� F �s a� e�atf�t� Damping

� e�asF �s�

f�t � a� t� a � t� a �

Time delay

��

aF� sa

��a � � f�at�

Stretching

� F �as� �a � ��

af

�t

a

�dnF �s�

dsn��t�nf�t� Derivation in s�plane

Z�

s

F ��� d�f�t�

tIntegration in s�plane

��

��i

Z c�i�

c�i�

F����F��s � �� d� f��t�f��t�

F��s�F��s�

Z t

f��� �f��t � � � d� �

Z t

f��t� � �f��� � d�

Convolution

� sF �s� � f�� f ��t�

�� s�F �s���sf�� f ���

�f ���t� Derivation in t�plane

�� snF �s���sn��f�� � � � f �n�����

�f �n��t�

���

sF �s�

s

Z t

f�� � d�

�t���

Z t

f�� � d� Integration in t�plane

�� lims��

sF �s� limt��

f�t� Final value theorem

�� lims��

sF �s� limt��

f�t� Initial value theorem

Page 243: Process Control

���

Table A�� Laplace transform table

Laplace transform F �s� Time function f�t�

� � ��t� Dirac function

��

s� Step function

��

s�t Ramp function

��

s��

�t� Acceleration

��

sn��tn

n�

��

s ae�at

��

�s a��t � e�at

�s

�s a����� at�e�at

� as

ae�t�a

�a

s� a�sin at

��a

s� � a�sinh at

��s

s� a�cos at

��s

s� � a�cosh at

���

s�s a�

a

��� e�at

���

s�� as��� e�t�a

���

�s a��s b�

e�bt � e�at

a � b

��s

�s a��s b�

ae�at � be�bt

a� b

��a

�s b�� a�e�bt sinat

�s b

�s b�� a�e�bt cos at

Page 244: Process Control

��� Appendix A Laplace transform table

Table A�� Laplace transform table cont�d

Laplace transform F �s� Time function f�t�

��

s� ��s �

� � �

sint

� � ��

p�� ��

e���t sin�p�� �� t

� � � te��t

� � ��

p�� � �

e���t sinh�p�� � � t

��s

s� ��s �

� � � � � � � ��p

�� ��e���t sin

�p�� �� t �

� � arctanp�� ��

��� � � �� � t�e��t

� � ��p

�� � �e���t sinh

�p�� � � t �

� � arctanp�� � �

��� � cos t

��a�

s� a���s b�

�pa� b�

�sin�at� � e�bt sin

� arctana

b

��s�

s� a���s b�

�pa� b�

�cos�at � �� e�bt cos

� arctana

b

���

s�s a��s b�

ab

ae�bt � be�at

ab�b� a�

���

�s a��s b��s c�

�b � c�e�at �c� a�e�bt �a� b�e�ct

�b� a��c � a��b � c�

���

�s a�n���

n�tne�at

��s

�s a��s b��s c�

a�b � c�e�at b�c� a�e�bt c�a� b�e�ct

�b� a��b � c��a� c�

��as�

s� a��� t

�sin at

��ps

�p�t

��psF�p

s� �p

�t

Z�

e����tf��� d�

Page 245: Process Control

B

Matrices

GOAL� To summarize the basic properties of matrices�

B�� Introduction

Vectors and matrices are compact ways of notations for describing many math�ematical and physical relations� Matrices are today used in most books onautomatic control� This appendix gives some of the most fundamental prop�erties of matrices that are relevant for a basic course in process control� Formore material on matrices we refer to courses in linear algebra and books onmatrices and linear algebra� A selection of references is given in the end of theappendix� Many authors prefer special notations such as boldfaced notationsor bars over the notations to indicate matrices� From the context there is usu�ally no di�culties to distinguish between scalars and matrices� Of this reasonwe will not use any special notations to separate scalars and matrices� Theonly convention used is that lower case letters usually denote vectors whileupper case letters usually denote general matrices�

In the presentation of the material in the book and in this appendix weassume that the reader has knowledge about the basic properties of vectorsand matrices� such as�

vector� matrix� rules of computations for vectors and matrices� linear de�pendence� unit matrix� diagonal matrix� symmetricmatrix� scalar product�transpose� inverse� basis� coordinate transformations� determinants

We will introduce� eigenvalue� eigenvector� matrix function� and matrix ex�ponential� These are concepts that are very useful in analysis of dynamicalsystems�

To make matrix calculations the program package Matlab can be recom�mended� This is a command driven package for matrix manipulations� Matlabcontains commands for matrix inversion� eigenvalue and eigenvector calcula�tions etc�

���

Page 246: Process Control

��� Appendix B Matrices

B�� Fundamental Matrix Properties

Basic properties of matrices are reviewed in this section�

Computational Rules

Matrices obey the following rules�

A�B � B � A

A� �B � C� � �A� B� � C

A� � � A

Multiplication with scalar � � � ���

��A� � ���A

� A � A

� A � � matrix with zeros

�� ��A � A� �A

�A�B� � A� B

Matrix multiplication�A�BC� � �AB�C

�A�B�C � AC �BC

It has been assumed that the matrices have appropriate dimensions� such thatthe operations are de�ned� Notice that in general AB �� BA� If AB � BAthen we say that A and B commute�

Trace

The trace of a n�n matrix A is denoted trA and is de�ned as the sum of thediagonal elements� i�e�

trA �nXi��

aii

Transpose Matrix

The transpose of a matrix A is denoted AT � The transpose is obtained byletting the rows of A become the columns of AT �

Example B���TransposeLet

A �

�� �� � �

� then

AT �

� � � �� �

Page 247: Process Control

B�� Fundamental Matrix Properties ���

We have the following computational rules�

�AT �T � A

�A� B�T � AT � BT

�A�T � AT scalar

�AB�T � BTAT

If A � AT then A is said to be symmetric�

Linear Independence and Basis

Linear independence of the vectors x� � � � xp of dimension n� � is equivalentwith the condition that

�x� � �x� � � pxp � � �B���

if and only if � � � � � p � �� If �B��� is satis�ed for a nontrivial setof i�s then the vectors are linear dependent�

Example B���Linear dependenceDetermine if the vectors

x� �

�����

� x� �

�����

� and x� �

�����

� are linear dependent� To test the linear dependence we form

�x� � �x� � �x� �

��� � � � ��� � ���� � �� � �

� �

�����

� Rows two and four give the same relation� Row one is the same as row twoplus row four� The system of equations is satis�ed� for instance� when � � ��� � �� and � � ��� This implies that x�� x� and x� are linear dependent�

If n vectors of dimension n � � are linear independent then they constitute abasis� All vectors in the n dimensional space may then be written as a linearcombination of the basis vectors�

Rank

The rank of a matrix A� rank A� is the number of linear independent columnsor rows in A�

Introduce the row �column� operations�

� Exchange two rows �columns�� Multiply a row �column� with a scalar �� �� Add one row �column� to another row �column�

Page 248: Process Control

��� Appendix B Matrices

We then have the property that row or column operations don�t change therank�

Determinant

The determinant is a scalar� that can be de�ned for quadratic matrices� Thedeterminant of A is denoted detA or jAj� The determinant is calculated byexpanding along� for instance� the ith column

detA �nX

j��

�����i�j�j !Aij j

where j !Aij j is the determinant of the matrix obtained from A by taking awaythe ith column and the jth row� The expansion can also be done along one ofthe rows�

Example B���Determinants of low order matricesFor a scalar ��� � matrix� A � #a$ is detA � a� For the �� � matrix

A �

� a�� a��a�� a��

� we get

detA � a��a�� � a��a��

The determinant of a �� � matrix can be calculated using Sarrus rule� Thedeterminant of the matrix

A �

�a�� a�� a��a�� a�� a��a�� a�� a��

� can be calculated by expanding along the �rst row

detA � a�� det !A�� � a�� det !A�� � a�� det !A��

� a���a��a�� � a��a���

� a���a��a�� � a��a���

� a���a��a�� � a��a���

� a��a��a�� � a��a��a�� � a��a��a��

� a��a��a�� � a��a��a�� � a��a��a��

Inverse

A quadratic n � n matrix is invertible or non�singular if there exists a n � nmatrix B such that

A B � B A � I

where I is the unit matrix� B is called the inverse of A and is denoted A���A matrix has an inverse if and only if rank A � n� If A has not an inverse itis singular�

The inverse can for instance be used to solve a linear system of equations

Ax � b �B���

Page 249: Process Control

B�� Fundamental Matrix Properties ��

where A is a n � n matrix� The system of equations has the unique solution

x � A��b

if A is invertible� If b � � in �B��� we get the homogeneous system of equations

Ax � �

If A is non�singular we have only one solution x � � called the trivial solution�However� if detA � � there may exist non�trivial solutions such that x �� ��

Example B���Inverse of �� � systemThe �� � matrix

A �

� a�� a��a�� a��

� has the inverse

A�� ��

detA

� a�� �a���a�� a��

� where

detA � a��a�� � a��a��

Transformation of a System

Let a dynamical system be described by the linear system equations

%x � Ax� Bu

y � Cx �Du

We can introduce new states z � Tx to obtain a transformed system� It isassumed that T is nonsingular such that x � T��z� In the new state variables

%z � T %x � TAx� TBu

� TAT��z � TBu

andy � Cx �Du � CT��z �Du

This de�nes a new system%z � +Az � +Bu

y � +Cz � +Du

where+A � TAT�� +B � TB

+C � CT�� +D � D�B���

For certain choices of T the transformed system will get simple forms�

B�� Eigenvalues and Eigenvectors

A matrix can be characterized by its eigenvalues and eigenvectors� These aresolutions to the equation

Ax � x �B��

Page 250: Process Control

�� Appendix B Matrices

where A is an n � n matrix� x a column vector and a scalar� Equation�B�� should be solved for x and � The vector x is an eigenvector and can beinterpreted as a vector that after a transformation by A is scaled by the scalar� Equation �B�� can be written as the homogeneous system of equations

�I �A�x � �

There exists non�trivial solutions� i�e� x �� �� if

det�I � A� � � �B���

This give rise to a nth order equation in and �B��� thus has n solutions calledthe eigenvalues of A� Equation �B��� is called the characteristic equation of thematrix A� The solutions x are found from �B�� with the eigenvalues obtainedfrom �B����

Example B���Eigenvalues of a �� � matrixFor a �� � matrix we get the characteristic equation

det�I � A� �

����� a�� �a���a�� � a��

����� � � �a�� � a���� �a��a�� � a��a���

� � � trA� detA

� �

There are two solutions

��� �trA�

r

�trA��

� detA

for which the homogeneous equation has solutions x �� ��Consider in particular the case

A �

� ��� �

� This matrix has the eigenvalues � � and � �� The eigenvectors areobtained from the system of equations

�x� � x� � �

��x� � x� � �

andx� � x� � �

��x� � �x� � �

This gives the eigenvectors

x� �

� ���� x� �

� ����

Only the directions of the eigenvectors are determined not their sizes�

There are several interesting connections between properties of a quadraticmatrix A and the eigenvalues� We have for instance�

Page 251: Process Control

B�� Eigenvalues and Eigenvectors ���

� If rank A � n then at least one eigenvalue is equal to zero�

� If rank A � n then no eigenvalue is equal to zero�

� The sum of the diagonal elements is equal to the sum of the eigenvalues�i�e�

trA �nXi��

i

The characteristic equation �B��� can be written as

n � a�n�� � � an � �

The Cayley�Hamiltons theorem shows that every quadratic matrix satis�es itsown characteristic equation i�e�

An � a�An�� � � anI � � I �B���

The connections between rank� determinant and inverse of a matrix is sum�marized into the following theorem�

Theorem B��

Let A be a quadratic matrix then the following statements are equivalent�

�� The columns of A constitute a basis�

�� The rows of A constitute a basis�

�� Ax � � has only the trivial solution x � ��

� Ax � b is solvable for all b�

�� A is nonsingular�

�� detA �� ��

�� rank A � n�

The eigenvectors and eigenvalues can be used to �nd transformations suchthat the transformed system gets a simple form� Assume that the eigenvaluesof A are distinct� i�e� i �� j i �� j� Let X be the matrix with the eigenvectorsas columns� We may then write �B�� as

AX � X" �B���

where

" �

�� �

� ��

� n

� From �B��� we get

X��AX � "

which we can interpret as a transformation with T � X��� Compare �B����It is always possible to diagonalize a matrix if it has distinct eigenvalues�

If the matrix has several eigenvalues that are equal then the matrix may betransformed to a diagonal form or a block diagonal form� The block diagonalform is called the Jordan form�

Page 252: Process Control

��� Appendix B Matrices

Singular values

The singular values �i of a matrix A are de�ned as

�i �pi

where i are the eigenvalues of the matrix ATA� The smallest in magnitudeis called the minimum singular value�

B�� Matrix functions

In the same way as we de�ne functions of scalars� we can de�ne functions ofquadratic matrices�

A matrix polynomial� f�A�� of a matrix A is de�ned as

f�A� � cAp � c�A

p�� � � cp��A� cpI

where ci are scalar numbers�

Example B���Matrix polynomialAn example of third order matrix polynomial is

f�A� � A� � �A� � A� I

If

A �

� � �� �

� then

f�A� �

� � �� �

A very important matrix function in connection with linear dierential equa�tions is the matrix exponential� eA� This function is de�ned through a seriesexpansion in the same way as for the scalar function ex� If A is a quadraticmatrix then

eA � I ���.A �

��.A� �

��.A� �

The matrix exponential has the following properties�

�� eAt eAs � eA�t�s� for scalar t and s

�� eAeB � eA�B only if A and B commute� i�e� if AB � BA�

�� If i is an eigenvalue of A then e�it is a eigenvalue of eAt�

Solution of the system equation

Let a system be described by the system of �rst order dierential equations

dx

dt� Ax� Bu

y � Cx �Du�B���

Page 253: Process Control

B�� Matrix functions ���

The solution of �B��� is given by

x�t� � eAtx��� �Z t

eA�t���Bu��� d�

y�t� � Cx�t� �Du�t��B���

This is veri�ed by taking the derivative of x�t� with respect to t� This gives

dx�t�dt

� AeAtx��� � AeAtZ t

e�A�Bu��� d� � eAte�AtBu�t�

� A

�eAtx��� �

Z t

eA�t���Bu��� d�

�� Bu�t�

� Ax�t� �Bu�t�

The solution thus satis�es �B���� The solution consists of two parts� One isdependent of the initial value� The other part depends on u over the intervalfrom � to t� The exponential matrix plays a fundamental role in the solution�The character of the solution depends of the matrix A and its eigenvalues�The matrix eAt is called the fundamental matrix of the linear system �B����

Computation of Matrix Exponential

There are several ways to compute the matrix exponential

eAt � I �At ���.

�At�� ���.

�At�� � �B����

Since we usually use the matrix exponential in connection with the solutionof the system equation we have multiplied the matrix A by t in �B�����

Series expansion� The most straightforward way to compute the matrixexponential is to use the de�nition in �B����� This method is well suitedfor computer computations� Dierent tricks must be used to speed up theconvergence� See the references� For hand calculations this is usually not agood way� since it is necessary to identify series expansions of e�t� sin��t�� etc�

Use of Laplace transform� It can be shown that the Laplace transformof �B���� is given by

LfeAtg � #sI �A$�� �B����

The right hand side of �B���� can be calculated and the elements in the matrixexponential matrix are obtained by taking the inverse Laplace transform ofthe elements in #sI �A$���

Use of diagonalization� Assume that A can be diagonalized� i�e� we canwrite

A � T��"T

where " is a diagonal matrix� Then

eAt � I � T��"tT ���.

�T��"tT

��T��"tT

��

� T���I �"t�

��.

�"t�� � �T

� T��e�tT

Page 254: Process Control

��� Appendix B Matrices

The matrix exponential of a diagonal matrix is

e�t �

�e��t �

� � �

� e�nt

� where i are the diagonal elements of "�

Use of Cayley�Hamiltons theorem� From Cayley�Hamilton�s theorem�B��� it follows that �At�n can be written as a linear combination of �At�n����At�n�� � � �I � It then follows that all terms in �B���� with exponents higherthan or equal n can be expressed as a linear combination of lower order terms�It is thus possible to write

eAt � �I � ���At� � � �n���At�n�� � f�At� �B����

How to get the coe�cients � � � � �n��� A necessary condition for �B���� tobe satis�ed is that

e�it � f�it� i � � � � � n �B����

where the is are the eigenvalues of A� If the eigenvalues of A are distinctthen �B���� is also a su�cient condition�

If A has an eigenvalue i with multiplicity ki then �B���� is replaced by

�e�it��j� � f �j��it� � j ki � � �B���

where the superscript �j� denotes the j�th derivative of the function withrespect to it� This will give n equations for the n unknown �i�s�

Example B��Distinct eigenvaluesLet

A �

� � ��� �

� For this value of A we get

A� � �IA� � �AA� � I

���

and

eAt � I �At � ��.It� � �

�.At� �

�.It� �

� I��� t�

�.�t�

.�

�� A

�t � t�

�.�

�� I cos t �A sin t

� cos t sin t� sin t cos t

� Using the Laplace transform method we get

#sI �A$�� �

� s ��� s

� ��

� ss���

�s���

� �s���

ss���

Page 255: Process Control

B�� Matrix functions ���

Using the table in Appendix A we can �nd the corresponding time functionsfor each element�

eAt � L���#sI �A$����

� cos t sin t� sin t cos t

� Using Cayley�Hamilton�s theorem we write

eAt � �I � ��At

The eigenvalues of A are � � i and � � �i� Using �B���� we get the twoequations

eit � � � ��i

e�it � � � ��i

which have the solution

� ���

�eit � e�it

�� cos t

�� ���i

�eit � e�it

�� sin t

This gives

eAt � cos t I � sin t A �

� cos t sin t� sin t cos t

Example B��Multiple eigenvaluesLet

A �

��� �� ��

� which has the eigenvalue � �� with multiplicity �� Assume that

eAt � �I � ��At

This gives the conditione�t � � � ��t

Using �B��� giveste�t � ��t

and we get� � e�t � te�t

�� � e�t

Finally

eAt �

� e�t � te�t �� e�t � te�t

� �

��te�t te�t

� te�t

� �

� e�t te�t

� e�t

Page 256: Process Control

��� Appendix B Matrices

B�� References

Fundamental books on matrices are� for instance�

Gantmacher� F� R� ������� The theory of Matrices� Vols I and II� Chelsea� NewYork�

Bellman� R� ������� Introduction to Matrix Analysis� McGraw�Hill� New York�

Computational aspects on matrices are found in�

Golub� G� H�� and C� F� van Loan ������� Matrix Computations� ��nd ed�� JohnsHopkins University Press� Baltimore� MD�

Dierent ways to numerically compute the matrix exponential is reviewed in�

Moler� C� B�� and C� F� van Loan ������� &Nineteen dubious ways to computethe exponential of a matrix�' SIAM Review� � � ��������

Page 257: Process Control

C

English�Swedish dictionary

GOAL� To give proper Swedish translations�

Aactuator st/lldonA�D converter A�D omvandlareadaptive control adaptiv regleringaliasing vikningamplitude functionamplitudfunktion

amplitude marginamplitudmarginal

analog�digital converteranalog�digital omvandlare

argument functionargumentfunktion

asymptotic stability asymptotiskstabilitet

asynchronous net asynkronn/t

Bbackward di�erencebak0tdierens

backward methodbakl/ngesmetoden

bandwidth bandbreddbasis basbatch process satsvis processbias avvikelse� nollpunktsf*rskjut�ning

block diagram blockdiagramblock diagram algebrablockdiagramalgebra

Bode diagram BodediagramBoolean algebra Boolesk algebrabounded input bounded outputstability begr/nsad insignal

begr/nsad utsignal stabilitetbreak frequency brytfrekvensbumpless transfer st*tfri *verg0ng

Ccanonical form kanonisk formcascade control kaskadregleringcausality kausalitetcharacteristic equation

karakteristisk ekvationcharacteristic polynomial

karateristiskt polynomchattering knattercombinatory network

kombinatoriskt n/tcommand signal b*rv/rde�

referenssignalcomplementary sensitivityfunction komplement/rk/nslighetsfunktion

computer control datorstyrningcomputer�controlled system

datorstyrt systemcontrol styrning� regleringcontrol error reglerfelcontrol signal styrsignalcontrollability styrbarhetcontroller regulatorcontroller gain regulatorf*rst/rk�

ningcontroller structure

regulatorstruktur

���

Page 258: Process Control

��� Appendix C English�Swedish dictionary

coupled systems kopplade systemcross�over frequencysk/rningsfrekvens

DD�A converter D�A omvandlaredamped frequency d/mpadfrekvens

damping d/mpningdead time d*dtid� transporttid�tidsf*rdr*jning

decade dekaddecoupling s/rkopplingdelay time d*dtid� transporttid�tidsf*rdr*jning

derivative term derivatatermderivative time derivationstiddeterminant determinantdi�erence equationdierensekvation

di�erential equationdierentialekvation

di�erential operatordierentialoperator

digital�analog converterdigital�analog omvandalare

direct digital control direktdigital styrning

discrete time system tidsdiskretsystem

disturbance st*rningdynamic relation dynamisktsamband

dynamic system dynamiskt system

Eeigenvalue egenv/rdeeigenvector egenvektorerror felexternal model extern modell

Ffeedback 0terkopplingfeedback control 0terkoppladreglering� sluten reglering

feedback system 0terkopplatsystem

feedforward framkoppling�ltering �ltrering�nal value theoremslutv/rdessatsen

�oating control ytande regleringforward di�erence fram0tdierens

free system fritt systemfrequency analysis frekvensanalysfrequency domain approach

frekvensdom/n metodfrequency domain model

frekvensdom/nmodellfrequency function

frekvensfunktionfunction chart funktionsschemafundamental matrix

fundamentalmatrix

Ggain f*rst/rkninggain function f*rst/rkningsfunk�tion

gain margin amplitudmarginalgain scheduling parameterstyr�ning

Hhigh frequency asymptote

h*gfrekvensasymptothold circuit h0llkretshomogeneous system homogent

systemhysterises hysteres

Iidenti�cation identi�eringimplementation implementering�

f*rverkligandeimpulse impulsimpulse response impulssvarinitial value initialv/rde�begynnelsev/rde

initial value theorembegynnelsev/rdesteoremet

input insignalinput�output model

insignal�utsignalmodellinput�output stability

insignal�utsignalstabilitetinstability instabilitetintegral control integrerandereglering

integral term integraltermintegral time integraltidintegrating controller

integrerande regulatorintegrator integratorintegrator saturation

integratorm/ttning

Page 259: Process Control

��

integrator windupintegratoruppvridning

interaction v/xelverkaninterlock f*rreglinginternal model intern modellinverse inversinverse response system ickeminimumfassystem

Llag compensation fasretarderandekompensering

Laplace transform Laplacetransform

lead compensation fasavanceradekompensering

limiter begr/nsare� m/ttningsfunk�tion

linear dependent linj/rt beroendelinear indedendent linj/rtoberoende

linear quadratic controllerlinj/rkvadratisk regulator

linear system linj/rt systemlinerarizing linj/riseringload disturbance belastningsst*r�ning

logical control logikstyrninglogical expression logiskt uttryckloop gain kretsf*rst/rkninglow frequency asymptotel0gfrekvensasymptot

Mmanual control manuell styrningmathematical model matematiskmodell

matrix matrismeasurement noise m/tbrusmeasurement signal m/tsignalminimumphase systemminimumfassystem

mode modmodel based controlmodellbaserad reglering

modeling modellering� modellbyggemultiplicity multiplicitetmultivariable system ervariabeltsystem

Nnatural frequency naturligfrekvens

neper nepernoise brus� st*rningnonlinear coupling olinj/r

kopplingnonlinear system olinj/rt systemnonminimum phase system icke

minimumfassystemNyquist diagram NyquistdiagramNyquists theorem

Nyquistteoremet

Oobservability observerbarhetobserver observerareoctave oktavon�o� control till�fr0n reglering�

tv0l/gesregleringopen loop control *ppen styrningopen loop response *ppnasystemets respons

operational ampli�eroperationsf*rst/rkare

operator guide operat*rshj/lpordinary di�erential equationordin/r dierentialekvation

oscillation sv/ngningoutput utsignal� /rv/rdeovershoot *versl/ng

Pparalell connection

parallellkopplingPetri net Petrin/tphase function fasfunktionphase margin fasmarginalPI�control PI�regleringPID�control PID�regleringPLC programmerbart logiksystempole polpole�placement poleplaceringposition algorithm

positionsalgoritmpractical stability praktiskstabilitet

prediction prediktionprediction horizon

prediktionshorisontprediction time prediktionstidpre�ltering f*r�ltreringprocess processprocess input processinsignalprocess mode processmodprocess output processutsignal

Page 260: Process Control

�� Appendix C English�Swedish dictionary

process pole processpolprocess zero processnollst/lleprogrammable logicalcontrollers programmerbartlogiksystem

proportional bandproportionalband

proportional gain proportionellf*rst/rkning

proportional control proportionellreglering

pulse transfer functionpuls*verf*ringsfunktion

Qquantization kvantisering

Rramp rampramp response rampsvarrank rangratio control kvotregleringreachability uppn0elighetreal�time programmingrealtidsprogrammering

recursive equation rekursivekvation

reference value referensv/rde�b*rv/rde

relative damping relativ d/mpningrelative gain array relativaf*rst/rkningsmatrisen

relay rel/reset time integraltidreset windup integratoruppvrid�ning

return di�erence 0terf*ringsdie�rens

return ratio 0terf*ringskvotrise�time stigtidrobustness robusthetroot�locus rotortRouths algorithm Routhsalgoritm

Ssampled data system tidsdiskretsystem

sampler samplaresampling samplingsampling frequencysamplingsfrekvens

sampling interval samplingsinter�

vallsampling period samplingsperiodselector v/ljaresensitivity k/nslighetsensitivity functionk/nslighetsfunktion

sensor m/tgivare� sensorsequential control sekvensregleringsequential net sekvensn/tseries connection seriekopplingset point b*rv/rde� referensv/rdeset point control b*rv/rdesregle�ring

settling time l*sningstidshift operator skiftoperatorsimpli�ed Nyquists theorem

f*renklade Nyquistteoremetsingle�loop controller

enloopsregulatorsingular value singul/rt v/rdesingularity diagram

singularitetsdiagramsinusoidal sinusformadsmoothing utj/mningsolution time l*sningstidsplit range control uppdelatutstyrningsomr0de

stability stabilitetstability criteria stabilitets�

kriteriumstate tillst0ndstate graph tillst0ndsgrafstate space controller

tillst0ndsregulatorstate space model tillst0ndsmodellstate transition matrix

dynamikmatrisstate variable tillst0ndsvariabelstatic system statiskt systemstationary error station/rt felsteady state error station/rt felsteady state gain station/r

f*rst/rkningsteady state value station/rv/rdestep stegstep response stegsvarsuperposition principle

superpositionsprincipensynchronous net synkonn/tsynthesis syntes� dimensionering

Page 261: Process Control

���

Ttime constant tidskonstanttime delay tidsf*rdr*jningtime domain approachtidsdom/nmetod

time�invariant systemtidsinvariant system

trace sp0rtracking f*ljningtransfer function *verf*ringsfunk�

tiontransient transienttransient analysis transientanalystranslation principle

translationsprinciptranspose transponattruth table sanningstabelltuning inst/llning

Uultimate sensitivity methodsj/lvsv/ngningsmetoden

undamped frequency naturligfrekvens

unit element enhetselementunit step enhetsstegunmodeled dynamics omodellerad

dynamikunstable system instabilt system

Vvector vektorvelocity algorithm

hastighetsalgoritm

Wweigting function viktfunktionwindup uppvridning

Zzero nollst/llezero element nollelementzero order hold nollte ordningens

h0llkrets