Professional Documents
Culture Documents
Simulation of Cascade PID Control and Model Predictive Control for a gas
separation plant by membrane separation
Outer Loop
PID
+
Upper
Controller
PID
+
InnerLoop
InnerLoop
InnerLoop
2. About Plant
11
14
4. System Identification
14
4.1. Introduction
14
15
18
28
5.1. Introduction
28
30
33
35
37
38
38
39
41
41
42
44
46
7.1. Introduction
46
46
46
47
8. Conclusion
51
9. References
52
52
11. Author
52
1. Introduction
This example demonstrates simulation of membrane separation control using
MATLAB&Simulink where a particular gas is extracted from mixed gas consisting of more than
2 components. The process assumes oxygen enrichment, air as mixed gas, and oxygen as an
extracted gas. The controlled object (plant) is a gas separator. The gas separator has functionality
which extracts only a particular gas through permeable membrane. This process produces specific
gas as a product. It controls pressure of gas separator so that concentration level of the particular gas
tracks given set points. Plant indicates simulation model rather than actual unit in this document.
Figure 1 shows flow of the control system described in this example. This figure is a typical flow of
control system design. Plant models are modeled mathematically in a plant modeling. The main
reason why plant model is created is that parametric model is identified from plant model, and
control system is designed based on parametric model. Control system design requires either
parametric or non-parametric models. Parametric model is identified from transient response data in
system identification. In control system design, PID control is designed for inner control system, and
cascade PID control system and Model Predictive Control are designed for outer control system
based on the parametric model. Performance evaluation of the designed control system is performed
through simulations in the evaluation of the control system.
START
Plant Modeling
System Identification
Control Design
PID Control , Cascade PID Control
Model Predictive Control
Evaluation
END
Figure 1. Flowchart of Control System Design
A schematic diagram of gas separator is shown in figure 2. Gas separator separates oxygen from air
by utilizing pressure differences. Here, gas separator is assumed to be connected at tri-level. Gas
extraction method is permeable membrane method utilizing pressure differences. Gas separator has
permeable membrane in the middle. Permeable membrane is assumed to be more permeable with
oxygen than other gas. The upper portion is where gas is to be flown into, and the lower portion is
where gas is permeated through permeable membrane which separates them. By creating pressure
differences between the two, oxygen concentration level becomes higher in the lower portion. Gas in
the lower portion flows into the next gas separator. By repeating this operation, oxygen
concentration becomes higher after going through each gas separator. Gas extracted after permeation
from the third gas separator is the final product. Positive pressure differences can be created by
controlling gas inlet flow and outlet flow, which results in variance of pressures in the upper and
lower portions.
High
Pressure
Agitator
Flow gas
(A)
Material
Part
(C)
Material Inhalation
gas
(D)
Material Emission
gas
(A)
Permeation
Part
(C)
High
Pressure
Permeation
Inhalation gas
Agitator
(A)
(D)
Permeation
Emission gas
(B)
Material
Part
(C)
(D)
High Pressure
Low
Pressure
Selectively
permeable
membrane
(A)
Selectively
permeable
membrane
(A) Pressure
sensor
(C) Inhalation
Control
Valve
Pump
Agitator
Permeation
Part
(D)
(A)
Low
Pressure
Note
(C)
Material
Part
(B)
(B) Density
sensor
Selectively
permeable
membrane
Permeation
Part
(C)
(D)
(A)
(C)
(D)
(B)
Manipulated
variable
switcher (refer 5.2.)
Low
Pressure
Figure 3 shows structure of the control system. This plant controls concentration and pressure. The
upper control system (outer loop) deals with concentration control, while the lower control system
(inner loop) deals with pressure control. The outer and inner controls work in combination to control.
In concentration control, pressure differences are computed for targets for the material and
permeation parts so that emission gas concentration of permeation part of each gas separator tracks
the given set point. Pressure differences are allocated appropriately to set point of pressure in
material and permeation parts by Computing Unit (Refer 5.5.). In pressure control, emission and
inhalation quantities are controlled so that pressure of permeation and material parts tracks set point
given to concentration control. Emission and inhalation quantities vary depending on opening of
each control valve. Computing Unit has functionality to switch between emission and inhalation
whether manipulated value of PID controller that controls whether pressure is positive or negative.
In order to perform this sample model(gas_dyn_mpc.mdl), MATLAB Version 7.9(R2009b),
Simulink 7.4(R2009b) and Model Predictive Control ToolboxTM Version 3.1.1(R2009b) are
required.
Outer Loop
Gas Separator1
Inner Loop
MV1
Outer
Controller
type1:
Cascade PID
type2:
MPC
SV
Computing
Unit
SV1
PID
controller CV
Control Valve
Pressure sensor
MV
MV2
Material Part
MV3
CV
Pressuresensor
PID
controller
+
SV2
MV
Permeation
Part
Control Valve
PV
Density Sensor
Same as above
Gas Separator2
Same as above
Gas Separator3
Inner Loop
Outer Loop
2. About Plant
2.1. Overall Structure of Plant and Control System
Figure 4 shows overall structure of plant and control system. The plant consists of three-level gas
separators. The control system consists of the outer and inner control systems. The outer control
system and Computing Unit assume a program in calculator module of control system that monitors
and controls this plant. PID controller assumes one loop controller or PID control module. The
Computing Unit assumes sequence logic within PID control module. PID controller of the inner
control system has three PID controllers attached to material part of each gas separator unit, and
three controllers for permeation part. The Computing Unit receives pressure difference as set point
from the outer control system, and allocates them to pressure set point of each PID controller.
Computing
Unit
PtW1
Pressure CV
PtW1_ U
SV
Set point of
Oxygen density
Outer Controller
type1:Cascade PID
type2:MPC
PID
L
PtQ1
Pressure CV
Material
Part
PtW2 U
_SV
L
PID
L
L
PID
PtW2
Pressure CV
Permeation
Part
L
Gas
Separator1 U
YAQ1
Oxygen
Density
PtQ2
Pressure CV
PID
L
PtW1
_SV
PtW3
Pressure CV
PID
L
Gas
Separator2 U
YAQ2
Oxygen
Density
L
PtQ3
Pressure CV
Note
PID
L
Sensor
Controlled variable of
outer control (Density)
L
Manipulated variable of
***_SV U outer control
=Set point of
inner control
Control
Valve
Pump
L
Manipulated
variable switcher
(Refer 5.2.)
Controlled variable of
inner control (Pressure)
Control valve of
inner control
Gas
Separator3
YAQ3
Oxygen
U Density
z
Agitator
Control
Pressure Valve
Sensor
Pump
Inhalation
Material Part
area
Emission
Pressure Sensor
Permeation Part
h
Inhalation
area
Emission
Density Sensor
Value
Unit
Symbol
Cross-section area
m2
Area
Area
25
m3
volume ( = h*area)
0.00001
molm-2s-1-1
0.000001
molm-2s-1-1
permeation parts
Separation
mechanism
Solution-diffus
ion
mechanism,
Knudsen
diffusion
Practical example
Oxygen enrichment,
Hydrogen separation,
Helium separation,
Uranium concentration
(gas diffusion method)
(7) Mass transfer coefficients of component A and B are constant and do not vary depending on
conditions such as temperature and pressure.
(8) No chemical change of gas.
(9) Ignore diffusion term of fluid.
(10) Dynamics of gas separator is governed by mass balance equation and ideal gas equation.
(11) There is no back flow of gas between gas separator 1, 2 and 3.
(12) Ignore dynamics within piping.
(13) Gas emission and inhalation solely depend on valve opening, and pump does not have any
impact on them.
(14) Pressure in initial state at time 0 within gas separator equals to air pressure.
(15) Mol fraction in initial state at time 0 within gas separator equals to that of air.
(3-1)
NB
(3-2)
K mB ( PBW ,i
PBQ ,i )
K mA ( PtW x Bi
PtQ y Bi )
PAW,i
[m]
PAQ,i
(Q) Permeation
Part
[Symbol description]
NA: Permeable membrane flow rate of component A [molm-2s-1]
NB: Permeable membrane flow rate of component B [molm-2s-1]
KmA: Mass transfer coefficient of partial pressure standard within membrane of component A [mol
m-2s-1-1]
KmB: Mass transfer coefficient of partial pressure standard within membrane of component B [mol
m-2s-1-1]
PAW,i: Partial pressure of gas component A [] in the material part. Subscript i means surface of
separation, and this applies the following.
PBW,i: Partial pressure of gas component B [] in the material part
PAQ,i: Partial pressure of gas component A [] in the permeation part
PBQ,i: Partial pressure of gas component B [] in the permeation part
PtW: Total pressure of gas in the material part []
PtQ: Total pressure of gas in the permeation part []
xAi: Mol fraction of component A in the material part
yAi: Mol fraction of component A in the permeation part
PmA: Permeable membrane coefficient [molm-1s-1Pa-1]
10
Note: Although modeling is not provided using this model, mass transfer coefficient is inversely
proportional to film thickness, the following equation holds true using permeable membrane
coefficient.
K mA
(3-3)
PmA /
Material Part
Inhalation
W:Emission gas quantity
from the material part
per unit time [mols-1]
F[mols-1]
NB:Permeable
membrane flow
rate of
component A
[molm-2s-1]
XAF:
Mol fraction of
component A in F[-]
Selectively
permeable
membrane
Area[m3]
Permeation
Part
Emission
XAW: mol fraction [-]
Inhalation
Q:Emission gas quantity
from the permeation part
per unit time [mols-1]
NA:Permeable
membrane flow
rate of
component A
[molm-2s-1]
Emission
YAQ: mol fraction [-]
Agitator
[Symbol description]
N: Number of mol in gas
F: material gas quantity flown into the material part per unit time [mols-1]
xAF: Mol fraction of component A in F [-]
W: Emission gas quantity from the material part per unit time [mols-1]
x: mol fraction [-]
y: mol fraction [-]
11
Q: Emission gas quantity from the permeation part per unit time [mols-1]
Area: membrane area [m2]
t: time [s]
P: pressure [Pa]
R: Gas constant 8.314[Jmol-1K-1]
V: Volume in the material part (permeation part) [m3]
[Meaning of subscript]
|t=0: Value at time t=0
tW: All gases in the material part
tQ: All gases in the permeation part
AW: Gas component A in the material part
AQ: Gas component A in the permeation part
dN tW
dt
F W
N A * Area
N B * Area
(3-4)
Considering integral from time 0 to t, it can be expressed by the following equation. This is the
number of mol in the material part at time t.
N tW
t
t t
(F W
N A * Area
N B * Area)dt
N tW
t 0
(3-5)
dN AW
dt
F X AF W X AW
N A Area
(3-6)
Considering integral from time 0 to t, it can be expressed by the following equation. This is the
number of mol of gas component A in the material part at time t.
N AW
t
t t
( F X AF W X AW
N A Area)dt
N AW
PtW
N tW R T / V
(3-8)
12
t 0
(3-7)
X AW
N AW / N W
(3-9)
dN tQ
N A * Area
dt
(3-10)
N B * Area Q
Considering integral from time 0 to t, it can be expressed by the following equation. This is the
number of mol in the permeation part at time t.
N tQ
t
t t
N tQ
t 0
(3-11)
dN AQ
N A Area Q YAQ
dt
N AQ
t
t t
(3-12)
N AQ
(3-13)
t 0
PtQ
N tQ R T / V
(3-14)
X AQ
N AQ / N W
(3-15)
13
4. System Identification
4.1. Introduction
In designing control system, parametric model or non-parametric model of controlled object (plant)
is necessary. Then, parametric model is acquired by employing system identification method to
Simulink model. As control system design requires both outer and inner loops, system identification
is performed for outer and inner loops. Some of the purposes of model acquisition by system
identification of each loop are described in table 3 (refer to figure 3 for outer and inner loops).
Table 3. Purposes of model acquisition by system identification of the outer and inner loops
Purpose
Inner loop
To construct inner loop which can track rapidly change of pressure set points that
the outer loop outputs.
Outer loop
14
START
Purpose
Linearization of plant
Procedure
Tools
Simulink+
Simulink
Control
Design TM
Control
System
Toolbox
Simulink
Simulation
Not OK
Evaluation
OK
END
Figure 9. Purposes of each operation, procedures and tools used in this example
15
TM
Figure 10 shows model used for system identification of the inner loop and PID control parameter
tuning.
Permeation part
PID controller1
Permeation part
PID controller2
Permeation part
PID controller3
Material Part
PID controller1
Material Part
PID controller2
Material Part
PID controller3
Signal Builder
Block
Gas Separator1
Gas Separator2
Gas Separator3
Figure 10. Model used in system identification of the inner loop and tuning of PID control parameter
(gas_dynamics3_ident.mdl)
Simulink(R) Control DesignTM is used for linearization in Simulink. It is possible to specify input and
output points and linearize input and output points in the Simulink Control Design. Although the
inner loop is closed loop structure in figure 10, linearization as a closed loop is possible without
disconnecting closed loop structure (refer to figure 11). GUI of the Simulink Control Design is
shown in figure 11. Linearization results are displayed on GUI such as step response, bode diagram,
impulse response, Nichols diagram, Nyquist diagram, pole-zero map and singular value map and so
on. Figure 11 shows step response in parallel before and after linearization.
16
Input point
GUI of the Simulink Control Design
Output point
It means to cut closed loop.
Example.
Permeation part of Gas separator2
Simplify
Output point
Input point
+
Set
Value
PID
Controller
Plant
Step response of
linearized transfer function
(Blue)
Based on the linearization results from the Simulink Control Design, it is assumed that model
response between input and output points that are order reduced in all loops can be linear
approximation to the some hundredth seconds order, it is considered to be integrated system for
simplicity. Linearized transfer functions of all inner loops are summarized in table 4.
Transfer Function
-0.0008/s
-0.0009/s
(u)
Gas separator 2 material part pressure (y)material part valve opening (u)
-0.0009/s
-0.0008/s
(u)
Gas separator 3 material part pressure(y)material part valve opening (u)
-0.0008/s
-0.0008/s
(u)
17
MV1
Gas separator 1
Set point of pressure
difference between
material part
and permeation part
Gas separator 1
Oxygen concentration
of permeation part
CV2
MV2
Outer
control
system
Gas separator 2
Set point of pressure
difference between
material part
and permeation part
MV3
Gas separator 2
Oxygen concentration
of permeation part
Plant
(including inner loop)
Gas separator 3
Set point of pressure
difference between
material part
and permeation part
DV1
DV2
CV3
Gas separator 3
Oxygen concentration
of permeation part
Figure 12. Manipulated variable, controlled variable, and disturbance of outer loop
Simulate the model in figure 13, and log impact of changes of each manipulated variable on
responses of each controlled variable as time series data. Extract necessary parts from time series
data, and identify extracted data.
18
Permeation part
PID controller1
Permeation part
PID controller2
Permeation part
PID controller3
Material Part
PID controller1
Material Part
PID controller2
Gas Separator1
Gas Separator2
Material Part
PID controller3
Gas Separator3
Signal Builder
Block
Major parts of this model have no significant differences from the model in figure 10, except for the
contents of the Signal Builder Block which create signal for system identification. The settings of the
Signal Builder Block in figure 13 are shown in figure 14.
19
Signal
MV1
MV2
MV3
Name
Gas separator1
Set point of pressure
in material part
Gas separator1
Set point of pressure
in permeation part
Gas separator2
Set point of pressure
in material part
Gas separator2
Set point of pressure
in permeation part
Gas separator3
Set point of pressure
in material part
Gas separator3
Set point of pressure
in permeation part
DV1
DV2
MV1
MV2
MV3
DV1
DV2
Table 5 describes what symbols used in Simulink model of this example mean, including figure 14.
20
Contents
Symbol
Manipulated
PTW1_SV
variable 1 (outer)
PTQ1_SV
Manipulated
PTW2_SV
variable 2 (outer)
PTQ2_SV
Manipulated
PTW3_SV
variable 3 (outer)
PTQ3_SV
Disturbance
F1
XAF1
of plant 1
Controlled
variable 1 (outer)
part of plant 1
Controlled
variable 2 (outer)
part of plant 2
Controlled
variable 3 (outer)
part of plant 3
YAQ1
YAQ2
YAQ3
YAQ1_SV
part of plant 1
Oxygen concentration mol fraction in the permeation
YAQ2_SV
part of plant 2
Oxygen concentration mol fraction in the permeation
YAQ3_SV
part of plant 3
Figure 15 show each manipulated variable and open loop response of each controlled variable
obtained from simulating the model in figure 13.
21
MV1
MV2
Pressure
difference
MV3
DV1
DV2
Oxygen
density
CV3
CV2
CV1
Impact of MV1
Impact of MV3
Impact of MV2
Impact of DV2
Impact of DV1
Figure 16 shows system identification flow of the outer control system using this simulation data.
Items in the flow are described below.
(1) Sampling of simulation data
In this example, system identification is performed from data acquired in simulation not real plant,
the right path is relevant. When acquiring real plant data, the left path is relevant.
(2) Extraction of data
Each manipulated value is considered as step input signal. Extract data should cover proximity of
steady state so that plant transient response is adequately included.
(3) Trimming of abnormal data
Remove essentially impossible data due to noise and so on, so that model should not be impacted by
abnormal data. Abnormal data does not exist such as noise impact in this simulation.
(4) Removal of bias (direct-current component) from data
Remove low frequency disturbance such as bias (direct-current component) which is undesirable for
identification.
22
START
Ex. Transient response by step input
1.Acquiring
real plat data
1.Sampling of
simulation data
2. Extraction of data
Steady state
3. Trimming of
abnormal data
4. Removal of bias
(direct-current component)
from data
Removal
of bias
5. System Identification
END
G( s)
K
exp( Ls )
Ts 1
(4-1)
G( s)
K
s2
2
n
ns
(4-2)
23
same way as general optimization in order to derive highly precise estimate with less number of
estimates.
In this simulation, non-linearity of model, that has time constant varying a few hundred times in
vertical direction of step input, can be observed from figure 15, and although
Upward time constant of step input < Downward time constant of step input
applies, derive upward model of step input.
For example, from simulation results, relationship between manipulated value 2 and control value 2
is shown in figure 17. From figure 17, transfer function is considered to be approximated as first
order delay + dead time system. Initial values of each parameter are gain=0.25(=magnitude of
manipulated value 2(0.1)/magnitude of manipulated value 2(0.4)), time constant=250, and dead time
L=30.
(1) and (2) in figure 18 are Simulink models used for parameter estimation. (3) in figure 19 is GUI
for the Simulink(R) Design OptimizationTM. (4) is graph of evaluation function with GUI (square sum
error). X-axis denotes number of estimation, and y-axis denotes value of evaluation function. (5) is a
graph indicating calculated values from models of estimation data and estimation parameter with
GUI. (4) and (5) are updated dynamically every time estimation is performed. Estimation finishes
when conditions set as optimization option is satisfied. Conditions include tolerance of evaluation
function, maximum estimation number, etc.
24
(1)
first order delay
+dead time system
(2)
Second order delay
system
Figure 18. Models used for first order delay + dead time system, parameter estimation of second
order delay
25
Iterations
(5) Measured and Simulated
Measured
data (gray)
Simulated
data (blue)
If 0<<1 for Second order delay system, overview of step response include vibrations as in figure 20,
and the relationship between parameter of second order system , and parameter: time constant T of
first order system n is assumed to be T= 1/ n. =0.6 is assumed in figure 20.
Display simulation data in graph, derive initial value of n by rough estimation. Relatively good
initial values can be provided by determining initial value referencing figure 21.
26
2
1
Ts 1
1
n
Figure 20. Relationship between first order delay system and second order delay system (01)
(Figure in [4] is partially modified.
2
n
s2
n
27
2
0.1
2
n
From the above, transfer function matrix of the derived model is shown in (4-3). Step response of the
model is shown in figure 22.
Y 1( s )
Y 2( s )
Y 3( s )
s2
0.182
e ( 3.6 s )
313.2 s + 1
0.2348
736.7s + 1
9.2372 * 10 -7
0.0032s + 3.4489 *10 -6
0
0.2462 ( 43.8 s )
e
205.5s + 1
3.641 * 10 -6
s 2 + 0.0071 s + 1.23 *10 -5
0
0
0.2884 (
e
234.2s + 1
(4-3)
MV2
MV1
MV3
CV1
CV2
CV3
28
U 1( s )
U 2( s )
41s )
U 3( s)
Item
Description
Epexegesis
Structure of
control
Cascade
PID Control
Improvement of
tracking Set Value
There is no
norm of
control.
It is not an optimizing
control of the entire plant.
The stress given to the
plant is not evaluated
enough.
Entire optimization of
multi variable
control system
incidence
Optimality
Interference
Improvement item
by MPC installation
Expecting effect
by MPC installation
Running cost reduction
Stabilization of control
Reduction of stress to plant
29
Function
Outer control
system
(position type)
concentration in the
separator.
Multivariable Model
Same as above
Same as above
Predictive Control
Inner control
system
type)
of oxygen concentration in
30
In the loop 1, when W (emission gas flow in the material part) increases, total pressure, PtW
decreases, then proportional gain of PID controller is negative. In the loop 2, when Q (emission gas
flow in the permeation part) increases, total pressure, PtQ decreases, then proportional gain of
controller is negative. In the loop 1 and 2, set points are supplied by the outer control system.
Set
point
loop1
Outer Control
System
Set point1
Sign of MV
of PID Controller
1
PID
controller
Manipulated
Variable
Switcher
0
ABS
Set point2
Absolute
Gas separator
Material part
Pressure
Sensor
Inhalation
control valve
W: Emission gas
quantity of
material part [mols-1]
Total Pressure
PtW
F: Inlet gas
quantity [mols-1]
Emission
control
valve
Selectively
permeable membrane
Permeation part
Pressure
Sensor
loop2
Manipulated
Variable
Sign of MV Switcher
of PID Controller
1
PID
controller
0
ABS
Total Pressure
PtQ
Inhalation
control valve
Density
Sensor
Absolute
Q: Emission gas
quantity of
permeation part [mols-1]
Emission
control
valve
In this model, structure of PID control adds rate limits, upper and lower limits to outputs
(manipulated variable) of basic position PID controller (see figure 25). Structure of PID controller is
common for both outer loop and inner loop. Upper and lower limits, and rate limits of all PID
controller are shown in table 7.
Table 7. Upper and lower limits and upper and lower rate limits of PID Controller
Parameter Name
Value [%]
MV upper limit
20
MV lower limit
-20
10
-10
31
Plant
PID Controller
Inside of subsystem
Integral Time
Proportional
Gain
Integrator
Upper and
lower limit
Rate
limiter
Derivative
Time
Appropriate
Differential
Operator
PID control parameter is derived using Ziegler-Nichols Method. An example of PID control
parameter using Ziegler-Nichols Method is displayed in table 8. Additionally, results applying
tuning visually from simulation results are shown in table 9.
Table 8. Example of PID control parameters using Ziegler-Nichols Method [2]
Control law
Proportional gain Kp
Integral time Ti
Derivative time Td
PI Control
0.833*(frequency of
stability limit)
Transfer
Proportional
Integral time
Derivative
Function
gain
-0.0008/s
-20
67
-0.0009/s
-17
67
-0.0009/s
-20
67
-0.0008/s
-20
67
time
32
-0.0008/s
-30
67
-0.0008/s
-30
67
Y 1( s )
G11 (s )
U 1( s )
Y 2( s )
G 21 (s) G 22 ( s )
U 2( s )
Y 3( s )
Figure 26 shows structure of cascade PID control. PID controller (outer) and PID controller (inner)
are double structure. The outer loop behavior is as follows:
PID controller (outer) outputs pressure difference SV (Set point) as manipulated variable so that
emission concentration in the permeation part of each gas separator is controlled to follows SV(Set
point). Computing unit(refer 5.5.) assigns pressure difference SV(Set point) that PID controller
(outer) outputs as SV(Set point) of pressure for the material and permeation parts of gas separator.
The inner loop behavior:
The inner loop controls emission and inhalation value to control to follow pressure SV (Set point) of
pressure provided from Computing Unit.
33
Outer loop
Y1
SV of density
in gas separator1
SV of pressure
in material part of
gas separator1
Computing unit
U1
PID controller
(outer)
SV of pressure
difference between
material part and
permeation part
In gas separator1
Inner loop
SV of pressure
in permeation part of
gas separator1
PID controller
(inner)
+
+
+
Base pressure
[atm]
Y2
PID controller
(outer)
SV of pressure
in material part of
gas separator2
U2
1/2
SV of pressure
difference between
material part and
permeation part
In gas separator2
+
1.0
+
SV of density
in gas separator3
U3
PID controller
(outer)
SV of pressure
difference between
material part and
permeation part
In gas separator3
PID controller
(inner)
Manipulated
variable
switcher
CV of density
in permeation
part of gas separator1
Manipulated
variable
switcher
1.3
Base pressure
[atm]
Base pressure
[atm]
Y3
1.3
Base pressure
[atm]
1.0
SV of density
in gas separator2
PID controller
(inner)
1/2
+
Manipulated
variable
switcher
SV of pressure
in permeation part of
gas separator2
PID controller
+
(inner)
Manipulated
variable
switcher
SV of pressure
in material part of
gas separator3
Manipulated
variable
switcher
1/2
+
PID controller
(inner)
plant
CV of density
in permeation
part of gas separator2
1.3
Base pressure
[atm]
SV of pressure
in permeation part of
gas separator3
PID controller
+
(inner)
1.0
+
Manipulated
variable
switcher
CV of density
in permeation
part of gas separator3
Base pressure
[atm]
PID parameters of cascade PID controller are derived from CHR method.
If plant can be expressed as transfer function of first order delay + dead time system, an example of
CHR method parameters are shown in table10.
G( s)
K
exp( Ls )
Ts 1
Overshoot
None
Control law
PI Control
34
Proportional
Integral
Derivative
gain Kp
time Ti
time Td
0.35T/KL
1.17T
The results obtained from applying CHR method to transfer function of the outer system are shown
in table 11.
Gas Separator
manipulated value 1 (y)
Transfer Function
Proportional
Integral
Derivative
gain
time
time
0.182
exp( 3.6 s )
313.2s 1
167.3
366.4
0.2462
exp( 43.8s )
205.5s 1
6.67
240.4
0.2884
exp( 41s )
234.2 s 1
6.93
274.0
Upper and lower limits, and rate limits of all cascade PID controller (outer) are shown in table 12.
Table 12. Upper and lower limits, and upper and lower rate limits
Value
MV upper limit
MV lower limit
0.05
-0.05
35
Outer loop
Computing unit
U1
SV of pressure
in material part of
gas separator1
PID controller
(inner)
1/2
+
SV of density
in each
gas separators
SV of pressure
difference between
material part and
permeation part
In gas separator1
Y1
Inner loop
SV of pressure
in permeation part of
gas separator1
PID controller
(inner)
+
+
+
U2
Base pressure
[atm]
+
SV of pressure
in material part of
gas separator2
1/2
Y2
SV of pressure
difference between
material part and
permeation part
In gas separator2
+
+
Base pressure
[atm]
+
1/2
+
Y3
SV of pressure
difference between
material part and
permeation part
In gas separator3
PID controller
(inner)
CV of density
in permeation
part of gas separator1
Manipulated
variable
switcher
SV of pressure
in permeation part of
gas separator2
PID controller
+
(inner)
Manipulated
variable
switcher
SV of pressure
in material part of
gas separator3
PID controller
(inner)
+
Manipulated
variable
switcher
plant
CV of density
in permeation
part of gas separator2
1.3
Base pressure
[atm]
1.0
+
Manipulated
variable
switcher
1.3
Base pressure
[atm]
1.0
U3
1.3
Base pressure
[atm]
1.0
Model
Predictive
Controller
Manipulated
variable
switcher
SV of pressure
in permeation part of
gas separator3
PID controller
+
(inner)
Manipulated
variable
switcher
Base pressure
[atm]
CV of density
in permeation
part of gas separator3
Figure 27. Control structure of Model Predictive Control (Outer system) and PID control (Inner
system)
Design parameters for Model Predictive Control system and its design basis are shown in table 13.
See chapter 6 for details of Model Predictive Control in MATLAB.
Table 13. Design parameters for Model Predictive Control system and its design basis
Time related parameter
Value
Design basis
Control interval
60 [seconds]
Prediction horizon
20 [samples]
Control horizon
10 [samples]
of prediction horizon.
36
Variable
Variable
Weight
type
Rate
Design basis
Weight
Manipul
U12
ated
U34
variables
U56
Output
YAQ1
10
variables
YAQ2
1000
(Controlled
YAQ3
10000
Variables)
Variable type
Variable
Constraints
Design basis
Manipulated
U12
variables
U34
U56
YAQ1
No constraints
variables
YAQ2
No constraints
YAQ3
37
manipulated variable is added to the base pressure in the material part, and half of the manipulated
variable is subtracted from the base pressure in the permeation part. The base pressure in the
material part is 1.3[atm], and 1.0[atm] in the permeation part. This is because it assumes the case
where outer control system is stopped and control is performed only by the inner control system. For
example, they are transient state such as launching and stopping plant, and malfunction of the outer
control system and maintenance.
Functionalities of Computing Unit are the same for cascade PID control and Model Predictive
Control.
Model Predictive
Controller output
(Manipulated Value)
U
Gas separator
Base pressure
1.3[atm]
Base pressure
1.0[atm]
Material part
Permeation
part
38
(1) in figure 29 sets control structure of Model Predictive Control system to be designed. (2) sets
inequality constraints of Model Predictive Control system to be designed. There are upper and lower
limits and rate limit constraints of manipulated variables, and upper and lower limits of controlled
valriables in inequality constraints. (3) sets control interval of Model Predictive Control system to be
designed, prediction horizon, control horizon and so on. (4) sets weight factor within the cost
function of Model Predictive Control system to be designed.
Model Predictive Control system described in chapter 6 refers to Model Predictive Control (MPC)
Toolbox.
MPC Structure Overview
(2)
Constraints
(1)
Manipulated
Variables
Controlled
Variables
Weight Tuning
(4)
39
Figure 30. Block Diagram of a SISO Model Predictive Control Toolbox Application [3]
Symbol
d
Description
Unmeasured disturbance. Unknown but for its effect on the plant output. The controller
provides feedback compensation for such disturbances.
Manipulated variable (or actuator). The signal the controller adjusts in order to achieve
its objectives.
Output (or controlled variable). The signal to be held at the setpoint. This is the true
value, uncorrupted by measurement noise.
40
u (k k ), K u ( k p 1 k ) ,
y (k k ),Ky (k p 1 k ) within the constraints. The procedures for dynamic optimization is shown
to the left in figure 31. To the right, prediction horizon and control horizon are described.
Procedure of MPC
Dynamic optimization
,M
repeat
present(k)
41
The model of the plant is a linear time-invariant system described by the equations (6-1).
x k 1 Ax k Buu k Bv v k Bd d k
ym k Cm x k Dvm v k Ddm d k
yu k Cu x k Dvu v k Ddu d k Duuu k
(6 1)
where x(k) is the nx-dimensional state vector of the plant, u(k) is the nu-dimensional vector of
manipulated variables (MV), i.e., the command inputs, v(k) is the nv-dimensional vector of measured
disturbances (MD), d(k) is the nd-dimensional vector of unmeasured disturbances (UD) entering the
plant, ym(k) is the vector of measured outputs (MO), and yu(k) is the vector of unmeasured outputs
(UO). The overall output vector y(k) collects ym(k) and yu(k).
6.5. Optimization Problem
Assume that the estimates of x(k), xd(k) are available at time k. Model Predictive Control
action at time k is obtained by solving the optimization problem.
where the subscript ( )j denotes the j-th component of a vector, (k+i|k) denotes the value
predicted for time k+i based on the information available at time k; r(k) is the current sample of the
output reference, subject to with respect to the sequence of input increments
{u(k|k),,u(m-1+k|k)} and to the slack variable , and by setting u(k)=u(k-1)+u(k|k)*, where
u(k|k)* is the first element of the optimal sequence.
42
min
u k k ,..., u m 1 k k ,
p 1
y
i 1, j
i 0
nu
ny
y j k i 1k
rj k
i 1
j 1
(6-2)
nu
u
i, j
uj k
ik
u
i, j
j 1
uj k
ik
u jt arg et k
j 1
u j min i
V j min i u j k i k u j max i
V j max i
u
u
u j min i
V j min i
uj k ik
u j max i
V j max i
y
y
y j min i
V j min i y j k i 1 k y j max i
V j max i
u j k h k 0, h m,..., p 1
0
i 0,..., p 1
(6-3)
with respect to the sequence of input increments {u(k|k),,u(m-1+k|k)} and to the slack variable
, and by setting u(k)=u(k-1)+u(k|k)*, where u(k|k)* is the first element of the optimal sequence.
When the reference r is not known in advance, the current reference r(k) is used over the whole
prediction horizon, namely r(k+i+1)=r(k) in Equation (6-3).
i, j
, w u i, j , w yi, j are nonnegative weights for the corresponding variable. The smaller w, the less
important is the behavior of the corresponding variable to the overall performance index.
u j, min , u j, max , u j, min , u j, max , y j, min , y j, max are lower/upper bounds on the corresponding
variables. In Equation (6-3), the constraints on u, u, and y are relaxed by introducing the slack
0 . The weight
variable
with respect to input and output weights, the more the constraint violation is
The larger
V u min , V u max , V
min
,V
max
concern for relaxing the corresponding constraint; the larger V, the softer the constraint.
V=0 means that the constraint is a hard one that cannot be violated. By default, all input constraints
are hard V
V y min
min
V y max
problem (for instance, because of unpredicted disturbances, model mismatch, or just because of
numerical round off).
43
u ( 0)
ut arg et (0)
u ( p 1)
ut arg et ( p 1)
J ( z, )
u ( 0)
L
u ( 0)
ut arg et (0)
u ( p 1)
ut arg et ( p 1)
u ( 0)
W
(6-4)
u ( p 1)
u ( p 1)
y (1)
r (1)
y ( p)
r ( p)
y (1)
r (1)
y( p)
r ( p)
V y min (1)
y min (1)
y (1)
L
L
y min ( p)
u min (1)
min
( p)
y( p)
L
y max ( p ) V y max ( p)
min
(1)
u ( 0)
u max (1)
u min (1)
min
u
min
u max ( p 1)
u ( 0)
(1)
u max (1)
L
u
min
max
u
( p 1)
max
(1)
max
( p 1)
u ( p 1)
( p 1)
(6-5)
u ( p 1)
( p 1)
L
u min ( p 1)
V u max (1)
L
u min ( p 1)
V y max (1)
y max (1)
u max ( p 1)
J ( z, ) U T W 2 uU
U TW 2
Y T W 2 yY
(6-6)
Ymin
Ymax
U min
U max
U min
(6-7)
U max
44
u ( 0)
u t arg et (0)
u ( p 1)
u t arg et ( p 1)
u ( 0)
(6-8)
u ( p 1)
Y
y (1)
r (1)
y ( p)
r ( p)
V y min (1)
y min (1)
Ymin
V y min ( p )
y min ( p )
V u min (1)
u min (1)
U min
V u min ( p 1)
u min ( p 1)
u min (1)
min
(1)
min
( p 1)
U min
u min ( p 1)
y max (1)
V y max (1)
L
Ymax
y max ( p )
V y max ( p)
V u max (1)
u max (1)
U max
u max ( p 1)
u max (1)
V u max ( p 1)
V
max
(1)
max
( p 1)
(6-9)
U min
u max ( p 1)
45
Computing
Unit
Cascade
PID
Controller
Data storing part
Cascade
PID
Controller
Permeation part
PID controller1
Permeation part
PID controller2
Permeation part
PID controller3
Material Part
PID controller1
Material Part
PID controller2
Signal Builder
Block
Gas Separator1
Gas Separator2
Material Part
PID controller3
Gas Separator3
46
Permeation part
PID controller1
Permeation part
PID controller2
Permeation part
PID controller3
Material Part
PID controller1
Material Part
PID controller2
Signal Builder
Block
Gas Separator1
Gas Separator2
Material Part
PID controller3
Gas Separator3
47
that manipulated variable of cascade PID controller is at the upper limit in (1) of figure 37. The
cascade PID control shows that the ability to make oxygen of more than 95% concentration set here
can not be obtained.
Manipulated variable of cascade PID control always stick to the upper limit within of the upper and
lower limits of manipulated variable, 0~1.5[atm].Manipulated variable of the upper and lower limits
of Model Predictive Control is 0~1[atm], and manipulated variable of Model Predictive Control
fluctuate within the range, stress put on the plant is lower in Model Predictive Control.
In Model Predictive Control, set point tracking control is achieved within the upper and lower limits
of the manipulated variables.
Weight factor of set point tracking of the gas separator 3 is weighted and set point tracking of the gas
separators 2 and 3 are lowered for Model Predictive Control in the design of cost function. Figure 35
shows that set point tracking is the best in the gas separator 3, followed by the gas separator 2 and 1,
respectively, which confirms behavior in accordance with the design concept. It also shows that the
ability to make oxygen with more than 95% concentration can be achieved in the current Model
Predictive Control performance. Weight factors for the manipulated variables 1, 2 and 3 are
minimized for large behavior range in the cost function. Each manipulated variables indicates larger
behavior range for control value set point tracking. As impact of disturbance (figure 38) is not so
significant for both cascade PID control and Model Predictive Control, it can be considered as good
for disturbance absorbability.
In conclusion, Model Predictive Control is considered to have the better control performance in this
example. However, this cascade PID control is simple and there are some possibilities for improved
control performance using feedforward and decoupling and so on.
48
Windup
(2)
(3)
Windup
49
Manipulated Variables
(1)
50
Disturbance
8. Conclusion
This example shows simulation for gas separator process control using permeable membrane in
Simulink.
The control object (plant) is gas separator. Plant model is created on a formula basis using Simulink,
and as control system for the plant, cascade PID control and Model Predictive Control are compared.
Control system for the gas separator process control consists of combination of the outer and inner
control systems (cascade control). Outputs of the outer control system is manipulated variables that
is set points to track controlled variables of inner control system.
The procedures for simulation are as follows:
(1) Plant modeling
Governing rules of the plant are assumed and modeled on a formula basis. The governing rules are
derived from mass balance equation and ideal gas equation.
(2) System identification
Identify parametric model from plant input and output response in time domain.
(3) Control system design (PID control, Model Predictive Control)
Design of PID control for the inner control system, and cascade PID control and Model Predictive
51
Control for the outer control system. The control object is the above parametric model.
(4) Evaluation of Control System
Performance of designed control system is evaluated in some diagram. Validity of Model Predictive
Control is confirmed in this example for multi-inputs multi-outputs system.
Plant model and control system in this example can be created in MATLAB&Simulink and
simulated. Logics of MATLAB&Simulink can be changed and extended as a more detailed model,
and improved gradually, a larger system can be constructed. It is also possible to embed
experimental equation or table format if processes are difficult to equate theoretically. Efficient and
intuitive modeling is possible in Simulinks graphical environment.
9. References
[1] Kenji Hashimoto and Fumimaru Ogino, Todays Chemical Engineering, Sangyo-Tosho (2001)
[2] Iori Hashimoto, Shinji Hasebe and Manabu Kano, Process Control Engineering, Asakura
Publishing Co., Ltd. (2002)
[3] Model Predictive Control Toolbox Users Guide Version 2 The Mathworks, 2004
[4] Shuichi Adachi, Control Engineering using MATLAB, Tokyo Denki University Press (1999)
11. Author
Hiroumi Mita
hiroumi.mita@mathworks.co.jp
Principal Application Engineer
AEG
The MathWorks Inc.
52
MATLAB and Simulink are registered trademarks of the MathWorks, Inc. All other names such as products are trademarks or registered trademarks of
respective owners. Reprint, copy or reproduction of the whole or any part of this material is prohibited. The contents of this material may be altered
without prior notice.
53