Simulation of Fuzzy Control of Oxygen Flow in PEM Fuel Cells

: This paper presents an alternative approach to the ﬂow control of an oxidizer in a proton exchange membrane (PEM) fuel cell system in which pure oxygen is the gas supplied to the cathode channel of the stack. The proposed oxygen ﬂow control is implemented based on information about the current drawn from the fuel cell stack and the voltage variation in the stack. This information and a fuzzy-logic-based control algorithm are used to increase oxygen utilization in a PEM fuel cell system without a recirculation system in relation to the control, in which the oxygen ﬂow rate is determined only in proportion to the current drawn from the stack. To verify the validity of the adopted assumptions, simulation tests of the proposed fuzzy control algorithm were conducted, for which parameters were adopted arbitrarily and determined with help of genetic algorithms. For simulation research, the proposed empirical mathematical model was used, which describes the mathematical relationship between voltage variation in the stack and the stoichiometry of oxygen ﬂow through the cathode of a fuel cell stack. The simulation results conﬁrm that the proposed control method leads to an increase in the oxygen utilization in the system without oxygen recirculation compared to an open system with cathode stoichiometry set to a constant level.


Introduction
Fuel cells are electric energy generation technology that can help solve the problem of ever-increasing greenhouse gas emissions and avoid the anticipated energy crisis resulting from limited fossil fuel resources.
One intensively developed technology is the proton exchange membrane fuel cell (PEM FC), in which the source of electricity is the chemical reaction of hydrogen with oxygen [1][2][3]. Fuel cells of this type have a set of features that enable their various applications: as an emergency power source and autonomous power supply for electricity and heat of buildings, e.g., a single-family house, or an electric car [2]. They are also used in unusual solutions such as underwater vehicles and submarines as well as spaceships and space stations [4][5][6][7][8]. The fuel cell converts chemical energy into usable electricity, making it more like a classic internal combustion engine (ICE) generator than a typical galvanic cell. Fuel and an oxidizer must be supplied to this power source, similar to the ICE generator; however, no intermediate stages of energy transformation using combustion are necessary. Therefore, the energy converter does not have any moving parts, and thus does not generate noise or vibrations, which is a significant advantage for many applications. For a fuel cell, the physical separation of the storage and conversion of chemical energy into electricity is an important feature; hence, it is only an energy converter, whereas galvanic cells also store energy [3,9,10].
A significant problem associated with the operation of fuel-cell-based systems is supplying the fuel cell stack with an oxidizer and specifically to control its flow [11][12][13][14]. This issue has been widely considered in the literature [10,[15][16][17][18][19][20][21][22][23][24][25], and the proposed methods of controlling the oxidant flow include both classic forward and feedback regulators, as well as adaptive, fuzzy-logic-based, and artificial neural networks. The described algorithms for controlling the flow of reactants primarily focus on preventing fuel starvation or oxygen starvation, i.e., the supply of reactants in the amount required by the reaction rate occurring in the cells [11,[26][27][28][29]. This is particularly important because deficiencies in the fuel or oxidizer may cause irreversible damage to the stack by degrading its components [30,31].
Controlling the flow of substrates should ensure the reduction in energy losses occurring in the cells, which result from the low concentration of reactants, called concentration losses in the literature. The effective export of reaction products outside the cells must also be ensured. To implement the above, pressures and the flow of reaction gases are maintained at sufficiently high levels.
In the case of PEM fuel cell systems, in which the oxidant is oxygen obtained from atmospheric air, this task is implemented using devices forcing an appropriate high air flow rate, protecting the fuel cell stack against the negative effects of oxygen deficiency and preventing water condensation inside the stack [32][33][34][35]. The use of excess oxidant flow to remove reaction water in systems using oxygen in air is generally implemented in the fuel cell system with an open cathode architecture, i.e., oxidizer subsystem without a recirculation part. In this system, air is forced through a cathode compartment by a compressor or blower. The reaction water along with excess air are removed outside the stack. In some systems, airflow is also used to remove excess heat from the fuel cell stack [7]. A typical configuration of the air subsystem is presented in a simplified form in Figure 1.
Energies 2020, 13, x FOR PEER REVIEW 2 of 26 include both classic forward and feedback regulators, as well as adaptive, fuzzy-logic-based, and artificial neural networks. The described algorithms for controlling the flow of reactants primarily focus on preventing fuel starvation or oxygen starvation, i.e., the supply of reactants in the amount required by the reaction rate occurring in the cells [11,[26][27][28][29]. This is particularly important because deficiencies in the fuel or oxidizer may cause irreversible damage to the stack by degrading its components [30,31]. Controlling the flow of substrates should ensure the reduction in energy losses occurring in the cells, which result from the low concentration of reactants, called concentration losses in the literature. The effective export of reaction products outside the cells must also be ensured. To implement the above, pressures and the flow of reaction gases are maintained at sufficiently high levels.
In the case of PEM fuel cell systems, in which the oxidant is oxygen obtained from atmospheric air, this task is implemented using devices forcing an appropriate high air flow rate, protecting the fuel cell stack against the negative effects of oxygen deficiency and preventing water condensation inside the stack [32][33][34][35]. The use of excess oxidant flow to remove reaction water in systems using oxygen in air is generally implemented in the fuel cell system with an open cathode architecture, i.e., oxidizer subsystem without a recirculation part. In this system, air is forced through a cathode compartment by a compressor or blower. The reaction water along with excess air are removed outside the stack. In some systems, airflow is also used to remove excess heat from the fuel cell stack [7]. A typical configuration of the air subsystem is presented in a simplified form in Figure 1. The actual value of the oxygen flow intensity supplying the cathode of the fuel cell stack is determined so that the amount of gas fed into the stack is always greater than the stoichiometric value , which is expressed as where is the oxygen flow coefficient, also called the cathode stoichiometry or cathode stoichiometric ratio.
The disadvantage of this approach for controlling the flow of oxidant is the need to force a large intensity of gas flow through the fuel cell stack and sometimes to compress the gas to high pressure. This contributes to a reduction in the overall efficiency of the fuel cell system due to the consumption of a certain amount of electric energy generated by the stack to drive compressors or fans.
Therefore, in the methods used in practice to control the flow and pressure of reagents in the stack, an algorithm is implemented that searches for a working point of substrates supplying subsystems for which the fuel cell system has the maximum efficiency of energy conversion [14,36], while protecting the stack against fuel and oxygen starvation by maintaining the stoichiometry of the reagents above the assumed minimum levels. Therefore, a compromise occurs between the concentration losses occurring at reduced pressures and flows and the internal energy losses of the fuel cell system related to the work of auxiliary devices. Hence, in most fuel cell systems, the oxidant flow is controlled in proportion to the current drawn from the stack [11,17,24,[37][38][39]. For such a The actual value of the oxygen flow intensity supplying the cathode of the fuel cell stack ψ O 2 r is determined so that the amount of gas fed into the stack is always greater than the stoichiometric value ψ O 2 , which is expressed as where k O 2 is the oxygen flow coefficient, also called the cathode stoichiometry or cathode stoichiometric ratio. The disadvantage of this approach for controlling the flow of oxidant is the need to force a large intensity of gas flow through the fuel cell stack and sometimes to compress the gas to high pressure. This contributes to a reduction in the overall efficiency of the fuel cell system due to the consumption of a certain amount of electric energy generated by the stack to drive compressors or fans.
Therefore, in the methods used in practice to control the flow and pressure of reagents in the stack, an algorithm is implemented that searches for a working point of substrates supplying subsystems for which the fuel cell system has the maximum efficiency of energy conversion [14,36], while protecting the stack against fuel and oxygen starvation by maintaining the stoichiometry of the reagents above the assumed minimum levels. Therefore, a compromise occurs between the concentration losses occurring at reduced pressures and flows and the internal energy losses of the fuel cell system related to the work of auxiliary devices. Hence, in most fuel cell systems, the oxidant flow is controlled in proportion to the current drawn from the stack [11,17,24,[37][38][39]. For such a system, the actual value Energies 2020, 13, 2372 3 of 26 of the oxidant flow ψ O 2 r is determined on the basis of the relationship in Equation (1). The value of the stoichiometric oxidant flow ψ O 2 is determined on the basis of the current drawn from the fuel cell stack in Equation (2), and the value of the coefficient k O 2 is assumed to be constant so that the oxygen flow through the cathode compartment is proper for all possible and permissible states of the fuel cell system. For this assumption, controlling the flow of oxidant through the cathode compartment of the fuel cell stack is illustrated in Figure 2.
where n is the number of cells in the stack, I st is the current drawn from the stack, and F is the Faraday constant.
Energies 2020, 13, x FOR PEER REVIEW 3 of 26 system, the actual value of the oxidant flow is determined on the basis of the relationship in Equation (1). The value of the stoichiometric oxidant flow is determined on the basis of the current drawn from the fuel cell stack in Equation (2), and the value of the coefficient is assumed to be constant so that the oxygen flow through the cathode compartment is proper for all possible and permissible states of the fuel cell system. For this assumption, controlling the flow of oxidant through the cathode compartment of the fuel cell stack is illustrated in Figure 2.
where n is the number of cells in the stack, Ist is the current drawn from the stack, and F is the Faraday constant. An analysis of studies available in the literature on fuel cell systems, in which the oxidant is oxygen obtained from atmospheric air, showed that for the proper operation of the system, at least twice as much air must be supplied as actually needed by the reactions occurring in the cells = 2 [24,27,40]. Supplying the oxidant with such intensity prevents the oxygen starvation effect, removes reaction water from the stack, and is beneficial due to the overall efficiency of the fuel cell system. For fuel cell systems that do not have access to air, e.g., for those installed in underwater platforms, pure oxygen is used as an oxidant. This difference causes a significant change in the concentration of the oxidant in the cathode chamber, because, while maintaining the total pressure unchanged, gas partial pressure increases almost fivefold.
With an increased oxidant concentration, the much lower oxygen flow rate is assumed to prevent oxygen starvation and increased concentration losses. However, with such a significantly reduced cathode stoichiometry, a significant operational problem arises associated with the need to remove the water that is the product of an electrochemical reaction in the cells. This occurs because, with a reduced reaction gas flow rate, the efficacy of water removal is also limited, which can lead to water condensation inside stack. The consequence of this may be blocking certain areas of the active surface of the cathode and even completely blocking the oxidant flow through the fuel cell, which may result in damage or emergency stopping of the fuel cell system.
In systems where the oxidant is pure oxygen, as in atmospheric air systems, the excess oxygen flow is used to remove water from the stack. When pumped through gas diffusion channels in a bipolar plate, the oxygen flow lifts water molecules and transports them outside the stack. Both analysis of literature sources regarding the use of fuel cells to supply underwater platforms with energy [6][7][8]15,[41][42][43][44][45][46][47][48][49][50][51][52][53][54][55][56][57][58][59], as well my own experience indicate that, in these applications, a system with a closed cathode outlet in combination with an oxygen recirculation subsystem is widely used, whose main element is a recirculation pump or ejector, forcing the appropriate backflow. Oxygen is pumped through the cathode compartment in an excess relative to the stoichiometric value. The excess oxygen together with the reaction water is transported outside the stack, where the reaction water is separated, and the oxygen is again fed to the fuel cell stack. A simplified structure of a typical oxygen subsystem configuration is shown in Figure 3.  An analysis of studies available in the literature on fuel cell systems, in which the oxidant is oxygen obtained from atmospheric air, showed that for the proper operation of the system, at least twice as much air must be supplied as actually needed by the reactions occurring in the cells k O 2 = 2 [24,27,40]. Supplying the oxidant with such intensity prevents the oxygen starvation effect, removes reaction water from the stack, and is beneficial due to the overall efficiency of the fuel cell system.
For fuel cell systems that do not have access to air, e.g., for those installed in underwater platforms, pure oxygen is used as an oxidant. This difference causes a significant change in the concentration of the oxidant in the cathode chamber, because, while maintaining the total pressure unchanged, gas partial pressure increases almost fivefold.
With an increased oxidant concentration, the much lower oxygen flow rate is assumed to prevent oxygen starvation and increased concentration losses. However, with such a significantly reduced cathode stoichiometry, a significant operational problem arises associated with the need to remove the water that is the product of an electrochemical reaction in the cells. This occurs because, with a reduced reaction gas flow rate, the efficacy of water removal is also limited, which can lead to water condensation inside stack. The consequence of this may be blocking certain areas of the active surface of the cathode and even completely blocking the oxidant flow through the fuel cell, which may result in damage or emergency stopping of the fuel cell system.
In systems where the oxidant is pure oxygen, as in atmospheric air systems, the excess oxygen flow is used to remove water from the stack. When pumped through gas diffusion channels in a bipolar plate, the oxygen flow lifts water molecules and transports them outside the stack. Both analysis of literature sources regarding the use of fuel cells to supply underwater platforms with energy [6][7][8]15,[41][42][43][44][45][46][47][48][49][50][51][52][53][54][55][56][57][58][59], as well my own experience indicate that, in these applications, a system with a closed cathode outlet in combination with an oxygen recirculation subsystem is widely used, whose main element is a recirculation pump or ejector, forcing the appropriate backflow. Oxygen is pumped through the cathode compartment in an excess relative to the stoichiometric value. The excess oxygen together with the reaction water is transported outside the stack, where the reaction water is separated, and the oxygen is again fed to the fuel cell stack. A simplified structure of a typical oxygen subsystem configuration is shown in Figure 3. I modified the oxidant subsystem by removing elements of the oxygen recirculation system (Figure 4), which made its architecture similar to the oxidant subsystem, which uses oxygen from atmospheric air. This solution reduces the energy needs of the fuel cell system and reduces its total weight, but the essential functions of the oxygen recirculation system, i.e., oxygen supply and removal of water from the stack, must be ensured by other means, i.e., appropriate oxygen flow control.
Although the constructions of the typical air subsystem and the modified oxygen subsystem are quite similar, the principles of controlling the oxygen flow through the stack must be different. From the viewpoint of the proper operation of the stack, direct application of air flow control rules is possible; from an economic point of view, this solution is not justified. Adopting a stoichiometric oxygen flow coefficient 2 at value of 2 or higher, which is the typical for air systems [24,62,63], would result in an unreasonably low oxygen utilization; the ratio of the amount of oxygen used for the reactions occurring in the cell to the amount of oxygen supplied to the stack would be 50% or less. Therefore, a new and important control criterion appeared: the degree of oxygen utilization, which becomes even more important when the amount of available oxygen is strictly limited, as is  This approach is characterized by a high degree of oxygen utilization, which is desirable especially if the amount of oxygen is strictly limited. The only loss of oxygen in such a system results from the need to remove accumulation of impurities in the cells brought together with the reaction gas. The main disadvantage of this oxygen subsystem configuration is the presence of additional elements in the form of a three-way valve, enabling oxygen to be fed back into the system and an oxygen pump forcing the recirculation of the reagent, which consumes part of the energy generated by the fuel cell system for its operation, and thus contributes to lowering the overall power system efficiency. Each additional element in the fuel cell system adversely affects its volume-mass balance, which is a particularly important issue for underwater applications [50,58]. However, the literature studies showed some solutions which minimize the parasitic power of oxygen subsystem. That kind of oxygen subsystem configuration was presented in [59], where authors suggest the use of a set of two ejectors to recirculate the oxygen in a PEMFC system in a submarine. In their research, they proved that the ejectors in combination with switching valves and their proper control strategy provide adequate oxygen backflow in any load conditions. Another interesting approach minimizing the parasitic power of oxygen subsystem was presented in [55]. To maintain proper ventilation of the cathodic compartment of the PEM FC stack, instead of one stack, they used two smaller stacks. With two water separators and a set of four switching valves and their synchronous switching, they successfully eliminated active recirculation (recirculation pump) maintaining proper operation of the fuel cell system at the same time. A similar solution was presented in [60,61], where the authors proposed cascading-type or multi-stage construction of the PEM FC stack for dead-end operation. Their stack was developed to operate as air independent power source for underwater vehicle. In their work, they proved that cascade-type construction of the stack is beneficial for overall system efficiency and oxygen utilization referring to the typical stack construction.
This paper presents a concept of controlling the flow of oxygen in a PEM fuel cell system with regular stack construction and no oxygen recirculation subsystem. Oxygen, which is not used in the electrochemical reaction, is removed outside the FC system. Simulation tests showed that both control strategies using a fuzzy proportional-differential (PD) controller with manually selected parameters and parameters selected using genetic algorithms ensure the proper operation of the fuel cell stack, Energies 2020, 13, 2372 5 of 26 preventing excessive increases in voltage variation in the stack and simultaneously minimizing oxygen consumption. For the best results obtained from simulation tests, the oxygen utilization may even exceed 95%.

Oxydizer Subsystem Configuration
The main difference between a fuel cell system in which pure oxygen is used as the oxidant and one in which atmospheric air is used is the architecture of the oxidant supply subsystem. In systems operating without access to air, using devices to force the flow of oxidant through the cathode compartment of the fuel cell stack is not necessary. The proper flow is often produced due to the pressure difference between the oxygen storage and the fuel cell stack. However, an oxygen pump can be present in fuel cell systems with oxygen recirculation. The structure of a typical oxidant subsystem in systems using pure oxygen is shown in Figure 3.
I modified the oxidant subsystem by removing elements of the oxygen recirculation system (Figure 4), which made its architecture similar to the oxidant subsystem, which uses oxygen from atmospheric air. This solution reduces the energy needs of the fuel cell system and reduces its total weight, but the essential functions of the oxygen recirculation system, i.e., oxygen supply and removal of water from the stack, must be ensured by other means, i.e., appropriate oxygen flow control. I modified the oxidant subsystem by removing elements of the oxygen recirculation system (Figure 4), which made its architecture similar to the oxidant subsystem, which uses oxygen from atmospheric air. This solution reduces the energy needs of the fuel cell system and reduces its total weight, but the essential functions of the oxygen recirculation system, i.e., oxygen supply and removal of water from the stack, must be ensured by other means, i.e., appropriate oxygen flow control.
Although the constructions of the typical air subsystem and the modified oxygen subsystem are quite similar, the principles of controlling the oxygen flow through the stack must be different. From the viewpoint of the proper operation of the stack, direct application of air flow control rules is possible; from an economic point of view, this solution is not justified. Adopting a stoichiometric oxygen flow coefficient 2 at value of 2 or higher, which is the typical for air systems [24,62,63], would result in an unreasonably low oxygen utilization; the ratio of the amount of oxygen used for the reactions occurring in the cell to the amount of oxygen supplied to the stack would be 50% or less. Therefore, a new and important control criterion appeared: the degree of oxygen utilization, which becomes even more important when the amount of available oxygen is strictly limited, as is Although the constructions of the typical air subsystem and the modified oxygen subsystem are quite similar, the principles of controlling the oxygen flow through the stack must be different. From the viewpoint of the proper operation of the stack, direct application of air flow control rules is possible; from an economic point of view, this solution is not justified. Adopting a stoichiometric oxygen flow coefficient k O 2 at value of 2 or higher, which is the typical for air systems [24,62,63], would result in an unreasonably low oxygen utilization; the ratio of the amount of oxygen used for the reactions occurring in the cell to the amount of oxygen supplied to the stack would be 50% or less.
Therefore, a new and important control criterion appeared: the degree of oxygen utilization, which becomes even more important when the amount of available oxygen is strictly limited, as is the case in underwater applications. While maximizing oxygen utilization, the correct working conditions of the stack must be maintained. The elimination of the oxygen recirculation also means that the criterion related to maximizing the efficiency of the fuel cell system, defined as the ratio of the power supplied to the devices and the power actually delivered by the fuel cell stack, no longer exists because the oxygen subsystem shown in Figure 4 has no elements that affect the change in system efficiency, Energies 2020, 13, 2372 6 of 26 because the oxygen flow regulator with a controlled valve consumes a constant amount of electric energy regardless of its operating point.
The above analysis indicated the need to redefine the task of controlling the flow of oxygen in such a fuel cell system. Developing new control principles and algorithms as well as evaluation criteria for oxygen flow control was necessary to maximize the degree of oxygen utilization while ensuring appropriate operating conditions for the fuel cell stack.
The fuel cell stack during use can exist in four different typical operating states: (1) State 1: Starting the fuel cell system. The system performs the actions necessary to bring the stack to nominal operating conditions. At this stage, the anode and cathode are flushed with an inert gas (nitrogen), flushed with reaction gases (hydrogen and oxygen), and the stack is heated to the operating temperature. i.e., disconnection from the load, closing the supply of reaction gases, and flushing the cathode and anode with inert gas.
In this study, stage 3 oxygen flow control was the focus. For the other operating states, oxygen flow was controlled according to a predetermined program.
The main purpose of controlling the flow of oxidant is to ensure oxygen supply to the surface of the active cells forming a stack in an amount resulting from the speed of the reactions occurring while minimizing oxygen consumption and ensuring proper operating conditions in the cathode of the stack, i.e., an even distribution of oxygen over the active area of the electrodes and the removal of reaction water, thereby preventing flooding the cathode compartment of the fuel cell stack.
Therefore, assuming that P(t) is a set of time-varying operating parameters of the PEM fuel cell stack falling within the permissible ranges of these parameters, S(t) is the time-varying control of oxygen flow through the cathode compartment of the fuel cell stack, W(t) is a set of parameters determining the operating conditions of the stack, and W d is a set of permissible values of these parameters. Then, the task of controlling oxygen flow can be defined as follows: For each time-varying set of fuel cell stack parameters P(t), whose elements fall within the set of permissible values of these parameters, oxygen flow control S(t) minimizes oxygen consumption while ensuring the proper working conditions of the fuel cell stack. Therefore, the task of controlling oxygen flow is an issue to be addressed in the field of optimal control.
An important aspect of this issue is defining the proper operating conditions for the PEM fuel cell stack. The quantities that define these conditions include the working temperature of the stack, the partial pressures of the reactants in the cells, and the humidity of the gases entering the stack. Another important and measurable quantity indirectly affecting the functioning of the stack is the flow rate of the reaction gases. This parameter affects the quantities characterizing the operation of the stack such as the concentration of reactants on the active surfaces of cells electrodes and the relative humidity prevailing in different areas of a single cell and of the stack. In this study, the focus was the stack operating conditions resulting from a change in the oxygen flow rate through the cathode compartment of the stack. Based on previous findings [64], the measurement of the voltages of individual cells of the stack and assessment of their non-uniformity can be useful estimators of the diversity of the prevailing operating conditions. In the case of an efficient and properly operating stack, this firstly allows for using the results of these voltage measurements to assess the quality of reproducibility of the membrane-electrode assembly and stack components manufacturing process [65]. Moreover, it enables the assessment of homogeneity of operating conditions inside the stack [66], and thus indirectly to Energies 2020, 13, 2372 7 of 26 assess the proper operation of the fuel cell stack subsystems, and, in particular, the subsystem of the oxidant supply and reaction water evacuation. Secondly, the assessment of voltage diversity can be used as a preliminary diagnostic tool to identify cells in the stack that have structural or manufacturing defects or are damaged. In addition, this study showed that under specific stack operating conditions it is possible that the lowered cathode stoichiometry leads to a significant reduction in voltage on only one cell in the stack.
The voltage range in the stack R U was adopted as a measure describing the scale of voltage diversity in a given moment. This quantity is a variable depending on the cells' similarity, stack design and operating conditions. In this research, voltage range is defined as the difference between the maximum and minimum voltages occurring on individual cells and is described by the relationship On the basis of the above observations and the inability to measure some of the values that determine the voltage values for individual cells in the stack, e.g., water activity in the membrane or partial gas pressures occurring on the active surfaces of electrodes of individual cells, a mathematical model was required describing changes in voltage range in the stack as a function of oxygen flow through the cathode compartment. The empirical mathematical model in Equation (5) and its parameters (Table 1) were developed on the basis of experimental research conducted on the real fuel cell system.
where K 1 , K 2 , T 1 , T 2 , p 1 , q 1 , q 2 are the parameters of the model, R U0 is the initial value of the voltage range in the stack, k kr is the critical value of the oxygen flow coefficient, R U,st is the sable value of voltage range. This test consisted of the step changes in the oxygen flow coefficient and simultaneous observation of changes in the voltage range in the stack. The experiment was divided into two parts, namely, the first one was based on several measurements during the step reduction in oxygen stoichiometry, and the second one on several measurements during step increase in the stoichiometry. The cathode stoichiometry was changed according to the data contained in Table 2. As a result of the conducted tests, step responses of the system, shown in Figure 5, were obtained, which in turn enabled the assessment of the nature of the voltage range changes on the basis of which the mathematical notation was defined and the parameters of this model were determined.   According to the results of these tests presented in Figure 5, the stack response to the cathode stoichiometry step reduction has the nature of variation that corresponds to the integral real element's step response, while the step increase in the stoichiometry caused changes in the voltage range which are similar to the step response of the first order inertial element. The dynamic behavior of the real integral element is described by the ordinary second order differential equation, and the first order inertial element by the first order ordinary differential equation [67]. The model development procedure was previously described in detail in [64,68]. The parameters of the system that was used for model identification are listed in Table 3.   According to the results of these tests presented in Figure 5, the stack response to the cathode stoichiometry step reduction has the nature of variation that corresponds to the integral real element's step response, while the step increase in the stoichiometry caused changes in the voltage range which are similar to the step response of the first order inertial element. The dynamic behavior of the real integral element is described by the ordinary second order differential equation, and the first order inertial element by the first order ordinary differential equation [67]. The model development procedure was previously described in detail in [64,68]. The parameters of the system that was used for model identification are listed in Table 3.
To validate the developed model, verification tests were conducted. For the same changes in the oxygen flow coefficient k O 2 , experimental tests were completed on a real fuel cell system and simulation tests on the basis of the developed model. In the first step, the experiment involved changes in the oxygen flow factor. This test was completed for two different stack load currents. In the second step, simulations were performed using the developed Model (5)  To validate the developed model, verification tests were conducted. For the same changes in the oxygen flow coefficient , experimental tests were completed on a real fuel cell system and simulation tests on the basis of the developed model. In the first step, the experiment involved changes in the oxygen flow factor. This test was completed for two different stack load currents. In the second step, simulations were performed using the developed Model (5)    The developed model allows both the selection of the parameters of regulators used in oxygen flow control as well as conducting simulation tests of the proposed control method.

Control Assumptions
The proposed control is a discrete time control method, applied according to specific time intervals. The control regulates the oxidant flow rate through the stack to minimize oxygen consumption based on the values of the current flowing from the stack and the voltage range, which is treated as an estimator of the correct functioning of the stack. The adopted general control diagram is presented in Figure 8. Quantities important from the point of view of controlling the oxygen flow, implementing the above objectives, are the current drawn from the stack I, the value of which depends on the power demand of the load, and the value of the range voltages in the stack RU. The current intensity directly determines the amount of oxygen consumed by the stack in the electrochemical reaction according to Equation (2), and the voltage range in the stack is treated as an indicator of the non-uniformity of the operating conditions in the stack.
The calculation of the stoichiometric coefficient 2 using a fuzzy PD controller consists of determining its value based on the regulation error and the increase in this error ∆ between successive controls steps calculated on the basis of the relationship where RUz is the voltage range setpoint, is the voltage range regulation error, U(t) is the voltage vector on all cells of the stack, and Z(t) is the disturbances vector. The developed model allows both the selection of the parameters of regulators used in oxygen flow control as well as conducting simulation tests of the proposed control method.

Control Assumptions
The proposed control is a discrete time control method, applied according to specific time intervals. The control regulates the oxidant flow rate through the stack to minimize oxygen consumption based on the values of the current flowing from the stack and the voltage range, which is treated as an estimator of the correct functioning of the stack. The adopted general control diagram is presented in Figure 8. Quantities important from the point of view of controlling the oxygen flow, implementing the above objectives, are the current drawn from the stack I, the value of which depends on the power demand of the load, and the value of the range voltages in the stack R U . The current intensity directly determines the amount of oxygen consumed by the stack in the electrochemical reaction according to Equation (2), and the voltage range in the stack is treated as an indicator of the non-uniformity of the operating conditions in the stack.
The calculation of the stoichiometric coefficient k O 2 using a fuzzy PD controller consists of determining its value based on the regulation error e R U and the increase in this error ∆e R U between successive controls steps calculated on the basis of the relationship where R Uz is the voltage range setpoint, e R U is the voltage range regulation error, U(t) is the voltage vector on all cells of the stack, and Z(t) is the disturbances vector.

Fuzzy Controller
The controller operating according to fuzzy logic is important for controlling the flow of reaction gases in fuel cell systems, mainly due to the possibility of using a simple rule base to control these complex non-linear processes [11,17,[69][70][71][72][73].
In this approach, determining the value of the coefficient is based on the fuzzy set theory, introduced by Zadeh in 1965 as an alternative approach to the classical set theory, in which, apart from the total membership of a given element to a certain set or lack of membership, intermediate states exist [11,71]. In fuzzy controllers, the input and output variables of the system, referred to as linguistic variables, are subject to fuzzification or the process of blurring. Functions are defined to determine the degree of membership of the sharp values of input and output variables to the corresponding values of linguistic variables [69,72]. These functions can take any waveform, and the most commonly used are: triangular, trapezoidal, bell, Gaussian, and sigmoidal [69,72].
A necessary element of the fuzzy inference system is the rule base in the form of "premise → conclusion", where both the premise and conclusion can be any complex logical sentences. The rule base is usually based on expert knowledge.
Two linguistic variables were adopted as input quantities for the fuzzy control algorithm: voltage range error (VRE) and increase in voltage range error (IVRE). The output variable was the oxygen flow coefficient (OFC). These variables were described on the continuous voltage range error ranges , voltage range error increase ∆ , and the oxygen flow coefficient according to the relevant membership functions.
In the next step, to specify the PD control in fuzzy version, the values of individual linguistic variables were determined and assigned a membership function. For the purposes of simulation studies, triangular and trapezoidal functions were used for input variables, with the singletons as the output variable.
The input variables were defined as follows:

Fuzzy Controller
The controller operating according to fuzzy logic is important for controlling the flow of reaction gases in fuel cell systems, mainly due to the possibility of using a simple rule base to control these complex non-linear processes [11,17,[69][70][71][72][73].
In this approach, determining the value of the coefficient k O 2 is based on the fuzzy set theory, introduced by Zadeh in 1965 as an alternative approach to the classical set theory, in which, apart from the total membership of a given element to a certain set or lack of membership, intermediate states exist [11,71]. In fuzzy controllers, the input and output variables of the system, referred to as linguistic variables, are subject to fuzzification or the process of blurring. Functions are defined to determine the degree of membership of the sharp values of input and output variables to the corresponding values of linguistic variables [69,72]. These functions can take any waveform, and the most commonly used are: triangular, trapezoidal, bell, Gaussian, and sigmoidal [69,72].
A necessary element of the fuzzy inference system is the rule base in the form of "premise → conclusion", where both the premise and conclusion can be any complex logical sentences. The rule base is usually based on expert knowledge.
Two linguistic variables were adopted as input quantities for the fuzzy control algorithm: voltage range error (VRE) and increase in voltage range error (IVRE). The output variable was the oxygen flow coefficient (OFC). These variables were described on the continuous voltage range error ranges e R U , voltage range error increase ∆e R U , and the oxygen flow coefficient k O 2 according to the relevant membership functions.
In the next step, to specify the PD control in fuzzy version, the values of individual linguistic variables were determined and assigned a membership function. For the purposes of simulation studies, triangular and trapezoidal functions were used for input variables, with the singletons as the output variable.
The input variables were defined as follows: Voltage range error (VRE): Adopting three linguistic values: negative, close to zero, and positive, described on a continuous set of values of voltage range error in the stack e R U according to the following membership functions: a 12 −R U (n) a 12 −a 11 for a 11 ≤ e R U (n) < a 12 0 for e R U (n) ≥ a 12 (7) Energies 2020, 13, 2372 12 of 26 close to zero : µ e R U (n) = a 14 −a 13 for a 13 ≤ e R U (n) < a 14 a 15 −a 14 for a 14 ≤ e R U (n) < a 15 0 for e R U (n) ≥ a 15 (8) positive : µ e R U (n) = a 17 −a 16 for a 16 ≤ e R U (n) < a 17 1 for e R U (n) ≥ a 17 (9) Increase in voltage range error (IVRE): The difference between the voltage range error in two consecutive control periods, adopting three linguistic values: negative, close to zero, and positive, described on a continuous set of values of increase in voltage range error in stack ∆e R U according to the following membership functions: The output linguistic variable of the fuzzy inference system was oxygen flow coefficient (OFC), which has linguistic values labeled: very small, small, average, big, and very big. All the values of the output linguistic variable were defined by the same membership functions, which are the functions of the singleton with a variable parameter of its position on a continuous set of values of the coefficient k O 2 , determined as follows: where x is a number of linguistic variable OFC values ranging from 1 to 1.5.
To fully define the fuzzy algorithm for determining the oxygen flow coefficient, it was necessary to formulate inference rules defining changes in the oxygen flow coefficient depending on the values of input variables. The adopted set of rules, containing all possible combinations of values of input variables, is presented in Table 4. The Takagi-Sugeno-Kang method, in which singletons are adopted as the functions of the output variables, was used as the inference method in the defuzzification process. For this model of inference, defuzzification is implemented by the weighted average value of the output functions from the fuzzy inference system. The parameters necessary for the proper functioning of the fuzzy algorithm for determining the oxygen flow coefficient describe the membership functions of the individual values of linguistic variables used in Equations (7)- (12). To limit the number of parameters sought, the following assumptions were applied: ψ O 2 (t)dt (15) where t p is the start time and t k is the end time.
This indicator provides information about the ratio of the amount of oxygen fed to the amount consumed by the fuel cell stack. A lower value indicates a higher oxygen utilization in the system.
For the coefficient k O 2 measured with a specified constant sampling frequency f p , the relationship of the integral average (15) can be written as the arithmetic average: where n p is number of samples acquired in the entire control period and can be determined by The second control objective was to manipulate the flow of oxygen to prevent a large variation in voltage on the cells in the stack, which is measured by the voltage range in the stack R U . The control Energies 2020, 13, 2372 14 of 26 of this criterion was assessed based on the value of the integral average voltage range error for the assumed control time according to the relationship e Ru,av = 1 t k − t p t k t p e Ru (t)dt. (18) For this indicator, the total average from Equation (17) can also be reduced to the arithmetic value of the voltage range error in the stack according to The criterion in Equation (19) was introduced due to the need to specify a certain upper threshold for the average voltage range for the entire control period, which should not be exceeded to prevent significant and prolonged increases in the voltage range in the stack. Long-term persistence of this state may cause an accumulation of water in the stack, which disrupts its proper operation and may even lead to stack damage.
Therefore, if the criterion in Equation (19) in a given control is a positive value, then the control is subjected to further assessment due to the average oxygen flow coefficient k O 2 in accordance with Equation (18). Otherwise, it must be rejected as incorrect.

Selection of Fuzzy Controller Parameters
The parameters of the fuzzy control procedure were determined using two methods. The first used arbitrarily adopted values of individual parameters describing membership functions. Only one set of these parameters exists, regardless of the simulation conditions. The values of the adopted parameters are presented in Table 5. Table 5. Parameters of the fuzzy controller chosen arbitrarily. Genetic algorithms (GAs) were used as the alternative method to determine the parameters of the fuzzy regulator. Their operation is based on Darwinian principles of reproduction and survival of the best-fitted individuals [74,75]. The methods of searching for the optimal solution using GAs are based on manipulations of the population of individuals through the use of genetic operators, i.e., selection, reproduction, crossover, and mutation, to obtain better solutions. A chromosome containing a set of features represents an individual in a given population. To use GAs to determine the parameters of the fuzzy regulator, a "chromosome" consisting of single "genes" was adopted, which are the parameters of the fuzzy control procedure. The parameter values were determined for three control periods (i.e., ∆t = 5, 10, 15 s) and two setpoint values of voltage range in the stack (i.e., R Uz = 35 and 38 mV). These two setpoints of voltage range were chosen arbitrary at these values for two reasons. Firstly, they have to be greater than the stable value of the voltage range in the stack operating properly. For the stack adopted for this research and operating with current density equal to 0.5 A/cm 2 , the stable measured value of voltage range is~33 mV. Secondly, the voltage range must be limited to prevent the accumulation of large amounts of condensed water inside the cells, which in turn could make it more difficult to remove it from the stack Then, the given solution was evaluated in accordance with the adopted adaptation function, which is determined by the relationship J = min ϑ (ϑ(k O 2 ,av , e Ru,av )) (20) where ϑ is the adaptation index, depending on the value of the average oxygen flow coefficient k O 2 ,av and the average voltage range error in the stack e Ru,av , determined from the relationship where e Ru,av has two values according to e Ru,av = 10 for e Ru,av < 0 1 for e Ru,av ≥ 0 .
Using this adaptation function enables the elimination of solutions that do not meet the criterion of the average value of voltage range in the stack. The parameters of the GA are shown in Table 6. The parameters of the fuzzy regulator obtained using the GAs are summarized in Table 7.

Simulation Environment
The simulation tests were conducted in the MATLAB/Simulink (MathWorks, Natick, MA, USA) environment using a simulation program developed on the basis of a mathematical model of the voltage range in the fuel cell stack outlined in Section 2.1 and algorithm for determining the oxygen flow coefficients described in Section 2.3.
The simulation model, which is presented in Figure 9, consists of three basic procedures: determining the value of oxygen flow coefficient k O 2 according to the algorithm of fuzzy regulator, determining the parameters of the voltage range model in the stack (K1, K2, T2), and calculating the value range R U .

Simulation Environment
The simulation tests were conducted in the MATLAB/Simulink (MathWorks, Natick, MA, USA) environment using a simulation program developed on the basis of a mathematical model of the voltage range in the fuel cell stack outlined in Section 2.1 and algorithm for determining the oxygen flow coefficients described in Section 2.3.
The simulation model, which is presented in Figure 9, consists of three basic procedures: determining the value of oxygen flow coefficient 2 according to the algorithm of fuzzy regulator, determining the parameters of the voltage range model in the stack (K1, K2, T2), and calculating the value range RU. The oxygen flow coefficient determination step was programmed in accordance with Equations (6)- (13). The block containing the algorithm program determining the value of the oxygen flow coefficient by means of a fuzzy procedure is presented in Figure 10. The oxygen flow coefficient determination step was programmed in accordance with Equations (6)- (13). The block containing the algorithm program determining the value of the oxygen flow coefficient by means of a fuzzy procedure is presented in Figure 10. The step for determining model parameters in real time, during the simulation, calculated model parameters on the basis of the relationship in Equation (5) and data on the current voltage range in the stack RU and actual oxygen flow coefficient. The detailed construction of this step is shown in Figure 11. The step for determining model parameters in real time, during the simulation, calculated model parameters on the basis of the relationship in Equation (5) and data on the current voltage range in the stack R U and actual oxygen flow coefficient. The detailed construction of this step is shown in Figure 11.
The step for calculating the value of the voltage range in the stack determines its current value based on the relationship in Equation (5). Its construction is presented in Figure 12. The step for determining model parameters in real time, during the simulation, calculated model parameters on the basis of the relationship in Equation (5) and data on the current voltage range in the stack RU and actual oxygen flow coefficient. The detailed construction of this step is shown in Figure 11. Step for calculation of model parameters.
The step for calculating the value of the voltage range in the stack determines its current value based on the relationship in Equation (5). Its construction is presented in Figure 12. Step for calculation of model parameters. Step for calculation of voltage range in the fuel cell stack.

Results for Fuzzy Control Procedure of Oxygen Flow with Manually Selected Parameters
The simulation tests were conducted for a simulation time of 400 s. The fuel cell stack, apart from the oxygen flow rate, was assumed to work under steady-state conditions, which were the same as those adopted during the model identification procedure. These parameters are listed in Table 8. Moreover, all simulations were performed with identical initial conditions, i.e., voltage range set to = 33 mV, and oxygen stoichiometry set to = 1.5.  Step for calculation of voltage range in the fuel cell stack.

Results for Fuzzy Control Procedure of Oxygen Flow with Manually Selected Parameters
The simulation tests were conducted for a simulation time of 400 s. The fuel cell stack, apart from the oxygen flow rate, was assumed to work under steady-state conditions, which were the same as those adopted during the model identification procedure. These parameters are listed in Table 8. Moreover, all simulations were performed with identical initial conditions, i.e., voltage range set to R U = 33 mV, and oxygen stoichiometry set to k O 2 = 1.5.      It can be seen in the presented plots that for the given initial values of the voltage range in the stack and oxygen flow coefficient, the controller in the first step abruptly reduced the stoichiometry to a value close to 1. This behavior results from the adopted base of rules used in the fuzzy controller (see Table 4). It should be noted that for the control process the permissible range of was adopted in the range (1.00-1.5). The stoichiometric flow for the assumed stack and the considered operating point (100 A) is approximately equal to 24NLPM. This means that the oxygen flow value has been It can be seen in the presented plots that for the given initial values of the voltage range in the stack and oxygen flow coefficient, the controller in the first step abruptly reduced the stoichiometry to Energies 2020, 13, 2372 20 of 26 a value close to 1. This behavior results from the adopted base of rules used in the fuzzy controller (see Table 4). It should be noted that for the control process the permissible range of k O 2 was adopted in the range (1.00-1.5). The stoichiometric flow for the assumed stack and the considered operating point (100 A) is approximately equal to 24NLPM. This means that the oxygen flow value has been changed from 36 to 24NL/min in this step. In the next steps of the simulation, so large stoichiometry changes no longer occur and are in the range of 1.00-1.35, and the change in the k O 2 value in one control period is not greater than 0.25.
At first glance, the course of changes over time in both the oxygen flow coefficient and the voltage range in the stack may suggest incorrect control or poor quality control, as the control usually aims to minimize regulation error and stabilize the operating point. However, in this case, the primary purpose of the control is to increase oxygen utilization and at the same time ensure proper functioning of the stack, i.e., prevent the accumulation of large amounts of liquid water inside the stack. The carried out simulations have shown that in terms of increasing the oxygen utilization, control in which the cathode stoichiometry is cyclically reduced and increased is more advantageous. Maintaining low stoichiometry for a period of time is beneficial from the point of view of oxygen utilization. For the results gained with the operation of the regulator with arbitrarily chosen parameters, the average stoichiometry of the cathode for the entire considered control period is in the range 1.08-1.13 (see Table 9). For comparison, for the developed model, the minimal stoichiometry of the cathode kept at a constant level, which would not cause an increase in the voltage range in the stack, is k O 2 = 1.183. On the other hand, lowering stoichiometry leads to an increase in the concentration of water in the cathode compartment, and as a result to its condensation. However, the occurrence of periodic increases in oxygen flow can be considered as a cathode purge that transport the accumulated water outside the stack. This can be seen in the results of model tests: the low value of k O 2 leads to an increase in the voltage range, which is treated as an indicator of water accumulation inside the stack. During the increased stoichiometry periods, there is a decrease in voltage range, which in turn can be interpreted as a proof of successful removal of condensed water from the cathode compartment.

Results for Fuzzy Control Procedure of Oxygen Flow with Parameters Determined by Genetic Algorithms
Selected simulation results obtained using the fuzzy procedure with parameters obtained using GAs are presented in Figures 16-18. be interpreted as a proof of successful removal of condensed water from the cathode compartment.

Results for Fuzzy Control Procedure of Oxygen Flow with Parameters Determined by Genetic Algorithms
Selected simulation results obtained using the fuzzy procedure with parameters obtained using GAs are presented in Figures 16-18.       The results of simulation tests, for which the parameters of the fuzzy controller were selected using GA, are similar to those presented earlier. Also, cyclic step changes in cathode stoichiometry can be seen between values close to 1 and values in the range 1.2-1.3. However, as a result of the regulator optimization, even more favorable results were obtained due to the utilization of oxygen. The average cathode stoichiometry over the entire simulated control period is in the range 1.043-1.083 (see Table 9), depending on the setpoint and control period.
The results from the carried out simulations and their analysis allow us to state that for the assumed control purposes, controlling the cathode stoichiometry for both fuzzy controllers, i.e., with arbitrary selected parameters and with parameters determined by GAs, is more advantageous in comparison to the control aiming at stabilization of stoichiometry and voltage range in the stack.
The proposed modification of the cathode subsystem of the PEM FC system and the control method may also have some negative effects. The first one results from the dependence of the control algorithm on the voltage range in the stack, and therefore the need to measure it. This is possible with the use of a cell voltage monitor (CVM). In many applications, due to the security of the system and its lifetime, the CVM is included in the system configuration. However, in the case of systems where it has not been used, addition of the CVM may involve both an increase in the overall costs of such a system and the weight of the entire FC based power system.
Another aspect that may have a negative impact on system reliability is the need for continuous changes in the oxygen flow value. Continuous changes in the actuator (solenoid valve) setpoints may negatively affect its lifetime and, as a result, the reliability of the entire power supply system. These aspects are outside the scope of this paper, but will be considered during subsequent studies aimed at the experimental verification of the developed control method.

Conclusions
The simulation tests were used to examine the control of the flow of oxygen through the cathode compartment of a PEM type fuel cell stack in the absence of access to atmospheric air. In such circumstances, supplying this reagent from the storage device is necessary; therefore, this reagent must be managed so that its utilization is as high as possible. A typical solution to this problem is the construction of an oxidant subsystem with an oxygen recirculation system. I analyzed the issue of oxygen flow control in an open cathode system and without oxygen recirculation. A method of controlling oxygen flow was developed using fuzzy set theory and simulation tests were conducted to verify the correctness of its functioning.
The simulation tests of the developed control method, both those with manually selected parameters and those determined with use of a GAs, confirmed its ability to prevent excessive increase in the voltage range in the stack. This procedure also resulted in reduced oxygen consumption compared to the control with a constant oxygen flow factor. For simulation test results, in the case of a regulator with arbitrarily selected parameters, the average oxygen flow coefficient for the entire simulated time did not exceed k O 2 = 1.13, which means that 13% of the oxygen fed to the fuel cell stack had not reacted, and for the highest rated control (i.e., for ∆t = 10 s and R U,z = 38 mV), oxygen consumption was 8% higher than the stoichiometric value.
Control with parameters determined using the GAs, just like the procedure with parameters selected manually, correctly prevented excessive increase in the voltage range in the stack. The use of GAs to determine the parameters of the procedure significantly contributed to the reduction in the average oxygen flow coefficient for the entire simulated control time. In the best case, i.e., for ∆t = 5 s and R Uz = 38 mV, only 4.3% more oxygen was fed into the fuel cell stack than the stoichiometric value. In the worst control case, the average oxygen flow rate did not exceed k O 2 = 1.09. The simulation tests of the proposed procedure for determining the oxygen flow coefficient k O 2 (Table 9) indicated that for properly selected parameters, the control objectives are implemented correctly.
Both the results in the literature and my own experimental research show that for proportional current control and with constant cathode stoichiometry, the minimum value of k O 2 that guarantees proper operation of the stack when supplied with pure oxygen is 1.2. The analysis of the results presented in Table 9 shows that for the considered procedure, the average value of this coefficient for all cases is lower, and thus oxygen utilization is higher. Simulation studies indicated that the procedure with parameters selected by the GA and for simulation parameters of ∆t = 5 s and R Uz = 38 mV was the most effective. For this control process, the amount of oxygen fed to the fuel cell stack is 4.3% greater than the amount consumed in the chemical reaction.
Future research plans include the experimental verification of the developed control method. In addition, I plan to verify the proper functioning of the control algorithm in dynamic fuel cell states, i.e., with changes in stack current as well as for stack operating parameters differing from the nominal values.