Practical Process Control
Practical Process Control
Safety First:
people, environment, equipment
65 operating constraint
PV & SP (%) 60 set point far from
profit constraint
55
SP
more profit
45
Copyright © 2007
40 poor control = large variation in PV by Control Station, Inc.
All Rights Reserved
Time
50
more profit
40
Copyright © 2007 by Control Station, Inc. All Rights Reserved
Time
Control Objective
Measured Process Variable (PV)
Set Point (SP)
Controller Output (CO)
Manipulated Variable
Disturbances (D) thermostat
controller
set point TC TT
temperature heat loss
sensor/transmitter (disturbance)
control
signal
manipulated
controller output, CO house
controller error fuel flow
signal to furnace valve temperature
e(t) = (SP – PV) to furnace
disturbances
measured temperature (heat loss from home)
process variable signal, PV
Temperature
Copyright © 2007 by Control Station, Inc. Sensor/Transmitter
All Rights Reserved
disturbance, D
measured process variable
signal, PV
Measurement
Copyright © 2007 by Control Station, Inc. Sensor/Transmitter
All Rights Reserved
Measurement Sensors:
temperature, pressure, pressure drop, level, flow,
density, concentration
Automatic Controllers:
on/off, PID, cascade, feed forward, multivariable,
model-based Smith predictor, sampled data,
parameter scheduled adaptive control
Control Objective:
maintain car velocity
Measured Process Variable (PV):
car velocity (“click rate” from transmission rotation)
Manipulated Variable:
pedal angle, flow of gas to engine
Controller Output (CO):
signal to actuator that adjusts gas flow
Set point (SP):
desired car velocity
Disturbances (D):
hills, wind, curves, passing trucks....
manipulated
controller error controller output, CO gas flow rate
e(t) = (SP – PV) signal to gas pedal to car engine car speed
disturbances
measured “click rate” (hills, wind, etc.)
PV signal
SP
PV
CO
PV
SP
where:
PV is the measured process variable
CO is the controller output signal
dPV
p + PV = Kp CO(t θp)
dt
where PV and CO are the total change from initial to
final steady state
PV = 1.0 m
PV 1.0 m m
Kp = –––– = ––––– = 0.1 –––
CO 10% %
CO = 10 %
t PVstart
PV63.2
PV total
63.2% of PV total
t PVstart
PV63.2
P
Copyright © 2007 by Control Station, Inc. All Rights Reserved
t PVstart t 63.2
tPVstart = 4.1
PV63.2 = 2.5
PV = 1.0 m
63.2% of PV total
4.1
PV63.2 = 2.5
4.1 5.7
Өp
tCOstep
t PVstart
Өp = t PVstart — tCOstep
tCOstep = 3.8
t PVstart= 4.1
In Summary
Workshop #1
Exploring Dynamics of Gravity-Drained Tanks
Since the FOPDT model is used for controller design and tuning, a
process should be modeled at a specific design level of operation!
disturbance, D
measured process variable
signal, PV
Measurement
Copyright © 2007 by Control Station, Inc. Sensor/Transmitter
All Rights Reserved
disturbance, D
measured
process variable
signal, PV
On -
Off
Copyright © 2007 by Control Station, Inc. All Rights Reserved
To protect the final control element from wear, a dead band or an upper and
lower set point is used
where:
CO = controller output signal
CObias = controller bias or null value
PV = measured process variable
SP = set point
e(t) = controller error = SP – PV
Kc = controller gain (a tuning parameter)
I = controller reset time (a tuning parameter)
D = controller derivative time (a tuning parameter)
SP
CO signal transmitted
over range of values
this causes the liquid flow rate into the top tank to change,
which ultimately changes the level in the lower tank
CO = CObias + Kc e(t)
where
CO = controller output signal
CObias = controller bias
e(t) = controller error
= SP – PV (or set point – process variable)
Kc = controller gain (a tuning parameter)
A bump test should move the CO far enough and fast enough
such that it generates a clear response in the PV
0.2 p
1.22
Kc =
Kp θp
offset
offset
Big disadvantage:
the controller permits offset
CO = CObias + Kc e(t)
Kc 3Kc 6Kc
CO effort
Copyright © 2007 by Control Station, Inc. All Rights Reserved
As Kc increases:
Control effort increases
Offset decreases
Oscillatory behavior increases
PB = (COmax — COmin)/Kc
PB = 100/Kc
Workshop #2
P-Only Control of Tank Level
where:
CO = controller output signal
CObias = controller bias or null value
PV = measured process variable
SP = set point
e(t) = controller error = SP – PV
Kc = controller gain (a tuning parameter)
I = controller reset time (a tuning parameter)
e(25) = 4
e(40) = – 2
PV
SP
25 40
Time (minutes)
SP
e(40) = –2
0
e(25) = 4
Copyright © 2007 by Control Station, Inc. All Rights Reserved Copyright © 2007 by Control Station, Inc. All Rights Reserved
25 40 25 40
Time (minutes) Time (minutes)
Time (minutes)
Integral sum = 7
Integral sum = – 34
Time (minutes)
When the dynamics have ended, e(t) is constant at zero and the
total integral has a final residual value: 135 – 34 + 7 = 108
At that point, the proportional term equals zero, and the integral
term may have a residual value
Kc
CO = CObias + 0 + (108)
I
Integral acts as
“moving bias” term
Kc
CO= CO
bias
+ Kc e(t) +
I e(t)dt
2 Kc
Kc
Kc/2
I /2 I 2 I
Workshop #4
The Hazard of Tuning PI Controllers by Trial and Error
Kc =
1 p and I = p
Kp (θp + c)
Reset rate (
R ) has units of 1/time or sometimes repeats/minute
The controller can’t regulate the process until the error changes
sign and the integral term shrinks sufficiently so that the CO
value again makes sense (moves between 0 – 100%).
disturbance, D
“Wire In”
PV Signal
CO constant
Copyright © 2007 by Control Station, Inc. All Rights Reserved
NB = 1% PV = 4%
CO bump
Copyright © 2007 by Control Station, Inc. All Rights Reserved
Step Doublet
66 DLO 66 DLO DLO
Pulse PRBS
66 DLO 66 DLO
66 DLO
66 DLO
66 DLO DLO
66 DLO
Desirable aspects:
stays very close to the design level of operation (DLO)
gives smallest maximum deviations of all open loop tests
N
2
SSE = [Measured Datai Model Datai ]
i=1
The smaller the SSE for a given data set, the better the
model describes the data
R2 (also computed by LOOP-PRO) is essentially an SSE
normalized for the number of data points and magnitude of
the data, making it a general “goodness of fit” criterion. The
closer it is to 1, the better the model describes the data.
Set Point (SP) Driven Bump Tests Can Provide Useful Data:
sharp CO
movement
Open and closed loop FOPDT model fits are (essentially) the
same if the controller is tuned to force a sharp CO change
If CO change is very sluggish, or so overly active it produces
sustained PV oscillations, the model fit may not be as good
SP
PV data
sharp CO
Copyright © 2007 by Control Station, Inc. All Rights Reserved
movement
SP constant PV data
PV
D steps
Set point driven FOPDT model matches open loop test data
Disturbance driven model is way off; Kp even has wrong sign
If a disturbance has corrupted a data set, run the test again
Workshop #5
PI Control of Heat Exchanger Temperature
A B C
A = (30 – 20)
= 10%
B = (34.5 – 30)
= 4.5%
C = (31 – 30) A B C
= 1%
Here:
POR = 4.5/10 = 0.45 or 45%
Decay ratio = 1/4.5 = 0.22 or 22%
±5% of PV
PV
Copyright © 2007 by
Control Station, Inc..
All Rights Reserved.
±5% of PV
PV
Copyright © 2007 by
Control Station, Inc..
All Rights Reserved.
trise = 43 – 30 = 13 min
tpeak = 51 – 30 = 13 min
tsettle = 100 – 30 = 70 min
±5% of PV
PV
A B C
Copyright © 2007 by
Control Station, Inc..
All Rights Reserved.
Copyright © 2007 by Control Station, Inc.. All Rights Reserved.
SP
PV
Copyright © 2007 by
Control Station, Inc.
All Rights Reserved.
Copyright © 2007 by
Control Station, Inc.
All Rights Reserved. Copyright © 2007 by
Control Station, Inc.
All Rights Reserved.
settling time
settling time
Auto Correlation
Measures how a signal matches a time-shifted version of itself
Good for separating a signal from noise, detecting trends, and
identifying repeating event patterns within a signal
Potential for monitoring controller performance (research in
progress)
Cross Correlation
Measure of relationship between two different signals, even
when the signals contain noise
Does a CO or disturbance impact several PVs? Compute cross
correlation to determine how strongly signal pairs are related
0.8
PV
0.6
0.4
0.2
0
5 10 15 20 25 30 35
17
period of oscillation (min)
Moving Average
A crude filtering of noisy data to make trends more visible
PV = process variable
n 1
(PV(i k n) SP) 2 SP = set point
i 0
PV(k) = average PV for window k
(k ) n 1 100% i, k = indexes
PV(k ) n = window length
Time
Time
Time
PV
Time
Time
window size = 500 time units
Kc de(t)
CO= CO + Kc e(t) + e(t)dt + Kc D
bias I dt
where:
CO = controller output signal
CObias = controller bias or null value
PV = measured process variable
SP = set point
e(t) = controller error = SP – PV
Kc = controller gain (a tuning parameter)
I = controller reset time (a tuning parameter)
D = controller derivative time (a tuning parameter)
Kc de(t)
CO= CO + Kc e(t) + e(t)dt + Kc D
bias I dt
Independent
de(t)
CO= CO
bias
+ Kc e(t) + Ki e(t)dt + Kd
dt
Know Your
Manufacturer!
error, e(t) = SP PV
PV & SP
= when SP changes
de(t)
PV dt
0
Copyright © 2007
by Control Station, Inc.
All Rights Reserved
Time Time
error, e(t) = SP PV
PV & SP
= when SP changes
de(t)
PV dt
0
Copyright © 2007
by Control Station, Inc.
All Rights Reserved
Time Time
Time
CO “kick”
Heat Exchanger under PID control shows CO kick with derivative on e(t)
Impact of CO kick on PV performance depends on sample time (T) relative
to p (fast/small sample time gives little chance for impact)
But potential for wear on mechanical FCE (e.g., valve) is always a concern
Independent
dPV
CO= CO
bias
+ Kc e(t) + Ki e(t)dt Kd
dt
PV & SP
PV slope changes
during response
Copyright © 2006 by Control Station, Inc. All Rights Reserved
Time
Kc I D
1 p +0.5 θp p +0.5 θp
p θp
Ideal
Kp c +0.5 θp 2 p + θp
1 p
p 0.5 θp
Interacting
Kp
c +0.5 θp
0.5 D D 2 D
Copyright © 2007 by Control Station, Inc. All Rights Reserved.
Time
PV & SP
0.5 D D 2 D
Copyright © 2007 by Control Station, Inc. All Rights Reserved.
Time
2 Kc
Kc/2
0.5D D 2 D
Copyright © 2007 by Control Station, Inc. All Rights Reserved.
Copyright © 2007 by Control Station, Inc. All Rights Reserved.
Time
I /2 I 2 I
For every D… …there is a new grid of Kc and I patterns
SP
slope rapidly
decreasing
PV & SP
slope rapidly
increasing
PV
Time
Slope (derivative) switches direction every sample
This produces alternating CO actions (called “chatter”) from
the PID algorithm
The CO chatter is amplified based on the size of D
Copyright © 2007 Control Station, Inc. All Rights Reserved 155
Noise Degrades Derivative Action
PV & SP Increasing Noise in PV
PV performance
degrades
Copyright © 2007 by
Control Station, Inc.
All Rights Reserved. Because
CO repeatedly
CO
Workshop #7
PID Control of Heat Exchanger Temperature
raw PV
PV
filtered PV
CO
Time
PV
raw PV
filtered PV
CO
Time
Filtered signals lag behind the raw signal (add dead time and
increase time constant)
As filtering increases and the signal becomes smoother, added
dead time decreases best possible control performance
Copyright © 2007 Control Station, Inc. All Rights Reserved 161
External Filters in Control
External filters are individual and separate hardware
or software items in the control loop
SP SP CO CO
+ PID FCE Process
Filter Filter
Final Control
Element
Copyright © 2007 by
Control Station, Inc.
All Rights Reserved PV PV Sensor &
Filter Transmitter
SP & filtered SP
Filter
filtered SP
Copyright © 2007 by
Control Station, Inc.
All Rights Reserved
PV
Time
Set Point Filters
Not used to address PV noise but included for completeness
SP filters smooth out sudden set point changes so they are
fed gradually to the controller
Thus can use an aggressive tuning for disturbance rejection.
Filtered SP changes are fed gradually to the controller, so SP
response performance remains moderate (or conservative
depending on degree of SP filtering)
Disturbance rejection and SP tracking performance can be
different – but must design & implement a SP filter to do this
SP SP CO CO
+ PID FCE Process
Filter Filter
Final Control
Element
Copyright © 2007 by
Control Station, Inc.
All Rights Reserved PV PV Sensor &
Filter Transmitter
SP SP CO CO
+ PID FCE Process
Filter Filter
Final Control
Element
Copyright © 2007 by
Control Station, Inc.
All Rights Reserved PV PV Sensor &
Filter Transmitter
SP CO
+ PI +
PV SP CO
D + PI +
Filter
Copyright © 2007 by
D
Control Station, Inc. PV D
All Rights Reserved Filter
Copyright © 2007 by
Control Station, Inc.
All Rights Reserved
PV
Filter Term
Dependent Interacting Series
D
e(t)dt + Kc D de(t) D dCO
Kc
CO=CO
bias
+Kc 1+ e(t) +
I I dt dt
Filter Term
Kc I D
Workshop #8
PID with CO Filter & Control of the Multi-Tank Process
Direct Acting E = PV - SP E = PV - SP E = PV - SP
2
Update Time 0.01 to 10.23 1 to 32,767
seconds seconds x 100
Notes: 1
0 to 3276.7 in SLC 5/03 and higher processors when the RG bit is set.
2
Divided by 100 for calculations
3
Divided by 1000 for calculations
1
= Where Kd = derivative gain of
T independent algorithm
16 + 1
Kd T = loop sample time
Thus, the larger the Kd, the stronger the filter (the greater the
smoothing)
d2PV dPV
P1 P2 (P1 P2 ) PV KP CO(t P )
dt2 dt
5 7
C oFirst
m pOrder
a r i n g a F i r s t O Cr doSecond
emr pa na Order
rd i nS ge ca o Fn id r s Ot Or d red r e Rr ea sn p d o
c
5 6
P r oProcess
c PV
Process e s s : Response
C u Response
s t o m P r o cWhen
eShapes
ss
Shapes P r oForced
When
When
Forced c eForced
by s sa: Step
C by
u s t oStep
mChange
by P Step
rChange
o c e s s Change C o n tro lle r: M
5 5
o
C o n t ro lle r O u t p u t P ro c e s s V a ria b le
P ro c e s s V a ria b le
60 First Order 60 Second Order
r
5 4
58 58
5 3
56 single arcsingle arc
56 ‘s’ shaped
P
5 2 54 responseresponse
single arc 54 response
‘s’ shaped
5 1 52 response 52 response
50 50
5 0
C o n t r o lle r O u t p u t
4 9
1 7 06 5 1 8 0 2 2 0 6 5 2 3 0
Second order model has an extra derivative with time
0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 1 0 0 1 1 0 1 2 0 1 3 0 1 4 0
4 0 1 5 0 1 6 0 1 9 0 2 0 0 2 1 0 2 4 0 2 5 0 2 6 0 2 7 0 2 8 0 2 9 0 3
e ( t im e u n it s ) T im e
1 6 0 constant 1 8 0 that
1 9 0 enables 2a1 0 gradual 2 3“s”
5 0 shaped 6 0 response
40 150 170 200 220 0 240 250 260 270 280 290 3
0 1 0 2 0 3 0 4 0 7 0 8 0 9
e ( t im e u n it s ) 6 0 60
55 55
50 50
Copyright © 2007 Control Station, Inc. All Rights Reserved 184
Response Shapes of 1st and 2nd Order Models Loop-Pro: Design Too
d Time (SOPDT) Model Fit of Gravity
Loop-Pro: Drained
Design Tools Tank Data
Model: First Order Plus Dead Time (FOPDT) File Name: GDT.txt
78
Loop-Pro: Design Tools
Model: Second Order Plus Dead Time (SOPDT) File Name: GDT.txt
72 5
SOPDT SSE = 0.187
66
R2 = 0.996
a bl e p ul a te d Vari a bl e
4
Pro cess VariMani
60
78 Gain (K) = 0.1213, Time Constant (T1) = 1.55, Dead Time (TD) = 0.6556
Goodness of Fit: R-Squared = 0.9935, SSE = 0.2873
Second order72
model better describes this data set
visually; with
66
lowest SSE; with R-squared closest to 1
Manip ul a te d Vari a bl e
60
50
40
65
Kp = 1 Kp= 2 Kp = –1
60
Cont r ol lCO
e r Outp ut
55
50
60 Kp = 1
P = 0
Process Vari a bl e /S et p oi n t PV
55
slower
50 response
P = 10 P = 25
70
65
60
C ont r ol l eCO
r Outp ut
55
50
60
Kp = 1
delayed
P = 10
PV
55
response
Process Vari a bl e
50
70
65 P = 0 P = 25
60
CO
C ontr ol l e r Outp ut
55
50
overshoot
60
Process Vari a bl e PV
50
inverse
40
L = +20
70
65
L = – 20
60
Contr ol l eCO
r Outp ut
55
50
equal SP steps
DLO 3 = 178 oC
DLO 2 = 163 oC
DLO 1
= 147 oC
Copyright © 2007 by Control Station, Inc. All Rights Reserved
PV data
Model Fit of Set Point Step 2: 155 170 oC
FOPDT model (in yellow) Model Fit of Set Point Step 3: 170 185 oC
PV data
I
1.2 1.2
(Kc) Kc
Gain (Kc) Kc
1 1
Gain,
Controller Gain,
0.8 0.8
Controller Gain
0.6 0.6
Controller
Controller
0.4 0.4
0.2 0.2
0 0
120 130 140 150 160 170 180 190 120 130 140 150 160 170 180 190
Process Variable (PV) Process Variable (PV)
PV PV
- 0.18 Moderate
extrapolate Kc PI Tuning
- 0.16
- 0.14
• (147, - 0.15)
Kc ( % / degrees )
- 0.12 limit Kc
- 0.10
- 0.08
(163, - 0.07)
•
- 0.06
Copyright © 2007 by Control Station, Inc.
•
(178, - 0.05)
- 0.04 All Rights Reserved
PV inside gap,
use moderate
PV outside gap,
use aggressive
At the beginning, the level in the tank is constant, therefore the exit
flow is exactly matching the inlet flow
As the exit flow rate is increased, more liquid is leaving the tank than is
entering, therefore the tank drains.
Reset time, Ti, is held constant throughout the experiment while controller gain, Kc, is
increased across both plots.
2Kc
Kc Base Case
Performance
Kc/2
Ti/2 Ti 2Ti
dPV *
= Kp CO(t θp )
dt
*
PV
Kp , Integrator Gain has units of, CO time
θp ,dead time has units of time
Integrating processes
need not start at a
steady value (steady-
state) before a bump is
made to the CO
y(t2 ) y(t1 )
Slope
t2 t1
Slope -Slope
* 2 1
K =
p CO -CO
2 1
*
Step 2: Calculate Integrator Gain, Kp
c c
c
Workshop #18
PI Control of the Pump Tank Process
inner
disturb, D2 Inner
Disturbance
Copyright © 2007
by Control Station, Inc.
All Rights Reserved
outer primary process variable, PV1
Copyright © 2007
by Control Station, Inc.
All Rights Reserved
outer primary process variable, PV1
Copyright © 2007
by Control Station, Inc.
All Rights Reserved
outer primary process variable, PV1
vapor
hot liquid feed
LC Lsetpoint
flash
valve liquid
liquid
drain
valve position manipulated
to control liquid level
Level must never fall so low that vapor is sent down liquid
drain nor rise so high that liquid enters the vapor line
vapor
hot liquid feed
LC Lsetpoint
flash
valve liquid
liquid
drain
valve position manipulated
to control liquid level
vapor
hot liquid feed
LC Lsetpoint
flash
valve liquid
Fsetpoint
FC
liquid
drain
flow rate manipulated
to control liquid level
constant 86
PV/S et p oi n t
Prim ary PV
set point P-Only
84
reactor exit 84
constant set point
temperature 72
control offset for primary variable
45
Contr ol l e r Outp ut
68
Secondary PV
30
48 48
disturbance disturbance
44
variable steps
44
variable steps
Di s t u rbance
Di s tu rbance
40 40
0 10 20 30 40 0 10 20 30 40
Time (mins) Time (mins)
Tuning: Gain = 1.0, Reset Time = 0.95, Sample Time = 1.0
90
90
88
88
PV/ S etp oi n t
Pri m ary PV
86
86
84 84
set point tracking set point tracking
60
performance 60 performance
40 40
C ontr ol l e r Out p ut
Secondary C O
20 20
0 10 20 30 40 50 0 10 20 30 40 50
Time (mins) Time (mins)
Tuning: Gain = 1.0, Reset Time = 0.95, Sample Time = 1.0
Tuning: Gain = -3.0, Reset Time = 1.71, Sample Time = 1.0
Workshop #11
Cascade Control of Jacketed Reactor
measured
process
set point Final variable
++
Feedback
++
Secondary Primary
+– Controller
Control
Process Process
Element
sensor “disturbance”
vapor
hot liquid feed
LC Lsetpoint
flash
valve liquid
liquid
drain
valve position manipulated
to control liquid level
P
Feed Forward Element
Disturbance Model
Process Model
vapor
hot liquid feed Lsetpoint
LC
flash
valve liquid
liquid
drain
manipulated
variable
measured
process variable
disturbance
variable
FF
constant
set point
disturbance
disturbance variable steps
variable steps
90
88
PV/S et p oi n t
86
60
40
C ontr ol l e r Out p ut
20
0 10 20 30 40 50 60 70 80 90
Time (mins)
PROCESS 11
y1setpoint u1 y1
- CONTROL PV1
+ response to +
+
Process 1
CO1
INTERACT 12
PV1
response to
CO2
INTERACT 21
PV2
response to
CO1
PROCESS 22
CONTROL PV2 +
2
ysetpoint +- u2 response to + y2
Process 2 CO2
PROCESS 11
y1setpoint u1feedback u1total y1
- CONTROL
++
PV1
+ response to +
+
Process 1
CO1
G11( s)
DECOUPLER 12
PV1
INTERACT 12
decoupled from u1decouple PV1
CO2
response to
D12 (s) CO2
G12 ( s)
INTERACT 21
DECOUPLER 21 2
udecouple PV2
PV2
response to
decoupled from
CO1
CO1
G21( s)
D21( s)
PROCESS 22
CONTROL PV2 +
+- +
2
ysetpoint 2
+ response to + y2
Process 2 ufeedback 2 CO2
utotal
G22 ( s)
2. The sensor does not see the result of the control action
cold liquid until the hot liquid travels down the pipe, and this
Fsetpoint dead time makes tight control difficult.
FC
hot liquid
Tsetpoint
TC