## Abstract

This paper is aimed at designing a class of model based extremum-seeking feedback controllers (ESC) for the on-line optimization of biomethane production rate in continuous anaerobic digestion (AD) processes. The ESC scheme is based on the modelling error compensation approach coupled with a first-order gradient estimator. The feedback control law is able to keep the concentration of volatile fatty acids (VFAs) near the unknown optimal setpoint while the methane production rate is maximized. Unlike other ESC algorithms applied to AD processes, the proposed control scheme includes a continuous uncertain estimator and avoids excessive oscillations in the control action. Numerical simulations compare the performance of the proposed ESC controller with traditional perturbation-based and sliding mode based approaches.

## INTRODUCTION

Anaerobic digestion (AD) consists of a chain of parallel and sequential biochemical processes where organic matter is degraded into a methane-rich biogas in an oxygen-free environment. The process is a well-known wastewater treatment technology for rich organic matter effluents. Over the last decades, AD has gained attention due to its high potential as a sustainable energy source (Zhang *et al.* 2016). In fact, to privilege the biomethane production in a safe way is one of the targets for the optimization of AD performance (Weiland 2010). However, the implementation of large-scale biogas plants has been limited due to severe problems in achieving stable operating conditions (Zhang *et al.* 2016). It is well known that the accumulation of volatile fatty acids (VFAs) into the digester induces the inhibition of methanogenic bacteria growth rate and leads to the acidification of the process (Méndez-Acosta *et al.* 2008; Nguyen *et al.* 2015). In this framework, the control of the VFAs concentration is very important in order to maintain a good balance between the different stages of the process and to improve the methane production rate. The main issue is that the optimal value of the VFAs concentration is unknown and depends on different factors like the external disturbances of the AD process, such as fluctuations in the influent composition, pH and temperature (Nguyen *et al.* 2015). One alternative to address this objective is to design robust control schemes able to reach unknown optimal set-points despite the uncertainty in the mathematical model and external disturbances of the system. Extremum-seeking control techniques (ESC) are a class of real-time optimization tools aimed at finding operating set-points in order to maximize (or minimize) an uncertain objective function (Ariyur & Krstic 2003; Dochain *et al.* 2011). The design of ESC schemes for the on-line optimization of the AD process has been reported in the literature covering different approaches from conventional perturbation-based ESC to adaptive and sliding mode based schemes (Wang *et al.* 1999; Dochain *et al.* 2011; Lara-Cisneros *et al.* 2015; Meraz *et al.* 2016; Barbu *et al.* 2017; Caraman *et al.* 2017). However, a common drawback in the implementation of existing ESC schemes is the excessive oscillations in the controlled system associated with supplementary effort of the command action (control input) and the actuator elements like valves and pumps of the process.

In this paper, a model-based ESC scheme is designed for the real-time optimization of biomethane production in continuous AD process. The controller is based on a modelling error estimation technique coupled with a first-order gradient estimator. Unlike previous ESC approaches, the proposed controller consists of a dynamical uncertain estimator that computes unknown terms, ensuring robustness for the controlled system despite unmodelled dynamics and external disturbances, and does not make use of continuous perturbation signals for achieving closed-loop convergence around the optimal operating conditions. In the rest of the paper, the control design methodology is presented and numerical simulations illustrate the performance of the proposed ESC scheme and compare it with traditional perturbation-based and sliding mode based approaches.

## CONTROLLER DESIGN

The control objective considered in this work is to keep the VFAs concentration close to an optimal unknown value while the methane production rate is maximized. For the control design purposes, it is assumed that the concentration of the VFAs and the methane outflow rate are available for on-line measurement. The design of the ESC scheme proceeds in two steps. First, we assume that all terms and parameters of the mathematical model for the AD are well known; consequently, an ‘ideal’ ESC control law is derived. Next, the assumption of the perfectly known mathematical model is relaxed by design a modelling-error compensation and a first-order gradient estimator. Finally, a robust ESC scheme is presented.

*et al.*(2001) is considered.

*S*is the concentration of organic biodegradable substrate (total soluble chemical oxygen demand (COD) except VFAs) and

_{1}*S*represent the concentration of VFAs;

_{2}*X*

_{1}and

*X*

_{2}represents the concentration for the acidogenic and methanogenic microorganisms. The specific growth rates for the acidogenesis and methanogenesis stages are given by Monod and Haldane kinetic expressions, respectively. The dilution rate

*D*is considered as the control action while

*S*

_{1f}and

*S*

_{2f}are the influent concentrations of

*S*and

_{1}*S*respectively. The

_{2},*k*with

_{i}*i*

*=*

*1,2,3,4*are yield coefficients and the parameter

*α*∈

*[0,1]*is related to the fraction of bacterial not-attached onto a support. The outflow rate of methane in the gaseous phase

*Q*is proportional to the methanogenic population growth rate (Bernard

_{M}*et al.*2001):

*S*) at the optimal unknown set-point, we propose the following ideal feedback control law:where

_{2}*K*is a positive control gain and

_{C}*σ*is the gradient of the outflow rate of methane

*Q*with respect to the VFAs concentration, defined as:

_{M}The control law (3) is based on an input-output linearizing method, which means that the control law is designed such that the closed-loop dynamics are characterized by linear dynamics (Isidori 1995). In this way, it is possible to show that the control law (3) is able to regulate the concentration of VFAs at the optimal set-point while the outflow rate of methane *Q _{M}* is maximized (see Meraz

*et al.*2016; Lara-Cisneros

*et al.*2019). However, the ESC control law (3) requires exact knowledge of the following:

- (i)
The growth kinetic expressions for the acetogenesis and methanogenesis processes and the yield coefficients (

*k*_{i}). - (ii)
The gradient defined in (4).

- (iii)
The exact value for the influent concentration of VFAs (

*S*_{2f}).

*et al.*2016; Lara-Cisneros

*et al.*2019). First, we assume that the influent composition

*S*

_{2f}is an uncertain function varying around a nominal value; that is, , with a known constant such that it provides a nominal value of the influent concentration, and an uncertain fluctuation in the composition of the influent feedstock. Now a function for grouping the uncertain terms in the control law (3) is defined as:

*η*can be estimated by the following extended high-gain observerwhere denotes the estimate for VFAs concentration and the uncertainty function

*η*, respectively. The observer parameters

*κ*

_{1}and

*κ*

_{2}are chosen such that the polynomial is Hurwitz and

*L*>

*0*is a positive high-gain observer (Alvarez-Ramírez 1999).

*σ*from the on-line measurable signals, we consider the following. First, since the gradient is defined as then we can obtain a good approximation as (see Meraz

*et al.*2016; Lara-Cisneros

*et al.*2019). Now, from the technique proposed in Berghuis & Nijmeijer (1993) to get an estimate of the velocity using only the position measurements in electromechanical systems, the following gradient estimation scheme based on first-order compensators is proposed. In this sense, let us denote the time derivatives of

*S*and

_{2}*Q*by

_{M}*δ S*and

*δ Q*, respectively. Then in the spirit of the works of Berghuis & Nijmeijer (1993) and Meraz

*et al.*(2016), approximate values of the time derivatives for

*δ S*and

*δ Q*can be obtained as the output of the proper filtering as:where is the time derivative operator and

*τ*and

_{Q}*τ*are filter time constants. The time domain realization of the above estimation expressions can be carried out using the auxiliary states

_{S}*ω*and

_{Q}*ω*as:

_{S}*et al.*(2019). Hence, the resulting robust ESC scheme is given by the feedback control law:where and are computed by (6) and (7–8), respectively. It is important to remark that the control scheme given by (6–9) does not requires knowledge about the kinetic models for organic matter degradation and the exact influent composition in the AD process, only a nominal reference value for the VFAs feeding composition is required.

### Numerical simulations

Simulation results are shown in Figures 1 and 3. The parameters of the AD model are the same as those reported in Bernard *et al.* (2001). The controller parameters for the ESC scheme (6–9) are set to the following values: *K _{C}*

*=*

*0.2, κ*

_{1}

*=*

*1, κ*

_{2}

*=*

*2, L*

*=*

*2.5*and

*τ*

_{S}*=*

*τ*

_{Q}*=*

*0.1*. As we can see in Figure 1, the control scheme (6–9) achieves the convergence of the AD process at the optimal operating conditions where the methane production rate

*Q*is maximized. With respect to the issue of maximizing the degradation rate of organic matter in the AD process, we know that it is of prime importance in the wastewater treatment plants context; but, on the other hand, it is known that one way to maximize the methane production rate is to maintain VFAs concentration at a specific value in order to favour the methanization process and avoid the acidification of the digester (Méndez-Acosta

_{M}*et al.*2008; Nguyen

*et al.*2015). It is important to remark that the control scheme is able to keep the AD process close to the optimal operating conditions despite un-modelled dynamics and fluctuations in the inlet composition (Figure 2). In Figure 3, acceptable performance of the ESC scheme (6–9) despite the fluctuation in the AD inlet composition is shown.

In order to compare the performance of the proposed ESC scheme with respect to the conventional perturbation-based ESC and sliding mode-based approaches (Wang *et al.* 1999; Dochain *et al.* 2011; Lara-Cisneros *et al.* 2015; Meraz *et al.* 2016; Barbu *et al.* 2017; Caraman *et al.* 2017), numerical simulations have been performed with same model parameters and conditions.

*K*

_{C}*=*

*0.0003*,

*A*

*=*

*0.01*,

*ω*

*=*

*0.5*and

*ω*

_{h}*=*

*0.4*. For the sliding mode-based scheme, we consider the same structure developed in Lara-Cisneros

*et al.*(2015), given by:where with and

*ρ*,

*λ,α*

*>*

*0*.

We can see in Figure 4 that the convergence rate to the maximal methane production does not have significant difference for the different ESC schemes. However, the response of the control action presents a clear advantage in terms of the smoothness for the proposed ESC scheme (6–9) with respect to (10) and (11) approaches (see Figure 3(b)). The simulation results show that the ESC approach proposed here is a good alternative to avoid the drawback of excessive oscillations in the control action due to the continuous external perturbation (dither signal) in traditional ESC schemes or sliding-mode ones. The advantage of smooth response in the control action is that it prevents excessive wear on the final actuator elements (valves and pumps) and guarantees low energy consumption. On the way to a practical implementation of the proposed ESC scheme, it is necessary to develop a tuning methodology in order to choose appropriate control parameters. Also, a convergence analysis that includes the stability properties of the gradient estimation algorithm and its relation with the dynamical properties of the AD process will be addressed in a future contribution.

## CONCLUSIONS

In this paper, a class of model-based extremum-seeking control scheme able to maximize the biomethane production rate in continuous AD processes has been proposed. The ESC controller is based on the modelling error compensation approach coupled with a first-order gradient estimator. Unlike the conventional ESC schemes, the proposed control law is a model-based algorithm without using exogenous perturbation signals, which avoid the drawback of excessive oscillations in the control input. Numerical simulations showed that the ESC scheme is able to regularize the AD process close to the optimal operating conditions despite unmodelled dynamics and external disturbances**.**

## ACKNOWLEDGEMENTS

This work was supported by the Sectorial Fund CONACYT-SENER-Energetic Sustainability Mexico through the project FSE-2015-07-279043 ‘*Development of monitoring and control systems to maximize biogas production in wastewater treatment processes*’.