Application of a smart dosing pump algorithm in identifying real-time optimum dose of antiscalant in reverse osmosis systems

The potential of membrane scaling control by a real-time optimization algorithm was investigated. The effect of antiscalant dosing was evaluated from the induction time measured in glass batch-reactors, and from the operational performance of a lab-scale reverse osmosis (RO) unit and two pilot-scale RO units. Step changes in the antiscalant dosing demonstrated that the accumulation of scaling is ‘paused ’ during periods when the optimum dose is applied. This is paramount for the application of a dynamic dosing strategy that may briefly underdose, while searching for the optimum dose. It was found that antiscalant underdose and overdose were both detrimental to RO operation since underdose resulted in membrane scaling, while overdose led to mem- brane fouling due to calcium-antiscalant deposits. The dosing algorithm was used to minimize antiscalant consumption in two pilot RO units. The algorithm was able to lower the antiscalant doses to 0.2 mg/L and 0.6 mg/L, while the supplier ’ s recommended antiscalant doses were 2.0 mg/L and 4.5 mg/L, respectively. As a result, the algorithm could reduce antiscalant consumption by up to 85 – 90% for the plants mentioned.


Introduction
In brackish water reverse osmosis (BWRO) processes, scaling is a major challenge and is typically the main barrier to operating RO installations at high recoveries. Scaling is caused by the precipitation (deposition) of sparingly soluble salts on the membrane surface when their saturation limits are exceeded. Scaling reduces permeate production (due to decreased membrane permeability), raises operational costs (due to higher operating pressure, cleaning costs, etc.), and degrades permeate water quality (due to increasing salt passage) [1,2]. A variety of inorganic compounds might cause scaling in BWRO, e.g., calcium carbonate, calcium sulphate, barium sulphate, calcium phosphate, silica, etc.
Antiscalant dosing in feedwater is one of the most extensively applied and effective scaling prevention strategies in RO applications [1,[3][4][5][6]. Antiscalants delay the precipitation process of the supersaturated sparingly soluble salts, allowing higher supersaturation without scale formation. There are several commercial antiscalants available, and the most commonly used ones in RO applications are phosphonates, polycarboxylates, and bio-based antiscalants [3,5,7]. The selection of antiscalants in RO applications depends on the feed water composition as well as other factors such as recovery and discharge regulations.
With the use of antiscalants, the main question which arises is: How to determine the lowest (optimum) dose of antiscalants to prevent scaling in RO applications? Operating the RO with the lowest antiscalant dose at which scaling does not occur is highly desirable, since high doses of antiscalant result in additional costs and pose environmental concerns [7]. In practice, the antiscalant dose for a given water composition is generally determined using the antiscalant manufacturer's proprietary programs. However, the method used by the manufacturers to calculate the antiscalant dose is unknown and therefore the end-users cannot verify their recommended doses. In general, the suppliers' recommended antiscalant doses are in the range of 2-10 mg/L to prevent scaling in RO processes [8].
Some studies have reported that the presence of some inorganic ions (e.g., phosphate) and natural organic matter, i.e., humic substances have a noticeable inhibitory effect on the scaling species [9][10][11][12][13][14][15][16]. It is, therefore, likely that when these substances are present in the RO feed, a lower antiscalant dose may be applied. Mangal et al. [13] have demonstrated that both phosphate and humic substances present in an anaerobic groundwater in the Netherlands could prevent calcium carbonate scaling and thus were responsible for the reduction in the antiscalant dose. As the effect of these substances is not considered by suppliers in the dosing recommendation, the actual required dose of antiscalant could be lower than the recommended dose. It is therefore essential to consider the effect of the aforementioned substances (if present in RO feed) when determining the optimum dose in RO applications. According to the authors' current knowledge, no standard method exists for optimizing antiscalant dose in RO applications that considers the effect of inorganic and organic substances in the feedwater on the antiscalant dose and which could be applied for any feedwater composition.
The required antiscalant dose may change in time, due to variations in the feedwater composition. Thus, dynamic adaptation is necessary to attain the lowest antiscalant dose. A feedback algorithm continuously and automatically adapts the dose based on an observation of the performance of the membrane system. However, this implies that occasionally, brief periods with under-and over-dosing may occur. It is necessary that the adverse effect of the under-or over-dosing on the fouling rate is reversible [17].
The study in this paper was performed in the context of the realization of a smart digital dosing pump (in cooperation with Grundfos A/ S) with an integrated dosing control algorithm that is intended to identify the optimal antiscalant dose necessary to achieve a target recovery in RO processes and thus to minimize or prevent overdosing of antiscalant. The control module of the dosing pump is configured to vary the dosage of antiscalant in the RO feed based on the net driving pressure (NDP) or (ΔNDP/Δt) of the last stage where scaling occurs. The algorithm should preferably be applied to an external scale-guard unit to reduce the risk of scaling in full-scale RO installations while optimizing antiscalant dose. A scale-guard unit is an additional RO element that is fed with the concentrate of the last stage of a full-scale RO installation, and because the scale-guard provides additional recovery, scaling occurs in the scale-guard prior to the final stage of the full-scale RO installation [18].
The working concept of the algorithm is described in more detail elsewhere [19]. The control algorithm, as illustrated in Fig. 1, initially employs the supplier's recommended antiscalant dose and then reduces Fig. 1. Working principle of the dosing pump algorithm in identifying the optimum antiscalant doses in RO processes [19]. M.N. Mangal et al. the dosage of antiscalant fed into the RO feed until an increase of the slope NDP (or ΔNDP/Δt) is detected. Afterwards, the algorithm increases the dose to the lowest antiscalant dose at which the NDP remains constant. The dose at which an increase in NDP is observed is recognized as the underdose, and the lowest antiscalant dose at which no increase in NDP is observed is considered as the optimum antiscalant dose. The dosing pump algorithm is based on the hypothesis that when NDP increases (due to scaling) at a dose lower than the optimum dose, further scaling and thus increase in NDP will stop when the dose is raised back to the optimum dose. This hypothesis needs to be verified as it could be expected that once scaling occurs (during antiscalant underdose), further scaling could not be stopped when the dose is increased from the underdose to the optimum dose or even back to the supplier's recommended dose.
The objectives of this paper are: i) to investigate whether once scaling occurs in an RO system due to antiscalant underdose, further scaling could be stopped with an optimum antiscalant dose, and ii) to evaluate the application of the dosing pump algorithm in minimizing antiscalant consumption and identifying optimum antiscalant doses in RO applications. This research work consists of two main parts. In the first part, step-changes are applied to the antiscalant dosing in controlled precipitation experiments (in glass reactors), once-through lab-scale RO tests, and pilot RO tests. In addition, the effect of underdose and overdose of antiscalant on calcium carbonate scaling and RO operation is demonstrated. In the second part, the antiscalant dosing algorithm is applied to determine the optimum antiscalant dose in two different RO plants; one treating anaerobic groundwater and located in Kamerik (the Netherlands), and the second one treating aerobic groundwater and located in Brabrand (Denmark).

Chemicals for preparing synthetic concentrate solutions
The controlled precipitation experiments in glass reactors, i.e., induction time measurements and the once-through lab-scale RO tests were executed with synthetic concentrate solutions where calcium carbonate was the only precipitating compound in the absence of antiscalant. The concentrations of Ca 2+  once-through mode, and ii) to carry out proof of principle tests at the most extreme conditions, so that if the algorithm can be successfully applied for the optimization of antiscalant dose at such high supersaturation levels, it can definitely be applied at low supersaturation levels as well.
Milli-Q water (Merck Millipore) was used to make synthetic concentrate solutions with CaCl 2 ⋅2H 2 O and NaHCO 3 (Analytical Grade, Merck). The pH adjustments of the synthetic concentrate solutions were done using 0.2 M solutions of HCl (Analytical grade, ACROS Organics) or NaOH (Analytical Grade, J.T. Baker). All experiments in this study were performed with a commercial phosphonate antiscalant.

Induction time measurements
In this study, as in others [13,[20][21][22], induction time is defined as the time elapsed between the emergence of supersaturated conditions and the detection of crystallization. Fig. 2 depicts a schematic diagram of the experimental setup which was used in this research to measure the induction time of calcium carbonate. The induction time tests were carried out in an airtight double-walled 3 L Applikon glass reactor with an Endress Hauser pH probe installed to continuously record the pH of the synthetic concentrate solution. Induction time was considered as the time it takes for the pH of the synthetic concentrate to drop by 0.03 units from its initial value as a result of the formation of calcium carbonate crystals [23].
To conduct an induction time test, the 3 L reactor was first half-filled with the NaHCO 3 solution and then the pH was adjusted to the desired value using a 0.2 M HCl solution. Following that, the other half of the reactor was filled with the CaCl 2 ⋅2H 2 O solution while maintaining the stirring rate inside the reactor at 150 rpm to ensure uniform mixing of the solutions and to avoid the development of any local supersaturated zones [24]. It is worth mentioning that all induction time tests were performed at 20 • C, which was controlled by a thermostat. After each induction time test, the reactor was cleaned with 0.2 M HCl to dissolve crystals that formed during the test, and then the reactor was rinsed twice with demineralized water (demi-water).
To investigate the effect of antiscalant underdose and overdose, induction time tests were performed with the synthetic concentrate of 85% recovery and antiscalant concentrations of 1.3 mg/L, 13.3 mg/L, and 33.3 mg/L which correspond to feedwater antiscalant doses of 0.2 mg/L, 2.0 mg/L, and 5.0 mg/L, respectively. According to antiscalant supplier, 5.0 mg/L was the upper limit of the antiscalant dose. For the algorithm's proof of principle, i.e., scaling reversibility with antiscalant, induction time measurements were carried out with synthetic concentrate solutions both with and without antiscalant, as well as in the absence and presence of calcium carbonate (seed) crystals. The calcium carbonate crystals employed were those that precipitated in the reactor during induction time tests with synthetic concentrate solutions without antiscalant. More precisely, to get freshly formed calcium carbonate crystals, an induction time test was performed with the synthetic concentrate solution having an initial pH of approximately 7.6. When the pH of the synthetic concentrate dropped to approximately 6.6 (nearly equilibrium pH) due to the precipitation of calcium carbonate in the reactor, the induction time test was stopped. The synthetic concentrate was then filtered through a 0.1 μm filter to retain those crystals that were not settled in the reactor but were in suspension in the synthetic concentrate. The retained crystals were returned to the reactor. Following that, an induction time test with a new synthetic concentrate solution with antiscalant was performed in the reactor containing crystals to see if antiscalant could prevent the formation of calcium carbonate when the supersaturated synthetic concentrate was in contact with freshly produced seed crystals of calcium carbonate.

RO performance indicators
The performance of the RO is monitored by the permeability K W (L/ m 2 /h/bar), defined as follows: With permeate flow Q p (L/h), net driving pressure NDP (bar), membrane area A M (m 2 ), and temperature correction factor TCF t . The temperature correction factor is calculated from the feedwater temperature T ( • C) as follows: and, the net driving pressure is given by: With feed pressure P f (bar), feed-concentrate pressure drop ΔP fc (bar), permeate pressure P p (bar), feed-concentrate osmotic pressure π fc (bar), and permeate osmotic pressure π p (bar).
The control algorithm used the temperature corrected NDP as input, given by: equations (1)-(4) are obtained from the membrane manufacturer (Hydranautics) and the ASTM standard practice for standardizing RO performance data (Designation: D4516-00).

Lab-scale RO measurements
The once-through lab-scale RO tests were performed using the system depicted schematically in Fig. 3, which included a SEPA cell (Sterlitech Corporation, USA) and an OSMO Titan unit (Convergence Industry B.V., the Netherlands). For each experiment, a new membrane sheet (effective area 140 cm 2 ) was harvested from a brackish water RO element of Hydranautics (ESPA2-LD-4040) and placed in the SEPA cell. The lab-scale RO unit was operated at constant pressure and was equipped with a highly sensitive flow meter to measure the permeate flow produced from a small membrane sheet. Membrane permeability (Eq. (1)) was used (instead of NDP) to monitor the occurrence of scaling.
The lab-scale RO tests were executed with the synthetic concentrate solutions of 85% recovery with antiscalant concentrations of 1.3 mg/L, 13.3 mg/L, and 33.3 mg/L which correspond to feedwater antiscalant doses of 0.2 mg/L, 2.0 mg/L, and 5.0 mg/L, respectively. The synthetic concentrate solutions were prepared by continuously dosing salts (e.g., Ca 2+ , HCO 3 − , etc.) into the demi-water feed stream at room temperature (20-23 • C). For tests that did not require the use of antiscalant, milli-Q water was dosed instead. The synthetic concentrate solution was first introduced to another reactor (before being fed to the SEPA cell), where it was stirred at 150 rpm for less than 1 min. The residence time of less than 1 min was obtained by keeping the flow rates entering and leaving the reactor at 32 L/h and by maintaining the synthetic concentrate volume in the reactor to approximately 0.5 L. In all tests, the cross-flow velocity and recovery were approximately 0.10-0.12 m/s and 0.5-0.7%, respectively. After the experiment, the membrane sheets were examined using scanning electron microscopy (SEM) (JEOL, JSM-6010LA).

Pilot-scale RO measurements
In this study, two pilot-scale RO units (Fig. 4) were used that were equipped with antiscalant dosing pumps fitted with the control algorithm, and could be operated with manual dosing or with automatically adapted dosing. An antiscalant manufacturer's projection program was used to understand the scaling potential of the RO concentrates for both RO pilot units and to obtain the recommended antiscalant type and doses to prevent scaling. Fig. 4a shows the schematic of the pilot RO located in Brabrand (Denmark) which treats aerobic groundwater (GW) with quality parameters given in Table 1. It is a single-stage RO unit with 3 pressure vessels in series where each pressure vessel is loaded with two FilmTec™ brackish water RO elements (BW30-4040). The single-stage RO pilot unit was operated with constant permeate production in recirculation mode to achieve a recovery of 80%. During the tests, the RO feed flow (combined with the recirculated concentrated flow) was 2.0 m 3 /h, and the permeate production was to 1.2 m 3 /h. The concentrate discharge was 0.3 m 3 /h, and 0.5 m 3 /h concentrate was recirculated the feed. The used antiscalant was a phosphonate antiscalant. The RO unit was operated without and with a range of antiscalant doses. Fig. 4b shows a schematic representation of the pilot RO unit, located  in Kamerik (the Netherlands), which treats anaerobic groundwater, with quality parameters shown in Table 1. The RO unit comprised six pressure vessels in the first stage, two in the second stage and one in the third stage, with three Hydranautics ESPA2-LD-4040 membrane elements in each pressure vessel. The RO unit was operated at 80% recovery with various doses of a phosphonate antiscalant. As both pilot units were operated at constant permeate production (flux) and the permeate flow of the entire stage was measured, the temperature corrected NDP (Eq. (4)) of the last stage (rather than average permeability) was recorded to monitor the occurrence of scaling. In RO plants that are equipped with an external scale guard (monitoring) unit [18] or could measure the permeate flow of the last element of the last stage, it is recommended to use permeability of that last element (or external scale guard unit) to monitor the occurrence of scaling and for the feedback control of the algorithm.

Effect of an overdose of antiscalant on calcium carbonate scaling and RO operation
The objective of this section is to investigate the consequences of overdose as well as underdose of antiscalant on membrane scaling and RO operation and to illustrate why RO plants need to be operated with their optimum antiscalant dose. Fig. 5a presents the measured induction times of the synthetic RO concentrates (LSI 2.2) with the feedwater antiscalant doses of 0.2 mg/L, 2.0 mg/L and 5.0 mg/L. As can be seen, with both 2.0 mg/L and 5.0 mg/ L antiscalant doses, the measured induction times were longer than 120 h, which suggested that the aforementioned doses of the antiscalants were able to delay the precipitation of calcium carbonate substantially. On the other hand, with 0.2 mg/L antiscalant dose, the measured induction time was shorter than 15 min and thus this dose was not sufficient to delay the precipitation of calcium carbonate and would most likely be unable to prevent the occurrence of calcium carbonate scaling in RO. Fig. 5b shows the permeability of the lab-scale RO unit when fed with the synthetic concentrate in the presence of feedwater antiscalant concentrations of 0.2 mg/L, 2.0 mg/L and 5.0 mg/L. As can be seen, the permeability decreased rapidly due to calcium carbonate scaling when the antiscalant dose was 0.2 mg/L. This result is in line with the one of Fig. 5a where it was demonstrated that an antiscalant dose of 0.2 mg/L was not sufficient to hinder the formation of calcium carbonate substantially. On the other hand, the permeability of the membrane remained constant with an antiscalant dose of 2.0 mg/L which suggested that the mentioned antiscalant dose was able to prevent calcium carbonate scaling. This finding was expected when considering Fig. 5a, where it was shown that the antiscalant dose of 2.0 mg/L was able to hinder the precipitation of calcium carbonate to a period longer than 120 h, thus minimizing the risk of scaling in RO. Unexpectedly, the permeability of the membrane decreased sharply with an antiscalant dose of 5.0 mg/L, and the drop was even greater than with a 0.2 mg/L antiscalant dose. As the induction time with the 5.0 mg/L antiscalant dose was greater than 120 h (similar to the dose of 2.0 mg/L), it was expected that the membrane permeability would remain constant. This suggested that calcium carbonate was not responsible for the permeability decline when the antiscalant dose was increased to 5.0 mg/L. Fig. 6 illustrates the SEM images of the fouled/scaled membranes with antiscalant doses of 0.2 mg/L and 5.0 mg/L, as well as the SEM image of a virgin (new) membrane. As can be seen in Fig. 6a, the membrane surface was covered with cubical crystals when the antiscalant dose was 0.2 mg/L. The cubical crystals were identified as calcite, a form of calcium carbonate, in the X-ray powder diffraction (XRD) analysis. On the other hand, the membrane surface was covered by an amorphous compound when the antiscalant dose was 5.0 mg/L as shown in the SEM image in Fig. 6b. This indicated that calcium carbonate was not responsible for the permeability decline at the high antiscalant dose of 5.0 mg/L. Fig. 6c shows the SEM image of a new (clean) membrane to better visualize the presence of foulant in Fig. 6b. The amorphous precipitates were sent to TZW DVGW-Technologiezentrum Wasser (Germany) for further examination with anion-exchange chromatography coupled to electrospray-ionization time-of-flight mass spectrometry (ESI-TOF) and inductively coupled plasma mass spectrometry (ICP-MS). The details on ESI-TOF and ICP-MS techniques have been published by other researchers elsewhere [25,26]. The analysis revealed that the amorphous compound was calcium phosphonate. This showed that the high dose (5.0 mg/L) of phosphonate antiscalant in the presence of high concentration of calcium (765 mg/L) may lead to the formation of amorphous deposits of calcium-phosphonate. Therefore, the overdose of antiscalant may prevent calcium carbonate scaling in the RO process, but meanwhile may lead to the permeability decline due to the precipitation of a calcium-antiscalant compound.
In RO processes, the adverse effect of a high dose of antiscalant is more pronounced at high recoveries (than at low recoveries) as the calcium concentration in the RO concentrate increases. Therefore, at high recoveries where the tendency of calcium carbonate scaling increases, the determination of the antiscalant dose as well as the selection of the type of antiscalant should be done carefully. In this paper, we briefly demonstrated the adverse effect of overdosing a commercial phosphonate antiscalant (which is one of the widely used antiscalants to control calcium carbonate scaling) in RO processes to show that optimizing antiscalant dose is not needed just because of environmental concerns and reducing additional costs, but also that higher doses may negatively affect the RO performance. It is essential to have information on the antiscalant concentrations at which the adverse effect of antiscalant is occurring. To answer when and under what conditions an antiscalant (e.g., phosphonate antiscalant) and calcium can precipitate on the membrane surface, both the solubility as well as the precipitation kinetics of the calcium antiscalant/phosphonate compound are required. It should be noted that the determination of the solubility of calcium and phosphonate antiscalant was not within the scope of this paper, nor was an investigation of different types of antiscalants (e.g., polycarboxylates, etc.) to see if they showed a similar negative effect as was observed with the phosphonate antiscalant. However, it is recommended that this effect be further researched in a lab-scale/pilot installation to prevent precipitation of calcium-antiscalant amorphous deposits on RO membranes.
In brief, as both overdose and underdose of antiscalant are problematic, it is essential to operate RO plants as close as possible to their optimum antiscalant dose to minimize both the risk of scaling/fouling and the additional costs.
In this paper, various terms for antiscalant doses are used, including overdose, optimum dose, underdose, and safe dose. Overdoes are defined as doses that prevent scaling but cause permeability decline due to the precipitation of a calcium-antiscalant compound. The optimum dose is the lowest antiscalant dose that can prevent scaling. Underdose is defined as a dose that is less than the optimum dose and cannot prevent scaling. Safe antiscalant doses are those that fall between the overdose and the optimum dose, avoiding scaling without causing the calciumantiscalant compound to develop.

Step changes in antiscalant dosing (Proof of principle of the dosing algorithm)
In this section, we evaluate the effect of step-changes in antiscalant  dosing in order to investigate if once scaling occurs due to under-dosing, further accumulation of scaling can be stopped by increasing the antiscalant dose. This was evaluated with induction time measurements (3. Fig. 7a  To answer that, an induction time test was performed initially without antiscalant and when the pH started to decrease due to the formation of calcium carbonate crystals, antiscalant (with an equivalent feedwater dose of 2.0 mg/L) was added to the solution (Fig. 7c).

Induction time measurements
As can be seen in Fig. 7c, pH began to decline in the absence of antiscalant (similar to Fig. 7a), but when 2.0 mg/L antiscalant was added after a 0.1 unit drop in pH, the subsequent decrease in pH stopped and thereafter, was constant for a duration longer than 1 week. This result showed that the antiscalant was able to prevent further formation and growth of calcium carbonate crystals in a highly supersaturated solution. Fig. 7d presents the induction time of the synthetic RO concentrate (without and with 2.0 mg/L of antiscalant) where (fresh) calcium carbonate crystals were already present in the glass reactor prior to the addition of antiscalant. The freshly formed calcium carbonate crystals (in the glass reactor) were obtained from the induction time experiment with the synthetic RO concentrate in the absence of antiscalant shown in Fig. 7a. In the presence of calcium carbonate crystals, pH decreased immediately as can be seen from Fig. 7d which suggested that the induction time was very short and the growth phase started directly. With the addition of antiscalant after a 0.1 unit drop in pH, the further decrease in pH stopped, which indicated that the phosphonate antiscalant was able to prevent further crystallization of calcium carbonate in a supersaturated solution.
In brief, from Fig. 7c and d, one can observe that in the case when scaling occurs in an RO system due to an underdose of antiscalant, further scaling can be stopped when a safe (or an optimum) dose of antiscalant is implemented. Fig. 8 shows the permeability of the RO membrane when fed with the synthetic RO concentrate (LSI 2.2) and with a feedwater antiscalant dose of 2.0 mg/L and 0.2 mg/L. As can be seen, the permeability remained constant with 2.0 mg/L dose, while it decreased when the dose was lowered to 0.2 mg/L. When the dose was increased back to 2.0 mg/L after a drop of approximately 27% in permeability, further decrease in the permeability stopped. This result clearly showed that a safe dose of phosphonate antiscalant can prevent further scaling in RO in the case when membrane elements are previously scaled due to an antiscalant underdose. Fig. 9a illustrates the scaling potential of RO concentrate at 80% recovery which was determined with the projection program of an antiscalant supplier. According to the projection program, both calcium carbonate and barium sulphate had the tendency to scale the RO unit in the absence of antiscalant, while with the addition of antiscalant, precipitation of the abovementioned compounds was not expected. It is worth mentioning that the actual saturation level of the scaling compounds would remain the same in the presence and absence of antiscalants. In the presence of antiscalant, the crystallization of the scaling compounds is hampered, preventing them from precipitating in the RO unit. This inhibitory effect of antiscalant is portrayed in the projection program as if antiscalant lowers the saturation level of the scaling compound (Fig. 9a), which is not the case. The antiscalant projection programs provide a lower saturation level in the presence of antiscalant to qualitatively indicate that the given compound may not precipitate when antiscalant is added. As the barium concentration in the RO feed is very low (ca. 0.1 mg/L) and due to the very slow precipitation kinetics of barium sulphate reported by Boerlage et al. [21], we consider that calcium carbonate is the main compound which will scale the RO unit in the absence of antiscalant. To prevent scaling in the RO unit in Brabrand, Denmark, the recommended dose given by the projection program was 4.5 mg/L. Fig. 9b presents the NDP when the RO pilot unit was operated at 80% recovery with various doses (including the supplier's recommended dose) of antiscalant and without the addition of antiscalant. As can be seen, no increase in NDP was observed when the antiscalant dose was lowered (in steps of 0.45 mg/L) from the supplier's dose of 4.5 mg/L to 0.45 mg/L, which suggested that the supplier's recommended dose was far greater than the actual (optimum) dose required to control scaling.

RO pilot measurements
When the dose was decreased to 0 mg/L, scaling started immediately which can be concluded from the NDP increase (during the operational

Application of the dosing pump algorithm
In the previous section, it was demonstrated that the accumulation of scale due to under-dosing of antiscalant can be stopped by increasing the antiscalant dose to the optimum level. This satisfies the basic criterion for the dosing algorithm to be used in RO processes to determine the optimum antiscalant dose necessary to control scaling. The objective of this section is to evaluate the dosing algorithm in two different RO pilot plants in Kamerik (Netherlands) and in Brabrand (Denmark) to determine the optimum antiscalant dose at various recoveries. Fig. 10a depicts the scaling potential of the RO concentrate in the absence and presence of antiscalant for the Kamerik RO unit at 80% recovery. According to the projection program, calcium carbonate and barium sulphate were the compounds that could cause scaling in the RO unit in the absence of antiscalants, while in the presence of antiscalant, scaling was not expected. We consider calcium carbonate as the main compound causing scaling in the RO unit due to the slow precipitation kinetics of barium sulphate as described earlier [21]. According to projection programs of the various suppliers, the proposed antiscalant was a phosphonate antiscalant, and the recommended dose was 2.0 mg/L.

Application of the algorithm to the RO plant in the Netherlands
In Fig. 10b, the NDP of the last stage at 80% recovery with various doses of the phosphonate antiscalant is shown. The initial dose used in the algorithm was the supplier's recommended dose (2.0 mg/L). The algorithm was programmed to decrease the dose in 9 steps of 0.2 mg/L after each 12 h of operation. It was assumed that the optimal dose for the RO unit at 80% recovery was in the range of 0.2-2.0 mg/L. As can be seen, no increase in NDP was observed at all doses between 2.0 mg/L and 0.2 mg/L. It is possible that the optimal antiscalant dose for the RO unit at 80% recovery is between 0 and 0.2 mg/L. However, at this point, the algorithm was not programmed to implement doses below 0.2 mg/L. To summarize, Fig. 10b showed that the supplier's recommended dose of 2.0 mg/L was considerably higher than the minimum dose required to prevent scaling, and that by using the dosing algorithm, the antiscalant dose was reduced by approximately 90% for the RO pilot unit at 80% recovery.
It is worth mentioning that at recoveries above 80%, the determination of the optimal antiscalant dose with the algorithm was not possible, since (amorphous) calcium phosphate was the precipitating compound at those recoveries [27]. In our previous work Mangal et al. [28] have demonstrated that antiscalants are not effective in preventing amorphous calcium phosphate scaling.

Application of the algorithm to the RO plant in Denmark
In Fig. 11a, the long-term operation of the RO unit (in Denmark) at 80% recovery with various doses of the antiscalant is illustrated. The algorithm was programmed to start with an antiscalant dose of 6.0 mg/L and then reduce the dose by 0.5 mg/L every 24 h until it reached a minimum dose of 0.6 mg/L.
As can be seen from Fig. 11a, no increase in NDP was observed when the algorithm lowered the antiscalant dose from the initial dose of 6.0 mg/L to 0.6 mg/L. It should be noted that the algorithm was given a minimum (lower limit) dose of 0.6 mg/L, so the actual optimal dose could be even lower. The RO unit operated for 54 days with the 0.6 mg/L dose which was sufficient to prevent calcium carbonate scaling. In Fig. 11a, one can see that at some points (e.g., between day 19 and 20, between day 42 and 43, and so on), the antiscalant dose jumped to 6.0 mg/L which was because of the disturbances in the RO operation. Nonetheless, the dose decreased back to 0.6 mg/L. The antiscalant dose was increased from 0.6 mg/L to 1.2 mg/L by the algorithm between days 63 and 70. This was again because of the disturbances in the RO operation which led to some short period of NDP increase. As a result, the antiscalant dose was increased by the algorithm. The antiscalant dose will remain at 1.2 mg/L, according to the current algorithm's decision tree (Fig. 1). Fig. 11a clearly shows that the NDP did not increase when the antiscalant dose was 1.2 mg/L, suggesting that the dose could be reduced to 0.6 mg/L. This means that operator intervention is needed when the algorithm increases the antiscalant dose. A warning message should appear on the human machine interface (HMI) indicating that the antiscalant dose has been increased. This prompts the operator to examine the RO performance (NDP) data and determine whether the algorithm's increase in antiscalant dose was caused by scaling or by disturbances in the RO operation. In the latter case, the operator has the option of adjusting the antiscalant dose and/or restarting the algorithm. Furthermore, if the NDP does not increase even with the lowest antiscalant dose given to the algorithm, an operator may restart the algorithm with smaller antiscalant reduction steps and a new minimum dose (lower limit) for the algorithm to determine the optimum antiscalant dose. For example, because no increase in NDP was observed at the lowest given dose of 0.6 mg/L in Fig. 11a, the operator may re-run the algorithm with antiscalant reduction steps of 0.1 mg/L or 0.2 mg/L, with the starting dose (upper limit) set at 1.2 mg/L and the minimum dose (lower limit) fixed at 0.2 mg/L. Nonetheless, Fig. 11a clearly demonstrated that the supplier's recommended antiscalant dose (4.5 mg/L) was significantly higher than the actual optimum dose required for long-term calcium carbonate scaling control in the RO unit. Furthermore, the algorithm was capable of decreasing the antiscalant dose when the NDP remained constant at higher doses, as well as increasing the dose when an increase in NDP was detected. To summarize, the dosing algorithm has the potential to identify optimal doses and minimize antiscalant consumption in RO processes. In this paper, the algorithm was applied where calcium carbonate was the precipitating compound. However, it is worth mentioning that the dosing algorithm should be able to identify the optimum dose of antiscalant for any scaling compound (e.g., calcium carbonate, calcium sulphate, silica, etc.) as long as the following two conditions are met: i) antiscalant is effective in preventing the precipitation of the scaling compound, and ii) the accumulation of scale due to under-dosing of antiscalant can be stopped by increasing the antiscalant dose to the optimum (safe) level. Fig. 11b illustrates the long-term operation of the RO unit with a constant antiscalant dose of 6.0 mg/L (1.5 mg/L higher than the supplier's recommended dose) in the absence of the dosing algorithm. As can be seen, the NDP increased at a constant antiscalant dose of 6.0 mg/ L, which could not be due to calcium carbonate scaling because the NDP remained constant with the 0.6 mg/L antiscalant dose in Fig. 11a. The calcium and antiscalant concentrations in the real RO concentrate of the RO unit in Denmark were 775 mg/L and 30 mg/L, respectively, which were comparable to the concentrations of calcium (765 mg/L) and antiscalant (33 mg/L) present in the synthetic concentrate of the lab scale RO unit in Fig. 5b (where permeability decreased sharply due to overdosing). This suggested that calcium-antiscalant compound, i.e., calcium phosphonate could be responsible for the increase in NDP in Fig. 11b. However, the adverse effect of antiscalant overdosing in the RO pilot unit (Fig. 11b) did not appear to be as severe as in the lab-scale RO unit (Fig. 5b). This could be due to a number of factors, including: i) the lab-scale RO measurements were carried out at room temperature (22 • C), whereas the feedwater (groundwater) temperature in Fig. 11b was 12 • C. As a result, the calcium-phosphonate compound in the labscale RO tests (Fig. 5b) had a higher saturation level (and faster precipitation kinetics) than the RO pilot tests (Fig. 11b), and ii) the increase in NDP of the lab-scale RO unit (if operated at constant permeate production (flux)) is more pronounced for a given decrease in membrane permeability than that of the pilot unit, because the lab-scale RO unit had only a single membrane sheet (total area = 0.014 m 2 ), whereas the pilot RO unit had 6 membrane elements in series (total area = 43.2 m 2 ). To summarize, the results of Fig. 11b also indicated that an antiscalant overdose could be detrimental to RO operation, and establishing an optimum dose is important to prevent fouling due to overdosing of antiscalants in RO systems.

Conclusions
In this study, we investigated the proof of principle, the validity and the application of a control algorithm that defines a real-time optimal set-point of antiscalant dosing to minimize antiscalant consumption in RO processes. In addition, the effect of underdose and overdose of antiscalant, i.e., phosphonate antiscalant on membrane scaling and RO operation was demonstrated. We combined pilot-scale RO operation, lab-scale RO operation and controlled precipitation (induction time) experiments.
The major findings of this study can be summarized as follows: • Underdose and overdose of phosphonate antiscalants can both be detrimental to the operation of RO systems, when trying to prevent calcium carbonate scaling. o Underdose of antiscalant results in RO flux decline due to the occurrence of (calcium carbonate) scaling on RO membranes o Overdose of antiscalant can lead to membrane fouling due to the precipitation of (amorphous) calcium-antiscalant deposits on RO membranes • In the case of scaling caused by the control algorithm's underdose of antiscalant, further scaling can be stopped when the algorithm increases the antiscalant dose back to a safe (or the optimum) dose. o Using induction time measurements, it was demonstrated that the decrease in pH caused by the formation of calcium carbonate at underdose (or zero dose) ceased when a safe dose was implemented. o With lab-scale as well as pilot-scale RO measurements, it was shown that permeability decline (increasing NDP) caused by an underdose of antiscalant stopped when the dose was increased to a safe (or the optimum) dose. • The dosing pump algorithm is a useful tool that considers the variation in RO feedwater quality and identifies real-time optimum antiscalant doses necessary to prevent scaling for a given recovery in RO. o For the RO pilot plant in the Netherlands, the supplier's recommended antiscalant dose at 80% recovery was 2.0 mg/L, while the dosing pump algorithm lowered the dose to 0.2 mg/L without any increase in NDP and thus resulted in a 90% reduction in antiscalant consumption. o For the RO pilot plant in Denmark, the supplier's recommended antiscalant dose was 4.5 mg/L, whereas the algorithm reduced the dose to 0.6 mg/L, which resulted in a stable NDP for over two months period and nearly 87% reduction in antiscalant consumption.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.