MPC Level EN PDF
MPC Level EN PDF
If you have any questions concerning this document please e-mail us to the
following address:
online-support.automation@siemens.com
Copyright Siemens AG 2010 All rights reserved
MPC Level
V 1.0, Beitrags-ID: 42200753 3
Warranty and Liability
We do not accept any liability for the information contained in this document.
Any claims against us – based on whatever legal reason – resulting from the use of
the examples, information, programs, engineering and performance data etc.,
described in this Application Example shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,
Copyright Siemens AG 2010 All rights reserved
MPC Level
4 V 1.0, Beitrags-ID: 42200753
Table of Contents
Table of Contents
Warranty and Liability ................................................................................................. 4
1 Preface ................................................................................................................ 6
2 Introduction........................................................................................................ 7
2.1 Basic Principles of Model Predictive Control........................................ 7
2.2 Stable and Unstable Control Loops ..................................................... 7
2.3 Examples of Unstable Control Loops................................................... 9
2.3.1 Level Control ........................................................................................ 9
2.3.2 Pressure Control in Tanks.................................................................. 10
2.3.3 Position Control .................................................................................. 11
2.3.4 Example of Multivariable Control with Integral Part Transfer Function11
3 Stabilization of Unstable Control Loops ....................................................... 12
3.1 Manual Parameterization of a Proportional-only Controller for
Integrating Processes......................................................................... 12
3.2 PID Tuner ........................................................................................... 14
4 Configuration of MPC with Slave Controller................................................. 15
4.1 Starting Point...................................................................................... 15
4.2 Connection in CFC ............................................................................. 15
4.3 Commissioning................................................................................... 18
Copyright Siemens AG 2010 All rights reserved
5 Simulation Example......................................................................................... 19
6 Conclusion ....................................................................................................... 21
7 Related Literature ............................................................................................ 22
7.1 Bibliography........................................................................................ 22
7.2 Internet Link Specifications ................................................................ 22
8 History............................................................................................................... 23
MPC Level
V 1.0, Beitrags-ID: 42200753 5
Preface
1 Preface
Objective of the Application
The area of application of the model predictive controller provided in SIMATIC
PCS 7 (function block ModPreCon and MPC respectively) is restricted by the
following fact: The control algorithm only works for stable processes with a step
response settling to a constant value in a finite time horizon.
If the process is not stable or shows an integral action (e.g. level control, position
control), the respective sub transfer functions have to be stabilized by slave con-
trollers. The objective of this application note is to describe how to proceed in such
cases.
This application note is an extension of the application note “Multivariable Model
Predictive Control – the Distillation Column as an Application Example”, containing
basic information how to apply the MPC.
The application example considered here shows an MPC with two manipulated and
two controlled variables in combination with a simulated process of which the sec-
ond main control loop shows integral action.
Validity
… valid for PCS 7 V7.0 SP1 or later versions.
MPC Level
6 V 1.0, Beitrags-ID: 42200753
Introduction
2 Introduction
2.1 Basic Principles of Model Predictive Control
A general overview of model predictive control is provided by the White Paper
“How to improve the Performance of your Plant using the appropriate tools of
SIMATIC PCS 7 APC-Portfolio?”
https://pcs.khe.siemens.com/efiles/pcs7/support/marktstudien/WP_PCS7_APC_EN
.pdf
The application note including the basic principles of the MPC can be found here:
http://cache.automation.siemens.com/dnl/zI/zIzMzM1MwAA_37361208_Tools/373
61208_MPC_en.pdf
Example: The temperature of a reactor is increasing after the heating power is in-
creased stepwise. With increasing temperature the heat loss of the reactor to the
environment is also increasing, until finally a new equilibrium condition at a higher
temperature is reached, where the increased heat loss is equal to the enlarged
heating power, and compensates for it.
Thought experiment: Please imagine a reactor with ideal thermal insulation, which
means no thermal loss to the environment. Now, if the heating power is increased
stepwise starting from the equilibrium condition, the temperature starts to rise. The
increase of the temperature is undamped and continuous, as no physical effect in
the opposite direction (an increasing heat flow to the environment according to the
rising temperature) exists. Therefore, no new equilibrium condition is reached, re-
sulting in an unstable control loop with respect to systems dynamics. This behav-
iour is called integral action.
There are other forms of instability besides the integrating behaviour, e.g. increas-
ing oscillations. Such behaviours can rather be found in mechanical systems (e.g.
the famous inverse pendulum). In process plants, such instabilities if appearing at
all, are mostly due to inappropriate controller tunings, and only rarely appear in
open loop.
MPC Level
V 1.0, Beitrags-ID: 42200753 7
Introduction
Figure 2-1 Step response of a control loop with compensation (blue) and without
compensation (red), i.e. with integral behaviour.
Step Response
3
whithout
compensation,
2.5 i.e. ohne
with
integral
Ausgleich
behaviour with
mit
2
compensation
Ausgleich
Amplitude
1.5
0.5
Copyright Siemens AG 2010 All rights reserved
0
0 10 20 30 40 50 60 70 80 90 100
Time (sec)
MPC Level
8 V 1.0, Beitrags-ID: 42200753
Introduction
If the level of a tank with continuous feed is to be controlled via an adjustable drain
as actuator (e.g. pump or valve with or without flow control), the control loop shows
integrating behaviour.
An equilibrium condition of the level only exists if the drain is exactly equal to the
feed. The level permanently decreases until the tank is empty, if the drain is in-
creased stepwise starting at this equilibrium condition. In contrast the level perma-
nently increases until the tank overflows, if the drain is decreased stepwise starting
at the equilibrium condition.
Figure 2-2 Types of level control, taken from Related Literature /1./.
Copyright Siemens AG 2010 All rights reserved
Exception natural drain: If only a valve with constant pressure behind exists in the
drain of the tank, the drain flow depends according to the drain formula of Toricelli
not only on the valve position (manipulated variable of the controller) but also
nonlinearly on the level h itself (proportional to 2 gh with acceleration of gravity
g). Compensation can be reached after small steps in the valve position in such
control loops. The level is decreasing if the valve at the drain is opened a little bit
starting at the equilibrium condition. Thus the hydrostatic pressure at the bottom of
the tank is decreasing, and accordingly the drain flow is decreasing until a new
equilibrium condition is reached. Anyway, the application of the techniques de-
scribed in the following is helpful for stabilization of a natural drain too, as the
mechanism of compensation only works for small steps and cannot be modelled
linearly.
In process plants there are many tanks where level control is necessary, e.g. surge
drums, separation tanks, stirred tank reactors, column sumps, feed water tanks,
MPC Level
V 1.0, Beitrags-ID: 42200753 9
Introduction
feed water tanks. There are different objectives for level control according to the
plant context [also see Related Literature /2./]:
Keep level constant (exactly at the set point) – important for levels directly in-
fluencing the process; disturbances are passed through to the output (drain).
Keep level as small as possible – if “dead volume” and inventory are undesir-
able.
Keep level inside specified limits while using the tank as buffer – changes in
level are tolerated to achieve a smooth drain flow.
Figure 2-3 Examples of level control (marked in red) in a typical part of plant (distillation
column) [also see Related Literature /1./].
Copyright Siemens AG 2010 All rights reserved
In some cases the pressure control in tanks behaves in a similar way as the level
control. The control loop shows an integral behaviour, if the manipulated variable is
a gas feed (e.g. admission of inerts) and no pressure loss to the environment ex-
ists. Typically a separate purge valve exists in such cases to discharge gases. The
pressure controller uses a split range function to access either the feed valve or the
purge valve.
MPC Level
10 V 1.0, Beitrags-ID: 42200753
Introduction
The control loop shows integrating behaviour if the position of mechanical parts is
controlled and the speed of the actuator is available as manipulated variable. An
"equilibrium condition" without move in the position only exists for a speed equal to
zero. The valve actuator is a common example for position control in process
plants. However, the valve position controllers are mostly integrated in the corre-
sponding actuators and hence not an issue for the DCS.
The level of most chemical reactors has to be kept in certain limits during continu-
ous operation. Therefore the drain flow (rotational speed of pump or set point of
subordinated flow controller) is available as manipulated variable and results in an
integral part transfer function as described in section 2.3.1. A multivariable control
problem including integral part transfer functions results if an additional quality con-
trol exists at the same reactor, e.g. with the reactor pressure as manipulated vari-
able (set point for the slave pressure controller). The residence time of the fluid in
the reactor as well as the progress and the result of the reaction (the product qual-
ity) are dependant on the drain flow, which is the manipulated variable of the level
controller.
Copyright Siemens AG 2010 All rights reserved
MPC Level
V 1.0, Beitrags-ID: 42200753 11
Stabilization of Unstable Control Loops
Step Response
14
12
10
Amplitude
6 ki
1
2
0
0 5 10 15 20 25 30 35 40 45 50
Time (sec)
t1
MPC Level
12 V 1.0, Beitrags-ID: 42200753
Stabilization of Unstable Control Loops
ki
The behaviour of an integrating process g i s can be described by
s t1 s 1
two parameters:
The maximal gradient ki of the response to a unit-step (of height one)
The delay time t1 needed by the process to reach its maximal gradient after a
step in the manipulated variable (intersection point of the tangent with the base
line in Figure 3-1)
The transfer function of the closed loop including a proportional-only controller
k s k p (kp is the proportional gain) is
g i s k s
g cl s
1
1 g i s k s t1 2 1
s s 1
k p ki k p ki
Thus the closed control loop has unity gain (the actual process value is equal to
the set point in steady state, if no disturbance at the input occurs) and two poles at
2
1
s1 / 2
1
4 t1 .
k p ki k k k p ki
p i
Copyright Siemens AG 2010 All rights reserved
Both poles are real, if the (absolute value of) gain kp of the controller is chosen
such that
1
kp .
4t1k i
Hence, an asymptotic stable control loop is ensured. A considerably smaller value
is a good starting point for a stable controller parameterization and a following
computer-based PID tuning, even if the specific values of the process are not
known exactly.
If the process is uncritical, an adequately small gain can be chosen arbitrarily and
used as starting point. You can increase this starting value iteratively until first indi-
cations of oscillations in the control loop become visible.
NOTE The sign of the controller gain must be negative, if the sign of the controlled
process ki is negative too (open drain valve -> level decreases)!
MPC Level
V 1.0, Beitrags-ID: 42200753 13
Stabilization of Unstable Control Loops
MPC Level
14 V 1.0, Beitrags-ID: 42200753
Configuration of MPC with Slave Controller
Figure 4-1 Original signal flow chart of an MPC with 2x2 process, where the main transfer
function g22 shows an integral action
g11
Copyright Siemens AG 2010 All rights reserved
CV1
g12
ModPreCon MV1
CV2
MV2
.
g21
CV2
g22
MPC Level
V 1.0, Beitrags-ID: 42200753 15
Configuration of MPC with Slave Controller
Figure 4-2 Signal flow chart of MPC with subordinated stabilizing PID controller for the
integral main transfer function g22
g11
CV1
g12
ModPreCon MV1
CV2
MV2
.
g21
PI
CV2
LIC
CV2 g22
Copyright Siemens AG 2010 All rights reserved
The slave controller stabilizes the control variable CV1 in general. The integral ef-
fect of the main transfer function g22 is compensates as well as the integral effect
of the coupling transfer function g21. The influence of MV2 on CV1 is also modified
by the slave controller due to g12.
All general notes on the configuration and commissioning of cascade controls are
relevant for this case (see Figure 5-1):
To get a correct anti windup calculation of the master controller, the range of
the manipulated variables of the master controller (respectively the corre-
sponding MPC channel) must be equal to the range of the external set point of
the slave controller (PID.SP_ExtHiLim… SP_ExtLoLim). Typically the MV limits
for automatic mode MViHiLim…MViLoLim are set tighter than the ones for
manual mode MViManHiLim…MViManLoLim in an MPC. Hence, the limits for
manual mode are set equal to the limits of the set point of the slave controller
and the ones for automatic mode are set even tighter only if necessary.
The master controller must be set to “tracking mode”, if the slave controller is
not in cascade mode (automatic mode with external set point) but in any other
mode (e.g. manual or automatic mode with internal set point) with no reaction
to instructions by the master controller (announced by PID.CascaCut= true).
The “tracking mode” must also be activated if a bad status of measurement
data at the master controller is detected. An OR-combination of both conditions
is passed to the binary input MPC.MV2TrkOn. To ensure a bumpless switching
back to cascade mode, the manipulated variable of the master controller
MPC.MV2Trk is linked to the current set point PID.SP of the slave controller.
The cycle time of the slave controllers in cascades must be at least as fast as
the cycle time of the master controller. In the present case this is ensured
automatically: the slave P(ID) controller runs in a standard fast cycle of the
automation system (typically 1s), while the MPC is moved to a slow cycle spe-
cific to the application after the model identification.
MPC Level
16 V 1.0, Beitrags-ID: 42200753
Configuration of MPC with Slave Controller
MPC Level
V 1.0, Beitrags-ID: 42200753 17
Configuration of MPC with Slave Controller
4.3 Commissioning
The parameterization of the controller and the commissioning is done „from interior
to exterior” as in any cascade control. First the slave controller is tuned (see chap-
ter 3) and switched to automatic mode. Afterwards the slave controller is switched
to cascade mode and the master controller is parameterized. While tuning the mas-
ter controller please consider that the whole inner closed control loop of the slave
controller is the controlled process of the master controller. Therefore the adjust-
able parameters of the master controller are not independent of the tuning of the
slave controller. The step experiments for the identification of the MPC models can
only be executed after the linking of the stabilizing slave controller, as the addi-
tional proportional-only controller affects the sub transfer functions g22, g21 and
g12 (see Figure 4-2).
A dead band can be used in the slave controller, if the level is not to be exactly
controlled to its set point. The controller has no reason to interfere with the process
as long as the controlled variable is inside the dead band. The control deviation
seems to be zero for the controller. Therefore, the control signal can be smoothed
to avoid valve wear, and variations of the drain flow can be reduced to obtain a
smooth feed for the downstream process components. The dead band should be
adjusted before the measurement data for the MPC configurator is recorded, as the
dead band influences the behaviour of the slave control loop. A dead band of at
least the same size must also be specified for the corresponding control channel of
Copyright Siemens AG 2010 All rights reserved
the master controller. Of course, the master controller is not able to reach the set
point more precisely as it is allowed by the dead band of the slave controller.
MPC Level
18 V 1.0, Beitrags-ID: 42200753
Simulation Example
5 Simulation Example
The simulation example was generated from a copy of the plant section ModPre-
Con of the APL_Example_EU, by introducing an additional integral block after the
transfer function Proc662.
Figure 5-1 Modified process simulation of the example project; the inserted integrator is marked in blue
Copyright Siemens AG 2010 All rights reserved
MPC Level
V 1.0, Beitrags-ID: 42200753 19
Simulation Example
Despite the interaction between both manipulated variables MV1 and MV2 and the
integral action of MV2 on PV2, both control variables PV1 and PV2 of the master
controller can be controlled to their given set points independently of each other,
which is a success of the described control concept. A “crosstalk” between the in-
teracting control loops can mostly be avoided, e.g. the level PV2 (dark green) is
only moved minimally during a set point step in SP1 (light blue). Specifics: Not only
the current value of the level PV2 (dark green) is reaching the set point SP2 of the
MPC (dark blue dashed) but also MV2 of the MPC (dark brown) in steady state, as
MV2 is simultaneously the set point of the slave level controller.
MPC Level
20 V 1.0, Beitrags-ID: 42200753
Conclusion
6 Conclusion
The area of application of the model predictive controller embedded in SIMATIC
PCS 7 is extended clearly by the described stabilization of unstable sub control
loops with the help of a slave proportional-only controller. A typical application is an
MPC where one controlled variable is the level of a tank, reactor, etc.
Copyright Siemens AG 2010 All rights reserved
MPC Level
V 1.0, Beitrags-ID: 42200753 21
Related Literature
7 Related Literature
7.1 Bibliography
This list is not complete and only represents a selection of relevant literature.
Tabelle 7-1
Titel
/1/ Krämer, S.
Auslegung von Standreglern in der verfahrenstechnischen Praxis. Dechema-
Seminar „Prozessregelungen – von den Grundlagen zu Advanced Control“, Sep.
2008.
/2/ Cheung, Tak-Fai und William L. Luyben
Liquid-Level Control in Single Tanks and Cascade of Tanks with Proportional Only
and Proportional-Integral Feed-back Controllers. Ind. Eng. Chem. Fund.,
18(1):15–21, 1979.
Subject Titel
\1\ Referenz auf den http://support.automation.siemens.com/WW/view/de/42200753
Beitrag
\2\ Siemens I IA/DT http://support.automation.siemens.com
Customer Support
\3\ http://en.wikipedia.org/wiki/Root_locus
MPC Level
22 V 1.0, Beitrags-ID: 42200753
History
8 History
Tabelle 8-1
Version Date Modifications
V1.0 04.’10 First version
Copyright Siemens AG 2010 All rights reserved
MPC Level
V 1.0, Beitrags-ID: 42200753 23