You are on page 1of 118

 NASSERELDEEN AHMED KABASHI

 DEPARTMENT OF BIOTECHNOLOGY
ENGINEERING
 nasreldin@iium.edu.my, Tel : Ext. 4524
 Sem II, 2015-2016
 BTE 4416 Bioprocess Control& Instrumentation
PID TUNING
When I complete this chapter, I
want to be able to do the following.
• Explain the performance goals
that seeks to achieve via tuning.
BTE 4416

• Apply a tuning procedure using


the process reaction curve and
tuning correlations.
• Further improve performance by
fine tuning
Sem II, 2015-2016
Open-Loop vs. Closed-Loop Control

Open-Loop Control
Output
Desired Command
Controller System
Output Input

Closed-Loop Control

Desired Output
Controller System
Output -

Sensor
Closed-Loop Control

 Advantages
 automatically adjusts input
 less sensitive to system
variation and disturbances
BTE 4416

 can stabilize unstable systems


 Disadvantages
 Complexity
 Instability

Sem II, 2015-2016


BTE 4416 Trial and Error Technique

Sem II, 2015-2016


Motivating example: level control
Flow in
 The inlet flow
comes from an
upstream process,
and may change
with time
 The level in the
BTE 4416

Flow out tank must be kept


constant in spite of
these changes

If the outlet flow is simply set equal to the inlet


flow, the tank may overflow or run empty
(because of flow measurement errors)

Sem II, 2015-2016


Introducing a level controller
Flow in
 The level controller
(LC) looks at the
SP level (monitoring)
LC
LT

 If the level starts to


increase, the LC
sends a signal to the
BTE 4416

Flow out
output valve to vary
the output flow
(change)

This is the essence of feedback control

Sem II, 2015-2016


Feedback control
 It is the most important and widely
used control strategy
 It is a closed-loop control strategy
BTE 4416

Block diagram
disturbance

comparator manipulated
ysp variable y
+ controller process
– error
set-point controlled
variable

transmitter

Sem II, 2015-2016


Back to level control
Flow in
desired value
(set-point)
transmitter
disturbance

SP

LC
LT
BTE 4416

controller
controlled
variable
(measurement)

process
Flow out

manipulated
variable
Sem II, 2015-2016
More on control jargon
 Input variables : independently stimulate the
system; they can induce change in the internal
conditions of the process
 manipulated (or control) variables u; m  at our disposal
 disturbance variables d  we cannot do anything on them
BTE 4416

 Output variables : measurements y, by which one


obtains information about the internal state of the
system (e.g. temperature, level, viscosity, refractive index)

 States : minimum set x of variables essentials for


completely describing the internal condition of a
process (e.g. composition, holdup, enthalpy)

Sem II, 2015-2016


Process dynamics
 Given a dynamic model of the
process, it investigates the process
response to various input changes

Two elements are necessary:


BTE 4416

• a dynamic model of the process


• a known forcing function

A A

u (t ) Step input u (t ) Pulse input


0 0
0 time 0 b time
Sem II, 2015-2016
Process models: Which?
 We will consider only two classes of
dynamic process models
 state-space models
 input-output models
State-space models can be derived directly from the
 general conservation equation:
Accumulation = (Inlet – Outlet) +
(Generation – Consumption)

They are written in terms of differential equations


relating process states to time  They occur in the
“time domain”
Process models : Which? (cont’d)

 Input-output models completely disregard the


process states. They only give a relationship between
process inputs and process outputs  They occur in
the “Laplace domain”

State-space model Input-output model

d x(t )
 f (x; u; d ; t ) Y (s)  G(s)U (s)
dt
y  h( x) states
U (s) Y (s)
G(s)
output
G (s) is called transfer
function of the process
Linear systems
 In the time domain, a linear system is
modeled by a linear differential equation.
 For example, a linear, nth-order system is:
dn y d n 1 y dy Our assumptions:
an  an 1    a1  a0 y  b u (t )
dtn d t n 1 dt – the coefficients of the
differential equations
are constant
– the output y is equal to
Note the state x
The Laplace-domain representation is possible only for
linear (or linearized) systems
We will assume that the process behavior in the vicinity of
the steady state is linear
First-order systems
Time-domain model Laplace-domain model

( Dividing by a0 )

dy  KP 
P  y  K P u (t ) Y ( s)   U ( s)
dt  P s  1 
 KP is the process steady state gain (it can
be >0 or <0)

 P is the process time constant (it is always >0)

KP
Transfer function of a first-order system: G ( s ) 
P s  1
Response of first-order systems
 We only consider the response to a
step forcing function of amplitude A

The time-domain
response is:
output, y

AKP
 
t

0.632 AKP
y (t )  AK P 1  e  P 
 
P
 
0
It takes  4÷5 time
constants for the
input, u

process to reach the


A

new steady state


0
time
Determining the process gain
 An open-loop test can be performed
starting from the reference steady state:
 step the input to the process
 record the time profile of the measured output
until a new steady state is approached
 check if this profile resembles
BTE 4416

 if so, calculate KP as: y(t )  AK P (1  e t / P )


yss,new  yss,ref  (output )  The gain is a
KP     dimensional
unew  uref  (input )  steady state figure

 The process gain can be determined from


steady state information only
Sem II, 2015-2016
Determining the time constant
 From the same open-loop test:
 determine P graphically (note: it has the dimension of time)


You need dynamic
information to
determine the
process time
output, y

AKP
constant
0.632 AKP
Determining the
values of KP and P
from process data is
 known as process
0 time identification
An alternative approach
 State the identification task as an optimization
problem:
 given a first-order model, find the KP and P values that
allow the model to best-fit the experimental data

 You will need a computer package to perform the


fitting (e.g. Control StationTM, MatlabTM)
BTE 4416

 It is better to step up and down the manipulated


input several times to capture the “true” dynamic
behavior of the process

 Never trust on the “raw” fitting results only! Always


judge the results by superimposing the fitted curve
to the process one

Sem II, 2015-2016


An alternative approach (cont’d)
Example using Control StationTM

Fitting a first-orde r mode l to pla nt da ta


P ro c e s s : w h it e lin e M o d e l: y e llo w lin e
M o d e l: F ir s t O rd e r F ile N a m e : fit _ F O . t x t

55
Process Variable

50
BTE 4416

45

55
Manipulated Variable

50

45

0 500 1000 1500


Time

Sem II, 2015-2016


G a in (K ) = 1 . 5 1 , T im e C o n s t a n t ( T 1 ) = 1 6 9 . 6
S S E : 3 2 .8 8
Extension to nonlinear systems
 Strictly speaking, the gain and time constant
are independent of the operating steady state
for linear systems only
 If a true (i.e. nonlinear) system is being
considered, the excitation sequence must be
BTE 4416

such that the process is not moved too far away


from the nominal steady state

linear nonlinear
y y
K P ,linear  K P ,nonlinear 
 u any steady state  u nominal steady state

Sem II, 2015-2016


Further remarks

“Slow” and “fast”


processes
The time needed
1.0
to approach the
50
0.8 1 new steady state
100
increases with
0.6
increasing P
y/(KPA)

0.4 10 5
Note
P For all P’s, the
0.2
output starts to
change immediately
0.0
after the input has
0 50 100 150 200 been changed
time units
Pure time-delay systems
• Many real systems do not
Plug flow react immediately to
Incompressible fluid excitation (as first order
systems instead do)
• The time needed to
“transport” a fluid property
change from the inlet to the
outlet is:

L : dead time or
P 
v time delay

Examples: transportation lags (e.g. due to pipe length, to recycle, …);


measurement lags (e.g. gaschromatographs)
Pure time-delay systems (cont’d)

The process output is simply


shifted by P units in time with
y (t )
respect to the input
Recorded output

0 P Models
time
Time domain :
BTE 4416

0 , t  P
y (t )  
 x(t   P ) , t   P
u (t )

Applied input Laplace domain :


0 Y ( s)
 e  P s
0 time U (s)
Sem II, 2015-2016
FOPDT systems
first-order
response

The dynamic
output

 behavior of many
real systems can
be approximated
as First Order
Plus Dead Time
(FOPDT)
input

0 time
Modeling a FOPDT system
 The behavior of a pure time-delay system is simply
superimposed to that of a first-order system

d y (t )
P  y (t )  K P u (t   P ) Time domain
dt
BTE 4416

K P e P s Laplace domain


G( s) 
P s  1

Approximating a real system as a FOPDT linear system


is extremely important for controller design and tuning

Sem II, 2015-2016


Second-order systems
d2 y
 Time-domain a2 2  a1
dt
dy
dt
 a0 y  bu (t )

representation:
2
d y dy
 2
2
 2  y  Ku(t )
dt dt
BTE 4416

Laplace-domain representation:
Y ( s) K K = process gain
 2 2
U ( s)  s  2s  1  = natural period
 = damping
Y (s)

K coefficient
U ( s) (1s  1)(  2 s  1)
Sem II, 2015-2016
Underdamped systems

1.8
Open-loop
1.6  = 0.2 response to a
1.4
input step
1.2
0.4 disturbance
0.6
y / (KA)

1.0
BTE 4416

0.8
0.6
0.4
0.2
0.0
0 2 4 6 8 10 12 14 16 18 20
Sem II, 2015-2016
t/
Overdamped systems

1.8
1.6
1.4
1.2
y / (KA)

1.0 1.0
BTE 4416

1.5
0.8 2.0
0.6  = 3.0 Open-loop
0.4 response to a
0.2 input step
0.0 disturbance
0 2 4 6 8 10 12 14 16 18 20
t/
Sem II, 2015-2016
Effect of the damping coefficient
 The value of  completely determines the degree of
oscillation in a process response after a perturbation

>1: overdamped, sluggish response


0 <  < 1 : underdamped, oscillating response
(the damping is attenuated as  decreases)
BTE 4416

<0: unstable system


(the oscillation amplitude grows indefinitely)

Sem II, 2015-2016


The importance of 2nd-order systems
 Control systems are often designed so that the
controlled (i.e., closed-loop) process responds as
an underdamped second-order system

actual trajectory
1.4
1.2
controlled variable
BTE 4416

1.0
0.8
0.6
0.4
desired value
0.2
0.0

Sem II, 2015-2016 0 5 10 15 20 25 30


time units
Inverse-response systems

 There is an
initial inversion
output variable
in the response:
the process
input and output

starts moving
input
away from its
variable
ultimate value
BTE 4416

 The process
output
eventually
heads in the
direction of the
final steady
time state
Sem II, 2015-2016
Inverse-response systems (cont’d)

Inverse response is the net result of two


i) opposing dynamic modes of
ii) different magnitudes, operating on
iii) different time scales
BTE 4416

the faster mode has a small magnitude and is


responsible for the initial, “wrong way” response
the slower mode has a larger magnitude and is
responsible for the long-term, dominant response

Sem II, 2015-2016


Example process: drum boiler
Steam Disturbance :
step increase in the cold
feedwater flowrate

Cold feedwater Output :


level in the boiler
Hot medium

 In the long run, the level is expected to increase, because we


have increased the feed material without changing the heat supply
 But immediately after the cold water has been increased, a drop
in the drum liquid temperature is observed, which causes the
bubbles to collapse and the observed level to reduce
Fundamentals of process
dynamics and control
BTE 4416

Process Control

Sem II, 2015-2016


Feedback control
The process information (y) is fed back to the controller
The objective is to reduce the error signal to zero,
where the error is defined as:

ysp = set point (target value)


e(t )  ysp (t )  y (t ) y = measured value
BTE 4416

disturbance

comparator manipulated
ysp variable y
+ controller process
– error
set-point controlled
variable

transmitter
Sem II, 2015-2016
The typical control problems

 Regulatory control
– the task is to counteract the effect of
external disturbances in order to maintain
the output at its constant set-point
(disturbance rejection)
BTE 4416

 Servo control
– the objective is to cause the output to track
the changing set-point
In both cases, one or more variables are
manipulated by the control system

Sem II, 2015-2016


Material balance control # 1
Liquid holdup control
(level control)

• If the level h tends to


Flow in

increase, the error


SP
(hsp – h) decreases
LC
LT

• The controller sends a


signal to the control
valve actuator
Flow out
• The flow out is
increased
• The level in the tank
decreases
Material balance control # 1 (cont’d)

The controller’s job is to enforce the total mass balance


around the tank, in order to have neither accumulation
nor depletion of liquid matter inside the tank

rate of mass out = rate of mass in


BTE 4416

set by the controller unknown to the controller

The equality is enforced by the controller


 regardless of the value of the level set-point
Sem II, 2015-2016
The task of a process control system
once more...

 Monitoring certain variables that indicate process


conditions at any time (measurements)
 Making rational decisions regarding what
corrective action is needed (current state vs. desired
state)
BTE 4416

 Inducing changes in the appropriate process variables


to improve process conditions (valves to manipulate)

According to what rationale does a


feedback control system work?

Sem II, 2015-2016


On-off control: the simplest one
 The control variable is manipulated according to:

The final control element is either


umax , if e  0
u (t )   completely open/maximum, or
umin , if e  0 completely closed/minimum

Widely used as
output dead
thermostat in
band
domestic heating
systems, refrigerators,
…; also in noncritical
ON
industrial applications
input (some level and heating
OFF time loops)
Summary for on-off control

 Advantages
 simple & easy to design
 inexpensive
 easily accepted among operators
BTE 4416

 Pitfalls
 not effective for “good” set-point control
(the controlled variable cycles)
 produce wear on the final control element
(it can be attenuated by a large dead band, at the expense
of a loss of performance)
Sem II, 2015-2016
Proportional (P) controllers
The control variable is manipulated according to:

u0 is the controller bias


u(t )  u0  KC e(t ) KC is the controller gain

The controller gain can be adjusted (“tuned”) to


BTE 4416

make the manipulated variable changes as sensitive


as desired to the deviations between set-point and
controlled variable

The sign of KC can be chosen to make the controller


output u increase or decrease as the error increases
Sem II, 2015-2016
P-only controllers

u(t )  u0  KC e(t )

The bias u0 is the value of the controller output which, in


manual mode, causes the measured process variable to
maintain steady state at the design level of operation
[e (t )=0] when the process disturbances are at their
BTE 4416

expected values
The bias value is assigned at the controller design level,
and remains fixed once the controller is put in automatic

u  u0  const : at the nominal steady state

Sem II, 2015-2016


P-only controllers (cont’d)

Flow in
70 L/h
u(t )  u0  KC e(t )

Nominal operation:
SP

LC
LT

u must be 60 L/h  if
e = 0 then u0=60 L/h
disturbance
Flow out 60 L/h
BTE 4416

10 L/h
If the disturbance
70 L/h
Flow in
changes to 20 L/h, the
SP
steady state is
LT
LC
maintained only if
u=50 L/h  since
u0=60 L/h, the error must
disturbance
Flow out 50 L/h
be 0
20 L/h
P-only controllers (cont’d)

u(t )  u0  KC e(t )
What if the disturbance changes during the process?
The manipulated input u must change to guarantee
that the process stays at steady state, i.e. u  u
0
BTE 4416

A steady state error e  0 must be enforced by the P-only


controller to keep the process at steady state:
us.s.  u0  KC e(t )  u0

A P-only controller cannot remove off-set


Sem II, 2015-2016
Performance of P-only controllers
Response to a disturbance step change
no control
(KC=0) • Whatever the value of KC,
the offset is reduced with
increasing KC respect to open-loop
operation
controlled variable

• Increasing KC :
the offset is reduced
the system may oscillate
the process response is
off-set speeded up
• Although the open-loop
response may be 1st
set-point
order, the closed-loop one
is not

time
Summary for P-only control

 Advantages
 conceptually simple
 easy to tune (a single parameter is
needed, KC ; the bias is determined from
BTE 4416

steady state information)

 Pitfalls
 cannot remove off-set (off-set is
enforced by the controlled)

Sem II, 2015-2016


PI controllers
P=Proportional , I=Integral

The P controller cannot remove off-set because the only


way to change the controller bias during non-nominal
operations is to cause e  0
The rationale behind a PI controller is to set the “actual”
BTE 4416

bias different from u0 , thus letting the error be zero


The control variable is manipulated according to:
u0 is the controller bias
 1
t

u (t )  u0  K C  e(t )   e(t ) d t  KC is the controller gain
 I 0  I is the integral time
(also called reset time)
integral action contribution

Sem II, 2015-2016


PI controllers (cont’d)

 1
t

u (t )  u0  K C  e(t )   e(t ) d t 
 I 0 

Note that until e  0, the manipulated input keeps on


changing because of the presence of the integral term
BTE 4416

The change in u (t ) will stop only when e = 0

The integral action can eliminate off-set

Sem II, 2015-2016


Performance of PI controllers

Response to a disturbance step change: effect of KC


open-loop The offset is eliminated
(KC=0)
Increasing KC :
the process response is
speeded up
controlled variable

the system may oscillate

 fixed
increasing KC CAUTION
For large
values of the
controller
gain, the
set point closed-loop
response may
time be unstable !
Performance of PI controllers
(cont’d)
Response to a disturbance step change: effect of I

Increasing I :
oscillations are
dampened
controlled variable

KC fixed the process response is


increasing I made more sluggish

CAUTION
For small
values of the
set point integral time,
the closed-
loop response
may be
time unstable !
Summary for PI control
 Advantages
 steady state off-set can be eliminated
 the process response can be considerably
speeded up with respect to open-loop
BTE 4416

 Pitfalls
 tuning is harder (two parameters must be
specified, KC and I)
 the process response becomes oscillatory;
bad tuning may even lead to instability
 the integral action may “saturate”
Sem II, 2015-2016
PID controllers
P=Proportional , I=Integral , D=Derivative
i) If the error if increasing very rapidly, a large deviation
from the setpoint may arise in a short time
ii) Sluggish processes tend to cycle

The rationale behind derivative action is to anticipate


BTE 4416

the future behavior of the error signal by considering


its rate of change
The control variable is manipulated according to:
 1
t
d e(t ) 
u (t )  u0  K C  e(t )   e(t ) d t   D 

  I 0 d t 
derivative action contribution
D is called derivative time
Sem II, 2015-2016
Performance of PID controllers

Response to a disturbance step change

no derivative action Increasing D :


D = 0 the oscillations caused
by the integral action
increasing D are dampened
controlled variable

the process response is


speeded up

CAUTION
Noisy
set-point measurements
may disrupt the
controller
performance !

time
Beware measurement noise !
The derivative action requires derivation of the output
measurement y with respect to time:

d e d( ysp  y )

dt dt
controlled variable
If the measured
output is noisy, its
BTE 4416

time derivative may


be large, and this
causes the
manipulated variable
time to be subject to
+100% manipulated variable
abrupt changes 
+50%
Attenuate or suppress
0 the derivative action
-50%
-100%
Sem II, 2015-2016 time
Summary for PID control

 Advantages
 oscillations can be dampened with respect to PI control

 Pitfalls
 tuning is harder than PI (three parameters must be specified, KC ,
I and D)
BTE 4416

 the derivative action may amplify measurement noise  potential


wear on the final control element

 Use of derivative action


 avoid using the D action when the controlled variable has a noisy
measure or when the process is not sluggish ( P /  P  0.5 )

Sem II, 2015-2016


Controller selection recommendations
 When steady state offsets can be tolerated, use a P-
only controller (many liquid level loops are on P control)

 When offset cannot be tolerated, use a PI controller


(a large proportion of feedback loops in a typical plant are under
PI control)
BTE 4416

 When it is important to compensate for some natural


sluggishness in the system, and the process signal
are relatively noise-free, use a PID controller

Sem II, 2015-2016


Performance assessment
(set-point tracking problem)
P tr = rise time
normalized controlled variable

1.4 tp = time to first peak


1.2 a ts = settling time A “good”
1.05
c decay ratio is
1.0 1/4 (“quarter
0.95
amplitude”
0.8
decay)
a /b = overshoot
0.6
b c /a = decay ratio
0.4 P = period of oscillation
0.2
0.0
0 tr tp 5 10 ts 15 20 25 30
time units
Performance indexes

IAE   e(t ) d t
0
: integral of the absolute value of error

• The controller’s tuning


parameters (KC ; I ; possibly D)
controlled variable

are chosen such that IAE is


minimized
set-point
• Semi-empirical formulae can be
derived based on a FOPDT open-
loop identification
• The optimal controller’s settings
time for load disturbance rejection are
IAE corresponds to the different from those for set-point
shaded area tracking
Tuning guidelines

 Fit a FOPDT model to the process data obtained by


step (or pulse) changes in the manipulated variable
 the process must begin at the nominal steady state
 the sampling rate should be at least ten times faster than
the process time constant
 the measured variable should be forced to move at least ten
BTE 4416

times from the noise band

 Determine initial values for KC , I (and possibly D )


from suggested correlations

 Never ever trust blindly on these settings. Always


refine the tuning on-field

Sem II, 2015-2016


Tuning correlations for PI control
(based on FOPDT open-loop identification)

KC I
IMC for balanced set P Note
P C is the larger
point tracking and K P ( P   P )
of (0.1P )
disturbance rejection and (0.8P )
minimum ITAE for P
0.586
 P /  P 0.916
set point tracking 1.03  0.165 P /  P 
0.929
KP
minimum ITAE for P
0.859
 P /  P 0.977
disturbance rejection 0.674 P /  P 
0.680
KP


ITAE   t e(t ) d t : integral of the time-weighted absolute
0 value of error

Controller tuning can be performed automatically using the


“Design Tools” module of Control Station™
A disadvantage of feedback control
 In conventional feedback control the corrective action for
disturbances does not begin until after the controlled
variable deviates from the set point

If either the cold oil


flow rate or the cold
oil temperature
change, the
controller may do a
good job in keeping
the hot oil
temperature at the
setpoint

What if the pressure of the fuel gas changes?


Plant Disaster
 Avarice Inc., a nearby
chemical plant, recently
experienced an OSHA
recordable when their piping
lines ruptured
 Employees in the vicinity
were scalded by the hot
liquid expelled from the
pipes
Related P&ID

• Excessively high temperatures in the tank outlet caused the downstream pipe
fittings to fail
• A drop in flowrate from the coolant supply tank occurred before the disaster
Proposed Solution

–One Scholar proposes cascade control


–New system will account for future fluctuations in coolant supply flowrate
Cascade Systems
• Cascade Control Systems contain integrated sets
of control loops
Primary Loop: Monitors the control variable
and uses deviation from its setpoint to provide
an output to the secondary loop.
Secondary Loop: Receives its setpoint from
the primary loop and controls the reference
variable accordingly.
Cascade control # 1
TC

master loop
stack gas The performance can be
set point improved because the
fuel control valve will
be adjusted as soon as
PC

slave loop TT
the change in supply
PT pressure is detected
hot oil
fuel gas cold oil

 Two control loops are nested within each other: the


master controller and the slave controller
 the output signal of the master (primary) controller serves as the
set point of the slave (secondary) controller
Benefits of Cascade Control
• Effectively accounts for external
disturbances
• Reduces dead time in variable response
• Compatible with other Control Systems,
such as Feed-Back and Feed-Forward
Control Architectures
Disadvantages of Cascade Control
• Multiple control loops make physical and
computational architecture more complex
• Additional controllers and sensors can be
costly
Cascade control # 2

Fe e d in
• The TC may reject
satisfactorily disturbances
such as reactant feed T
Cooling and composition
w ater out
• If the T of the cooling
Cooling
w ater in
water increases, it slowly
TC
increases the reactor T
• The TC action may be
TT
delayed by dynamic lags in
the jacket and in the reactor
Products out
Cascade control # 2 (cont’d)

Fe e d in

• The performance can be


slave loop improved because the
cooling water rate will be
Cooling adjusted as soon as a
w ater out
change in the jacket
Cooling
temperature is detected
TT
w ater in
• This keeps the heat removal
TC rate at a constant level, and
set point the reactor temperature is
TC
less affected by the
master loop
TT

unknown disturbance

Products out
Tuning a cascade loop
1 Begin with both the master and the slave controllers in
manual
2 Tune the slave (inner) loop for set-point tracking first (the
tuning guidelines presented before can be used)
3 Close the slave loop, and adjust the tuning on line to ensure
good performance
4 Leaving the inner loop closed, tune the master loop for
disturbance rejection (the tuning guidelines presented before
can be used)
5 Close the master loop, and adjust the tuning on line to ensure
good performance
A P-only controller is often sufficient for the slave loop
Summary on cascade control
 It is used to improve the dynamic response of the process
to load disturbances
 It is particularly useful when the disturbances are
associated with the manipulated variable or when the final
control element exhibits nonlinear behavior
BTE 4416

 The disturbances to be rejected must be within the inner


loop
 The inner loop must respond much more quickly than the
outer loop
 Two controllers must be tuned

Sem II, 2015-2016


PID by MATLAB Implement
Example 1
Consider a system with transfer function
T=10K/[(1*2)s^2+ (1+2)s+1+AK]
BTE 4416

Step Response

Change it manually
1.5

Amplitude
0.5

0
0 0.003 0.006 0.009 0.012 0.015 0.018
Time (sec.)

Sem II, 2015-2016


PID by MATLAB Implement
Example 2
Consider a system with transfer function
T=(K*S+Ki)/[S^3+ 3*S^2+(2+K)*S+Ki]
BTE 4416

Sem II, 2015-2016


step response
1.4

1.2

0.8
BTE 4416

y(t)

0.6

0.4

0.2

0
0 1 2 3 4 5 6 7 8 9 10
t

Sem II, 2015-2016


Tuning of PID Controllers

Because of their widespread use in practice, we


present below several methods for tuning PID
controllers. Actually these methods are quite
old and date back to the 1950’s. Nonetheless,
they remain in widespread use today.
BTE 4416

In particular, we will study.


 Ziegler-Nichols Oscillation Method
 Ziegler-Nichols Reaction Curve Method
 Cohen-Coon Reaction Curve Method

Sem II, 2015-2016


(1) Ziegler-Nichols (Z-N)
Oscillation Method

This procedure is only valid for open


loop stable plants and it is carried out
through the following steps
BTE 4416

 Set the true plant under proportional


control, with a very small gain.
 Increase the gain until the loop starts
oscillating. Note that linear oscillation is
required and that it should be detected at
the controller output.
Sem II, 2015-2016
u Record the controller critical gain Kp = Kc and
the oscillation period of the controller output,
Pc.
Adjust the controller parameters according to
BTE 4416

Table 6.1 (next slide); there is some


controversy regarding the PID parameterization
for which the Z-N method was developed, but
the version described here is, to the best
knowledge of the authors, applicable to the
parameterization of standard form PID.

Sem II, 2015-2016


Table 9.1: Ziegler-Nichols tuning using the
oscillation method
BTE 4416

Sem II, 2015-2016


General System
If we consider a general plant of the
form:
K 0e  s  
G0 ( s) 
 0s  1
; 0  0 x  .
0
BTE 4416

then one can obtain the PID settings via


Ziegler-Nichols tuning for different
values of  and 0. The next plot
shows the resultant closed loop step
responses as a function of the ratio
Sem II, 2015-2016
Figure 9.3: PI Z-N tuned (oscillation
method) control loop for different values of
the ratio

x  .
0
0
BTE 4416

Sem II, 2015-2016


Numerical Example

Consider a plant with a model given by


BTE 4416

Find the parameters of a PID controller


using the Z-N oscillation method. Obtain
a graph of the response to a unit step
input reference and to a unit step input
disturbance.
Sem II, 2015-2016
Solution
Applying the procedure we find:
Kc = 8 and ωc = 3.

Hence, from Table 9.1, we have


BTE 4416

The closed loop response to a unit step in


the reference at t = 0 and a unit step
disturbance at t = 10 are shown in the
next figure.
Sem II, 2015-2016
Figure 9.4: Response to step reference and
step input disturbance
BTE 4416

Sem II, 2015-2016


Different PID Structures?

A key issue when applying PID tuning rules (such


as Ziegler-Nichols settings) is that of which PID
structure these settings are applied to.
To obtain an appreciation of these differences we
BTE 4416

evaluate the PID control loop for the same plant in


Example 6.1, but with the Z-N settings applied to
the series structure, we have

Ks = 4.8 Is = 1.81 Ds = 0.45 s = 0.1

Sem II, 2015-2016


Figure 6.5: PID Z-N settings applied to
series structure (thick line) and
conventional structure (thin line)
BTE 4416

Sem II, 2015-2016


Observation
In the above example, it has not made
much difference, to which form of PID
the tuning rules are applied. However,
the reader is warned that this can make
BTE 4416

a difference in general.

Sem II, 2015-2016


(2) Reaction Curve Based
Methods
A linearized quantitative version of a simple
plant can be obtained with an open loop
experiment, using the following procedure:
BTE 4416

1. With the plant in open loop, take the plant manually to a


normal operating point. Say that the plant output settles at
y(t) = y0 for a constant plant input u(t) = u0.
2. At an initial time, t0, apply a step change to the plant input,
from u0 to u (this should be in the range of 10 to 20% of full
scale).

Cont/…

Sem II, 2015-2016


3. Record the plant output until it settles to the new
operating point. Assume you obtain the curve shown
on the next slide. This curve is known as the process
reaction curve.
BTE 4416

In Figure 9.6, m.s.t. stands for maximum slope


tangent.
4. Compute the parameter model as follows

Sem II, 2015-2016


Figure 9.6: Plant step response

The suggested parameters are shown in Table 9.2.


BTE 4416

Sem II, 2015-2016


Table 9.2: Ziegler-Nichols tuning using the
reaction curve
BTE 4416

Sem II, 2015-2016


General System Revisited
Consider again the general plant:

K0e s x  .
G0 ( s)  0
 0s  1
BTE 4416

The next slide shows the closed loop


responses resulting from Ziegler-Nichols
Reaction Curve tuning for different
values of

Sem II, 2015-2016


Figure 9.7:PI Z-N tuned (reaction curve
method) control loop
BTE 4416

Sem II, 2015-2016


Observation
We see from the previous slide that the
Ziegler-Nichols reaction curve tuning
method is very sensitive to the ratio of
delay to time constant.
BTE 4416

Sem II, 2015-2016


Ziegler-Nichols Tuning of PID
Regulators
 J. G. Ziegler and N. B. Nichols
recognized that the step responses of a
large number of processes control
systems exhibits a process reaction
BTE 4416

curve like <fig.1>


 Ziegler & Nichols gave two methods for
tuning the controller
 For a decay ratio of 0.25
 Based on a stability boundary

Sem II, 2015-2016


BTE 4416

Fig.1

Sem II, 2015-2016


Z.-N. Tuning of PID Regulators
Method One

For a decay
ratio of 0.25
BTE 4416

Sem II, 2015-2016


Sample of MATLAB Implement

 Consider a system with transfer


function
T=2/[(S+2)*(0.18*S^2+0.6*S+1)]
With L=0.38;R=1;
BTE 4416

Sem II, 2015-2016


4

2
BTE 4416

3 5

Sem II, 2015-2016


Step Response
1.5

1
BTE 4416

y(t)

0.5

0
0 1 2 3 4 5 6 7 8 9 10
t

Sem II, 2015-2016


Z.-N. Tuning of PID Regulators
Method Two

Based on a
stability
boundary
BTE 4416

Sem II, 2015-2016


(3) Cohen-Coon Reaction
Curve Method

Cohen and Coon carried out further studies to find


controller settings which, based on the same
model, lead to a weaker dependence on the ratio
of delay to time constant. Their suggested
controller settings are shown in Table 9.3:
BTE 4416

Table 9.3: Cohen-Coon tuning using the reaction curve.


Sem II, 2015-2016
General System Revisited
Consider again the general plant:

G0 ( s) 
K0e s x  .
 0s  1 0
BTE 4416

The next slide shows the closed loop


responses resulting from Cohen-Coon
Reaction Curve tuning for different
values of

Sem II, 2015-2016


Figure 9.8: PI Cohen-Coon tuned (reaction
curve method) control loop
BTE 4416

Sem II, 2015-2016


Lead-lag Compensators

Closely related to PID control is the idea


of lead-lag compensation. The transfer
function of these compensators is of the
BTE 4416

form:

If 1 > 2, then this is a lead network and


when 1 < 2, this is a lag network.
Sem II, 2015-2016
Figure 9.9:Approximate Bode diagrams for
lead networks (1=102)
BTE 4416

Sem II, 2015-2016


Observation
We see from the previous slide that the
lead network gives phase advance at 
= 1/1 without an increase in gain. Thus
it plays a role similar to derivative
BTE 4416

action in PID.

Sem II, 2015-2016


Figure 9.10: Approximate Bode diagrams
for lag networks (2=101)
BTE 4416

Sem II, 2015-2016


Observation
We see from the previous slide that the
lag network gives low frequency gain
increase. Thus it plays a role similar to
integral action in PID.
BTE 4416

Sem II, 2015-2016


Illustrative Case Study:
Distillation Column
PID control is very widely used in
industry. Indeed, one would we hard
pressed to find loops that do not use
some variant of this form of control.
BTE 4416

Here we illustrate how PID controllers


can be utilized in a practical setting by
briefly examining the problem of
controlling a distillation column.

Sem II, 2015-2016


Example System
The specific system we study here is a
pilot scale ethanol-water distillation
column.
BTE 4416

Sem II, 2015-2016


Condenser Feed-point Reboiler
Figure 9.11: Ethanol - water distillation
column
A schematic diagram of the column is given below:
BTE 4416

Sem II, 2015-2016


Model
A locally linearized model for this system is as follows:

where
BTE 4416

Note that the units of time


here are minutes.

Sem II, 2015-2016


Summary
 PI and PID controllers are widely used in
industrial control.
 From a modern perspective, a PID controller
is simply a controller of (up to second order)
BTE 4416

containing an integrator. Historically,


however, PID controllers were tuned in terms
of their P, I and D terms.
 It has been empirically found that the PID
structure often has sufficient flexibility to
yield excellent results in many applications.
Sem II, 2015-2016
Homework Assignment 4
 Using Z.-N. method Two to establish
the PID regulator using the same
transfer function above.
 Adjusting the P,I,D value manually to
BTE 4416

establish the most stable output using


the same transfer function above.
 From real Industry give three examples for
usage of P, PI, and PID with explanation to
each (P, PI, and PID)

Sem II, 2015-2016

You might also like