*Article* **Daytime/Nighttime Event-Based PI Control for the pH of a Microalgae Raceway Reactor**

**Enrique Rodríguez-Miranda 1, Manuel Beschi 2, José Luis Guzmán 3,\*, Manuel Berenguel <sup>3</sup> and Antonio Visioli <sup>1</sup>**


Received: 12 March 2019; Accepted: 19 April 2019; Published: 28 April 2019

**Abstract:** In this paper, a new solution to improve the traditional control operation of raceway microalgae reactors is presented. The control strategy is based on an event-based method that can be easily coupled to a classical time-driven proportional-integral controller, simplifying the design process approach. The results of a standard Proportional-Integral (PI) controller, as well as of two event-based architectures, are presented in simulation and compared with each other and with traditional On/Off control. It is demonstrated that the event-based PI controller—operating during the whole day instead of only during daytime—achieves a better performance by reducing the actuator effort and saving costs related to gas consumption.

**Keywords:** microalgae; raceway; control problem; PID; event-based

#### **1. Introduction**

The importance of environmental sustainability and the rising of renewable energies promote the development of new energy sources, such as microalgae reactors. These biological processes have become very popular nowadays due to their great potential to produce biofuels and high-value products. The biomass obtained in these processes can be useful for applications such as cosmetics at the pharmaceutical industry, or even products for agriculture and aquaculture coupled to wastewater treatment [1]. Among many advantages, these biological systems stand out for the capability of microalgae to produce valuable compounds from photosynthesis while consuming CO2 and nutrients, even coming from flue gases and wastewater.

There are mainly two types of reactors: tubular photobioreactors, for high-value microalgae strains, and raceway or open reactors. This second type of reactor is the most common one on an industrial scale due to its operation simplicity and its low maintenance costs [2,3].

Biological systems have complex dynamics, difficult to control, and can be affected by several variables. Microalgae growth depends on temperature, solar radiation, pH and dissolved oxygen [4]. The incidence of solar radiation and temperature conditions are determined by the reactor design. Therefore, the controlled variables are pH and dissolved oxygen, both of which are disturbed by solar radiation [5]. Concretely, pH is more critical in the growth process because of its direct influence on the photosynthesis process, and thus it is the controlled variable analysed in this work.

Traditionally, microalgae reactors are operated by On/Off controllers that work only during the daytime period. In this way, the pH of the microalgae varies significantly during the whole day, especially during nighttime, being harmful to the algae. Furthermore, this type of control does not achieve enough efficiency in productivity to compete against other biofuel sources in the energy market. Therefore, it is necessary to improve the control algorithms that allow the critical variables of the system to be maintained at optimum values while reducing the cost of biomass production. The Proportional-Integral-Derivative (PID) controllers are widely used in industry with satisfactory control results (performance) and can be used for these type of processes. Different examples can be found in the literature. An example of a linear Proportional-Integral (PI) controller with feedforward for pH control in tubular bioreactors can be found in [6]. A robust PID controller for pH control in raceway reactors based on Quantitative Feedback Theory (QFT) has been used in [7]. On the other hand, event-based control is gaining great interest for these kinds of processes, where the sensors are at a considerable distance from the control device. Moreover, these sensors can be wireless, so the use of event-based controllers would increase their life span. In [8], a controller with a sensor deadband produces a considerable reduction of CO2 losses in a microalgae tubular reactor. Another example of the application of event-based control can be seen in [9], where an event-based Generalized Predictive Controller (GPC) with a disturbance compensation approach is used for the effective use of CO2 in a raceway reactor. Subsequently, this GPC scheme was improved and combined with a selective control for dissolved oxygen [5]. Thus, through the event-based control paradigm, the desired trade-off between control performance and control effort was achieved. In addition, the actuator provides only the amount of gas needed, keeping the pH at an optimum value while reducing gas consumption.

In this work, the advantages of using PI control during the whole day (daytime and nighttime periods) against traditional On/Off control (performed only during daytime) are demonstrated. The greatest advantage that can be found in the use of PI control is the reduction in CO2 consumption, despite operating the reactor during the whole day. In this way, the necessary amount of CO2 must be injected to avoid losses to the atmosphere, while maintaining the pH at certain levels allowing the growth of the algae. Another advantage is the reduction in the Integrated Absolute Error (IAE) for pH, which helps to maintain the pH close to the set-point throughout daytime and nighttime. However, On/Off control leaves the pH to evolve free during nighttime, increasing the IAE value.

Moreover, this paper presents an event-based control architecture for PID controllers. The objective is to tune a classical time-driven PI for pH control in the raceway reactor, and then to add event-based capabilities but keeping the initial PI control design. The event-based systems allow a trade-off between control performance and control effort, being perfect for the microalgae process in raceway reactors. Thus, this type of event-based control improves the PI controller behaviour so that the CO2 consumed can be further reduced at the expense of a slight degradation of the pH, also reducing the associated valve control effort.

One of the best-known event-based sampling methods is the so-called Send-On-Delta (SOD) sampling [10,11], a deadband or level-crossing sampling method where a node samples the signal only when it changes of a fixed value with respect to the previously sampled value. A modified version of the SOD technique, called Symmetric-Send-on-Delta (SSOD) sampling [12–14], applied to a Proportional-Integral (PI) controller, has been used in this work. In particular, two control schemes from this sampling method, called SSOD-PI and PI-SSOD have been proposed. The difference between both architectures depends on were the triggering function is applied in the control loop. This method improves the SOD sampling with a symmetric deadband mapping. The stability properties and limit cycles conditions for first-order-plus-dead-time (FOPDT) processes are highlighted in [12].

Therefore, this work focuses on a simulation study of the event-based SSOD approach combined with a PI controller in a dynamic model for microalgae production [15]. Two control architectures of the SSOD event-based method (SSOD-PI and PI-SSOD) are compared to an On/Off control method, which is traditionally used to operate these kinds of reactors for pH control. The performed tests were oriented to establish a trade-off between control effort and control performance and present an alternative to traditional control. In addition, the advantages and disadvantages over classical time-driven PI control techniques are presented.

The paper is organized as follows. The control scheme is presented in Section 2, where the control problem and the SSOD architecture are also described. The controller design, results, and discussion obtained from the simulation study are presented in Section 3. Finally, conclusions are drawn in Section 4.

#### **2. Material and Methods**

This section describes the control problem, the Symmetric-Send-on-Delta approach and two configurations applied to a PI controller.

#### *2.1. Microalgae Raceway Reactor*

The reactor simulator model represents a raceway reactor located at "Estación Experimental Las Palmerillas" owned by the *Fundación Cajamar* Cajamar, Almería, Spain. This reactor has a total surface area of 100 m2, formed of two channels of 50 m that are connected by 1 m width U-shaped bends (Figure 1). The raceway reactor is operated at 0.2 m constant depth (20 m3 total volume), as recommended in [16] to achieve the best overall hydraulic performance in terms of power consumption. Mixing is made with a 1.2 m diameter paddlewheel with eight blades of marine plywood, operated by an electric motor. Otherwise, carbonation is carried out in a sump (1 m deep and 0.65 m wide) at 1.8 m from paddlewheel. Three plate membrane diffusers at the bottom inject flue gas in the sump.

**(a)** Reactor scheme (top and side view). **(b)** Reactor view.

#### *2.2. Reactor Dynamic Model*

For the simulation results presented, a dynamic model of microalgae production in raceway reactors has been used [15]. The model is based on fundamental principles instead of empirical equations and takes into account mass balances, thermodynamic relationships and biological phenomena. This model can be used to predict the evolution of the main reactor variables, such as biomass concentration, pH and dissolved oxygen. It has been calibrated and validated using experimental data from a 100 m<sup>2</sup> pilot-scale raceway reactor, as can be seen in [15].

The culture growth is modelled as a function of the photosynthesis rate. The main parameter that determined the photosynthesis rate is the available light, which is based on different parameters such as external irradiance, culture characteristic, and reactor design [17]. The following equation represents the available light:

$$I\_{\rm av}(t,\mathbf{x}) = \frac{I\_0(t)}{K\_\mathbf{a} \mathbb{C}\_b(t,\mathbf{x})h} (1 - \exp(-K\_\mathbf{a} \mathbb{C}\_b(t,\mathbf{x})h),\tag{1}$$

where *t* is the time, *x* the space, *I*<sup>0</sup> is the solar irradiance on an obstacle-free horizontal surface, *Ka* is the extinction coefficient, *Cb* is the biomass concentration, and *h* is the liquid height on the channels.

The photosynthesis rate is modelled with the available light by the following equation [4]:

*Processes* **2019**, *7*, 247

$$\begin{split} P\_{\rm O\_2}(t, \mathbf{x}) &= (1 - a\_s) \frac{P\_{\rm O\_{2,max}} I\_{4\rm v}(t, \mathbf{x})^n}{\mathcal{K}\_\mathbf{i} \exp\left(I\_{4\rm v}(t, \mathbf{x}) m\right) + I\_{4\rm v}(t, \mathbf{x})^n} \left(1 - \left(\frac{[\rm O\_2](t, \mathbf{x})}{\mathcal{K}\_\mathbf{O\_2}}\right)^2\right) \\ &\times \left(B\_1 \exp\left(\frac{-\mathcal{C}\_1}{pH(t, \mathbf{x})}\right) - B\_2 \exp\left(\frac{-\mathcal{C}\_2}{pH(t, \mathbf{x})}\right)\right) - a\_s R\_{\rm O\_2}, \end{split} \tag{2}$$

where *PO*<sup>2</sup> is the photosynthesis rate, *α<sup>s</sup>* is a solar distributed factor that represents the shadow projection on the perpendicular axis of the reactor walls, *PO*2,*max* is the maximum photosynthesis rate for microalgae under culture conditions, *n* is the form exponent, *Ki* and *m* are form factors for the exponential function of average irradiance. Furthermore, *B*<sup>1</sup> and *B*<sup>2</sup> are pre-exponential factors for the pH influence on the photosynthesis rate, and *C*<sup>1</sup> and *C*<sup>2</sup> are the activation energies of the Arrhenius model. *RO*<sup>2</sup> is a respiration constant that represents the respiration phenomenon.

The influence of pH and dissolved oxygen in the photosynthesis rate equation is of special attention, being the main variables of the system that have to be controlled.

These equations describe the biological part of the system, while the mixing and the gas–liquid mass transfer are expressed by several balances formulated in terms of Partial Differential Equations (PDE).

In [18], the pH is related to other variables such dissolved oxygen, carbonate or bicarbonate by several equilibrium equations. From these balances' equations, a prediction of pH along time and space can be obtained. In the following equation, the inorganic carbon concentration ([*CT*]) is modelled taking into account the microalgae photosynthesis process and transport phenomena due to recirculation along the raceway reactor. We assumed constant velocity (*v*), and constant cross-sectional area due to the multiplication between the liquid height (*h*) and the channel width (*w*):

$$\begin{split} \text{with} & \frac{\partial \left[ \mathbb{C}\_{\text{T}} \right](t, \mathbf{x})}{\partial t} = -\text{whv} \frac{\partial \left[ \mathbb{C}\_{\text{T}} \right](t, \mathbf{x})}{\partial \mathbf{x}} + \text{wh} \frac{R\_{\text{CO}\_{2}}(t, \mathbf{x}) \text{Cb}(t, \mathbf{x})}{M\_{\text{CO}\_{2}}} \\ & + \text{whK}\_{\text{InCO}\_{2\epsilon}} \left( \left[ \text{CO}\_{2}^{\*} \right](t, \mathbf{x}) - \left[ \text{CO}\_{2} \right](t, \mathbf{x}) \right) \end{split} \tag{3}$$

where *PCO*<sup>2</sup> is the carbon consumption rate, *MCO*<sup>2</sup> is the molecular weight of CO2, and *KlaCO*<sup>2</sup>*<sup>c</sup>* is the mass transfer coefficient for CO2. The term [*CO*2] represents the carbon dioxide in the liquid phase and [*CO*∗ <sup>2</sup> ] represents the equilibrium concentration in the gas phase, which can be calculated by Henry's law taking into account the CO2 properties in the air.

As for the inorganic carbon concentration, a balance equation for the dissolved oxygen is presented:

$$\begin{split} \text{with } \frac{\partial \left[O\_2\right](t,x)}{\partial t} = -whv \frac{\partial \left[O\_2\right](t,x)}{\partial x} + wh \frac{P\_{O\_2}(t,x)Cb(t,x)}{M\_{O\_2}} \\ + whK\_{lvO\_2\_c} \left( \left[O\_2^\*\right](t,x) - \left[O\_2\right](t,x) \right), \end{split} \tag{4}$$

where *PO*<sup>2</sup> is the photosynthesis rate previously described, *MO*<sup>2</sup> is the molecular weight of the oxygen, and *KlaO*<sup>2</sup>*<sup>c</sup>* is the volumetric gas–liquid mass transfer coefficient for oxygen. The term ([*O*<sup>∗</sup> <sup>2</sup> ](*t*, *x*) − [*O*2]) represents the driving force, where the equilibrium concentration in the gas phase [*O*∗ <sup>2</sup> ] can be calculated by Henry's law, as a function of the oxygen concentration in the gas phase.

Other mass balances can be applied to the paddlewheel and sump of the raceway reactor and represented by Ordinary Differential Equations (ODE) expressions. In the sump, CO2 is injected in a gaseous form to control pH, and the air is injected to remove dissolved oxygen accumulated in the reactor.

The oxygen balance is established from the relationship of the gases to the nitrogen molar ratio due its solubility is approximately zero and can be considered constant:

$$\begin{array}{l} \frac{dYO\_{2,\text{out}}(t)}{dt} = -\frac{Q\_{\text{gas}}}{V\_{\text{s}}(1-\varepsilon\_{\text{s}}(t))} (YO\_{2,\text{out}}(t) - YO\_{2,\text{in}}(t)) \\\ -K\_{\text{l}\alpha O\_{2s}} \frac{V\_{\text{mol}}}{\mathcal{Y}\_{\text{N}\_2}} \frac{(1-\varepsilon\_{\text{s}}(t))}{\varepsilon\_{\text{s}}(t)} ([O\_2^\*](t) - [O\_2](t))\_{l\text{m}} \end{array} \tag{5}$$

where *YO*<sup>2</sup> is the oxygen to nitrogen molar ratio in the gas phase, defined in the inlet and outlet of the sump, *Vmol* is the molar volume under reactor conditions, and *yN*<sup>2</sup> is the nitrogen molar fraction.

An analogous mass balance can be described for the carbon dioxide, where *YCO*<sup>2</sup> is the carbon dioxide to nitrogen molar ratio in the gas phase:

$$\begin{array}{l} \frac{dY \text{CO}\_{2,out}(t)}{dt} = -\frac{Q\_{\text{S}}u}{V\_{\text{s}}(1 - \varepsilon\_{\text{s}}(t))} (Y \text{CO}\_{2,out}(t) - Y \text{CO}\_{2,in}(t)) \\\ -K\_{\text{laCO}\_{2,s}} \frac{V\_{\text{rad}}}{V\_{\text{N}\_2}} \frac{(1 - \varepsilon\_{\text{s}}(t))}{\varepsilon\_{\text{s}}(t)} ([\text{CO}\_{2}^{\ast}](t) - [\text{CO}\_{2}](t))\_{lm} . \end{array} \tag{6}$$

#### *2.3. Microalgae Strain*

The microalgae strain used corresponds to *Scenedesmus almeriensis* (CCAP 276/24). This microalga is characterized by a high growth rate, withstanding temperature up to 45 ◦C and pH values from 7 up to 10, although its optimum conditions are 30 ◦C and pH around 8. In particular, in this work, a set-point of 7.8 will be considered.

#### *2.4. Control Problem*

To maintain the microalgae culture in good conditions inside the raceway reactor, it is necessary to maintain two main variables at their optimal values, the pH and dissolved oxygen. These variables are controlled by injecting CO2 and air, respectively, into the sump. However, the pH has a more critical role than the dissolved oxygen and it will be the controlled variable in this work.

The control problem consists of maintaining the pH of the culture at a given level. The injection of CO2 coming from flue gases reduces the pH level due to the formation of carbonic acid, while the photosynthesis process increases the pH due to consuming CO2 and producing *O*2.

When more CO2 is injected in excess and it cannot be completely dissolved in the water, it is released into the atmosphere, being harmful to the environment. Thus, an adequate control algorithm is required to look for a trade-off between the pH control and the CO2 injections. Furthermore, reducing the number of CO2 injections in the reactor implies a reduction of the costs and an increment of the life-span of the electronic valves. Summarizing, the control scheme is presented in the following way: the process output is the culture pH, the aperture of the flue gas injection valve is the manipulated variable, and the solar radiation acts as the main disturbance.

The On/Off controllers are widely used for pH control in raceway reactors as in other industrial processes, due to its simplicity. Its behaviour is a relay with hysteresis and represents the most simple feedback controller that can be used to control a process. This type of control is suitable for processes that have two states (open and close) because the controller switches the control variable between two states (on or off), depending on the set-point error with respect to the controlled variable. However, this type of control is characterized by low accuracy and pH oscillations due to the changes in the control signal, causing a negative influence on microalgae. The On/Off valve is opened and flue gases are injected until the pH measure decreases below the set-point; then, the control valve is closed until the pH reaches a value above the set-point, and so on.

On the other hand, PI control has proven to be advantageous over traditional On/Off control, as shown in [6,7]. This type of control allows the pH to be maintained close to the set-point, reducing the characteristic oscillations of On/Off control and, in addition, improving the control signal of the valve.

Recently, the use of event-based PI controllers is increasing thanks to the advantages they have over the use of classical PI controllers. Using event-based architectures applied to PI controllers allows the reduction the CO2 consumption in the injections, granting a smooth degradation in pH. Moreover, it is also possible to reduce the control effort in the valve and, in addition, to increase the battery life span of wireless sensors.

**Figure 2.** Symmetric-Send-On-Delta (SSOD) control architecture schemes: Symmetric-Send-On-Delta-Proportional-Integral (SSOD-PI) controller (top) and Proportional-Integral-Symmetric-Send-On-Delta (PI-SSOD) controller (bottom). Dashed blocks: Governor, Sensor Unit (SU), Control Unit (CU) and Actuator Unit (AU).

#### *2.5. Symmetric-Send-on-Delta Method*

The event-based method, applied to a PI controller, used in this work is derived from the Send-On-Delta method [10,11]. This derivation is called Symmetric-Send-On-Delta [12], and, generally, it can be seen as a relay behaviour with hysteresis.

The behaviour can be described with the following equation:

$$\upsilon^\*(t) = \begin{cases} (i+1)\Delta\beta & \text{if } \frac{\upsilon(t)}{\Delta} \ge (i+1) \text{ and } \upsilon^\*(t^-) = i\Delta\beta\\ \displaystyle i\Delta\beta & \text{if } \frac{\upsilon(t)}{\Delta} \in [(i-1), (i+1)] \text{ and } \upsilon^\*(t^-) = i\Delta\beta\\ (i-1)\Delta\beta & \text{if } \frac{\upsilon(t)}{\Delta} \le (i-1) \text{ and } \upsilon^\*(t^-) = i\Delta\beta \end{cases} \tag{7}$$

In [12], it has been demonstrated that the parameter Δ influences the system tolerance without affecting the system stability. For this reason, it has to be properly tuned to establish a trade-off between the increments of the steady-state error and the decrements of the number of events.

#### *2.6. Event-Based Control Architectures*

Two different architectures are implemented with the SSOD technique based on the event-triggered data exchange position in the control loop and are shown in Figure 2. In this figure, the dashed blocks are as follows:


These blocks can be coupled depending on the control configuration, being possible to use wireless devices when are far from the main control.

#### 2.6.1. SSOD-PI Scheme

The first architecture is called SSOD-PI controller because the SSOD block is placed in the SU, before the PI controller in the control loop. In this scheme (Figure 2 top), the CU and the AU are located in the same machine while the SU is located separately. Thus, the communication from the sensor could be wireless. The control action is computed by the controller at a regular sampling rate, considering the last received sampled error. One of the benefits of this configuration is the reduction

on the communication between the sensor and the control unit, improving the life span of the batteries of wireless sensors.

#### 2.6.2. PI-SSOD Scheme

In the other scheme, the SSOD block is located after the PI controller in the control loop and it is called PI-SSOD. In this case, the SU and the CU are placed in the same machine, while the AU is located separately and can be powered independently. The control action is sent to the actuator, which holds the last received control signal until the next data exchanging triggering event. Analogous as the SSOD-PI scheme, this configuration presents a reduction of the number of changes in the control action, thus the actuator wear can be reduced.

#### **3. Results and Discussion**

This section discusses the results obtained in simulation with the application of two SSOD event-based architectures for the pH control problem in a raceway simulator [15]. Several experiments were performed with different solar radiation profiles during five days to observe how the event-based controller reacts to changes in the photosynthesis rate and in the pH variable. An evaluation of the pH referred to the Integrated Absolute Error, to the control effort and to the CO2 consumption associated with the injection time have been carried out.

The aim is to establish a comparison between the traditional On/Off controller architecture and the SSOD event-based method. An initial comparison was made between the traditional On/Off control operating during daytime and a PI control architecture that operates both during daytime and nighttime periods. Afterwards, further comparisons have been made with the SSOD event-based control architectures (SSOD-PI and PI-SSOD) from the initially designed PI controllers and applied to the combined daytime-nighttime solution. Results about the stability of SSOD-PI and PI-SSOD for FOPDT processes can be found in [12].

Usually, the pH control is performed only during the diurnal period because of its influence on the photosynthesis process. Thus, the system is working in open-loop during the night period to save CO2 injections and thus saving costs and CO2 losses. However, in this work, the control scheme will be evaluated for the whole day in order to analyse how the (event-based) control approach can contribute to control the system also during the night and without increasing the costs too much. Notice that the pH presents different dynamics at the diurnal and nocturnal periods. Thus, two different PI controllers will be designed for diurnal and nocturnal situations.

In a previous work [19], two different linear models were identified for both daytime and nighttime periods:

$$\log G(s)\_{daytime} = \frac{-4.100}{3390 \cdot s + 1} \cdot e^{-100 \cdot s} \,\tag{8}$$

$$G(s)\_{n \cdot ghthine} = \frac{-1.619}{2171 \cdot s + 1} \cdot e^{-100 \cdot s}. \tag{9}$$

It is worth noting that the normalized dead time of the system, that is, the ratio between the dead time and the time constant, in both cases, is very small, i.e., the process is lag dominant. For this reason, among the wide variety of PID tuning rules [20], a Simple-Internal-Model-Control (SIMC) tuning rule [21,22] has been selected, which states that the PI parameters have to be selected as:

$$\begin{aligned} K\_{\mathcal{P}} &= \frac{1}{k} \frac{T}{\lambda + \theta}, \\\\ T\_{\ell} &= \min \{ T, 4(\lambda + \theta) \}, \end{aligned}$$

where *θ* is the dead time of the process, *T* is its time constant and *λ* is the desired closed-loop time constant. The value of *λ* should be greater than or equal to the system dead time. The closed-loop time constant, in the two cases, has actually been fixed as 0.2 times the open-loop time constants, which results in *λ* = 678 (daytime) and *λ* = 434.2 (nighttime) seconds. These values result, indeed, to be much higher than the dead times, ensuring a high robustness to the system, which is desirable by considering the linealization procedure of the system model (2)–(6). Then, the following PI controllers were obtained:

$$\mathcal{C}(s)\_{dragtimu} = -1.063 \cdot \left(1 + \frac{1}{3112 \cdot s}\right).$$

$$\mathcal{C}(s)\_{nlgttimu} = -2.511 \cdot \left(1 + \frac{1}{2137 \cdot s}\right).$$

Obviously, when tuning a PI controller, it is important to ensure the asymptotic stability of the system [23–25]. For this reason, the analysis provided in [12] to determine the parameter stability region for which there are no limit cycles for the two systems (8) and (9) have been performed. Results are shown in Figures 3 and 4 and they confirm that, for both controllers, the parameters have been selected so that the avoidance of limit cycles and instability is ensured. Moreover, the tuning is also robust as the parameters are far from the border of the region.

**Figure 4.** Stability region for nighttime controller.

Tables 1–3 show the performance indexes for the control architectures tested during the five days. In these tables, *IAE* is the Integrated Absolute Error (also during daytime and nighttime), *TVu* is the total variation in the control signal, *Ey*(*day*) and *Ey*(*night*) are the number of events during daytime and nighttime periods, *IT* is the CO2 injection time to the reactor (also during daytime and nighttime) and *Gas* is the CO2 consumption.

#### *3.1. PI Controller Results*

The first scenario shows the simulation results considering two control architectures, a traditional On/Off controller (red) operated during daytime (the system is in open loop during the nighttime) and a combined daytime-nighttime PI control (black). Figure 5 shows a two days simulation where it can be seen how the pH oscillates around set-point (7.8) during daytime for the On/Off controller. These oscillations range from 7.73 to 7.9 while, for the PI controller, the pH remains close to the set-point. Another remarkable fact is the variation of the pH during nighttime, which, in the case of On/Off control, can reach values of 8.7. On the opposite, the nighttime PI controller keeps the pH around set-point in that period.

**Figure 5.** Two days comparison between traditional On/Off daytime control (red) and PI control during daytime and nighttime (black).

Referring to the control effort, the control signal graphic of Figure 5 represents the opening of the injection valve for both control schemes. In this graphic, it can be verified that, in the case of the On/Off controller, the valve opens completely in short periods of time, which causes a great control effort. In the case of the PI controller, the maximum opening of the valve is around 23% and 12.5% for the daytime and nighttime periods, respectively.

In Table 1, the indexes for these two control schemes during the five days can be seen. Starting with the IAE, it is very remarkable how the PI controller reduces this error by up to 98.40% with respect to the On/Off control, since it also operates during the nighttime. Observing this error independently between the daytime and nighttime periods, reductions of the order of 88.21% and 99.08% respectively for the IAE can be achieved. From the point of view of the total variation in the control signal, the PI control reduces this variation by 94.16%, due to a more accurate control during the daytime and even the nighttime. This improvement in the control signal is reflected in a reduction of the control effort. The most remarkable comparison that can be made is about injection time and gas consumption. The PI

controller reduces these values by 13.78% compared to the On/Off control, despite operating during the entire day and not only during the daytime period.


**Table 1.** Performance On/Off and Proportional-Integral (PI) control indexes.

#### *3.2. SSOD-PI Controller Results*

The second scenario presents the results of the SSOD-PI control architecture for five days. Figure 6 represents the SSOD-PI approach for the pH control problem with two different Δ values (Δ = 0.01 and Δ = 0.05 for daytime and Δ = 0.05 for nighttime). By analysing the graphics of Figure 6, a comparison can be established between both Δ values, which represent the lowest and higher values studied for this SSOD configuration. Regarding pH (first plot), during the night, both signals show similar behaviour, due to a Δ value of 0.05. On the contrary, during the daytime period, the change in the tolerance produced by the Δ parameter is appreciated. With a Δ value of 0.01 (black), it can be seen that the pH it kept around set-point with a peak at the beginning of the daytime period caused by the dilution process (microalgae raceway reactor works in continuous mode, where biomass is extracted every morning at the same hour and medium is injected to keep the same volume in the reactor). On the other hand, with a Δ value of 0.05 (red), this dilution peak is increased due to a lower tolerance caused by a higher Δ value.

Moreover, at the end of the daytime, a peak is observed, which is produced by a decrease in solar radiation and greater tolerance in the event-band. For the control signal (second plot), during the nighttime period, the response of the valve is the same in both cases. Regarding the daytime, the control signal corresponding to a Δ value of 0.05 shows a slower rise at the beginning of the daytime period and a higher average value with respect to the Δ value of 0.01. In relation to the events (third and fourth plots), a decrease in the number of events can be appreciated when the value of the Δ parameter increases, as it can be seen in Table 2.


**Table 2.** Performance Symmetric-Send-On-Delta-Proportional-Integral (SSOD-PI) indexes.

*Processes* **2019**

, *7*, 247

**Figure 6.** Results with the SSOD-PI controller. Δ = 0.01 (black) and Δ = 0.05 (red). First plot: pH output. Second plot: control signal. Third plot: diurnal events. Fourth plot: nocturnal events. Fifth plot: solar radiation.

The SSOD-PI performance indexes are presented in the Table 2, where the test carried out with different Δ values (Δ = 0.01, 0.02, 0.03, 0.04 and 0.05) are collected for five days each. The IAE error increases during the daytime period as the Δ value increases, while for the nighttime similar values result for all cases. This is due to the fact that a fixed Δ value was used for the nighttime period while a value from 0.01 to 0.05 was used for the daytime, thus increasing the error tolerance. Therefore, due to this increase in the error tolerance, the number of events—or communications between the sensor and the control unit—will be reduced with the increase of the Δ value, as can be seen in the table, especially during the daytime period. The total variation increases slightly in every case due to the tolerance imposed by the Δ value, which makes the control signal during the daytime period more constant but higher in the case of Δ = 0.05. Regarding the injection time and gas consumption, there is no significant variation between cases, ranging from 1537.70 min (Δ = 0.01) to 1545.70 maximum (Δ = 0.04), with the highest consumption during the daytime period.

### *3.3. PI-SSOD Controller Results*

The last scenario presents the results of the PI-SSOD control architecture for five days. Figure 7 shows the simulation performed using different Δ values (Δ = 0.001 and 0.01) to compare both results. In the top plot, the pH behaviour during the whole experiment is presented, where the pH reaches a higher value during the dilution process on daytime for the Δ value of 0.01. This dilution process acts as a disturbance at the same hour for every simulated day and the controller reacts later than for a Δ value of 0.001 because the event-based control method has a higher tolerance regarding the step in the control signal. On the other hand, for the Δ value of 0.001, this peak is smaller and the pH remains around the set-point. In the nighttime period, a Δ value of 0.006 for the PI controller was used for all the experiments, to maintain the pH oscillating close to the set-point.

In the second plot, the combined control signal applied to the actuator is shown. This signal is similar during the nighttime period for both simulations, and during the start of the daytime period, it can be seen that the signal corresponding to Δ value of 0.01 begins to act later than for the Δ value of 0.001.

The daytime and nighttime events are presented in the third and fourth plots, respectively. It can be seen that, during the daytime, there are fewer events than during nighttime, as it can be checked in Table 3, because of the small deadband in the nighttime period.

Table 3 shows the performance indexes for all Δ cases studied (Δ = 0.001, 0.003, 0.005, 0.007 and 0.01) during a period of five days. Comparing the IAE, it can be appreciated that it increases as the Δ value increases because the increments in the control signal are greater. The error during nighttime is similar in all cases, due to the same Δ value used in that period. The total variation does not show a regular increase or decrease, and it varies depending on the Δ value because the control signal is similar in all cases. The only observed difference is a later actuation during the daytime period. The daytime events are reduced as the Δ value increases and they remain similar during nighttime as the IAE and the nighttime events. The injection time and gas consumption do not show much variation in the analyzed cases. In the case of Δ = 0.01, the reduction in the injection time due to the dilution peak above the set-point is compensated with an increase due to the opposite effect, the period in which the pH remains below the set-point. Thus, gas consumption is similar to the case of Δ = 0.001, where the pH remains close to the set-point.

*Processes* **2019**

, *7*, 247

**Figure 7.** Results with the PI-SSOD controller. Δ = 0.001 (black) and Δ = 0.01 (red). First plot: pH output. Second plot: control signal. Third plot: diurnal events. Fourth plot: nocturnal events. Fifth plot: solar radiation.


**Table 3.** Performance Proportional-Integral-Symmetric-Send-On-Delta (PI-SSOD) indexes.

#### *3.4. Discussion*

As verified from the first scenario comparing the On/Off control with the PI control architecture, this last scheme brings a series of benefits to the pH control problem with respect to the traditional one. It provides an improvement in the CO2 usage even operating the reactor during both daytime and nighttime, while the On/Off control was used only during the diurnal period.

On the other hand, the event-based control architectures based on the SSOD method and coupled with a classical time-driven PI (SSOD-PI and PI-SSOD) controller also count with the benefits that improve the reactor control compared to the traditional On/Off control. Comparing these event-based control architectures with respect to the PI control, certain advantages are obtained accompanied by a series of disadvantages related to the trade-off between tolerance and control accuracy. Looking at Tables 1–3, the first advantage for the event-based schemes is the reduction of the CO2 consumption, at the expense of degrading the pH control performance slightly by increasing the IAE values. This reduction is obviously more relevant when the plant operates for long periods of time (i.e., months). The second advantage is related to the control effort, which is reduced due to control tolerances established in both daytime and nighttime periods, as can be seen, by the total variation and injection time.

Finally, the two event-based control architectures (SSOD-PI and PI-SSOD) show some differences between them regarding the event-based architectures and the Δ values suitable for its operation. One of the main differences that can be seen between the two architectures is that the Δ parameter has a greater influence on the PI-SSOD scheme since small variations of this parameter showed greater changes in IAE, as from Tables 2 and 3. The PI-SSOD scheme shows a greater reduction in the total variation of the control signal with respect to the SSOD-PI. On the contrary, the SSOD-PI scheme shows less number of events, being more suitable for use with wireless sensors. Regarding the injection time, it can be appreciated that, for the PI-SSOD architecture, it is slightly higher than for the SSOD-PI one. These differences are due to the event-based triggering method in both cases, where the Δ parameter does not work in the same way, and therefore, it must be selected regarding the needs of the process.

#### **4. Conclusions**

In this paper, two event-based control architectures derived from the SSOD method have been presented. Two event-based PI controllers (for daytime and nighttime periods) with different Δ values were evaluated to establish a comparison with classical time-based PI controllers and traditional On/Off control. The main objective is to reduce CO2 injection and control effort in the reactor maintaining a satisfactory pH control within established thresholds.

Simulation tests with both event-based architectures have been carried out obtaining promising results in the response of pH and gas consumption. These proposed event-based controllers provide improvements in the Integrated Absolute Error, gas consumption and control effort with respect to the traditional On/Off control for this process. The use of classical PI controllers improves traditional control, and then the use of event-based controllers coupled with PI ones offers even more advantages. One of the most remarkable results is the need to operate the reactor throughout the whole day (daytime and nighttime periods) versus the daytime operation of the traditional control to improve the pH control and save CO2. The tolerance in the output signal for the daytime and nighttime periods was better controlled, reducing CO2 consumption and improving the control effort at the same time, which results in benefits in terms of cost savings and maintenance.

The results have shown that the output tolerance can be varied by adjusting the Δ parameter, becoming another tuning variable in the control architecture. The higher this parameter is, the greater the process tolerance, reducing the number of events at the expense of degrading control performance.

The use of the proposed event-based controllers can improve the biomass production and would reduce the costs of the operations. In general, these controllers allow the use of wireless sensors/actuators and its implementation does not require a special hardware for the controller, as the control code is fairly simple. It is also worth stressing that event-based control somehow mimics the manual control of an operator, who usually changes the value of the manipulated variable when an event occurs. For this reason, it is likely that this strategy is well accepted by operators. Future work will consist of the implementation of the proposed control strategies in a real raceway reactor.

**Author Contributions:** E.R.-M. participates in the implementation, validation and analysis of the presented data. He also contributed in the writing—original draft preparation. M.B. (Manuel Beschi) participated in the writing—original draft preparation and the design of the proposed event-based control methodology. A.V., M.B. (Manuel Berenguel) and J.L.G. contributed in writing—review and editing, formal analysis and funding acquisition. Moreover, A.V. participated in the evaluation of the event-based control approaches, and M.B. (Manuel Berenguel) and J.L.G. in the implementation and analysis of the simulator for the microalgae raceway reactor.

**Funding:** This work has been partially funded by the following projects: DPI2014-55932-C2-1-R and DPI2017-84259-C2- 1-R (financed by the Spanish Ministry of Science and Innovation and EU-ERDF funds), and the European Union's Horizon 2020 Research and Innovation Program under Grant Agreement No. 727874 SABANA.

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

### **Abbreviations**

The following abbreviations are used in this manuscript:


#### **References**


© 2019 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 (http://creativecommons.org/licenses/by/4.0/).
