Hierarchical predictive control of Wastewater Treatment Plants

This paper investigates the performance of a new predictive control approach used to improve the energy efficiency and effluent quality of a conventional Wastewater Treatment Plant (WWTP). A twolayer hierarchical control structure is proposed: process control as a lower layer and a higher layer of optimization. The Activated Sludge Process (ASP) optimization using the proposed approach provides an improved aeration system efficiency to reduce energy costs while maintaining the quality parameters of the effluent. The control strategy is evaluated by performing simulations and analyzing the results. The regulatory performances have been tested and the effects of several tuning parameters are investigated.


Introduction
The efficient administration and treatment of municipal and industrial wastewater is crucial to sustaining community health and a clean, safe environment.Biological treatment is an important and integral part of any WWTP.The Activated Sludge Process is the most used technology of biological treatment processes to treat municipal and industrial wastewater due to its flexibility, high reliability and costeffectiveness, as well as its capacity of producing high quality effluent.The AS processes are difficult to control because of their complex and nonlinear behaviour [1].Several research papers have focused on the importance of well-tuned models and simulation platforms in the process of designing and tuning the controllers [2,3].Other research papers have focused on developing multiple model based controllers instead of nonlinear complex ones [4].Nevertheless, controllers are required to maintain an optimum setpoint, regardless of the changes in the operating point.This type of control strategies have also been proposed, including adaptive [5,6], predictive [7,8], fuzzy [9] or fractional order PID control [10].
Nowadays, applying Supervisory Control and Data Acquisition (SCADA) solutions has a positive impact on the WWTP operations and development [11].SCADA is a tool with a very specific defined set of functions.Examples can include: turn devices on or off, display real time operational data, provide plant-wide views of operation, trend data and alarms.SCADA systems mainly perform data logging, monitoring, alarming and diagnostic functions so that large, complex process systems can be operated in a safe manner and maintained by a relatively small staff.Nevertheless SCADA systems are data acquisition and monitoring oriented and cannot carry out advanced process control techniques.In WWTP applications process control is still minimal mostly because WWTPs are considered as a non-profit industry.Therefore, the main purpose of this paper is to design an advanced control strategy to be integrated with SCADA solutions in WWTP management.The paper presents the design and implementation of a hierarchical control structure focusing on minimizing operational costs in the plant, while keeping it running optimally and satisfying the effluent requirements.
A WWTP based on an activated sludge technology (ASWWTP) is capable of treating the wastewater such that the effluent quality meets the environmental standards.However, the associated operational cost could be too high.Mainly, the operational costs of an ASWWTP represent the energy required by blowers for aeration.Hence, an optimising strategy for controlling the activated sludge aeration process is strongly recommended.The amount of air provided by the blowers in the aeration tank should be modified to control the dissolved oxygen concentration (DO).Thus, optimizing the aeration process actually means determining the optimal value of the dissolved oxygen setpoint.Several strategies have been proposed and Model Predictive Control (MPC) proved to be a suitable one [12,13,14].Due to specific features of WWTP a two-layer hierarchical structure is developed: local process control loops as a lower layer and a higher layer of process optimization.
The paper is structured as follows.After the Introduction section, a brief description of the WWTP and of the local SCADA system is provided.In the third section, the hierarchical control solution is presented, followed by the description of optimization control integration with local plant control system.The overall system performances analysis is detailed in Section IV, while the last section contains the concluding remarks.

Plant description and SCADA system
The process mathematical model development and the model calibration were made based on data obtained from a conventional activated sludge system operating under aerobic conditions and whose main purpose is to ensure the removal of colloidal and dissolved carbonaceous organic matter.The residual water that needs to be treated is coming from a factory that processes and paints cotton, a milk factory and from domestic households.The wastewater first enters the aerated bioreactor where the treatment based on ASP takes place.The clear water and the sludge are separated due to gravity in the secondary settler.In order to keep biological sustainability, the active sludge is recirculated and the bioreactor is aerated using an aeration system with low pressure blowers, an air piping network, and air diffusers (Fig. 1).A more detailed description of the plant and the development of two reduced order models which adequately describe the biochemical processes for the purpose of on-line control design can be found in [15].SCADA application is divided in four functional sections: plant general overview, settings and parameters, parameter graphics and alarms.Plant general overview based on the synoptic scheme (Fig. 1) shows the whole process operating state.It is possible to use manual remote control for various equipment or adjust the variables setpoint values in automatic control mode.Fig. 2. SCADA -Plant general overview (1 -process equipment; 2 -process parameter; 3 -Alarm icon; 4 -system menu; 5 -process control status; 6 -alarm reset button).
In this case there are several process parameters which need to be controlled.The first control loop regulates the dissolved oxygen concentration in the aeration tank at a target reference value.The manipulated variable is the air flow rate in the aeration tank, adjusted using a control valve.The second loop controls the pressure generated by the blower in the aeration system and will reject the disturbances introduced by changing the position of the control valve from the previous loop.A loop less relevant to the control system, and which does not interact with the other control loops, controls the level in the homogenization tank.Some of the local system functions are also considered important.One of these controls the position of the aeration flow control valve according to the exit of the controller for the dissolved oxygen and the pressure restrictions imposed on the air diffusers.Another control loop calculates the minimum and maximum blower values, depending on the position of the flow control valve, the state of the air lift pump control valves, and the air temperature at the blower outlet.The dissolved oxygen concentration control in the aeration tank is one of the most important control loops in the process, which must be optimised in order to reduce energy consumption and improve energy efficiency.To do this, a two-layer hierarchical control system is proposed in this paper.The previous process control loops are considered as a lower layer and a higher layer of optimization is added.

Hierarchical Control Strategy
A schematic representation of the proposed hierarchical control system layers is presented in Fig. 4.

Hierarchical Control structure
Optimization control layer consists in a model based predictive control (MBPC) technique used to control the organic substrate concentration in the biological reactor.The wastewater treatment plant used as a pilot plant has a single aeration tank mainly focused on the removal of organic matter from the wastewater.COD (Chemical Oxygen Demand), measured using the potassium dichromate method (CODCr), a standard wellestablished method, was adopted as the measure of the concentration of organic matter.The output of the MBPC algorithm represents the optimal value of the dissolved oxygen setpoint.
At the lower layer, the process is controlled by two main control loops: (1) 2) dissolved oxygen concentration (DO) control in the aeration tank where the setpoint is generated by the higher control level (optimization level).The design and implementation of the pressure control loop does not pose difficult problems but the control loop of dissolved oxygen concentration is a challenging issue.The activated sludge wastewater treatment processes are very complex, with large, uncontrollable input disturbances, significant nonlinearities and characterized by uncertainties regarding their parameters.The MBPC algorithm used for the dissolved oxygen concentration control loop will be able to tackle these challenges.
Thus, two versions of the well-known Generalized Predictive Control (GPC) method of Clarke et al [16,17] have been applied.A predictive algorithm based on the standard formulation of GPC will be used in the optimization layer to control the organic matter concentration (SS) in the biological reactor and to determine the optimal value of the dissolved oxygen setpoint in the aeration tank.A modified GPC version will be used in the lower layer to control the dissolved oxygen concentration minimizing the aeration energy.

GPC algorithms
For the design of the model predictive control a model of the process is needed.The MPC controllers are designed to use the process model to predict the values of future process outputs and to compute the optimal control action based on minimization of a cost function with including of restrictions to the process variables.

Standard GPC algorithm
For the GPC approach, as described in details in [16], for linear models the controller output is obtained by minimizing the cost function: where: Δ -the differencing operator 1-q -1 ; N 1 -the minimum costing horizon; N 2 -the maximum costing horizon; Nu -the control horizon; ρ -a control-weighting coefficient; y,u -process output and input; y r -the future reference sequence.N 1 , N 2 , N u and ρ are controller design parameters.The use of the CARIMA plant model: introduces in the controller an integrator as a natural consequence.
To derive a j step ahead predictor of the process output y(t+j) on considers the polynomial identity: where E j (q -1 ) and F j (q -1 ) are polynomials uniquely defined, given A(q -1 ) and the prediction interval j, of degree j-1 and respectively n (n -the process order).
Based on this identity we have: For j = N 1 ,...,N 2 equation ( 5) can be written: The predictor y(t+j), consists on three terms: one including the past known control actions and the filtered measured process outputs, the second depending on future control actions which must be determined and the third, depending on the future noise signals.For the WWTP process k is considered to be 1.Let f(t+j) be the component which includes the past known control actions and the filtered measured process outputs (all the known terms at a time moment t): then the equations ( 7) can be rewritten in the vectorial form: where y, u, f and e are vectors of form: 1)x1 N -(N , )] ( ),..., ( [ + and the matrix G, is lower triangular: It is necessary to specify that after an interval N u < N 2 , the control signal is assumed to be constant and control increments are zero, i.e.: 0 In [17] are given some recommendations concerning the choice of the design parameters.

Modified GPC algorithm
An important step in developing the proposed DO control algorithm is the reparametrization of the cost function in the GPC algorithm to contain a measure of energy consumed by aeration process.This could exploit the fluctuation of operating conditions by significant energy savings.Since the aeration air flow W is the manipulated variable resulted from the controller output u, to minimize the aeration flow and not its variations the reparametrized cost function of the predictive algorithm has to contain the controller output u, instead of the control output increment Δu.This will lead to a positional implementation form for the controller cost function: In [18] a modified version of GPC algorithm based on a positional form for both the process model and controller cost function is presented.In this paper only the cost function ( 13) is considered in the positional form and the CARIMA process model is considered.Thus, the minimization of the cost function (13) with the output of the controller replaced by u(t)=u(t-1)+Δu(t) where u(t-1) is known (u (t-1)=u') leads to: Considering the derivative of the previous equation in relation to Δu: Again, only the first element of the vector Δu, Δu (t) needs to be determined because it represents the increment of the command at time t: where α T =[α 1 ...α N ] represents the first line of the (G T G+ρI) -1 G T matrix and β T = [β 1 ... β Nu ] the first line of the (G T G + ρI) -1 ρI matrix.

Simulation results
The assessment of the developed control system is done through numerical simulation in the Matlab/SIMULINK environment.The nonlinear model of the activated sludge wastewater treatment process given in [15] was used to simulate the process dynamics.In the GPC algorithms the prediction of the process output is based on linear process models.To obtain the linear state space model and the transfer function from W to DO and from DO to SS the model was linearized around an operating point.To reduce the transfer functions order, from the linear state space model a balanced state-space realization was first computed and then the smallest diagonal entries of the balanced grammians were eliminated using modred.Similar values for the transfer functions parameters were obtained using a Recursive Least Square algorithm to estimate the discrete transfer functions based on the input/output data of the nonlinear model simulations for small variations around the operating point.
The steady state values for the considered process output are DO0 =1.36 mg/l and SS=120mg/l.The aeration air flow (W) is considered as the manipulated input for the inner control loop.The influent organic matter concentration SSin (influent load) and the influent flow are considered as disturbances.The air flow values were limited between Wmin = 50m 3 /h and Wmax =300m 3 /h.The controllers design parameters are: N1=1, N2=6, Nu=1, the sampling period t SDO = 0.01 h for the inner loop and t SSS =0.5h for the outer loop.Different values of the control-weighting coefficient ρ (ro) are considered in order to provide information on the compromise between control performances and savings in energy consumption.The higher the values for ρ, the lower the power consumption, but the restriction on the command will increase the steady state error and the response time for the inner loop.This will not affect the overall system performances that are given by the outer loop for which ρ =0 is considered.A constant setpoint (SSsp=120mg/l) is considered and different aspects related to the effects of load disturbances have been analyzed.Performances for efluent organic matter concentration (SSe) will be considered, which are more relevant than those for aeration tank organic matter concentration.
For the first simulation scenario the regulatory performances during simulation test when the disturbances presented in Fig. 4 (a 30% step disturbance added to the steady state value SSin0=765mg/l) and Fig. 5 (random disturbances for a large simulation time) are applied on the most significant process input: influent organic matter concentration SSin.Fig. 6 shows the regulatory performances for the disturbance presented in Fig. 4. Using the positional GPC control algorithm for the inner loop, the steady state error in the DO process output is increasing with the value of the control-weighting coefficient, ρ.To obtain a zero steady state error for the outer loop output (SSe) the standard GPC algorithm will increase the DO setpoint.But what is most important, by increasing the value of control-weighting coefficient, the aeration air flow W decreases and also the total amount of air consumed to reject the disturbance.It can be observed in the upper graph, for the process output SSe, very similar performances are obtained for ρ=0 (continuous line) and ρ=0.02 (dotted line).Analyzing the controller output W, the air needed to reject the disturbance from t=70h to 220h (during 150h) in the second case (ρ=0.02)represents 67% of the air needed in the first case (ρ=0).For ρ=0.05 (dashed line) the air amount needed to reject the disturbance is very low but more modest performances are obtained.The performances analysis for Fig. 7 leads to similar conclusions to those for the step response case (Fig. 6): similar performances for ρ=0 (continuous line) and ρ=0.02 (dotted line); more modest performances for ρ=0.05 (dashed line) but a significant diminution of the air amount.For the second simulation scenario disturbances for the influent flow are considered.Fig. 8 shows the regulatory performances for a 20% step disturbance added to the influent flow.Regulatory performances and considerations regarding air consumption are not significantly different from the first simulation scenario case.This time a saturation limit of 6 mg / l for the DO setpoint was considered.

Conclusions
The wastewater treatment plants are complex processes due to the strong nonlinearities, large variable time constants and continuous perturbations present on the influent.This paper evaluates the performance of a hierarchical control structure for the activated sludge process of a WWTP.For the inner loop, a positional form of the standard GPC algorithm was developed and the simulations provide information on how the compromise between control performances (steady state error and response time) and savings in energy consumption can be managed through design parameters.Using the proposed control strategy, the aeration flow and, by default, the blower's speed is allowed to be lowered when the operating conditions of the WWTP permits.The power consumed by blowers is proportional to the cube of air flow.This means that already minimal reductions in blower air flow can provide savings in energy consumption.A 15-20% of average energy savings is estimated.

Fig. 4 .Fig. 5 .
Fig. 4. SSi n i n p u t -st ep d i st u r ban ce.

Fig. 7
Fig.7shows the regulatory performance when the disturbances presented in Fig.5are applied.