Fuzzy Sliding Mode Control for Microbial Fuel Cells

: The microbial fuel cells (MFCs) are a kind of green energy with good prospects, which provides an effective solution to the problem of unsustainable development of energy today. Aiming at the problem that MFCs are susceptible to various external disturbances, a sliding mode (SM) controller for MFCs is designed in this paper. The controller can effectively reduce the inﬂuence of external disturbance on voltage output and improve the practicability of microbial fuel cells (MFC). At the same time, aiming at the chattering problem of the basic SM control, a fuzzy sliding mode (FSM) control method is proposed by combining the fuzzy logic theory and the SM control. The design method of FSM controller is given by using Lyapunov theory. The method can adaptively adjust the parameters according to the difference between the actual value of the substrate concentration and the set value. The controller can reduce the system input chattering and the inﬂuence of external disturbances on the system output. Simulation results show that compared with SM control and backstepping control, the designed method has smaller steady-state error and overshoot.


Introduction
At present, the world's energy crisis is becoming increasingly severe, and the excessive use of fossil fuels has also caused serious social problems [1][2][3]. The search for new environmentally friendly energy has become an important research direction at this stage [4]. The MFCs are a new type of renewable and clean energy [5,6]. They can use anaerobic bacteria to decompose organic matter contained in water or sludge to generate electricity, and the decomposition process does not produce other harmful substances [7]. The MFCs are an efficient way to treat wastewater and recover energy. They also provide a reliable solution to the energy problem [8]. At the same time, a large amount of domestic sewage provides sufficient reaction substrates for the MFCs, which makes the MFC have a broad application prospect [9].
MFCs mainly exist in the laboratory stage. Their production voltage is low and prone to large fluctuations. Meanwhile, the discharge power is also difficult to meet the requirements of large-scale applications [10,11]. At present, many studies have focused on the selection of MFC materials, microbial selection, and the design of external controllers, and have achieved many good results [12][13][14]. MFCs must be externally controlled to achieve good voltage output [10]. At present, many control methods for MFC have been proposed. Just to name a few, a fuzzy PID method is proposed to realize the constant voltage output in two-chamber MFC [15]. In [16], a model predictive control strategy is used to achieve good steady-state performance and dynamic performance of MFC. In [10], a backstepping control strategy is proposed to deal with the parameter uncertainty existing in the model. The above studies have achieved good control results. However, few studies have considered the substrate interference of MFCs, which are affected by temperaturedependent microbial decomposition rates, anode feed impurities, and other factors.
The MFC system uses electricity-generating microorganisms to decompose organic matter and convert chemical energy into electrical energy [17][18][19]. The complexity of the microbial production mechanism makes it difficult to simplify the internal reaction to a linear model, that is to say, the MFCs is inherently nonlinear [20,21]. At the same time, in the process of MFC power generation, the substrate concentration of MFC is often disturbed by various factors. These external disturbances will cause large voltage fluctuations and make it difficult for the system output voltage to meet the application requirements [10]. Therefore, it is very necessary to design a suitable controller to make the system have certain anti-disturbance performance and improve its discharge efficiency.
Aiming at the problem that MFC is susceptible to external disturbances, we found that SM control is a control method suitable for nonlinear systems. The SM control can also restrain the external disturbance of the system [22]. In the dynamic process, SM controller can force the system to move according to the predetermined state trajectory of the sliding surface according to the current state of the system [23]. By designing a suitable SM surface, the output of the system can be tracked to the set value, and the system has a certain anti-interference ability [24]. SM control has the advantages of quicker response speed to the control target and easier implementation in physical systems. At present, SM control has been widely applied in the field of control engineering [25][26][27]. For MFC, it is beneficial to improve its discharge performance by stabilizing the substrate concentration at the set value by an external controller. Therefore, one of our goals is to propose a SM control method for MFC that can stabilize the substrate concentration at a set value and has anti-interference ability.
As we all know, SM control has chattering problems, that is, the large-scale rapid switching of system control input, which is difficult to achieve in practical control systems [28]. At the same time, the existence of chattering can excite high-frequency unmodeled dynamics in the system, which can cause system instability and even control system collapse. Therefore, another goal of this study is to ensure system stability while reducing the impact of input chattering on the system. FSM control is an effective method to reduce chattering of SM control system. The basic idea is to compensate the influence of unmodeled dynamics by adjusting the fuzzy logic in the approaching stage of SM control system, so as to improve the quality of control system, reduce the time to reach the sliding surface, and reduce chattering [29]. To sum up, it is feasible to use FSM control to reduce the chattering problem of MFC SM control and improve the stability of MFC output voltage.
In this paper, an MFC FSM controller is designed by combining fuzzy logic with SM control. The innovations of this paper are mainly from the following two points. (1) A fuzzy sliding mode control method for MFCs is proposed in this paper, which can reduce the influence of external disturbances on the system and reduce the chattering phenomenon of the control system. (2) Compared with backstepping control [10] and SM control methods, the control method proposed in this paper has smaller steady-state error and overshoot. The chapters of this paper are arranged as follows. The second part mainly introduces the MFC model. The third part gives the design method of FSM controller. The fourth part presents and compares the simulation results of basic SM control, FSM control and backstepping control. The fifth part is conclusion.

Introduction of MFCs
This section mainly introduces the MFC reaction mechanism and the MFC mathematical model.

Mfc Reaction Mechanism
MFCs are usually divided into single-chamber MFCs and dual-chamber MFCs, both of which have an anode and a cathode. There are reaction substrates and electrogenic bacteria in the anode chamber. Electrogenic bacteria decompose organic matter in the anode chamber to produce H ions and electrons. H ions reach the cathode through the proton exchange membrane, and combine with the electrons passing through the external circuit to generate water. During this process, the electrons pass through the external circuit to generate current. The cathode of the dual-chamber MFC is usually an ionic solution, and the single-chamber MFC usually uses an air cathode. When acetate is used as the substrate, the reaction process is shown in the following formula: Figure 1 is a schematic diagram of the single-chamber MFC. Considering the mass balance, the Monod equation is used to describe the relationship between the active biomass and the kinetics of the main substrate. Synthesis and decay processes in bacterial dynamics are also considered. The net bacterial growth rate can be described as where p syn is the growth rate, p dec is the decay rate, b is endogenous decay coefficient and Q is the substrate concentration, K s is the half-saturation constant, p max is the maximum growth rate. Bacteria obtain energy for growth by decomposing substrates, and the rate of substrate decomposition can be described by where o max is the maximum utilization of substrate, X is the biomass concentration. The net bacterial growth rate can be written as where Y is the growth yield.

Mfc Mathematical Model
By analyzing the MFC internal variable relationship and considering the change of ions during the reaction, the MFC mathematical model used in this paper can be obtained. The MFC mathematical model adopts a set of mathematical formulas to express the internal reaction of MFC, which can clearly show its internal mechanism. This has important implications for follow-up research. In this paper, a single-chamber single-population MFC model is used to design the controller, and its model is proposed by Abul et al. by analyzing the internal mechanism of MFC and experimentally [30]. Unlike the original MFC mathematical model, disturbance factors are taken into account in the model. Its state equation is as follows: Among them, x 1 (t) and x 2 (t) represent the substrate concentration and biomass concentration, respectively, Q 0 is the initial value of the substrate concentration, a(t) is the external disturbance in the model, the control input u(t) is the dilution rate. Therefore, the output voltage equation of the MFC can be written as where V a is the anode voltage, V c is the cathode voltage, E a is the anode potential, E c is the cathode potential, E La is the anode voltage loss, R = 8.31446 JK −1 mol −1 is the ideal gas constant, T = 298.15 K is the temperature of MFC, F = 96,485 s A/mol is the Faraday constant, n 1 = 8 and n 2 = 4 are two fixed parameters, E Lc is the cathode voltage loss, E 0a and E 0c are the anode standard potential and cathode standard potential, respectively.
The parameter values in the state equation and output equation come from [30], and their values are shown in Table 1.

Controller Design
During the operation of MFCs, it is more susceptible to external factors. Changes in temperature, pH, etc., during power generation will have an impact on microbial activity and growth rate. At the same time, problems such as uneven mixing of the substrate during anode feeding are still inevitable. All of the above factors will affect the operation of the system and cause voltage fluctuations. This is why there are external disturbances in the control system.
According to the above-mentioned MFC mathematical model, it can be seen that the change of HCO − 3 concentration and H + concentration is only related to the change of substrate concentration and biomass concentration, andẋ 3 = 2ẋ 1 ,ẋ 4 = 9ẋ 3 . Therefore, during the MFC controller design process, the control effect on the output voltage can be achieved only by controlling the substrate concentration and biomass concentration. According to [10], better voltage output can be achieved by controlling substrate concentration at the set value x 1d . Therefore, one of our control goals is to stabilize the system substrate concentration at the desired value. At the same time, when designing a control system, we should consider the influence of external disturbance on the system, and achieve disturbance suppression.
FSM control is a control method that has a good effect of suppressing disturbances. It combines fuzzy logic and SM control to solve the problem that traditional SM control has strong chattering. For MFCs, it is necessary to use FSM control to reduce the influence of external disturbances on the system and improve the system stability. In order to facilitate the understanding of the design method of FSMC, we give a schematic diagram of the control system in Figure 2.

Sm Control
Aiming at the external disturbance of MFC, a SM controller is designed first by using Lyapunov theory. The controller is not sensitive to the external disturbance of the system, and can effectively reduce the influence of the external disturbance of the system on the system.

Theorem 1. If the control input u(t) satisfies
where d(t) = max|a(t)| + Y, Y > 0, x 1d is the expected value of x 1 (t), the sgn function is a symbolic function and satisfies then the system (6) is asymptotically stable to any perturbation.
Proof. Changes in substrate concentration in the model can be written aṡ Define sliding mode function where e is the tracking error and satisfies Consider the Lyapunov function Bring (14), (16) into (18), we can geṫ Bring (12) into (19), we can geṫ From (20), it can be seen that the system (14) is asymptotically stable.

Fuzzy Rule Design
There is a serious chattering problem in SM control, which is not conducive to the actual operation of the system. Therefore, we use FSM control to reduce the impact of input chattering on the system. At the same time, we need to estimate d(t) effectively to reduce the disturbance of external disturbance to the system, so that the system always runs on the sliding surface. It can be known from (20) that when SṠ < 0, then d(t) should be reduced, otherwise d(t) should be increased. Therefore, we fuzzify the coefficient d(t), the fuzzy language of SṠ is chosen as {m f 1, m f 2, m f 3, m f 4, m f 5}, the fuzzy language of d(t) is chosen as { f 1, f 2, f 3, f 4, f 5}. At the same time, through the trial-and-error method, we get the membership function which can make the system have a better performance output.
The membership functions are shown in Figures 3 and 4. The fuzzy rules describing the relationship between SṠ and d(t) are as follows.
From the above fuzzy rules and (12), we can get the FSM controller.
Considering that in the actual control input, the dilution rate u(t) cannot be infinitely variable, so it should be limited. The controller input saturation can be written as where u max is the maximum value allowed by the actual input and u min is the minimum value allowed by the actual input.

Experiments and Simulations
In order to verify the control effect of the designed FSM control, MATLAB/simulink is used for simulation, and the simulation results are compared with ordinary SM control and backstepping control. SM control and backstepping control are all tuned to meet the best control performance. The simulation parameters are mainly from [10], select the appropriate FSM control parameters, set the initial value of substrate concentration x 10 = 60 mg/L, the initial value of biomass concentration x 20 = 1.5 mg/L, the expected value of substrate concentration is x 1d = 20 mg/L, set the upper limit of the control input as u max = 0.5, and the lower input limit as u min = 0, all three control systems impose the same time-varying disturbance. The effectiveness of the controllers is determined by comparing the curve differences of the MFC mathematical models controlled by three different controllers under the same simulation conditions.
One of our control purposes is to make x 1 (t) reach the set value of 20 mg/L, which is beneficial for MFC to achieve the best output performance. Figure 5 shows the change curve of x 1 (t) after applying disturbance. It can be seen that the SM controller reaches the set value faster and has a certain anti-interference effect. However, the substrate concentration controlled by the SM controller is always unstable and has obvious chattering. The substrate concentration always fluctuates around 20 mg/L, which is difficult to meet our needs. Backstepping control can avoid chattering problem better, but its adjustment time is long and it is greatly affected by disturbance. Compared with it, the FSM controller has lower adjustment time and overshoot. At the same time, it has lower chattering and is more suitable for practical applications. The change of biomass concentration is affected by the concentration of substrate, and its change curve is shown in Figure 6. From Figure 6, a similar conclusion to Figure 5 can be drawn. Figure 7 shows the change curve of the control input u(t) after applying the disturbance. It can be seen intuitively that the SM controller has a high chattering frequency and a large switching amplitude, which cannot be achieved in actual physical experiments. Violent chattering can also destabilize the system. Backstepping control has lower input chattering and switching amplitude, but its control effect is difficult to meet the requirements. Compared with SM control and backstepping control, FSM control has lighter input chattering and smaller switching amplitude. At the same time, it has better control effect and is more suitable for practical applications.    − , H + , the change is affected by the state quantities x 1 (t), x 2 (t). As can be seen from the figures, compared with the backstepping control, the SM control, the FSM control strategy has a faster stabilization time and smaller overshoot. Figures 10-12 are the change curves of the anode voltage, the cathode voltage and the total voltage, respectively. The stability of the output voltage is the most fundamental control goal of this paper. The voltage fluctuation is mainly caused by the change of the substrate concentration. It can be seen that compared with the other two control methods, the FSM control has a lower adjustment time, and it has a better suppression effect on disturbances. The control method effectively reduces chattering in SM control, and is more in line with the needs of practical applications.

Conclusions
A fuzzy sliding mode control method for MFCs is proposed in this paper. The operation process of MFCs is nonlinear in nature, and an appropriate nonlinear controller needs to be added to make its performance meet our needs. In this paper, the sliding mode control method is used to stabilize the substrate concentration to the set value and make the system have a certain anti-disturbance ability. Aiming at the chattering problem in SM control, a FSM controller is designed by combining the fuzzy control idea with SM control. The controller can effectively reduce chattering caused by SM control, which is more in line with actual needs. In order to verify the effectiveness of the designed FSM control method, we compare it with SM control and backstepping control, and verify its effectiveness through simulation analysis.
In the future, we will optimize the FSM control to further reduce its chattering. At the same time, the MFC's maximum power tracking will be studied, so that the MFC can always maintain the maximum power output. This can effectively increase its output power, further improving the practicality of the MFC.