Next Article in Journal
An Area-Efficient and Configurable Number Theoretic Transform Accelerator for Homomorphic Encryption
Previous Article in Journal
DC-Link Voltage Fluctuation Suppression Method for Modular Multilevel Converter Based on Common-Mode Voltage and Circulating Current Coupling Injection under Unbalanced Grid Voltage
Previous Article in Special Issue
Chaos Moth Flame Algorithm for Multi-Objective Dynamic Economic Dispatch Integrating with Plug-In Electric Vehicles
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Design of a PID Controller for Microbial Fuel Cells Using Improved Particle Swarm Optimization

by
Chenlong Wang
,
Baolong Zhu
,
Fengying Ma
* and
Jiahao Sun
School of Information and Automation Engineering, Qilu University of Technology (Shandong Academy of Sciences), Jinan 250353, China
*
Author to whom correspondence should be addressed.
Electronics 2024, 13(17), 3381; https://doi.org/10.3390/electronics13173381
Submission received: 30 July 2024 / Revised: 23 August 2024 / Accepted: 24 August 2024 / Published: 26 August 2024

Abstract

:
The microbial fuel cell (MFC) is a renewable energy technology that utilizes the oxidative decomposition processes of anaerobic microorganisms to convert the chemical energy in organic matter, such as wastewater, sediments, or other biomass, into electrical power. This technology is not only applicable to wastewater treatment but can also be used for resource recovery from various organic wastes. The MFC usually requires an external controller that allows it to operate under controlled conditions to obtain a stable output voltage. Therefore, the application of a PID controller to the MFC is proposed in this paper. The design phase for this controller involves the identification of three parameters. Although the particle swarm optimization (PSO) algorithm is an advanced optimization algorithm based on swarm intelligence, it suffers from issues such as unreasonable population initialization and slow convergence speed. Therefore, this paper proposes an improved particle swarm algorithm based on the Golden Sine Strategy (GSCPSO). Using Circle chaotic mapping to make the distribution of the initial population more uniform, and then using the Golden Sine Strategy to improve the position update formula, not only improves the convergence speed of the population but also enhances convergence precision. The GSCPSO algorithm is applied to execute the described design process. The results of the simulation show that the designed control method exhibits smaller steady-state error, overshoot, and chattering compared with sliding-mode control (SMC), backstepping control, fuzzy SMC (FSMC), PSO-PID, and CPSO-PID.

1. Introduction

The utilization of fossil fuels has played a crucial role in the development of human society, but it has also caused problems such as the depletion of mineral resources and the destruction of the ecological environment [1,2]. Therefore, it is necessary to find renewable energy sources. Renewable energy sources like solar energy, biomass energy, and hydropower have received significant attention [3,4,5]. One promising approach is to use pollutants to generate electricity, which can address both energy shortages and environmental pollution problems [6]. As a new type of renewable energy, the microbial fuel cell (MFC) has great development potential [7]. However, the internal reactions within the MFC are highly complex and involve many disciplines, such as microbiology, electrochemistry, control science, and so on [8,9,10]. Therefore, it is very difficult to achieve a stable output voltage from the MFC under uncontrolled conditions [11].
Using a controller in the MFC is an effective way to produce a stable output voltage [12]. There have been many research achievements in the field of controller design for the MFC [13,14,15]. Giuliano et al. proposed a dynamic control method to maximize the output power of the MFC by adjusting the load [13]. In [14], Ma et al. constructed a T-S fuzzy model for the MFC, which facilitated the controller design. An adaptive backstepping method was introduced in [15], which can be used for online estimation of the nonlinear characteristics of the MFC. In addition, some studies have applied the gain scheduling control method to the MFC, which not only avoids voltage inversion but also maximizes output voltage [16]. However, the aforementioned nonlinear control methods are difficult to apply in practical MFC systems. In practical industrial processes, the PID controller is widely recognized due to its simple structure and robustness under a broad range of operating conditions, making it extensively applied in industry.
During this study, we noticed that it is crucial to improve the performance of the PID controller by incorporating new features. Numerous artificial intelligence (AI) techniques have been utilized to enhance controller performance. Approaches like neural networks and fuzzy systems have found extensive application in effectively tuning PID controller parameters [17]. Many random search methods, such as particle swarm optimization (PSO), the gray wolf algorithm (GWA), and the beetle antennae search (BAS) algorithm, have been applied to parameter tuning [18]. PSO is a classical heuristic stochastic optimization method inspired by the study of bird foraging behavior. The basic principle of the PSO algorithm is easy to understand, and its parameter settings are relatively simple, often requiring only a few basic parameters to be set. Additionally, the PSO algorithm has a wide range of applications, including in engineering, economics, biology, and other fields [19]. However, it suffers from issues such as unreasonable population initialization and slow convergence speed. To address these issues, numerous scholars have proposed improved PSO algorithms using different strategies [20]. In [21], Hazim Shakhatreh et al. employed an improved PSO algorithm to search for a three-dimensional layout for unmanned aerial vehicles, enabling them to operate stably as airborne wireless base stations. In [22], using a type of PSO algorithm, the unmanned aerial vehicle efficiently and stably identified the optimal path in complex environments. To accomplish firefighting missions, Ghamry et al. employed an improved PSO algorithm to optimize the paths of multiple unmanned aerial vehicles, enabling them to complete tasks in the shortest possible time [23]. In [24], Fu et al. employed a type of PSO algorithm to address path-planning issues for maritime unmanned aerial vehicles. Due to its exceptional optimization methodology, the improved PSO method showed great promise in tackling the optimization of PID controller parameters. Therefore, in this paper, the GSCPSO algorithm is used to search for the optimal PID controller parameters for the MFC system. First, the distribution of the initial population is made more uniform by employing Circle chaotic mapping. Then, the position update formula is improved using the Golden Sine Strategy, significantly enhancing convergence speed.
Frequency-domain integral performance criteria have commonly been employed to assess controller performance; however, these criteria come with their own set of advantages and disadvantages [25]. The integral time-weighted absolute error (ITAE) is the absolute value of the error multiplied by the time term integrated over time. It not only indicates the magnitude of the error (control accuracy) but also captures the speed of error convergence. This metric effectively considers both control accuracy and convergence speed. In this paper, the ITAE is employed to assess the effectiveness of a GSCPSO-PID controller implemented in a complex MFC control system.
The main contributions of this paper are as follows:
(1)
This paper proposes the method of using a PID controller to achieve stable output voltage in an MFC. As far as we know, there are few references about PID controllers applicable to MFCs.
(2)
To address the issue of slow convergence speed in PSO, this paper combines Circle chaotic mapping and the Golden Sine Strategy with the PSO algorithm, proposing an improved PSO algorithm named GSCPSO. The algorithm is tested on 12 benchmark functions, and performance evaluations are conducted. The test results indicate that the GSCPSO algorithm has faster convergence speed and stronger robustness.
(3)
To verify the ability of GSCPSO to solve practical application problems, we compare the GSCPSO-PID controller with SMC, FSMC, backstepping control, PSO-PID, and CPSO-PID. The results show that the GSCPSO-PID controller has a faster convergence speed and smaller overshoot in the MFC.
At the same time, compared to existing papers on MFC control, the algorithm proposed in this paper addresses the issue of difficult parameter selection in existing PID control algorithms, offering superior performance and greater practicality.
The remainder of this paper is organized as follows. Section 2 describes the model of the MFC system and the PID controller. Section 3 describes the general method of using GSCPSO to optimize the tuning of the PID parameters. Section 4 shows the simulation results of this study. Section 5 presents the conclusions of this study.

2. Model Formulation and PID Control

2.1. Control-Oriented Mathematical Mode of MFC

The MFC is a complex nonlinear system, generally composed of an anode, a cathode, and a proton exchange membrane between them. According to the structure of the MFC, it can be divided into two types: single-compartment and double-compartment. The difference between them is whether there is a proton exchange membrane between the anode and the cathode. Figure 1 shows a single-compartment model of a typical MFC. When an MFC uses glucose as a substrate, the anode and cathode react as follows:
C 6 H 12 O 6 + 6 H 2 O 6 C O 2 + 24 H + + 24 e
O 2 + 4 H + + 4 e 2 H 2 O
In this reaction, anaerobic microbes living in the anode break down glucose to produce protons and electrons, while releasing carbon dioxide and water; electrons move from the anode through an external circuit to the cathode, generating an electric current. At the cathode, oxygen combines with protons and electrons from the anode to produce water.
In order to design an external controller for the MFC system, it is necessary to translate the complex internal reactions within the MFC into a mathematical model. In this paper, a single-cell, single-population, control-oriented mathematical model is adopted, which was established after a large number of experimental studies [15]. This mathematical model controls the output voltage by controlling the dilution rate (u) of the MFC. In this mathematical model, states x 1 , x 2 , x 3 , and x 4 represent the substrate concentration, biomass concentration, acetate concentration, and hydrogen ion concentration, respectively. The mathematical model is as follows:
x ˙ 1 = Γ m a x x 1 x 2 Z s + x 1 + u ( η x 1 )
x ˙ 2 = ψ m a x x 1 Z s + x 1 u b x 2
x ˙ 3 = 2 Γ m a x x 1 x 2 Z s + x 1 u ( η x 1 )
x ˙ 4 = 9 Γ m a x x 1 x 2 Z s + x 1 u ( η x 1 )
where Γ m a x represents the maximum substrate utilization rate, ψ m a x represents the maximum microbial growth rate, and Z s represents the semi-saturation constant. Therefore, when the MFC is in an open-circuit state, the electric potential of the anode and cathode can be expressed as follows:
V a = E a E L o s s , a = E 0 a R T n 1 F ln x 1 x 3 2 x 4 9 E L o s s , a
V c = E c E L o s s , c = E 0 c R T n 2 F ln 1 0.2 x 4 2 E L o s s , c
V = V a V c
where V a represents the anode voltage of the MFC, V c represents the cathode voltage of the MFC, and V represents the total voltage of the MFC. The symbols a and c in Equations (5)–(7) represent the anode and cathode of the MFC, respectively. E L o s s , a and E L o s s , c , represent the internal voltage losses at the anode and cathode of the MFC, respectively, which are experimentally verified to be 0.15 V and 1.019 V. F is the Faraday constant with a value of 96,485 C/mol; T is the temperature of the MFC with a value of 298.15 K; and R is the ideal gas constant with a value of 8.3144 J/(mol·k).
From Equations (5) and (6), it can be observed that the output voltage of the MFC is only related to states x 1 , x 3 , and x 4 . Meanwhile, Equations (3) and (4) can be written as
x ˙ 3 = 2 x ˙ 1 x ˙ 4 = 9 x ˙ 1
Therefore, it is possible to control the output voltage of the MFC by manipulating states x 1 and x 2 .

2.2. PID Controller

Since its inception in 1910, the PID controller has undergone significant development, particularly with the introduction of the Ziegler–Nichols (Z-N) direct tuning method in 1942. This method has contributed to the widespread adoption and popularity of PID control [26]. The three functions of the PID controller cover the handling of transient and steady-state responses, providing a simple yet effective solution for several real-world control problems. The PID controller operates by calculating the error value, denoted as e(t), which represents the difference between the desired value and the actual value. It dynamically adjusts the control variable, u(t), utilizing proportional (P), integral (I), and derivative (D) terms. The controller can fine-tune these components to reduce system error to a minimum. A standard PID controller can be mathematically represented as follows:
u ( t ) = K P e ( t ) + K i 0 t e ( t ) d t + K d d e ( t ) d t
where K p , K i , and K d are the proportional coefficient, integral coefficient, and differential coefficient of the PID controller, respectively. u ( t ) represents the control input (dilution rate) of the MFC. Meanwhile, e ( t ) is defined as the difference between the desired and actual substrate concentrations, as well as the difference between the desired and actual biomass concentrations.

3. PID Controller Parameter Adjustment Based on the Improved Particle Swarm Optimization Algorithm

Adjusting PID controller parameters is a standard optimization problem. The goal is to enhance control performance, with the ITAE serving as the fitness function. The primary application of the GSCPSO algorithm is to optimize three key controller parameters− K p , K i , and K d −to ensure the MFC system achieves optimal performance. The block structure of the created controller is shown in Figure 2. The ITAE is used as the fitness function to calculate the fitness values, identify the global optimum in the population, and assign it to K p , K i , and K d sequentially. In the figure below, x 1 d and x 2 d represent the desired values of the substrate and microorganism concentrations in the microbial fuel cell, respectively.

3.1. Particle Swarm Optimization Algorithm

The PSO algorithm is a random optimization method. It starts from random solutions and iteratively seeks the optimal solution by evaluating the fitness of these solutions. The quality of a solution is assessed based on its fitness. The algorithm operates with a simple set of rules. It navigates the search space by following the currently discovered optimal values to find the global optimum. PSO is characterized by its simple implementation and ease of understanding.
The basic principle of the PSO algorithm assumes that in a D-dimensional search space, there are N particles forming a population. Each particle has two characteristics: velocity and position. The magnitude of the velocity represents the speed of the particle’s movement. The velocity of the ith particle is represented as V i = ( v i 1 , v i 2 , v i 3 , , v i D ) , i = ( 1 , 2 , , N ) . The position information indicates the direction of the particle’s movement. The position of the ith particle is represented as X i = ( x i 1 , x i 2 , , x i D ) , i = ( 1 , 2 , , N ) . Each particle in the population searches for the optimal solution in the target solution space. This process is independent and is recorded as the particle’s individual best solution, p b e s t . The individual best solution of particle i is represented as p b e s t i = ( p i 1 , p i 2 , , p i n ) , i = ( 1 , 2 , , N ) . After each particle obtains its individual best solution, it shares this solution with other particles in the population to search for the overall best solution of the current population, g b e s t . The global best solution of particle i is represented as g b e s t i = ( g i 1 , g i 2 , , g i n ) , i = ( 1 , 2 , , N ) . It should be noted that in the same iteration, the global best solution is the same for all particles. Afterward, particles update their velocity and position based on their individual best solution and the globally shared best solution. The velocity update formula for the nth dimension of particle i in the ( t + 1 )th iteration of the PSO algorithm is [27]
ν i n t + 1 = ω × ν i n t + c 1 × r 1 × ( p i n x i n t ) + c 2 × r 2 × ( g i n x i n t )
where ω is the inertia factor, which affects the optimization ability of the particle. c 1 and c 2 are the learning factors, where c 1 is the individual learning factor and c 2 is the global learning factor. r 1 and r 2 are random functions with values between 0 and 1, used to introduce randomness into the particle search process. The position update formula for an N-dimensional particle i in the (t + 1)th iteration is
x i n t + 1 = x i n t + ν i n t + 1

3.2. Algorithm Improvement Strategies

3.2.1. Introduction of Population Initialization for Circle Mapping

This paper uses population initialization with the introduction of Circle mapping. The expression for generating a chaotic sequence with Circle mapping is shown in Equation (12), where n u m i represents the ith chaotic sequence number, and mod(a,b) represents the modulus operation of a divided by b.
n u m i + 1 = mod ( n u m i + 0.2 0.5 2 π × sin ( 2 π × n u m i ) , 1 )
Figure 3 shows the distribution of 1000 sequence values generated by the commonly used Bernoulli map [28], Logistic map [29], Tent map [30], and Circle map. Observing Figure 3, it can be seen that the chaotic sequence values generated by the Circle map are more evenly distributed between 0 and 1 compared to those generated by the Bernoulli map, Logistic map, and Tent map. Introducing this into the population initialization operation can provide a high-quality search space for the algorithm, which is conducive to improving the convergence accuracy of the algorithm.
The population initialization operation with the introduction of Circle mapping includes the initialization of the velocity and position, as shown in Equations (13) and (14), respectively. Here, v u b and v l b are the upper and lower bounds of the particle velocity, while x u b and x l b are the upper and lower bounds of the particle position. The values n u m i , j and n u m i , j represent the chaotic sequence values generated by Circle mapping for the corresponding particle dimension.
v i , j = v l b + v u b v l b × n u m i , j
x i , j = x l b + x u b x l b × n u m i , j

3.2.2. Golden Sine Strategy

Based on the relationship between the sine function and the unit circle, the Golden Sine algorithm can traverse all points on the sine function, similar to scanning the entire unit circle in optimization problems. During this search process, the golden ratio method is used to focus the scan on regions that produce better results, thereby narrowing the search space. This approach not only improves convergence speed but also balances global search capability with local search capability, enhancing the precision of the solution.
The position update formula integrating the Golden Sine algorithm is as follows:
x i , j t + 1 = x i , j t | s i n r 1 | r 2 s i n r 1 | x 1 v i , j t + 1 x 2 x i , j t |
where r 1 is a random number between 0 and 2 π , r 2 is a random number between 0 and π , and x 1 and x 2 are coefficients generated using the golden ratio method.
x 1 = a 1 τ + b τ
x 2 = a τ + b 1 τ
In Equations (16) and (17), τ represents the golden ratio, with a value of 5 1 / 2 . a and b denote the range for the golden ratio search method, where a = 2 2 ( 2 t ) / T and b is also set to 1.

3.2.3. The Implementation Steps for Improving the Algorithm

According to the description in the previous subsections, the specific implementation steps of GSCPSO are as follows:
Input: Maximum number of iterations T m a x , population size N, dimension of the function D, and upper and lower bounds for the velocity and position.
Output: The optimal solution g b e s t , and its fitness value f ( g b e s t ) .
Step 1: Initialization operation, including setting parameters for the population size, problem dimension, and maximum number of iterations, and initializing the particle velocity and position in the population using Circle mapping.
Step 2: Calculate the fitness value f ( x i ( 1 , , D ) ) for each particle i in the population, where i = 1 , 2 , , N .
Step 3: Update the particle’s velocity information according to Equation (10), and update the particle’s position information according to Equation (15).
Step 4: Calculate the fitness value, record the individual best values of the population, and record the global best value.
Step 5: Check if the iteration condition is satisfied. If it is, exit the iteration; otherwise, return to Step 3.
The flow of GSCPSO is shown in Figure 4. In this study, the ITAE is employed as the fitness function for the optimization of control parameters in the MFC. The fitness function is defined as
J = 0 t | e ( t ) | d t

3.3. Solution Representation

To achieve the optimal PID controller parameters, this subsection utilizes the GSCPSO algorithm for parameter adjustment. The design involves adjusting PID controller parameters using GSCPSO to achieve rapid and stable control of the output voltage in the MFC.
The optimized PID controller uses the actual and desired substrate concentrations in the MFC, along with the difference between the actual and desired microbial concentrations, as the error (e) for the controller input. The output variables K p , K i , and K d of the GSCPSO algorithm serve as the control parameters for the PID controller. Based on the above discussion, the procedure for optimizing the PID controller using GSCPSO is as follows:
Step 1: Initialize the parameters of GSCPSO.
Step 2: Use Circle chaotic mapping to obtain the initial population’s position and velocity information.
Step 3: Decode the population individuals as K p , K i , and K d .
Step 4: Run the Simulink MFC model and use Equation (18) as the fitness function. Record the individual best values and the global best value of the population.
Step 5: Calculate the number of times the current global best solution appears.
Step 6: Update the particle’s velocity information according to Equation (10) and update the particle’s position information according to Equation (15).
Step 7: Call the Simulink model built using the ‘sim’ function, return the fitness function values of the new-generation population, and update the position.
Step 8: Check if the maximum iteration count has been reached. If so, end the iteration; otherwise, return to Step 3.

4. Experiments and Results Analysis

4.1. Simulation Experiment and Comparative Analysis of Optimization Algorithms

The simulation experiment environment in this paper was configured as follows: for hardware, a computer with an 11th Gen Intel i7-11700F 2.50GHz CPU was used; for software, the MATLAB simulation software version R2021b, based on the Windows 10 operating system, was used.
This paper selected 12 representative benchmark test functions to evaluate the performance of the algorithm. The names and characteristics of these 12 benchmark test functions are shown in Table 1.
To ensure the fairness of the experimental tests, the population size N for all algorithms was set to 30, and the maximum number of iterations T m a x was uniformly set to 200. Each algorithm was independently run 30 times, and the corresponding mean and standard deviation were recorded. The smaller the mean, the higher the average convergence accuracy of the algorithm; the smaller the standard deviation, the better the robustness of the algorithm’s convergence.
PSO, CPSO, and GSCPSO were simulated and tested on unimodal functions F1–F6 and multimodal functions F7–F12. The statistical results of the test functions are shown in Table 2. The iterative curves on F1–F12 were plotted to more intuitively analyze the effects of the various improvement strategies, as shown in Figure 5 and Figure 6, where the horizontal axis represents the number of algorithm iterations, and the vertical axis represents the objective function value.
As can be seen in Table 2, GSCPSO achieved a mean and standard deviation of 0 on test functions F9 and F11, indicating that it consistently reached the theoretical optimal value. Although it did not achieve the theoretical optimal value on other test functions, its optimal value and standard deviation were smaller than those of PSO and CPSO, indicating that GSCPSO has a stronger ability to escape local optima and a correspondingly higher convergence accuracy. Notably, except for F5 and F6, the convergence accuracy of GSCPSO was significantly superior to that of other test functions. In conjunction with Figure 5 and Figure 6, it is clear that only on test function F2 did all three algorithms exhibit the same fast convergence speed and good convergence accuracy. Apart from F2, GSCPSO exhibited the fastest convergence speed and accuracy on the other test functions and successfully escaped local optima on F4, F8, F9, F10, and F11. Overall, the GSCPSO exhibited better performance. The convergence performance of CPSO was very similar to that of traditional PSO, both of which performed poorly.

4.2. Simulation Experiment and Comparative Analysis of the MFC Control Problem

To validate the control effectiveness of the GSCPSO-PID controller, simulations were conducted using MATLAB/Simulink. The simulation results were compared with those obtained using SMC [31], FSMC [32], backstepping [15], PSO-PID, and CPSO-PID. SMC, FSMC, and backstepping were all tuned to achieve the best control performance. For GSCPSO, the parameters were set as N = 20, T m a x = 100, D = 3, and c 1 = c 2 = c 3 = 2. Considering the inherent randomness of metaheuristics, the parameter tuning process for PSO, CPSO, and GSCPSO was repeated 20 times, and the average results were used. The controller parameters for PSO-PID, CPSO-PID, and GSCPSO-PID are presented in Table 3. The simulation parameters were primarily derived from [15,31,32]. The key parameters of the MFC system are listed in Table 4. The expected values for the substrate and biomass concentrations were x 1 d = 20 mg/L and x 2 d = 2 mg/L, respectively. The upper and lower limits of the control input were set to u m a x = 0.5 and u m i n = 0, respectively. To demonstrate the effectiveness of the designed controller, this section compares six different controllers, evaluating their performance based on the obtained variations in the curves.
One of our control objectives is to ensure that x 1 ( t ) and x 2 ( t ) reach the set values of 20 mg/L and 2 mg/L, respectively. This optimization is crucial for maximizing the output performance of the MFC. Figure 5a shows the change curve of x 1 ( t ) . It can be observed that compared to GSCPSO-PID, the overshoot of the backstepping method is significant, and the adjustment time is prolonged. Although SMC and FSMC exhibit smaller overshoots, they encounter the issue of unavoidable oscillations at steady-state moments, which are not suitable for practical applications. It can also be seen in Figure 5a that compared with GSCPSO-PID, CPSO-PID and PSO-PID have relatively poor control performance indicators such as overshoot, rise time, and steady-state error, especially in terms of convergence speed. Therefore, GSCPSO-PID exhibits better control performance. Table 5 summarizes the variation trend of the substrate concentration using the GSCPSO-PID control method compared with backstepping, SMC, FSMC, CPSO-PID, and PSO-PID. The variation in the biomass concentration is influenced by the substrate concentration, as depicted in Figure 5b. Similar conclusions to those drawn from Figure 5a can be made based on the observations of Figure 5b. According to [14,15,32], we can see that the oscillations in the BC curve are due to the intense fluctuations in its control input (dilution rate) from 30 s to 40 s, which leads to the oscillations in the BC curve during this period.
The MFC achieves control over the output voltage by regulating the dilution rate. In the MFC, peristaltic pumps are commonly employed to regulate the anode feed flow rate. However, due to the nature of peristaltic pumps, making continuous and rapid adjustments to the flow rate can be challenging. Consequently, it is advisable for the controller output to avoid prolonged high-frequency oscillations. Figure 5e illustrates the variations in the control input, u ( t ) , for different controllers. In Figure 5b, it can be observed that there is a peak in the biomass concentration. The reason for this is evident in Figure 5e: the control input of the microbial fuel cell has a real physical meaning and is non-negative. Therefore, we have limited the control input, setting its minimum value to 0 and its maximum value to 0.5. When the controller produces a negative control output, it is forced to zero, and no control is applied, causing the system to operate in an open-loop state. Consequently, the system will continue to diverge until the controller’s control output becomes positive, at which point it formally becomes a closed loop, causing the state to converge and a peak to appear. It can be observed that both SMC and FSMC consistently exhibit significant fluctuations. In practical MFC control, such fluctuations are not permissible. While backstepping avoids oscillations at steady-state moments, its performance does not meet practical requirements, and the control performance of CPSO-PID and PSO-PID is not as good as that of GSCPSO-PID control.
Figure 5c,d depict the changes in H C O 3 and H + concentrations, influenced by the state variables x 1 ( t ) and x 2 ( t ) . It is evident from these figures that the GSCPSO-PID strategy exhibits quicker stabilization and smaller overshoot compared to the backstepping, SMC, FSMC, CPSO-PID, and PSO-PID strategies. Figure 7e,g,h illustrate the variations in the anode voltage, cathode voltage, and total voltage, respectively. Ensuring stable output voltage is the primary control objective of this study, with voltage fluctuations primarily attributed to changes in substrate and biomass concentrations. In Figure 7h, at the initial moment of backstepping, the voltage fluctuates greatly, and both SMC and FSMC exhibit oscillations at steady-state moments, which are not conducive to practical applications. While CPSO-PID and PSO-PID control do not exhibit oscillations at steady state, the time taken for the output voltage to stabilize is longer compared to GSCPSO-PID control. Therefore, the GSCPSO-PID method is more effective compared to other control schemes in MFC control and aligns more closely with the requirements of practical applications.

5. Conclusions

This paper proposes the method of using a PID controller to address the issue of the MFC’s inability to quickly generate a stable output voltage. To achieve rapid parameter tuning for the PID controller, we introduce the GSCPSO algorithm for adjusting the PID controller parameters, which greatly enhances the performance of the controller. The GSCPSO algorithm uses Circle chaotic mapping to initialize the population and also employs the Golden Sine Strategy, which greatly enhances both the global search ability and the local development ability of the algorithm. Comparative experiments on 12 benchmark test functions and one additional test demonstrate that the GSCPSO algorithm outperforms the traditional PSO and CPSO algorithms in terms of convergence speed and accuracy. The GSCPSO-PID controller exhibits excellent performance in adjustment time and steady-state error, showing more significant advantages compared to SMC, backstepping control, FSMC, PSO-PID, and CPSO-PID.
In the future, we will construct a physical model of the MFC to further enhance the practical applicability of our algorithm, providing more valuable references for practitioners in the field of MFCs.

Author Contributions

Conceptualization, F.M. and J.S.; methodology, C.W. and B.Z.; software, C.W. and B.Z.; validation, C.W. and F.M.; formal analysis, B.Z.; writing—original draft preparation, C.W. and F.M.; writing—review and editing, B.Z.; funding acquisition, B.Z. and F.M. All authors have read and agreed to the published version of the manuscript.

Funding

This work is supported by the National Natural Science Foundation of China (Grant Nos. 62203047, 72471013), Pilot projects for the integration of science, education, and industry (Grant/Award No: 2023CGZH-02), the National Laboratory of Space Intelligent Control (Grant No. HTKJ2023KL502023), the Research Foundation for Advanced Talents of Qilu University of Technology (Grant Nos. 2023RCKY148, 2023RCKY149), the Youth Innovation Science and Technology Support Plan of Colleges in Shandong Province (Grant/Award No: 2022KJ131).

Data Availability Statement

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Ponomarenko, T.; Nevskaya, M.; Jonek-Kowalska, I. Mineral resource depletion assessment: Alternatives, problems, results. Sustainability 2021, 13, 862. [Google Scholar] [CrossRef]
  2. Huang, Y. Destruction process and restoration countermeasures of the ecological environment of a comprehensive geological structure. Earth Sci. Res. J. 2020, 24, 429–437. [Google Scholar] [CrossRef]
  3. Qi, W.; Liu, J.; Christofides, P.D. Distributed supervisory predictive control of distributed wind and solar energy systems. IEEE Trans. Control Syst. Technol. 2012, 21, 504–512. [Google Scholar] [CrossRef]
  4. Kongnam, C.; Nuchprayoon, S. A particle swarm optimization for wind energy control problem. Renew. Energy 2010, 35, 2431–2438. [Google Scholar] [CrossRef]
  5. Åström, K.J.; Furuta, K. Swinging up a pendulum by energy control. Automatica 2000, 36, 287–295. [Google Scholar] [CrossRef]
  6. Lai, B.; Yi, P.; Sui, Y.; Zhang, Q. Energy distribution in EV energy network under energy shortage. Neurocomputing 2021, 444, 179–188. [Google Scholar] [CrossRef]
  7. Xu, F.; Cao, F.Q.; Kong, Q.; Zhou, L.L.; Yuan, Q.; Zhu, Y.J.; Wang, Q. Electricity production and evolution of microbial community in the constructed wetland-microbial fuel cell. Chem. Eng. J. 2018, 339, 479–486. [Google Scholar] [CrossRef]
  8. Rinaldi, A.; Mecheri, B.; Garavaglia, V.; Licoccia, S.; Di Nardo, P.; Traversa, E. Engineering materials and biology to boost performance of microbial fuel cells: A critical review. Energy Environ. Sci. 2008, 1, 417–429. [Google Scholar] [CrossRef]
  9. Logan, B.E.; Hamelers, B.; Rozendal, R.; Schröder, U.; Keller, J.; Freguia, S.; Aelterman, P.; Verstraete, W.; Rabaey, K. Microbial fuel cells: Methodology and technology. Environ. Sci. Technol. 2006, 40, 5181–5192. [Google Scholar] [CrossRef]
  10. Mohan, S.V.; Velvizhi, G.; Modestra, J.A.; Srikanth, S. Microbial fuel cell: Critical factors regulating bio-catalyzed electrochemical process and recent advancements. Renew. Sustain. Energy Rev. 2014, 40, 779–797. [Google Scholar] [CrossRef]
  11. Tee, P.F.; Abdullah, M.O.; Tan, I.A.; Amin, M.A.; Nolasco-Hipolito, C.; Bujang, K. Effects of temperature on wastewater treatment in an affordable microbial fuel cell-adsorption hybrid system. J. Environ. Chem. Eng. 2017, 5, 178–188. [Google Scholar] [CrossRef]
  12. Patel, R.; Deb, D. Nonlinear adaptive control of microbial fuel cell with two species in a single chamber. J. Power Sources 2019, 434, 226739. [Google Scholar] [CrossRef]
  13. Premier, G.C.; Kim, J.R.; Michie, I.; Dinsdale, R.M.; Guwy, A.J. Automatic control of load increases power and efficiency in a microbial fuel cell. J. Power Sources 2011, 196, 2013–2019. [Google Scholar] [CrossRef]
  14. Ma, F.; Ouyang, T.; Cheng, Y.; Zhu, B.; Ji, P. Non-fragile guaranteed cost control of microbial fuel cells. ISA Trans. 2023, 143, 398–408. [Google Scholar] [CrossRef]
  15. Patel, R.; Deb, D. Parametrized control-oriented mathematical model and adaptive backstepping control of a single chamber single population microbial fuel cell. J. Power Sources 2018, 396, 599–605. [Google Scholar] [CrossRef]
  16. Boghani, H.C.; Michie, I.; Dinsdale, R.M.; Guwy, A.J.; Premier, G.C. Control of microbial fuel cell voltage using a gain scheduling control strategy. J. Power Sources 2016, 322, 106–115. [Google Scholar] [CrossRef]
  17. Nemitallah, M.; Nabhan, M.; Alowaifeer, M.; Haeruman, A.; Alzahrani, F.; Habib, M.; Elshafei, M.; Abouheaf, M.; Aliyu, M.; Alfarraj, M. Artificial intelligence for control and optimization of boilers’ performance and emissions: A review. J. Clean. Prod. 2023, 417, 138109. [Google Scholar] [CrossRef]
  18. Kiliçarslan, S. PSO+ GWO: A hybrid particle swarm optimization and Grey Wolf optimization based Algorithm for fine-tuning hyper-parameters of convolutional neural networks for Cardiovascular Disease Detection. J. Ambient. Intell. Humaniz. Comput. 2023, 14, 87–97. [Google Scholar] [CrossRef]
  19. Gad, A.G. Particle swarm optimization algorithm and its applications: A systematic review. Arch. Comput. Methods Eng. 2022, 29, 2531–2561. [Google Scholar] [CrossRef]
  20. Jain, M.; Saihjpal, V.; Singh, N.; Singh, S.B. An overview of variants and advancements of PSO algorithm. Appl. Sci. 2022, 12, 8392. [Google Scholar] [CrossRef]
  21. Shakhatreh, H.; Khreishah, A.; Alsarhan, A.; Khalil, I.; Sawalmeh, A.; Othman, N.S. Efficient 3D placement of a UAV using particle swarm optimization. In Proceedings of the 2017 8th International Conference on Information and Communication Systems (ICICS), Irbid, Jordan, 4–6 April 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 258–263. [Google Scholar]
  22. Roberge, V.; Tarbouchi, M.; Labonté, G. Comparison of parallel genetic algorithm and particle swarm optimization for real-time UAV path planning. IEEE Trans. Ind. Inform. 2012, 9, 132–141. [Google Scholar] [CrossRef]
  23. Ghamry, K.A.; Kamel, M.A.; Zhang, Y. Multiple UAVs in forest fire fighting mission using particle swarm optimization. In Proceedings of the 2017 International Conference on Unmanned Aircraft Systems (ICUAS), Miami, FL, USA, 13–16 June 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 1404–1409. [Google Scholar]
  24. Fu, Y.; Ding, M.; Zhou, C.; Hu, H. Route planning for unmanned aerial vehicle (UAV) on the sea using hybrid differential evolution and quantum-behaved particle swarm optimization. IEEE Trans. Syst. Man Cybern. Syst. 2013, 43, 1451–1465. [Google Scholar] [CrossRef]
  25. Zaky, M.S. A self-tuning PI controller for the speed control of electrical motor drives. Electr. Power Syst. Res. 2015, 119, 293–303. [Google Scholar] [CrossRef]
  26. Bennett, S. Development of the PID controller. IEEE Control Syst. Mag. 1993, 13, 58–62. [Google Scholar] [CrossRef]
  27. Eberhart, R.; Kennedy, J. A new optimizer using particle swarm theory. In Proceedings of the MHS’95. Proceedings of the Sixth International Symposium on Micro Machine and Human Science, Nagoya, Japan, 4–6 October 1995; IEEE: Piscataway, NJ, USA, 1995; pp. 39–43. [Google Scholar]
  28. Chikushi, R.T.M.; de Barros, R.S.M.; da Silva, M.G.N.M.; Maciel, B.I.F. Using spectral entropy and bernoulli map to handle concept drift. Expert Syst. Appl. 2021, 167, 114114. [Google Scholar] [CrossRef]
  29. Bao, B.; Rong, K.; Li, H.; Li, K.; Hua, Z.; Zhang, X. Memristor-coupled logistic hyperchaotic map. IEEE Trans. Circuits Syst. II Express Briefs 2021, 68, 2992–2996. [Google Scholar] [CrossRef]
  30. Manikandan, V.; Raj, V.; Janakiraman, S.; Sivaraman, R.; Amirtharajan, R. Let wavelet authenticate and tent-map encrypt: A sacred connect against a secret nexus. Soft Comput. 2024, 28, 6839–6853. [Google Scholar] [CrossRef]
  31. Lian, L.; Ji, P.; OuYang, T.; Ma, F.; Xu, S.; Gao, C.; Liu, J. Fuzzy integral sliding mode control based on microbial fuel cell. Complexity 2021, 2021, 6670039. [Google Scholar] [CrossRef]
  32. Ouyang, T.; Ma, F.; Zhu, B.; Ji, P.; Lian, L. Fuzzy Sliding Mode Control for Microbial Fuel Cells. Machines 2022, 10, 320. [Google Scholar] [CrossRef]
Figure 1. Double-chamber MFC model.
Figure 1. Double-chamber MFC model.
Electronics 13 03381 g001
Figure 2. Schematic diagram of the control system.
Figure 2. Schematic diagram of the control system.
Electronics 13 03381 g002
Figure 3. Distribution diagram of numerical values. (a) Generated by the Bernoulli map; (b) Generated by the Logistic map; (c) Generated by the Tent map; (d) Generated by the Circle map.
Figure 3. Distribution diagram of numerical values. (a) Generated by the Bernoulli map; (b) Generated by the Logistic map; (c) Generated by the Tent map; (d) Generated by the Circle map.
Electronics 13 03381 g003
Figure 4. The flowchart of GSCPSO.
Figure 4. The flowchart of GSCPSO.
Electronics 13 03381 g004
Figure 5. The convergence curve analysis of each algorithm on the F1–F6 test functions. (a) F1; (b) F2; (c) F3; (d) F4; (e) F5; (f) F6.
Figure 5. The convergence curve analysis of each algorithm on the F1–F6 test functions. (a) F1; (b) F2; (c) F3; (d) F4; (e) F5; (f) F6.
Electronics 13 03381 g005aElectronics 13 03381 g005b
Figure 6. The convergence curve analysis of each algorithm on the F7−F12 test functions. (a) F7; (b) F8; (c) F9; (d) F10; (e) F11; (f) F12.
Figure 6. The convergence curve analysis of each algorithm on the F7−F12 test functions. (a) F7; (b) F8; (c) F9; (d) F10; (e) F11; (f) F12.
Electronics 13 03381 g006
Figure 7. Performance comparison based on different control methods. (a) Substrate concentration; (b) Biomass concentration; (c) H C O 3 concentration; (d) H + concentration; (e) Control input; (f) Anode voltage; (g) Cathode voltage; (h) Total voltage.
Figure 7. Performance comparison based on different control methods. (a) Substrate concentration; (b) Biomass concentration; (c) H C O 3 concentration; (d) H + concentration; (e) Control input; (f) Anode voltage; (g) Cathode voltage; (h) Total voltage.
Electronics 13 03381 g007
Table 1. Representation of 12 classic test functions.
Table 1. Representation of 12 classic test functions.
FunctionBenchmark FunctionRange f min
F1Sphere Function[−100, 100]0
F2Schwefel’s Problem 2.22[−10, 10]0
F3Schwefel’s Problem 1.2[−100, 100]0
F4Schwefel’s Problem 2.21[−100, 100]0
F5Generalized Rosenbrock’s Function[−30, 30]0
F6Step Function[−100, 100]0
F7Quartic Function, i.e., Noise[−1.28, 1.28]0
F8Generalized Schwefel’s Problem 2.26[−500, 500]−12,569.5
F9Generalized Rastrigin’s Function[−5.12, 5.12]0
F10Ackley’s Function[−32, 32]0
F11Generalized Penalized Function 1[−50, 50]0
F12Generalized Penalized Function 2[−50, 50]0
Table 2. Comparison of GSCPSO with other algorithms in terms of mean and standard deviation.
Table 2. Comparison of GSCPSO with other algorithms in terms of mean and standard deviation.
FunctionF1 F2 F3
Algorithm MEANSTDMEANSTDMEANSTD
PSO1.3 × 1034.4 × 1021.1 × 1012.0 × 1001.8 × 1036.8 × 103
CPSO2.1 × 1031.3 × 1039.0 × 1002.0 × 1004.8 × 1032.2 × 103
GSCPSO4.1 × 10−192.2 × 10−181.9 × 10−93.1 × 10−91.7 × 10−185.3 × 10−18
FunctionF4 F5 F6
Algorithm MEANSTDMEANSTDMEANSTD
PSO9.0 × 1001.6 × 1005.9 × 1033.9 × 1031.4 × 1035.5 × 102
CPSO1.1 × 1012.0 × 1006.4 × 1034.6 × 1032.1 × 1037.1 × 102
GSCPSO5.0 × 10−114.1 × 10−114.2 × 1035.3 × 1031.6 × 1034.5 × 102
FunctionF7 F8 F9
Algorithm MEANSTDMEANSTDMEANSTD
PSO1.3 × 1004.0 × 10−1−2.5 × 1034.6 × 1029.5 × 1011.9 × 101
CPSO2.0 × 10−11.0 × 10−1−1.3 × 1032.3 × 1021.3 × 1022.5 × 101
GSCPSO2.4 × 10−38.0 × 10−3−1.2 × 1052.0 × 10300
FunctionF10 F11 F12
Algorithm MEANSTDMEANSTDMEANSTD
PSO8.8 × 1011.8 × 1005.8 × 1001.6 × 1002.3 × 1011.5 × 101
CPSO1.3 × 1022.1 × 1011.3 × 1001.8 × 1015.4 × 1014.3 × 101
GSCPSO1.8 × 10−101.5 × 10−10001.5 × 1038.0 × 103
Table 3. Parameters for different types of controllers.
Table 3. Parameters for different types of controllers.
Type of Controller K p K i K d
PSO-PID1083.0349
CPSO-PID2.59620.00978190
GSCPSO-PID1024.3139
Table 4. The values of the main parameters in the MFC.
Table 4. The values of the main parameters in the MFC.
SymbolDescriptionTypical ValueUnit
Γ m a x Maximum substrate utilization3.6 d 1
Z s Half-saturation constant32.4mg/L
ψ The maximum growth rate of microorganisms0.4 d 1
bEndogenous decay coefficient0.084 d 1
η Initial substrate concentration value60mg/L
Table 5. Comparison of substrate concentrations under different control strategies.
Table 5. Comparison of substrate concentrations under different control strategies.
MethodOvershootRise Time (s)Settling Time (s)Peak Time (s)Steady-State ErrorChattering
GSCPSO-PID6.57%7.9543.589515.680.061No
CPSO-PID7.61%8.258951.589516.50.089No
PSO-PID8.37%8.641556.721216.7520.0744No
SMC [31]1.15%7.5921.529813.30.5107Yes
FSMC [32]9.07%23.536221.789125.110.1907Yes
BC [15]79.22%64.192588.888929.340.018No
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, C.; Zhu, B.; Ma, F.; Sun, J. Design of a PID Controller for Microbial Fuel Cells Using Improved Particle Swarm Optimization. Electronics 2024, 13, 3381. https://doi.org/10.3390/electronics13173381

AMA Style

Wang C, Zhu B, Ma F, Sun J. Design of a PID Controller for Microbial Fuel Cells Using Improved Particle Swarm Optimization. Electronics. 2024; 13(17):3381. https://doi.org/10.3390/electronics13173381

Chicago/Turabian Style

Wang, Chenlong, Baolong Zhu, Fengying Ma, and Jiahao Sun. 2024. "Design of a PID Controller for Microbial Fuel Cells Using Improved Particle Swarm Optimization" Electronics 13, no. 17: 3381. https://doi.org/10.3390/electronics13173381

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop