# Nonlinear PI Control with Adaptive Interaction Algorithm for Multivariable Wastewater Treatment Process

Authors: S. I. Samsudin; M. F. Rahmat; Norhaliza Abdul Wahab
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

The wastewater treatment plant (WWTP) is highly known with the nonlinearity of the control parameters, thus it is difficult to be controlled. In this paper, the enhancement of nonlinear PI controller (ENon-PI) to compensate the nonlinearity of the activated sludge WWTP is proposed. The ENon-PI controller is designed by cascading a sector-bounded nonlinear gain to linear PI controller. The rate variation of the nonlinear gaink
n  is automatically updated  based on adaptive interaction algorithm. Initiative to simplify the ENon-PI control structure by adapting k
n has been proved by significant improvement under various dynamic influents. More than 30% of integral square error and 14% of integral absolute error are reduced compared to benchmark PI for DO control and nitrate in nitrogen removal control. Better average effluent qualities, less number of effluent violations, and lower aeration energy consumption resulted.


---

## Body

## 1. Introduction

The wastewater treatment plant (WWTP) is naturally aimed to remove the suspended substances, organic material, and phosphate from the water before releasing it to the recipient. The best technology available was used to control the discharge of pollutants emphasized in biological process, namely, as activated sludge process (ASP). In ASP, the organic materials are oxidized by microorganisms. The organic material is then transformed into carbon dioxide and some incorporate into new cell mass. The new cell mass then forms sludge that contains both living and dead microorganisms and, thus, contains organic material, phosphorous, and nitrogen [1]. Referring to [2], the common problems in WWTP are caused by maintenance issues and poor effluent quality which are due to poor control approaches.According to [3], aeration process is a crucial part of the whole ASP. It is a nontrivial task to transport the oxygen from the air bubbles to the cells of the microorganisms, thus the process is commonly described by the oxygen mass transfer coefficient (K
La). The K
La is, in general, nonlinear and depends on the aeration actuating system and the sludge conditions [4]. Indeed, as referred to in [5], the dissolved oxygen (DO) is stated as a key variable and commonly applied in controlling the ASP. The level of DO in the aerobic reactors has a direct influence on the microorganisms’ activities in the activated sludge. The DO level should be sufficiently high so that enough oxygen can be delivered to the microorganisms in the sludge. However, an excessively high DO will require higher airflow rate and thus leads to higher energy consumption and deteriorate the sludge quality. Meanwhile, nitrogen removal in activated sludge requires two-step procedure which takes place simultaneously nitrification and denitrification processes. Nitrification is a process in which ammonium is oxidized to nitrate under aerobic (present oxygen) conditions. The nitrate formed by nitrification process, in turn, is converted into gaseous nitrogen under anoxic (absent oxygen) conditions, that is called denitrification. The improvement of DO concentration in aerated tanks and the nitrogen removal process contribute to big interest of activated sludge control.The proportional-integral (PI) technique is one of the control strategies that are frequently applied in WWTP. As referred to in [6], each part of PI controller highly contributes in achieving the control target. The proportional part is potential to increase the response speed and control accuracy while the integration part is normally used in eliminating the steady-state error of the system. The performances of several control strategies with PI controller to the WWTP have been discussed in [7, 8]. However, it is hard to achieve high control performance in all operating conditions with a linear PI controller due to different dynamic behaviours of the WWTP control parameters. More retuning task will always be demanded for a fixed-gain PI controller. Therefore, a controller that is potential to maintain a balance of DOs concentrations and nitrogen removal process during the set-point changes is highly demanded. Many approaches have been developed in improving the adaptability and robustness of the controller such as self-tuning method, general predictive control, fuzzy logic, and neural network strategy. However, predictive control technique may require more complex control structure while human knowledge and system’s experts are strongly demanded in adaptive fuzzy controller. Besides, the crucial work is concentrated in estimating all of the input-output data within such a complex system and in determining the appropriate structure of the neural network controller.Under these circumstances, enhanced nonlinear PI (ENon-PI) controller is proposed to compensate the nonlinearity of the control parameters hence to improve the performance of the conventional linear PI controller. The design of the ENon-PI controller is basically referred to [9] where the linear fixed-gain PI controller is cascaded to a bounded nonlinear gain. As referred to in [9], the nonlinear gain function has two parameters to be determined in initial simulation such as the range of variation, e
max
⁡, and the rate of variation, k
n. Difficulties come to identify the appropriate combination of these parameters especially for a complex nonlinear system. Therefore, modifications to the ENon-PI to automate one of the parameters are obviously proposed. The idea is to automatically update k
n using simple updating algorithm, namely, as adaptive interaction algorithm (AIA). The theoretical of adaptive interaction is previously applied in neural network and PID control as referred to in [10, 11], respectively. AIA is generally a technique in which a system is decomposed into subsystems where an adaptation exists between them. It is believed that the k
n is potential to be updated with respect to proportional control part as referred to in [11].Two case studies are proposed for control design strategies with respect to dynamic behaviors of the WWTP. Case 1 highlights the improvement of the ASP with respect to DO concentration in all aerated tanks called DO345 control while the improvement of nitrogen removal process is aimed in Case 2. Cases 1 and 2 are considered due to different average time constant for DO and nitrate which is in minutes and several hours, respectively. In particular, the WWTP is naturally a multivariable system that is basically described as a system with more than one control loop. Changes in any input will generally affect all the outputs due to interaction between the inputs and outputs variables. However, a decentralized controller is a simple approach of multivariable controller designs. As a result, the plant to be controlled is essentially a collection of independent subplants where each element in the plant may be designed independently. The proposed Enon-PI is developed in decentralized control structure in both simulation cases. To further extend, the study on how the ENon-PI controller performs under various different dynamic conditions is covered. The proposed ENon-PI controller is then tested to an updated Benchmark Simulation Model No. 1 (BSM1) with more complex sensors and noises as updated in [12].The paper is organized as follows. The BSM1 is explained in Section2 while the development of ENon-PI with adaptation algorithm is presented in Section 3. The simulation result and discussion of well-tuned ENon-PI controller are presented in Section 4. Finally, Section 5 concludes the paper. For convenience of discussion, Table 1 lists the acronyms that frequently used in the paper.Table 1
List of the acronyms.
Acronyms
Descriptions
AE
Aeration energy
AIA
Adaptive interaction algorithm
ASM1
Activated Sludge Model 1
ASP
Activated sludge process
BSM1
Benchmark Simulation Model No. 1
DO
Dissolved oxygen
D
O
q
Dissolved oxygen control of tankq, q
=
3,4
,
5
DO345
Dissolved oxygen control of tanks 3, 4, and 5
e
Error
e
q
Error of tankD
O
q, q
=
3,4
,
5
ENon-PI
Enhanced nonlinear PI
IAE
Integral of absolute error
ISE
Integral of square error
k
non
Nonlinear gain
k
n
Rate variation of nonlinear gain
K
La
q
Air flow rate of tankq, q
=
3,4
,
5
K
p
Proportional gain
K
i
Integral gain
Mean(
|
e
|
)
Absolute error
Max(
e
)
Maximum absolute deviation from set-point
Q
intr
Internal recycle flow rate
Std(
e
)
Standard deviation of the error
WWTP
Wastewater treatment plant


## 2. Benchmark Simulation Model No. 1 (BSM1)

The WWTP used in the simulation is the benchmark plant developed in [12]; referred as BSM1. The plant consists of five tanks where the first two compartments are anoxic zones followed by three aerobic tanks as shown in Figure 1. Each tank is assumed to have constant volume of 1000 m3, 1000 m3, 1333 m3, 1333 m3, and 1333 m3, respectively. The effluent from the last tank is connected in series to a settler of constant volume of 6000 m3. The BSM1 is widely used as a standard model based on the most popular IWA Activated Sludge Model No. 1 (ASM1) proposed in [13]. The ASM1 was developed as to describe the removal of ammonium nitrogen and organic carbon. Meanwhile, the model proposed by [14] by was chosen to resemble the behavior of the secondary settler. The BSM1 is default controlled by PI controller where two control loops of nitrate in the second anoxic tank and the DO concentration in the final tank are emphasized. The performances of the benchmark PI are always used as comparison to the proposed controller. Detail on the model can be referred in [12].Figure 1
The plant layout of the BSM1.


### 2.1. Influent Load

To investigate the performance of the control strategy in various weather situations, three dynamic input files including dry, rain, and storm events that have realistic variations in the effluent flow rate and composition have been used. The data used for the estimation and control are sampled with a sampling period of 15 minutes given as(1)
[
time
S
I
S
S
X
I
X
S
X
BH
X
BA
X
P
S
O
S
NO
S
NH
S
ND
X
ND
S
ALK
Q
o
]
.In any influent: S
O
=
0
g(-COD) m3; X
BA
=
0
gCOD m−3; S
NO
=
0
g
N
m
-
3;  X
P
=
0
g COD m−3; S
ALK
=
7 mol m−3. The description of influent’ variables is presented in Table 2.Table 2
Influent data.
Variables
Descriptions
S
I
Soluble inert organic matter
S
S
Suspended solids
S
O
Dissolve oxygen
S
NO
Nitrate
S
NH
Ammonium and ammonia nitrogen
S
ND
Soluble biodegradable organic nitrogen
S
ALK
Alkalinity
X
I
Particulate inert organic matter
X
S
Slowly biodegradable substrate
X
BH
Active heterotrophic biomass
X
BA
Active autotrophic biomass
X
P
Particulate products arising from biomass decay
X
ND
Particulate biodegradable organic nitrogen
Q
o
Input flow rateThe dry influent contains two weeks of dynamic dry weather influent data. The rain influent is based on the dry weather file with an added rain event during the second week. Similarly, the storm influent file is also based on the dry weather file but added with two storm events during the second week. There is a constant influent with constant flow and composition that is used during the system simulation under steady state condition. Refer to [12] for detailed explanation.


### 2.2. Performance Assessment

Two-level performance assessment is highlighted in controlling the WWTP. The local control loop is assessed on the means of absolute error (Mean(|
e
|)), the integral of absolute error (IAE), the integral of square error (ISE), the maximum absolute deviation from set-point (Max(e)), and the standard deviation of the error (Std(e)) at the first level. Meanwhile, the second level investigates the effect of the control strategy on the plant process operation with respect to economical and quality part. Two measuring assessments are considered in the simulation such as the effluent violations and the aeration energy consumed.


#### 2.2.1. The Effluent Violations

Table3 indicates the constraints of the effluent water quality. The flow-weighted average effluent concentrations of the following variables must meet their corresponding limitations. Besides, the effluent violations can be reported through the number of violations and the percentage time plant is in violation. This quantity indicates the frequency of the plant effluent increases above the effluent constraint.Table 3
Constraints of the effluent water quality.
Variables
Value
Total nitrogen (Ntot)
18 g N m−3
Chemical oxygen demand (COD5)
100 g COD m−3
Ammonia (S
NH)
4 g N m−3
Total suspended solids (TSS)
30 g SS m−3
Biochemical oxygen demand (BOD5)
10 g BOD m−3


#### 2.2.2. The Aeration Energy

The index of aeration energy (AE) is described as in (2). K
La
q
(
t
) is the oxygen transfer coefficient in each tank, q. The AE is calculated for the last 7 days, T of the dynamic test weather conditions with unit of kWhday−1. Consider
(2)
AE
=
S
o
sat
⁡
T
·
1.8
·
1000
∫
7
days
14
days
∑
k
=
1
5
V
q
·
K
La
q
(
t
)
d
t
.


## 2.1. Influent Load

To investigate the performance of the control strategy in various weather situations, three dynamic input files including dry, rain, and storm events that have realistic variations in the effluent flow rate and composition have been used. The data used for the estimation and control are sampled with a sampling period of 15 minutes given as(1)
[
time
S
I
S
S
X
I
X
S
X
BH
X
BA
X
P
S
O
S
NO
S
NH
S
ND
X
ND
S
ALK
Q
o
]
.In any influent: S
O
=
0
g(-COD) m3; X
BA
=
0
gCOD m−3; S
NO
=
0
g
N
m
-
3;  X
P
=
0
g COD m−3; S
ALK
=
7 mol m−3. The description of influent’ variables is presented in Table 2.Table 2
Influent data.
Variables
Descriptions
S
I
Soluble inert organic matter
S
S
Suspended solids
S
O
Dissolve oxygen
S
NO
Nitrate
S
NH
Ammonium and ammonia nitrogen
S
ND
Soluble biodegradable organic nitrogen
S
ALK
Alkalinity
X
I
Particulate inert organic matter
X
S
Slowly biodegradable substrate
X
BH
Active heterotrophic biomass
X
BA
Active autotrophic biomass
X
P
Particulate products arising from biomass decay
X
ND
Particulate biodegradable organic nitrogen
Q
o
Input flow rateThe dry influent contains two weeks of dynamic dry weather influent data. The rain influent is based on the dry weather file with an added rain event during the second week. Similarly, the storm influent file is also based on the dry weather file but added with two storm events during the second week. There is a constant influent with constant flow and composition that is used during the system simulation under steady state condition. Refer to [12] for detailed explanation.


## 2.2. Performance Assessment

Two-level performance assessment is highlighted in controlling the WWTP. The local control loop is assessed on the means of absolute error (Mean(|
e
|)), the integral of absolute error (IAE), the integral of square error (ISE), the maximum absolute deviation from set-point (Max(e)), and the standard deviation of the error (Std(e)) at the first level. Meanwhile, the second level investigates the effect of the control strategy on the plant process operation with respect to economical and quality part. Two measuring assessments are considered in the simulation such as the effluent violations and the aeration energy consumed.


### 2.2.1. The Effluent Violations

Table3 indicates the constraints of the effluent water quality. The flow-weighted average effluent concentrations of the following variables must meet their corresponding limitations. Besides, the effluent violations can be reported through the number of violations and the percentage time plant is in violation. This quantity indicates the frequency of the plant effluent increases above the effluent constraint.Table 3
Constraints of the effluent water quality.
Variables
Value
Total nitrogen (Ntot)
18 g N m−3
Chemical oxygen demand (COD5)
100 g COD m−3
Ammonia (S
NH)
4 g N m−3
Total suspended solids (TSS)
30 g SS m−3
Biochemical oxygen demand (BOD5)
10 g BOD m−3


### 2.2.2. The Aeration Energy

The index of aeration energy (AE) is described as in (2). K
La
q
(
t
) is the oxygen transfer coefficient in each tank, q. The AE is calculated for the last 7 days, T of the dynamic test weather conditions with unit of kWhday−1. Consider
(2)
AE
=
S
o
sat
⁡
T
·
1.8
·
1000
∫
7
days
14
days
∑
k
=
1
5
V
q
·
K
La
q
(
t
)
d
t
.


## 2.2.1. The Effluent Violations

Table3 indicates the constraints of the effluent water quality. The flow-weighted average effluent concentrations of the following variables must meet their corresponding limitations. Besides, the effluent violations can be reported through the number of violations and the percentage time plant is in violation. This quantity indicates the frequency of the plant effluent increases above the effluent constraint.Table 3
Constraints of the effluent water quality.
Variables
Value
Total nitrogen (Ntot)
18 g N m−3
Chemical oxygen demand (COD5)
100 g COD m−3
Ammonia (S
NH)
4 g N m−3
Total suspended solids (TSS)
30 g SS m−3
Biochemical oxygen demand (BOD5)
10 g BOD m−3


## 2.2.2. The Aeration Energy

The index of aeration energy (AE) is described as in (2). K
La
q
(
t
) is the oxygen transfer coefficient in each tank, q. The AE is calculated for the last 7 days, T of the dynamic test weather conditions with unit of kWhday−1. Consider
(2)
AE
=
S
o
sat
⁡
T
·
1.8
·
1000
∫
7
days
14
days
∑
k
=
1
5
V
q
·
K
La
q
(
t
)
d
t
.


## 3. Development of Enhanced Nonlinear PI Controller

### 3.1. The Case Study

As mentioned, two case studies are highlighted for control design strategies. The improvement of the ASP with respect to DO concentration in all aerated tanks, tank 3 (DO3), tank 4 (DO4), and tank 5, (DO5) called DO345 control is aimed in Case 1. Meanwhile, the improvement of the nitrogen removal process of nitrate and DO5 control is next highlighted in Case 2.


#### 3.1.1. Case 1: Controlling the Aerated Tanks (DO345)

For decentralized control structure, the WWTP is partitioned into three SISO subsystems contributing to three ENon-PI controllers. The implementation of DO345 control is shown in Figure 2.Figure 2
ENon-PI control for the last three aerated tanks in Case 1.


#### 3.1.2. Case 2: Controlling the Nitrate-DO5

For the nitrogen removal process, the ENon-PI controller is set to work correspondingly to the benchmark PI. The implementation of the controller is shown in Figure3.Figure 3
ENon-PI control for the nitrate-DO5 in Case 2.


### 3.2. The Controller

For a conventional linear PI controller, the error signal is used to generate the proportional (P) and integral (I) control actions and to be summed in producing the control signal as generally expressed as in
(3)
u
(
t
)
=
K
p
e
(
t
)
+
K
i
∫
0
t
e
(
t
)
d
t
,
where K
p and K
i are the proportional and integral coefficients of the PI controller, respectively. However, the fixed-gains of conventional linear PI controller have the limitation in controlling the time-variant characteristics and the process nonlinearities of the WWTP [15]. This problem can be alleviated by employing nonlinear elements in the PI control scheme and thus leads the development of the ENon-PI controller.As discussed, the ENon-PI is designed by cascading a sector-bounded nonlinear gain to linear PI controller as described in (4). The nonlinear gain, k
non is a function of error with respect to the changes of k
n, that acts on the error in producing the scaled error; f
(
e
)
=
k
non
(
e
,
k
n
)
·
e
(
t
). The f
(
e
) is then input to the PI controller thus generating the control action as
(4)
u
ENon-PI
(
t
)
=
[
k
p
e
(
t
)
+
k
i
∫
0
t
e
(
t
)
d
t
]
·
f
(
e
)
=
[
k
p
e
(
t
)
+
k
i
∫
0
t
e
(
t
)
d
t
]
[
k
non
(
e
,
k
n
)
·
e
(
t
)
]
.
The k
non can be expressed by any nonlinear general function such as sigmoidal function, the hyperbolic function, and the piecewise linear function as explained in [16]. However, the k
non used in the simulation are described in (5) and (6). Notice that the k
n is automatically updated by the AIA while e
max
⁡ is the user-defined positive constant. Consider
(5)
k
non
(
e
,
k
n
)
=
[
exp
⁡
(
k
n
e
)
+
exp
⁡
(
k
n
e
)
2
]
,
where
(6)
e
=
{
e
|
e
|
≤
e
max
⁡
,
sign
⁡
(
e
)
·
|
e
max
⁡
|
|
e
|
>
e
max
⁡
.


### 3.3. The Algorithm

The work on enhanced nonlinear PID by [9] is extended to adaptively update the k
n. It is believed that the characteristic of k
n is potential to be manipulated based on AIA. As mentioned, the AIA is generally a technique in which a system is decomposed into subsystems where an adaptation exists between them. The k
n is updated with respect to proportional control part as referred to in [11]. The typical decomposition of a system for an adaptive interaction and the detail on AIA can be further referred in [10, 11, 17].In conjunction to Case 1, DO3, DO4, and DO5 control loops are involved. However, the DO3 concentration is first considered to present the applied algorithm. The block diagram of ENon-PI of DO3 control loop is shown in Figure 4. y
d
3 and y
3 are desired and measured outputs that result in the error of DO3, e
3. The e
3 is then applied by AIA in updating the k
n
3 for the variation of the k
non
3. The integration of the functional of k
non
3 to the PI controller develops the ENon-PI for DO3 control.Figure 4
The block diagram of ENon-PI controller for DO3 control.The aim here is to updatek
n
3 of the nonlinear gain for the third tank using the the AIA so that the performance index which is the e
3 as in (7) is minimized. With respect to AIA, it is believed that interaction/adaptation of k
n
3 exists between the proportional gain transfer function of e
3, A
3, and the functional of the k
non
3
. The gradient method as given in (8) is then applied. Consider
(7)
E
3
=
e
3
2
=
(
y
3
-
y
d
3
)
2
,
(8)
k
•
n
3
=
-
γ
3
d
E
3
d
y
3
∘
F
•
[
x
3
]
∘
A
3
ϒ
3 is the adaptation gain while F
• is the Frechet derivative in relation to the plant input, x
3, and the output, y
3. The adaptation of k
n
3 is then reduced to
(9)
k
•
n
3
=
2
γ
3
(
y
3
-
y
d
3
)
F
•
[
x
3
]
∘
A
3
=
2
γ
3
e
3
F
•
[
x
3
]
∘
A
3
.
The functional F
[
x
3
] can be written in the convolution form as in (10). g
3
(
t
) is the impulse response of the linear time invariant system for DO3 while * denotes convolution. Therefore, the Frechet derivative can be expressed as in (11). Consider
(10)
F
[
x
3
]
=
g
3
(
t
)
*
x
3
(
t
)
=
∫
0
t
g
3
(
t
-
τ
)
x
3
(
τ
)
d
τ
,
(11)
F
•
[
x
3
]
∘
A
3
=
∫
0
t
g
3
(
t
-
τ
)
A
3
(
τ
)
d
τ
=
g
3
(
t
)
*
A
3
(
t
)
.
However in many practical systems, the Frechet derivative can be approximated as in (12) where A
3 is an arbitrary function and σ
3 is a constant value. Consider
(12)
F
•
[
x
3
]
∘
A
3
=
σ
3
A
3
.
This result approximates Frechet tuning algorithm as presented in
(13)
k
•
n
3
=
2
γ
3
e
3
F
•
[
x
3
]
∘
A
3
=
2
γ
3
e
3
σ
3
A
3
.
Let the adaptive coefficient, η
3
=
2
ϒ
3
σ
3 and η
3
>
0
. The tuning algorithm of k
n
3 thus can be simplified to (14). Therefore, k
n
3 might change and update it responses with time referring to the changes of e
3 in achieving good variation of the k
non
3. The general function of k
non used in the simulation can be referred in (5). Consider
(14)
k
•
n
3
=
η
3
e
3
A
3
.
Taking y
d
4 and y
4 that represent the desired and measured outputs which result the error of DO4, e
4 besides A
4 that denotes the proportional gain of tank four, the procedures of (7)–(13) are repeated. This results in an approximate Frechet tuning algorithm for tank four as described in (15). The same goes to DO control of tank five thus contributing to k
n
5 as in (16). Notice that η
3, η
4, and η
5 are the adaptation coefficients of k
n
3, k
n
4, and k
n
5 in controlling the DO3, DO4, and DO5 concentrations, respectively. For simplicity, the proportional gains of A
3, A
4, and A
5 are always set to 1
(15)
k
•
n
4
=
η
4
e
4
A
4
,
(16)
k
•
n
5
=
η
5
e
5
A
5
.
In fact, the procedures on (7)–(13) are repeated for nitrate control loop in Case 2. The tuning algorithm of k
n
2 is then described in (17). Meanwhile, similar algorithm presented in (16) is used for DO5 control. Consider
(17)
k
•
n
2
=
η
2
e
2
A
2
.


## 3.1. The Case Study

As mentioned, two case studies are highlighted for control design strategies. The improvement of the ASP with respect to DO concentration in all aerated tanks, tank 3 (DO3), tank 4 (DO4), and tank 5, (DO5) called DO345 control is aimed in Case 1. Meanwhile, the improvement of the nitrogen removal process of nitrate and DO5 control is next highlighted in Case 2.


### 3.1.1. Case 1: Controlling the Aerated Tanks (DO345)

For decentralized control structure, the WWTP is partitioned into three SISO subsystems contributing to three ENon-PI controllers. The implementation of DO345 control is shown in Figure 2.Figure 2
ENon-PI control for the last three aerated tanks in Case 1.


### 3.1.2. Case 2: Controlling the Nitrate-DO5

For the nitrogen removal process, the ENon-PI controller is set to work correspondingly to the benchmark PI. The implementation of the controller is shown in Figure3.Figure 3
ENon-PI control for the nitrate-DO5 in Case 2.


## 3.1.1. Case 1: Controlling the Aerated Tanks (DO345)

For decentralized control structure, the WWTP is partitioned into three SISO subsystems contributing to three ENon-PI controllers. The implementation of DO345 control is shown in Figure 2.Figure 2
ENon-PI control for the last three aerated tanks in Case 1.


## 3.1.2. Case 2: Controlling the Nitrate-DO5

For the nitrogen removal process, the ENon-PI controller is set to work correspondingly to the benchmark PI. The implementation of the controller is shown in Figure3.Figure 3
ENon-PI control for the nitrate-DO5 in Case 2.


## 3.2. The Controller

For a conventional linear PI controller, the error signal is used to generate the proportional (P) and integral (I) control actions and to be summed in producing the control signal as generally expressed as in
(3)
u
(
t
)
=
K
p
e
(
t
)
+
K
i
∫
0
t
e
(
t
)
d
t
,
where K
p and K
i are the proportional and integral coefficients of the PI controller, respectively. However, the fixed-gains of conventional linear PI controller have the limitation in controlling the time-variant characteristics and the process nonlinearities of the WWTP [15]. This problem can be alleviated by employing nonlinear elements in the PI control scheme and thus leads the development of the ENon-PI controller.As discussed, the ENon-PI is designed by cascading a sector-bounded nonlinear gain to linear PI controller as described in (4). The nonlinear gain, k
non is a function of error with respect to the changes of k
n, that acts on the error in producing the scaled error; f
(
e
)
=
k
non
(
e
,
k
n
)
·
e
(
t
). The f
(
e
) is then input to the PI controller thus generating the control action as
(4)
u
ENon-PI
(
t
)
=
[
k
p
e
(
t
)
+
k
i
∫
0
t
e
(
t
)
d
t
]
·
f
(
e
)
=
[
k
p
e
(
t
)
+
k
i
∫
0
t
e
(
t
)
d
t
]
[
k
non
(
e
,
k
n
)
·
e
(
t
)
]
.
The k
non can be expressed by any nonlinear general function such as sigmoidal function, the hyperbolic function, and the piecewise linear function as explained in [16]. However, the k
non used in the simulation are described in (5) and (6). Notice that the k
n is automatically updated by the AIA while e
max
⁡ is the user-defined positive constant. Consider
(5)
k
non
(
e
,
k
n
)
=
[
exp
⁡
(
k
n
e
)
+
exp
⁡
(
k
n
e
)
2
]
,
where
(6)
e
=
{
e
|
e
|
≤
e
max
⁡
,
sign
⁡
(
e
)
·
|
e
max
⁡
|
|
e
|
>
e
max
⁡
.


## 3.3. The Algorithm

The work on enhanced nonlinear PID by [9] is extended to adaptively update the k
n. It is believed that the characteristic of k
n is potential to be manipulated based on AIA. As mentioned, the AIA is generally a technique in which a system is decomposed into subsystems where an adaptation exists between them. The k
n is updated with respect to proportional control part as referred to in [11]. The typical decomposition of a system for an adaptive interaction and the detail on AIA can be further referred in [10, 11, 17].In conjunction to Case 1, DO3, DO4, and DO5 control loops are involved. However, the DO3 concentration is first considered to present the applied algorithm. The block diagram of ENon-PI of DO3 control loop is shown in Figure 4. y
d
3 and y
3 are desired and measured outputs that result in the error of DO3, e
3. The e
3 is then applied by AIA in updating the k
n
3 for the variation of the k
non
3. The integration of the functional of k
non
3 to the PI controller develops the ENon-PI for DO3 control.Figure 4
The block diagram of ENon-PI controller for DO3 control.The aim here is to updatek
n
3 of the nonlinear gain for the third tank using the the AIA so that the performance index which is the e
3 as in (7) is minimized. With respect to AIA, it is believed that interaction/adaptation of k
n
3 exists between the proportional gain transfer function of e
3, A
3, and the functional of the k
non
3
. The gradient method as given in (8) is then applied. Consider
(7)
E
3
=
e
3
2
=
(
y
3
-
y
d
3
)
2
,
(8)
k
•
n
3
=
-
γ
3
d
E
3
d
y
3
∘
F
•
[
x
3
]
∘
A
3
ϒ
3 is the adaptation gain while F
• is the Frechet derivative in relation to the plant input, x
3, and the output, y
3. The adaptation of k
n
3 is then reduced to
(9)
k
•
n
3
=
2
γ
3
(
y
3
-
y
d
3
)
F
•
[
x
3
]
∘
A
3
=
2
γ
3
e
3
F
•
[
x
3
]
∘
A
3
.
The functional F
[
x
3
] can be written in the convolution form as in (10). g
3
(
t
) is the impulse response of the linear time invariant system for DO3 while * denotes convolution. Therefore, the Frechet derivative can be expressed as in (11). Consider
(10)
F
[
x
3
]
=
g
3
(
t
)
*
x
3
(
t
)
=
∫
0
t
g
3
(
t
-
τ
)
x
3
(
τ
)
d
τ
,
(11)
F
•
[
x
3
]
∘
A
3
=
∫
0
t
g
3
(
t
-
τ
)
A
3
(
τ
)
d
τ
=
g
3
(
t
)
*
A
3
(
t
)
.
However in many practical systems, the Frechet derivative can be approximated as in (12) where A
3 is an arbitrary function and σ
3 is a constant value. Consider
(12)
F
•
[
x
3
]
∘
A
3
=
σ
3
A
3
.
This result approximates Frechet tuning algorithm as presented in
(13)
k
•
n
3
=
2
γ
3
e
3
F
•
[
x
3
]
∘
A
3
=
2
γ
3
e
3
σ
3
A
3
.
Let the adaptive coefficient, η
3
=
2
ϒ
3
σ
3 and η
3
>
0
. The tuning algorithm of k
n
3 thus can be simplified to (14). Therefore, k
n
3 might change and update it responses with time referring to the changes of e
3 in achieving good variation of the k
non
3. The general function of k
non used in the simulation can be referred in (5). Consider
(14)
k
•
n
3
=
η
3
e
3
A
3
.
Taking y
d
4 and y
4 that represent the desired and measured outputs which result the error of DO4, e
4 besides A
4 that denotes the proportional gain of tank four, the procedures of (7)–(13) are repeated. This results in an approximate Frechet tuning algorithm for tank four as described in (15). The same goes to DO control of tank five thus contributing to k
n
5 as in (16). Notice that η
3, η
4, and η
5 are the adaptation coefficients of k
n
3, k
n
4, and k
n
5 in controlling the DO3, DO4, and DO5 concentrations, respectively. For simplicity, the proportional gains of A
3, A
4, and A
5 are always set to 1
(15)
k
•
n
4
=
η
4
e
4
A
4
,
(16)
k
•
n
5
=
η
5
e
5
A
5
.
In fact, the procedures on (7)–(13) are repeated for nitrate control loop in Case 2. The tuning algorithm of k
n
2 is then described in (17). Meanwhile, similar algorithm presented in (16) is used for DO5 control. Consider
(17)
k
•
n
2
=
η
2
e
2
A
2
.


## 4. Results and Discussion

The simulation procedures of BSM1 can be referred to in [12]. In the ideal case, the BSM1 is first simulated for 150 days to attain a quasi-steady-state using the constant influent input. This is done to guarantee that the initial conditions of the states are consistent. It then continued with 14-day simulation of dry influent to set up the plant for the dynamic benchmark simulation. Finally, the plant is simulated for the next 14 days with the dynamic test input weather with noises present. However, only the data of the last 7 days are evaluated in control assessment. For DO control, the sensor of class A with a measurement range of 0 to 10 g(-COD) m−3 and a measurement noise of 0.25 g(-COD) m is used. Meanwhile, a class B0 sensor with a measurement range of 0 to 20 gNm−3 and measurement noise of 0.5 gNm−3 is applied in nitrate control. Two case studies are considered in the simulation, DO345 control and nitrogen removal process control.


### 4.1. Case 1: Controlling the DO345

The DO concentrations in tank 3, tank 4, and tank 5 are set to 1.5 mg L−1, 3 mg L−1, and 2 mg L−1, respectively, as referred to in [18]. Nevertheless, the previous work develops multivariable PID for COST simulation benchmark [19] instead of updated version [12] that is used in the present simulation. In addition, the oxygen mass transfer coefficient of DO3 (K
La
3), the oxygen mass transfer coefficient of DO4 (K
La
4), and the oxygen mass transfer coefficient of DO5 (K
La
5) are constrained to a maximum of 360 day−1. The k
n
3, k
n
4, and k
n
5 are automatically updated using AIA as described in (14)–(16). Meanwhile, the adaptive coefficients, η
3, η
4, and η
5 are set to 0.09. e
max
⁡
=
1 is applied while the proportional gains and the integral time constants of linear PI controllers are set to 25 and 0.0020, respectively.


### 4.2. Case 2: Controlling the Nitrate-DO5

The nitrate-DO5 control of the nitrogen removal process is considered in the second case. The k
n
2 and k
n
5 are automatically updated using AIA as referred to in (16)-(17). The internal recycle flow rate (Q
intr) and the K
La
5 are manipulated. To improve the nitrogen removal, the nitrate concentration is set to 1.0 gm−3 with constrained Q
intr up to 5 times of stabilized input flow rate, 92230 m3 day−1. The DO5 level is set to 2.0 gm−3 with constrained K
La
5 to a maximum of 360 day−1. The η
2 and η
5 are similarly set to 0.09 while the e
max
⁡ and the PI control gains as in Case 1 are maintained in the simulation.


### 4.3. Discussion

It is aimed to improve the performance for the set-point tracking of the load changes due to daily variations in different influents composition. As mentioned, the effectiveness of the proposed ENon-PI controller is investigated in two-level assessment, the performance of the controller and the performance of activated sludge process compared to benchmark PI.


#### 4.3.1. The Performance of the Controller

The ENon-PI is first assessed by investigating the Mean(|e|), the IAE, the ISE, the Max(e), and the Std(e). As for comparison, the performance of ENon-PI with adaptive k
n is also compared to ENon-PI with fixed k
n. For this purpose, the k
n
3, k
n
4, and k
n
5 are set to 0.01 for DO345 control. Similarly k
n
5 is used for DO5 while k
n
2 is set to 0.1 for nitrate in nitrate-DO5 control. Referring to Table 4, obvious improvement is obtained in Case 1 by ENon-PI controller compared to benchmark PI controller. However, as referred to in Table 5, significant improvement is observed for nitrate compared to DO5 in Case 2. Difficulties come to control simultaneous nitrate and DO5 control loops in Case 2 that may due to different dynamic behaviours of the control parameters.Table 4
Comparative of controller performance for Case 1.
Benchmark PI
Fixedk
n
Adaptivek
n
-%
-%
Dry
Mean(
|
e
|
)
0.0840
0.0695
17.3052
0.0688
18.1381
IAE
0.5883
0.4814
18.1724
0.4813
18.1894
ISE
0.0840
0.0547
34.8616
0.0547
34.8616
Max(dev)
0.3963
0.3101
21.7532
0.3058
22.8382
Std(dev)
0.1095
0.0884
19.2915
0.0884
19.2915
Rain
Mean(
|
e
|
)
0.0795
0.0688
13.4939
0.0666
16.2601
IAE
0.5567
0.4665
16.2056
0.4665
16.2056
ISE
0.0747
0.0513
31.3556
0.0512
31.4894
Max(dev)
0.3851
0.2992
22.2958
0.2868
25.5162
Std(dev)
0.1033
0.0856
17.1506
0.0855
17.2474
Storm
Mean(
|
e
|
)
0.0809
0.0680
15.8978
0.0672
16.8872
IAE
0.5660
0.4702
16.9229
0.4701
16.9405
ISE
0.0789
0.0523
33.6934
0.0522
33.8202
Max(dev)
0.3792
0.3005
20.7626
0.2970
21.6855
Std(dev)
0.1062
0.0864
18.6057
0.0864
18.6057Table 5
Comparative of controller performance for Case 2.
Benchmark PI
Fixedk
n
Adaptivek
n
-%
-%
Dry
Nitrate
Mean(
|
e
|
)
0.2050
0.2049
0.034151
0.1760
14.13377567
IAE
1.4348
1.2319
14.14134
1.2318
14.14831335
ISE
0.5690
0.3871
31.96478
0.3862
32.12295903
Max(dev)
0.9178
0.8138
11.33338
0.8130
11.42053998
Std(dev)
0.2851
0.2341
17.88558
0.2338
17.99080992
DO5
Mean(
|
e
|
)
0.0840
0.0852
−1.37547
0.0815
3.026985865
IAE
0.5883
0.5864
0.324659
0.5707
2.993319848
ISE
0.0840
0.0863
−2.76868
0.0816
2.828222685
Max(dev)
0.3963
0.4184
−5.57392
0.4396
−10.9232671
Std(dev)
0.1095
0.1110
−1.3421
0.1095
0.027389756
Rain
Nitrate
Mean(
|
e
|
)
0.2478
0.2068
16.55907
0.2065
16.6801162
IAE
1.7349
1.4479
16.54274
1.4457
16.66954868
ISE
0.7944
0.5435
31.58014
0.5411
31.88227
Max(dev)
0.9213
0.8445
8.340026
0.8431
8.491979074
Std(dev)
0.3369
0.2783
17.38408
0.2776
17.59187793
DO5
Mean(
|
e
|
)
0.0795
0.0802
−0.83991
0.0762
4.189508625
IAE
0.5567
0.5514
0.955597
0.5338
4.116970829
ISE
0.0747
0.0763
−2.0968
0.0700
6.333212905
Max(dev)
0.3851
0.4060
−5.44085
0.4342
−12.764576
Std(dev)
0.1033
0.1034
−0.07743
0.0999
3.31010453
Storm
Nitrate
Mean(
|
e
|
)
0.2398
0.2037
15.05067
0.2033
15.21748196
IAE
1.6785
1.4257
15.06107
1.4229
15.22788204
ISE
0.7880
0.5454
30.78417
0.5417
31.25372793
Max(dev)
1.2014
0.9644
19.72699
0.9483
21.0670884
Std(dev)
0.3355
0.2788
16.89272
0.2779
17.16994068
DO5
Mean(
|
e
|
)
0.0809
0.0818
−1.17001
0.0786
2.787740866
IAE
0.5660
0.5701
−0.72794
0.5502
2.788084385
ISE
0.0789
0.0808
−2.43927
0.0763
3.265885694
Max(dev)
0.3792
0.4137
−9.08659
0.4348
−14.6503533
Std(dev)
0.1062
0.1075
−1.27179
0.1044
1.648610457The variation of output and input variables of DO345 control in Case 1 under dry input weather by ENon-PI with adaptive k
n is shown in Figure 5. It was seen that the ENon-PI controller with adaptive k
n
3, k
n
4, and k
n
5 manages well to keep DO3, DO4, and DO5 concentrations around the reference values. Besides, the input variables K
La
3, K
La
4, and K
La
5 are always kept under the upper bounds. Meanwhile, Figure 6 shows the variation of the error and the adaptation of the k
n resulted. As observed, higher k
n is demanded for a higher error resulted.Variation of (a) output and (b) input variables under dry influent of Case 1.
(a)
(b)Variation of (a) error (b) rate variation under dry influent of Case 1.
(a)
(b)The nitrate-DO5 control is then simulated with respect to benchmark PI, as applied in [12]. Figure 7 shows the comparative variation of output variables of nitrate and DO5 under rain input weather. Slight improvements are observed by ENon-PI with adaptive k
n
2 and k
n
5 for nitrate and DO5 concentrations compared to benchmark PI. Nevertheless, the improvements are obviously better than the fixed k
n. The variations of input variables of nitrate-DO5 control are next illustrated in Figure 8. Similarly, the Q
intr and K
La
5 are always kept under the upper bounds. Meanwhile, the variation of the errors and the adaptation of the rate variation resulted are illustrated in Figure 9.Variation of (a) nitrate (b) DO5 output variables under rain influent of Case 2.
(a)
(b)Variation of (a)Q
intr (b) K
La
5 input variables under rain influent of Case 2.
(a)
(b)Variation of (a) error (b) rate variation under rain influent of Case 2.
(a)
(b)


#### 4.3.2. The Performance of Activated Sludge Process

The second level of controller assessment is to investigate the effect of the ENon-PI control strategy on the process of an activated sludge. Firstly, the performances in average effluent concentrations are compared to benchmark PI and the fixedk
n, as indicated in Tables 6 and 7 for Cases 1and 2, respectively. Five main process variables including the total S
NH, Ntot, BOD5, COD, and TSS are evaluated. The limit of effluent variables can be referred in Table 3. Overall in Case 1, in spite of total COD concentration, improvement on average effluents has been observed by ENon-PI compared to benchmark PI. Obvious enhancement on the S
NH resulted by ENon-PI with adaptive k
n compared to benchmark PI under three input weathers. In particular, the improvement of S
NH is maintained by ENon-PI with adaptive k
n in Case 2. Besides, improvement on Ntot was recorded under dry and storm influents.Table 6
Average effluent concentrations for Case 1.
Dry
Rain
Storm
BenchmarkPI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
S
NH conc/mg N/L
2.5392
2.3896
2.3881
3.226
3.2041
3.1954
3.0622
3.0395
3.041
TSS conc/mg SS/L
13.0038
13.0038
13.0038
16.1768
16.175
16.1750
15.2737
15.2773
15.2724
Ntotconc/mg N/L
16.9245
16.8500
16.8505
16.9245
14.6539
14.6719
15.8676
15.7662
15.7666
Total COD conc/mg COD/L
48.2201
48.2420
48.2427
45.4337
45.4314
45.4479
47.6626
47.6631
47.6639
BOD5 conc/mg/L
2.7568
2.7615
2.7615
3.4557
3.4548
3.4557
3.2050
3.2049
3.2045Table 7
Average effluent concentrations for Case 2.
Dry
Rain
Storm
Benchmark PI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
S
NH conc/mg N/L
2.5392
2.5128
2.5126
3.226
3.2041
3.1954
3.0622
3.0395
3.0390
TSS conc/mg SS/L
13.0038
13.0058
13.0058
16.1768
16.1798
16.1750
15.2737
15.2733
15.2734
Ntotconc/mg N/L
16.9245
16.8169
16.8160
16.9245
14.6539
14.6719
15.8676
15.7672
15.7666
Total COD conc/mg COD/L
48.2201
48.2201
48.2201
45.4337
45.4314
45.4479
47.6626
47.6638
47.6639
BOD5 conc/mg/L
2.7568
2.7560
2.7560
3.4557
3.4548
3.4549
3.2050
3.2049
3.2049Next, the numbers of time that the effluent limits are not met during simulation obtained by ENon-PI for Case 1 are presented in Tables8 and 9. The number of violation of Ntot is observed under dry weather while it is extended to TSS under the storm weather. It was proved that the numbers of the effluent increases above the effluent constraints are reduced from 7 to 6 compared to benchmark PI under dry weather. In the meantime, it reduces from 7 to 5 and 2 to 1 for Ntot and TSS under storm weather condition, respectively. To clarify, the Ntot effluent violation compared to benchmark PI under dry and storm influents is shown in Figure 10.Table 8
Effluent violations under dry influent.
Benchmark PI
ENon-PI
Ntot
Days
1.2813
1.1042
%
18.3036
15.7738
Occasion
7.0000
6.0000Table 9
Effluent violations under storm influent.
Benchmark PI
ENon-PI
Ntot
Days
1.0938
0.9167
%
15.6250
13.0952
Occasion
7.0000
5.0000
TSS
Days
0.0208
0.0104
%
0.2976
0.1488
Occasion
2.0000
1.0000Effluent violations of Ntot for (a) dry (b) storm influents.
(a)
(b)Next, the average AE consumed in the process of activated sludge is illustrated in Figure11. As observed in Case 1, the AE is significantly reduced by ENon-PI with adaptive k
n compared to benchmark PI under rain and storm events where the AE is minimized by 140.3118 and 46.7117 kwh per day, respectively. Meanwhile, about 0.5474 kwh per day of AE is saved with adaptive k
n compared to fixed k
n of ENon-PI controller under storm weather which is the lowest AE consumption in Case 2. In fact, even though slight improvements were recorded by Non-PI in Case 2 but the AE is mostly better than the benchmark PI controller.Comparative of aeration energy consumed (in kWh per day) for (a) Case 1 and (b) Case 2.
(a)
(b)


## 4.1. Case 1: Controlling the DO345

The DO concentrations in tank 3, tank 4, and tank 5 are set to 1.5 mg L−1, 3 mg L−1, and 2 mg L−1, respectively, as referred to in [18]. Nevertheless, the previous work develops multivariable PID for COST simulation benchmark [19] instead of updated version [12] that is used in the present simulation. In addition, the oxygen mass transfer coefficient of DO3 (K
La
3), the oxygen mass transfer coefficient of DO4 (K
La
4), and the oxygen mass transfer coefficient of DO5 (K
La
5) are constrained to a maximum of 360 day−1. The k
n
3, k
n
4, and k
n
5 are automatically updated using AIA as described in (14)–(16). Meanwhile, the adaptive coefficients, η
3, η
4, and η
5 are set to 0.09. e
max
⁡
=
1 is applied while the proportional gains and the integral time constants of linear PI controllers are set to 25 and 0.0020, respectively.


## 4.2. Case 2: Controlling the Nitrate-DO5

The nitrate-DO5 control of the nitrogen removal process is considered in the second case. The k
n
2 and k
n
5 are automatically updated using AIA as referred to in (16)-(17). The internal recycle flow rate (Q
intr) and the K
La
5 are manipulated. To improve the nitrogen removal, the nitrate concentration is set to 1.0 gm−3 with constrained Q
intr up to 5 times of stabilized input flow rate, 92230 m3 day−1. The DO5 level is set to 2.0 gm−3 with constrained K
La
5 to a maximum of 360 day−1. The η
2 and η
5 are similarly set to 0.09 while the e
max
⁡ and the PI control gains as in Case 1 are maintained in the simulation.


## 4.3. Discussion

It is aimed to improve the performance for the set-point tracking of the load changes due to daily variations in different influents composition. As mentioned, the effectiveness of the proposed ENon-PI controller is investigated in two-level assessment, the performance of the controller and the performance of activated sludge process compared to benchmark PI.


### 4.3.1. The Performance of the Controller

The ENon-PI is first assessed by investigating the Mean(|e|), the IAE, the ISE, the Max(e), and the Std(e). As for comparison, the performance of ENon-PI with adaptive k
n is also compared to ENon-PI with fixed k
n. For this purpose, the k
n
3, k
n
4, and k
n
5 are set to 0.01 for DO345 control. Similarly k
n
5 is used for DO5 while k
n
2 is set to 0.1 for nitrate in nitrate-DO5 control. Referring to Table 4, obvious improvement is obtained in Case 1 by ENon-PI controller compared to benchmark PI controller. However, as referred to in Table 5, significant improvement is observed for nitrate compared to DO5 in Case 2. Difficulties come to control simultaneous nitrate and DO5 control loops in Case 2 that may due to different dynamic behaviours of the control parameters.Table 4
Comparative of controller performance for Case 1.
Benchmark PI
Fixedk
n
Adaptivek
n
-%
-%
Dry
Mean(
|
e
|
)
0.0840
0.0695
17.3052
0.0688
18.1381
IAE
0.5883
0.4814
18.1724
0.4813
18.1894
ISE
0.0840
0.0547
34.8616
0.0547
34.8616
Max(dev)
0.3963
0.3101
21.7532
0.3058
22.8382
Std(dev)
0.1095
0.0884
19.2915
0.0884
19.2915
Rain
Mean(
|
e
|
)
0.0795
0.0688
13.4939
0.0666
16.2601
IAE
0.5567
0.4665
16.2056
0.4665
16.2056
ISE
0.0747
0.0513
31.3556
0.0512
31.4894
Max(dev)
0.3851
0.2992
22.2958
0.2868
25.5162
Std(dev)
0.1033
0.0856
17.1506
0.0855
17.2474
Storm
Mean(
|
e
|
)
0.0809
0.0680
15.8978
0.0672
16.8872
IAE
0.5660
0.4702
16.9229
0.4701
16.9405
ISE
0.0789
0.0523
33.6934
0.0522
33.8202
Max(dev)
0.3792
0.3005
20.7626
0.2970
21.6855
Std(dev)
0.1062
0.0864
18.6057
0.0864
18.6057Table 5
Comparative of controller performance for Case 2.
Benchmark PI
Fixedk
n
Adaptivek
n
-%
-%
Dry
Nitrate
Mean(
|
e
|
)
0.2050
0.2049
0.034151
0.1760
14.13377567
IAE
1.4348
1.2319
14.14134
1.2318
14.14831335
ISE
0.5690
0.3871
31.96478
0.3862
32.12295903
Max(dev)
0.9178
0.8138
11.33338
0.8130
11.42053998
Std(dev)
0.2851
0.2341
17.88558
0.2338
17.99080992
DO5
Mean(
|
e
|
)
0.0840
0.0852
−1.37547
0.0815
3.026985865
IAE
0.5883
0.5864
0.324659
0.5707
2.993319848
ISE
0.0840
0.0863
−2.76868
0.0816
2.828222685
Max(dev)
0.3963
0.4184
−5.57392
0.4396
−10.9232671
Std(dev)
0.1095
0.1110
−1.3421
0.1095
0.027389756
Rain
Nitrate
Mean(
|
e
|
)
0.2478
0.2068
16.55907
0.2065
16.6801162
IAE
1.7349
1.4479
16.54274
1.4457
16.66954868
ISE
0.7944
0.5435
31.58014
0.5411
31.88227
Max(dev)
0.9213
0.8445
8.340026
0.8431
8.491979074
Std(dev)
0.3369
0.2783
17.38408
0.2776
17.59187793
DO5
Mean(
|
e
|
)
0.0795
0.0802
−0.83991
0.0762
4.189508625
IAE
0.5567
0.5514
0.955597
0.5338
4.116970829
ISE
0.0747
0.0763
−2.0968
0.0700
6.333212905
Max(dev)
0.3851
0.4060
−5.44085
0.4342
−12.764576
Std(dev)
0.1033
0.1034
−0.07743
0.0999
3.31010453
Storm
Nitrate
Mean(
|
e
|
)
0.2398
0.2037
15.05067
0.2033
15.21748196
IAE
1.6785
1.4257
15.06107
1.4229
15.22788204
ISE
0.7880
0.5454
30.78417
0.5417
31.25372793
Max(dev)
1.2014
0.9644
19.72699
0.9483
21.0670884
Std(dev)
0.3355
0.2788
16.89272
0.2779
17.16994068
DO5
Mean(
|
e
|
)
0.0809
0.0818
−1.17001
0.0786
2.787740866
IAE
0.5660
0.5701
−0.72794
0.5502
2.788084385
ISE
0.0789
0.0808
−2.43927
0.0763
3.265885694
Max(dev)
0.3792
0.4137
−9.08659
0.4348
−14.6503533
Std(dev)
0.1062
0.1075
−1.27179
0.1044
1.648610457The variation of output and input variables of DO345 control in Case 1 under dry input weather by ENon-PI with adaptive k
n is shown in Figure 5. It was seen that the ENon-PI controller with adaptive k
n
3, k
n
4, and k
n
5 manages well to keep DO3, DO4, and DO5 concentrations around the reference values. Besides, the input variables K
La
3, K
La
4, and K
La
5 are always kept under the upper bounds. Meanwhile, Figure 6 shows the variation of the error and the adaptation of the k
n resulted. As observed, higher k
n is demanded for a higher error resulted.Variation of (a) output and (b) input variables under dry influent of Case 1.
(a)
(b)Variation of (a) error (b) rate variation under dry influent of Case 1.
(a)
(b)The nitrate-DO5 control is then simulated with respect to benchmark PI, as applied in [12]. Figure 7 shows the comparative variation of output variables of nitrate and DO5 under rain input weather. Slight improvements are observed by ENon-PI with adaptive k
n
2 and k
n
5 for nitrate and DO5 concentrations compared to benchmark PI. Nevertheless, the improvements are obviously better than the fixed k
n. The variations of input variables of nitrate-DO5 control are next illustrated in Figure 8. Similarly, the Q
intr and K
La
5 are always kept under the upper bounds. Meanwhile, the variation of the errors and the adaptation of the rate variation resulted are illustrated in Figure 9.Variation of (a) nitrate (b) DO5 output variables under rain influent of Case 2.
(a)
(b)Variation of (a)Q
intr (b) K
La
5 input variables under rain influent of Case 2.
(a)
(b)Variation of (a) error (b) rate variation under rain influent of Case 2.
(a)
(b)


### 4.3.2. The Performance of Activated Sludge Process

The second level of controller assessment is to investigate the effect of the ENon-PI control strategy on the process of an activated sludge. Firstly, the performances in average effluent concentrations are compared to benchmark PI and the fixedk
n, as indicated in Tables 6 and 7 for Cases 1and 2, respectively. Five main process variables including the total S
NH, Ntot, BOD5, COD, and TSS are evaluated. The limit of effluent variables can be referred in Table 3. Overall in Case 1, in spite of total COD concentration, improvement on average effluents has been observed by ENon-PI compared to benchmark PI. Obvious enhancement on the S
NH resulted by ENon-PI with adaptive k
n compared to benchmark PI under three input weathers. In particular, the improvement of S
NH is maintained by ENon-PI with adaptive k
n in Case 2. Besides, improvement on Ntot was recorded under dry and storm influents.Table 6
Average effluent concentrations for Case 1.
Dry
Rain
Storm
BenchmarkPI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
S
NH conc/mg N/L
2.5392
2.3896
2.3881
3.226
3.2041
3.1954
3.0622
3.0395
3.041
TSS conc/mg SS/L
13.0038
13.0038
13.0038
16.1768
16.175
16.1750
15.2737
15.2773
15.2724
Ntotconc/mg N/L
16.9245
16.8500
16.8505
16.9245
14.6539
14.6719
15.8676
15.7662
15.7666
Total COD conc/mg COD/L
48.2201
48.2420
48.2427
45.4337
45.4314
45.4479
47.6626
47.6631
47.6639
BOD5 conc/mg/L
2.7568
2.7615
2.7615
3.4557
3.4548
3.4557
3.2050
3.2049
3.2045Table 7
Average effluent concentrations for Case 2.
Dry
Rain
Storm
Benchmark PI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
S
NH conc/mg N/L
2.5392
2.5128
2.5126
3.226
3.2041
3.1954
3.0622
3.0395
3.0390
TSS conc/mg SS/L
13.0038
13.0058
13.0058
16.1768
16.1798
16.1750
15.2737
15.2733
15.2734
Ntotconc/mg N/L
16.9245
16.8169
16.8160
16.9245
14.6539
14.6719
15.8676
15.7672
15.7666
Total COD conc/mg COD/L
48.2201
48.2201
48.2201
45.4337
45.4314
45.4479
47.6626
47.6638
47.6639
BOD5 conc/mg/L
2.7568
2.7560
2.7560
3.4557
3.4548
3.4549
3.2050
3.2049
3.2049Next, the numbers of time that the effluent limits are not met during simulation obtained by ENon-PI for Case 1 are presented in Tables8 and 9. The number of violation of Ntot is observed under dry weather while it is extended to TSS under the storm weather. It was proved that the numbers of the effluent increases above the effluent constraints are reduced from 7 to 6 compared to benchmark PI under dry weather. In the meantime, it reduces from 7 to 5 and 2 to 1 for Ntot and TSS under storm weather condition, respectively. To clarify, the Ntot effluent violation compared to benchmark PI under dry and storm influents is shown in Figure 10.Table 8
Effluent violations under dry influent.
Benchmark PI
ENon-PI
Ntot
Days
1.2813
1.1042
%
18.3036
15.7738
Occasion
7.0000
6.0000Table 9
Effluent violations under storm influent.
Benchmark PI
ENon-PI
Ntot
Days
1.0938
0.9167
%
15.6250
13.0952
Occasion
7.0000
5.0000
TSS
Days
0.0208
0.0104
%
0.2976
0.1488
Occasion
2.0000
1.0000Effluent violations of Ntot for (a) dry (b) storm influents.
(a)
(b)Next, the average AE consumed in the process of activated sludge is illustrated in Figure11. As observed in Case 1, the AE is significantly reduced by ENon-PI with adaptive k
n compared to benchmark PI under rain and storm events where the AE is minimized by 140.3118 and 46.7117 kwh per day, respectively. Meanwhile, about 0.5474 kwh per day of AE is saved with adaptive k
n compared to fixed k
n of ENon-PI controller under storm weather which is the lowest AE consumption in Case 2. In fact, even though slight improvements were recorded by Non-PI in Case 2 but the AE is mostly better than the benchmark PI controller.Comparative of aeration energy consumed (in kWh per day) for (a) Case 1 and (b) Case 2.
(a)
(b)


## 4.3.1. The Performance of the Controller

The ENon-PI is first assessed by investigating the Mean(|e|), the IAE, the ISE, the Max(e), and the Std(e). As for comparison, the performance of ENon-PI with adaptive k
n is also compared to ENon-PI with fixed k
n. For this purpose, the k
n
3, k
n
4, and k
n
5 are set to 0.01 for DO345 control. Similarly k
n
5 is used for DO5 while k
n
2 is set to 0.1 for nitrate in nitrate-DO5 control. Referring to Table 4, obvious improvement is obtained in Case 1 by ENon-PI controller compared to benchmark PI controller. However, as referred to in Table 5, significant improvement is observed for nitrate compared to DO5 in Case 2. Difficulties come to control simultaneous nitrate and DO5 control loops in Case 2 that may due to different dynamic behaviours of the control parameters.Table 4
Comparative of controller performance for Case 1.
Benchmark PI
Fixedk
n
Adaptivek
n
-%
-%
Dry
Mean(
|
e
|
)
0.0840
0.0695
17.3052
0.0688
18.1381
IAE
0.5883
0.4814
18.1724
0.4813
18.1894
ISE
0.0840
0.0547
34.8616
0.0547
34.8616
Max(dev)
0.3963
0.3101
21.7532
0.3058
22.8382
Std(dev)
0.1095
0.0884
19.2915
0.0884
19.2915
Rain
Mean(
|
e
|
)
0.0795
0.0688
13.4939
0.0666
16.2601
IAE
0.5567
0.4665
16.2056
0.4665
16.2056
ISE
0.0747
0.0513
31.3556
0.0512
31.4894
Max(dev)
0.3851
0.2992
22.2958
0.2868
25.5162
Std(dev)
0.1033
0.0856
17.1506
0.0855
17.2474
Storm
Mean(
|
e
|
)
0.0809
0.0680
15.8978
0.0672
16.8872
IAE
0.5660
0.4702
16.9229
0.4701
16.9405
ISE
0.0789
0.0523
33.6934
0.0522
33.8202
Max(dev)
0.3792
0.3005
20.7626
0.2970
21.6855
Std(dev)
0.1062
0.0864
18.6057
0.0864
18.6057Table 5
Comparative of controller performance for Case 2.
Benchmark PI
Fixedk
n
Adaptivek
n
-%
-%
Dry
Nitrate
Mean(
|
e
|
)
0.2050
0.2049
0.034151
0.1760
14.13377567
IAE
1.4348
1.2319
14.14134
1.2318
14.14831335
ISE
0.5690
0.3871
31.96478
0.3862
32.12295903
Max(dev)
0.9178
0.8138
11.33338
0.8130
11.42053998
Std(dev)
0.2851
0.2341
17.88558
0.2338
17.99080992
DO5
Mean(
|
e
|
)
0.0840
0.0852
−1.37547
0.0815
3.026985865
IAE
0.5883
0.5864
0.324659
0.5707
2.993319848
ISE
0.0840
0.0863
−2.76868
0.0816
2.828222685
Max(dev)
0.3963
0.4184
−5.57392
0.4396
−10.9232671
Std(dev)
0.1095
0.1110
−1.3421
0.1095
0.027389756
Rain
Nitrate
Mean(
|
e
|
)
0.2478
0.2068
16.55907
0.2065
16.6801162
IAE
1.7349
1.4479
16.54274
1.4457
16.66954868
ISE
0.7944
0.5435
31.58014
0.5411
31.88227
Max(dev)
0.9213
0.8445
8.340026
0.8431
8.491979074
Std(dev)
0.3369
0.2783
17.38408
0.2776
17.59187793
DO5
Mean(
|
e
|
)
0.0795
0.0802
−0.83991
0.0762
4.189508625
IAE
0.5567
0.5514
0.955597
0.5338
4.116970829
ISE
0.0747
0.0763
−2.0968
0.0700
6.333212905
Max(dev)
0.3851
0.4060
−5.44085
0.4342
−12.764576
Std(dev)
0.1033
0.1034
−0.07743
0.0999
3.31010453
Storm
Nitrate
Mean(
|
e
|
)
0.2398
0.2037
15.05067
0.2033
15.21748196
IAE
1.6785
1.4257
15.06107
1.4229
15.22788204
ISE
0.7880
0.5454
30.78417
0.5417
31.25372793
Max(dev)
1.2014
0.9644
19.72699
0.9483
21.0670884
Std(dev)
0.3355
0.2788
16.89272
0.2779
17.16994068
DO5
Mean(
|
e
|
)
0.0809
0.0818
−1.17001
0.0786
2.787740866
IAE
0.5660
0.5701
−0.72794
0.5502
2.788084385
ISE
0.0789
0.0808
−2.43927
0.0763
3.265885694
Max(dev)
0.3792
0.4137
−9.08659
0.4348
−14.6503533
Std(dev)
0.1062
0.1075
−1.27179
0.1044
1.648610457The variation of output and input variables of DO345 control in Case 1 under dry input weather by ENon-PI with adaptive k
n is shown in Figure 5. It was seen that the ENon-PI controller with adaptive k
n
3, k
n
4, and k
n
5 manages well to keep DO3, DO4, and DO5 concentrations around the reference values. Besides, the input variables K
La
3, K
La
4, and K
La
5 are always kept under the upper bounds. Meanwhile, Figure 6 shows the variation of the error and the adaptation of the k
n resulted. As observed, higher k
n is demanded for a higher error resulted.Variation of (a) output and (b) input variables under dry influent of Case 1.
(a)
(b)Variation of (a) error (b) rate variation under dry influent of Case 1.
(a)
(b)The nitrate-DO5 control is then simulated with respect to benchmark PI, as applied in [12]. Figure 7 shows the comparative variation of output variables of nitrate and DO5 under rain input weather. Slight improvements are observed by ENon-PI with adaptive k
n
2 and k
n
5 for nitrate and DO5 concentrations compared to benchmark PI. Nevertheless, the improvements are obviously better than the fixed k
n. The variations of input variables of nitrate-DO5 control are next illustrated in Figure 8. Similarly, the Q
intr and K
La
5 are always kept under the upper bounds. Meanwhile, the variation of the errors and the adaptation of the rate variation resulted are illustrated in Figure 9.Variation of (a) nitrate (b) DO5 output variables under rain influent of Case 2.
(a)
(b)Variation of (a)Q
intr (b) K
La
5 input variables under rain influent of Case 2.
(a)
(b)Variation of (a) error (b) rate variation under rain influent of Case 2.
(a)
(b)


## 4.3.2. The Performance of Activated Sludge Process

The second level of controller assessment is to investigate the effect of the ENon-PI control strategy on the process of an activated sludge. Firstly, the performances in average effluent concentrations are compared to benchmark PI and the fixedk
n, as indicated in Tables 6 and 7 for Cases 1and 2, respectively. Five main process variables including the total S
NH, Ntot, BOD5, COD, and TSS are evaluated. The limit of effluent variables can be referred in Table 3. Overall in Case 1, in spite of total COD concentration, improvement on average effluents has been observed by ENon-PI compared to benchmark PI. Obvious enhancement on the S
NH resulted by ENon-PI with adaptive k
n compared to benchmark PI under three input weathers. In particular, the improvement of S
NH is maintained by ENon-PI with adaptive k
n in Case 2. Besides, improvement on Ntot was recorded under dry and storm influents.Table 6
Average effluent concentrations for Case 1.
Dry
Rain
Storm
BenchmarkPI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
S
NH conc/mg N/L
2.5392
2.3896
2.3881
3.226
3.2041
3.1954
3.0622
3.0395
3.041
TSS conc/mg SS/L
13.0038
13.0038
13.0038
16.1768
16.175
16.1750
15.2737
15.2773
15.2724
Ntotconc/mg N/L
16.9245
16.8500
16.8505
16.9245
14.6539
14.6719
15.8676
15.7662
15.7666
Total COD conc/mg COD/L
48.2201
48.2420
48.2427
45.4337
45.4314
45.4479
47.6626
47.6631
47.6639
BOD5 conc/mg/L
2.7568
2.7615
2.7615
3.4557
3.4548
3.4557
3.2050
3.2049
3.2045Table 7
Average effluent concentrations for Case 2.
Dry
Rain
Storm
Benchmark PI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
BenchmarkPI
Fixed
k
n
Adaptive
k
n
S
NH conc/mg N/L
2.5392
2.5128
2.5126
3.226
3.2041
3.1954
3.0622
3.0395
3.0390
TSS conc/mg SS/L
13.0038
13.0058
13.0058
16.1768
16.1798
16.1750
15.2737
15.2733
15.2734
Ntotconc/mg N/L
16.9245
16.8169
16.8160
16.9245
14.6539
14.6719
15.8676
15.7672
15.7666
Total COD conc/mg COD/L
48.2201
48.2201
48.2201
45.4337
45.4314
45.4479
47.6626
47.6638
47.6639
BOD5 conc/mg/L
2.7568
2.7560
2.7560
3.4557
3.4548
3.4549
3.2050
3.2049
3.2049Next, the numbers of time that the effluent limits are not met during simulation obtained by ENon-PI for Case 1 are presented in Tables8 and 9. The number of violation of Ntot is observed under dry weather while it is extended to TSS under the storm weather. It was proved that the numbers of the effluent increases above the effluent constraints are reduced from 7 to 6 compared to benchmark PI under dry weather. In the meantime, it reduces from 7 to 5 and 2 to 1 for Ntot and TSS under storm weather condition, respectively. To clarify, the Ntot effluent violation compared to benchmark PI under dry and storm influents is shown in Figure 10.Table 8
Effluent violations under dry influent.
Benchmark PI
ENon-PI
Ntot
Days
1.2813
1.1042
%
18.3036
15.7738
Occasion
7.0000
6.0000Table 9
Effluent violations under storm influent.
Benchmark PI
ENon-PI
Ntot
Days
1.0938
0.9167
%
15.6250
13.0952
Occasion
7.0000
5.0000
TSS
Days
0.0208
0.0104
%
0.2976
0.1488
Occasion
2.0000
1.0000Effluent violations of Ntot for (a) dry (b) storm influents.
(a)
(b)Next, the average AE consumed in the process of activated sludge is illustrated in Figure11. As observed in Case 1, the AE is significantly reduced by ENon-PI with adaptive k
n compared to benchmark PI under rain and storm events where the AE is minimized by 140.3118 and 46.7117 kwh per day, respectively. Meanwhile, about 0.5474 kwh per day of AE is saved with adaptive k
n compared to fixed k
n of ENon-PI controller under storm weather which is the lowest AE consumption in Case 2. In fact, even though slight improvements were recorded by Non-PI in Case 2 but the AE is mostly better than the benchmark PI controller.Comparative of aeration energy consumed (in kWh per day) for (a) Case 1 and (b) Case 2.
(a)
(b)


## 5. Conclusion

The aim of this paper is to design a simple but effective controller so that the performance of activated sludge process DO concentration control (Case 1) and the nitrogen removal (Case 2) of the WWTP are improved. For this work, the enhanced nonlinear PI (ENon-PI) controller is designed in which the conventional fixed-gain PI controller is incorporated with the bounded nonlinear function as to compensate the nonlinearity of the WWTP. The characteristic of the rate variation,k
n, is manipulated and automatically adapted based on adaptive interaction algorithm for a wide range of nonlinear gain.From simulation, significant improvement is proved for DO345 control by ENon-PI compared to benchmark PI. Notice that the Case 1 deals with similar dynamic behaviors of DO concentrations, thus it easier to be controlled. In contrast, difficulties to control the simultaneous nitrate and DO5 concentrations for Case 2 are undeniable due to different natures of both control parameters. Even though slight improvements were recorded by Non-PI in Case 2 but it is mostly better than the benchmark PI controller.The effectiveness to simplify the ENon-PI control structure with adaptivek
n has been proved with significant improvement on both case studies. The performance comparison indicates that the proposed ENon-PI yields the most accurate strategy to control the DO concentration and the nitrogen removal process. For DO345 control, obvious improvement resulted where about 34.86%, 31.4894%, and 33.8202% of ISE are reduced compared to benchmark PI under dry, rain, and storm weathers, respectively. Again, more than 30% of ISE is reduced under three dynamic influent weathers, specifically for nitrate in nitrogen removal control. Meanwhile, more than 14% of IAE is reduced both simulation cases. Better average effluent concentrations and less number of the effluent violations resulted. Besides, lower average aeration energy is consumed specifically under rain and storm influents for DO345 control and in nitrate removal process, respectively. The proposed ENon-PI shows benefit for simple and practical implementation in controlling various dynamic natures of the activated sludge process.



---

*Source: 475053-2014-09-25.xml*