Abstract
Advanced optimal dosing control based on multiple online sensor data is operational in several treatment facilities in Norway. The benefits of the dosing control system in maintaining stable phosphate/solids removal and saving coagulant usage are documented in the literature. The dosing algorithm is currently implemented in a programmable logic controller (PLC) connected to the treatment plant's Supervisory Control and Data Acquisition (SCADA) system. The PLC receives online sensor data from the plant's SCADA, calculates the optimal dosing values, and transmits optimal dosage values back to the SCADA system. The dosing algorithm is frequently updated to keep in sync with the process and equipment upgrades of the treatment plant and advances in control algorithm schemes. The upgrades include new regulatory feedback loops, structural changes to the dose equation, and the addition of conditional setpoints. Each maintenance and upgrade routine entails operational downtime where the dosing algorithm is set to a sub-optimal flow-proportional dose. This paper presents a non-intrusive Internet of Things (IoT) infrastructure to implement a predictive/forecast component to an existing dosing control algorithm. The benefits of the new cloud-based system in improving nutrient removal, increasing operational flexibility, and reducing maintenance downtime are presented in this work.
HIGHLIGHTS
Hybrid predictive models forecast effluent quality up to 4 h in advance.
Control models developed in python can be deployed in real-time.
Integrating forecast models enhances dosing control algorithms.
INTRODUCTION
Over 66% of wastewater treatment plants (WWTPs) in Norway employ chemical coagulation and flocculation, followed by sedimentation, as their primary treatment method (Berge & Onstad 2021). These processes necessitate a significant annual coagulant consumption of around 100,000 tons. Excessive use of coagulants and flocculants can increase operational costs without any discernible improvements in treatment efficiencies (Jiang 2015; Wang et al. 2021b). On the other hand, insufficient dosing of these chemicals can result in inadequate contaminant removal, potentially compromising the quality of the effluent and posing risk to public health (Sohrabi et al. 2018). Therefore, WWTPs often implement dosing control systems to ensure the optimal dosage of chemicals, which can reduce operating costs and minimize sludge production while simultaneously meeting the effluent discharge requirements set by the government (Ratnaweera & Fettig 2015). These measures align with the overarching global objective of achieving sustainable resource management and recovery.
Dosing control systems range from simple flow-proportional to complex multiparameter algorithms (Hahn et al. 2005). Conventional multiparameter dosing control systems employ real-time data from online physical sensors (such as pH, conductivity, ORP, suspended solids, and temperature) to calculate the optimal dosages (Huang & Liu 1996). Although the feed-forward dosing control model with a feedback correction described in (Liu & Ratnaweera 2016) has yielded satisfactory results, several inherent challenges encourage researchers and treatment plant operators to explore avenues for improvement.
A significant challenge arises from the high hydraulic retention time in the treatment process, leading to a delay of two to 5 h between inlet and outlet sensor readings. This high retention time entails that the feedback corrections calculated using the effluent water-quality sensors should be judiciously used in the dosing control algorithm. Grey-box dynamic models, previously employed to estimate effluent TP and COD values (Nair et al. 2020a), can be adapted to generate time-step ahead predictions and potentially offset the high process delay time. However, the complex forecast models developed using commonly used programming languages such as Python, Julia, MATLAB, must be transcribed to their respective PLC applications (using proprietary programming suites) for real-time deployment (Parrot & Venayagamoorthy 2008). This comprehensive process requires a substantial investment of man-hours for transcription, rigorous testing, and necessary modifications. Moreover, it comes with the added disadvantage of system downtime during the PLC application updates in the WWTP. Therefore, an alternative deployment architecture is necessary for a more convenient and faster deployment of forecast models in real-time.
Internet of Things (IoT) and cloud computing have gained widespread recognition and adoption in water and wastewater treatment industry (Torfs et al. 2022). Since the first appearance of the IoT in the early 2000s, internet-connected devices have seen exponential growth (Wang et al. 2021a). IoT systems can be combined with data analytics to deploy predictive algorithms for WWTP monitoring. A non-intrusive version of such infrastructure, used to deploy a soft sensor algorithm, was first tested on a pilot-scale (Nair et al. 2020b), followed by successful demonstrations in full-scale WWTP (Nair et al. 2022). A robust performance of the non-intrusive IoT infrastructure for algorithm deployment prompted us to explore the possibility of modifying the system to facilitate two-way communications with the PLC.
This work presents a non-intrusive IoT infrastructure that could be used to deploy complex forecast models to enhance the dosing control system. A full-scale WWTP located in Norway served as the testbed to evaluate this new IoT infrastructure and the supervisory add-on to the existing dosing control system. The changes in plant performance both in terms of the number of operational downtimes caused due to model updates and the improvement in treatment efficiencies due to the new forecast-based algorithm were assessed.
MATERIALS AND METHODS
Treatment process and control system
The municipal WWTP located in the Norwegian town of Vestby was used as a test site to evaluate the new IoT infrastructure and the forecast model add-on to the control algorithm. The WWTP has a treatment capacity of 29,000 population equivalents (p.e.) and uses chemical coagulation as its primary method for eliminating phosphates as well as suspended and colloidal particles from municipal wastewater.
The treatment process starts with screen filters, where large particles are removed from raw sewage, entering the WWTP from the central pump station. The wastewater then proceeds to the sand traps, where heavier particles are separated and subsequently eliminated through sedimentation at the tank's base. Following the removal of mechanically separable larger particles, the wastewater advances to the chemical treatment stages. Within this stage, a pre-polymerised aluminium-based pre-polymerised coagulant is introduced into the wastewater, leading to the coagulation of suspended solids and soluble phosphate, resulting in the formation of larger flocs. In the final stage within the flocculation basin, an organic polymer is introduced to further enhance particle aggregation. Wastewater achieving sufficient floc development is then directed to six rectangular sedimentation tanks, providing an ample residence time for the flocs (sludge) to settle at the tank's bottom. Subsequently, the treated wastewater flows over weirs into the effluent channel, while the sludge is extracted from the bottom of the sedimentation tank. A detailed layout of the treatment plant, complete with flow directions and distribution, sensor locations, and dosing points, can be found in Nair et al. (2022).
Real-time data communication between the plant's SCADA system and ADoC is a fundamental aspect of the operational framework. In this setup, the ADoC system receives sensor data in real-time from the WWTP̀s SCADA, and subsequently, optimal dosage values are relayed back to the SCADA which in turn steers the dosing pumps. The communication configuration, the model equations for dose calculations, feedback correctors, and fail-safe algorithms are programmed using the proprietary programming language offered by Beijer Electronics. To facilitate remote data management and accessibility, a dedicated data module is appended providing connectivity to the ADoC system. Online data, received by the ADoC, is logged in the remote database offered by DOSCON. This data can be accessed through the DOSMON monitoring suite, enhancing the overall monitoring and control capabilities of the system.
Forecast model and algorithm modification
In Equation (1), is the model predicted values of COD and TP at time instance and is the time frequency. V is the holdup volume of the treatment plant, is the inlet TP/COD concentrations, is the flow rate, and is the removal rate value at time instance t. The removal rate is calculated using a data-driven model where the pH in the flocculation basin ), coagulant dosage , and flocculant dosage ) are model inputs. The models were implemented in Python and were calibrated using real-time data from physical and soft sensors, deployed in the treatment plant. The batch calibration method discussed in Marsili-Libelli et al. (2001) was used to fit the treatment plant data to the model and obtain the model calibration parameters.
Proposed architecture
Within the PLC layer of the updated IoT infrastructure, a new gain-adjusting sub-module has been introduced. This addition complements the three existing data-processing modules from the previous system (as shown in Figure 1). The cloud layer encompasses three distinct sub-sections (Figure 2). The first sub-section hosts a database module equipped with a PostgreSQL server, operating as a real-time data repository. Following that, the second sub-section features a forecast module, scripted in Python. This Python script retrieves the latest data from the repository and generates predictions for effluent water-quality parameters at future time steps. The output of the forecast module is subsequently utilized in the third sub-module, which encompasses the optimizer. This optimizer determines optimal control moves of the coagulant and flocculant dosages for a future time horizon. These control moves are then transmitted to the PLC, which reconciles the cloud-base dose calculations with the values, calculated by the base algorithm in the PLC in the gain adjuster module.
To handle data requests, originating from the PLC, and route them to the remote database, the cloud infrastructure incorporates a data queuing service. Additionally, an extra communication layer has been integrated to the existing PLC application. This communication layer consists of a MQTT client service that can send data (publish) and receive real-time updates (subscribe) from the data server (with an MQTT broker) installed in the cloud infrastructure.
Evaluation criteria
The new architectural framework was implemented at the WWTP, and the results were monitored over a 3-month period. Two distinct evaluation criteria were used to assess the performance of the new IoT infrastructure and the forecast model-based control algorithm.
Number of effluent violations
The WWTP is subject to regulatory requirements, mandating a TP removal efficiency of over 90%. Typically, the operators maintain removal rates at approximately 92.5%, allowing for a safety margin of ±2.5%. To monitor the daily removal rate at the WWTP, a carousel sampler is installed at both the influent and effluent lines. Samples are automatically collected at regular intervals, and TP values are measured in the laboratory every day using the standard methods described in Standard Methods (2012), during the test period. The daily measurements of influent and effluent TP concentration serve as reliable performance indicators for our ADoC system. Optimal coagulant dosage results in a removal rate between 90 and 95%, while values below 90% or above 95% can indicate potential underdosing or overdosing scenarios.
Operational downtimes
DOSCON maintains comprehensive logs of both planned and unplanned maintenance interventions on the ADoC. Planned upgrades encompass a range of activities, including version updates, algorithm calibration, the introduction of new conditional loops, SCADA system overhauls, changes in sensor types, and sensor calibration. During the upgrade, the dosing control system switches over to sub-optimal flow-proportional control. The number of interventions and values of operational downtime are recorded in the company's operational management system. A thorough comparison of the number of interventions and the total hours of operational downtime both before and after the implementation of our new IoT-based infrastructure were conducted to quantify the change.
RESULTS AND DISCUSSION
Performance of forecast model
The plots in Figure 3 show that the forecast accuracy shows a discernible decline as the forecast horizon increases. For t= 30 min, the model predicted versus actual values showed a correlation coefficient of R2 = 0.98, which subsequently dropped to 0.95 and 0.921 for a forecast horizon of 1 and 4 h, respectively. The prediction accuracy drops drastically to about 0.67 for a time horizon of 8 h. Because the total residence time for the entire treatment line varies between 2 and 4 h, it would be safe to use the time-step ahead forecast values in the optimal dose calculations without compromising on the optimal dose calculation.
Process improvements after forecast algorithm deployment
The plots in Figure 4 and the quantitative comparisons in Table 1 demonstrate that the TP removal values for the new dosing control algorithm are closer to the ideal (set-point) removal rate of 92.5%, showing a mean absolute error (MAE) of 1.03. In contrast, the algorithm without the forecast model exhibited an MAE value of 3.57. Moreover, the new algorithm not only exhibits lower deviation from the ideal removal value but also demonstrates fewer limit violations. While the previous algorithm crossed the upper and lower limits of 90 and 95% on five different occasions over the initial three-month period, the new algorithm showed no limit violations during the assessment period. This performance improvement can be attributed to the proactive component of the dosing control algorithm, which rapidly adjusts its optimal dose values as the forecasted TP removal values approach the predefined limits.
Performance indicators . | Before forecast corrector . | After forecast corrector . |
---|---|---|
Average TP removal (%) | 93.7 | 92.5 |
Mean absolute error | 3.57 | 1.03 |
No. limit violation | 5 | 0 |
Performance indicators . | Before forecast corrector . | After forecast corrector . |
---|---|---|
Average TP removal (%) | 93.7 | 92.5 |
Mean absolute error | 3.57 | 1.03 |
No. limit violation | 5 | 0 |
It is also important to highlight that the TP removal rate shown in Figure 4 and the quantitative parameters presented in Table 1 pertain to days with dry weather conditions, where the total inflow is less than 9,000 m3/day. This correction is made to account for the challenges posed by rainy weather, which can lead to sewer overflows and extremely low TP concentrations in the raw wastewater, making it difficult to maintain a TP removal rate above 90% even if the dosing pumps are operating at maximum capacity. Therefore, in scenarios of extremely high flow where the inflow is greater than 9,000 m3/day, optimizing the dose alone may not be sufficient to meet the treatment requirements. To avoid any impact caused by the plant's process capacity limitations, we have excluded these high flow conditions from our dosing control comparison. Furthermore, conducting a quantitative comparison under similar operating conditions provides a reasonable basis for comparing the performance of two different control algorithms.
Reduction in operational downtime
Figure 5 shows that manual interventions have increased after deploying the new IoT infrastructure. These interventions are due to activities such as changes in model types, adding new predictors to the forecast algorithms, tuning the weights of the optimizer, and adjusting the reconciliation factors in the PLC. These actions were conducted during the initial days of the algorithm deployment to fine-tune the system and obtain the ideal parameters pertaining to the forecast algorithm and the optimizer. It could also be observed that despite the increase in the number of manual interventions, there has been no increase in operational downtime. This is primarily because most of the modifications were conducted in the cloud layer, during which the core algorithm running in the PLC was unaltered, resulting in no operational downtime during code modification. This new approach allowed us to alter the supervisory dosing control algorithm on the go without pausing the existing algorithm already deployed in the PLC. This dual-layered approach also incorporates an additional layer of security, preventing a complete failure of the ADoC during possible internet outages. In such situations, even if the PLC's gain-adjusting module does not receive the signal from the MQTT broker, the PLC reverts itself to the base algorithm rather than completely shutting down the ADoC.
CONCLUSIONS
The hybrid forecast models presented in this work demonstrate a capacity to predict effluent water-quality parameters with a reasonable level of accuracy. Consequently, these forecasted effluent TP values, for a time horizon of up to 4 h, can be used as a predictive component in the dosing control algorithm. The forecast models that provide time-step ahead TP values and the supervisory dosing algorithms that provide optical control moves can be implemented in the dual-layered IoT infrastructure presented in this study. The novel forecast-based dosing control algorithm yields significant performance improvements compared to its predecessor. It excels in maintaining TP removal close to the desired set-point value while simultaneously reducing the number of limit violations. Furthermore, adopting a dual-layered IoT strategy introduces sufficient levels of flexibility to adapt the control algorithm without incurring operational downtime. This new system also takes into account practical considerations, such as potential internet connectivity loss. The ADoC seamlessly reverts to the base control in such cases, ensuring robust and uninterrupted system performance.
ACKNOWLEDGEMENTS
The authors wish to acknowledge the encouraging discussions and logistical assistance from Geir Simensen and Rune Larsen at the Sondre Follo WWTP, Vestby, Norway.
DATA AVAILABILITY STATEMENT
All relevant data are included in the paper or its Supplementary Information.
CONFLICT OF INTEREST
The authors declare there is no conflict.