Fuzzy Rule-Based and Particle Swarm Optimisation MPPT Techniques for a Fuel Cell Stack

The negative environmental impact and the rapidly declining reserve of fossil fuel-based energy sources for electricity generation is a big challenge to finding sustainable alternatives. This scenario is complicated by the ever-increasing world population growth demanding a higher standard of living. A fuel cell system is able to generate electricity and water with higher energy efficiency while producing near-zero emissions. A common fuel cell stack displays a nonlinear power characteristic as a result of internal limitations and operating parameters such as temperature, hydrogen and oxygen partial pressures and humidity levels, leading to a reduced overall system performance. It is therefore important to extract as much power as possible from the stack, thus hindering excessive fuel use. This study considers and compares two Maximum Power Point Tracking (MPPT) approaches; one based on the Mamdani Fuzzy Inference System and the other on the Particle Swarm Optimisation (PSO) algorithm to maintain the output power of a fuel cell stack extremely close to its maximum. To ensure that, the power converter interfaced to the fuel cell unit must be able to continuously self-modify its parameters, hence changing its voltage and current depending upon the Maximum Power Point position. While various methods exist for Maximum Power Point tracker design, this paper analyses the response characteristics of a Mamdani Fuzzy Inference Engine and the Particle Swarm Optimisation technique. The investigation was conducted on a 53 kW Proton Exchange Membrane Fuel Cell interfaced to a DC-to-DC boost converter supplying 1.2 kV from a 625 V input DC voltage. The modelling was accomplished using a Matlab/Simulink environment. The results showed that the MPPT controller based on the PSO algorithm presented better tracking efficiency as compared to the Mamdani controller. Furthermore, the rise time of the PSO controller was slightly shorter than the Mamdani controller and the overshoot of the PSO controller was 2% lower than that of the Mamdani controller.


Introduction
Fuel cells (FCs) are likely to play a key role in the current and future power industries, as they are potential candidates to replace fossil fuel-based electric generators for clean electricity production.They show great capabilities for use in microgrids [1], and unlike other green energy technologies such as wind and solar power systems, they can operate at any site without geographic limitations to provide optimal services [2].Their functioning is such that energy from an electro-chemical reaction is continuously converted into electricity in the form of direct current with water and heat as by-products [3].In this electro-chemical reaction, hydrogen is the main fuel while oxygen is the oxidant.However, various other fuels are available for use depending upon the FC type.The most current FC technologies include Polymer Electrolytic or Proton Exchange Membrane Fuel Cell (PEMFC), Alkaline Fuel Cell (AFC), Phosphoric Acid Fuel Cell (PAFC), Solid Oxide Fuel Cell Energies 2019, 12, 936 2 of 15 (SOFC), Molten Carbonate Fuel Cell (MCFC) and Direct Methanol Fuel Cell (DMFC) [3][4][5][6][7].Among all the technologies mentioned above, PEMFCs are the most popular; a report of production revealed that in 2010, 97% of fuel cells in markets were PEMFC [8].
A PEMFC consists of three active parts: an anode, a cathode, and an electrolyte in between them.The electrodes are composed of a porous material enveloped by a layer of catalysts in platinum.Molecular hydrogen (H 2 ) migrates from a gas-flow stream to the anode for the electrochemical reaction.The hydrogen is oxidised to create hydrogen ions and electrons based on the following equation: The hydrogen ions migrate to the acidic electrolyte, whereas the electrons head toward an outside circuit to go to the negative electrode.At the cathode, water is formed through the reaction between electrons and hydrogen with the oxygen supplied from an external gas-flow stream as expressed in Equation ( 2): The general reaction in a fuel cell produces electricity, water and heat as shown in Equation ( 3): The water by-products and heat are removed endlessly to maintain appropriated conditions for power generation.
In general, fuel cells present many benefits in comparison with conventional power sources such as internal combustion engines and renewable generators.These benefits are [9][10][11]:

•
Higher power efficiency; • Noise-free operation; • Less maintenance requirement; • Economical, as it does not need any fossil fuel for its operation.
However, they also have critical limitations such as poor voltage profile against current density, slower dynamics and the presence of higher current ripples.
In general, a typical PEMFC stack displays a nonlinear output power because of internal limitations and operating parameters which include the temperature, hydrogen and oxygen partial pressures, humidity levels, gas speed and stoichiometry, and membrane water content, leading to a reduced system performance [1,12,13].It is crucial to extract as much power as possible from the stack knowing that at any operating condition, there is only one Maximum Power Point.This prevents excessive fuel use and avoids low system efficiency.To ensure this, a switch mode power converter referred to as a Maximum Power Point Tracker (MPPT) is interfaced between the FC and the load and operates such that the converter's duty cycle is adjusted continuously, hence modifying the voltage and current depending upon the Maximum Power Point position.If a proper algorithm is used, the MPPT will be able to locate and track the PEMFC MPP.
This study considered and compared two maximum power point tracking approaches; one based on the Mamdani Fuzzy Inference System and the other on the Particle Swarm Optimisation algorithm to maintain the output power of a fuel cell stack as close as possible to its designed power.The main objective was to analyse the responses of both MPPT controllers.The investigation was conducted on a 53 kW Proton Exchange Membrane Fuel Cell coupled to a power electronics converter and a DC load.The simulation was performed under a Matlab/Simulink environment.The rest of the paper is organised as follows: the next section is dedicated to the system modelling, Section 3 focuses on the MPPT design, Section 4 gives the simulation results, Section 5 compares both MPPT controllers and the last section deals with the conclusion.

System Modelling
The proposed system depicted in Figure 1 consists of a 53 kW Proton Exchange Membrane Fuel cell (PEMFC) stack, a DC-to-DC boost converter and a MPPT controller.The voltage and current of the fuel cell stack are sensed and used as inputs to the MPPT controller, which in turn delivers a signal for the PWM generator to drive the converter switch.The converter delivers 1.2 kV from a 625 V input voltage.

System Modelling
The proposed system depicted in Figure 1 consists of a 53 kW Proton Exchange Membrane Fuel cell (PEMFC) stack, a DC-to-DC boost converter and a MPPT controller.The voltage and current of the fuel cell stack are sensed and used as inputs to the MPPT controller, which in turn delivers a signal for the PWM generator to drive the converter switch.The converter delivers 1.2 kV from a 625 V input voltage.

PEMFC Characteristics
The FC model adopted in this investigation is a modified version of the approach proposed by [17], whereby the dynamics of the reactant flow are negligible.
The voltage resulting from the electro-chemical reactions is expressed by the Nernst equation as [33]: where P H 2 and P O 2 are the hydrogen and oxygen partial pressures, respectively, T is the temperature, F is the Faraday constant and R is the ideal gas constant.The partial pressures are defined as function of reactant utilisation by the equations [33]: where U fH 2 and U fO 2 are the hydrogen and oxygen utilisation, respectively, P fuel and P air are the supply pressures of the hydrogen and oxygen, respectively, and x and y are the percentages of hydrogen and oxygen compositions.The rates of reactant utilisation are given as follows [34]: where V hydr and V oxyg are the hydrogen and oxygen flow rates, i fc is the cell current.
The lack of oxygen in the cell leads to the increase of its utilisation over the nominal value; hence, Equation ( 4) is adjusted as [34]:

PEMFC Characteristics
The FC model adopted in this investigation is a modified version of the approach proposed by [17], whereby the dynamics of the reactant flow are negligible.
The voltage resulting from the electro-chemical reactions is expressed by the Nernst equation as [33]: where P H 2 and P O 2 are the hydrogen and oxygen partial pressures, respectively, T is the temperature, F is the Faraday constant and R is the ideal gas constant.
The partial pressures are defined as function of reactant utilisation by the equations [33]: where U fH 2 and U fO 2 are the hydrogen and oxygen utilisation, respectively, P fuel and P air are the supply pressures of the hydrogen and oxygen, respectively, and x and y are the percentages of hydrogen and oxygen compositions.The rates of reactant utilisation are given as follows [34]: where V hydr and V oxyg are the hydrogen and oxygen flow rates, i fc is the cell current.The lack of oxygen in the cell leads to the increase of its utilisation over the nominal value; hence, Equation ( 4) is adjusted as [34]: where K u is the voltage undershoot constant and U f O 2nom is defined as the nomination oxygen utilisation.
The open circuit voltage of a single cell is given by Equation ( 9) as follows: where K C is the voltage constant.
Taking into consideration losses, including the activation losses and resistive and diffusion losses, the open circuit voltage of a single cell is expressed as: where V r = r ohm .ifc (13) where T d is the cell settling time to a current step and r ohm is the cell resistance, and i o is given as [33]: where α is the charge transfer coefficient, ∆G is the activation energy barrier, k is the Boltzmann constant and h is the Plank constant.The complete PEMFC stack voltage is given as follows: where N is the number of cells in the stack.The polarisation curve of the PEMFC used in this study is shown in Figure 2 and is based on Equations ( 4) to ( 16) using parameters in Table 1.

DC-to-DC Converter
In this study, a boost converter functioning at a switching frequency of 30 kHz is designed to step-up a 625 V DC voltage of the fuel cell to 1.2 kV.A boost converter (see Figure 1) transforms an unregulated voltage to a required voltage by readjusting the duty cycle at a high switching frequency.

DC-to-DC Converter
In this study, a boost converter functioning at a switching frequency of 30 kHz is designed to step-up a 625 V DC voltage of the fuel cell to 1.2 kV.A boost converter (see Figure 1) transforms an unregulated voltage to a required voltage by readjusting the duty cycle at a high switching frequency.The choice of components such as the inductor and capacitor is crucial to decrease the ripple generation depending on the switching frequency.In a continuous conduction mode, a boost converter operates with inductance greater than the critical inductance, L C defined as: where where f is the switching frequency and R is the load.
To hinder high ripple voltage, a boost converter requires a filter capacitor as the current supplied to the RC circuit is discontinuous.Whenever the diode is turned off, the capacitor supplies the output current.Thus, the capacitor must be higher than a certain value.The minimum value of the capacitor C Min is expressed as: where ∆V O is the ripple voltage.The boost converter parameters as calculated using Equations ( 17)-( 19) are given in Table 2.

Mamdani Fuzzy Inference MPPT Controller Design
Fuzzy Inference Systems are based on two methods: the Mamdani Fuzzy Inference technique [21,[35][36][37][38][39][40] and the Takagi-Sugeno-Kang Inference method [35,36,38,39,[41][42][43][44][45][46][47][48].The major Energies 2019, 12, 936 6 of 15 difference between them lies in the consequent fuzzy rules and defuzzification procedures; the Mamdani Inference method uses fuzzy sets as rule consequent, while Sugeno Inference considers linear functions of input variables.In the Mamdani approach, the crisp output of the fuzzy system y crisp is determined using the "Centre of Gravity" defuzzification by supposing that the consequent fuzzy set of Rule i is Q i , characterised by membership u Q i and by defining the centre of areas of u Q i to be the point q i in the universe.Equation (20) gives the crisp output of the Mamdani method [40]: For MPPT controller design, two inputs are required, namely the error e and the change in error ∆e.The error is expressed as: where p(k), p(k − 1), v(k) and v(k − 1) are the powers and voltages at instants k and k − 1 respectively.The change in error ∆e k is given as follows: where e k and e k−1 are the error at instants k and k −1.
The proposed Mamdani Fuzzy Inference System MPPT controller uses two inputs, as shown in Figure 3.Each input consists of five triangular membership functions with a normalised universe of discourse ranging from −2 to 2. These inputs are the error and the change in error as expressed in Equations ( 21) and (22).They include five variables, namely negative big (NB), negative small (NS), zero (Z), positive small (PS) and positive big (PB).

Mamdani Fuzzy Inference MPPT Controller Design
Fuzzy Inference Systems are based on two methods: the Mamdani Fuzzy Inference technique [21,[35][36][37][38][39][40] and the Takagi-Sugeno-Kang Inference method [35,36,38,39,[41][42][43][44][45][46][47][48].The major difference between them lies in the consequent fuzzy rules and defuzzification procedures; the Mamdani Inference method uses fuzzy sets as rule consequent, while Sugeno Inference considers linear functions of input variables.In the Mamdani approach, the crisp output of the fuzzy system y crisp is determined using the "Centre of Gravity" defuzzification by supposing that the consequent fuzzy set of Rule i is Q i , characterised by membership u Q i and by defining the centre of areas of u to be the point  in the universe.Equation (20) gives the crisp output of the Mamdani method [40]: For MPPT controller design, two inputs are required, namely the error e and the change in error Δe.The error is expressed as: where p k , p k-1 , v k and v k-1 are the powers and voltages at instants k and k − 1 respectively.The change in error Δek is given as follows: where e k and e k-1 are the error at instants k and k-1.
The proposed Mamdani Fuzzy Inference System MPPT controller uses two inputs, as shown in Figure 3.Each input consists of five triangular membership functions with a normalised universe of discourse ranging from −2 to 2. These inputs are the error and the change in error as expressed in Equations ( 21) and (22).They include five variables, namely negative big (NB), negative small (NS), zero (Z), positive small (PS) and positive big (PB).The output of the Mamdani Inference Engine consisted of five membership functions (two trapezoidal and three triangular membership functions), namely negative big (NB), negative small (NS), zero (Z), positive small (PS) and positive big (PB) (see Figure 4).The universe of discourse ranged from 0 to 1.The output of the Mamdani Inference Engine consisted of five membership functions (two trapezoidal and three triangular membership functions), namely negative big (NB), negative small (NS), zero (Z), positive small (PS) and positive big (PB) (see Figure 4).The universe of discourse ranged from 0 to 1.The rules are designed based on the provided inputs and Table 3 shows the relationship between the inputs and output.The rules are designed based on the provided inputs and Table 3 shows the relationship between the inputs and output.

Particle Swarm Optimisation MPPT Controller Design
Particle Swarm Optimisation (PSO) is one of the most current nature-inspired optimisation algorithms, and was developed by James Kennedy and Russell Eberhart in 1995 [49,50].Lately, PSO has arisen as a promising algorithm in solving many optimisation problems in science and engineering.For MPPT applications, the PSO method is easy to implement, exhibits fast computation capabilities and allows the determination of the MPP regardless of environmental conditions [26].The method is based on the behaviour of bird flocks; a number of collaborative particles are used in an n dimensional space and each particle has a position p i (distributed randomly) and velocity v i (v i = 0 in initiation).The position of a particle is determined by the best position found by the particle so far P best , and the best position of all particles so far G best .The equations defining the standard PSO approach are as follows: x i = 1, 2, 3, . . ., N where x i and v i are the velocity and position of a particle i, respectively, w represents the inertia weight, k is the iteration number.r 1 and r 2 are random variables uniformly distributed in the range of [0,1], P best is the best position of particle i, G best is the best position of all the particles in the swarm and c 1 and c 2 are the cognitive and social coefficients, respectively.The operational procedure of a PSO algorithm involves the following five steps:

•
The first step consists of randomly initialising the particles in the same distribution either over the search space or on grid nodes covering the search space in equidistant points.

•
The second step concerns the evaluation of the fitness of particles one by one, by giving the possible solution to the objective function.

•
In the third step, individual and global best fitness values (P best and G best ) are updated through the comparison of their previous values against the newly calculated and the replacement of P best and G best including their corresponding positions.

•
The fourth step involves the update of the velocity and position of particles one by one in the swarm using Equations ( 23) and ( 24).

•
The last step consists of verifying if the convergence criterion is satisfied in order to end the process or to increase the number of iteration by 1 and move to step 2.
The PSO MPPT controller used in this study is based on the flowchart depicted in Figure 5. • The fourth step involves the update of the velocity and position of particles one by one in the swarm using Equations ( 23) and ( 24).

•
The last step consists of verifying if the convergence criterion is satisfied in order to end the process or to increase the number of iteration by 1 and move to step 2.
The PSO MPPT controller used in this study is based on the flowchart depicted in Figure 5.

Results Using the Mamdani MPPT Controller
A simulation of the system shown in Figure 1 was carried out under a Matlab/Simulink environment for a duration of 10 s using an MPPT controller based on the Mamdani Fuzzy Inference Engine to evaluate the response characteristics of the current, voltage and power curves.Figure 6 depicts the corresponding results.A simulation of the system shown in Figure 1 was carried out under a Matlab/Simulink environment for a duration of 10 s using an MPPT controller based on the Mamdani Fuzzy Inference Engine to evaluate the response characteristics of the current, voltage and power curves.The output voltage of the system at the load side was about 1.214 kV, as shown in Figure 6a.The fuel cell hydrogen flow rate, hydrogen pressure and temperature were unchanged, and the operating voltage was at a constant value.It had a rising time of about 1.172 ms, which corresponded to the time required for the voltage to rise from 0 to 100% of its final value.In addition, the overshoot and undershoot were 29.221% and 5.816%, respectively.These percentages of undershoot and overshoot The output voltage of the system at the load side was about 1.214 kV, as shown in Figure 6a.The fuel cell hydrogen flow rate, hydrogen pressure and temperature were unchanged, and the operating voltage was at a constant value.It had a rising time of about 1.172 ms, which corresponded to the time required for the voltage to rise from 0 to 100% of its final value.In addition, the overshoot and undershoot were 29.221% and 5.816%, respectively.These percentages of undershoot and overshoot show the appearance of the signal exceeding 1.214 kV and the occurrence of the signal below 1.214 kV, respectively.The settling time of the voltage signal was 8.072 ms.
The output current at the terminals of the converter is shown in Figure 6b and had a value of about 42.17 A. It had a rising time of about 1.172 ms, and an overshoot and undershoot of 29.221% and 5.816%, respectively.In the same vein, the power at the terminals of the converter is displayed in Figure 6c, and corresponds to 51.83 kW.Its rising time was 896.288 µs, with an overshoot and undershoot of 65.833% and 1.121%, respectively.Its settling time, which refers to the time needed for the power curve to reach and stay within its final value by the absolute percentage of 2% or 5%, was 10.53 ms.
Moreover, the tracking efficiency, which was an important parameter to assess the accuracy of the MPPT algorithm, was determined as 97.79% of the fuel cell designed power using the equation: where P MPPT expresses the output power of the implemented MPPT controller (51.83 kW) and P MPP is the maximum power of the fuel cell stack (53 kW).

Results Using the PSO MPPT Controller
The system shown in Figure 1 was simulated under a Matlab/Simulink environment for a duration of 10 s using an MPPT controller based on the Particle Swarm Optimisation approach to analyse the response characteristics of the current, voltage and power curves.The curves resulting from the simulation are shown in Figure 7.
The output voltage at the terminals of the converter was 1.228 kV (see Figure 7a).The fuel cell hydrogen flow rate, hydrogen pressure and temperature were unchanged, and this voltage was constant throughout the simulation.The voltage had a rising time of about 1.177 ms.In addition, the overshoot and undershoot were 27.564% and 7.925%, respectively.The time that this voltage required to reach and stay within a range of its final value was 19.981 ms.
Similarly, the output current of this system is shown in Figure 7b and had a value of about 42.66 A, it has a rising time of about 1.177 ms, and an overshoot and undershoot of 27.564% and 7.925%, respectively.The settling time corresponding to the output current was 19.981 ms.In the same vein, the power at the terminals of the converter is displayed in Figure 7c, and was around 52.68 kW.Its rising time was 834.688 µs, with an overshoot and undershoot of 63.115% and 3.736%, and a settling time of 20.009 ms.
The tracking efficiency of the PSO algorithm was calculated as 99.39% of the fuel cell maximum power (53 kW) using Equation ( 25).The output voltage at the terminals of the converter was 1.228 kV (see Figure 7a).The fuel cell hydrogen flow rate, hydrogen pressure and temperature were unchanged, and this voltage was constant throughout the simulation.The voltage had a rising time of about 1.177 ms.In addition, the

Discussion
When comparing both controllers with respect to the simulation processing time, it was observed that the Mamdani MPPT controller required more time compared to the controller based on the PSO algorithm.Thus, the PSO controller reached the MPP faster than the Mamdani controller did.Table 4 shows the response characteristic parameters of both controllers; the PSO MPPT controller displayed better tracking efficiency compared to the Mamdani MPPT controller.Additionally, the rise time of the PSO controller was slightly shorter than the Mamdani controller.Furthermore, the overshoot of the PSO controller was about 2% lower than the Mamdani Controller.However, the voltage, current and power curves obtained from the PSO controller show some short sporadic and undesirable oscillations (see Figure 7).Even though the Mamdani controller was less accurate in terms of the tracking efficiency, it showed better dynamic response in the settling time and undershoot, as the values obtained were lower than those proposed by the PSO controller.The voltage, current and power curves resulting from this controller presented no oscillation.

Conclusions
The negative environmental impact and the rapidly declining reserve of fossil fuel-based energy sources for electricity generation is a big challenge to finding sustainable alternatives.This scenario is complicated with the ever-increasing world population growth demanding a higher standard of living.A fuel cell system is able to generate high-grade electricity and water with higher energy efficiency while producing near-zero emissions.
This study compared two Maximum Power Point Tracking approaches; one based on the Mamdani Fuzzy Inference System and another on the Particle Swarm Optimisation algorithm to constrain a fuel cell stack to deliver its maximum power.The main objective was to analyse the response characteristics of both MPPT controllers.The investigation was conducted on a 53 kW Proton Exchange Membrane Fuel Cell coupled to a DC-to-DC converter delivering 1.2 kV from 625 V and a DC load.The results showed that the MPPT controller based on the PSO algorithm presented better tracking efficiency as compared to the Mamdani controller.Furthermore, the rise time of the PSO controller was slightly shorter than that of the Mamdani controller, and the overshoot of the PSO controller was 2% lower than that of the Mamdani controller.However, the voltage, current and power curves obtained from the PSO controller presented some short sporadic and undesirable oscillations.On the other hand, the Mamdani controller showed better performances in the settling time and undershoot.

Figure 6 .
Figure 6.(a) Output voltage, (b) output current and (c) output power using the Mamdani Fuzzy Inference System.

Figure 6 .
Figure 6.(a) Output voltage, (b) output current and (c) output power using the Mamdani Fuzzy Inference System.

Figure 7 .
Figure 7. (a) Output voltage, (b) output current and (c) output power using the Particle Swarm Optimisation algorithm.

Figure 7 .
Figure 7. (a) Output voltage, (b) output current and (c) output power using the Particle Swarm Optimisation algorithm.