InTechOpen uses cookies to offer you the best online experience. By continuing to use our site, you agree to our Privacy Policy.

Mathematics » "Modern Fuzzy Control Systems and Its Applications", book edited by S. Ramakrishnan, ISBN 978-953-51-3390-2, Print ISBN 978-953-51-3389-6, Published: August 30, 2017 under CC BY 3.0 license. © The Author(s).

Chapter 20

Design and Stability Analysis of Fuzzy‐Based Adaptive Controller for Wastewater Treatment Plant

By Mao Li
DOI: 10.5772/intechopen.68411

Article top

Design and Stability Analysis of Fuzzy‐Based Adaptive Controller for Wastewater Treatment Plant

Mao Li
Show details


In this chapter, design and stability analyses of direct model reference control system based on wastewater treatment plant are addressed. The purpose of controller design includes input saturation control and two‐level control system with fuzzy supervisor control. The wastewater treatment plant is a highly uncertain non‐linear system and the plant parameter are unknown, therefore controller design are under those condition.

Keywords: fuzzy control, fuzzy supervisor, wastewater treatment plant, adaptive control, model reference adaptive control, Lyapunov function

1. Introduction

The problem to be solved for this chapter is the dissolved oxygen reference trajectory tracking in an aerobic reactor for nutrient removal using direct model reference adaptive controller at the activated sludge wastewater treatment plant (WWTP). The reference trajectory is provided on‐line by upper control layer of the overall control system. The controller design utilizes a different time scale in the internal dissolved oxygen dynamic and in disturbance inputs. In this chapter, we introduce two kinds of adaptive control, one is Direct Model Reference Adaptive Control (DMRAC) and another one is fuzzy logic based on DMRAC with two‐level control.

2. Adaptive control

The basic concept of adaptive control is that it comprises of two main types. The first is called model reference adaptive control (MRAC) mode whereas the second is called self‐tuning mode. An adaptive control characteristic is that the control parameter are variable, and those parameters are updated online with the signal in the system.

2.1. Model reference adaptive control

A model reference adaptive control can be divided into four parts, such as plant, reference model, control law and controller. A plant includes unknown parameters. The reference model is described as control system output. The closed‐loop control law is adjusting mechanism for adjustable control parameters. The controller updates the adjustable parameter with time‐varying control system.

The plant is supposed to exist with known system structure, but plant parameters are unknown in the real. The structure of the dynamic equation is known with some unknown parameters in the nonlinear plants. The number of poles/zero are supposed to be known with unknown location poles/zero.

The reference model is used in order to obtain assignation ideal response of adaptive control system to control output. For the adaptive control system, that mean it is supply the ideal response by adjusting ideal plant parameters in the adaptation mechanism. To design the adaptive control system, first step is choice of the reference model. It is needed to meet two following clauses.

  • The reference model should satisfy the performance of adaptive control system such as rise time, overshoot and settling time.

  • The ideal plant parameter should be implemented by the adaptive control system.

The controllers are composition of several adjustable parameters. This implies that the controllers are distribution signal to each adjustable parameter with online update. The controller needs to have good tracking performance which means it can achieve tracking convergence behaviour. To design controller, two conditions need to be considered.

  • If the plant parameters are known, then the plant out should track model reference trajectory by relevant controller parameters.

  • If the plant parameters are unknown, then the plant out should track model reference trajectory by adjusting the controller parameters.

The linearly parameterized that mean is the control law with linear term of the adjustable parameters. To guarantee stability and tracking performance, adaptive control design is used by linear parameterization of the controller.

Adjusting parameters in adaptive control law is call adaptation mechanism. In the MRAC systems, the adaptation law is used in order to search the plant parameters, therefore the plant out can track set‐point (model reference) with good performance by adaptive controller. The difference between ideal adaptive control parameter and real plant parameter is call tracking error. The tracking error converge to zero that implies that adaptive control system is stable.

2.2. Self‐tuning model reference adaptive control

The control parameters estimate plant unknown parameters in control system. If a plant parameter is unknown, then a parameter estimator provides estimation values to those plant unknown parameters. If a plant parameter is known, then control parameters would transmit plant parameters by on‐line update on model reference. The estimator provides estimation control parameters with on‐line update from model reference, it is called self‐tuning controller. The self‐tuning controller is estimation unknown parameter in the plant at the same time.

The self‐turning MRAC manipulate processes:

  • The estimator transfer estimated plant parameters to controller; therefore, it can compute the plant corresponding unknown parameters at the same time. The plant estimation parameters depend on the past plant input and output.

  • Computes a control input and rely on control parameters and measured signal, and this control input rely on new plant output.

  • The close‐loop parameters and plant input are updated on‐line with time‐varying adaptive control system.

The estimation parameter can be taken from an ideal parameters and real parameters by plant input/plant output data that are updated on‐line with time‐varying adaptive control system. The error dynamic is described as the difference between ideal plant parameters and real plant parameters; this implies that if tracking errors converge to zero by adjusting parameters adaptation then plant output complete tracking reference model. It is purpose of self‐turning adaptive control design.

The self‐turning control includes two types of adaptive controllers, one is called Indirect Model Reference Adaptive Control (IMRAC) and the another one is called Direct Model Reference Adaptive Control. The plant unknown parameters are provided by adaptive controller estimation of those plant parameters. If the estimation plant parameters need transfer into controller parameters,furthermore control law parameters can influent plant unknown parameters. This implies that the control parameters can adjust plant unknown parameters with standard estimation approach. It is called IMRAC. On the other hand, if it does not need transfer process, this method is called DMRAC.

2.3. Direct model reference control design

The property of adaptive control is used for plant with unknown parameters; therefore, choosing the adaptive control law is more implicated in controller design. Since we mention before, adaptive control law produce controller parameters. Also the stability analysis for control system need to be considered in controller design. In this chapter, we used Lyapunov theory to analyse control system whether stable or unstable. The process of adaptive control design includes three steps. The first step is choosing control law (include plant variable parameters). The second step is choosing adaptation law. The final step is stability analyses to guarantee convergence of control system.

3. DMRAC with input saturation apply on WWTP

3.1. Introduction

An activated sludge wastewater treatment plant (WWTP) is a complex nonlinear system due to multiple time scale and unmeasurable state variables. In addition, it has time‐varying input disturbances and saturation during the WWTP operation; hence, the hierarchical structures which were considered in Refs. [1, 2]. The two‐level controller of tracking prescribed a concentration of the dissolved oxygen (DO) trajectory, while the reference of concentration dissolved oxygen (DOref) was developed in Refs. [3, 4]. The activated sludge plant contained two main components, such as bioreactor and settler as illustrated in Figure 1.


Figure 1.

Structure of WWTP for nutrient removal.

The microorganism produced the biomass to nutrient removal in the bioreactor. The concentration of dissolved oxygen control is an important state parameter that feeds the microorganisms. The concentration of DO control was considered in Ref. [5]. The upper level controller produced airflow Qairref(t) into the aerobic biological reactor zone. The lower level controller produced the concentration of DO to track the Qairref(t) set‐point trajectory. The airflow is the control input, and the concentration of DO is the control output.

The dissolved oxygen reference trajectory DOref(t) set‐point was optimized by the upper control layer which was the medium control layer in overall WWTP [1]. The clean water came out from the settler after being separated from the biomass and sludge. The concentration of substrate and biomass were unmeasurable state variables; hence, they were not able to be on‐line updated. The upper layer control with input saturation was presented in Ref. [6]. The saturation function was assumed considering that aeration system controller was ideal and thus the airflow was equal to airflow reference. However, the physical modelling of the wastewater treatment plant was used to design the controller. In this chapter, we consider the upper level controller with input saturation by designing the new direct model reference adaptive control (DMRAC).

3.2. Problem statement

A mathematical model of the WWTP is based on the mass balance equations, which are illustrated in Figure 1. Hence, they represent the plant variables to produce the model in the state‐space format [8]:




X(t), S(t), DOmax, Xr(t), D(t), Sin(t), DOin(t), Y, μ(t), μmax, KS, KDO, Qair(t), K0, r, β, Qin(t), Qr(t), Qw(t), Va are biomass concentration, substrate concentration, maximum dissolved concentration, recycled biomass concentration, dilution rate, substrate concentration in the influent, dissolved oxygen concentration in the influent, biomass yield factor, biomass growth rate, maximum specific growth rate, affinity constant, saturation constant, aeration rate, model constant, recycled sludge rate, removed sludge rate, influent flow rate, effluent flow rate, recycled flow rate, waste flow rate and aerator volume, respectively.

The function kLa(Qair(t)) is the oxygen transfer, which depends on the aeration actuating system and sludge conditions [4]. In this chapter, it is assumed that


where α and δ are two known constant values relating to oxygen transfer.

As only the DO output is considered in this chapter, the model is sufficiently accurate. Otherwise, more detailed model, for example, the ASM3, than it should be utilized as it has been done in Ref. [7]. In Figure 2, the detailed structure of the activated sludge WWTP for nutrient removal with the airflow actuator is illustrated. The actuator dynamics are described by a complex hybrid model. The output of aeration control system airflow output Qair(t) needs to follow the reference airflow input Qairref(t), which was described in Ref. [8]. The plant input with time‐varying disturbances are dissolved oxygen concentration in the fluent DOin(t), the substrate concentration in the influent Sin(t) and influent flow rate Qin(t). The controller needs to have high performance to enables the airflow output to track the reference airflow input.


Figure 2.

Structure of wastewater treatment plant.

The structure of DO control system for nutrient removal with input saturation at activated sludge WWTP is illustrated in Figure 3.


Figure 3.

Structure of DO control system with input saturation.

The aeration controller designed in this chapter considers the aeration control system as the input Qair(t) with input saturation to achieve Qairref(t)=Qair(t). This is the main difference in comparison with Ref. [8]. If the plant dynamics have several serially coupled reactors, the decentralized controller needs to consider the input saturation [6]. Previous papers [13] considered the two‐level controller to remove the nutrient in the activated sludge WWTP. The upper layer controller generated the expected Qairref(t) into each of the aerobic biological reactor zones. The input of the lower layer controller was Qair(t), which needs to track prescribed upper layer output Qairref(t) for each of the reactor zones. If the upper layer controller had an input saturation condition, it influenced global control system stability and performance. As the plant dynamics have very high order and nonlinear dynamics as in Eqs. (1)(5). The fixed parameter linear controller could not continue to keep the expected performance under full range of operating conditions. This was verified in Ref. [4] by using fixed parameter PI controller in low layer control. The upper layer controller used a fuzzy supervised controller. It obtained the expected performance. In practice, if the disturbance of the input becomes large, fast varying and with saturation input, the PI controller becomes very complex. The DMRAC with input saturation in upper layer control is considered in this chapter, which is not based on previous papers [7]. The DO(t) of the DMRAC input‐output model rearranges the state‐space model from Eqs. (1)(4). As the state variable are not measureable, the unknown quantities in this input‐output model will integrate into one term known as respiration. The parameter adaptation laws of the adaptive controller enable the respiration to be estimated indirectly and automatically.

3.3. DMRAC design

The direct state‐space model of WWTP is represented in Eqs. (1)(5). The dynamics are uncertain and nonlinear. The state variables Xr(t), X(t), S(t) are unmeasurable. The state variables Qair(t),Qin(t),Qw(t),DO(t) are measured by on‐line updates. To design the direct model reference adaptive controller, we shall derive dissolved oxygen dynamics model in input‐output format of first‐order and with input disturbance and input saturation. We shall rewrite Eq. (3) by substituting Eqs. (5) and (7). The term D(t)DOin(t) can be neglected in state‐space model, since it is very small in comparison with other state variables. The dissolved oxygen input‐output model (DOIOM) is derived as follows:


where ap(t),cp(t),bp(t),dp are DOIOM parameters and


The parameters ap(t) and cp(t) are slowly varying and unknown. The parameters ap(t) is dependent on upper control layer which operates in the time scale and is slower in comparison with DO(t) control time scale (6) and (9). The parameter cp(t) is dependent on X and S, and is slower in comparison with DO(t) (1) and (15). The parameter bp(t) is dependent on the fast internal dynamics of DO(t) time scale (9). Hence, DO(t) is fast varying and known. The parameter dp is slowly varying and known. The model reference dynamics (MRD) generate achieved DO(t) dynamics.

The DO(t) tracks the prescribed dissolved oxygen trajectory DOref(t) by the controller. The MRD equation is as follows:


where DOm.ref(t) is the reference dynamics output and the parameters am and bm are constant.

The DO(t) dynamics SISO input‐output model with input saturation yields is as follows:


where W(t) is assumed saturation control input with constraint (SCIC) W(t)=saturation(Qair(t)),


where QairL(t) and QairU(t) are actuator lower and upper constant bounds. If under the input saturation condition, the filter tracking error n(t) is increasing, then global stability will be unstable for the control system. The model reference adaptive control law without input saturation was proposed in Ref. [5]. This motivates us to develop a new control law in comparison with Ref. [8] by explicitly considering the influence of the actuator input saturation nonlinearity.

The filter tracking error is applied as follows:


where e(t) represents the difference between DO(t) and DOm,ref(t) with on‐line update.


We define the auxiliary signal as follows:


where Φ is small position constant parameter. The parameter ΔQair(t) is the difference between SCIC W(t) and control input Qair(t).

The affine MRAC law is applied as follows:


The MRD in Eq. (10) has linear dynamics. The terms 1bpaf(t)f(DO(t)) and 1bpdp in Eq. (16) can be cancelled by closed‐loop with an impact of the nonlinear and additive terms in Eq. (8). The control input saturation is described by the last term in Eq. (16) which is retained in DOIOM. The fifth term in Eq. (16) is updated on‐line. The parameters aDO(t), af(t) and aDOref(t) are updated by adaptive control law. The MRD is achieved in the closed‐loop for ideal parameter. Closing the loop by Eq. (16) yields:




where a^DO(t), a^f(t) and a^DOref(t) are the ideal parameters, which can now be obtained as follows:


The parameter adaption laws which can achieve stability for a DMRAC system with SISO‐controlled plant were derived in Ref. [6]. It was a first‐order dynamic system composed of the mixed linear uncertainty in constant but not time‐varying parameters and additive structured nonlinear. Applying these laws to Eq. (8) yields:


γ1, γ2 and γ3 are small enough positive constants representing the parameter adaptation gains which are used to control the parameter adaptation rates. In order to guarantee the stability of the closed‐loop system, these rates shall be harmonized with the process variable rates. The DMRAC structure is presented in Figure 4.


Figure 4.

DMRAC structure.

3.4. Stability analysis

The estimated parameters aDO(t), af(t) and aDOref(t) are updated on‐line by the adaptation laws (25)(27). The error between estimated parameter and ideal parameters are denoted as ΔaDO(t), Δaf(t) and ΔaDOref(t):


Considering the following Lyapunov function:




It follows from Eqs. (13), (15), (10) and (17) that


Applying Eqs. (33), (25) (26) and (27) into (32), yields:


Summarizing the result of the Lyapunov function (RLF) with input saturation closed‐loop DO(t) dynamic system, it can be seen that RLF progressively approaches zero. If the RLF approaches zero, then filter tracking error approaches zero, when time approaches infinity, Φ is small position constant and n2(t) is positive variable. To find the bounded saturation control input by limiting error between control output and dissolved oxygen trajectory reference with auxiliary signal, yields:


If time approaches infinity, the e(t) approaches zero. To confirm whether the auxiliary signal is negative or positive when time goes to infinity by considering the following Lyapunov function, yields:



Applying Eq. (12) into Eq. (37), yields:


Assume term


It follows Eqs. (38) and (39) so that


Now we assume


where a0 is small positive constant value. Applying Eq. (41) into Eq. (40) yields:


The second term 12ΔQairplant2(t) is bounded. To find bound of first term by integral, yields:


where the Vλ.0(t) is the initial value of the Vλ(t). As time approaches infinity and a0 is large enough for a positive value, then second term is equal to zero in (37).


It follows from Eqs. (36) and (44) and the limitation Vλ(t) as negative or zero by squared.


It follows from Eqs. (35) and (41) that


If the value of a0 is large enough, then the tracking error e(t) is closer to zero. The control system will be more stable. Finally, the standard application of the Barbalat’s lemma allows concluding the adaptive control system that achieves the asymptotic tracking of DOref(t) under‐bounded aDO(t), a^D^O^(t), af(t), af(t), aDOref(t), aDOref(t) if (a) the parameter in adaptive control law are close enough to the set‐point in initial condition; (b) the parameter adaptation rates are positive small enough and (c) the saturation input is small enough, the control parameters bounded are stabilized

3.5. Simulation results

The simulation data are based on the real record. We assumed WWTP without disturbance, the very good DO(t) tracking model reference DOref(t) performance has been shown in Figure 5. The real plant contained some disturbances such as effluent flow rate, recycled flow rate and waste flow rate. The controller that we have designed still indicated perfect tracking performance in Figure 6.


Figure 5.

DO and DOref with input saturation.


Figure 6.

DO and DOref with input saturation and disturbances.

4. Fuzzy supervisor based on multiple DMRAC

4.1. Introduction

In this section, we consider that fuzzy control are based on multiple DMRAC. The fuzzy control represents upper level control and DMRAC represents lower level control. More detail information are described in the next section.

4.2. Problem statement

In Ref. [4] is descried two‐level controller tracking previously set‐point of DO trajectory in several serially coupled reactors for the nutrient removal served by one actuator system with several air blower at WWTP. The upper level control delivers airflow into each bioreactors to be bioreactor set‐point trajectory close to ideal trajectory. The lower level control is used for the concentration of DO trajectory flowing the set‐point. The structure of WWTP with coupled reactors is illustrated in Figure 7. The structure of WWTP is different from Section 5 that contains two bioreactors. The capacity limit is that total airflow Qairmax(t) should be small or equal to sum of all the adaptive control signals Qair.k(t).


Figure 7.

The structure of wastewater treatment plant for nutrient removal with coupled reactors.


where k is the number of bioreactor.

4.3. Controller design

4.3.1. Lower DMRAC design

As mentioned in Section 3, the process of DMRAC design is explained in detail; therefore, in this section we provide essential equations. The state‐space format is same with last section for single reactor as in Eqs. (1)(6).

  • The dissolved oxygen input‐output model (DOIOM) with coupled bioreactors is derived as follows:


    where ap.i(t),cp.i(t),bp.i(t),dp.i are DOIOM parameters and


    where i=1,2

  • The plant parameters status are exactly same with single reactor. The model reference dynamics equation is set as:


    where j=1,2

  • The affine model reference adaptive control law is applied as follows:


    where k=1,2

  • Model reference adaptive control law is used as:


where n=1,2; z=1,2; l=1,2; i=1,2.

4.3.2. Fuzzy supervisor design

The purpose of fuzzy supervisor is to divide total airflow Qairmax(t) into two lower control signal, but those should satisfy capacity limit (47). Each of the bioreactors airflow restrict lower control output by MRAC. This implies that if fuzzy supervisor delivers airflow big enough then bioreactor output is more close to set‐point trajectories (model reference). The error dynamic described each bioreactors output approaching uniform level. The fuzzy supervisor is designed as following: Step 1: Fuzzification

Linguistic variable is at lower level for each DMRAC error dynamics. Those error dynamics are divided into three types such as small, medium and big by percentage of lower level error dynamics (54). Membership function used in this chapter are Sigmoidal condition (55) and Gauss condition (56).


where V(t) is percentage of lower level error dynamics for each airflow.

ei(t) is DMRAC error dynamics for each bioreactors.


where a, c are membership function shape parameters.


where a, σ are membership function shape parameters. Step 2: Fuzzy rule First rule

If error dynamics is small and sum of level airflow is greater than total airflow,

Then bioreactor receives corresponding percentage of total airflow.

If V(t) is small and i=1qQair.i(t)Qairmax(t)


(57) Second rule

If error dynamic medium and sum of level airflow is greater than total airflow,

Then bioreactor receives corresponding percentage of total airflow.

If V(t) is medium and i=1qQair.i(t)Qairmax(t)


(58) Third rule

If error dynamic is big and sum of level airflow is greater than total airflow,

Then bioreactor receive corresponding percentage of total airflow.

If V(t) is big and i=1qQair.i(t)Qairmax(t)


(59) Step 3: Defuzzification

Each of the bioreactors obtain airflow by a fuzzy value.

5. Summary

In this chapter, we considered two different adaptive control. The first adaptive control is applied on WWTP with control input saturation. The second adaptive control descried that how upper level fuzzy control working is based on lower level DMRC applied on the coupling bioreactors of WWTP.


1 - Brdys MA, Grochowski M, Gminski T, Konarczak K, Drewa M. Hierarchical predictive control of integrated wastewater treatment system. Control Engineering Practice. 2008;16(6):751–767.
2 - Piotrowski R, Brdys MA, Konarczak K, Duzinkiewicz K, Chotkowski W. Hierarchical dissolved oxygen control for activated sludge processes. Control Engineering Practice. 2008;16:114–131.
3 - Brdys MA, Diaz‐Maiquez. Application of fuzzy model predictive control to the dissolved oxygen concentration tracking in an activated sludge process. In: Proceedings of the 15th IFAC World Congress; 21–26 July; Barcelona.
4 - Brdys MA, Chotkowski W, Duzinkiewicz K, Konarczak K, Piotrowski R. Two‐level dissolved oxygen control for activated sludge processes. In: Proceedings of the 15th IFAC World Congress; 21–26 July 2002; Barcelona.
5 - Olsson G, Newell R. Wastewater Treatment System. Modelling, Diagnosis and Control. London, UK: IWA Publishing; 1999.
6 - Zubowicz T, Brdys MA, Piotrowski R. Intelligent PI controller and its application to dissolved oxygen tracking problem. Journal of Automation Mobile Robotics & Intelligent Systems. 2010;4(3):16–24.
7 - Li M, Brdys MA. Direct model reference adaptive control of nutrient removal at activated sludge wastewater treatment plant. In: The 20th International Conference on Methods and Models in Automation and Robotics; 24–27 August 2015; Miedzyzdroje, Poland.
8 - Duzinkiewicz K, Brdys MA, Kurek W, Piotrowski R. Genetic hybrid predictive controller for optimized dissolved‐oxygen tracking at lower control level. IEEE Transaction on Control System Technology. 2009;17:1183–1192.