Distributed Control Systems for a Wastewater Treatment Plant: Architectures and Advanced Control Solutions

This chapter is focused on the development and implementation of a distributed and hierarchized control system for the wastewater treatment plant (WTP) Calafat, Romania. The primary control loops for both treatment lines (water and activated sludge) are developed and analyzed. Also, the distributed control system (DCS) architecture of the wastewater treatment plant is presented, and the advantages of the proposed control structure are highlighted. In order to increase the performance of the overall control system, some advanced control solutions are investigated. More precisely, multivariable adaptive and robust control algorithms are proposed for the activated sludge bioprocess. Several realistic simulation experiments are performed, and the obtained results are analyzed.


Introduction
In this chapter, a control architecture developed at the wastewater treatment plant (WTP) Calafat (located in Oltenia region, Romania) is presented. This control structure was developed in the frame of research project ADCOSBIO (no. 211/2014, UEFISCDI) [1] and contract no. 168/ 2017, University of Craiova-Water Company Oltenia (WCO). More precisely, a distributed control system (DCS)-supervisory control and data acquisition (SCADA) architecture was proposed, which is organized as a distributed and hierarchized control system. This control solution envisaged the wastewater treatment plant Calafat but can be adapted and implemented for other similar wastewater treatment plants from the WCO.
The wastewater treatment is a process operated to convert wastewater into an effluent that can be returned to the water cycle with minimal impact on the environment. This process takes place in a wastewater treatment plant (WTP) [2]. In a WTP, the treatment usually comprises three stages, called primary, secondary, and tertiary treatments [3]. Primary treatment consists in the mechanical removing of settled and floating materials, and the remaining liquid can be discharged or directed to secondary treatment. Secondary treatment removes dissolved and suspended biological matter, and it is typically performed by microorganisms in a special habitat. The goal of tertiary treatment is to provide a final treatment stage to improve the effluent quality before it is released to the environment. The treatment method used at the WTP Calafat is a classical one, with a mechanical stage for the impurity removal and a biological stage based on activated sludge. The proposed control solution for this WTP is based on a DCS structure.
The paradigm of DCSs is related to the control of medium and high complexity processes, and it consists in the implementation of distributed and hierarchized systems in a number of four to five levels [4]. The two main attributes of the DCS should be mentioned here: the horizontal functionality in each level is managed by a real-time operating system, and the communication between levels is characterized by the network used in the DCS. Currently, some modern technologies from the networks and processing devices are incorporated into the DCSs [5,6]. The DCS-SCADA solution for the WTP Calafat consists in four levels: the field level (level 0), the direct control level (level 1), the plant supervisory level (level 2), and the production control/regional coordination level (level 3). In this chapter, the structure of the first three levels and their functionality are presented. The primary control loops implemented at level 1 of DCS-WTP Calafat are described. Also, due to the fact that the performance improvement of the WTP control system is possible only by managing the activated sludge bioprocess, some advanced control solutions based on nonlinear adaptive and robust control algorithms are proposed for level 2 of the DCS.
The activated sludge process implemented at WTP Calafat is an aerobic process, highly nonlinear and characterized by parametric uncertainties [3,[7][8][9][10][11]. The best-known model that tries to describe the activated sludge processes is ASM1 (Activated Sludge Model No. 1) [3,[10][11][12]. The main drawback of ASM1 is its complexity, such that it becomes unfeasible for control. Thus, in this chapter a simplified model of the activated sludge process will be used. The model is based on the model of Nejjari et al. [8], adapted for WTP Calafat.
Several control strategies were developed for bioprocesses, such as linearizing strategy, adaptive approach [3,[7][8][9], robust and optimal control, sliding mode control [13], model predictive control [14], etc. Yet, in all these schemes, the knowledge of all inputs is required. Unfortunately, for wastewater treatment processes, usually, the complete knowledge of inputs is not available. For these cases, interval observers (or set observers) were developed in the last period, allowing the reconstruction of a guaranteed interval for the unmeasured states instead of estimating their precise numerical values. The only requirement is to know an interval in which the unmeasured inputs of the process evolve. These robust observers are capable of coping with the problems posed by both the uncertainties in the inputs and the incomplete knowledge of process kinetics [15][16][17][18].
In this chapter, some of our previous results [12] are extended for WTP Calafat in order to design multivariable adaptive and robust control algorithms. The proposed control strategies are able to handle the model uncertainties of an activated sludge process used for removal of two pollutants carried out in a continuous recycle reactor. The main control objective is to maintain the pollution level at a desired low value despite the load and concentration variations of the pollutant. The adaptive control scheme is designed by combining a linearizing control law with a state asymptotic observer and with an estimator used for online estimation of unknown kinetics. The robust control structure is designed as a linearizing control law plus an interval observer able to estimate lower and upper bounds in which the unmeasured states are guaranteed to lie. Moreover, the uncertain process parameters are replaced by their lower and upper bounds assumed known.
The chapter is organized as follows. In Section 2, the general characteristics of the WTP Calafat and the process flow are presented. Section 3 proposes a distributed control solution for the wastewater treatment process from WTP Calafat. The control architecture and the primary control loops are analyzed. In Section 4, the design of multivariable adaptive and robust control schemes for the activated sludge process is provided. The behavior of the proposed control algorithms is analyzed by performing realistic simulation experiments. The final conclusions are presented in Section 5.

Description of the technological process flow
The general characteristics of the wastewater treatment plant (WTP) Calafat and the process flow will be presented. The process flow comprises two stages: the pretreatment (which is the so-called mechanical stage) and the biological stage. Figure 1 presents the general block diagram of the WTP, and Figure 2 shows an aerial photography of the WTP.
The WTP was designed for the treatment of a daily average flow of 8366 m 3 /day and of a maximum flow of 530 m 3 /h. The WTP size was chosen in order to solve the needs of a number of maximum 29,000 inhabitants of Calafat town, predicted for 2020. The treatment method is a classical one, with a mechanical stage for the impurity removal and a biological stage based on activated sludge. The wastewater enters in a tank; it is lifted with special pumps to the pretreatment area and after that is gravitationally discharged in the biological tanks, where the water is aerated and mixed with the activated sludge. Thus, the biodegradation of the water occurs. Finally, the effluent is discarded through decantation.

Process flow: pretreatment
The process technological lines will be succinctly described. After the entering in the WTP, the influent wastewater passes through a bar screen (the gross filter) to remove all large objects, and after that it flows in a gravitationally way through a slit in the pump room. This unit is equipped with three Flygt submersible centrifugal pumps P1.A, P1.B, and P1.S (two active pumps (A and B) and one for backup (S)). The water level is measured by using an ultrasonic transducer L1 and is kept between two limits (preestablished limits depending on average water flow). By using the level information, the pumps act to keep the level into the limits. Also, the level information is transmitted to the process computer in the central control room. The water exits from the pumps P1.A, P1.B, and P1.S through three vertical pipes, which at the superior part of the tank (in the valve room) pass to a horizontal configuration and after that merge into a collector. From the valve room, a pipeline goes to the preliminary treatment  (pretreatment: mechanical stage). This plant is placed on a metallic structure at the +6.40 m elevation.
An electromagnetic flow meter is placed on the vertical part of the pipe, and it is used to measure the hourly flow of the wastewater provided by the pumps P1.A, P1.B, and P1.S. By opening two sluice valves located at the entrance of the channels used for thin filtering, the wastewater resulted from the pumps P1.A, P1.B, and P1.S passes through the channels and is filtrated by using some rotational filters. The thin impurities which are separated by the filters are then discharged on a conveyer belt and stored into a special tank.
The wastewater enters in a tangential manner in the workers, and, under the mixer action, the water has a descendant spiral movement. After that, the wastewater is lifted through a central pipe, and finally it is evacuated through a radial pipe. This movement, due to the gravitational and centrifugal forces, allows the sedimentation of the solids in the lower part of the workers. The fat and grease floating on the surface are collected by the skimmers. The solid particles are removed by opening the sliding valves, and thus these particles are periodically drained via a spiral conveyer. The grit is cleared into a special tank. After the pretreatment, the water passes via a pipeline which ramifies at the superior part of the biological tanks in the anoxic zones.

Process flow: biological stage
The biological tanks consist of two biological reactors (bioreactors) and two settlers (sedimentation tanks). These are circular tanks, positioned in a concentric manner, with the settler in the inner part and the biological reactor in the exterior. The walls of the tanks (5 m height) are from special glassed steel. The walls are embedded into concrete structures plated with Izocor hydro-isolation. The external diameter is d 1 = 35.16 m, the volume is V = 3800 m 3 , and the inner diameter is d 2 = 18.86 m. At the biological reactor, the bottom is plane, but the bottom of the settler is in the shape of a truncated cone. The bioreactor is divided in two zones, anoxic and aerobic, by using two steel walls, radially disposed. The ratio of the volumes is 30% anoxic/ 70% aerobic.
In the anoxic zone of each bioreactor, the wastewater from the pretreatment is mixed with the activated sludge which is recirculated by the Flygt pumps RAS/SAS P3.A, P3.B, P3.S. These pumps are controlled with frequency converters, and the flow ratio is 1:1. An equal flow of mixture from the aerobic zone is pumped through a slit from the zone separation wall by the internal recirculation pumps P2.A and P2.B (Flygt type, with frequency converters). The mixers placed in this anoxic zone achieve the homogenization of the three inputs (wastewater, activated sludge, aerobic mixture). In the anoxic zone, the next actions are achieved: • An appropriate ratio between the substrate (the organic content of the wastewater + nutrients) and the microorganisms (the active content of the sludge) • The denitrification process (the nitrogen removal) From the anoxic zone, the compound passes into the aerobic zone, where the biochemical oxidation of the organic matter is achieved. The needed oxygen is provided from the air delivered by the BOC Edwards air blowers A1.A, A1.B, and A1.S and bubbled as thin bubbles by using polymeric membranes. Two technological variables are very important for the aerobic process: the dissolved oxygen (DO) and the pH of the mixture. These are measured and indicated by using the transducers Q1 and Q2 (for DO concentration) and Q3 and Q4, respectively, (for pH). The air is blown by the air blowers A1.A, A1.B, and A1.S (two active and one for backup) through galvanized steel pipes. The air pressure and temperature can be monitored by using the local devices. The airflows at the two tanks are measured by using the flow meters F1 and F2. The flow control is necessary in order to maintain the DO concentration between the specified values. The DO is measured by using the sensors Q1 and Q2, and the information is used to control the air blower speed by using frequency converters.
The mixture from the aerobic zone arrives at the partition wall where one-third from the flow is taken by the recirculation pumps P2.A and P2.B and delivered to the anoxic zones and twothirds from the flow is passed through a pipeline (via the communicating vessel principle) into the central pipe of the settler. From here the mixture exits in a radial and uniform way at the superior part. The effluent is separated from the sludge and after that is gravitationally removed through a circular drain. Finally, the effluent is flushed in the Danube through a channel. The settlers are equipped with radial scrapper bridges, which have a double goal: • The superior scrapper collects the foam and directs it to a foam-collecting chamber.
• The inferior scrapper cleans the sediments and directs the sludge to a discharge whirl.
The activated sludge is transported to a collector from which is exhausted through three ramifications by the pumps RAS/SAS P3.A, P3.B, P3.S (RAS is the recirculated activated sludge at the anoxic zones; SAS is the surplus activated sludge, which is carried to a special tank).
As a conclusion, in the biological tanks, the following processes occur: • The decomposition of the organic matters by using enzymes (enzymatic reactions) • Assimilation of some components by the microorganisms The proposed DCS-SCADA solution for the WTP Calafat is presented in Figure 3. The levels of the DCS and their functionality are described in the next paragraphs.
Level 0 contains all the field devices placed at the technological process level. Classically, at this level we have the measurements of various variables and the final control elements. The components of this level are: • Sensors (analogic) for flows, levels, pressures, pH, and DO concentrations, such as electromagnetic sensors (Siemens, 0-10 m/s water speed) for flows, ultrasonic sensors (Siemens, 0.3-8 m) for level measurements, pH, and DO concentrations measured via integrated measurement systems (4-20 mA) for dosing devices, etc.
• Contact sensors that provide data about the state of some equipment and operations • Final control elements (actuators) such as control valves, pumps, etc.
• Dedicated devices for various operations such as dosages, recipes, and technological processing, which will interact with the DCS at the monitoring level • On/off elements for various actions such as pump starting, etc.
Level 1 comprises the data acquisition devices and the controllers, including the real-time data processing. The analogic signals from sensors and also the control inputs to the actuators are unified signals (e.g., currents in the range 4-20 mA). Due to the geographical distribution, the WTP control system is implemented with several PLCs (programmable logic controllers). These PLCs are connected into a master-slave network with extensions, which handles the information and takes the required decisions for the coordination of the entire technological process. The acquired data, the decisions, and the events occurred in the process are communicated to the next level (SCADA) in order to be used and displayed on the graphical monitoring interface. The information flow is bidirectional; that is, the PLCs receive information about global decisions or optimization, such as set points for the control loops, switches between operational regimes, etc. The decisions at this level are taken in real time and such that the operation of the overall process is managed. The primary control loops are implemented at the PLC level, but the set point of each loop is provided by the superior hierarchic level (SCADA). The PLCs also achieve the implementation of the direct commands delivered by the control algorithms and function of various operational regimes.
Level 2 contains the equipment and the devices from the control room, which receive the information from level 1 (PLC level) and supervise the global operation of the WTP. This level is represented by the SCADA/HMI (human-machine interface) system. The main functions achieved at this level consist in operation optimization, implementation of adaptive and robust control algorithms (proposed in Section 4), operation monitoring via graphical interfaces, remote operation mechanisms, data/event storage, achievement of a data historian, etc. Also, the SCADA ensures the communication between the local dispatcher room (WTP Calafat) and the regional dispatcher of Water Company Oltenia, by using a GSM/GPRS system. The SCADA/HMI runs on two redundant servers. The SCADA supervises the direct control system (real time). If the SCADA system stops, the process will be automatically operated by using the PLCs. Several protection and backup procedures are incorporated in the operation and supervisor programs. The most of control and data acquisition devices used for levels 1 and 2 are provided by Siemens, Telemecanique, etc.
Level 3 is the regional dispatcher of the WCO, and it will coordinate the activity of the WTP with respect of the performance and of extended monitoring of the geographical area.
The operation regimes allowed by the DCS are as follows: automatic, manual via the computer, and locally manual. Automatic: The WTP control is achieved exclusively through the command/decision provided by the DCS (PLCs + SCADA/HMI). Manual via the computer: The DCS works only as a data acquisition system, but the decisions are taken by the human operator and are transmitted via PLCs and SCADA to the actuators. The system offers all the information and keeps the inter-blockings at the software and hardware levels. This regime can be achieved for the entire WTP or only for some components. Locally manual: This regime implies the local operation, no matter what regime is set at the PLCs or SCADA levels. This regime is of high priority, but the SCADA will signalize at the dispatcher level in this situation, and the event will be stored. This regime is useful when failures occur or in the case of network communication problems, startups, and maintenance.
The integration of local SCADA in regional SCADA. The regional SCADA system is a regional centralized structure, which implies the organization of a regional dispatcher, equipped with reliable industrial devices, disposed in a redundant topology in order to ensure a continuous operation. The regional dispatcher role is to coordinate all the subnetworks from the urban areas. The local dispatchers are in fact local process networks from each urban area, which acquire and handle the primary information from the process (levels, flows, concentrations, telemetry, diagnostic signals, etc.). This information is available for the local operator but also at the regional level.

Level 1: primary control loops
In this section, a few numbers of primary control loops that are implemented at level 1 of DCS-WTP Calafat will be described.
The control loop 1 ensures the level control in the admission room. The level is measured with the sensor L1, and the control action is achieved via the wastewater pumps P1.A, P1.B, and P1.S (two active pumps (A and B) and one for backup (S)). The block diagram of this control loop is presented in Figure 4. The level set point is preestablished, since the influent flow in the WTP fluctuates. If the level decreases under a limit, the pumps are shut down (decision at the PLC level). This critical situation is transmitted to the SCADA system, where a warning signal will be displayed/stored. The control loop is a classical feedback loop, with a possible PID control law plus a switching mechanism. The control loop is implemented at level 1 of DCS, but the set point (the reference) is provided by level 2. The actuators are the three pumps P1.A, P1.B, and P1.S that have the motors controlled with static frequency converters in order to provide a variable flow. The switching mechanism (switching logic) of the pumps is designed to ensure a rotation in the operation of the pumps. This fact is done to avoid the unevenly wear of the pumps but also for the failure situations.
The influent wastewater flows are disturbances for the loop and will be rejected by the control law.
The control loop 2 is designed for the control of dissolved oxygen (DO) concentrations, which are measured with the transducers Q1 and Q2, and the control is provided by the air blowers A1.A, A1.B, and A1.S. The control loops are presented in Figure 5 and are dedicated to the DO concentration control in the biological tanks (aerators).
The control laws are PIDs (with self-tuning facilities), but also some advanced control laws can be implemented. As in the previous case, the control loop is implemented at level 1 of DCS, but the set point is provided by level 2. The actuator for the technological line A is the air blower A1.A and for the line B is A1.B (A1.S is a backup air blower).
The control loop 3 is dedicated to the regulation of the recirculated flow percentage calculated from the aerated water flow (from the input of the distribution room). This process variable (percent) is processed by using an algorithm with several input arguments such as dissolved  oxygen, suspended solids, nitrogen, and phosphorus provided by the automated extraction probe system. The set point is given by the operator via the SCADA system, and the control action is based on the emulsion sludge pumps P2.A and P2.B from the aerators. These two control loops (block diagrams in Figure 6) are independent because we have two biological treatment tanks. The control loop is implemented at level 1 of DCS, and the set point is provided by level 2. The actuator for the technological line A is the recirculation pump P2.A, and for the line B is the pump P2.B.
The control loop 4 is designed to control the ratio (flow F1)/(flow F2), which is the activated sludge flow introduced in the influent wastewater flow, by using the submersible pumps P3.A, P3.B, and P3.S. This control loop is presented in Figure 7. The backup pump P3.S will act: • Periodically (scheduled by the operator), to ensure a uniform usage of the pumps • When additional flows of wastewater occur and the active pumps cannot provide the required activated sludge flow • When some failures occur at the active pumps  As in the previous cases, the control loop is implemented at level 1 of DCS, and the set point is provided by level 2. The actuators are the submersible pumps P3.A, P3.B, and P3.S. The switching mechanism (switching logic) of the pumps is designed in order to cover the above-described scenarios. The influent wastewater flows and their parameters are disturbances for the control loop and will be rejected by the control law.

Advanced control solutions for the activated sludge bioprocess
In the following sections, some advanced control solutions are proposed in order to be implemented at level 2 of the DCS-WTP Calafat. More precisely, multivariable adaptive and robust control algorithms are proposed for the activated sludge process that takes place at WTP Calafat. The main control objective at this level is to maintain the pollution level at a desired low value despite the load and concentration variations of the pollutant. The controlled variables are the concentrations of pollutant and dissolved oxygen inside the aerator. Therefore, some of the control loops described in the previous section will be used, and other loops will be modified. The simulations performed in realistic conditions and using an adapted model of the activated sludge process showed that the performance of the overall control system can be increased. The implementation of the proposed control algorithms at WTP Calafat will be ensured within the research project TISIPRO [19].

Dynamical model of the activated sludge bioprocess and control objective
The activated sludge process which works at WTP Calafat is an aerobic process of biological wastewater treatment. As it was mentioned above, this process is operated in at least two interconnected tanks: a bioreactor (aerator) in which the biodegradation of the pollutants takes place and a sedimentation tank (settler) in which the liquid is clarified (the biomass is separated from the treated wastewater) (Figure 8). This bioprocess is very complex, highly nonlinear, and characterized by parametric uncertainties. In the literature there are many models that try to describe the activated sludge processes. The best-known model is ASM1 (Activated Sludge Model No. 1) [3,[10][11][12]. The main drawback of ASM1 is its complexity, such that it becomes unusable in control issues. Thus, in this chapter a simplified model of a process  for the removal of the pollutant S from the treated water will be used. The model is based on the model of Nejjari et al. [8], adapted for WTP Calafat. The dynamics of the plant (aerator + settler) is described by the mass balance equations [8,9]: where X, S, O, and X r are the concentrations of biomass (active sludge) in the aerator, of substrate (pollutant), of dissolved oxygen, and of recycled biomass, respectively, O sat is the saturation concentration of dissolved oxygen, D = F in /V is the dilution rate (F in is the influent flow rate, V is the constant aerator volume), μ is the specific growth rate, μ S is the decay coefficient for biomass, Y is the consumption coefficient of substrate S, r is the rate of recycled sludge, β is the rate of removed sludge, F O is the aeration rate, and α is the oxygen transfer rate. S in and O in are the substrate and dissolved oxygen concentrations in influent substrate.
T the vector of mass inflow rates and gaseous transfer rates, (1) can be written as where D is the matrix of dilution rates, whose structure is the next one: In fact, model (2) describes the dynamics of a large class of bioprocesses carried out in stirred tank reactors and is referred as general dynamic state-space model of this class of bioprocesses [3,7], with ξ ∈ ℜ n , ϕ Á ð Þ ∈ ℜ m , K ∈ ℜ nÂm , D ∈ ℜ nÂn , and v ∈ ℜ n . The nonlinear character of model (2) is given by the reaction kinetics, its modeling being the most difficult task.
The main control objective is to maintain the pollution level at a desired low value despite the load and concentration variations of the pollutant. Because in any aerobic fermentation a proper aeration is essential in order to obtain an efficient process, then an adequate control of dissolved oxygen concentration in aerator is very important [3,8,11]. Thus, the controlled variables are concentrations of pollutant S and dissolved oxygen O inside the aerator, that is, As control inputs we chose the dilution rate D and the aeration rate F O , that is, So, we have a multivariable control problem of a squared process with two inputs and two outputs [12]. Since in model (1) the relative degrees [20] of both controlled variables S and O are equal to one, then the dynamic of output y can be written as where Ψ ξ ð Þ, Φ T ξ ð Þ, θ, and B ξ ð Þ are given by.
Model (4) is linear with respect to control input u(t).
The matrix B ξ ð Þ is nonsingular and so invertible as long as S in À 1 þ r ð ÞS and α O sat À O ð Þare different from zero, conditions that are satisfied in a normal operation of the reactor.
We consider that the specific growth rate μ is a double Monod-type model, i.e., [8] where μ max is the maximum specific growth rate of microorganisms and K S and K O are the saturation constants for substrate S and for oxygen, respectively.
Consequently, based on the input-output model (4), the main control objective is to make output y to asymptotically track some desired trajectories denoted y * ∈ ℜ 2 despite any influent pollutant variation and uncertainty and time-varying of some process parameters and also of unavailability of some process states.

Exact feedback linearizing control
Firstly, we consider the ideal case where maximum prior knowledge concerning the process is available; that is, model (2) is completely known (i.e., μ is assumed completely known and all the state variables, and all the inflow rates are available by online measurements). Then, a multivariable decoupling exact feedback linearizing control law can be designed. Since the relative degree of the input-output model (4) is equal to 1, then for the closed loop system, we impose the following first-order linear stable dynamical behavior: where y * ¼ S * O * ½ T is a desired piecewise constant output, Λ ¼ diag λ i f g, λ i > 0, and i ¼ 1, 2.
Then, from models (4) and (7), one obtains a multivariable decoupling feedback linearizing control law: The control law (8) leads to a linear error model described as _ e ¼ ÀΛ e, where e ¼ y * À y is the tracking error, which for λ i > 0, i ¼ 1, 2 has an exponential stable point at e ¼ 0.
This controller will be used both for developing of the adaptive and robust controllers and as benchmark, because it yields the best behavior and can be used for comparison.

Adaptive control strategy
Since the prior knowledge concerning the process previously assumed is not realistic, we will design an adaptive control strategy under the following conditions: • The specific growth rate μ is time-varying and completely unknown.
• The variables X and X r are not accessible.
• The inflow rate F in and the rate of recycled sludge r are time-varying.
• The online available measurements are the output pollution level S; the oxygen concentrations O in and O, respectively; and the influent substrate concentration S in .
• All the other kinetic and process coefficients are known.
Recall that the control objective is to make output y to asymptotically track some specified references y * ∈ ℜ 2 despite the unknown kinetics, any time variation of S in , O in , and F in and time-varying of some process parameters. Under the above conditions, an adaptive controller is obtained as follows. The unmeasured variables X and X r can be estimated by using an appropriate form of the reaction rate-independent asymptotic observer developed in [12], described by the next equations (for details, see [12,[15][16][17]): This observer was developed for the following class of nonlinear models [12,[15][16][17]: that can describe the dynamics of numerous bioprocesses, with x ∈ ℜ n , ϕ Á ð Þ ∈ ℜ m , K ∈ ℜ nÂm , A ∈ ℜ nÂn , and b ∈ ℜ n . Note that the aerobic process modeled by model (2) belongs to this class.
For a good understanding, we resume here only some aspects. If in model (11) q ≤ n, states are measured online, and then model (11) can be rewritten as [12,[15][16][17]: (12) where ζ 1 (dimζ 1 ¼ q) denotes the measured variables and ζ 2 (dimζ 2 ¼ n À q ¼ s) represents the variables that have to be estimated, and the matrices K 1 , K 2 , A 11 , A 12 , A 21 , A 22 , b 1 , and b 2 , with suitable dimensions, are the corresponding partitions of K, A, and b, respectively.
The stability of the observers (9) and (10) can be analyzed by using the observation error ζ 2 ¼ ζ 2 À b ζ 2 , whose dynamics obtained from models (9) and (12) is given by It was proven (see [21]) that whatever K * 1 is, the observers (9) and (10) are asymptotically stable if the next conditions hold [15]: (a) W ζ, ij t ð Þ ≥ 0 and ∀i 6 ¼ j, that is, W ζ is a Metzler matrix [22]; (b) where A þ 12 and A þ 22 and A À 12 and A À 22 are the corresponding partitions of A À and A þ , specified in (H4). Since in model (2) rank K ¼ 1, under the above conditions, let us consider the next state partitions: which are induced on the matrices K, A, and b from model (11) the following partitions:  If the matrix N 2 is chosen as N 2 ¼ I 2 , then the matrix N 1 from N ¼ N 1 ⋮N 2 ½ takes the form: The unmeasured states X and X r are obtained by using the asymptotic observers (9) and (10) where W(t) and Z(t) are described by the following matrices: where D À and D þ and r À and r þ represent a lower and, respectively, an upper bound of D and r, and 1 ≥ β ≥ 0, then two stable bounds denoted W À ζ and W þ ζ can be calculated for the stable matrix W ζ t ð Þ.
To obtain the online estimates b μ of the unknown rate μ, we will use an observer-based parameter estimator (OBE) (for details, see [3,7,21]).
Since for the aerobic digestion we must estimate only one incompletely known reaction rate, using only the dynamics of S and O, then the OBE is particularized as [3,7,12] where b X is the online estimate of X, calculated by using the state asymptotic observer given in Eqs. (9) and (10), and ω 1 , ω 2 < 0 and γ 1 , γ 2 > 0 are design parameters at the user's disposal to control the stability and the tracking properties of the estimator.
Finally, the complete adaptive control algorithm is made up by combination of the observer Eqs.
A block diagram of the designed multivariable adaptive system is shown in Figure 9.

Robust control strategy
We will develop a robust control strategy under realistic conditions as follows: • S in and O in are not measurable; that is, in model (11) the vector b(t) is incompletely known, but some lower and upper bounds, possible time-varying, denoted by S À in and S þ in and O À in and O þ in , respectively, are given.
• The variables X and X r are not accessible.
• μ is uncertain and time-varying, because both μ max and K S are uncertain and timevarying, but for these, the bounds μ À max and μ þ max and K À S and K þ S , respectively, are known.
• The inflow rate F in is time-varying.
• r is time-varying, but r ∈ r À ; r þ ½ , where the bounds r ∓ are given.
• The available online measurements are S and O.
• All the other kinetic and process coefficients are known.
To control process (1) under the above conditions, we will develop a robust control strategy as follows. First, the components D and F O of the control law (8) are written as where To estimate the unknown variable X from Eq. (23), we cannot use anymore the asymptotic observers (9) and (10) because S in and O in are not measurable. Hence, by using a suitable observer interval, based on the known lower and upper bounds of S in and O in , we estimate lower and upper bounds of X, in-between it evolve. The interval observer is achieved by using the designed asymptotic observers (9) and (10). For this purpose, the hypothesis (H1) is modified into (H1 0 ) as follows: (H1 0 ) K and A(t) are known, ∀t ≥ 0, and the next additional hypotheses are introduced [15,16,21]: (H5) the input vector b(t) is unknown, but guaranteed bounds, possibly time-varying, are given as b À t ð Þ ≤ b t ð Þ ≤ b þ t ð Þ; and (H6) the initial state conditions are unknown, but guaranteed bounds are given as Interval observers work as a bundle of two observers: an upper observer, which produces an upper bound of the state vector, and a lower observer producing a lower bound, providing this way a bounded interval in which the state vector is guaranteed to evolve [15][16][17]23]. The design is based on properties of monotone dynamical systems or cooperative systems (see [15-16, 21, 24]). Then, under hypotheses (H1 0 )-(H6), a robust interval observer for the system (2) can be described as [12,[15][16][17]21] where W t ð Þ and Z t ð Þ are given by (10), ζ þ 2 t ð Þ and ζ À 2 t ð Þ are upper and lower bounds of the , are the partitions of the known upper and lower bounds of the input vector b(t). Since N 2 must have to be invertible, then it is chosen as N 2 ¼ kI s , where I s is the identity matrix and k > 0 is a real arbitrary parameter.
Since the control objective is to maintain the wastewater degradation S at a desired low-level S * with a proper aeration, then under the next realistic conditions are its lower and upper bounds achieved by using the interval observer (24)), we can define the following robust control strategy.
In Eq. (26) the values of μ þ and μ À of μ are calculated as and b X À and b X þ correspond to S À in and O À in and S þ in and O þ in , respectively.
Remark 1. Note that in a normal operation of the bioreactor the terms S þ in À 1 þ r À ð ÞS, S À in À 1 þ r þ ð Þ S, and α O sat À O ð Þfrom control law (25) are different from zero.◆ As can be observed from the structure of the control scheme (25) (block diagram in Figure 10) and from the simulation results presented in the next section, this control strategy forces the controlled variables to be as close as possible to their desired values.

Simulation results and discussions
The performance of adaptive controller given by Eq. (20) and of robust controller given by Eqs.
(25) and (26) by comparison to the exact linearizing controller (8) (used as benchmark) has been tested by performing extensive simulation experiments. For a proper comparison, the simulations were carried out by using the process model (1) under identical conditions. The values of process and kinetic parameters [8,12] are adapted for WTP Calafat as in Table 1. Two simulation scenarios were taken into consideration: Case 1. We analyzed the behavior of closed-loop system using the adaptive controller (20), by comparison to exact linearizing control law (8) under the following conditions: • S in and O in are time-varying ( Figures 11 and 12), but they are assumed measurable.
• The specific growth rate μ is unknown and time-varying.
• The kinetic coefficients μ 0 max and K 0 S are time-varying parameters described as • The rate of recycled sludge r is time-varying as r t ð Þ ¼ r 0 1 þ 0:5 sin π t=36 ð Þ ð Þ .
• All the other coefficients (Y, K O , μ S , β, α) are constant and known.
• The variables S and O are known (measurable).
• The states X and X r are unmeasurable (X and X r will be estimated).  The behavior of closed-loop system using adaptive controller (20), by comparison to exact linearizing control law (8), is presented in Figures 13-16. To verify the regulation properties, for references S * and O * , some piece-wise constant variations were considered.
To be close to reality, we considered that the measurements of controlled variables S and O are corrupted with additive zero mean white noises (2.5% from their nominal values), as well as the measurements of the influent variables S in and O in are corrupted with an additive zero mean white noise (2.5% from their nominal values). The gains of control laws (8), respectively, (20) are λ 1 ¼ λ 2 ¼ 2, and the tuning parameters of adaptive controller have been set to the values ω 1 ¼ ω 2 ¼ 0:5 and γ 1 ¼ γ 2 ¼ 0:75.
The evolution of the estimate of unknown variable X provided by the observers (9), (10), and (14)-(18) is presented in Figure 17, and the profile of estimate of unknown specific growth rate μ provided by the OBE (19) is given in Figure 18. It can be noticed that both state observer and parameter estimator provide proper results. From graphics in Figures 13 and 14, it can be seen   that the behavior of overall system with adaptive controller (20) is correct, being very close to the behavior of closed-loop system in the ideal case obtained using the linearizing controller (8) when the model is known. Note also the regulation properties and ability of the controller   to maintain the controlled output y very close to its desired value, despite the high variation of S in and F in as well as of the unmeasurable influent dissolved concentration O in and time variation of some process parameters. Even if the control inputs are more affected by noisy measurements, the behavior of the controlled system remains satisfactory.    Case 2. In this case the closed-loop system is based on the structure of robust controllers (25) and (26) under the following assumptions: • S in and O in are not measurable, but some lower and upper bounds, denoted by S À in and O À in and S þ in and O þ in , respectively, as in Figures 11 and 12, are given.
• μ 0 max and K 0 S are two uncertain and time-varying parameters, but some lower and upper bounds of them are known, i.e., μ À max ≤ μ max t ð Þ ≤ μ þ max and K À S ≤ K S t ð Þ ≤ K þ S .
• F in is time-varying as in Case 1, and the variables S and O are known (measurable).
• The rate of recycled sludge r and the yield coefficient Y are time-varying, but some lower and upper bounds of them are known, i.e., r À ≤ r t ð Þ ≤ r þ and Y À ≤ Y t ð Þ ≤ Y þ .
• All the other kinetics and process coefficients are constant and known; states X and X r are unmeasurable (the lower and upper bounds X À , X À r and X þ , X þ r will be estimated, corresponding to S À in and O À in and S þ in and O þ in , respectively).
In our analysis we assume that the time variations of μ max and K S are those from Case 1, that is We assume also that the time variation of r is like in Case 1, that is, r ∈ r À ; r þ ½ ¼ 0:5r 0 ; 1:5r 0 Â Ã . As we mentioned above, in the control laws (25) and (26), the values of μ þ and μ À are calculated as The behavior of closed-loop system using robust controllers (25) and (26) by comparison to the linearizing law (8) is presented in Figures 19-22. The gains of control laws (25) are the same as in the first case, i.e., λ 1 ¼ λ 2 ¼ 2. The estimates of lower and upper bounds of variable X are presented in Figure 23. The estimated values b X þ and b X À are obtained by using the interval observers (24) and (14)- (18), where the input vectors v þ and v À contain the known bounds S À in and O À in and S þ in and O þ in , respectively. The state initial conditions are unknown, but some guaranteed lower and upper bounds are assumed as 245 ¼ X À 0 ð Þ ≤ X 0 ð Þ ≤ X þ 0 ð Þ ¼ 255 (g/l). The time evolution of the uncertain but bounded time-varying parameter μ as well as of its bounds is shown in Figure 24.   Note that the reference profiles of S * and O * are the same as in the first case. As in the adaptive case, the measurements of controlled variable S and O are corrupted with additive zero mean white noises (2.5% from their nominal values). From Figures 19-22, it can be seen that the behavior of overall system with robust controllers (25) and (26), even if this controller uses much less a priori information and is affected by measurement noises, is correct, being close to the behavior of closed-loop system with adaptive controller (20) as well as to the behavior of closed-loop system in the ideal case (process completely known).

Conclusions
In this chapter, a distributed and hierarchized control system implemented at WTP Calafat was presented and analyzed. Also, advanced control solutions for the activated sludge bioprocess taking place in the WTP were proposed.  The implemented DCS-SCADA architecture of the WTP was organized as a distributed and hierarchized control system, developed on four levels. The first three levels were approached in this chapter: the field level, the direct control level, and the plant supervisory level. The structure and the functionality of these levels were described. The primary control loops were dedicated to the control of main technological variables such as levels, dissolved oxygen concentrations, recirculation flows, activated sludge flows, etc.
The analysis of the WTP behavior showed that the performance improvement of the control system is possible by developing advanced control solutions for the activated sludge bioprocess that takes place in the WTP. Therefore, multivariable adaptive and robust control algorithms were proposed and will be implemented at level 2 of the DCS.
The main control objective for the activated sludge process is to maintain the pollution level at a desired low value in spite of load and concentration variations of the pollutant. The controlled variables were the concentrations of pollutant and dissolved oxygen. Two nonlinear control strategies were proposed: an adaptive control scheme and a robust control structure. The adaptive control law was developed under the assumption that the growth rates were unknown but the influent flow rate was measurable. The robust control structure was designed under more realistic suppositions that the growth rates are uncertain and the influent concentrations are completely unknown, but lower and upper bounds of growth rates and of influent organic load (possibly time-varying) are known. Also, the uncertain process parameters were replaced by their lower and upper bounds assumed known.
The proposed control strategies were tested in realistic simulation scenarios, by using noisy measurements of the available states. Taking into account all the uncertainties, disturbances, and noisy data acting on the bioprocess, the conclusion is that the adaptive and especially the robust controllers can constitute a good choice for the control of such class of wastewater treatment bioprocesses. As future research, the implementation of the proposed control algorithms for the activated sludge process at WTP Calafat will be ensured within the project TISIPRO. The proposed control architecture and solutions envisaged the WTP Calafat but can be adapted and implemented for other similar WTPs from the WCO.