Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

x21 20/4/01 8:10 am Page 175

Advanced monitoring and control of anaerobic wastewater

Water Science and Technology Vol 43 No 7 pp 175–182 © 2001 IWA Publishing and the authors
treatment plants: software sensors and controllers for an
anaerobic digester
O. Bernard*, M. Polit**, Z. Hadj-Sadok*, M. Pengov***, D. Dochain****, M. Estaben** and
P. Labat**
*INRIA, COMORE Project, BP93, 06902 Sophia-Antipolis Cedex, France
**Laboratoire de Physique Appliquée et d’automatique, Université de Perpignan, 52 av. de Villeneuve,
66860 Perpignan, France
***Centre de Robotique, ENSMP, 60 bld St-Michel, 75272 Paris, France
****CESAME, UCL, Bât. Euler, Av. G. Lemaître, 4-6, 1348, Louvain-La-Neuve, Belgium

Abstract A mass balanced based model representing the dynamical behaviour of anaerobic digester has
served as a basis for the design of software sensors for the concentration of inorganic carbon, alkalinity and
volatile fatty acids. The predictions of the sensors are close to the actual off-line measurements. The model
has also been used to design a model-based adaptive linearizing controller and a fuzzy controller whose
objective is to regulate the ratio of the intermediate alkalinity over the total alkalinity below some desired value
(0.3) under which the process is assumed to remain in stable conditions and avoid VFA accumulation. Both
controllers were calibrated via extensive numerical simulations and implemented. The controllers proved
successful in maintaining the ratio of TA over PA below 0.3, even in presence of large variations of the
organic load.
Keywords Asymptotic observers; anaerobic digestion; fuzzy control; adaptive linearizing control

Introduction
Anaerobic wastewater treatment plants can become unstable under certain circumstances.
Here we propose a feedback control loop to overcome this drawback. The anaerobic
process is known to be very sensitive to the alkalinity of the medium, and therefore to sta-
bilise the process we develop controllers that regulate its alkalinity. More precisely the con-
troller objective is to regulate the ratio of the intermediate alkalinity (IA) over the total
alkalinity (TA) below some desired value (0.3) under which the process is assumed to
remain in stable conditions and avoid volatile fatty acids (VFA) accumulation. Two differ-
ent approaches are considered. The first approach is based on a mass balance model
(Bernard et al., 2000). The model has been first used to design a software sensor that com-
putes the concentration of COD, inorganic carbon, alkalinity and VFA in the digester. We
use the predictions of this software sensor to design an adaptive linearizing controller. We
compare this controller with a fuzzy controller based on a set of fuzzy rules.

Design of the software sensors


Mass conservation
From the model presented in (Bernard et al., 2000), a linear combination of equations can
lead to mass conservation equations independent of the bacterial growth kinetics. We
consider thus the following auxiliary variables:
z1 = Z , z2 = S2 − k2 CT / k4 , z3 = S1 + k1 S2 / k2 (1)

From the model, we readily obtain: 175

Downloaded from https://iwaponline.com/wst/article-pdf/43/7/175/429874/175.pdf


by UNIVERSITE PIERRE ET MARIE CURIE user
on 22 August 2018
x21 20/4/01 8:10 am Page 176

= D( z1in − z1 )
dz1
(2)
dt
k k k 
= D( z2in − z2 ) −  2 3 + 3  QCH 4 + 3 QCO 2
dz2 k (3)
dt  k4 k6 k6  k6

= D( z3in − z3 ) − 1 3 QCH 4
dz3 kk (4)
dt k2 k6
O. Bernard et al.

where
k2 k
z1in = Zin , z2in = S2in − CTlin , z3in = S1in + T S2in (5)
k4 k2

Mass balance based software sensors


The auxiliary variables z1, z2 and z3 can now be asymptotically estimated (Bastin and
Dochain, 1990). The estimates are obtained by simply replacing the zi in (2), (3) and (4)
with the variables ẑ1, ẑ2, ẑ3 that denote the estimate of the auxiliary variable z1, z2 and z3
respectively. It is then easy to prove that the convergence rate of the zis toward the zis is the
dilution rate D. The variables can now be used to estimate online the inorganic carbon CTI
and the substrates S1 and S2 from the gas measurements:
zˆ1 − zˆ2
Cˆ Tl = , Sˆ2 = zˆ1 − f B ( pH )Cˆ Tl ,
( 2 4 ) + f B ( pH)
k / k
k
Sˆ1 = zˆ3 − 1 Sˆ2 , Bˆ = f B ( pH )Cˆ Tl , Zˆ = zˆ1 (6)
k2
The dissociation ratio of the total inorganic carbon is given by:
f B ( pH ) = 1 / (1 + 10 pH − pK b ) (7)

Figure 1 Software sensor predictions for COD, VFA, total alkalinity Z and bicarbonate B on the pilot plant.
176 The predictions (– – –) are compared with the real-life data

Downloaded from https://iwaponline.com/wst/article-pdf/43/7/175/429874/175.pdf


by UNIVERSITE PIERRE ET MARIE CURIE user
on 22 August 2018
x21 20/4/01 8:10 am Page 177

Note that the VFA corresponds to the intermediate alkalinity (IA) and Z to the total
alkalinity (TA).

Calibration and validation of the software sensor


Figure 1 gives the estimation results for the pilot digester at the LBE, INRA (Narbonne,
France). Note that the estimations of S1, S2, B and Z are quite reliable, even if they are based
on gas measurements and even if the design of the observers is based on a very simplified

O. Bernard et al.
model of the process.

Control of the alkalinity


Control objectives
The alkalinity should be maintained in the following range in order to guarantee the
stability of the process:
IA / TA ≤ 0.3 and TA ≥ 3 g / l (8)

The control actions will be the addition of alkalinity in the influent and the influent flow rate.

Design of the linearizing control law


In a first approach, we develop a linearizing controller. In order to have a system whose
variables correspond to the variables to be controlled, we consider the following change of
coordinates:
x x 1 S S C
w1 = 1 , w2 = 2 , w3 = , w4 = 1 , w5 = 2 , w6 = Tl (9)
Z Z Z Z Z Z
Then we get the following equation:
dw5 S Z  k q
= D 2in − w5 in + k2 µ w1 − 3 M (10)
dt  Z Z  k6 Z
In these new coordinates, the control objectives are the following:
w5 ≤ 0.3 and w3 ≤ 0.3333 l / g (11)

In fact this control problem can be decoupled in two control problems: as the dynamics of Z
is very simple, it is trivial to achieve the desired alkalinity in the fermenter, indeed we just
have to adjust Zin to the objective value Z*. Then we have to control w5 to the desired value
w5*. Our closed-loop dynamics objective is to assign the dynamics of w5 as follows:

dw5
dt
(
= λ w5∗ − w5 , λ > 0) (12)

where λ is a parameter that help to tune the convergence rate of the controller. By combin-
ing the dynamical equation in w5 and the desired closed-loop dynamics (12), we obtain then
the following control law:

D=
( )
λZ w5∗ − w5 + k3 qM / k6 − k2 µ1 X1 (13)
S2in − w3 Zin
Because the control law tends to force a linear closed loop dynamics (12) to the nonlinear
process, the control law is called a linearizing control law (see Bastin and Dochain, 1990,
Dochain and Perrier, 1993 and Perrier and Dochain, 1993). One way to eliminate X1 (which
is not measured on line) and µ1 (which is basically unknown or at least largely uncertain) is
to consider a quasi steady-state (QSS) approximation for the mass balance equation of the
organic substrate S1. This gives the following algebraic equation:
1
µ1 X1 = ( DS1in − S1 ) (14)
k1 177

Downloaded from https://iwaponline.com/wst/article-pdf/43/7/175/429874/175.pdf


by UNIVERSITE PIERRE ET MARIE CURIE user
on 22 August 2018
x21 20/4/01 8:10 am Page 178

Then the linearizing control law (13) becomes:

D=
( )
λZ w5∗ − w5 + k3 qM / k6
(15)
S2in − w5 Zin + k2 / k1 ( S1in − S1 )
Note that this control law can reach values higher than the dilution rate, which was applied
a priori. This control law has been tested in numerical simulations. It turns out to be
efficient, and fast enough to be applied in practice.
O. Bernard et al.

Practical version of the linearizing control law


The practical implementation of the control law derived requires a number of modifications
in order to guarantee its robust behaviour with respect to the uncertainty concerning the
knowledge of the process dynamics and the uncertainty concerning the measurements of
the process variables. The first important modification consists of introducing an adapta-
tion mechanism. This is done in order to adapt the model dynamics considered for the con-
trol action (the dynamical equation in w5) to its true dynamics. This is performed by
estimating on line the process parameter that plays an important role, θ = k3/k6, as follows:

dθˆ
= C1 ( w5∗ − w5 ), C1 > 0 (16)
dt
This estimation approach is known as a Lyapunov-based approach (see e.g. Bastin and
Dochain, 1990). In practice, the choice of C̄1 depends on the value of the methane gas flow
rate qM as follows:

C1
C1 = , C1 > 0 (17)
qM
This allows us to have closed-loop dynamics of the whole system (process + controller
(15)(16)) independent of the state of the process (see Perrier and Dochain, 1993). Besides the
advantage of estimating a physical parameter (the ratio of the yield coefficients k3 and k6), the
above adaptation mechanism introduces an integral which is essential to guarantee zero
steady-state error of the closed-loop system. The second important modification of the control
law consists of replacing the value of S1 by an estimate, typically that given by the asymptotic
observer (S2 and Z are measured on-line). Another important feature of the practical imple-
mentation of the controller is the limitation of the control action when the value of w5 is taking
larger values than w5*, above a certain limit (chosen here equal to 0.01). The implementation of
the control law includes an anti-windup in order to avoid oscillations due to the integral action
when the control input reaches its bounds (i.e. 0 or the maximum influent flow rate). Finally the
control algorithm software includes a number of test about the different variables in order to
prevent undesired or absurd behaviour of the control system. It is essential to note that the
design of the controller induces in essence a lot of flexibility in its implementation, depending
on the quality of information concerning e.g. the measurement of the influent load and flow
rate. The controller has been calibrated and validated via extensive numerical simulations.

The fuzzy controller


The fuzzy controller will act on the input flow rate. It has two inputs, total alkalinity (alct)
and alkalinity ratio (rapalc) and one output, influent flow rate (Qin). It corresponds to a
Matlab® file and has a Mamdani (1975) structure.

The input fuzzy subsets: the input fuzzy subsets have 3 parts, 2 trapeziums and one triangle
(Figure 3). Their bounds were defined with experimental data and function of the aims of
178 the controller. The inputs are combined with an “and” operator (min).

Downloaded from https://iwaponline.com/wst/article-pdf/43/7/175/429874/175.pdf


by UNIVERSITE PIERRE ET MARIE CURIE user
on 22 August 2018
x21 20/4/01 8:10 am Page 179

O. Bernard et al.
Figure 3 Membership functions for the total alkalinity, alct (left) and for the alkalinity ratio, rapalc (right)

Figure 4 Fuzzy subsets for the dilution rate Ω

The fuzzy subset for the output: the controller computes the influent flow rate Qin to be
applied. This value is obtained, from the set point value as follows:
Qin = Qin + Ω ( alct, rapalc)
The fuzzy subsets for the fuzzy dilution rate function Ω(alct, rapalc) are depicted on Figure
4. There are 3 triangles and 2 trapeziums. The fuzzy rules are aggregated with the “or” oper-
ator (max). The final result is obtained calculating the centroid of the output.

Fuzzy rule table: the fuzzy rules are the following

If (alct is TS) and (rapalc is OK) then (dilution rate is +)


If (alct is OK) and (rapalc is OK) then (dilution rate is ZE)
If (alct is TH) and (rapalc is OK) then (dilution rate is –)
If (alct is TS) and (rapalc is TS) then (dilution rate is ++)
If (alct is OK) and (rapalc is TS) then (dilution rate is +)
If (alct is TH) and (rapalc is TS) then (dilution rate is +)
If (alct is TS) and (rapalc is TH) then (dilution rate is –)
If (alct is OK) and (rapalc is TH) then (dilution rate is –)
If (alct is TH) and (rapalc is TH) then (dilution rate is –)

The fuzzy controller was first calibrated using extensive numerical simulations, and then
applied to the real processes (pilot scale). 179

Downloaded from https://iwaponline.com/wst/article-pdf/43/7/175/429874/175.pdf


by UNIVERSITE PIERRE ET MARIE CURIE user
on 22 August 2018
x21 20/4/01 8:10 am Page 180

Experimental results
The adaptive linearizing controller has been successfully implemented on the pilot plant in
Narbonne. Figure 2 presents one set of control results. The figure compares open-loop
(without control) results and closed-loop (with the adaptive linearizing controller) results.
During both experiments (open loop, and closed loop), the organic load have been changed
several times, between 5 and 20 gCOD/l: this corresponds, in particular, to an increase to
20 gCOD/l, to variations that can possibly induce acid accumulation and process instability
O. Bernard et al.

in open loop. Note in particular that the ratio IA/TA is always below 0.3 with the adaptive
linearizing controller, while it grew to values larger than 0.5 in open loop. This corresponds
to an accumulation of VFA in open loop: these have reached a value larger than 2.5 meq/l.
The VFA remained always below 1.5 meq/l in closed loop with the adaptive linearizing
controller. This illustrates the ability of the designed controller to maintain the process in
stable conditions even in presence of the varying organic load.
The results obtained with the fuzzy controller are on the Figure 5. In every situation the
fuzzy controller maintained the alkalinity ratio below 0.3 (in fact at 0.2) and the total alka-
linity between 50 and 80 meq/l. The problems that can occur concern the alkalinity meas-
urements (see for example t = 5640 h.). If the values are false (in term of fault coming from

180 Figure 2 Control of the ratio of the intermediate alkalinity over the total alkalinity on the pilot plant

Downloaded from https://iwaponline.com/wst/article-pdf/43/7/175/429874/175.pdf


by UNIVERSITE PIERRE ET MARIE CURIE user
on 22 August 2018
x21 20/4/01 8:10 am Page 181

O. Bernard et al.

Figure 5 Results obtained with the fuzzy controller

the sensor for example), the controller will calculate a false value. In this situation, the Fault
Detection System has to detect and to solve the problem.

Discussion
Both controllers (adaptive linearizing controller and fuzzy controller) proved to exhibit
good performances on the pilot plant. The merits and drawbacks of both controllers can
indeed be summarized as follows. One of the basic feature of the structure of the fuzzy con-
troller is its simplicity: it is therefore well adapted in situations when only rough knowledge
about the process dynamics is available. However it has the disadvantage to require the
knowledge of the mean value of the influent flow rate Q¯in: good performance may depend
on the quality of the knowledge concerning this value. One of the main merit of the adaptive
linearizing controller is its flexibility: its design is based on a “physical” (mass balance)
model, yet the implementation may consider different level depending on the knowledge
about the process dynamics. For instance, the feedforward term with respect to the influent 181

Downloaded from https://iwaponline.com/wst/article-pdf/43/7/175/429874/175.pdf


by UNIVERSITE PIERRE ET MARIE CURIE user
on 22 August 2018
x21 20/4/01 8:10 am Page 182

concentration Sin can be set to a constant value if Sin is not accessible for on-line measure-
ment. Similarly, good knowledge about the process kinetics (typically, in case of the exis-
tence of a reliable model for the specific growth rate, the control law can be easily modified
to include it). Obviously, the main drawback comes its model-based structure: the worse
the model, the worse the control performance. It is also true that one can expect better
dynamical performance from a controller as long as the dynamical model on which it is
based is reliable, or more precisely for operating conditions for which it is reliable.
O. Bernard et al.

Therefore the dynamical model development can be a critical issue with that respect.

Conclusion
The tests performed on the observers and on the two types of controllers have shown that in
the two kinds of digesters (pilot and industrial size), the results are quite reliable. For the
controllers, they are together able to maintain the process in stable conditions even in pres-
ence of the varying organic load. The choice between the two controllers will be imposed
by the situation, the decision being taken by the supervisor system. Particularly, this deci-
sion will take into account the working of the sensor of alkalinity and also the validity range
of the model used for the adaptive controller.

Acknowledgements
This work was founded by the Belgian Programme on Interuniversity Poles of Attraction
initiated by the Belgian State, Prime Minister’s Office for Science, Technology and
Culture, the CNRS and the European Commission through the Project FAIR-CT 96-1198
(AMOCO). The scientific responsibility rests with its authors.

References
Bastin, G. and Dochain, D. (1990). On-line Estimation and Adaptive Control of Bioreactors, Elsevier,
Amsterdam.
Bernard O., Hadj-Sadok, Z. and Dochain, D (2000), Advanced monitoring and control of anaerobic
wastewater treatment plants: II. Dynamical model development and identification. Preprint of
Watermatex 2000, 3.57–3.64.
Dochain, D. and Perrier, M. (1993).Control design for nonlinear wastewater treatment processes. Wat. Sci.
Tech., 28(11–12), 283–293.
Graef S.P. and J.F. Andrews (1974), Mathematical modeling and control of anaerobic digestion. AIChE
Symp. Series, Water 1973, G.F. Benett (ed.). 70 (136), 101–131.
Perrier, M. and Dochain, D. (1993). Evaluation of control strategies for anaerobic digestion processes.
Int. J. Adaptive Cont. Signal Proc., 7(4), 309–321.
Mamdani, E. (1975). An experiment in linguistic synthesis with a fuzzy logic controller. Int. J. on Man
Machine Studies, 7, 1–13.

182

Downloaded from https://iwaponline.com/wst/article-pdf/43/7/175/429874/175.pdf


by UNIVERSITE PIERRE ET MARIE CURIE user
on 22 August 2018

You might also like