Professional Documents
Culture Documents
Model Predective Control
Model Predective Control
Model Predective Control
a r t i c l e i n f o a b s t r a c t
Article history: Model-predictive control algorithms are applied to a high capacity reverse osmosis (RO) membrane desa-
Received 19 December 2007 lination process simulation that utilizes feed flow reversal in order to prevent and/or reverse scale crystal
Received in revised form 18 June 2008 formation on the membrane surface. A dynamic non-linear model which incorporates feed concentration
Accepted 18 June 2008
and membrane properties is used for simulation and demonstration of optimally controlled feed flow
reversal. Before flow reversal can take place on a high capacity RO plant, the flow into the membrane unit
must be carefully reduced to eliminate the risk of membrane module damage and unnecessary energy
Keywords:
consumption. A cost function is formulated for the transition between the normal high flow steady-state
High-recovery reverse-osmosis
desalination
operating point to a low flow steady-state operating point where it is safe to reverse the flow direction.
Model-predictive control Open-loop and closed-loop simulations demonstrate non-linear model-predictive control strategies that
Flow reversal induce transition from the high-flow to low-flow steady-states in an optimal way while subjected to
plant-model mismatch on the feed concentration, actuator magnitude and rate constraints, and sampled
measurements.
Ó 2008 Elsevier Ltd. All rights reserved.
0959-1524/$ - see front matter Ó 2008 Elsevier Ltd. All rights reserved.
doi:10.1016/j.jprocont.2008.06.016
434 A.R. Bartman et al. / Journal of Process Control 19 (2009) 433–442
When operating a system that utilizes feed flow reversal, it is to the system presented in Fig. 2, but it is important to note that
important to carry out the mode switching (from forward flow to these MPC algorithms can be adapted to any flow reversal
reverse flow) in a manner which will not cause water hammer. equipped reverse osmosis system where the operator is able to
The phenomenon of water hammer takes place when fluid moving control the stream velocity entering the membrane units. Model-
at a moderate to high velocity (velocity > 1.5 m/s for the example predictive control has not been employed for use with the feed
in this work) suddenly encounters a blockage in the pipe (for in- flow reversal technique, but has been evaluated for the overall con-
stance, when a solenoid valve is instantly closed). The fluid’s inertia trol of RO desalination processes [1]. It is noted that in a recent
causes it to slam into the blockage, causing a pressure wave and of- work [11], Lyapunov-based non-linear control systems and mod-
ten wear/damage to the process equipment [8]. The Joukowski for- el-based monitoring schemes were designed for fault-tolerant con-
mula [15] can be used to estimate the magnitude of the pressure trol of RO processes in the presence of actuator faults without
wave caused by water hammer for a given system configuration, dealing with the issue of optimization of the feed flow reversal pro-
and it is seen that this problem can be especially prominent in cess. Optimization with MPC requires the use of a RO desalination
large systems with a high feed flow rate. system model, which has been derived based on mass and energy
For example, consider the system presented in Fig. 2. Initially balances [10]. A cost function that takes into account control ac-
solenoid valves s2 and s3 are closed and s1 and s4 are open. Further- tion, stream velocities, and system pressure is proposed, along
more, the velocity entering the membrane unit, vfr, is 10 m/s. When with several hard process constraints which represent physical
flow reversal is initiated, solenoid valves s2 and s3 are opened and limitations of the system. The model, cost function, and constraints
assuming similar flow resistance in each path, the flow splits are arranged into a non-linear optimization problem which is
approximately evenly through the three possible paths. The flows solved through the use of a numerical optimization algorithm.
through s2, s3, and the membrane unit are approximately 3.3 m/s. Closed-loop simulations with MPC are performed in this work to
However, the flow going through s1 and s4 is approximately demonstrate the mode switching dynamics. The MPC algorithm
6.7 m/s. With a maximum velocity threshold of 1.5 m/s, none of is also applied to the system when a plant-model mismatch on
these flow velocities are low enough to enable the closure of a sole- feed concentration is imposed. This plant-model mismatch will al-
noid valve without the possibility of causing component damage low for evaluation of the disturbance rejection by the controller
through water hammer. From this example, it is clear that with when using feedback from the plant model.
the configuration seen in Fig. 2, water hammer is of concern when
the velocity into the membrane units is approximately 1.5 times 2. RO system model
the water hammer threshold.
Motivated by these considerations, the goal of this work is to As seen in Fig. 2, feed water enters the system and is pressur-
use model-predictive control (MPC) to determine the optimal ized by the high-pressure pump. The pressurized stream is split
switching path from normal operating conditions to a condition into a bypass stream (with velocity vb) and the stream which en-
where the stream velocity entering the membranes is much lower; ters the spiral-wound membrane unit(s) (vfr). Two streams also
preventing water hammer during solenoid valve closure while exit the membrane module, the retentate (or brine) stream, with
avoiding pressure fluctuations and decreased process performance velocity vr, and the permeate stream. The downstream pressure
during the transition. Alleviating these phenomena will prolong of all of the exit streams is assumed to be atmospheric pressure.
equipment life-span and help to maximize the productivity of The model derivation is based on an overall mass balance and
the RO system. The formulation presented in this work is specific local energy balances around the valves of the system [10]. In
Fig. 1. An expanded view the flow reversal configuration surrounding the spiral-wound unit.
10 2
dvr A2p Ap 1 Ap evr v2r
¼ ðvf vb vr Þ þ Dp ð2Þ
dt Am K m V qV 2 V
qAp
P sys ¼ ðvf vb vr Þ þ Dp ð5Þ where l and / are constants depending on the valve properties. For
Am K m
the model presented in this paper, the curve relating valve position
where q is the fluid density, V is the system volume, vf is the feed (Op) to resistance value (ev) is shown in Fig. 3. It can be seen in Fig. 3
velocity, Ap is the pipe cross-sectional area, Am is the membrane that as the valve position goes to zero (fully closed), the valve resis-
area, Km is the membrane overall mass transfer coefficient, Cf is tance values begin to grow at an increasing rate; and as the valve
the amount of total dissolved solids (TDS) in the feed, a is an effec- approaches the fully-open position, the resistance values change
tive concentration weighting coefficient, d is a constant relating slowly. This treatment of the valve characteristics allows for con-
effective concentration to osmotic pressure, vb is the bypass flow straints based on valve actuator speed to be incorporated into the
velocity, vr is the retentate flow velocity, Psys is the system pressure, RO system model and into the controller calculations.
R is the fractional salt rejection of the membrane, evb is the bypass
valve resistance, and evr is the retentate valve resistance. Using
3. Model-predictive control of flow reversal
these dynamic equations, various control techniques can be applied
using the valve resistance values as the manipulated inputs (evb,
When switching the system into flow reversal mode, it is de-
evr). At very small valve resistance values, the valve behaves as an
sired to bring the feed velocity into the membranes (vfr) below
open pipe; as the valve resistance becomes very large, the valve be-
the velocity threshold; where the flow will not cause significant
haves as a total obstruction and the flow velocity goes to zero [2].
water hammer when the solenoid valves are closed. In order to de-
In order to accurately model the valve dynamics and obtain
crease the membrane feed velocity (vfr), it will be necessary to
practical constraints, the concept of valve Cv is used. The definition
open the bypass valve. It is desired to keep the system pressure
of Cv for a valve in a water system is presented in Eq. (6), where Q is
constant while decreasing the velocity so that the membrane and
the volumetric flow rate through the valve.
system components will not be damaged. This can be done by clos-
Q ing the retentate valve while the bypass valve is being opened, in
C v ¼ pffiffiffiffiffiffiffiffi ð6Þ
P sys such a fashion that the system pressure fluctuates less than a
Using a simplified energy balance around one valve: pre-defined tolerance. MPC is used to complete this transition in
an optimal way.
dv Psys Ap 1 Ap ev v2 When reversing the flow, the solenoid valves (si), arranged as
¼ ð7Þ
dt qV 2 V seen in Fig. 1, are opened/closed in a specific sequence. First, valves
Steady-state is assumed, and the simplified energy balance is rear- s2 and s3 are opened, then valves s1 and s4 are closed. After these
ranged to yield: actions are completed, the retentate and bypass valves can be
manipulated to return the process to the desired steady-state.
1
Cv ¼ qffiffiffiffiffiffiffiffiffiffiffi ð8Þ The normal steady-state operating point is used as the initial con-
1
Ap 2
qev dition for the mode switching. To determine the final state after
mode switching, the procedure is as follows: Using the normal
Depending on the type of valve and its flow characteristics, it is as- steady-state operating point, the pressure set point is calculated
sumed that the Cv value (and in turn, the ev values from the model) using Eq. (5). In this case, P spsys ¼ 457:51 psi. Second, setting the by-
can be related to the valve position (percentage open) through the pass velocity to vf 1:5 m/s (equivalent to setting vfr ¼ 1:5 m/s)
following logarithmic relation based on commercially available and using the desired pressure set point, the low-flow steady-state
valve data: operating point value for vlss r can be determined. With the steady-
0 1
state values of vlss
r , vlss
b , and the pressure set point P sp
sys , the model
B 1 C equations can be solved for the valve resistance values elss
Op ¼ l ln @ qffiffiffiffiffiffiffiffiffiffiffiA þ / ð9Þ vb and
Ap 12 qev elss
vr corresponding to the low-flow operating point. Following this
procedure, the low-flow steady-state operating point is known,
436 A.R. Bartman et al. / Journal of Process Control 19 (2009) 433–442
but the optimal path taken to get there from the initial operating 6. Only the first of the optimal control inputs, u(tcurrent), is applied;
steady-state is not. the system of Eqs. (1) and (2) is numerically integrated for one
While it is desired to complete this flow direction switching time-step (from t = tcurrent to t = tcurrent + tstep) using the first
with minimal impact on the system pressure, and in the shortest optimal control value to yield a new initial state for the next
time possible, it is also necessary to factor in several system optimization.
parameters such as pressure variation allowed, the bypass stream 7. The remaining optimal control values for the prediction horizon
velocity as compared to the water hammer threshold, and the are used as an initial guess for the computation of the control
amount of control energy expended. To account for these issues, values in the next step.
an optimization cost function is first proposed: 8. All steps are repeated for each optimization time-step from t = 0
2 !2 to t = tf tstep.
nX
c þN
2
Cðx; x0 ; uÞ ¼ 4a PsysspðiÞ 1 þ b vfr ðiÞ 1
i¼nc
Psys vwh As implicitly stated above, all control values are applied in a
0 !2 13 sample-and-hold fashion; that is, a control value used in the inte-
2
e vb ðiÞ e vr ðiÞ gration on the interval [tstep n1 tstep n Þ is held constant over the en-
þc@ 1 þ 1 A5 ð10Þ tire interval, and then a new control value is determined by the
elss
vb
elss
vr
optimization for the interval [tstep n t step nþ1 Þ.
where nc is the current time-step, nc + N is the current time-step
plus the prediction horizon, and vwh is the water hammer threshold 4. Simulation results
velocity. The prediction horizon, N, is defined such that the optimi-
zation is performed from the current time-step to N time-steps in 4.1. Overview
the future (i.e., from t = tcurrent to t = tcurrent + Ntstep).
The values of the cost function of Eq. (10) depend on the initial In order to test the feasibility of MPC for feed flow reversal in a
state of the system (x0) and the state of the system between t(nc) reverse osmosis desalination system, several simulation studies
and t(nc + N) (the state, x, is comprised of vb and vr). The cost func- were carried out. Initially, it was desired to examine the effect of
tion also depends heavily on the control actions used (u), and using the model-predictive controller to switch between steady-
weights given to the individual terms by the weighting coefficients states when the process conditions are identical to the nominal
a, b, and c. As the optimization procedure is carried out, the opti- plant model. Using a sampling time approximately one tenth of
mization algorithm allows for a set of non-linear constraints to the system step response time, the model-predictive control for-
be employed. In this formulation, the following two hard actuator mulation is applied to the system with various prediction horizons.
constraints are enforced: These simulations are subsequently compared to an ‘‘open-loop
manually controlled” transition where the control inputs are
Opi P 0 ð11Þ
manipulated to their final values at the maximum rate allowed
by the constraints, as well as the case where the transition is con-
dOpi
j j 6 Rmax
valve ð12Þ trolled using proportional–integral (PI) control.
dt
Next, it was desired to simulate the switching between steady-
The first constraint forces the valve position values to be positive, states in the presence of a plant-model mismatch on the feed TDS
since negative values of this variable would be physically meaning- value. The controller receives state feedback from the plant model
less. The second constraint sets a maximum rate of opening/closing at the end of each time-step (i.e., measurements of vb and vr), but
for the valves, Rmax
valve . Additional constraints can be added; con- an offset in system pressure and stream velocity is observed due to
straints on maximum system pressure or other system variables the mismatched MPC controller. Simulations are conducted at sev-
may be desirable for certain types of RO operations. eral prediction horizons, and an integral control input is applied
In order to optimize the constrained transition from normal after the MPC reaches steady-state in order to bring the system
flow to low-flow and incorporate feedback into the calculation of pressure back to the nominal pressure set point; see Table 1.
the control action, a non-linear model-predictive control (MPC) Finally, due to the relatively fast time scale of the system
formulation is implemented [4,5,13,14]. In this method, a time dynamics, the use of a steady-state approximation of the dynamic
frame for the transition is chosen, t = 0 to t = tf, along with an opti- model equations (Eqs. (1) and (2)) was also investigated in the
mization time-step tstep and a prediction horizon N. Using these
optimization parameters and the constraints along with the RO
system model and the cost function weighting parameters a, b, Table 1
and c, the MPC control scheme can determine an optimal pair of Process parameters and normal mode steady-state values (nss)
control inputs, evb and evr, for each time-step.
q = 1000 kg/m3
The MPC optimization involves the following procedure: V = 0.04 m3
vf = 10 m/s
1. The initial state vector and initial control value guesses are Ap = 1.27 cm2
passed to a non-linear optimization algorithm based on sequen- Am = 30 m2
Km = 9.218 109 s/m
tial quadratic programming.
Cf = 10,000 mg/L
2. The optimization algorithm numerically integrates the model a = 0.5
equations from t = tcurrent to t = tcurrent + Ntstep using the initial T = 25 °C
state vector and control value guesses. R = 0.993
3. The resulting state vector is used to calculate the value of the l = 24.270
/ = 153.554
cost function. d = 0.2641 Pa/(ppm*K)
4. A new set of control inputs are determined, and steps 2–4 are vnss
b = 1.123 m/s
repeated until a minimum cost value is found (i.e., minevb ;evr vnss
r = 4.511 m/s
sp
Cðx; x0 ; uÞ) subject to the constraints of Eqs. (11) and (12). P sys = 457.51 psi
enss
vb = 5000
5. Optimal control inputs for each tstep are made available to the
enss
vr = 310
controller and actuators.
A.R. Bartman et al. / Journal of Process Control 19 (2009) 433–442 437
30
480 Opr
20
470 10
0 2 4 6 8 10
460
Fig. 6. Steady-state switching using MPC in the absence of plant-model mismatch:
valve positions vs. time for N = 1 (solid line), N = 3 (dashed line), and N = 5 (dotted
450
line).
440
control horizon is instrumental in minimizing pressure
430
fluctuations.
The benefits of implementing MPC on the system pressure can
be seen even more clearly when the optimized cases are compared
420 to the ‘‘open-loop manually controlled” pressure in Fig. 7, where
the valves are adjusted to their final steady-state at the maximum
410 rate allowable by the constraints. In this case, a 100 + psi pressure
variation caused by the ‘‘open-loop manually controlled” operation
400 is observed; about two times larger than the one under MPC. Of
0 2 4 6 8 10 course, the acceptable pressure deviation during mode transition
depends on the specific RO process under consideration. However,
Fig. 4. Steady-state switching using MPC in the absence of plant-model mismatch:
the proposed MPC approach to addressing this control problem is
system pressure vs. time for N = 1 (solid line), N = 3 (dashed line), and N = 5 (dotted flexible enough to allow for variation in the acceptable pressure
line), including pressure set point (horizontal line). level. Furthermore, it is important to point out that one can
438 A.R. Bartman et al. / Journal of Process Control 19 (2009) 433–442
580 500
560 480
540 460
440
520
420
500
400
480
380
460
360
440
340
420
320
400
0 1 2 3 4 5 6 7 8 9 10 300
0 2 4 6 8 10
9
4.1
8 vb
7
4.095
0 5 10 15
6
Fig. 10. Total optimization cost vs. prediction horizon with upper and lower bounds 5
based on maximum transition speed.
4
tion, the MPC controlled cases should perform better than the max-
imum speed transition (again, the ‘‘open-loop manually con- 3
trolled” case) where the pressure is weighted equivalently to the
MPC controlled cases. It can be seen in Fig. 10 that all of the MPC 2
controlled cases at various prediction horizons fall between these
two bounds. It is also noted that the magnitudes of the cost func- 1 vr
tion values depend on the individual weighting on each term, but
the trend will be independent of term weighting. 0
0 2 4 6 8 10
470 100
460 Opb
90
450 80
440 70
430 60
420 50
410 40
400 30
390 20 Opr
380 10
0 2 4 6 8 10 0 2 4 6 8 10
Fig. 11. Steady-state switching using MPC in the presence of plant-model Fig. 13. Steady-state switching using MPC in the presence of plant-model
mismatch on feed TDS: system pressure vs. time for N = 1 (solid line), N = 3 (dashed mismatch on feed TDS: valve positions vs. time for N = 1 (solid line), N = 3 (dashed
line), and N = 5 (dotted line), including pressure set point (horizontal line). line), and N = 5 (dotted line).
440 A.R. Bartman et al. / Journal of Process Control 19 (2009) 433–442
plied to the system after the MPC has finished acting. This integral where ubf MPC represents the final value for the MPC bypass valve con-
term can be implemented in the following two ways: First, trol action after reaching the steady-state determined by the opti-
Z tc mization, ðvb vlss b Þ is the error between the actual bypass
1
urtotal ¼ urfMPC þ ðPsys Psp
sys Þdt ð15Þ velocity and the low-flow steady-state bypass velocity, and sbi is
sri 10 the integral time constant (sbi ¼ 30 1
).
where urfMPC represents the final value for the MPC retentate valve In the results presented in Figs. 14–16, it is seen that the MPC
control action after reaching the steady-state determined by the optimization reaches a steady-state around t = 8 s; after this stea-
optimization, tc is the current time, and ðPsys Psp dy-state is reached, the MPC is deactivated and the integral control
sys Þ is the error be-
tween the actual system pressure and the nominal set point pres- is initiated at t = 10 s. In both cases, the offsets are eliminated; the
sure, and sri is the integral time constant (sri ¼ 10). Second, offset on pressure is eliminated in the case of the integral term
Z tc
using pressure measurements, and the offset on bypass velocity
1 is eliminated in the second case. It can also be observed that the
ubtotal ¼ ubf
MPC þ ðvb vlss
b Þdt ð16Þ
s b
i 10 system pressure deviates even more than the original offset in
460 100
90 Opb
450
80
440
70
430
60
420 50
40
410
30
400
Opr
20
390
10
380 0
0 2 4 6 8 10 12 14 16 18 20
0 5 10 15 20
Fig. 14. Mode transition using MPC and integral control in the presence of plant-
Fig. 16. Mode transition using MPC and integral control in the presence of plant-
model mismatch on feed TDS: system pressure vs. time for integral term based on
model mismatch on feed TDS: valve positions vs. time for integral term based on
system pressure (solid line) and integral term based on bypass velocity (dashed
system pressure (solid lines) and integral term based on bypass velocity (dashed
line) with pressure set point (dotted line) for N = 1.
lines) for N = 1.
9
600
8 vb
550
7
6
500
450
4
3 400
2
350
1 vr
0 300
0 5 10 15 20 0 1 2 3 4 5 6 7 8 9 10
Fig. 15. Mode transition using MPC and integral control in the presence of plant- Fig. 17. Mode transition using MPC in the absence of plant-model mismatch:
model mismatch on feed TDS: bypass and retentate stream velocities vs. time for system pressure vs. time for algebraic steady-state MPC formulation (dashed line),
integral term based on system pressure (solid lines) and integral term based on ‘‘open-loop manually controlled” case (solid line), and first PI approach (dotted
bypass velocity (dashed lines) for N = 1. line).
A.R. Bartman et al. / Journal of Process Control 19 (2009) 433–442 441
the case where the integral term is based on the bypass velocity. In the stream velocity and control action plots (Figs. 18 and 19),
Other methods may be used to correct for MPC offset due to it is seen that the algebraic steady-state MPC formulation is very
plant-model mismatch; the approach followed here is only one similar to the ‘‘open-loop manually controlled” case, but the small
example. For more detailed information on PI controller tuning, differences in control action have a large effect on the system pres-
see [12]. sure. A large fluctuation in system pressure can be observed in Fig.
17, showing that even with a larger sampling time, a prediction
4.4. Use of steady-state process model in MPC horizon of one, and only using steady-state algebraic equations
in the optimization algorithm, the MPC formulation still performs
Finally, the issue of reduction of the time needed to compute much better than the ‘‘open-loop manually controlled” case. As ex-
the control action by MPC is investigated. Specifically, motivated pected, the steady-state MPC formulation does not perform as well
by the fast time-scale of the RO system dynamics, an algebraic as the closed-loop system using the MPC with dynamic model
steady-state approximation of the model equations is used in place equations. In terms of computation time, it was found that the
of the dynamic model in the MPC formulation. In this case, the MPC steady-state algebraic MPC formulation and the MPC formulation
algorithm with a prediction horizon N = 1 takes the form: using the dynamic model computed the optimal control actions
2 !2 0 !2 13
nX
c þ1
2 2
min 4a PsysspðiÞ 1 þb
vfr ðiÞ
1 þc@ evb ðiÞ
1 þ
evr ðiÞ
1 A5
evb ;evr
i¼nc
Psys vwh elss
vb
elss
vr
In Figs. 17–19, the closed-loop system results (under the MPC) in approximately the same amount of time (for any given predic-
using the steady-state algebraic equations with a sampling time tion horizon). The steady-state algebraic MPC formulation of Eq.
of 1 s are presented and compared to the ‘‘open-loop manually (17) is slightly faster in terms of computation time relative to the
controlled” case (where the valves are opened to their final stea- MPC with the dynamic process model, but the benefits of increased
dy-state at the maximum rate allowed).
9
100
8 vb
90 Opb
7
80
6
70
5
60
4
50
3
40
2
30
1 vr Opr
20
0
0 2 4 6 8 10 10
0 2 4 6 8 10
Fig. 18. Mode transition using MPC in the absence of plant-model mismatch:
stream velocities vs. time for algebraic steady-state MPC formulation (dashed line), Fig. 19. Mode transition using MPC in the absence of plant-model mismatch: valve
‘‘open-loop manually controlled” case (solid line), and first PI approach (dotted positions vs. time for algebraic steady-state MPC formulation (dashed line), ‘‘open-
line). loop manually controlled” case (solid line), and first PI approach (dotted line).
442 A.R. Bartman et al. / Journal of Process Control 19 (2009) 433–442