*Article* **A Simplified Algorithm for Setting the Observer Parameters for Second-Order Systems with Persistent Disturbances Using a Robust Observer**

**Alejandro Rincón 1,2,\*, Fredy E. Hoyos <sup>3</sup> and John E. Candelo-Becerra <sup>3</sup>**


**Abstract:** The properties of the convergence region of the estimation error of a robust observer for second-order systems are determined, and a new algorithm is proposed for setting the observer parameters, considering persistent but bounded disturbances in the two observation error dynamics. The main contributions over closely related studies of the stability of state observers are: (i) the width of the convergence region of the observer error for the unknown state is expressed in terms of the interaction between the observer parameters and the disturbance terms of the observer error dynamics; (ii) it was found that this width has a minimum point and a vertical asymptote with respect to one of the observer parameters, and their coordinates were determined. In addition, the main advantages of the proposed algorithm over closely related algorithms are: (i) the definition of observer parameters is significantly simpler, as the fulfillment of Riccati equation conditions, solution of LMI constraints, and fulfillment of eigenvalue conditions are not required; (ii) unknown bounded terms are considered in the dynamics of the observer error for the known state. Finally, the algorithm is applied to a model of microalgae culture in a photobioreactor for the estimation of biomass growth rate and substrate uptake rate based on known concentrations of biomass and substrate.

**Keywords:** state estimation; robust observer; bioprocess monitoring; nonlinear systems

#### **1. Introduction**

In the monitoring and control of biological and biochemical processes, it is crucial to have real-time knowledge of variables such as the concentrations of biomass, products or reactants; the growth rate of microorganisms; and the substrate consumption rate [1–4]. Online knowledge of the substrate uptake rate is needed for the application of automatic control [4], whereas online knowledge of the specific growth rate (*μ*) is usually required in the following cases: (i) in automatic control with the biomass concentration as the output [5]; (ii) in automatic control with *μ* as the output (see [6,7]); (iii) in the maximization of growth rate via an extremum seeking controller [8]; (iv) in the maximization of the gaseous outflow rate via an extremum seeking controller [9]. The concentrations and reaction rates can be estimated by using state observers combined with the measurement of some state variables, and a known mass balance model for the measured states [1,10–12]. Control design for multi-agent systems is another active area of observer design. In these systems, observers are designed to estimate the unmeasured states of adjacent agents [13–15].

Robust observer designs have been developed for tackling uncertainty in the dynamics of observation errors. Common designs consider: (i) a lack of knowledge in the dynamics of the observation error for the unknown state; (ii) an unknown term of the unknown state

**Citation:** Rincón, A.; Hoyos, F.E.; Candelo-Becerra, J.E. A Simplified Algorithm for Setting the Observer Parameters for Second-Order Systems with Persistent Disturbances Using a Robust Observer. *Sensors* **2022**, *22*, 6988. https://doi.org/ 10.3390/s22186988

Academic Editor: Simon Tomažiˇc

Received: 12 August 2022 Accepted: 11 September 2022 Published: 15 September 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

in the dynamics of the observation error for the known state [10,16–22]. In the case that the dynamics of the observation error for the known state involves an additional additive uncertain term and it is persistent but bounded, the steady state estimation involves error, even if a discontinuous observer is used. However, the estimation error depends on the observer parameters, so it can be reduced to a certain extent, provided that the known limits of the uncertainty [23,24].

In [25], a tuning procedure is proposed for setting the parameters of an extended state observer (ESO) for a closed loop second-order system with measurement noise and bounded external disturbance. The used observer is a Luenberger-like extended state, which is intended to estimate the external disturbance. The stability of the resulting estimation error dynamics is determined based on the state matrix, and two choices are proposed for setting the observer gains that lead to the real negative eigenvalues of the state matrix. Furthermore, the time-dependent bound of the transient behavior of the observation errors is determined, which gives the exponential convergence rate and the width of the convergence region in terms of observer parameters and some disturbances of the dynamics of the observation errors. However, the time derivative of the external disturbance is required to be bounded, and the input gain is required to be locally Lipschitz continuous.

In [21], an observer is designed to estimate the parameters of the tunneling current in a Scanning Tunneling Microscope (STM). The measurement of the tunneling current (*it*) is described by additive noise and first-order sensor dynamics, with the current *it* as its input. The observer is used for estimating the tunneling current *it*. The estimate is expressed in terms of Laplace transforms of the actual current and additive noise. The observer parameters must be chosen to have poles with strictly negative real parts in the transfer functions. A simple choice is proposed, which yields a second-order characteristic polynomial with a damping coefficient of one. However, no external disturbance is considered in the first-order sensor dynamics.

In [10], a filtered high gain observer is designed for a class of non-uniformly observable systems, and then it is applied to a phytoplanktonic growth model. Bounded disturbances and noisy measurements are considered, although bounded disturbances are not considered in the dynamics of the known state. The observation errors exponentially converge to a compact set whose width is a function of the observer parameters and bounds of the disturbances and measurement noise. Thus, the boundary of the transient behavior of the observation errors is determined. Furthermore, an improved observer is formulated for the case of sampled outputs, and the transient boundary of the observation errors is determined. Finally, the observer is applied to a model of continuous culture of phytoplankton, with an estimation of the substrate and cell quota concentrations based on biomass concentration measurements. The main limitations of the observer design are: (i) bounded disturbances are not considered in the dynamics of the observation error for the known state; (ii) some conditions of a Riccati differential equation must be satisfied.

In [23], a super-twisting observer is designed for a two-dimensional system, considering disturbances in the two observation error dynamics. Two disturbance types are considered in the observation error dynamics: in the first, the upper bound is the function of the observation error for the known state (known observation error); in the second, the upper bound is constant. The observation errors converge to zero in finite time for the first disturbance type. Thus, the convergence is proved, and the convergence time is determined. The observation errors converge to a compact set for the second disturbance type. Thus, the convergence region is determined, but the time-dependent bound of the transient behavior of the observation errors and the convergence times are not determined. In addition, the observer design algorithm is proposed, which involves the selection of design parameters. Finally, the observer and the algorithm are applied to a model of microalgae culture in a photobioreactor, performing an estimation of biomass growth rate, substrate uptake rate, and internal quota. However, the observer algorithm involves an iterative solution of LMIs, and the observer involves a discontinuous signal.

In this work, a new algorithm is proposed for setting the parameters of a robust observer for second-order systems, considering persistent but bounded disturbances in the two observation error dynamics. The algorithm is applied to a model of microalgae culture in a photobioreactor for the estimation of biomass growth rate and substrate uptake rate based on known concentrations of biomass and substrate. The main contributions over closely related studies of the stability of state observers (for instance [10,21,23,25]) are:

	- − In [21], the dependence of the width of the convergence region on the observer parameters and disturbance terms is not determined.
	- − In [10], the width of the convergence region is expressed in terms of the bounds of the disturbances and measurement noise, but bounded disturbances are not considered in the dynamics of the estimation error of the known state, so the effect of these disturbances is not considered in the convergence region.
	- − In [23], the width of the convergence region is expressed in terms of the bounds of the disturbances of the dynamics of the estimation error of the known state, but the effect of observer parameters and bounded disturbance of the dynamics of the estimation error of the unknown state are not considered.

In addition, the advantages of the proposed algorithm over closely related algorithms are:


The work is organized as follows. The bioreactor model is presented in Section 2. The preliminaries in Section 3 include the observer equations and the bound of the transient and asymptotic behavior of the observer error. The main results presented in Section 4 include the formulation of the algorithm for setting the observer parameters and the determination of the width of the convergence region of the observer error in terms of the observer parameters. An application to a microalgae bioreactor is shown in Section 5, and the discussion and conclusions are drawn in Section 6.

#### **2. Bioreactor Model**

Consider the system

$$\frac{d\mathbf{x}\_1}{dt} = h\_1 + b\mathbf{x}\_2 + \delta\_{1\prime} \tag{1}$$

$$\frac{d\mathbf{x}\_2}{dt} = h\_2 + \delta\_{2\prime} \tag{2}$$

where *x*<sup>1</sup> and *x*<sup>2</sup> are the states; *h*<sup>1</sup> and *h*<sup>2</sup> are model functions; *δ*<sup>1</sup> and *δ*<sup>2</sup> are disturbance terms; and *b* is the *x*<sup>2</sup> gain in the dynamics of *x*1. The model terms fulfill the following assumptions:

**Assumption 1.** *The functions h*<sup>1</sup> *and h*<sup>2</sup> *are known; the state x*<sup>1</sup> *is measured, and the coefficient b is known; the state x*<sup>2</sup> *and the terms δ*<sup>1</sup> *and δ*<sup>2</sup> *are unknown.*

**Assumption 2.** *The coefficient b is bounded away from zero:*

$$|b| \ge b\_{\min} > 0$$

*where bminis an unknown positive constant.*

**Assumption 3.** *The disturbance terms δ*<sup>1</sup> *and δ*2*are bounded.*

#### **3. Preliminaries: Observer and Bounds for the Transient and Steady Behavior of the Observer Error**

In this section, the observer equations and the bounds for the transient and asymptotic behavior of the observer error for the unknown state (*x*2) are recalled from [24]. The detailed mathematical procedure of the Lyapunov-based formulation of the observer is provided in [24].

#### *3.1. Observer*

The observer equations are [24]:

$$\frac{d\hat{\mathbb{X}}\_1}{dt} = b\mathbb{X}\_2 - |b| \left( \omega \overline{\mathbb{x}}\_1 + \left( k + \frac{1}{4\omega} \right) \psi\_{\ge 1} + s a t\_{\ge 1} \hat{\theta} \right) + h\_1. \tag{3}$$

$$\frac{d\hat{x}\_2}{dt} = -b\omega \left( \left( k + \frac{1}{4\omega} \right) \psi\_{x\_1} + sat\_{x\_1}\hat{\theta} \right) + h\_{2\prime} \tag{4}$$

$$\frac{d\hat{\theta}}{dt} = \gamma |b||\psi\_{x\_1}|.\tag{5}$$

where

$$
\overline{\mathfrak{x}}\_1 = \mathfrak{x}\_1 - \mathfrak{x}\_1. \tag{6}
$$

$$\psi\_{x\_1} = \begin{cases} \overline{x}\_1 - \varepsilon \operatorname{ for } \overline{x}\_1 \ge \varepsilon \\ 0 \operatorname{ for } \overline{x}\_1 \text{ } \varepsilon \text{ } [-\varepsilon, \varepsilon] \\ \overline{x}\_1 + \varepsilon \operatorname{ for } \overline{x}\_1 \le -\varepsilon \end{cases} \tag{7}$$

$$sat\_{x\_1} = \begin{cases} \begin{array}{l} 1 \ for \,\overline{x}\_1 \ge \varepsilon \\ \frac{1}{\varepsilon} \overline{x}\_1 \ for \,\overline{x}\_1 \in \ [-\varepsilon, \ \varepsilon] \\ -1 \ for \,\overline{x}\_1 \le -\varepsilon \end{array} \tag{8}$$
 
$$\sigma = sign(b)$$

where *x*ˆ1 is the estimate of *x*1, *x*ˆ2 is the estimate of *x*2, ˆ *θ* is the updated parameter, and: (i) *γ*, *k*, *ω* are user-defined positive constants; (ii) the width of the convergence region of *x*1, that is, *ε*, is user-defined, positive, and constant.

#### *3.2. Mathematical Definitions*

The main mathematical definitions are given as follows. *b*, *h*1, *h*2, *δ*<sup>1</sup> and *δ*<sup>2</sup> are terms of the model (1) and (2) described after Equations (1) and (2), satisfying Assumptions 1, 2, and 3. In addition, *x*<sup>1</sup> = *x*ˆ1 − *x*<sup>1</sup> is the observer error for the known state, *x*<sup>2</sup> = *x*ˆ2 − *x*<sup>2</sup> is the observer error for the unknown state; *x*<sup>1</sup> is the known state, *x*<sup>2</sup> is the unknown state, and *z* = *x*<sup>2</sup> − *σωx*1.

Mathematical definitions related to the function *Vz*:

$$V\_z = \frac{1}{2} \psi\_z^2$$

$$\psi\_z = \begin{cases} z + \delta\_{\min} \, for \, z \ge -\delta\_{\min} \ge 0 \\ 0 \, for \, z \in (-\delta\_{\max}, -\delta\_{\min}) \\ z + \delta\_{\max} \, for \, z \le -\delta\_{\max} \le 0 \end{cases}$$

where *δmin* and *δmax* are constants that satisfy

$$
\delta \ge \delta\_{\min}, \quad \delta\_{\min} \in \left( -\infty, 0 \right]; \\
\delta \le \delta\_{\max}, \quad \delta\_{\max} \in \left[ 0, \quad \infty \right),
$$

where *δ* is defined as

$$
\delta = \frac{1}{b} \left( \frac{\delta\_2}{\sigma \omega} - \delta\_1 \right) \rho
$$

and *ψzo* is the value of *ψ<sup>z</sup>* at the initial time.

Mathematical definitions related to the overall Lyapunov function:

$$V\_{z\theta x1} = V\_z + V\_{x1} + V\_{\theta}$$

$$V\_{x1} = \frac{1}{2}\psi\_{x1}^2; \; V\_{\theta} = \frac{1}{2}\gamma^{-1}\overline{\theta}^2; \; \overline{\theta} = \theta - \theta$$

where *θ* is a positive constant fulfilling:

$$|-\delta\_{zt} - \delta\_1/b| \le \theta \text{; } \delta\_{zt} = \psi\_z - z.$$

Mathematical definitions of convergence regions:

$$
\Omega\_{\mathbf{x}1} = \{ \overline{\mathbf{x}}\_1 : -\varepsilon \le \overline{\mathbf{x}}\_1 \le \varepsilon \}
$$

$$
\Omega\_{\mathbf{x}2} = \{ \overline{\mathbf{x}}\_2 : |\overline{\mathbf{x}}\_2| \le \max \{ -\delta\_{\min}, \delta\_{\max} \} + \omega \varepsilon \}
$$

#### *3.3. Convergence of the Observer Error for the Known State*

The combined state *z* is defined as:

$$z = \mathfrak{X}\_2 - \sigma \omega \mathfrak{X}\_{1\prime} \tag{9}$$

The Lyapunov function for *z* is defined as

$$V\_z = \frac{1}{2} \psi\_{z'}^2 \tag{10}$$

$$\psi\_z = \begin{cases} z + \delta\_{\min} \, for \, z \ge -\delta\_{\min} \ge 0 \\ 0 \, for \, z \in (-\delta\_{\max}, -\delta\_{\min}) \\ z + \delta\_{\max} \, for \, z \le -\delta\_{\max} \le 0 \end{cases} .$$

where *δmin* and *δmax* are constant limits for the disturbance term

$$
\delta = \frac{1}{b} \left( \frac{\delta\_2}{\sigma \omega} - \delta\_1 \right) \nu
$$

that satisfy

$$
\begin{array}{ll}
\delta \ge \delta\_{\min}, & \delta\_{\min} \in \left( -\infty, 0 \right], \\
\delta \le \delta\_{\max}, & \delta\_{\max} \in \left[ 0, \infty \right).
\end{array}
$$

Differentiating *Vz* with respect to time, yields

$$\frac{dV\_z}{dt} \le -2\omega \, |b| V\_z \le 0.$$

The overall Lyapunov function is:

$$V\_{z\theta x1} = V\_z + V\_{x1} + V\_{\theta}$$

$$V\_{x1} = \frac{1}{2}\psi\_{x1}^2; \; V\_{\theta} = \frac{1}{2}\gamma^{-1}\overleftarrow{\theta}^2; \; \overleftarrow{\theta} = \widehat{\theta} - \theta$$

where *Vz* is given by Equation (10), *γ* is a user-defined positive constant, ˆ *θ* is provided by Equation (5) and *θ* is a positive constant fulfilling

$$|-\delta\_{zt} - \delta\_1/b| \le \theta \text{; } \delta\_{zt} = \psi\_z - z.$$

The time derivative of *Vz<sup>θ</sup>x*<sup>1</sup> leads to

$$\frac{dV\_{z\theta x1}}{dt} = \frac{d}{dt}(V\_z + V\_{x1} + V\_\theta) \le -kb\_{\min} \psi\_{x1}^2 \le 0. \tag{11}$$

This indicates the asymptotic convergence of the observer error *x*<sup>1</sup> to the compact set Ω*x*<sup>1</sup> = {*x*<sup>1</sup> : −*ε* ≤ *x*<sup>1</sup> ≤ *ε*}.

**Remark 1.** *The ψ<sup>z</sup> definition given after Equation (10) indicates that ψz, ψ*<sup>2</sup> *<sup>z</sup> and dψ*<sup>2</sup> *<sup>z</sup>*/*dz exist and are continuous. The ψx*<sup>1</sup> *definition (7) indicates that ψx*<sup>1</sup> *, ψ*<sup>2</sup> *<sup>x</sup>*1*, and <sup>d</sup>ψ*<sup>2</sup> *<sup>x</sup>*1/*dx*<sup>1</sup> *exist and are continuous. Consequently, Vz, Vx*<sup>1</sup> *and the overall Lyapunov function Vz<sup>θ</sup>x*<sup>1</sup> *exist and are continuous. A detailed determination of dVz<sup>θ</sup>x*1/*dt, dVz*/*dt, dVx*1/*dt, dVθ*/*dt is given in* [24].

**Remark 2**. *The term 'overall Lyapunov function' is used for the Lyapunov function that results from the addition of several quadratic or positive forms and whose time derivative indicates the convergence result of some state. This term is also used in* [32,33]*. Notice that this condition is only fulfilled by Vz<sup>θ</sup>x*1*, as follows from Equation (11).*

*3.4. Bounds for the Transient and Steady Behavior of the Observer Error for the Unknown State*

From the definition of *z* (9), it follows that the observer error *x*<sup>2</sup> can be rewritten in terms of *z* and *x*1: *x*<sup>2</sup> = *z* + *σωx*1.

$$\text{The first-order coupling between the two-dimensional } \mathcal{N} \text{-matrices is the only possible } \mathcal{N} \text{-matrices with } \mathcal{N} = \{0, 1, 2, \dots, N\} \text{ and } \mathcal{N} = \{0, 1, 2, \dots, N\}.$$

$$|\overline{x}\_2| \le |z| + \omega |\overline{x}\_1|.$$

Combining the dynamics of *z* and *x*1, yields

$$|\overline{x}\_2| \le |\psi\_{\overline{z}o}|e^{-\omega b\_{\min}(t-t\_\delta)} + \max\{-\delta\_{\min}, \delta\_{\max}\} + \omega|\overline{x}\_1|\tag{12}$$

where *ψzo* is the value of *ψ<sup>z</sup>* at the initial time, and *δmin* and *δmax* are constant limits for the disturbance term

$$
\delta = \frac{1}{b} \left( \frac{\delta\_2}{\sigma \omega} - \delta\_1 \right) \tag{13}
$$

that satisfy

This leads to

$$\begin{array}{ll} \delta \ge \delta\_{\min}, & \delta\_{\min} \in (-\infty, 0], \\ \delta \le \delta\_{\max}, & \delta\_{\max} \in [0, \infty). \end{array} \tag{14}$$

*bmin* is a constant limit for *b* that satisfies Assumption 2.

Despite the fact that the convergence of *x*<sup>1</sup> to Ω*x*<sup>1</sup> = {*x*<sup>1</sup> : −*ε* ≤ *x*<sup>1</sup> ≤ *ε*} is asymptotic, one can consider that *x*<sup>1</sup> ∈ Ω*x*<sup>1</sup> for some *t* ≥ *T*1, that is, |*x*1| ≤ *ε*. Combining with

Equation (12) yields the time-dependent bound for the transient behavior of the observer error *x*2:

$$|\overline{x}\_2| \le |\psi\_{\overline{x}o}|e^{-\omega v b\_{\min}(t - t\_o)} + \max\{-\delta\_{\min}, \delta\_{\max}\} + \omega \varepsilon for \ t \ge T\_1 \tag{15}$$

Hence, *x*<sup>2</sup> converges asymptotically to the compact set

$$\Omega\_{\mathbf{x}2} = \{ \overline{\mathbf{x}}\_2 : |\overline{\mathbf{x}}\_2| \le \max \{ -\delta\_{\min}, \delta\_{\max} \} + \omega \varepsilon \} \tag{16}$$

so that the limits of the convergence region Ω*x*<sup>2</sup> are *max*{−*δmin*, *δmax*} + *ωε* and −*max*{−*δmin*, *δmax*} − *ωε*.

#### **4. Formulation of the Algorithm for Setting the Observer Parameters and Determination of the Width of the Convergence Region of the Observer Error in Terms of the Observer Parameters**

In this section: (i) the width of the convergence region Ω*x*<sup>2</sup> (16) is expressed in terms of the interaction between the parameters of the observer (3)–(5) and *δ*1, *δ*2, the disturbance terms of the observer error dynamics; (ii) an algorithm is formulated for setting the observer parameters *ω*, *ε*, *γ*, *k*.

*4.1. Determination of the Width of the Convergence Region of the Observer Error*

From the definition of *δ* in Equation (13), it follows that

$$|\delta| \le \frac{1}{\omega} d\_2 + d\_1 \tag{17}$$

where *d*<sup>1</sup> and *d*<sup>2</sup> are positive constants that satisfy

$$
\left|\frac{\delta\_2}{b}\right| \le d\_{2'} \left|\frac{\delta\_1}{b}\right| \le d\_1 \tag{18}
$$

From Equation (17) and the conditions on *δmin* and *δmax* (14), it follows that the *δmin* and *δmax* values can be chosen to be:

$$
\delta\_{\text{max}} = \frac{1}{\omega} d\_2 + d\_1; \ \delta\_{\text{min}} = -\delta\_{\text{max}}.
$$

so that the terms in Equation (14) are fulfilled. Then, the convergence set Ω*x*<sup>2</sup> (16) becomes

$$
\Omega\_{\mathbf{x}2} = \{ \overline{\mathbf{x}}\_2 : |\overline{\mathbf{x}}\_2| \le f\_{\mathbf{w}} \} \tag{19}
$$

$$f\_w = \frac{1}{\omega}d\_2 + d\_1 + \omega\varepsilon \tag{20}$$

so that the width of the convergence set Ω*x*<sup>2</sup> is *fw* and the limits of Ω*x*<sup>2</sup> are −*fw* and +*fw*. The main features of the *fw* function are:

$$\begin{aligned} f\_w &> 0; \ f\_w &\text{has a vertical asymptote, at } \omega = 0\\ \lim\_{\omega \to \infty} f\_w &= \infty; \ f\_w > d\_1 \ge \sup\_{t \ge t\_0} |\delta\_1/b|; \ \lim\_{\omega \to 0^+} f\_w = \infty \end{aligned} \tag{21}$$

From these properties, it follows that *fw* has a minimum point with respect to *ω*. Its coordinates are determined by differentiating *fw* expression (20) with respect to *ω*, which yields:

$$
\omega^\* = \sqrt{d\_2} \, \frac{1}{\sqrt{\varepsilon}}; f^\*\_w = 2\sqrt{d\_2}\sqrt{\varepsilon} + d\_1 \tag{22}
$$

Therefore, the relationship between *f* ∗ *<sup>w</sup>* and *ω*<sup>∗</sup> is given by

$$f\_w^\* = 2d\_2 \frac{1}{\omega^\*} + d\_1 \tag{23}$$

**Remark 3**. *The properties (21) of the fw function and its minimum (22) indicate that ω* = *ω*∗*and a low ε value leads to low fw, which implies a low width of the convergence region* Ω*x*2*, and consequently, a high quality of x*<sup>2</sup> *estimation, as follows from Equations (19) and (20).*

**Remark 4**. *An overlarge ω value fulfilling ω ω*<sup>∗</sup> *leads to: (i) fast convergence of the upper bound of x*2*, as follows from Equation (15); (ii) a large fw value, which implies a low quality of x*<sup>2</sup> *estimation, as follows from Equations (19) and (20). Therefore, the choice of ω must take into account both the convergence rate and the width of the convergence region of x*2.

**Remark 5**. *A low ε value leads to low f* ∗ *w, since f* <sup>∗</sup> *<sup>w</sup> increases with respect to ε, as follows from Equation (22). However, overly small ε values lead to steeper slopes in the shape of the satx*<sup>1</sup> *signal (8) of the observer, which implies that the numerical solution of the differential equation must use a smaller step size.*

**Remark 6**. *The f* ∗ *<sup>w</sup> function (23) increases with d*1*, whereas ω*<sup>∗</sup> *is independent of d*1*, as follows from Equation (22).*

In the case that *δ*<sup>1</sup> = 0 in Equation (1), we have

$$|\delta| \le \frac{1}{\omega} d\_2$$

and one can use

$$
\delta\_{\text{max}} = \frac{1}{\omega} d\_{\text{2}}; \,\delta\_{\text{min}} = -\delta\_{\text{max}}.
$$

Then, Equation (19) becomes

$$
\Omega\_{\mathbf{x}2} = \{ \overline{\mathbf{x}}\_2 : |\overline{\mathbf{x}}\_2| \le f\_{\mathbf{w}} \}\tag{24}
$$

$$f\_w = \frac{1}{\omega}d\_2 + \omega\varepsilon\tag{25}$$

The resulting features of *fw* for *δ*<sup>1</sup> = 0 are:

$$f\_w > 0; \ f\_w \text{has a vertical asymptote, at } \omega = 0;$$

$$\lim\_{\omega \to \infty} f\_w = \infty; \lim\_{\omega \to 0^+} f\_w = \infty$$

From these properties, it follows that *fw* has a minimum point with respect to *ω*. The coordinates of this minimum are determined by differentiating *fw* expression (22) with respect to *ω*, which yields:

$$
\omega^\* = \sqrt{d\_2} \frac{1}{\sqrt{\varepsilon}}; f\_w^\* = 2\sqrt{d\_2}\sqrt{\varepsilon} \tag{26}
$$

#### *4.2. Formulation of the Algorithm for Setting the Observer Parameters*

The algorithm presented in Algorithm 1 allows us to set the observer parameters *ω*, *ε*, *γ*, and *k*, so as to define: (i) the convergence rate of *x*2; (ii) the value of *fw* = <sup>1</sup> *<sup>ω</sup> d*<sup>2</sup> + *d*<sup>1</sup> + *ωε*, which is the width of the *x*<sup>2</sup> convergence set Ω*x*<sup>2</sup> = {*x*<sup>2</sup> : |*x*2| ≤ *fw* }.


**Remark 7**. *The proposed algorithm and the observer (3)–(5) lead to a more practical and simpler real-time state estimation in either laboratory or industrial applications, according to the advantages A1 to A4, which are due to the observer of* [24]*. They can be applied to systems whose model can be cast in the second-order form (1) and (2), which includes a wide range of mechanical and physical systems. Some examples are:*


**Remark 8**. *The convergence rate and the width of the x*<sup>2</sup> *convergence set* (*fw*) *can be properly defined by setting the observer parameters ω, ε, γ, k in accordance with the proposed procedure, with ω, ε values corresponding to the minimum point of fw, that is, ω*∗*, f* ∗ *w*.

**Remark 9**. *The proposed observer algorithm deals with the combined effect of disturbance terms and observer parameters on the width of the convergence region for the estimation error of the unknown state, as follows*:


*fw value is obtained by using the coordinates of the minimum, that is, ω=ω*∗*, according to Equation (22). Thus, the highest accuracy of the state estimation is obtained by setting the observer parameters equal or similar to the coordinates of the minimum.*

#### **5. Application to Microalgae Bioreactor**

The developed algorithm for setting parameters of the observer (3)–(5) is used to estimate the substrate uptake rate *ρ* and specific growth rate *μ* in a continuous microalgae bioreactor. The concentrations of substrate and biomass are considered to be known, and the system is described by the Droop model [23,37]:

$$\frac{d\mathbf{x}}{dt} = \mu \mathbf{x} - D\mathbf{x} \tag{27}$$

$$\frac{ds}{dt} = -\rho \mathbf{x} + D(\mathbf{s}\_i - \mathbf{s}) \tag{28}$$

$$\frac{dq}{dt} = \rho - \mu q\tag{29}$$

where *x* is the biomass concentration, *s* is the substrate concentration, and *q* is the cell quota of assimilated nutrient; *D* = *Fi*/*v* is the dilution rate, *Fi* is the feeding flow rate, *v* is the broth volume, *si* is the fed substrate concentration, *μ* is the specific growth rate, and *ρ* is the specific substrate uptake rate. The expressions for *μ*, *ρ*, and the model parameters are [23]:

$$\begin{cases} \begin{aligned} \mu(q) &= \max\limits\_{\mathcal{O}, \mathbf{m} \in \mathcal{M}} \{0, \mu\_m \Big(\mathbf{1} - \frac{Q\_O}{q}\right)\}; \rho = \rho\_m \Big(\frac{s}{s + \mathbf{K}\_s}\Big) \\ \rho\_m &= 0.03 \frac{\text{mg} \mathbf{N}}{\text{mg} \mathbf{C} \cdot \mathbf{d}}; K\_s = 0.0010 \frac{\text{mg} \mathbf{N}}{\text{L}}; \mu\_m = 0.5 \,\mathbf{d}^{-1}; \\ Q\_O &= 0.045 \,\text{mg} \mathbf{N} / \text{mg} \mathbf{C}; \\ \chi\_{to} = 0.1 \,\text{mg} \mathbf{C} / \text{L}; s\_{to} = 0.01 \,\text{mg} \mathbf{N} / \text{L}; q\_{to} = 0.06 \,\text{mg} \mathbf{N} / \text{mg} \mathbf{C}; \\ D &= \begin{cases} 0.25 \left(1 + \sin\left(\frac{2\pi}{\text{r}\_D} \mathbf{t}\right)\right) & \mathbf{d}^{-1} \text{ for } t < 6 \,\text{d}; \\ 0 & \text{for } t \ge 6 \,\text{d} \end{cases} \end{cases} \end{cases} \tag{30}$$

The model details, including parameters and specific growth rate expression, are given in [23].

The *fw* curve as a function of *ω* and *ε* is computed using Equation (20), the curves of *f* ∗ *<sup>w</sup>* and *ω*<sup>∗</sup> as a function of *ε* are computed using Equation (22), and the *f* <sup>∗</sup> *<sup>w</sup>* vs. *ω*<sup>∗</sup> curve is computed using Equation (23).

The simulation of the model (27)–(29) and the observer (3)–(5) was performed using Matlab software (The Math Works Inc., Natick, MA, USA): the differential equations were numerically integrated using the ode45 routine.

Although model (27)–(29) comprises three states, it leads to the following secondorder subsystems:

A)

$$\frac{ds}{dt} = -\rho \mathbf{x} + D(s\_i - s)$$

$$\frac{d\rho}{dt} = \delta\_2$$

for the first example, so that *x*<sup>1</sup> = *s*; *x*<sup>2</sup> = *ρ*.

B)

$$\frac{d\mathbf{x}}{dt} = \mu \mathbf{x} - D\mathbf{x}$$

$$\frac{d\mu}{dt} = \delta \mathbf{z}$$

for the second example, so that *x*<sup>1</sup> = *x*; *x*<sup>2</sup> = *μ*. This approach is also considered in [23].

#### *5.1. First Example: Estimation of Substrate Uptake Rate*

The specific substrate uptake rate *ρ* is estimated using the substrate mass balance model (28) and the knowledge of substrate and biomass concentrations. The fed substrate concentration *si* is inaccurately known: *si* = *si* + *δsin*, where *si* is the known value of *si*, and *<sup>δ</sup>sin* is the uncertainty; *si* <sup>=</sup> 0.05 mg N/L; *<sup>δ</sup>sin* <sup>=</sup> 0.1*si* <sup>×</sup> sin2π<sup>t</sup> *<sup>τ</sup>*si ; *τsi* = 3. The substrate concentration (*s*) is the known state, and the specific substrate uptake rate (*ρ*) is the unknown state, so that substrate model (28) can be cast in the form (1), (2) with

$$\mathbf{x}\_1 = \mathbf{s}; \; x\_2 = \rho; \; b = -\mathbf{x}; \; h\_1 = (\mathbf{\bar{s}}\_i - \mathbf{s})D; \; h\_2 = 0; \; \delta\_1 = D\delta\_{\mathbf{s}i}; \; \delta\_2 = \frac{d\rho}{dt} \tag{31}$$

Additionally, the observer (3)–(5) provides the estimate of *ρ*, that is, *x*ˆ2 = *ρ*ˆ. The observer structure is given in Figure 1. *x* is the biomass concentration, *s* is the substrate concentration, *ρ* is the specific substrate uptake rate, *D* = *Fi*/*v* is the dilution rate, *Fi* is the feeding flow rate, *v* is the broth volume, and *si* is the fed substrate concentration. In addition, *x*<sup>1</sup> is the known state, *x*<sup>2</sup> is the unknown state, and *x*ˆ2 is the estimate of *x*2.

**Figure 1.** Structure of the observer application to microalgae bioreactor for estimating the specific substrate uptake rate *ρ*.

To examine the *fw* function (20), the *d*1, *d*<sup>2</sup> bounds of the disturbance terms *δ*1/*b*, *δ*2/*b* are obtained by simulation based on the *x*1, *x*<sup>2</sup> model, yielding *d*<sup>1</sup> = 0.04, *d*<sup>2</sup> = 0.11. The curves of *fw*, *f* ∗ *<sup>w</sup>*, *ω*<sup>∗</sup> for different *ε*, *ω* values are shown in Figure 2.

Low *fw* values are obtained for *ω* = *ω*<sup>∗</sup> and low *ε* value (see Figure 2b,d), which is in accordance with remark 4.1. A minimum of the *fw* function is characterized by *ω*<sup>∗</sup> = 8.564, *f* ∗ *<sup>w</sup>* = 0.0657 for *ε* = 0.0015, as follows from Equation (22). The observer parameters are chosen to be:

$$\pounds = 0.0015; \omega = 8.56; \; k = 40; \gamma = 100; \; \pounds\_{1|to} = 0.1; \; \pounds\_{2|to} = 0 \; d^{-1}; \; \hat{\theta}\_{lo} = 0 \tag{32}$$

So that *fw* ≈ *f* <sup>∗</sup> *<sup>w</sup>*. The bioreactor is simulated using model (27)–(29) with plant model terms and parameters (30), whereas the observer (3)–(5) is simulated using the definition of the terms of the system model given by Equation (31), and the values of observer parameters given by Equation (32), and it is observed that (Figure 3):


**Figure 2.** Effect of the observer parameters *ε*, *ω* on the *fw* function (20) for estimation of the specific substrate uptake rate *ρ*: (**a**) *fw* as a function of *ω* for several *ε* values, indicating the minimum point; (**b**) detail of *fw* as a function of *ω* for several *ε* values, indicating the minimum point; (**c**) values of *ω*∗ as a function of *ε*, indicating the points for the *ε* values considered in subfigure a; (**d**) values of *f* ∗ *<sup>w</sup>* as a function of *ε*, indicating the points for the *ε* values considered in subfigure a.

**Figure 3.** Performance of the observer (3)–(5) for estimation of specific substrate uptake rate *ρ*, using the observer parameters obtained through the proposed algorithm: (**a**) trajectory of state *x*<sup>1</sup> and estimate *x*ˆ1; (**b**) trajectory of the observer error for the known state, *x*1; (**c**) trajectory of state *x*<sup>2</sup> and estimate *x*ˆ2; (**d**) trajectory of the observer error for the unknown state, *x*2, with the limits (−*fw*, +*fw*) of the Ω*x*<sup>2</sup> convergence set indicated through dashed horizontal lines; (**e**) trajectory of the updated parameter ˆ *θ*.

The performed simulations confirm the adequacy of the parameter recommendations provided in the observer algorithm to achieve proper convergence speed and the width of the convergence region of *x*2.

#### *5.2. Second Example: Estimation of Biomass Growth Rate*

The specific growth rate *μ* is estimated using the biomass mass balance model (27) and the knowledge of biomass concentration. The biomass concentration (*x*) is the known state, and the specific growth rate *μ* is the unknown state, so the biomass model (27) can be cast in the form (1), (2) with

$$\mathbf{x}\_1 = \mathbf{x}; \; x\_2 = \mu; \; b = \mathbf{x}; \; h\_1 = -D\mathbf{x}; \; h\_2 = 0; \; \delta\_1 = 0; \; \delta\_2 = \frac{d\mu}{dt} \tag{33}$$

Additionally, the observer (3)–(5) provides the estimate of *μ*, that is, *x*ˆ2 = *μ*ˆ. The observer structure is given in Figure 4. *x* is the biomass concentration, *s* is the substrate concentration, *μ* is the specific growth rate, *ρ* is the specific substrate uptake rate, *D* = *Fi*/*v* is the dilution rate, *Fi* is the feeding flow rate, *v* is the broth volume, and *si* is the fed substrate concentration. In addition, *x*<sup>1</sup> is the known state, *x*<sup>2</sup> is the unknown state, and *x*ˆ2 is the estimate of *x*2.

**Figure 4.** Structure of the observer application to microalgae bioreactor for estimation of the specific growth rate *μ*.

To examine the *fw* function, the *d*1, *d*<sup>2</sup> bounds of the disturbance terms *δ*1/*b*, *δ*2/*b* are obtained by simulation based on the *x*1, *x*<sup>2</sup> model, yielding *d*<sup>1</sup> = 0, *d*<sup>2</sup> = 0.125. The curves of *fw*, *f* ∗ *<sup>w</sup>*, *ω*<sup>∗</sup> for different *ε*, *ω* values are shown in Figure 5.

Low *fw* values are obtained for *ω* = *ω*<sup>∗</sup> and low *ε* value (see Figure 5b,d), which is in accordance with remark 4.1. A minimum of the *fw* function is characterized by *ω*<sup>∗</sup> = 9.129, *f* ∗ *<sup>w</sup>* = 0.0097 for *ε* = 0.0015. The observer parameters are chosen to be:

$$
\omega = 0.0015; \omega = 9.12; \; k = 40; \gamma = 100; \; \pounds\_{1|to} = 0.1 \text{mg} \\
\mathbb{C}/L; \; \pounds\_{2|to} = 0 \; d^{-1}; \; \theta\_{to} = 0 \tag{34}
$$

So that *fw* ≈ *f* <sup>∗</sup> *<sup>w</sup>*. The bioreactor is simulated using model (27)–(29) with plant model terms and parameters (30), whereas the observer (3)–(5) is simulated using the plant model terms and parameters given by Equation (33), and the values of observer parameters given by Equation (34), and it is observed that (Figure 6):


**Figure 5.** Effect of the observer parameters *ε*, *ω* on the *fw* function (19) for estimation of the specific growth rate *μ*: (**a**) *fw* as a function of *ω* for several *ε* values; (**b**) detail of *fw* as a function of *ω* for several *ε* values, indicating the minimum point; (**c**) values of *ω*∗ as a function of *ε*, indicating the points for the *ε* values considered in subfigure a; (**d**) values of *f* ∗ *<sup>w</sup>* as a function of *ε*, indicating the points for the *ε* values considered in subfigure a.

**Figure 6.** Performance of the observer (3)–(5) for estimation of specific growth rate *μ*, using the observer parameters obtained through the proposed algorithm: (**a**) trajectory of state *x*<sup>1</sup> and estimate *x*ˆ1; (**b**) trajectory of the observer error for the known state, *x*1; (**c**) trajectory of state *x*<sup>2</sup> and estimate *x*ˆ2; (**d**) trajectory of the observer error for the unknown state, *x*2, with the limits (−*fw*, +*fw*) of the Ω*x*<sup>2</sup> convergence set indicated through dashed horizontal lines; (**e**) trajectory of the updated parameter ˆ *θ*.

#### **6. Discussion and Conclusions**

#### *6.1. Discussion*


The statement of the procedure for determining the constants that satisfy Equation (18). Based on several literature studies, we finally concluded that they could be obtained by the simulation of *δ*2/*b*, *δ*1/*b*, based on the *x*1, *x*<sup>2</sup> model, with model parameter values obtained from either closely related studies or offline fitting, as stated in Algorithm 1.

#### *6.2. Conclusions*

In this work, a new algorithm is proposed for setting parameters of a robust observer for second-order systems, considering persistent but bounded disturbances in the two observation error dynamics. As the main contribution over closely related studies of the stability of state observers, the width of the convergence region of the observer error for the unknown state is expressed in terms of the interaction between the observer parameters and the disturbance terms of the observer error dynamics. Moreover, the properties and the minimum of this relationship were determined.

The proposed observer algorithm leads to a more practical and simpler state estimation in either laboratory or industrial applications. It can be used for systems whose model can be cast in second-order form, for instance, mechanical, chemical, and biochemical systems. Moreover, it can be used for multiple state estimation, in cases of several second-order systems. The choice of the observer parameters must consider both the convergence rate and width of the convergence region of the estimation error of the unknown state. Choosing the observer parameter values to be similar or equal to the values for the minimum leads to a high quality of state estimation.

The performed simulations confirm the adequacy of the parameter recommendations provided in the observer algorithm to achieve the proper convergence speed and width of the convergence region of the observer error for the unknown state.

Future work will include: (i) extending the observer and the algorithm to system models of third order; (ii) extending the observer and the algorithm to system models of general nth order; (iii) considering noise in the measurement of the known state.

**Author Contributions:** Conceptualization, A.R.; methodology, A.R.; writing—original draft preparation, A.R., J.E.C.-B. and F.E.H.; writing—review and editing, A.R., F.E.H. and J.E.C.-B.; visualization, A.R., F.E.H. and J.E.C.-B. All authors have read and agreed to the published version of the manuscript.

**Funding:** A. Rincón was supported by Universidad Católica de Manizales. The work of F.E. Hoyos and John E. Candelo-Becerra were supported by Universidad Nacional de Colombia—Sede Medellín.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** This work was supported by Universidad Católica de Manizales and Universidad Nacional de Colombia, Sede Medellín. Fredy E. Hoyos and John E. Candelo-Becerra thank the Departamento de Energía Eléctrica y Automática. The work of Alejandro Rincón was supported by Universidad Católica de Manizales.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

