ABSTRACT
This article presents a model-predictive controller (MPC) for the maximization of the energy efficiency of a closed-circuit desalination reverse osmosis (CCRO) system. CCRO is a process for producing drinking water that is based on a cyclic operation with the following two phases: (a) filtration and (b) drain. In this article, we test model predictive control for optimal control of this process. The most important features of our approach are as follows: (a) the selection of a model structure that enables reliable forecasts of the filtration phase (up to 3 h), (b) an on-line model calibration strategy that ensures model forecast reliability, and (c) the satisfaction of equipment safety and operational constraints on the selected setpoints. We challenge this through deliberate introduction of changes in the unmeasured feed concentration and the applied constraints. Our results indicate that frequent model parameter updates are critical to maintain model reliability for MPC purposes. In addition, we illustrate that parameter identifiability is not guaranteed and that deliberate variation in flow rates is necessary even though the process never operates in steady state. Finally, MPC can compute flow rate setpoints that maximize the energy efficiency of the CCRO process while satisfying the applicable equipment and safety constraints.
HIGHLIGHTS
Model predictive control enables optimization of closed-circuit reverse osmosis.
Our strategy successfully selects optimal values for the feed and recirculation flow rate.
Frequent model parameter updates are critical to maintain model reliability.
INTRODUCTION
Desalination processes are used to separate salts and minerals from water. Early days of desalination used phase-change processes such as evaporation and distillation to remove water from saline streams, but modern processes rely on semipermeable membranes such as reverse osmosis (RO) and nanofiltration (NF) to retain salts and allow mainly water to diffuse through the barrier (El-Dessouky & Ettouney 2002). While early applications of membrane desalination focused on seawater and brackish groundwater desalination, present appplications include water reclamation for reuse and industrial and residential water purification (Kucera 2015).
While RO is now an established commercial process, it exhibits high energy consumption compared to the energy demand of conventional water purification processes (Zhu 2012). In addition, membrane fouling and mineral scaling limit water recovery (i.e., the amount of product water per unit of feed water) while increasing the cost of operation (e.g., cleaning time, chemicals, membrane replacement, labor) (Salinas-Rodríguez et al. 2021). Moreover, the operating pressure and water flux in RO and NF are limited, thereby further restricting water recovery. To overcome these hurdles, manufacturers and researchers have been developing unique solutions that can lead to reduced cost of operation and energy demand in desalination.
CCRO has many benefits compared to conventional RO. One of the interesting features is that the recycle flow during filtration can be manipulated independently of the feed flow rate into the system. This can be used to increase the shear forces at the membrane surface and reduce the thickness of the concentration boundary layer, thus increasing product water quality, reducing operating cost due to lower osmotic pressure at the membrane surface, and reducing potential mineral scaling on the membrane. In addition, operating in a closed loop enables desalination for a short period of time while the water is supersaturated with some minerals before the brine is flushed out of the system, thus enabling an even higher water recovery.
Model predictive control (MPC) is an advanced control method that uses a dynamic model of the system’s behavior for optimal control. The model is used to (a) evaluate the future value of a mathematical objective function, which is a function whose value will be minimized or maximized, and (b) assess whether applicable constraints are satisfied. MPC chooses the optimal control actions while maintaining safe operations. This approach was pioneered in the 1970s and has arguably become a standard practice in industries with complex processes, such as chemical manufacturing and oil and gas refining. It has demonstrated superior process optimization capability compared to more simplistic conventional approaches that use operator inputs to define setpoints such as proportional–integral–derivative (PID) control (Eaton & Rawlings 1992; Lee 2011; Ruchika 2013). Despite historical successes, MPC has found limited implementation in industries that lack large engineering support organizations. This is in large part due to the highly specialized knowledge in model development, optimization, and control theory required to develop, tune, and maintain MPC control schemes (Schwenzer et al. 2021). In this article, we report on our efforts to reduce the burden associated with model definition and maintenance.
One of the challenges in using MPC specific to water treatment is that typical water infrastructure are subject to frequent changes that affect the process dynamics (Rivas-Perez et al. 2019). Examples include pump degradation, changes in valve resistance, membrane fouling and scaling, membrane or membrane spacer compaction, changes in influent composition that affect permselectivity, and concentration polarization (Hoek et al. 2008; Li et al. 2012). In addition, real-time water quality measurements are often limited to conductivity, pH, TOC, turbidity, and specific ions, which do not offer a detailed view on the identity and concentration of salt species. Together, unmeasured changes in the process and feed water means that a model will quickly become inaccurate without updates. Thus, any MPC strategy critically depends on an effective strategy for model updating while MPC is in use, also known as adaptive MPC (Adetola & Guay 2011).
Improving the control of RO desalination has been investigated since the late 1990s. Early efforts applied system identification methods for model development paving the way for model-based optimization approaches such as dynamic matrix control within simulated RO systems. These efforts were directed to achieve faster convergence of single setpoint variable such as water permeation rate and dual setpoint variables such as water permeation rate and product water conductivity compared to conventional proportional–integral (PI) controllers (Alatiqi et al. 1989; Abbas 2006). A key focus of prior work has been the development of tractable approaches for tuning and implementing MPC for RO water desalination. Optimization-based control has also been investigated in view of minimization of the energy requirements per unit of product water, also known as the specific energy consumption (SEC) in RO systems (Bartman et al. 2010). So far, the need for adaptive control has received limited attention in the field of water production system optimization.
In this work, we focus on the CCRO process because it is in an early stage of development. This provides a unique opportunity to simultaneously design and test optimal control strategies. While conceptually simple, CCRO is a complex process to optimize. The closed loop design and the cyclic operation makes nonlinear behavior more apparent compared to continuous-flow, as will be illustrated below. We focus on the manipulation of permeate and recirculation flowrates during the filtration phase as a way to minimize the system’s integral SEC (iSEC). We challenge our MPC strategy by experimental evaluation on a pilot-scale CCRO system and show that MPC can be successfully applied for process optimization with a variety of operational constraints.
MATERIALS & METHODS
Experimental pilot: CCRO
Design and construction
Hydraulics










List of symbols
Symbol . | Description . | Units . |
---|---|---|
![]() ![]() | Standard deviation for perturbation of the feed and recirculation flow rate setpoints | kWh |
![]() ![]() ![]() | Model parameters for concentrate conductivity | -, mS . min/cm . L, min/L |
![]() ![]() | Model parameters for recirculation pump power draw | kWh . min/L, kWh . min2/L2 |
![]() ![]() ![]() | Model parameters for feed pump power draw | kWh, kWh . min/L, kWh . cm/mS, |
![]() | Number of seconds between flow rate setpoint changes | – |
![]() ![]() ![]() | Concentrate conductivity (measured, smoothed) | mS/cm |
![]() | Concentrate conductivity lower control limit | mS/cm |
![]() | Concentrate conductivity upper control limit | mS/cm |
![]() | Feed flow rate | L/min |
![]() | Feed flow rate lower control limit | mS/cm |
![]() | Feed flow rate upper control limit | mS/cm |
![]() ![]() ![]() | Permeate flow rate (measured, smoothed) | L/min |
![]() ![]() ![]() | Recirculation flow rate (measured, smoothed) | L/min |
iSEC | Integral specific energy consumption | kWh/m3 |
![]() | Cycle index | – |
![]() | Index of the flow rate setpoint | – |
k | Sample index | – |
![]() | Length of a setpoint sequence | – |
N | Number of seconds until concentrate conductivity upper control limit is reached | – |
![]() ![]() ![]() | Feed pump power draw (measured, smoothed) | kWh |
![]() ![]() ![]() | Recirculation pump power draw (measured, smoothed) | kWh |
SEC | Specific energy consumption | kWh/m3 |
![]() | Time since start of the filtration phase | s |
![]() | Recirculation/drain valve position | – |
W | Window length for median filter | – |
![]() | Recirculation flow rate setpoint perturbation | – |
![]() | Feed flow rate setpoint perturbation | – |
Symbol . | Description . | Units . |
---|---|---|
![]() ![]() | Standard deviation for perturbation of the feed and recirculation flow rate setpoints | kWh |
![]() ![]() ![]() | Model parameters for concentrate conductivity | -, mS . min/cm . L, min/L |
![]() ![]() | Model parameters for recirculation pump power draw | kWh . min/L, kWh . min2/L2 |
![]() ![]() ![]() | Model parameters for feed pump power draw | kWh, kWh . min/L, kWh . cm/mS, |
![]() | Number of seconds between flow rate setpoint changes | – |
![]() ![]() ![]() | Concentrate conductivity (measured, smoothed) | mS/cm |
![]() | Concentrate conductivity lower control limit | mS/cm |
![]() | Concentrate conductivity upper control limit | mS/cm |
![]() | Feed flow rate | L/min |
![]() | Feed flow rate lower control limit | mS/cm |
![]() | Feed flow rate upper control limit | mS/cm |
![]() ![]() ![]() | Permeate flow rate (measured, smoothed) | L/min |
![]() ![]() ![]() | Recirculation flow rate (measured, smoothed) | L/min |
iSEC | Integral specific energy consumption | kWh/m3 |
![]() | Cycle index | – |
![]() | Index of the flow rate setpoint | – |
k | Sample index | – |
![]() | Length of a setpoint sequence | – |
N | Number of seconds until concentrate conductivity upper control limit is reached | – |
![]() ![]() ![]() | Feed pump power draw (measured, smoothed) | kWh |
![]() ![]() ![]() | Recirculation pump power draw (measured, smoothed) | kWh |
SEC | Specific energy consumption | kWh/m3 |
![]() | Time since start of the filtration phase | s |
![]() | Recirculation/drain valve position | – |
W | Window length for median filter | – |
![]() | Recirculation flow rate setpoint perturbation | – |
![]() | Feed flow rate setpoint perturbation | – |
Schematic diagram of the pilot-scale closed-circuit reverse osmosis (CCRO) pilot system. The main components of the CCRO process are a membrane unit, a feed pump, a recirculation pump, and a three-way valve to switch between filtration and drain phases. The most important sensors for this study are the feed and recirculation flow rate measurements (,
), the feed and recirculation pump power draws (
,
), and the concentrate conductivity (
). Concentrate (brine) and permeate (product water) are collected in a mixing tank, allowing the feed water to be reproduced with consistent quality in view of reproducible results.
Schematic diagram of the pilot-scale closed-circuit reverse osmosis (CCRO) pilot system. The main components of the CCRO process are a membrane unit, a feed pump, a recirculation pump, and a three-way valve to switch between filtration and drain phases. The most important sensors for this study are the feed and recirculation flow rate measurements (,
), the feed and recirculation pump power draws (
,
), and the concentrate conductivity (
). Concentrate (brine) and permeate (product water) are collected in a mixing tank, allowing the feed water to be reproduced with consistent quality in view of reproducible results.
Image of the CCRO system. The feed pump (influent pump), feed tank, mixing tank, and membrane unit are visible.
Image of the CCRO system. The feed pump (influent pump), feed tank, mixing tank, and membrane unit are visible.
Operation
Feed water
The feed water to the CCRO system was prepared with deionized water and sodium chloride (ACS grade, Rocky Mountains Reagent, Golden, CO, USA). The concentration of water delivered from the feed tank was either 1,500 or 2,000 mg/L. To keep the feed water at constant concentration, the concentrate and permeate streams from the RO membrane were sent to a mixing tank, and periodically, the mixed solution was delivered by gravity to the feed tank. During the experiments, the water temperature was maintained at 20–23 °C using a water chiller that fed a heat exchanger installed in the feed tank.
Instrumentation
Both pumps were equipped with a variable-frequency-drive (VFD) to maintain water flux (and hence pressure) by manipulation of the feed pump and recirculation flow rates. These VFDs are controlled by sending an analog signal representing the relative proportion of the maximum pump power (0–100%). The system is equipped with turbine-type flow meters for the measurement of the recirculation flow rate (, 4352K522, McMaster-Carr, USA) and the measurement of the permeate flow rate (
, JLC International). The system was also equipped with electric current transducers to measure the pumps’ power draws (
and
) (CR Magnetics, Inc., St. Louis, MO, USA). The concentrate in the closed loop (
) was monitored with a conductivity sensor that can operate at high pressures (AST60, Advanced Sensor Technologies, Inc. (ASTI), USA). All setpoint and sensor data were collected and saved with a sampling interval of 1 s.
Basic controls
The basic control system includes (a) two proportional–integral (PI) controllers to maintain the feed and recirculation flow rates at the desired setpoint by varying the signal to the pump VFDs and (b) control logic for the filtration-drain sequences. The operation was switched from the filtration phase to the drain phase when the measured concentrate conductivity reaches a user-specified upper control limit (). This control limit was set at 25 mS/cm unless mentioned otherwise. The operation was switched from the drain phase to a new filtration phase when the measured concentrate conductivity reaches a user-specified lower control limit (
), which was 3 mS/cm during our study. To minimize the impact of sensor noise, the PI controllers used filtered signals obtained with the mADORE filter (Borowski et al. 2009). This method uses repeat median regression with an adaptive rolling window to provide a robust estimate of the signal in real time.
Model predictive control
Model predictive control concept for application in a time-varying sequential process. An optimal setpoint sequence is applied every cycle. After each cycle, new data are available and used to update the dynamic process model automatically. This model is then used to compute the setpoint sequence for the next cycle that optimizes the objective function according to the model, while satisfying applicable constraints.
Model predictive control concept for application in a time-varying sequential process. An optimal setpoint sequence is applied every cycle. After each cycle, new data are available and used to update the dynamic process model automatically. This model is then used to compute the setpoint sequence for the next cycle that optimizes the objective function according to the model, while satisfying applicable constraints.
Model structure
Enable accurate forecasting of process dynamics along the duration of the filtration phase (30 min–2.5 h)
Enable on-the-fly updating of model parameters
Capture the dominant effects of the selected flow rate setpoints on key process variables, which are the concentrate conductivity and pump power draws.









Model calibration
The MPC framework relies on the identified system model given in Equations (1) and (2). However, we found that using static parameters fails to account for changes in the process due to unmeasured changes in the feed or the process, as will be demonstrated below. To assure an up-to-date model, we calibrate the model during each drain phase using data from the preceding filtration phase.
Data preprocessing












The beginning of the filtration phase presents a transient period during which the contents of the closed circuit are not perfectly mixed yet. This was observed to cause oscillations of the measured concentrate conductivity during the first minutes of the filtration phase. The above model does not account for such oscillations. To describe this accurately, a more complex partial differential equation would be required. To maintain simplicity of the MPC, we instead remove the data corresponding to incomplete mixing for model calibration purposes.
Parameter estimation
To discuss our experiments in detail, we define three models explored for our experiments:
Static model: This model is calibrated once after the first filtration phase in the experiment.
Forecast model: This model is calibrated after each filtration phase and used to predict the process behavior in the next filtration phase as part of our MPC strategy.
Calibrated model: This model is calibrated after each filtration phase and used to predict the process behavior during the same filtration phase (hind-casting).
Optimization of the flow rate setpoints
Objective function


Applicable constraints
There are four constraints in our MPC problem:
Recycle flow rate: This flow rate must stay between
and
L/min to ensure its safety.
Feed pump flow rate: This flow rate must stay between
L/min and
L/min to ensure safety of the pump and the membrane.
Conductivity: The concentrate conductivity must remain below a user-specified value
, typically 25 mS/cm.
Filtration time: The length of the filtration phase must be equal to a predetermined value.
Optimization problem I
The iSEC is most sensitive to the filtration phase because water is produced and most of the energy is consumed during this phase. Therefore, we choose to manipulate the setpoints during the filtration phase to minimize the iSEC. Therefore, the control problem consists of finding setpoint sequences for the flow rates, and
, that minimize the iSEC for the next cycle. We choose to vary the setpoints at intervals of 2 min.
Optimization problem II
Perturbation of the setpoints
Preliminary experiments revealed that direct application of the optimal setpoints causes the variations of the manipulated variables to be so small that the produced data is not informative about the values for the model parameters. This is also known as poor parameter identifiability (Dochain et al. 1995). As an example, consider a case where the feed flow rate is constant in Equation (1). When so, any change in the values of
can be compensated with a change in the values of
. To obtain reliable estimates for both parameters, it is therefore important that the feed flow rate
is sufficiently varied. In our study, poor parameter identifiability occurred when the selected flow rate setpoints are practically constant, as demonstrated below. To ensure that the model updates are accurate, we modified our MPC strategy by means of a random yet small perturbation of the chosen setpoints, similar to persistent excitation methods (Willems et al. 2005).
EXPERIMENTAL EVALUATION OF THE MPC STRATEGY
Several experiments were executed to evaluate and challenge our MPC strategy. We focus on the following three experiments:
Experiment A: This experiment constitutes our first test of the MPC strategy. Our first variation of MPC was deployed during this experiment (no time constraint, see Section 2.2.3). No setpoint perturbation was applied (
and
). The feed salt concentration was 2,000 mg/L throughout the experiment. The upper control limit for concentrate conductivity (
) was 25 mS/cm (salinity
16,000 mg/L) throughout the experiment. This experiment lasted 21 h and included 20 cycles.
Experiment B: This experiment challenged our approach by means of a deliberate and unmeasured increase of the feed salinity. Our first variation of MPC was now deployed with setpoint perturbation. The initial feed concentration was 1,200 mg/L, and the upper control limit for concentrate conductivity (
) was 17 mS/cm (salinity
11,000 mg/L). The feed concentration was gradually changed from 1,200 to 2,000 mg/L during cycles 6 and 7, after which the feed concentration was kept at 2,000 mg/L. At the same time,
was changed from 17 mS/cm (cycles 1–7) to 25 mS/cm (cycles 8–23). This experiment lasted 22 h and included 23 cycles.
Experiment C: Similar to experiment B, this experiment challenged our approach by means of a deliberate and unmeasured decrease of the salt concentration of the feed water. Our second variation of MPC was deployed during this experiment (with time constraint, see Section 2.2.3). The initial feed concentration was 2,000 mg/L. The feed concentration was gradually changed from 2,000 to 1,200 mg/L between cycles 10 and 11, after which the feed concentration was kept at 1,200 mg/L. At the same time, the target filtration phase time length was changed from 90 min (cycles 1–10) to 180 min (cycles 11–20). The upper control limit for concentrate conductivity (
) was 25 mS/cm throughout the experiment. This experiment lasted 49 h and included 20 cycles.
The chronological order of the cycles is described by the cycle index . The cycle index is reset to
at the start of each experiment and increases by one each time a new filtration phase starts.
SOFTWARE IMPLEMENTATION
Complete model predictive control architecture of the pilot scale CCRO system. A LabVIEW virtual instrument (VI) was used for basic controls by computing new variable-frequency-drive (VFD) setpoints every second. During the drain phase, raw data collected during the previous filtration phase were sent to Python for smoothing and model calibration. The updated model parameter values were then fed to the Python-based model predictive controller, which computes the optimal setpoint sequence given the up-to-date model.
Complete model predictive control architecture of the pilot scale CCRO system. A LabVIEW virtual instrument (VI) was used for basic controls by computing new variable-frequency-drive (VFD) setpoints every second. During the drain phase, raw data collected during the previous filtration phase were sent to Python for smoothing and model calibration. The updated model parameter values were then fed to the Python-based model predictive controller, which computes the optimal setpoint sequence given the up-to-date model.
The MPC code in Python used the updated model parameters to generate forecasts for the next filtration phase and computed flow rate setpoints that minimize the iSEC, using the Ipopt solver (Wächter & Biegler 2006). Once computed, the sequence of flow rate setpoints was sent to the LabVIEW VI.
RESULTS AND DISCUSSION
Experiment A: Need for perturbation


Experiment A – Model forecasts for four cycles in absence of setpoint perturbation. Left to right: Cycle 3 to 6 in experiment A. Top and middle row: Measurements and forecasts of concentrate conductivity () and recirculation pump power demand (
), respectively. Black dots represent measured values. Forecasts are shown with a static model (cyan, full line), the model calibrated with data from the previous cycle (blue, dashed line), and the model calibrated with data from the current cycle (red, dotted line). Bottom row: Measurements and setpoints for the recirculation flow rate (
).
Experiment A – Model forecasts for four cycles in absence of setpoint perturbation. Left to right: Cycle 3 to 6 in experiment A. Top and middle row: Measurements and forecasts of concentrate conductivity () and recirculation pump power demand (
), respectively. Black dots represent measured values. Forecasts are shown with a static model (cyan, full line), the model calibrated with data from the previous cycle (blue, dashed line), and the model calibrated with data from the current cycle (red, dotted line). Bottom row: Measurements and setpoints for the recirculation flow rate (
).

Experiment A – Visualization of model parameter values for the recirculation pump power draw equation (Equation (3)) in the absence of setpoint perturbation. Top: Parameter values as a function of the cycle index. Lack of perturbation leads to dramatic changes in the identified parameter values during cycles 4, 5, and 18. Bottom: Scatter plot of the parameters. The parameter value pairs obtained during cycles 4, 5, and 18 lie slightly below the regression line describing all other parameter value pairs.
Experiment A – Visualization of model parameter values for the recirculation pump power draw equation (Equation (3)) in the absence of setpoint perturbation. Top: Parameter values as a function of the cycle index. Lack of perturbation leads to dramatic changes in the identified parameter values during cycles 4, 5, and 18. Bottom: Scatter plot of the parameters. The parameter value pairs obtained during cycles 4, 5, and 18 lie slightly below the regression line describing all other parameter value pairs.
Experiment B: optimal control with equipment constraints
Model-based forecasting
Experiment B – Model forecasts for cycles 1, 8, and 9. Top to bottom: Forecasts for ,
, and
. Black dots represent measured values. Horizontal dashed lines represent the applied upper limit for conductivity. Forecasts are shown with a static model (cyan, full line), the model calibrated with data from the previous cycle (blue, dashed line), and the model calibrated with data from the current cycle (red, dotted line). Regular parameter updating is required to obtain reliable forecasts of the key variables in the process.
Experiment B – Model forecasts for cycles 1, 8, and 9. Top to bottom: Forecasts for ,
, and
. Black dots represent measured values. Horizontal dashed lines represent the applied upper limit for conductivity. Forecasts are shown with a static model (cyan, full line), the model calibrated with data from the previous cycle (blue, dashed line), and the model calibrated with data from the current cycle (red, dotted line). Regular parameter updating is required to obtain reliable forecasts of the key variables in the process.
Model fit and parameter values
Experiment B – Model fit as a function of cycle index. Left panels show the RMSR for conductivity, recycle pump power, and feed pump power. Right panels show the mean prediction error (bias) for the same variables. Results obtained without model updates (cyan circles), using the model obtained with data from the previous cycle (blue triangles), and using the model calibrated with data from the current cycle (red squares). The time of the salt concentration change in the feed tank is marked as a vertical dotted line. To maintain good forecasting accuracy, as measured with RMSR and bias, regular model parameter updating is necessary.
Experiment B – Model fit as a function of cycle index. Left panels show the RMSR for conductivity, recycle pump power, and feed pump power. Right panels show the mean prediction error (bias) for the same variables. Results obtained without model updates (cyan circles), using the model obtained with data from the previous cycle (blue triangles), and using the model calibrated with data from the current cycle (red squares). The time of the salt concentration change in the feed tank is marked as a vertical dotted line. To maintain good forecasting accuracy, as measured with RMSR and bias, regular model parameter updating is necessary.



Experiment B – Visualization of model parameter values. Left: as a function of the cycle index. Right: scatter plots. Top to bottom: Parameters for Equations (1) ( forecast), (2) (
forecast), and (3) (
forecast). The time of the change in the salt concentration of the feed water is marked as a vertical dotted line in the left panels. In the left panels, parameter values are multiplied with arbitrary constants to facilitate visualization.
Experiment B – Visualization of model parameter values. Left: as a function of the cycle index. Right: scatter plots. Top to bottom: Parameters for Equations (1) ( forecast), (2) (
forecast), and (3) (
forecast). The time of the change in the salt concentration of the feed water is marked as a vertical dotted line in the left panels. In the left panels, parameter values are multiplied with arbitrary constants to facilitate visualization.
Selected control actions and system performance
Experiment B – Flow rate setpoints and corresponding measurements for cycles 1, 8 and 9. Top: Recycle flow rate. Bottom: Feed flow rate. The lower and upper limits for flow rates are shown as blue and magenta dashed lines, respectively. The selected setpoints are at the boundaries of their range. This is true before (cycle 1) and after (cycles 8, 9) the change in the salt concentration of the feed water.
Experiment B – Flow rate setpoints and corresponding measurements for cycles 1, 8 and 9. Top: Recycle flow rate. Bottom: Feed flow rate. The lower and upper limits for flow rates are shown as blue and magenta dashed lines, respectively. The selected setpoints are at the boundaries of their range. This is true before (cycle 1) and after (cycles 8, 9) the change in the salt concentration of the feed water.
Experiment B – Comparison of observed values and forecasts of the integrated specific energy consumption (iSEC). The time of the salt concentration change in the feed tank is marked as a vertical dotted line. Forecasted values with a static model (cyan circles) fail to track the change in iSEC following an unmeasured change in the salt concentration of the feed water during cycle 7. In contrast, forecasts based on the adaptive model (blue triangles) follow the observed value closely, except for cycle 7, immediately after the feed water change, and during cycles 16 and 17, due to an unmeasured disturbance.
Experiment B – Comparison of observed values and forecasts of the integrated specific energy consumption (iSEC). The time of the salt concentration change in the feed tank is marked as a vertical dotted line. Forecasted values with a static model (cyan circles) fail to track the change in iSEC following an unmeasured change in the salt concentration of the feed water during cycle 7. In contrast, forecasts based on the adaptive model (blue triangles) follow the observed value closely, except for cycle 7, immediately after the feed water change, and during cycles 16 and 17, due to an unmeasured disturbance.
The computed RMSR values are shown in Figure 9 as a function of time. With a static model (cyan circles), the RMSR increases dramatically after the unmeasured change of the salt concentration of the feed water (cycle 8). In contrast, updating the model after each cycle enables a much better description of the measured values (red squares). For MPC purposes, the model in use is the one calibrated with measurements collected during the previous cycle (blue triangles). In general, this forecasting model fares well although one or two cycles appear necessary to regain a reliable model after an unmeasured change (e.g., cycle 9). The forecasting errors during cycles 16 and 17 are fairly high for conductivity and the feed pump power. This is explained as a result of the uncontrolled reduction of the salt concentration of the feed water discussed in the previous paragraph.
Experiment C: Optimal control with equipment and time constraints
Experiment C – Model-based forecasts and setpoints for cycles 10, 11, 12, and 13 (left to right). A change in the salt concentration of the feed water is applied between cycles 10 and 11. Upper and lower limits on the process variables are shown as horizontal lines (blue and magenta). The time constraint is shown as a vertical dotted line. Top row: conductivity (). Black dots represent measured values. Forecasts and setpoints are shown with a static model (cyan, full line), the model calibrated with data from the previous cycle (blue, dashed line), and the model calibrated with data from the current cycle (red, dotted line). Middle and bottom row: recycle flow rate (
) and feed flow rate (
). Regular parameter updating is required to obtain reliable forecasts of the conductivity. During the whole experiment, model predictive control selects setpoints for the recycle flow rate that are equal to or close to the lower limit. The selected feed flow rate setpoints are at the upper limit at the start of the cycle and at the lower limit at the end of the cycle. The model update after cycle 11 accounts for the change in the salt concentration of the feed water, in turn leading to a longer period of high feed flow rate setpoints during cycle 12 and after.
Experiment C – Model-based forecasts and setpoints for cycles 10, 11, 12, and 13 (left to right). A change in the salt concentration of the feed water is applied between cycles 10 and 11. Upper and lower limits on the process variables are shown as horizontal lines (blue and magenta). The time constraint is shown as a vertical dotted line. Top row: conductivity (). Black dots represent measured values. Forecasts and setpoints are shown with a static model (cyan, full line), the model calibrated with data from the previous cycle (blue, dashed line), and the model calibrated with data from the current cycle (red, dotted line). Middle and bottom row: recycle flow rate (
) and feed flow rate (
). Regular parameter updating is required to obtain reliable forecasts of the conductivity. During the whole experiment, model predictive control selects setpoints for the recycle flow rate that are equal to or close to the lower limit. The selected feed flow rate setpoints are at the upper limit at the start of the cycle and at the lower limit at the end of the cycle. The model update after cycle 11 accounts for the change in the salt concentration of the feed water, in turn leading to a longer period of high feed flow rate setpoints during cycle 12 and after.
One can also see that the time constraint is met closely during experimental evaluation in cycles 10, 12, and 13. The measured conductivity does not reach the upper limit at the forecasted time exactly. The difference is attributed to noise in the conductivity measurement, which is not accounted for in the mean-based forecast used in MPC, and mismatch between the model forecast and the actual process. During cycle 11, the forecast model used for MPC does not yet account for the unmeasured change in the salt concentration of the feed water. As a result, the true conductivity is substantially lower than the one expected based on the model. As a result, the time needed to reach the upper limit for the conductivity (270 min) exceeds the target time length (180 min). After one model update, this problem disappears. The realized filtration length remains within 12 min of the targeted time length during the remainder of the experiment (not shown).
The middle and bottom rows of Figure 13 show the selected control actions during cycles 10–13. During each of these cycles, the selected recycle flow rate is equal or close to the lower limit (45 L/min). This is true for all cycles (1–20, not shown). In contrast, the selected setpoints for the feed flow rate are first equal or close to the upper limit at first while they are equal or close to the lower limit later in the filtration phase. The transition from high to low flow rate setpoints is fast and takes two times the control horizon only (4 min total). In hindsight, this is interpreted as follows: reaching the upper limit for conductivity starting from an initial value is equivalent to a volume of treated water. This volume of treated water is treated in a predetermined amount of time (time constraint). Thus, to satisfy the time constraint, the volume of water matching the upper limit for conductivity needs to match the integral of the feed flow rate setpoints over the specified filtration time. To minimize the iSEC, the feed flow rate should be highest when it can be achieved with the lowest energy demand. As can be seen in Figure 8, the energy demand is higher when the conductivity is higher. In the CCRO process, the conductivity increases during filtration. Consequently, it is energetically beneficial to apply higher feed flow rates at the start of the filtration time and lower feed flow rates at the end. This explains the resulting high-low pattern for the feed flow rate setpoints. Note that the time of switching from the high to low setpoints changes after cycle 11 when changes in the filtration time and the salt concentration of the feed water are both accounted for. The optimal sequence of flow rate setpoints is therefore non-trivial and requires an up-to-date model.
Experiment C – Model fit as a function of cycle index. Left panels show the RMSR for conductivity, recycle pump power, and feed pump power. Right panels show the mean prediction error (bias) for the same variables. The time of the salt concentration change in the feed tank is marked as a vertical dotted line. Results obtained without model updates (cyan circles), using the model obtained with data from the previous cycle (blue triangles), and using the model calibrated with data from the current cycle (red squares). In the presence of unmeasured feed or process changes, regular model parameter updating is necessary to maintain good forecasting performance.
Experiment C – Model fit as a function of cycle index. Left panels show the RMSR for conductivity, recycle pump power, and feed pump power. Right panels show the mean prediction error (bias) for the same variables. The time of the salt concentration change in the feed tank is marked as a vertical dotted line. Results obtained without model updates (cyan circles), using the model obtained with data from the previous cycle (blue triangles), and using the model calibrated with data from the current cycle (red squares). In the presence of unmeasured feed or process changes, regular model parameter updating is necessary to maintain good forecasting performance.
Suggested improvements for optimal CCRO control
Our MPC strategy is fairly generic and could be applied to any sequential process for which a simple yet dynamic model structure can be identified. Our experiments suggests that the optimal setpoints exhibit a simple pattern. This is explained by the fact that both pumps are typically operated at one of their safety constraints. We consider the following aspects worthy of study for general-purpose MPC for sequential processes:
Consider the need for perturbation of process inputs (setpoints in our case) as part of the MPC optimization problem. More specifically, consider the trade-off between the system performance and the anticipated model accuracy when optimizing the setpoints.
Enhance the reliability of the model and the selected setpoints by updating the model and the optimal setpoint sequences repeatedly during the cycle, as opposed to only once at the start of the cycle.
The following features are considered for further development of a CCRO-specific solution for MPC:
Include the critical conductivity (the conductivity at which the CCRO process switches from the filtration to drain phase) as a setpoint available for optimization. We hypothesize that this value determines the trade-off between the cost of brine disposal and energy efficiency, and these trade-offs may change as a function of local geography, regulation, and electricity market.
Consider that the time-constrained minimization of the iSEC (Experiment C) may be reduced to the optimal selection of a single time-point to transition from the highest to the lowest feed flow rate, thus reducing the dimensionality of the MPC problem significantly.
Choose feed pump and recycle pumps that enable a wider operational range. Note that more flexible equipment is likely available for larger experimental pilots and full-scale plant designs.
Suggested experimental work
For the preparation of this article, the feed water was made with deionized water and sodium chloride only. As a result, the feed water is simple in composition and does not contain other elements, such as bivalent ions, that are expected under real-world conditions. This means that the membrane is likely to incur scaling in practice. Without such ions, as in this article, scaling is unlikely, thus enabling long-term testing of our MPC strategy. In the future, our objective is to test our MPC strategy under more realistic conditions by (a) adding bivalent ions to artificial feed water and (b) sourcing a naturally occurring brackish water as feed water. The presence of bivalent ions is likely to cause scaling of the membrane as time progresses. As a result, the resistance of the membrane will increase between clean-in-place operations. Automatic updates of the model parameters would account for these changes. More specifically, we expect the parameter to increase over time. This would reflect that maintaining the same permeate flux requires a higher transmembrane pressure, and thus a higher energy demand by the feed pump at the same flux. We expect the resulting control actions to be very similar in the sense that the control actions would be at the extremes of the feasible range. The main difference would be that the resulting iSEC would gradually increase with the same feed salinity levels.
We also note that the feed salinity remained relatively low in our experiments (up to 2,000 mg/L). However, the salinity level to which the membrane is exposed is as high as 16,000 mg/L. We are therefore confident that the system can handle the salinity levels of brackish water (e.g., up to 10,000 mg/L). A higher feed salinity would lead to a higher SEC and a lower recovery when the same upper control limit for the concentrate conductivity is applied. Further testing is required to quantify the recovery and specific energy consumption that can be expected in such a case.
CONCLUSIONS
Following are the concluding remarks:
We developed a model predictive controller (MPC) for maximization of the energy efficiency of a sequential desalination process named CCRO.
We identified an empirical mechanistic model that produces reliable multi-step forecasts (a) in the absence of steady-state operation, (b) in the presence of unmeasured disturbances, and (c) over time horizons that are relevant for sequential batch process optimization purposes.
A cycle-by-cycle model calibration strategy combined with perturbation of flow rate setpoints proved adequate to ensure reliable forecasts are available for MPC purposes.
MPC enables optimization of the energy efficiency by manipulating the permeate and recirculation flow rate setpoint sequences while satisfying equipment and time constraints imposed on the CCRO process.
ACKNOWLEDGEMENTS
This work is supported by the National Alliance for Water Innovation (NAWI), funded by the U.S. Department of Energy, Energy Efficiency and Renewable Energy Office, Advanced Manufacturing Office under Funding Opportunity Announcement DE-FOA-0001905. The authors acknowledge the technical support of Mr. Michael Veres, Mr. Mason Manross, and Ms. Cheyenne Footracer.
DATA AVAILABILITY STATEMENT
All relevant data are available on OpenEI at https://doi.org/10.7481/1963162
CONFLICT OF INTEREST
The authors declare there is no conflict.