# Improving Process Management in a Water Treatment Plant Using Control Modelling

Cleber Gustavo Dias, Fábio Santos, André Librantz, Cristiano Sousa, Luiz Silva

► To cite this version:

Cleber Gustavo Dias, Fábio Santos, André Librantz, Cristiano Sousa, Luiz Silva. Improving Process Management in a Water Treatment Plant Using Control Modelling. IFIP International Conference on Advances in Production Management Systems (APMS), Sep 2016, Iguassu Falls, Brazil. pp.138-145, 10.1007/978-3-319-51133-7_17. hal-01615700

HAL Id: hal-01615700

https://inria.hal.science/hal-01615700

Submitted on 12 Oct 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Improving Process Management in a Water
Treatment Plant Using Control Modelling

Cleber Gustavo Dias<fnref n="1" /> and Fábio Cosme Rodrigues dos Santos<fnref n="1" />,<fnref n="2" />, André Felipe Henriques Librantz<fnref n="1" />, Cristiano Morais de Sousa<fnref n="1" />, and Luiz Carlos da Silva<fnref n="1" />

**Abstract.** This work presents a modelling and a simulation of a pH con-
trol for process management in a drinking water treatment plant. A range
of historical data, or knowledge base, was used to define the behavior of
each input and disturbances of the process, using the MATLAB/Simulink
software. The present pH control modelling has been simulated and com-
pared to some experimental tests, thus con-tributing to achieve and iden-
tify operational scenarios in a real water treatment plant. Therefore, the
present results allows to predict not only the present scenari-os but also
new operational conditions, in order to estimate the better process pa-
rameters and reduce some costs related to raw materials, such as the
lime con-sumption, in water treatment plants.

**Keywords:** pH Control · Water Treatment Plant · Modelling and Sim-
ulation · Industrial Process Management

# 1 Introduction

The pH neutralization process, or the control of pH, is a crucial task in wide in-
dustrial applications, such as chemical, biotechnological engineering, wastewater
and water treatment plants (WTP). The pH, as a definition, is the logarithmic
value of hydrogen ion activity in an aqueous solution or a measure of the acidity
or alkalinity of a solution [1]. In terms of numerical values, a solution with a pH
equal to 7 is neutral and for an alkalinity solution, this value is greater than 7.
In an acidic solution, the pH value is less than 7.

The control of a pH neutralization is one of the major problem in water
treatment plants, particularly due to its highly nonlinear characteristics [2]. In
the last years, many researchers have studied pH control strategies and methods
to resolve or min-imize this strong nonlinearity [2].

In some cases, an extended Kalman filter (EKF) and an unscented Kalman
filter (UKF) were used to estimate some values in a nonlinear pH process [3,4].
In [5], double-control scheme for pH process was employed to obtain a good load
rejection performance, particularly simultaneous change occurs in set point and
in disturbance inputs. This solution was proposed to overcome some drawbacks

<footnote n="1">¹ Nove de Julho University, São Paulo, Brazil</footnote>

<footnote n="2">² Companhia de Saneamento Básico do Estado de São Paulo, São Paulo, Brazil

diascg@uni9.pro.br</footnote>
usually found in conventional PID (proportional-integral-derivative) systems,
such as the robustness of the control.

In [6], a Wiener-Laguerre model was used to evaluate the pH neutralization
process as a nonlinear model predictive control framework, based on the sequen-
tial quadratic programming algorithm. This solution was designed considering
an operation of the pH process in distinct set points. A Wiener model identifi-
cation and predictive control also was applied of a pH neutralization process in
[7], but in this case in an effluent solution control.

A multi-model nonlinear predictive control scheme was applied in [8] to de-
scribe and handle the nonlinearities of a pH industry process. This approach
included a parallel integral action in the controller to compensate unmeasured
states.

In a WTP, for example, natural dissolved organic matter (DOM) is present
and this kind of product may cause relevant problems for process control [9]. In
this situation, a coagulation step should be applied to maximize the removal of
DOM in water, but accordingly to [9], some coagulants are able to modify the
final pH, especially after enhanced coagulation. In [10], a reset/hybrid control
application was applied an in-line pH process, in order to test the performance
of a reset controller for a non-linear system with disturbances.

In some cases, a pH process requires an online monitoring and control sys-
tem due to its highly nonlinear aspects [11,12]. Other researches took into
account the use of artificial intelligence techniques to improve pH control, in
particular for predictive purposes and adaptive and/or optimization strategy
[13,14,15,16,17,18,19,20,21].

As aforementioned, the pH control is a major issue in some industrial pro-
cesses due to its nonlinear behavior, thus, in this context, the aim of this work
consists in the modelling and simulating a pH closed-loop control of a real WTP,
in order to better manage the process and reduce some costs related to the use
of raw materials in a water treatment plant, for some operational scenarios, as
well as identify the better parameters for this type of process.

## 2 Methodology

The present work has been applied for simulation purposes and some process
variables were chosen by mathematical modelling. These variables were identified
con-sidering their impact for pH control in a real drinking water treatment plant,
located at São Paulo city, Brazil. The rated flow of this WTP is 33 m³/s. In this
context, this research has been performed in six steps, as follows:

1. Identify the process variables according to the desired pH behavior. Thus, consid-ering the knowledge of the operators, some parameters were identified as relevant for pH control, such as, chlorine dosage and fluorine dosage at the end of the pro-cess treatment, raw water flow, treated water turbidity and the lime dosage;

2. Select a range of historical data stored in a Supervisory Control and Data Acquisi-tion (SCADA system). This system is running at the local water
plant and Figure 1 shows a screen of the SCADA used for operating the WTP and lime dosage to con-trol the pH of the drinking water. On this screen is possible to adjust the reference value for automatic controller or the lime pump frequency, as well as other parameters such as the lime flow, lime dosage and dosage pumps.

<figure><img src="image_2.png" /><figcaption>Fig. 1. A process screen in the SCADA system for pH monitoring and lime dosage</figcaption></figure>

3. Identify a sample data wherein the pH process was being controlled in automatic mode. Table 1 shows a brief sample of the experimental data used for modelling and simulation.

<table><caption>Table 1. Some historical data selected from SCADA software</caption><thead><tr><th rowspan="2">Data and Time</th><th colspan="2">Measured Turbidity</th><th>Chlorine</th><th>Fluorine</th><th>Raw water</th></tr><tr><th>pH</th><th>(UNT)</th><th>dosage (mg/L)</th><th>dosage (mg/L)</th><th>flow (m3/s)</th></tr></thead><tbody><tr><td>2015-10-06 03:39:08:117</td><td>7.93</td><td>0.42</td><td>1.74</td><td>0.64</td><td>13.82</td></tr><tr><td>2015-10-06 03:41:38:163</td><td>9.04</td><td>0.45</td><td>1.64</td><td>0.61</td><td>13.85</td></tr><tr><td>2015-10-06 03:44:08:147</td><td>8.96</td><td>0.46</td><td>1.66</td><td>0.63</td><td>13.86</td></tr><tr><td>2015-10-06 03:46:38:677</td><td>9.04</td><td>0.45</td><td>1.68</td><td>0.68</td><td>13.87</td></tr><tr><td>2015-10-06 03:49:08:177</td><td>8.70</td><td>0.45</td><td>1.67</td><td>0.73</td><td>13.86</td></tr><tr><td>2015-10-06 03:51:38:193</td><td>8.33</td><td>0.44</td><td>1.66</td><td>0.80</td><td>13.77</td></tr><tr><td>2015-10-06 03:54:08:803</td><td>8.34</td><td>0.45</td><td>1.69</td><td>0.60</td><td>13.81</td></tr></tbody></table>

4. Load these data in the MATLAB® software and execute some specific commands to determine the behavior (transfer function) of each input and respective output variable. In this case, the output variable is the measured pH. The following commands were used:

- Command "iddata": create a data object to encapsulate the input/output data and their properties(Eq. 1).

$$DAT = iddata(Y, U, Ts) \qquad (1)$$
Where: Y = output, U input and Ts = sampling interval
- Command “tfest”: This MATLAB c ○ function estimates a continuous-
time transfer function, sys, using time- or frequency-domain data, DAT
obtained from “iddata” command, and contains np poles, as follows Eq
2:

$$
\text{sys} = \text{tfest}(\text{DAT}, \text{np}) \tag{2}
$$

5. Modelling each input/output variable and/or equipment in the MATLAB Simulink environment, in order to proceed to the operational scenarios simulation. Figure 2 shows an aerial view of the WTP used for modelling and experimental validation. Figure 3 shows a final model of each variable, i.e., chlorine dosage, treated turbidity and flow, as well as the equipment behavior, such as lime and fluorine pumps, after modelling step. Figure 3 also highlights a transfer function obtained for one disturbance, i.e., for chlorine dosage, using Equations 1 and 2. This function is a relation between the chlorine dosage and its influence in the pH value. Equations 1 and 2 also were used for determining the other disturbances, such as fluorine dosage, flow and turbidity influence.

<figure><img src="image_3.png" /><figcaption>Fig. 2. The water treatment plant used for modelling and simulation</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Fig. 3. The process modelling in the MATLAB/Simulink c ○ software</figcaption></figure>

6. The performance of the final model is measured by the mean absolute error (MAE), as shown in Equation 3:

$$
MAE = \frac{1}{N} \sum_{i=1}^{N} (t_i - y_i) \quad (3)
$$
Where, is desired value; is value obtained from the mathematical model and N is number of existing samples. The next section shows the results and discussion about the simulation of three operational scenarios using the model depicted in Figure 3.

## 3 Results and Discussion

This session shows the results and discussion about the simulation of three operational scenarios using the final mathematical model depicted in Figure 33. In each case, the initial conditions were used to start the simulation and proceed with experimental validation.

- First scenario (initial conditions): in this case the initial parameters were defined as follows: chlorine dosage = 1.74 mg/L, fluorine dosage = 0.645 mg/L, raw water flow = 13.83 m³/s and treated turbidity = 0.422 NTU. Figure 3 (a) and (b) show the lime pumps dosage, and the pH obtained in the experimental and simulated data.

<figure><img src="image_5.png" /><figcaption>Fig. 4. a) Frequency of lime pumps 1 and 2 and b) pH measured for experimental and simulated data</figcaption></figure>

- Second scenario (initial conditions): in this case the initial conditions were defined as follows: chlorine dosage = 1.86 mg/L, fluorine dosage = 0.654 mg/L, raw water flow = 17.24 m³/s and turbidity = 0.33 NTU. Figures 3 (a) and (b) show the lime pumps dosage and the pH obtained in the experimental and simulated data.

- Third scenario (initial conditions): in this case the initial conditions were defined as follows: chlorine dosage = 1.76 mg/L, fluorine dosage = 0.691 mg/L, raw water flow = 27.03 m³/s and turbidity = 0.272 NTU. Figures 6a and 6b show the lime pumps dosage and the pH obtained in the experimental and simulated data.
<figure><img src="image_6.png" /><figcaption>**Fig. 5.** a) Frequency of lime pumps 1 and 2 and b) pH measured for experimental and simulated data</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>**Fig. 6.** a) Frequency of lime pumps 1 and 2 and b) pH measured for experimental and simulated data</figcaption></figure>

The results show a good approximation between the simulated and experimental data, even though some operational points should be better evaluated in each case. On the other hand, it should be noted that the results achieved in the scenario 3 are better than those obtained in other cases, as this last scenario have considered a data sampled time equal to 10 seconds from the knowledge base (SCADA system), while in the first and second cases were employed data sample time equal to 2.5 minutes. Table 2 shows the MAE values for each scenario.

The frequency of each lime pump is a relevant parameter capable of estimating the lime consumption in the WTP, since this parameter is useful to determine lime flow. Today, the pH control at the water plant used for experimental validation requires more than 15 tons of lime per day, when the raw water flow is near 33 m³/s.
<table><caption>**Table 2.** Values of MAEs scenarios</caption><thead><tr><th>Scenario</th><th>Mean Absolute<br>Error (MAE) of the frequency of lime pumps</th><th>Mean Absolute<br>Error (MAE) of the pH value</th></tr></thead><tbody><tr><td>1</td><td>9.28 Hz</td><td>0.573</td></tr><tr><td>2</td><td>5.69 Hz</td><td>0.334</td></tr><tr><td>3</td><td>2.06 Hz</td><td>0.192</td></tr></tbody></table>

## 4 Conclusions

This work presented a model of a pH control for process management in a drinking water treatment plant. A data set obtained from a SCADA software was used to define the behavior of each input and disturbances of the process, using the MATLAB/Simulink © software. The results of the three operational scenarios show a good approximation between simulated and experimental data, thus, the present model can be used in other operational conditions, in order to estimate the lime pump frequency and the pH in the treated water, as well as improve the raw water quality and reduce the lime consumption. The current mathematical model can be a useful tool for a decision-making process and production management; particularly for estimating the daily chemical refills in the WTP, which is not an easy task. It should be mentioned that lime consumption could represent 15% of total operational costs in a WTP [22]. Moreover, the lime consumption could be better evaluated due to initial parameters of the WTP. Further investigations should be considered, using an artificial intelligence approach, to estimate the minimum dosage of the lime pumps, maintaining the quality of the treated water. That could lead to cost reduction in the water treatment process.

## References

1. Hermansson, A.W. and Syafiie, S.: Model Predictive Control of pH Neutralization Processes: A Review. Control Engineering Practice pp. 98–109 (2015)

2. Abdullah, N., Karsiti, M., Ibrahim, R.: A Review of pH Neutralization Process Control. In: 4th International Conference on Intelligent and Advanced Systems. vol. 2, pp. 594–598. IEEE (2012)

3. Barhoumi, A., Ladhari, T., M'sahli, F.: The Extended Kalman Filter for Nonlinear System: Application to System of Waste Water Treatment. In: 15th International Conference on Sciences and Techniques of Automatic Control and Computer Engineering. pp. 445–450. IEEE (2014)

4. Romanenko, A., Santos, L.O., Afonso, P.A.: Unscented Kalman Filtering of a Simulated pH System. Industrial & Engineering Chemistry Research 43(23), 7531–7538 (2004)

5. Shobana, S., Panda, R.C.: Control of pH Process Using Double-control Scheme. Nonlinear Dynamics 67(3), 2267–2277 (2012)

6. Mahmoodi, S., Poshtan, J., Jahed-Motlagh, M.R., Montazeri, A.: Nonlinear Model Predictive Control of a pH Neutralization Process Based on Wiener–Laguerre Model. Chemical Engineering Journal 146(3), 328–337 (2009)
7. Gomez, J., Jutan, A., Baeyens, E.: Wiener Model Identification and Predictive Control of a pH Neutralisation Process. IEE Proceedings-Control Theory and Applications 151(3), 329-338 (2004)

8. Hermansson, A.W., Syafiie, S.: Control of pH Neutralization System Using Nonlinear Model Predictive Control with I-controller. In: IEEE International Conference on Industrial Engineering and Engineering Management. pp. 853-857. IEEE (2014)

9. Xie, J., Wang, D., van Leeuwen, J., Zhao, Y., Xing, L., Chow, C.W.: pH Modeling for Maximum Dissolved Organic Matter Removal by Enhanced Coagulation. Journal of Environmental Sciences 24(2), 276-283 (2012)

10. Carrasco, J., Baños, A.: Reset Control of an Industrial In-line pH Process. IEEE Transactions on Control Systems Technology 20(4), 1100-1106 (2012)

11. Jacobs, O., Hewkin, P., While, C.: Online Computer Control of pH in an Industrial Process. In: IEE Proceedings D-Control Theory and Applications. vol. 127, pp. 161-168. IET (1980)

12. Aparna, V.: Development of Automated pH Monitoring & Control System Through USB Data Acquisition. In: 6th IEEE Power India International Conference. pp. 1-6. IEEE (2014)

13. Tan, W., Lu, F., Loh, A., Tan, K.C.: Modeling and Control of a Pilot pH Plant Using Genetic Algorithm. Engineering Applications of Artificial Intelligence 18(4), 485-494 (2005)

14. Menzl, S., Stühler, M., Benz, R.: A Self Adaptive Computer-based pH Measurement and Fuzzy-control System. Water Research 30(4), 981-991 (1996)

15. Saji, K., Kumar, M.S.: Fuzzy Sliding Mode Control for a pH Process. In: IEEE International Conference on Communication Control and Computing Technologies. pp. 276-281. IEEE (2010)

16. Sabharwal, J., Chen, J.: Intelligent pH control Using Fuzzy Linear Invariant Clustering. In: Proceedings of the Twenty-Eighth Southeastern Symposium on System Theory. pp. 514-518. IEEE (1996)

17. Mollov, S., Babuska, R., Abonyi, J., Verbruggen, H.B.: Effective Optimization for Fuzzy Model Predictive Control. IEEE Transactions on Fuzzy Systems 12(5), 661-675 (2004)

18. Xu, C., Shin, Y.C.: A Multilevel Fuzzy Control Design for a Class of Multiinput Single-Output Systems. IEEE Transactions on Industrial Electronics 59(8), 3113-3123 (2012)

19. Loh, A., Looi, K., Fong, K.: Neural Network Modelling and Control Strategies for a pH Process. Journal of Process Control 5(6), 355-362 (1995)

20. Böling, J.M., Seborg, D.E., Hespanha, J.P.: Multi-model Adaptive Control of a Simulated pH Neutralization Process. Control Engineering Practice 15(6), 663-672 (2007)

21. Navghare, S., Bodhe, G.: Design and Implementation of Real Time Neurofuzzy Based pH Controller. In: 2009 Second International Conference on Emerging Trends in Engineering & Technology. pp. 946-952. IEEE (2009)

22. Plappally, A.K., Lienhard, J.H.: Costs for Water Supply, Treatment, End-use and Reclamation. Desalination and Water Treatment 51(1-3), 200-232 (2013)