Beruflich Dokumente
Kultur Dokumente
Regulation
Tutor: R. Costa
From equation (1) a control-oriented model will be where the state variables are the hi tank water
developed to implement the NMPC strategy as de- levels for 1 ≤ i ≤ 4. Moreover, the control in-
scribed in the next section. A graphical schematic puts are u1 , qa and u2 , qb , corresponding to
of the four-tanks system is shown in figure 1. the two input flows to the upper tanks. Letter k
determines the discrete-time variable.
3.1 The Nonlinear Model Predictive The overall problem constraints are given in the
Control Approach CEA challenge document [1]. The bounding state
constraints are defined as
The NMPC strategy is chosen with the objec-
tive of not losing accuracy due to the linearisa- 0.2 m ≤ xi ≤ 1.2 m, i = 1, 2, 3, 4. (3)
tion of the system needed in the traditional MPC
approach. The advantage of this formulation is In addition to the state constraints, there is an-
that it is possible to find the optimal control so- other set of hard constraints related to the input
lution of the real system at the cost of changing water flows that feed the upper level tanks
a convex constrained optimisation to non-convex
optimisation. Usually the main drawback is the 0 m3 /h ≤ uz ≤ 2.5 m3 /h, z = a, b. (4)
time needed to find solutions, but given the sys-
tem’s sampling time, the computing time is small 3.4 Cost Function
enough to let the solver find a solution. Subopti-
The objective of the controller is to minimize the
mal solutions are found due to the flatness of the
function over the control horizon. The function
gradient of the cost function, but this solutions
to minimize is J(h, q, c, p), given by the problem
are close enough to the optimal solution for the
statement of the CEA challenge
objective of this work and close enough to guar-
antee feasibility in the next time-step. Vmin
J(h, q, c, p) = (qa2 + cqb2 ) + p . (5)
A(h1 + h2 )
To guarantee the feasibility of the next time-stem
the imposition of terminal conditions can be added
To implement the NMPC algorithm the cost func-
to the control scheme. This addition increases the
tion expressed in (5) has to be discretized and ex-
computational effort to conditions where the so-
pressed in state representation form
lution can not be found inside the sampling range
of time, hence it has been discarded from the Vmin
J(k) = (u1 (k)2 + cu2 (k)2 ) + p .
adopted solution. A(x1 (k) + x2 (k))
(6)
The cost function is computed over a given pre- 4.1 Controller Setup
diction and control horizons (Hp and Hc ).
One of the advantages of NMPC algorithms is the
3.5 NMPC Algorithm high degree of configuration that they offer (con-
trol and prediction horizons, penalization terms,
Let etc.). Table 1 shows the controller setup parame-
u(k) , (u(0|k), . . . , u(Hp − 1|k)) (7) ters and the computational effort for the simula-
tion scenario proposed for the CEA competition.
be the sequence of control inputs over a prediction
horizon Hp where there is also the dependence on
the initial condition x(0|k) , x0 . The NMPC al- Table 1: NMPC setup parameters.
gorithm proposed to regulate the water levels in
the four-tank system can be formulated as follows: Parameter Variable Value
Prediction horizon Hp 120
min J(x0 , u(k)), (8) Control horizon Hc 120
u(k)∈Rm×Hp Sampling time Tm 5s
Simulation time Tsim 4800 s
subject to
Computing time CP Ut 10 min
Av. optimization time (figure 9) Topt 0.58 s
• system model (2) over Hp ,
• state constraints (3) over Hp , In figure 2, a general representation of the closed-
loop control scheme for the NMPC approach im-
• input constraints (4) over Hp ,
plementation is showed.
It is useful to relax the state constraints, this leads
to reduced computation time while it keeps the
states in the admissible range of operation. Ad-
ditional costs could be added to represent this re-
laxation of constraints but experiments showed it
was not necessary to add this additional weights
to the cost function.
To define the control horizon (Hp ) it is necessary Figure 2: Closed-loop control scheme
to take into account the sampling time and the
dynamics of the system. If Hp is too small the
controller does not produce a significant impact 4.2 Results and Discussion
on the system due to the small optimization win- The computing time for each of the simulations is
dow, thus the cost of the control action is too big around 10 minutes each time the algorithm runs to
compared to the final effect. In consequence, Hp study 80 minutes of the behaviour of the system.
has to be at least big enough to be able to see The computing time is below the real response of
significant results in the relevant outputs, corre- the system, hence the adapted solution is adequate
sponding to states x1 and x2 . A critical issue in to be implemented in a real plant.
the election of Hp is the stability of the closed loop
system, the values considered for Hp have never The behaviour of the water level of each tank ver-
presented stability problems. Finally the control sus the ideal trajectory planned by the reference
horizon (Hc ) must be defined, the computation generator is represented in figures 3, 4, 5 and 6.
time is not critical and allows to use Hc equal to As it can be seen in previous figures, not always
Hp . In table 1 the parameter configuration for the the real tank level arrives to the ideal trajectory
simulations are presented. with the same velocity. The prioritisation of the
minimal cost of the trajectory over the reference
tracking of the tank levels result in the shown wa-
4 Simulation Results
ter dynamical behaviour.
The initial state for all simulations is x0 =
(h1 , h2 , h3 , h4 ) = (0.5955, 0.6616, 0.5384, 0.7682)
in [m]. The simulations have been carried out us-
ing fmincon in MATLAB
R R2011a (32 bits), run-
ning in a PC Intel
R CoreTM i7-3770 at 3.40GHz
with 8GB of RAM.
Tank 1 Tank 4
0.9 1.2
Tank reference Tank reference
Tank level 1.1 Tank level
1
0.8
0.9
0.8
0.7
h1 [m]
h4 [m]
0.7
0.6
0.6
0.5
0.4
0.5 0.3
0.2
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Time [s] Time [s]
Water flows
2.6
0.8
qa*
2.4 qa
h2 [m]
qb*
0.7
2.2 qb
2
0.6
1.8
m3 / h
0.5
1.6
1.4
0.4
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Time [s] 1.2
Tank 3
1 Figure 7: Water flows behaviour
Tank reference
Tank level
0.9
0.3
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Time [s]
7
500
6
5
400
4
3 300
ID
2
J
200
1
0
100
−1
−2 0
−3
−100
−4
0 1000 2000 3000 4000 5000
0 1000 2000 3000 4000 5000 Time [s]
Time [s]
5 Conclusions
Optimization time
0.95
A NMPC controller has been designed and imple-
0.9
mented to be applied to the four-tanks system.
0.85 The performance of the controller has been eval-
0.8
uated, obtaining low ID values in the simulation
scenario proposed in the contest. The proposed
0.75
Topt [s]
References
[1] Descripción de la Fase 1. URL:
http://www.ceautomatica.es
[2] De Schutter, B., & van den Boom, T. J.
(2004). MPC for continuous piecewise-affine
systems. Systems & Control Letters, 52(3),
179-192.
[3] Gatzke, E. P., Meadows, E. S., Wang, C., &
Doyle Iii, F. J. (2000). Model based control of
a four-tank system. Computers & Chemical
Engineering, 24(2), 1503-1509.
[4] Grüne, L., & Pannek, J. (2011). Nonlin-
ear Model Predictive Control (pp. 43-66).
Springer London.
[5] Johansson, K. H. (2000). The quadruple-tank
process: A multivariable laboratory process
with an adjustable zero. Control Systems
Technology, IEEE Transactions on, 8(3), 456-
465.
[6] Khalil, H. K., & Grizzle, J. W. (2002). Non-
linear systems (Vol. 3). Upper Saddle River:
Prentice hall.
[7] Maciejowski, J. M. (2002). Predictive control:
with constraints. Pearson education.
[8] Mhaskar, P., El-Farra, N. H., & Christofides,
P. D. (2005). Robust hybrid predictive con-
trol of nonlinear systems. Automatica, 41(2),
209-217.