AI-based proton exchange membrane fuel cell inlet relative humidity control

Humidity is a key factor affecting proton exchange membrane fuel cell (PEMFC) efficiency and output performance. Different working conditions have different requirements for humidity. Too high or too low water content inside the PEMFC will damage the output performance and even affect the PEMFC life. Therefore, how to control humidity appropriately is a crucial subject. This paper establishes a PEMFC internal water management and inlet humidity model, and analyzes the influence of the anode inlet humidity change on the performance of the PEMFC and the water content of the membrane through computational fluid dynamics (CFD) simulation. The direct control of the inlet humidity, which is difficult to be accurately measured, is converted to the temperature control of the bubble humidifier according to the proposed model, and a back propagation neural network proportion integration differentiation (BPPID) controller is proposed, which combines artificial neural network and digital PID control to adjust PID parameters in real time. The controller is applied to the temperature control of the bubble humidifier and compared with the traditional PID controller and the fuzzy PID controller. It is found that the performance of the BPPID controller is better through the comparison with the experimental results.


I. INTRODUCTION
Proton exchange membrane fuel cell (PEMFC) is the most promising fuel cell technology for its low operating temperature, low noise, fast start-up ability, light weight and high power density [1]. However, PEMFC often have problems such as poor performance and short service life due to the complexity of PEMFC system and the sensitivity to factors such as temperature, humidity and pressure, etc [2]. Among these factors, humidity is considered a crucial one, Humidity has a direct impact on the water and heat management of PEMFC. Excessive humidity may cause flooding. However, insufficient humidity may lead to water shortage in the fuel cell, drying the membrane and damaging the mechanical structure of the membrane. The performance of PEMFC without humidifying reaction gas is 20%-40% lower than that of using humidified reaction gas [3]. Both of these conditions will seriously damage the performance of PEMFC and shorten its service life [4].
In order to improve the performance and prolong the service life of PEMFC, many experts and scholars have carried out a lot of valuable research on the humidity mechanism model, humidification mode and control method. Nguyen et al. [5] proposed a water and heat management model from the perspective of establishing fuel cell humidification mechanism for evaluating the effectiveness of various humidification designs and the effects of various design and operating parameters on the performance of PEMFC. Their model showed that in order to keep the membrane hydrated to reduce ohmic loss, the anode flow must be humidified and the cathode flow must also be humidified when air rather than pure oxygen is employed. Zhang et al. [7] conducted numerical simulation research on PEMFC to explore the influence of cathode inlet humidity on the dynamic performance. Their results show that increasing cathode inlet humidity can improve the starting performance of the PEMFC. Yan et al. [8] further conducted experimental research on a PEMFC stack. They proved that under high current density conditions, the water transported from the anode to the cathode through electro-osmosis drag is greater than the water that diffuses from the cathode to the anode through back diffusion, which will lead to membrane dehydration. Therefore, humidifying the anode gas helps to counteract this effect, but they did not observe that the PEMFC performance will be better with the increase of anode inlet humidity. Since humidity plays a key role in PEMFC, various humidification methods have been proposed in order to better manage the system humidity and make it more compatible with the mechanism model. Those methods can be classified into external and internal humidification. Ahmaditaba et al. [9] concluded that internal humidification includes steam water injection, Stack-Integrated humidifiers, membrane additive and porous absorbent sponge while external humidification includes enthalpy wheel exchanger, membrane humidification and bubble humidification. They designed and tested a bubble humidifier which humidified the air entering the cathode side of the PEMFC to investigate the effects of parameters including water temperature, humidification tank water level and inlet flow on exhaust water content and dew point temperature. The results manifested that under the condition of constant water temperature, the outlet relative humidity increases with the increase of water level, but once the water level exceeds a certain value, it will no longer possess any obvious impact on the outlet relative humidity. Tangirala et al. [10] modified the traditional bubbling humidifier into a continuous humidifier to control the RH of H2 at constant value (94-95%) by using cooling water recirculation. This design recycles the thermal energy of the fuel cell and thus improves the efficiency of the whole system but the humidity regulation range of this method is relatively small. Membrane humidifier is another external humidification scheme, which makes full use of the water and heat in the exhaust without additional power consumption of the stack. It has been increasingly used in the air humidification system of PEMFC. However, in practical application, due to the diversity of working conditions, it is difficult for membrane humidifier to fully humidify the inlet air. Ramya et al. [11] developed a porous membrane-based gas humidification sub-system for cathode gas humidification. Their results demonstrated that the performance of a single cell using porous membrane humidifier is equivalent to that of bubble humidifier under the condition of low current density, and circulation of cooling water from the stack would give the best results for humidification for cathode gas. Zhang et al. [12] employed capillary tubes to humidify the anode with excess water from the cathode. This internal humidification design is simple in structure and fast in response. However, if the cathode exhaust gas flow rate is too high or too low, it will adversely affect the performance of the PEMFC.
Humidity has a great influence on fuel cells, and many humidification methods have been developed. However, since PEMFC is a closed structure with time-varying, nonlinear and strong coupling characteristics, humidity is still a variable that is difficult to a control precisely. KE et al. [6] considered the coupling relationship between humidity and temperature in PEMFC and proposed a dynamic fuzzy optimal composite control method taking temperature and humidity environment as an overall condition. And humidity is controlled by changing the air speed of the oxygen reaction channel. Their experimental results revealed that adjusting the internal temperature has an obvious effect on humidity regulation. Sun et al. [13] regarded humidity deviation as an interference, and developed a robust load regulator considering parameter uncertainty to solve the oxygen starvation problem of PMEFC. Riasscos [14] regulated the air flow by adjusting the air stoichiometry to maintain the relative humidity within the recommended value, so as to indirectly control the relative humidity of PEMFC without additional humidifier. There are also scores of studies directly aimed at the inlet air humidity control of cathode and anode of PEMFC. Kim et al. [15] designed a multiple input multiple output (MIMO) fuzzy controller taking the water content of membrane as the control variable, and applied it to an open cathode PEMFC system. Damour et al. [16] proposed a model that combined the PEMFC water management model and the differential flatness theory and used air mass flow as a manipulated variable to adjust the membrane humidity. Simulation results showed that its performance was satisfying, but there is still a lack of experimental verification.
Chen et al. [17] introduced Active Disturbance Rejection Control (ADRC) strategy into PEMFC cathode humidity control. The experimental results showed that, comparing the output voltage under different controllers, the control performance of their proposed controller was better than that of the traditional PID and fuzzy PID controllers.
Some scholars have also combined artificial intelligence (AI) algorithm with PEMFC humidity control to realize intelligent control means such as neural network control (NNC). With the great leap in the computing power of modern computers, these intelligent control methods are simpler and cheaper to implement, and without needing accurate system mathematical model like some other controllers, but they can still behave satisfactory performance, and thus they are quiet suitable for complex, nonlinear, dynamic uncertain systems. Nanadegani et al. [18] employed the neural network to simulate a PEMFC system, and by analyzing the optimal operating conditions, they concluded that it was more sensitive to the change of relative humidity VOLUME XX, 2017 9 under the condition of high current density than that under low current density condition. Zhang et al. [19] established the PEMFC water management system model, and based on this model, proposed a recurrent neural network (RNN) based model predictive control (MPC) controller to control the cathode water concentration and reduce the fluctuation of cathode humidity. They realized the control process in the simulation environment. The results showed that their RNN-based MPC controller had shorter response time than PID controller and can avoid the fluctuation of cathode water concentration. Mostafa et al. [20] proposed a RNN controller based on nonlinear autoregressive moving average model approximation.
The controller controlled the mole fraction of anode and cathode water to fix the system voltage and maintain the water content of the PEMFC within the control range. Nevertheless, the controller invented has not been verified by experiments neither. In this paper, the water management model and inlet humidity model of proton exchange membrane fuel cell are established to indirectly control the internal humidity of PEMFC through inlet humidity. And the influence of different anode inlet humidity on PEMFC is investigated via computational fluid dynamics (CFD) simulation to illustrate the significance of controlling inlet humidity on PEMFC. This paper then introduces an external humidifier, bubble humidifier, which is widely used in PEMFC. And combined with the established mathematical model, the internal humidity control of PEMFC can be converted into the inlet humidity control of humidifier, and then into the temperature control of bubbling humidifier. And in order to adjust the temperature of the humidifier quickly and accurately to coordinate with the PEMFC. An intelligent controller based on artificial neural network, a back propagation neural network proportion integration differentiation (BPPID) controller, is proposed, and applied to the temperature control of the bubble humidifier and compared with the traditional PID controller and the fuzzy PID controller.
The structure of this paper is as follows: Section 2, a PEMFC water management model and an inlet humidity model are proposed. And at the end of this section, the effects of different anode inlet humidity on PEMFC are simulated and analyzed; Section 3, Introduce the bubble humidifier and design the BPPID controller; Section 4, The results of different control algorithms are discussed; Section 5, Conclusion.

II. Modeling and simulation A. PEMFC water management model
As shown in Figure 1, a PEMFC consists of a bipolar plate and a membrane electrode assembly (MEA). The membrane electrode comprises an anode electrode, a proton exchange membrane and a cathode electrode. The anode and cathode electrodes include gas diffusion layer (GDL), micro-porous layer (MPL) and catalytic layer (CL) [21].

FIGURE 1. PEMFC structure
The proton conductivity of membrane in PEMFC is closely related to its water content. Recently, all-fltmsulphonie acid membrane is most commonly used as proton exchange membrane，which perform high proton conductivity only when it is fully hydrated. Maintaining high proton conductivity is of great significance to keep the high output performance of PEMFC. Although with the development and renewal of PEMFC, the working current density gradually increases, resulting in the corresponding increase in the rate of electrochemical reaction to produce water. However, the amount of water inside the cell does not mean that the membrane is fully hydrated. In effect, only the water combined with the membrane is conducive to the improvement of proton conductivity, while other excess water will block the voids of the MPL and cause flooding, resulting in the decline of system performance.
In order to simplify the model and make the model more conducive to analyze the influence of inlet humidity on the system, some assumptions are put forward: (i) the PEMFC operates at a constant temperature, the reaction gases are ideal gases; (ii) the pressure distribution of anode and cathode is uniform and equal; (iii) the water content and water flux on the membrane are uniform; (iv) The water in the PEMFC exists only in the form of gas.
Water transport in proton exchange membrane is mainly affected by three mechanisms: electro-osmosis drag, back diffusion and pressure gradient.
Electro-osmosis drag means that in the process of proton transport from anode to cathode, protons will drag a certain number of water molecules to move together, which leads to the transmembrane transport of water. The water transmembrane transport flux due to electro-osmosis drag is given by equation (1)   Back diffusion refers to the diffusion driven by the water concentration gradient in the electrolyte. Since water is generated at the cathode through PEMFC electrochemical reaction, the concentration of water at the cathode is always higher than that at the anode, so the overall direction of back diffusion is always from cathode to anode. The water flux due to back diffusion is given by equation (6).  (8) Where mem  is the dry membrane density, mem EW represents the membrane equivalent weight.
Water transported due to pressure gradient is described by equation (9) [25]. The permeability of the membrane is very small. When the inlet pressures of the anode and cathode are the same, the water transport across the membrane caused by the pressure difference between both sides of the membrane is generally much less than the two mechanisms mentioned above. Combining equations (1) to (9) and assuming that the pressure difference between anode and cathode is 0, and based on the law of mass conservation, the governing equations of water in the membrane and water on both sides of anode and cathode are obtained in equations (10) to (12)

B. PEMFC inlet humidity model
Because the inlet humidity of PEMFC is difficult to measure and control, we propose an inlet humidity model to convert the inlet humidity control into the temperature control of bubble humidifier. Some assumptions are reported in order to realize this conversion: (i) The gas entering the humidifier has undergone sufficient heat exchange with the bubbling humidifier, that is, the gas exiting the humidifier has the same temperature as the humidifier. (ii) the gas is fully humidified after passing through the humidifier and has been saturated. (iii) the gas reaching the inlet will not carry droplets into the PEMFC. (iv) The gas and liquid temperature inside the humidifier are the same. The Since the fuel cell works at a constant temperature, first calculate the saturated vapor pressure at this temperature, then the required inlet vapor pressure can be calculated from the relative humidity, and then the corresponding saturation temperature can be calculated by Equation (20).
Further, the inlet concentration of each component of the anode and cathode can be obtained:   Combined with the relative molecular mass, the inlet mass fraction of each component can also be obtained: 22 (18) and (19). And so far, a water management and an inlet humidity model has been established.

C. Simulation
As the anode is more prone to water shortage during the operation of PEMFC, especially under high current density, resulting in membrane drying, this simulation focuses on the change of anode relative humidity, and fixes the cathode inlet humidity at 100%.
In this part, a 50cm×50cm single fuel cell model is established. The fixed cell temperature is 343K, and the gas flow channels of anode and cathode adopts counter flow design, which is shown in Figure 2. And The model is studied by CFD with ANSYS Fluent.

FIGURE 2. The PEMFC flow field structure
The influence of four levels of anode inlet relative humidity (40%; 60%; 80%; 100%) on PEMFC current density and membrane water content is shown in Figure  3 and Figure 4, respectively. VOLUME XX, 2017 9

FIGURE 4. Membrane water content distribution under different anode inlet relative humidity: (a) 40%, (b) 60%, (c) 80%, (d) 100%
As shown in Figure 3, with the increase of anode humidity, the current density magnitude of the PEMFC also increases. This is mainly because when the anode inlet humidity is low, the membrane water content in the anode inlet area is very low, resulting in high ohmic polarization, thus the current density in this area is relatively low. When the anode inlet humidity increases, the number of water molecules carried by the sulfonic acid group in the proton exchange membrane increases, which speeds up the proton transfer rate. It can be seen that when the humidity at the anode and cathode inlets are both 100%, the area with high current density is transferred to the area close to the hydrogen outlet and air inlet, and the magnitude gradually decreases from the cathode inlet to the outlet. This is mainly due to the gradual decrease in the concentration caused by the oxygen consumption, leading to the cell current density decrease gradually from cathode inlet to outlet. It can also be observed that the current density distribution inside the PEMFC will be different under different inlet humidity conditions. Therefore, this simulation states that the current density magnitude and distribution inside the PEMFC can be controlled by controlling the inlet humidity. Figure 4 manifests that as the relative humidity of the anode increases, the water content of the membrane will increase accordingly. Combined with Figure 3 and Figure 4, it is illustrated that the water content of the membrane is inseparable from the internal current density of the PEMFC. However, as mentioned before, it is not always reasonable to maintain the maximum inlet relative humidity for PEMFC operation. Therefore, it is necessary to flexibly adjust the inlet gas humidity in combination with actual working conditions to prevent cathodic flooding due to excessive water and prevent membrane drying due to insufficient internal water.

A. Bubble humidifier
In this paper, the PEMFC inlet humidity control is converted to the temperature control of the bubble humidifier. The schematic diagram and appearance of the bubble humidifier used in this experiment are shown in Fig. 5 and Fig. 6 respectively. VOLUME XX, 2017 9 The humidifier tank is made of stainless steel and wrapped with a layer of thermal insulation material. Four 100W resistance wires are equipped at the tank bottom as a heater to provide heat. A thermocouple is inserted into the tank to monitor the liquid temperature in real time. And in order to eliminate the influence of liquid level on tank heating, deionized water of 80% of the total volume of the tank is always maintained in the tank, which is realized by installing a transparent tube liquid level gauge next to the tank as a liquid level indication device and when the liquid level is lower than or higher than the set value, the valve will be automatically opened for drainage or water injection.
The whole humidifier temperature control is a time-delay system. The heat transfer process can be regarded as a complex cylindrical wall composite heat transfer, including heat conduction, convective heat transfer and radiation heat transfer. The composite heat transfer coefficient of this heat transfer process is difficult to measure, so it is hard to predict the temperature of the humidifier accurately. Therefore, this section studies the temperature control of the humidifier.

B. BP neural network PID controller
In computer control, the digital incremental PID controller is widely used [27], and its control law is shown in equation (27). Where, In order to achieve better control effect, PID controller must adjust the size of three parameters: proportional p k , integral i k , and differential d k , so as to adjust the relationship between different control effects on the control quantity. This relationship is a complex non-linear combination, and it is necessary to find the best one in order to achieve a satisfying control performance. In some relatively simple systems, PID parameter values can refer to some past experience, and satisfying control effects can often be achieved. However, in some relatively complex systems, such as systems with coupling, nonlinearity, and time delay, other advanced algorithms need to be used to intelligently adjust PID parameters. BP neural network is one of the important algorithms in the field of artificial intelligence，which owns the ability to approach any nonlinear function. The classic BP neural network structure is shown in Figure 7, which consists of an input layer, an output layer and at least one hidden layer [28]. Its network is fully connected, and there are two kinds of signal propagation: input signal and error signal. The input signal propagates from the input layer to the output layer, that is, forward propagation, and the error signal propagates back to the input layer from the output layer along the original connection, that is, back propagation. VOLUME XX, 2017 9

FIGURE 7. BP neural network structure
BP neural network algorithm also has some problems, such as slow convergence speed and easy to fall into local optimal solution. Therefore, BP network and PID control are combined to realize the best combination of PID control through online learning of system performance to adjust PID parameters p k , i k , and d k in time. In this paper, a self-learning three-layer BP neural network PID (BPPID) controller is employed, and its structure is displayed in Figure 8. The controller consists of two parts: (i) classic PID controller, which directly performs closed-loop control on the plant, and the three parameters (ii) BP neural network. The output state of the neurons in the output layer corresponds to the three parameters of the PID controller. Through the self-learning and weights adjustment of the neural network, the output of the neural network corresponds to a certain optimal control law.  (29) Where M is the number of input variables, which depends on the complexity of the control system. In this paper, we select the sampling temperature of bubble humidifier () yk , set temperature () d yk, error e( ) k , and a bias value of 1 as the input of the input layer, which means M = 4. And the right superscript 0, 1 and 2 of variables represent input layer, hidden layer and output layer respectively.
(2) The inputs and outputs of the hidden layer are: In this paper, the output of the output layer is the three parameters of the PID controller, According to equations (29) to (33), the neural network structure adopted by the BPPID controller is shown in Figure 9. VOLUME XX, 2017 9

D. Network training algorithm
The loss function is defined as follows: Where e( ) k is the error of the control system. e( ) ( ) The gradient descent method is used to iteratively modify the weight matrix of the network, and a momentum factor is added to make the search quickly converge to the global minimum: Where  is the learning rate and  is the momentum factor. Both of them can be adjusted to compensate for the influence of inaccurate calculations that may occur during the calculation process [29]. In this paper, if two adjacent sampling errors are close, the learning rate will be multiplied by a value slightly greater than 1 to increase. If the two sampling errors are far apart, the learning rate will be multiplied by a value slightly less than 1 to decrease.
Ok k In the same way, the weight learning algorithm of hidden layer neurons can be obtained: The controller control algorithm can be summarized as follows: (1) Determine the structure of the BP network, and set the weights of each layer, and then select the learning rate and the momentum factor, at this time k=1.
(2) Get (4) Calculate the output of the BPPID controller by equations (27) and (28), and then the network weights are adjusted through equations (41) and (42) to realize the self-learning of the neural network.
(5) Set k = k +1 and return to step (2) until the system is stable.

IV Results and discussion
In order to verify the effectiveness of BPPID controller for this humidifier, traditional PID controller and fuzzy VOLUME XX, 2017 9 PID controller are also employed by way of comparison.
And it is ensured that the humidifier conducts sufficient heat exchange with the surrounding environment at the start of each experiment, that is to say, the starting temperature of humidifier is equal to ambient temperature. The operating temperature of the PEMFC usually stays between 65 ℃ to 85 ℃ [1]. In this paper, we assume that the operating temperature of PEMFC keeps constant at 70 ℃. And for the purpose of imitating the situation that PEMFC needs to increase humidification during operation, the humidification tank is heated from ambient temperature to 50 ℃ in each experiment, and then heated to 70 ℃ after it is stable, which are called phase 1 and the phase 2 respectively. And according to the mathematical model proposed in Section 2, the relative humidity of the inlet is 39.5% in the first place and then will change to 100%. Furthermore, the performance of each control algorithm is compared according to data visualization. In this control system, As shown in Figure 10, an intelligent instrument is used as temperature collector and the carrier of PID control algorithm, and a silicon controlled rectifier is used to adjust the heating power of resistance wire. And the digital signal transmission and control algorithm compilation is based on LabVIEW and Python. LabVIEW serves as data communication supporter, and Python is applied to calculate control parameters according to the read data. Figure 11 shows the comparison of the temperature control of the bubble humidifier under different control algorithms measured through experiments. It can be seen that the temperature of the bubble humidifier is the easiest to achieve stability under the BPPID controller, and the time spent is the shortest. It took 343 steps to stabilize the first time, and 303 steps to stabilize the second time. However, the time for the fuzzy PID controller takes to reach stability is 559 steps and 705 steps respectively. And the time for the traditional PID controller takes to stabilize is 714 steps and 407 steps respectively. Figure 12 displays a comparison of the absolute errors of different control algorithms in the two phases. Combining Figure 11 and Figure 12, It can be seen that the overshoot generated by the fuzzy PID controller is the smallest, only 1 ℃ while the overshoot generated by the traditional PID controller is the largest, reaching 4.4 ℃. The overshoot raised by BPPID controller is between the two, 1.4 ℃. It can also be found from the figure that the fuzzy PID is the most stable of the three controllers, while the fluctuations generated by the traditional PID controller are the largest. Although the overshoot of the BPPID controller is not the smallest, it is only 0.4 ℃ away from the minimum. Therefore, considering the difference in control time, the proposed BPPID controller is most suitable for this bubble humidifier.

FIGURE10. Control system framework
The change of PID parameter output by BP neural network during the control process is exhibited in Figure  13. It can be observed that when the deviation from the target value is too large, the values of the PID parameters p k , i k , and d k are also large, and as they gradually approach the target value, the values of these parameters gradually decrease and eventually stabilize. VOLUME XX, 2017 9 This paper presents a PEMFC water management model and an inlet humidity model, and conducts simulation and analysis of the influence of different anode inlet humidity on PEMFC performance. It is observed that as the inlet humidity increases, the water content of the proton exchange membrane also increases, and the PEMFC current density also increases accordingly. An experimental study on the control of inlet humidity is also investigated in this paper, converting direct control of the inlet humidity, which is difficult to measure accurately, into temperature control of the bubble humidifier. And a controller combined with artificial intelligence, that is, BPPID is proposed. this controller is employed to the bubble humidifier temperature control and compared with traditional PID controller and Fuzzy-PID controller. It is found that the performance of the BPPID controller is better by comparing the experimental results. The authors will combine the proposed control algorithm with PEMFC in the actual operation in the future and explore the application possibilities of more intelligent control methods in PEMFC.