Post on 15-Mar-2020
transcript
MATLAB®&Simulink® Sample Model Description ― Simulation of Cascade PID Control and Model Predictive Control for a gas
separation plant by membrane separation ―
UpperController
PID
PID+-
+-
InnerLoop
Outer Loop
InnerLoop
InnerLoop
Simulation of Cascade PID Control and Model Predictive Control for a gas separation plant by membrane separation
1. Introduction 3
2. About Plant 5
2.1. Overall Structure of Plant and Control System 5
2.2. Gas Separator 7
2.3. About Membrane Separator 8
3. Introducing Mathematical Model 8
3.1. Introduction of Mathematical Model of Permeable Juxtamembrane 9
3.2. Introduction of Mathematical Model for Gas Separator 11
3.3. Mathematical-Based Simulink Model 14
4. System Identification 14
4.1. Introduction 14
4.2. Identification of Inner Loop 15
4.3. Identification of Outer Loop 18
5. Control System Design 28
5.1. Introduction 28
5.2. Inner Control System Design ~ PID Control 30
5.3. Upper Control System Design ~ Cascade PID Control 33
5.4. Outer Control System Design ~ Model Predictive Control 35
5.5. Computing Unit 37
1
6. Multivariable Model Predictive Control in MATLAB[3] 38
6.1. The Model Predictive Control (MPC) Toolbox and the MPC Blockset 38
6.2. Control Structure of Model Predictive Control 39
6.3. Operation of Model Predictive Control 41
6.4. Linear Model of Plant 41
6.5. Optimization Problem 42
6.6. Cost Function of Model Predictive Control 44
7. Evaluation of Control System 46
7.1. Introduction 46
7.2. Simulation Model of Cascade PID Control 46
7.3. Simulation Model of Model Predictive Control 46
7.4. Comparison of Cascade PID Control and Model Predictive Control 47
8. Conclusion 51
9. References 52
10. Exemption from Responsibility 52
11. Author 52
2
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.
Plant Modeling
System Identification
Control Design PID Control , Cascade PID Control
Model Predictive Control
START
END
Evaluation
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
3
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.
Permeation Emission gas
Material Emissiongas
MaterialPart
Agitator
PermeationPart
Low Pressure
MaterialPart
Agitator
Flow gas
Low Pressure
MaterialPart
Agitator
High Pressure
PermeationPart
High Pressure
High Pressure
(A)
(A)
(A)
(A)
(A)
(A)
(B)
(B)
(B)
(C)
(D)
(C)
(C)
(C)
(C)
(C)
(D)
(D)
(D)
(D)
(D)
NotePressuresensor
InhalationControlValve
Pump Manipulatedvariable switcher (refer 5.2.)
(A) Densitysensor
(B)
(C) Emission gas ControlValve
(D)
Material Inhalation gas
PermeationInhalation gas
Low Pressure
Selectivelypermeable membrane
Selectivelypermeable membrane
Selectivelypermeable membrane
PermeationPart
Figure 2. Schematic Diagram of Gas Separator
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
4
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, MATLAB Version 7.0.1, Simulink 6.1 and Model Predictive
Control Toolbox Version 2.1 are required.
OuterControllertype1:Cascade PIDtype2:MPC
PIDcontroller
ComputingUnit
SV: Setpoint - PressureMV: Manipulated Variable - Emission or InhalationVolume of airCV: Controlled Variable - Pressure
SV1
MV
Pressure sensorControl Valve
CV
PIDcontroller
SV2 MV
CV
Control Valve
+ -
+-
Gas Separator2
Gas Separator3
Same as above
Same as above
MV2
MV3
Inner Loop
Pressuresensor
Density Sensor
Inner LoopOuter LoopSV: Setpoint - Oxygen DensityMV: Manipulated Variable - Pressure DifferenceCV: Controlled Variable - Oxygen Density
SV
MV1
PV
Material Part
PermeationPart
Gas Separator1
Outer Loop
Figure 3. Control System Structure ~Inner Loop and 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.
5
YAQ1OxygenDensity
Inlet Flow GasVolume F1Density XAF1
GasSeparator1
Outer Controllertype1:Cascade PIDtype2:MPC
ComputingUnit
Set point of Oxygen density
Note
Sensor
ControlValve
Pump
U
L
Control valve of inner control
L
***_SV U
Manipulatedvariable switcher (Refer 5.2.)
PID
MaterialPart
+
-
+
-
PtW1_SV
PID
PtW1Pressure CV
PtQ1Pressure CV
U
L
L
L
L
L
L
YAQ2Oxygen
Density
+
- PID
L
L
LL
L
YAQ3 OxygenDensity
+
- PID
L
L
L
L
L
L
PID+
-L
PID+
-
L
PtW2_SV
U
PtW1_SV
UU
U
U
GasSeparator2
GasSeparator3
PermeationPart
Controlled variable of inner control (Pressure)
Controlled variable of outer control (Density)
Manipulated variable of outer control=Set point of inner control
PtQ3Pressure CV
PtQ2Pressure CV PtW3
Pressure CV
PtW2Pressure CV
Figure 4. Overall Structure of Plant and Control System
6
2.2. Gas Separator
Gas separator assumes as follows (Refer to figure 5).
Gas separator shape is rectangular. Gas assumed to be air that flows into inlet line of gas separator.
Permeable membrane is placed in the middle of gas separator to separate gases. Oxygen in the gas
can penetrate permeable membrane, but nitrogen can not. By crating pressure differences between
material and permeation parts, membrane permeation flow of oxygen in the gas occurs from material
to permeation part. Nitrogen is assumed to be significantly less permeable than oxygen. This makes
mol fraction of oxygen of permeation part higher. Agitator makes gas concentration uniform by
agitating inside. There are pressure sensors to material and permeation parts. Control valves are
attached to each inhalation and emission line to control pressures of material and permeation parts.
Flow of inhalation and emission are controlled by control valve opening. When inhalation and
emission flows change, pressures at both material and permeation parts change. To make it simple,
assume that inhalation and emission capabilities are constant. There is a concentration sensor
attached to permeation part to measure concentration of emission gas.
area
z
Selectivelypermeablemembrane
PressureSensor
h
Inlet Flow Gas
Inlet Line
area
Density Sensor
Agitator
Control Valve
Pressure SensorEmission
Inhalation
Pump
Material Part
Permeation Part
Inhalation
Emission
Figure 5. Gas Separator
7
Numerical specification of gas separator is described in table 1.
Table 1. Numerical Specification of Gas Separator
Specification Value Unit Symbol
Cross-section area 5 m2 Area
Permeable membrane cross-section area 5 m2 Area
Cubic volume of material and
permeation parts
25 m3 volume ( = h*area)
Height of material and permeation parts 5 m h
Mass transfer coefficient (oxygen) 0.00001 mol・m-2・s-1・㎩-1 -
Mass transfer coefficient (nitrogen) 0.000001 mol・m-2・s-1・㎩-1 -
2.3. About Membrane Separator
Permeable membrane is barrier diffusion that selectively permeates according to material type.
Concentration difference, pressure difference and difference in potential are used to drive mass
transfer (energy). Practical examples included oxygen enrichment, water purification and salt
manufacturing. [1] Among such examples, gas separation is described in table 2.
Table 2. Description of gas separation [1]
Permeable material Separation method
Driving force Residue material
Separation mechanism
Practical example
Easy-to-permeate gaseous molecule
Gas separation
Concentration difference (partial pressure difference)
Difficult-to-permeate gaseous molecule
Solution-diffusion mechanism, Knudsen diffusion
Oxygen enrichment, Hydrogen separation, Helium separation, Uranium concentration (gas diffusion method)
3. Introducing Mathematical Model This chapter describes physical environment controlling gas separator, permeable juxtamembrane,
and entire gas separator. Although the actual unit is considered to be quite complex, for the purpose
of modeling, the following assumptions are made:
<Hypothesis>
(1) Gas is ideal gas.
(2) Gas is air. Air consists of two components. Components are component A (oxygen) and
component B (nitrogen).
(3) Mol fraction of component A in the air is 0.2, and that of component B is 0.8.
(4) Ignore friction with gas and container wall and piping, and pressure loss.
(5) Gas is at normal temperature and constant (20 degrees, Celsius).
(6) Gas component distribution within gas separator is uniform.
8
(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. Introduction of Mathematical Model of Permeable Juxtamembrane
The three governing rules of permeable juxtamembrane are as follows. To make it generalized, they
are formulated as component A and B.
<Governing Rules>
(1) Permeable membrane flow rate of component within gas is proportionate to partial pressure
difference of components inside and outside of membrane.
(2) Positive permeable membrane flow rate occurs from higher partial pressure side to lower side.
(3) Component A is easy to penetrate the permeable membrane, whereas component B is not.
Where, permeable membrane flow rates NA of gas component A, and NB of gas component B are
described in the following formula[1] .
)()( yPxPKPPKN ,, AitQAitWmAiAQiAWmAA −=−= (3-1)
)()( yPxPKPPKN ,, BitQBitWmAiBQiBWmBB −=−= (3-2)
(KmA >> KmB)
9
δ[m]
(W)
(Q)
PAW:Partial pressure of gas component A
PAQ,i
PAW,i
PAQ:Partial pressure of gas component A
NA:Permeablemembrane flow rate of component A
NB:Permeable membrane flowrate of component B
PtW:Total pressure of gas
PtQ:Total pressure of gas
Material Part
PermeationPart
Selectivelypermeablemembrane
Figure 6. Diagram of permeable juxtamembrane
[Symbol description]
NA: Permeable membrane flow rate of component A [mol・m-2・s-1]
NB: Permeable membrane flow rate of component B [mol・m-2・s-1]
KmA: Mass transfer coefficient of partial pressure standard within membrane of component A [mol・
m-2・s-1・㎩-1]
KmB: Mass transfer coefficient of partial pressure standard within membrane of component B [mol・
m-2・s-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 [mol・m-1・s-1・Pa-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.
δ/mAmA PK = (3-3)
3.2. Introduction of Mathematical Model for Gas Separator
Dynamics of gas is assumed to be controlled by material balance equation and ideal gas equation.
Material balance equation determines number of mol of total gas, component A (oxygen) and
component B (nitrogen) within gas separator plant. Ideal gas equation determines total pressure, and
partial pressures of component A and B within gas separator plant.
Material balance equation, pressure and mol fraction are described as follows:
F[mol・s-1]
XAF:Mol fraction of component A in F[-]
Selectivelypermeablemembrane(Area[m3])
XAW: mol fraction [-]
NB:Permeablemembrane flowrate of
component A[mol・m-2・s-1]
Agitator
W:Emission gas quantity from the material partper unit time [mol・s-1]
YAQ: mol fraction [-]
Q:Emission gas quantityfrom the permeation partper unit time [mol・s-1]
Material Part
PermeationPart
Emission
Inhalation
Emission
Inhalation
NA:Permeablemembrane flowrate of
component A[mol・m-2・s-1]
Figure 7. Diagram of gas separator
[Symbol description]
N: Number of mol in gas
F: material gas quantity flown into the material part per unit time [mol・s-1]
xAF: Mol fraction of component A in F [-]
W: Emission gas quantity from the material part per unit time [mol・s-1]
x: mol fraction [-]
y: mol fraction [-]
11
Q: Emission gas quantity from the permeation part per unit time [mol・s-1]
Area: membrane area [m2]
t: time [s]
P: pressure [Pa]
R: Gas constant 8.314[J・mol-1・K-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
(Material balance equation of all gases in the material part)
Changes in number of mol of all gases in the material part per unit time can be expressed by the
following equation.
AreaNAreaNWFdt
dNBA
tW ** −−−= (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.
00)**( == +−−−= ∫ ttW
t
BAtttW NdtAreaNAreaNWFN (3-5)
(Material balance equation of gas component A in the material part)
Changes in number of mol of gas component A in the material part per unit time can be expressed by
the following equation.
AreaNXWXFdt
dNAAWAF
AW ⋅−⋅−⋅= (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.
00)( == +⋅−⋅−⋅= ∫ tAW
t
AAWAFttAW NdtAreaNXWXFN (3-7)
(Pressure of all gases in the material part)
It is assumed that the ideal gas equation is approved. P=nRT/V, instead of PV=nRT
VTRNP tWtW /⋅⋅= (3-8)
12
(Mol fraction in the material part)
WAWAW NNX /= (3-9)
(Material balance equation of all gases in the permeation part)
Change of mol number of all gases in the permeation part per unit time can be expressed by the
following equation.
QAreaNAreaNdt
dNBA
tQ −+= ** (3-10)
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.
00)**( == +−+= ∫ ttQ
t
BAtttQ NdtQAreaNAreaNN (3-11)
(Material balance equation of gas component A in the permeation part)
This can be expressed by the following equation in the same way:
AQAAQ YQAreaN
dtdN
⋅−⋅= (3-12)
00)( == +⋅−⋅= ∫ tAQ
t
AQAttAQ NdtYQAreaNN (3-13)
(Pressure of all gases in the permeation part)
It is assumed that the ideal gas equation is approved. P=nRT/V, instead of PV=nRT
VTRNP tQtQ /⋅⋅= (3-14)
(Mol fraction in the permeation part)
WAQAQ NNX /= (3-15)
13
3.3. Mathematical-Based Simulink Model
The Simulink model in figure 8 can be obtained by expressing equation (3-1) to (3-15) in block
diagram in Simulink.
Figure 8. Gas separator model in Simulink
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 To improve precision of model used by outer loop in order to enhance control
performance of the outer loop.
14
4.2. Identification of Inner Loop
In this example, model is acquired by linearization and model order reduction for the inner loop
system identification.
PID parameter tuning is performed for the acquired model in the “Control System Design” of the
next chapter.
Figure 9 summarizes purposes of each operation, procedures and tools used in this example for inner
loop system identification (including PID parameter tuning).
Simulink+SimulinkControl Design
Closed-loop structure of the PID control is cut, to make it open loop structure, and linearization.
Linearization of non linear plant model
SimulinkDynamic simulation by SimulinkEvaluation control performanceby above PID parameter calculated by Ziegler-Nichols Method
Control System Toolbox
(1) pole-zero cancellation of transfer function(2) Evaluation by pole-zero map(3) Evaluation by step response in time domain
Model order reduction of high order plantto apply PID parameter tuning method (Ziegler-Nichols Method)
ToolsProcedurePurpose
Linearization of plant
Tuning of PID Parameters
Evaluation
START
END
Model order reduction of plant
Simulation
OK
Not OK
Figure 9. Purposes of each operation, procedures and tools used in this example
15
Figure 10 shows model used for system identification of the inner loop and PID control parameter
tuning.
Signal Builder Block
Gas Separator1 Gas Separator2 Gas Separator3
Permeation partPID controller1
Material PartPID controller1
Material PartPID controller2
Permeation partPID controller2
Material PartPID controller3
Permeation partPID controller3
Data storing part Data display part
Figure 10. Model used in system identification of the inner loop and tuning of PID control parameter
The Simulink Control Design 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
PlantPIDController
+
-
×Set Value
Input point
Simplify
×:It means to cut closed loop.
GUI of the Simulink Control Design
Step response of a model which is applied model order reduction by pole-zerocancellation with linearizedtransfer function(Green)
Step response of linearized transfer function(Blue)
Example.Permeation part of Gas separator2
Output point
Input point Output point
Figure 11. Simulink Control Design
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.
Table 4. Transfer function with input and output points linearized
Input and output points of the inner loop Transfer Function
Gas separator 1 material part pressure(y)-material part valve opening (u) -0.0008/s
Gas separator 1 permeation part pressure (y)-permeation part valve opening
(u)
-0.0009/s
Gas separator 2 material part pressure (y)-material part valve opening (u) -0.0009/s
Gas separator 2 permeation part pressure (y)-permeation part valve opening
(u)
-0.0008/s
Gas separator 3 material part pressure(y)-material part valve opening (u) -0.0008/s
Gas separator 3 permeation part pressure(y)-permeation part valve opening
(u)
-0.0008/s
17
4.3. Identification of Outer Loop
System identification in the outer loop models impact that pressure differences between the material
and permeation parts of each gas separator unit 1, 2 and 3 have on oxygen concentration in the
permeation part of gas separator 1, 2 and 3. Open loop response between control quantity 1, 2 and 3,
and manipulated variable 1, 2 and 3 in figure 12 are identified. Although set point of pressure
tracking control of material and permeation parts of each plant is performed for the inner loop, the
inner loop shows very high speed set point tracking compared to outer loop dynamics, therefore it is
assumed to be included in low speed dynamics of the outer loop.
Plant (including inner loop)
Outer controlsystem
Gas separator 2Set point of pressuredifference between material part and permeation part
Gas separator 3Oxygen concentrationof permeation part
Gas separator 2Oxygen concentrationof permeation part
Gas separator 1Oxygen concentrationof permeation part
MV1
MV2
MV3
CV1
CV2
DV1
DV2Inlet flow gasdensity
CV3
MV: Manipulated VariableCV: Controlled VariableDV: Disturbance
Gas separator 1Set point of pressuredifference between material part and permeation part
Gas separator 3Set point of pressuredifference between material part and permeation part
Inlet flow gas quantity
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
Signal Builder Block
Gas Separator1 Gas Separator2 Gas Separator3
Permeation partPID controller1
Material PartPID controller1
Material PartPID controller2
Permeation partPID controller2
Material PartPID controller3
Permeation partPID controller3
Data storing part
Data display part
Figure 13. Simulink model for outer system identification
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
Gas separator2Set point of pressure in material partGas separator2Set point of pressure in permeation partGas separator3Set point of pressurein material partGas separator3Set point of pressure in permeation part
Inlet flow gasquantity
Inlet flow gasdensity
Gas separator1 Set point of pressurein permeation part
Gas separator1Set point of pressure in material part
MV2
MV3
DV1
DV2
Signal Name
MV1MV1
MV2
MV3
DV1
DV2
Figure 14. Setup Signal for the Signal Builder Block
Table 5 describes what symbols used in Simulink model of this example mean, including figure 14.
20
Table 5. Meaning of symbols in Simulink model
Name Contents Symbol
Pressure set point in the material part of plant 1 PTW1_SV Manipulated
variable 1 (outer) Pressure set point in the permeation part of plant 1 PTQ1_SV
Pressure set point in the material part of plant 2 PTW2_SV Manipulated
variable 2 (outer) Pressure set point in the permeation part of plant 2 PTQ2_SV
Pressure set point in the material part of plant 3 PTW3_SV Manipulated
variable 3 (outer) Pressure set point in the permeation part of plant 3 PTQ3_SV
Gas flow quantity of plant 1 F1 Disturbance
Oxygen concentration mol fraction of gas flow quantity
of plant 1 XAF1
Controlled
variable 1 (outer)
Oxygen concentration mol fraction in the permeation
part of plant 1 YAQ1
Controlled
variable 2 (outer)
Oxygen concentration mol fraction in the permeation
part of plant 2 YAQ2
Controlled
variable 3 (outer)
Oxygen concentration mol fraction in the permeation
part of plant 3 YAQ3
Oxygen concentration mol fraction in the permeation
part of plant 1 YAQ1_SV
Oxygen concentration mol fraction in the permeation
part of plant 2 YAQ2_SV
Set point (outer)
Oxygen concentration mol fraction in the permeation
part of plant 3 YAQ3_SV
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
MV3
DV1
DV2
CV3
CV2
Oxygendensity
Pressuredifference
CV1Impact of DV1Impact of MV1 Impact of MV3 Impact of DV2Impact of MV2
Figure 15. Open loop response to each manipulated variable
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
Removalof bias
4. Removal of bias(direct-current component)
from data
5. System Identification
START
END
Ex. Transient response by step input
Steady state
3. Trimming of abnormal data
1.Acquiring real plat data
1.Sampling of simulation data
2. Extraction of data
Figure 16. System identification flow of the outer control system
(5) System Identification
System Identification Toolbox and Simulink Parameter Estimation are MATLAB&Simulink tools
used for system identification. It is considered that model is approximated by transfer function of
first order delay + dead time system from step input response characteristics in figure 15.
)exp(1
)( LsTs
KsG −+
= (4-1)
K: gain, T: time constant, L: dead time
or
Transfer function of second order delay system
22
2
2)(
nn
n
ssK
sGωζω
ω++
= (4-2)
K: gain, ζ: damping ratio, ωn: eigen frequency
Model identification is possible using either tool, method using the Simulink Parameter Estimation is
introduced in this guide. Simulink Parameter Estimation estimates parameter within Simulink model
based on optimization. It is necessary to provide appropriate initial value to estimation value in the
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.
Figure 17. Step response of manipulated variable 2 and controlled variable 2
(1) and (2) in figure 18 are Simulink models used for parameter estimation. (3) in figure 19 is GUI
for the Simulink Parameter Estimation. (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 delaysystem
Figure 18. Models used for first order delay + dead time system, parameter estimation of second
order delay
25
Cost Function
Measureddata (gray)
Simulated data (blue)
Measured and Simulated
GUI of Simulink Parameter Estimation
Iterations
(3)
(4)
(5)
Figure 19. Simulink Parameter Estimation
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
nωπ2
11+Ts
n
Tξω
1=
Second order delay system
First order delay system
Figure 20. Relationship between first order delay system and second order delay system (0<ζ<1) (Figure in [4] is partially modified.)
1.02 22
2
=++
n
nn
n
ssω
ωξωω
Figure 21. Graph of second order delay system (0<ζ≦2)
27
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.
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢
⎣
⎡
+
=⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−
−
−
)(3)(2)(1
1 + 234.2s0.2884
10*1.23 + s 0.0071 + s10*3.641
10*3.4489 + 0.0032ss10*9.2372
01 + 205.5s
0.2462 1 + 736.7s
0.2348
001 + s 313.2
0.182
)(3)(2)(1
)41(5-2
6-
6-2
7-
)8.43(
)6.3(
sUsUsU
e
e
e
sYsYsY
s
s
s
(4-3)
CV1
MV2 MV3MV1
CV2
CV3
Figure 22. Step Response
5. Control System Design 5.1. Introduction
This example outer and inner control systems work together. As this is multi-inputs and
multi-outputs, control system is multi-variable control. Outer and inner control systems are designed
separately in control system design. Cascade PID control and multi-variable Model Predictive
28
Control is designed and compared as multi-variable control.
Figure 23 shows why multi-variables Model Predictive Control is adopted. Model Predictive Control
is control rules that are theoretically valid for plant with long time constant and dead time. PID
control design for multi-input multi-output system generally is becoming more complex. Model
Predictive Control is a control rules that optimized control is possible where stress put on plant is
treated as constraints.
The gas separators in the back and forth influence each other because it connects.
incidenceInterference
It is not an optimizing control of the entire plant. The stress given to the plant is not evaluated enough.
There is no norm of control.
Optimality
Cascade PID Control
Description
Structure of control
A control system is closed in a gas separator.It only controls Set Value tracking.
EpexegesisItem
Improvement of tracking Set Value
Entire optimization of multi variable control system
Improvement item by MPC installation
Expecting effect by MPC installation
・Running cost reduction・Stabilization of control・Reduction of stress to plant
Figure 23. Why multivariable Model Predictive Control is adopted
29
Table 6 summarizes outer and inner control systems.
Table 6. Outer control system and inner control system
Control method Function Set point, controlled variable, manipulated
variable
Cascade PID control
(position type)
To track set point of oxygen
concentration in the
permeation part of each gas
separator.
Set point: oxygen concentration in emission gas
in the permeation part
Controlled variable: oxygen concentration in
emission gas in the permeation part
Manipulated variable: pressure difference
between the material and permeation parts
Outer control
system
Multivariable Model
Predictive Control
Same as above Same as above
Inner control
system
PID control (position
type)
To control inhalation and
emission control valve
opening and follow set points
of oxygen concentration in
the material and permeation
parts of each gas separator.
Set point: pressures in the material and
permeation parts of gas separator
Controlled variable: pressures in the material and
permeation parts of gas separator
Manipulated variable: inhalation (emission)
5.2. Inner Control System Design ~ PID Control
Inner control system is assumed to be loop control by PID controller. Manipulated variable switcher
switches between emission and inhalation, depending on sign of manipulated variables, W and Q
that PID controllers of loop1 and loop2 output.
The function of manipulated variable switcher is assumed as follows.
In the loop 1, total pressure, PtW of pressure sensor is treated as CV (Controlled Variable) , and W
(emission gas flow in the material part) as MV (Manipulated variable). If W is positive, emission gas
value is positive, and emission value control valve is controlled. Inhalation control valve then is fully
closed. If W is negative, emission gas value is negative, and inhalation value control valve is
controlled. Emission value control valve then is fully closed. To match sign of inhalation value and
valve opening, if W is negative, it is absolute value of W.
In the loop 2, total pressure, PtQ of pressure sensor is treated as CV (Controlled Variable), Q
(emission gas flow in the permeation part) as MV(manipulated variable). If Q is positive, emission
gas value is positive, and emission value control valve is controlled. Inhalation value control valve
then is fully closed. If Q is negative, emission gas value is negative, and inhalation value control
valve is controlled. Emission value control valve then is fully closed. Switching between emission
and inhalation is not modeled in Simulink model.
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.
F: Inlet gas quantity [mol・s-1]
W: Emission gas quantity of material part [mol・s-1]
Material part
Permeation part
Gas separator
Inhalationcontrol valve
Emissioncontrolvalve
Total PressurePtQ
PressureSensor
Total PressurePtW
loop1
loop2
PIDcontroller
-Outer ControlSystem
+
-+
Set point2
Emissioncontrolvalve
DensitySensor
Sign of MVof PID Controller
0
1
Selectivelypermeable membrane
Setpoint
0
1PID
controller
AbsoluteABS
ManipulatedVariableSwitcher
ABS
PressureSensor
Set point1
Inhalationcontrol valve
ManipulatedVariableSwitcherSign of MV
of PID Controller
Q: Emission gas quantity of permeation part [mol・s-1]
Absolute
Figure 24. PID controller attached to gas separator
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
MV upper rate limit 10
MV lower rate limit -10
31
PID Controller Plant
Inside of subsystem
ProportionalGain
Integral Time
Derivative Time
AppropriateDifferential Operator
Integrator
Upper and lower limit
Ratelimiter
Figure 25. Structure of PID controller
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.45*(gain of stability limit) 0.833*(frequency of
stability limit)
-
Table 9. PID Control Parameter of inner loop
Input and output points Transfer
Function
Proportional
gain
Integral time Derivative
time
Gas separator 1 material part
pressure (y)-material part valve
opening (u)
-0.0008/s -20 67 -
Gas Separator 1 permeation part
pressure (y)- permeation part
valve opening (u)
-0.0009/s -17 67 -
Gas Separator 2 material part
pressure (y)-material part valve
opening (u)
-0.0009/s -20 67 -
Gas Separator 2 pressure in the
permeation part (y)-valve
-0.0008/s -20 67 -
32
opening in the permeation part (u)
Gas Separator 3 material part (y)
-material part valve opening (u)
-0.0008/s -30 67 -
Gas Separator 3 permeation part
pressure (y)-permeation part
valve opening (u)
-0.0008/s -30 67 -
5.3. Upper Control System Design ~ Cascade PID Control
When designing multiple loop control using multi-variable control, it is important to determine
appropriately which manipulated variables control which controlled variables, and its combinations.
In this example, based on a basic theory that one manipulated variable controls one controlled
variable, manipulated variable 1-controlled variable 1, manipulated variable 2-controlled variable
2, manipulated variable 3-controlled variable 3.
For simplicity, where equation (4-3) of the outer system model is equation (5-1), Y2(s) is found to
be interfered by U1(s), and Y3(s) is interfered by U1(s) and U2(s). Decoupling can be used for
cancelling interferences, but in this example, each gas separator controls independently each PID
controller (outer) does not have decoupling functionality to avoid mutual interference.
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
)(3)(2)(1
)()()(0)((s)G00)(
)(3)(2)(1
333231
2221
11
sUsUsU
sGsGsGsG
sG
sYsYsY
(5-1)
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
plant
PID controller(inner)+
-
1/2+
1.3
+
+
1.0+ +
-
+-
1/2+
1.3
+
+1.0
++
-
+
-
1/2
+
1.3
+
+
1.0
Base pressure [atm]
++
-
SV of pressure difference between material part and permeation partIn gas separator3
SV of pressurein permeation part of gas separator3
Computing unit
Inner loop
Y1
Y2
Y3
U1
U2
U3
Manipulatedvariable switcher
PID controller(inner)
PID controller(inner)
PID controller(inner)
PID controller(inner)
PID controller(inner)
PID controller(outer)+
-
PID controller(outer)
-
PID controller(outer)
-SV of densityin gas separator3
Manipulatedvariable switcher
Manipulatedvariable switcher
Manipulatedvariable switcher
Manipulatedvariable switcher
Manipulatedvariable switcher
Base pressure[atm]
Base pressure [atm]
Base pressure[atm]
Base pressure [atm]
Base pressure [atm]
SV of densityin gas separator2
SV of densityin gas separator1
SV: Set pointCV: Controlled Variable
CV of densityin permeation part of gas separator3
CV of densityin permeation part of gas separator2
CV of densityin permeation part of gas separator1
SV of pressurein permeation part of gas separator2
SV of pressurein permeation part of gas separator1
SV of pressurein material part of gas separator1
SV of pressurein material part of gas separator2
SV of pressurein material part of gas separator3
SV of pressure difference between material part and permeation partIn gas separator1
SV of pressure difference between material part and permeation partIn gas separator2
Figure 26. Structure of Cascade PID Control
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.
)exp(1
)( LsTs
KsG −+
=
K: gain, T: time constant, L: dead time
Table 10. Parameter examples of CHR method [2]
External input Overshoot Control law Proportional
gain Kp
Integral
time Ti
Derivative
time Td
Set point change None PI Control 0.35T/KL 1.17T -
34
The results obtained from applying CHR method to transfer function of the outer system are shown
in table 11.
Table 11. PID parameter of cascade PID control (host)
PID Parameter
Input and output points Transfer Function Proportional
gain
Integral
time
Derivative
time
Gas Separator
manipulated value 1 (y)
-control value 1 (u)
)6.3exp(12.313
182.0 ss
−+
167.3 366.4 -
Gas Separator
manipulated value 2 (y)
-control value 2 (u)
)8.43exp(15.205
2462.0 ss
−+
6.67 240.4 -
Gas Separator
manipulated value 3 (y)
-control value 3 (u)
)41exp(12.234
2884.0 ss
−+
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 1
MV lower limit 0
MV upper rate limit 0.05
MV lower rate limit -0.05
5.4. Outer Control System Design ~ Model Predictive Control
Detailed structure of Model Predictive Control system is shown in figure 27. What differs from
cascade PID control is that cascade PID control is single-input single-output, and Model Predictive
Control system is multi-inputs and multi-outputs.
35
plant
+-
1/2+
1.3
+
+
1.0+ +
-
+-
1/2+
1.3
+
+1.0
++
-
+
-
1/2
+
1.3
+
+
1.0+
+-
Y1
Y2
Y3
U1
U2
U3
SV of densityin each gas separators
SV of pressurein permeation part of gas separator3
SV of pressurein permeation part of gas separator2
SV of pressurein permeation part of gas separator1
SV of pressurein material part of gas separator1
SV of pressurein material part of gas separator2
SV of pressurein material part of gas separator3
Manipulatedvariableswitcher
Manipulatedvariableswitcher
Manipulatedvariable switcher
Manipulatedvariable switcher
Manipulatedvariable switcher
Manipulatedvariable switcher
CV of densityin permeation part of gas separator3
CV of densityin permeation part of gas separator2
CV of densityin permeation part of gas separator1
SV of pressure difference between material part and permeation partIn gas separator3
SV of pressure difference between material part and permeation partIn gas separator2
SV of pressure difference between material part and permeation partIn gas separator1
Model PredictiveController
Base pressure [atm]
Base pressure[atm]
Base pressure [atm]
Base pressure[atm]
Base pressure [atm]
Base pressure [atm]
Computing unit
Outer loop
PID controller(inner)
Inner loop
PID controller(inner)
PID controller(inner)
PID controller(inner)
PID controller(inner)
PID controller(inner)
SV: Set pointCV: Controlled Variable
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] As time constant of plant ranges from approximately a
few hundred to kilo seconds order, prediction horizon
is set at 1200 seconds to include generally plant’s
dynamics. Control interval is set at 60 seconds as this
does not require high speed control.
Prediction horizon 20 [samples]
Control horizon 10 [samples]
For calculation speed-up, control horizon is set at half
of prediction horizon.
36
Variable
type
Variable Weight Rate
Weight
Design basis
U12 1 1
U34 1 1
Manipul
ated
variables U56 1 1
YAQ1 10
YAQ2 1000
Output
variables (Controlled
Variables)
YAQ3 10000
To make significantly bigger weight factor of
controlled variables than that of manipulated
variables. This evaluates highly set point tracking
of controlled variables within the evaluation
function. Manipulated variable can move as long
as it satisfies set point tracking. This calculates Δu
vector that places more importance on set point
tracking than manipulated variable stability.
Furthermore, place weight in set value tracking so
that set point of Y3 (gas concentration of final
product). Apply more loose constraints for
intermediate product (Y2) compared with Y3.
Intermediate product (Y1) is not required to track
setpoint.
Variable type Variable Constraints Design basis
U12 0 <= U12 <= 1
-0.05 <= U12/rate <= 0.05
U34 0 <= U34 <= 1
-0.05 <= U34/rate <= 0.05
U56 0 <= U56 <= 1
Manipulated
variables
-0.05 <= U56/rate <= 0.05
U1, U2 and U3 are operated within the
upper and lower limits.
U1, U2 and U3 are 1[atm] at
maximum, 0[atm] at minimum. This
means to define the upper and lower
limits of stress put on the plant. Rate
limit is to be strict in order to mitigate
stress put on the plant.
YAQ1 No constraints
YAQ2 No constraints
Output
variables
YAQ3 0 <= YAQ3 <= 1
Upper and lower limits are placed only
for the final product, YAQ3, and no
limits are placed for intermediate
product, YAQ1 and YAQ2.
5.5. Computing Unit
Functionalities of Computing Unit are described in figure 28. The Computing Unit allocates half of
the output from the outer control system to both the material and permeation parts. Half of the
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 PredictiveController output(Manipulated Value)
U
Gas separator
Permeationpart
Material part
Base pressure1.3[atm] +
+
Base pressure1.0[atm]
+ -
½×U
Figure 28. Functions of Computing Unit
6. Multivariable Model Predictive Control in MATLAB[3]
6.1. The Model Predictive Control (MPC) Toolbox and the MPC Blockset
The Model Predictive Control (MPC) Toolbox is a MATLAB product which is used for design and
simulation of Model Predictive Control system. In order to simulate the designed Model Predictive
Control system use the MPC Controller Block provide in this tool. The MPC toolbox provides
function library for command line and mpctool for dedicated GUI. Model Predictive Control
designed in mpctool is MPC object form, and can be treated on MATLAB Workspace. Simulink and
the MPC Toolbox can be seamlessly used by specifying MPC object in the MPC Controller Block.
Examples of Functionalities of mpctool are described in figure 29.
(1) in figure 29 sets control structure of Model Predictive Control system to be designed. (2) sets
38
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 the Model Predictive Control
(MPC) Toolbox. MPC Structure Overview
Controlled Variables
ManipulatedVariables
Model and Horizons
Constraints
Weight Tuning
(1)(2)
(3) (4)
Figure 29. Example of various GUIs for designing mpctool
6.2. Control Structure of Model Predictive Control
Control structure of Model Predictive Control is shown in Fig30. The structure is the same in SISO
(single-input single-output) and MIMO (multi-input multi output). Model Predictive Control is a
kind of feedback control.
39
Figure 30. Block Diagram of a SISO Model Predictive Control Toolbox Application [3]
Description of symbols in Figure 30 is shown in Table14.
Table 14. Description of Model Predictive Control Toolbox Signals [3]
Symbol Description
d Unmeasured disturbance. Unknown but for its effect on the plant output. The controller
provides feedback compensation for such disturbances.
r Setpoint (or reference). The target value for the output.
u Manipulated variable (or actuator). The signal the controller adjusts in order to achieve
its objectives.
v Measured disturbance (optional). The controller provides feedforward compensation for
such disturbances as they occur to minimize their impact on the output. y Output (or controlled variable). The signal to be held at the setpoint. This is the “true”
value, uncorrupted by measurement noise.
y Measured output. Used to estimate the true value, y .
z Measurement noise. Represents electrical noise, sampling errors, drifting calibration,
and other effects that impair measurement precision and accuracy.
40
6.3. Operation of Model Predictive Control
Dynamic optimization is performed in Model Predictive Control. (1) and (2) as follows are repeated
in dynamic optimization procedure.
(1) Prediction future controlled variable of the plant as many as p pieces of prediction horizon, p for
every control interval. (2) Solving manipulated variable rate vector [ ])k1(),( +−ΔΔ mkukku K that minimizes quadratic
cost function described by manipulated variable rate vector [ ])k1(),( +−ΔΔ pkukku K ,
manipulated variable vector [ )k1(),( +−pkukku K ] and controlled variable vector
[ )k1(),( +−pkykky 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.
present(k)
,M
Prediction future controlled variable of the plant as many as p pieces of prediction horizon, p for every control interval.
Solving manipulated variable rate vector that minimizes quadratic cost functiondescribed by manipulated variable rate vector,
manipulated variable vector and controlled variable vector within the constraints.
Set u(k) to plant
k=k+1(Shift sample time )
Procedure of MPC
repeat
Dynamic optimization
Figure 31. Behavior overview of Model Predictive Control [3]
6.4. Linear Model of Plant
The linear model used in Model Predictive Control Toolbox for prediction and optimization is
depicted in Figure 32.Inputs of the model are manipulated variables and observable and
non-observable disturbances.
41
Figure 32. Linear Model of a Plant used by MPC Toolbox [3]
The model of the plant is a linear time-invariant system described by the equations (6-1).
( ) ( ) ( ) ( ) ( )( ) ( ) ( ) ( )( ) ( ) ( ) ( ) ( ) )16(
1
−+++=++=
+++=+
kuDkdDkvDkxCkykdDkvDkxCky
kdBkvBkuBkAxkx
uuduvuuu
dmvmmm
dvu
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. The 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
( ) ( ) ( ) ( )( )
( ) ( ) ( )( )⎪⎭
⎪⎬⎫
+⎟⎟⎠
⎞+−+++Δ+
⎪⎩
⎪⎨⎧
⎜⎜⎝
⎛++−+++−ΔΔ
∑∑
∑ ∑
==
Δ
−
= =+
2
1
2arg,
1
2,
1
0 1
2,1 11,
min1,...,
ερωω
ωε
ε
uu
y
n
jetjtj
uji
n
jj
uji
p
i
n
jjj
yji
ikukikukiku
ikrkikykkmukku (6-2)
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
( ) ( ) ( ) ( ) ( )( ) ( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) ( )( )
1,...,001,...,,0
1 maxmaxminmin
maxmaxminmin
maxmaxminmin
−=≥−==+Δ
+≤++≤−+Δ≤+Δ≤−Δ
+≤+≤−ΔΔ
pipmhkhku
iViykikyiViyiViukikuiViu
iViukikuiViu
j
yjjj
yjj
ujjj
ujj
ujjj
ujj
ε
εεεε
εε
(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).
ji,y
ji,u
ji,u w, w,wΔ 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.
maxj,minj,maxj,minj,maxj,minj, y ,y ,u ,u ,u ,u ΔΔ 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
variable 0≥ε . The weight ερ on the slack variable ε penalizes the violation of the constraints.
The larger ερ with respect to input and output weights, the more the constraint violation is
penalized. The Equal Concern for the Relaxation (ECR) vectors
have nonnegative entries which represent the
concern for relaxing the corresponding constraint; the larger V, the softer the constraint. maxminmax
umin
umax
umin
u V ,V ,V ,V ,V ,V yyΔΔ
V=0 means that the constraint is a hard one that cannot be violated. By default, all input constraints
are hard ( )0V V VV maxu
minu
maxu
minu ==== ΔΔ and all output constraints are soft
( )1VV maxy
miny == . As hard output constraints may cause infeasibility of the optimization
problem (for instance, because of unpredicted disturbances, model mismatch, or just because of
numerical round off).
43
6.6. Cost Function of Model Predictive Control
Cost Function (6-2) is shown as follows.
22
2
arg
arg2
arg
arg
)(
)1(
)(
)1(
)(
)1(
)(
)1(
)1(
)0(
)1(
)0(
)1(
)0(
)1(
)0(
)1(
)0(
)1(
)0(),(
εσ
ε
+⎟⎟⎟
⎠
⎞
⎜⎜⎜
⎝
⎛
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡−
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
⎟⎟⎟
⎠
⎞
⎜⎜⎜
⎝
⎛
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡−
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡+
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−Δ
Δ
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−Δ
Δ+
⎟⎟⎟⎟
⎠
⎞
⎜⎜⎜⎜
⎝
⎛
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−⎟⎟⎟⎟
⎠
⎞
⎜⎜⎜⎜
⎝
⎛
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−=
Δ
pr
r
py
yW
pr
r
py
y
pu
uW
pu
u
pu
u
pu
uW
pu
u
pu
uzJ
y
T
u
T
ett
ett
u
T
ett
ett
LLLL
LL
LLLL
(6-4)
Constraint (6-3) is shown as follows.
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
−−−Δ
−Δ−−−
−−
−
≤
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
−Δ
Δ−
≤
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
−−−Δ
−Δ−−−
−−
−
Δ
Δ
Δ
Δ
)1()1(
)1()1()1()1(
)1()1()()(
)1()1(
)1(
)0()1(
)0()(
)1(
)1()1(
)1()1()1()1(
)1()1()()(
)1()1(
maxmax
maxmax
maxmax
maxmax
maxmax
maxmax
minmin
minmin
minmin
minmin
minmin
minmin
pVpu
VupVpu
VupVpy
Vy
pu
upu
upy
y
pVpu
VupVpu
VupVpy
Vy
u
u
u
u
y
y
u
u
u
u
y
y
ε
εε
εε
ε
ε
εε
εε
ε
L
L
L
L
L
L
L
L
L
(6-5)
Cost Function (6-4) is shown as follows.
2222),( εσε ++ΔΔ+= Δ YWYUWUUWUzJ yT
uT
uT (6-6)
Constraint (6-6) is shown as follows.
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
Δ≤
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
Δ≤
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
Δ max
max
max
min
min
min
UUY
UUY
UUY
(6-7)
Δu that minimizes J is calculated sequentially-iterated by the quadratic programming with
constraints. Symbols that used in equation (6-6) and (6-7) are shown as follows.
44
⎟⎟⎟
⎠
⎞
⎜⎜⎜
⎝
⎛
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡−
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−Δ
Δ=Δ
⎟⎟⎟⎟
⎠
⎞
⎜⎜⎜⎜
⎝
⎛
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−=
)(
)1(
)(
)1(
)1(
)0(
)1(
)0(
)1(
)0(
arg
arg
pr
r
py
yY
pu
uU
pu
u
pu
uU
ett
ett
LL
L
LL
(6-8)
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−Δ
−Δ=Δ
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−
−=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−
−=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−Δ
−Δ=Δ
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−−−
−=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
−
−=
Δ
Δ
Δ
Δ
)1()1(
)1()1(
)1()1(
)1()1(
)()(
)1()1(
)1()1(
)1()1(
)1()1(
)1()1(
)()(
)1()1(
maxmax
maxmax
min
maxmax
maxmax
max
maxmax
maxmax
max
minmin
minmin
min
minmin
minmin
min
minmin
minmin
min
pVpu
VuU
pVpu
VuU
pVpy
VyY
pVpu
VuU
pVpu
VuU
pVpy
VyY
u
u
u
u
y
y
u
u
u
u
y
y
ε
ε
ε
ε
ε
ε
ε
ε
ε
ε
ε
ε
L
L
L
L
L
L
(6-9)
45
7. Evaluation of Control System 7.1. Introduction
This chapter evaluates control performance of cascade PID control and Model Predictive Control of
the outer control system designed in chapter 5.
7.2. Simulation Model of Cascade PID Control
Figure 33 shows simulation model of cascade PID control.
After 0 to 25000 seconds, it is controlled in combination of cascade PID control and the inner
control system.
CascadePID
ControllerComputing Unit
Signal Builder Block Gas Separator1 Gas Separator2 Gas Separator3
Permeation partPID controller1
Material PartPID controller1
Material PartPID controller2
Permeation partPID controller2
Material PartPID controller3
Permeation partPID controller3
Data storing part
Data display part
CascadePID
Controller
CascadePID
Controller
Figure 33. Simulation Model
7.3. Simulation Model of Model Predictive Control
Model that simulates Model Predictive Control is shown in figure 34. Model Predictive Control is
performed from time 2000 seconds. So, Model Predictive Controller (MPC Controller Block) is
located within Enabled Subsystem. It is controlled in the inner control system only up to 2000
seconds, and in combination of the Model Predictive Control and the inner control system after 2000
to 25000 seconds.
46
Computing Unit
Signal Builder Block Gas Separator1 Gas Separator2 Gas Separator3
Permeation partPID controller1
Material PartPID controller1
Material PartPID controller2
Permeation partPID controller2
Material PartPID controller3
Permeation partPID controller3
Data storing part
Data display part
Model PredictiveController
Figure 34. Simulation Model
7.4. Comparison of Cascade PID Control and Model Predictive Control
Perform simulations for cascade PID control and Model Predictive Control. The results obtained are
shown in figure 35 to 38. (Figure 35: Set points and controlled variables, Figure 36: superimpose of
Figure 35, Figure 37: manipulated variables, Figure 38: disturbance)
In (1) in figure 35 (left side of figure 36), set point tracking control apparently stops and windup that
requires time for a while to restart set point tracking is confirmed in cascade PID control. Windup
occurs because: integrator is affected if output signal (MV) is reached to upper or lower limit in PID
calculation when error that is difference between set point and controlled variable occurs. An
appropriate integrated value is stored in integrator and normal calculation is performed if MV does
not go over the limits. If MV goes over the limits, excessive integrated values are stored in integrator.
It requires substantial time for integrated value to become 0 when this state is controlled to be
normal range. Until reaching this time, MV output does not return to normal range, and the state of
going over the limits continues. The functionality to initialize integrated value in a short time is
called anti-reset windup. This PID controller does not have anti-reset windup.
(1) of figure 35 (left side of figure 36) indicate the state which can not track set point. Each gas
separator constructs own closed cascade PID control system, and in the gas separator 3, it confirms
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
Cascade PID control Model Predictive Control
(3)(2)
Windup
Figure 35. Setpoints and manipulated variables
Windup
Figure 36. Superimpose of figure 35
49
Cascade PID Control Model Predictive ControlManipulated Variables
(1)
Figure 37. Manipulated variables
50
Disturbance
Figure 38. 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 Simulink’s graphical environment.
9. References [1] Kenji Hashimoto and Fumimaru Ogino, Today’s 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 User’s Guide Version 2 The Mathworks, 2004
[4] Shuichi Adachi, Control Engineering using MATLAB, Tokyo Denki University Press (1999)
10. Exemption from Responsibility Under no circumstances will CYBERNET SYSTEMS CO.,LTD be liable in any way for in this
content, or for any loss or damage of any kind incurred as a result of the use of this content.
11. Author Hiroumi Mita
h-mita@cybernet.co.jp
Senior Application Engineer
CDA Engineering Group, Field Application Engineering Department,
Applied Systems First Division
CYBERNET SYSTEMS CO.,LTD.
52
Created in February 2005
This model is created using MATLAB Version 7.0.1 and Simulink : Version 6.1.
MATLAB&Simulink Sample Model Description ― Simulation of Cascade PID Control and Model Predictive Control for a gas separation plant by
membrane separation ―
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.
http://www.cybernet.co.jp/MATLAB Applied Systems First Division, Sales, E-mail: infomatlab@cybernet.co.jp
Applied Systems First Division, Engineering, E-mail: techmatlab@cybernet.co.jp
53