The use of mathematical models for diagnosis of activated sludge systems in WWTP

In this study diagnosis of activated sludge systems in wastewater treatment plant (WWTP) was investigated. Diagnosis of technical objects can be realized in many ways. One of the divisions of the diagnostic methods include modelling with or without a model of the object. The first of these is the analysis of the symptoms for which, based on the parameter values, the abnormality in the diagnosed objects are sought. Another way is to use models of objects undergoing diagnosis. In this case, the diagnosis comes down to a comparison of information from the response object model or the estimated parameters of the model with data from the real object. The aim of this study was to evaluate an innovative concept of the possible use the mathematical model and computer simulation in the diagnosis and control of activated sludge systems in WWTP.


Introduction
Research in diagnosis systems has been very active since the 1970s.Numerous fault diagnosis methods are reported in the industrial and academic literature.Common know was fault detection and diagnosis (FDD) methods, which was a family of approaches finalized to detection and location of faults on processing systems.The term "fault" is generally defined as "an unpermitted deviation of at least one characteristic property of the system from the acceptable, usual, standard condition" [1].The main aim of FDD methods consists in determining the type, size and location of the most possible fault, as well as its time of detection in order to improve product quality, plant efficiency, as well as the ability to meet environmental and safety constraints.
The task of diagnosis systems in this study was the earliest and most accurate detection of irregularities in the operation of diagnosed process, object etc. based on on-line data.Such a system allows the operator of WWTP to unload the object and monitor operating parameters of the object in order to diagnose abnormal process.Diagnostics of technical objects is based on two main methods: symptomatic diagnostics and modelled support.In the first of these cases, object are performed on the basis of known diagnostic parameters, while in the second variant the diagnosed model is used.Diagnosis supported WWTP control is comparing the results obtained on the real object with the results obtained from the model and then determining, so-called "Residues occurrence of a fixed value may indicate an emergency" or "Closely linked with data acquisition is the detection of faulty behaviour from process data" [2,3].
The purpose of this study is diagnosis of activated sludge systems in wastewater treatment plant (WWTP).Diagnosis of technical objects can be realized in many ways.One of the divisions of the diagnostic methods include modelling with or without a model of the object.The first of these is the analysis of the symptoms for which, based on the parameter values, the abnormality in the diagnosed objects are sought.Another way is to use models of objects undergoing diagnosis.In this case, the diagnosis comes down to a comparison of information from the response object model or the estimated parameters of the model with data from the real object.The aim of this study was to evaluate an innovative concept of the possible use the mathematical model and computer simulation in the diagnosis and control of activated sludge systems in "Klimzowiec" WWTP.located in Chorzów (Poland).

Material and methods
Figure 1 presents a general diagram of the model diagnosis of studied plant under full-scale condition.The model is powered by data from the real object, based on which the object is simulated.The next step is to compare modelling results with the actual results of measurements from the real object.On this basis, residual generation is performed.Then the evaluation of the residue values is made on the basis of which the detection of possible malfunctions is performed (Figure 1).-Mathematical model -approximate object description was created using a mathematical software -Real model -most often, the system is similar to that of a researcher, but simplified and thus simpler to study its behaviour: -Theoretical model -hypothetical design describing a given object in a simplified way, the parameters of the object are reduced to the relations between the most important ones.
-Nominal model -is a deterministic model whose uncertainty is defined by a particular scenario.
Regardless of the modelling methodology, the main problem is the correct representation of the modelled object.This may be due to a number of factors, such as too much measurement data, what causes that all data in the model cannot be taken into account.The reason of this situation is the increasing complexity of parameters that simulation time is too long and the model will no longer be justified.The solution to this problem is to simplify the model.However, it may be that excessive model simplification may reduce the accuracy of the model so that simulation results may prove useless.

Study side
The "Klimzowiec" WWTP is a mechanical and biological treatment plant based on the use of activated sludge in the Bardenpho system.The WWTP is managed by the Chorzów-Świętochłowice Water and Wastewater Utility.Klimzowiec WWTP consists of predenitrification zones and defatting zones as well as three denitrification bioreactors and five nitrification.Each of the nitrification bioreactors has three independent oxygenation zones.The average effluent flow is approximately 25,900 m 3 /d which is equivalent around 200,000 RLM.The Klimzowiec WWTP also has six secondary settlers of which only four are used at the same time.

Model description
The Klimzowiec WWTP model, created in software WEST 2014 SP3, was used to diagnose measuring devices installed in the objects.The mathematical model was developed in WEST (Wastewater Treatment Plant Engine for Simulation and Training) software and used for diagnostics (Figure 2).The ASM2d (Activated Sludge Model No.2d) was used to create the simulation.The model is enhance, among on-line data such as: -wastewater flow Q with sewer parameters (COD, TSS, TN, TP), -the amount of wastewater brought along with the wastewater parameters (COD, TSS, TN, TP), -temperature in pre-denitrification, anaerobic (P removal), denitrification, nitrification tanks etc., -the concentration of oxygen in each of the three sections of biological reactors, -amount of external and internal recirculation.
The standard library of WEST software blocks lacked the means to reproduce the control of sludge recirculation.The WEST software gives the ability to add and modify existing models.This allowed to create a control element for the concentration of suspensions in the effluent, respectively.Control of this parameter is achieved by adjusting the amount of excess sludge discharged from the system.

Previsys and diagnostics system
PreviSys was used in order to start the diagnostics of the sensors, as it was necessary to create a system that allows two-way communication with the SCADA system.It enabled to inform the dispatcher about the problem in easy and readable way and is closely linked with data acquisition is the detection of faulty behaviour from process data.This system can be divided into three parts: PreviBox, PreviSoft and PreviSCADA.
PreviBox is a device that, when used in conjunction with or replacing wastewater automation systems, implements optimization algorithms.The complete device consists of a PLC with modules suitable for communication with devices at a given WWTP such as multitouch panel, industrial PC, router, and a switch.
PreviSoft is based on advanced algorithms used in industrial automation.For control, the ASM (Activated Sludge Model) is used.To run the modeling process, PreviSys can use both general purpose software (MATLAB®) and specialized modelling program for wastewater treatment simulation (WEST®, GPS-X®).
PreviSCADA is software installed on an industrial PC built into PreviBox, which can additionally serve as a supervisory system (SCADA) for smaller treatment plants.The E3S Web of Conferences 22, 00037 (2017) DOI: 10.1051/e3sconf/20172200037 ASEE17 software includes, among others, specific modules: communication, databases, alarm, reporting, visualization, web server.The PreviSys PreviSCADA software acts as an object data logger, so that the user can see locally how PreviSys works.
In summary, PreviSys is a smart, complete solution that can be used to control the work of a WWTP, which, in oposition to SCADA software, uses advanced control and diagnostics algorithms.It also allows to create a mathematical model of a controlled object.The model can be used both in the control algorithms of the WWTP as well as in the diagnostics of the sensors.

Downloading data to online model
In order to have the current data in the diagnostic system, it is necessary to automate the simulation execution.For this purpose, the operating system task schedule was used.It initiates a batch script that manages all the steps involved in retrieving current data and activating a mathematical model.This script runs every 10 minutes.The first step in the script is to retrieve the current SCADA data, then convert the data into a format suitable for the mathematical model.Then the simulation of the object's work is started.The last step is to save the resulting data in the appropriate files.

Results and Discussion
The task of diagnostic systems is the earliest and most accurate detection of irregularities in the operation of diagnosed object.Such a system allows the operator to unload the object because it does not need to monitor operating parameters of the object in order to diagnose abnormal process.As the operation of the model has been automated in order to simulation data, that were available from WWTP.The next step was the comparison of model outputs with actual on-line measurements (e.g.N-NH4) at WWTP.Based on this, MATLAB® software was used to designate a residue.Subsequently, a classification of resides will be made, depending on which further actions are taken.If residuum exceeds the qualifier value, it was considered to be informative of the likely occurrence of a sensor failure and the information will be sent to the dispatcher.Information is sent using the Modbus tk python library.This library is for communication using the Modbus protocol.The information is sent to the PLC located in the PreviSys and then read by the SCADA system.This way, when a sensor fails to diagnose a sensor, SCADA will display the message.According that, the dispatcher will decide on further action.The Figure 3 shows the residue value for Δt = 1 day and the value of ammonia nitrogen concentration changes in the biological reactor of the studied WWTP.Simulation and calculation of residual values takes place every 10 minutes.The chart contains data from approximately 34 days between August 26, 2016 and September 29, 2016.On the left axis the concentration of the measured ammonium nitrogen is shown and the right value of the residue is shown on the left.A horizontal line at the value of 2 is residua, which is the qualifier value.In this case, the qualifier value was set to operator and residue is greater than 2, so this value was exceeded, the dispatcher was informed of the possible calibration of the probe each time.After informing the dispatcher about possible problem with the N-NH4 probe, further steps have been taken as it was presented in the Figure 4.The dispatcher was informed about the situation on 17 September.Then, the N-NH4 probe was cleaned on September 19th and on September 21st (marked on the vertical line).The probe was calibrated based on data from the laboratory.After calibration process, the measurement results from the N-NH4 probe have dropped by about 0.5 mg/l, which was a good information for the WWTP.

E3S
Interest in this field, monitoring systems for fault detection and diagnosis (FDD) in biological processes and on-line measurements, specifically, WWTPs has started around 30 years ago with an early application of model identification and diagnosis by Beck [4] based on a fuzzy control.Since then, several alternative approaches were presented, mainly based on statistical considerations.Fuente [5] compare a number of established techniques for estimating the process parameters when a fault occurs in a simplified nonlinear model for a real plant.Yoo [6] proposed the identification of different operating conditions and discrimination between sustained and simple faults by using databased methods for dimensionality reduction and clustering.In a similar way, Lee [7] focused on the identification of faulty sensors and the reconstruction of the measurements by estimating the process dynamics; here, a dynamic principal component analysis (PCA) was successful in effectively detecting the faults, especially when the abnormal condition was caused by a single sensor failure.In this study the step further in this field was made.First of all, it was created a mathematical model of the studied plant (calibrate and automate model launching), which allowed access to current data for comparison with on-line measurements from the object.Based on this comparison, the residue was determined.The last step in the operation of the sensor diagnostics system is to evaluate the residues and then, depending on the results sent to the operator, information about possible sensor damage.The system allows for defining parameters of residual determination and qualifier functions.This makes it possible to customize the diagnostic system to any type of variable, regardless of the magnitude of its variation and the speed with which changes in the value of the measurement occur.Based on the calculated residue it is possible to determine the level of the qualifier after which the information for the dispatcher with possible error in the operation of the sensor is reported.Moreover, this study presents innovative approach in this field in comparison with the more recent work.For example, Ciappelloni [8] proposed a combination of model and databased techniques to describe a pilot scale aerobic sequence batch reactor (SBR); PCA is again used to describe different process cycles and a decision algorithm was developed to classify different process faults.The SBR was also studied by Wimberger and Verde [9] with the goal of evaluating the detectability and is possibility for analytical and signal based fault detection and isolation.A different approach was proposed by Nejjari [10], where an extended Luenberger observer is adopted for the residual generation of sensor faults.Zumoffen and Basualdo [11] focused on the need for an efficient fault tolerant control on WWTP.The term "fault" is generally defined as "an unpermitted deviation of at least one characteristic property of the system from the acceptable, usual, standard condition" [1].Nevertheless, the databased approach to fault detection methods can achieve only limited validity, mainly because vast amounts of data are required but not necessarily available in a WWTP.The FDD technology is still developing and should continue to improve as a part of future "Smart Control System" at WWTP.The important point is that wastewater utilities can be heroes instead of burdens by working towards a goal of biochemical process improvement and control for energy neutrality at WWTP.Essentially, for these reasons the causal fault diagnosis approach is believed to have a promising Nonlinear modelling and adaptive monitoring with fuzzy and multivariate statistical methods in biologic wastewater treatment plants.
Research in the field of activated sludge systems diagnosis in wastewater treatment plants has been very active since the 1970s and numerous fault diagnosis methods are reported in the industrial and academic literature.For example FDD methods are a family of approaches finalized to detection and location of faults on processing systems.The main challenge of FDD methods consists in determining the type, size and location of the most possible fault, as well as its time of detection in order to improve product quality, plant efficiency, as well as ability to meet environmental and safety constraints [3].
Based on the presented data, it can be concluded that the diagnostics of the sensors using a mathematical model is an innovative method allowing to simplify and accelerate the diagnosis of measurement sensor problems.A commercial software WEST was used to model the WWTP configuration and for the dynamic simulation of the biochemical process, but the reason of greatest interest is the implementation of a special system and an appropriate communication software with SCADA as a development of mathematical model for the diagnosis of the plant.The causal fault diagnosis approach is believed to have a promising potential and should be developed regarding to online measurement equipment is still needed because of challenging conditions for reliable measurements at WWTPs.Closely linked with data acquisition is the detection of faulty behaviour from process data.

Fig. 1 . 2 E3S
Fig. 1.The diagram of the model diagnosis of studied plant under full-scale condition.

Fig. 2 .
Fig. 2. The existing model of "Klimzowiec" WWTP created in the WEST software.

Fig. 3 .
Fig. 3.The residue value and ammonia nitrogen concentration changes in the biological reactor of the studied WWTP.