Application study of the power control system for air-cooled proton exchange membrane fuel cell based on fuzzy adaptive with heuristic adaptive period strategy

As a zero-emission, non-polluting power generation device, hydrogen fuel cells are of great interest to the global industry with the advantages of high-power generation efficiency, wide source, and wide application scenarios. Influenced by various factors, it leads to a complex fuel cell control system and unstable output characteristics, which is one of the difficulties in the current technology development. In this section, an embedded power control system according to an STM32 microcontroller is developed to improve the steady-state characteristics of cathode open air-cooled fuel cell (PEMFC), and a fuzzy adaptive PID control algorithm according to the heuristic adaptive strategy of time interval is proposed. The control system achieves real-time detection of operating status. It maintains the stable output of cathode open air-cooled PEMFC by predicting vehicle speed in real-time to precisely control the hydrogen supply and external additional fans to control the operating temperature by the control strategy.


INTRODUCTION
Energy is the lifeblood that drives social progress and is one of the most important development resources for countries in the 21st century [1][2][3][4][5][6].With the development of the economy, the demand for fossil energy has increased, and the over-exploitation of fossil energy has caused a series of environmental problems [2][3][4][5][6][7], such as global warming, the formation of acid rain, and the sinking of the ground surface.The overexploitation of petroleum resources causes the greenhouse effect by increasing the carbon dioxide content in the air, and acid rain by increasing the sulfur in the air, which causes irreversible damage to agricultural land, plants, and animals.Fossil energy evolved from the remains left behind by ancient organisms and is a primary energy source.The generation of fossil resources requires hundreds and thousands of years of evolution in the ground.Fossil fuels generate harmful gases such as carbon monoxide, sulfur dioxide, and nitrogen oxides under inadequate combustion conditions.
With the rapid development of global technology, fossil energy consumption is also increasing at an alarming rate, and the gap between energy supply and demand will increase.Fossil energy sources include coal, oil, and natural gas.In recent years, oil prices have fluctuated, the overall price is rising, and the crisis is coming.China's energy demand will be restrained, national energy security will be threatened, and renewable energy and new energy demand replacement will be imminent.
The hydrogen fuel cell does not require much working environment, and it can work both outdoors and indoors; the products generated by the reaction are non-polluting, and it is known from its basic working principle that the only product generated under ideal circumstances is water, which is a nonpolluting substance, that is, the reaction occurs in a cycle is non-polluting; the fuel cell has a high efficiency of power generation.The source of hydrogen is also relatively wide, such as the electrolysis of water to produce hydrogen, fossil fuel to produce hydrogen, and other ways.Hydrogen fuel cells have great potential for development in hydrogen fuel cell vehicles, navigation and spaceflight, new energy robots, and emergency portable power.
Hydrogen fuel cells also have some disadvantages, such as susceptibility to the external environment and changes in operating conditions, unstable voltage output, large hysteresis, and fuel safety problems, which seriously hinder the promotion of the commercial application of fuel cells [3,8].With the continuous progress and development of global technology, the technical difficulties of hydrogen fuel cells will be overcome, the application of hydrogen fuel cells will become more and more widespread, and the production cost will be reduced.As a new energy source, hydrogen fuel cells will greatly contribute to the world's environmental protection and energy utilization.
According to the different cooling methods, the proton exchange membrane fuel cell stacks can be divided into air-cooled and circulating water-cooled [4].The air-cooled fuel cell belongs to the two types of air-cooled types, which have high efficiency, compact structure, and low own energy consumption.Its working principle is similar to the basic power generation principle of conventional hydrogen fuel cells, but there are major differences in its basic structure.The basic working principle is the inverse reaction of water electrolysis, where oxygen comes from the air, and the proton exchange membrane Fuel Cell (PEMFC) can keep reacting when hydrogen is continuously fed from outside.The electrons produced by the cathode flow through an external circuit with a load, forming a circuit.The electrical energy in this circuit is provided by the air-cooled fuel cell.The air-cooled PEMFC stack structure consists of a cell assembly, a fan assembly, and a scrambler assembly.The cathode is in direct contact with the air and the fan assembly is used for heat exchange between the air and the cell assembly.The scrambler assembly is placed between the battery assembly and the fan assembly.The scrambler assembly is used to disturb the airflow blowing to the battery assembly from the fan assembly so that the airflow to each area of the battery assembly is uniform, to extract excess heat from the air-cooled PEMFC, to avoid the phenomenon of local overheating, and to achieve the purpose of air cooling.The assembly contains the basic PEMFC anode, cathode, and other components.
Its performance is affected by hydrogen supply, working temperature and humidity, and oxygen content in the air.Its output characteristics are unstable, and the steady-state characteristics are poor.When the load is relatively large, the required current is higher, and the air-cooled PEMFC works with a large voltage drop, causing the output power instability phenomenon.The energy conversion efficiency of PEMFC reactors is usually between 50% and 60%, which means that the reactor generates a large amount of heat during operation, and to maintain a stable operating temperature of the reactor, the waste heat must be discharged [5,9,10], so an external additional cooling fan.Because of the many factors affecting its output characteristics, the inability to establish an accurate mathematical model for accurate calculations is one of the difficulties of the current study.The air-cooled PEMFC cathode is in direct contact with air and has fewer controllable variable factors, so it can only rely on controlling the hydrogen concentration of the participating reaction and the external attached small fan to control the hydrogen supply and operating temperature and then control the output power of the air-cooled PEMFC to achieve the requirement of stable power output.The control system reduces the working temperature by controlling the hydrogen concentration and the small fan in real-time to make it work in the best condition under different environments to improve the unstable output power of the air-cooled PEMFC.And it can reduce fuel consumption, increase the service life of air-cooled PEMFC and improve fuel utilization.In this paper, an embedded power control system according to an STM32 microcontroller is developed to improve the steady-state characteristics of air-cooled fuel cells (PEMFC), and a fuzzy adaptive PID control algorithm according to a heuristic adaptive time interval strategy is proposed.The control system predicts the vehicle speed in real-time by machine learning model.Then the speed corresponds to the output power required by the fuel cell, controls the hydrogen supply and the external additional fan to control the operating temperature in real-time according to the output power, and realizes real-time detection of the operating status and keeps the output of the air-cooled PEMFC stable according to the control strategy.

System composition
The air-cooled PEMFC control system consists of the hydrogen storage tank, control system, air-cooled PEMFC (electric stack), fan, lithium battery, and load.As shown in Figure 1, the hydrogen storage tank's role is to supply hydrogen to the air-cooled PEMFC, and the hydrogen flows into the air-cooled PEMFC through the hydrogen valve to participate in the chemical reaction.The air-cooled PEMFC is not responsible for controlling the hydrogen valve opening control but only passively receives hydrogen for the reaction.The fan is attached to the side of the air-cooled PEMFC and is controlled by the control system.Its role is to adjust the temperature and humidity of the reactor during operation to ensure that it is operating at a more suitable temperature and humidity, which in turn affects the chemical reaction activity that occurs during the operation of the reactor.Another role of the fan is to provide enough oxygen for the reaction to occur and to avoid insufficient oxygen when the reaction occurs.The lithium battery in the control system is a backup energy.The role of one is to avoid the PEMFC cannot work properly equipment all power off.The role of the two is that the load needs more power and cannot be provided properly.The lithium battery is involved in the load power supply.The control system collects data and controls the air-cooled PEMFC accordingly.The data collected in real-time include working temperature and humidity, voltage, current, speed, etc.The signal is processed by analog-to-digital conversion and, combined with the energy output required after speed prediction, the opening degree of the hydrogen valve is controlled to provide hydrogen for the air-cooled PEMFC cathode reaction.The hydrogen valve is flexibly controlled under different working conditions.Under different operating conditions, the opening of the hydrogen valve can be flexibly controlled to provide the right amount of hydrogen for the air-cooled PEMFC to participate in the reaction, and the fan speed can be controlled to ensure that the air-cooled PEMFC works at a suitable temperature and humidity.The regulation of the hydrogen valve and fan controls the temperature and humidity when the reaction occurs.It indirectly controls the output state of the air-cooled PEMFC to ensure the best working condition and the most stable output power.

Main functions 1) Data Acquisition
The control system detects the working status of air-cooled PEMFC online in real time.It collects data including PEMFC and lithium battery voltage and current, air and working environment temperature and humidity, hydrogen pressure detection, PEMFC and lithium battery working status, and vehicle speed. 2

) Display Module
To facilitate the observation of the data collected by the control system, this section uses a 0.96-inch OLED display with a 128×64 resolution, 6-pin, four-wire SPI interface.It can display 8 lines of data with 16 parameters and is sufficient to meet the needs of the control system and small size. 3

) Energy Management
The load may be different, considering that the air-cooled PEMFC is applied to various external environments and faces various unexpected situations.A lithium battery is attached as a backup energy source to prevent the load from being underpowered during operation to participate in the power supply.When the load of air-cooled PEMFC requires higher power, the lithium battery is involved in the power supply at the same time.The working mode of air-cooled PEMFC and Li-ion batteries is determined by estimating the power and speed predicted demand power collected by the control system.

4) Emergency Handling
When the air-cooled PEMFC encounters an unexpected situation (such as insufficient hydrogen, unable to replenish hydrogen in time, sudden changes in the environment, etc.), the reaction cannot normally occur to avoid a sudden loss of power to the load.The lithium battery is involved in supplying power at this time.

5) Wireless communication and data storage
Through the wireless transmission module and PC interaction, the working status of the control system can be monitored through the PC terminal.While the collected data can be stored in the SD card through the control system, the working status of the system can be observed remotely.The operation of the control system can be shut down if abnormal conditions are found, and the program operation can be cycled if there is no abnormality.The PC terminal can observe and detect the working status of the control system through wireless communication and control the whole embedded control system program state.

Software design of air-cooled PEMFC control system 1) Software Design
According to the PEMFC characteristics, to maximize the output power at a certain current, the maximum voltage of stack at that current can be achieved.According to the electric potential of the PEMFC (energy-strength thermodynamic electric potential, activation loss electric potential, ohmic polarization loss electric potential, and concentration difference polarization loss electric potential), it is known that the PEMFC output voltage and the output current related, which is related to operating temperature, air pressure and hydrogen pressure of the PEMFC at the same time [6].The air-cooled fuel cell cathode is in direct contact with air, and the oxygen content in the air can be approximated to a fixed value.The hydrogen supply to the cathode open air-cooled fuel cell uses a constant pressure hydrogen supply method, and the partial pressure of hydrogen varies in a constant pressure state with essentially constant magnitude.Therefore, the PEMFC output voltage is only affected by the operating temperature and output current, i.e., at a certain moment, there must be a corresponding operating temperature, which makes the output voltage reach the maximum value.The framework of software design is shown in Figure 2. The air-cooled PEMFC control system collects current data in real time through the current sensor.The program of temperature control estimates the most suitable operating temperature of the PEMFC under the current parameters.Then the external additional fan works to make the PEMFC operating temperature reach the estimated temperature, that is, to achieve the maximum PEMFC output voltage and maximum output power.According to the parameters of real-time to determine the operating status of the PEMFC, the lithium battery participates in the power supply when operating beyond the load, abnormal conditions to warn and protect the PEMFC to prevent irreparable damage during operation to extend the life of the PEMFC. 2

) Fuzzy adaptive PID control
The PID controller with fuzzy adaptive is according to the PID control algorithm, which takes the error e and error change ec as input and calculates and modifies each parameter of the PID in real time according to the fuzzy control rules to meet the demand of e and ec on the PID parameters under different working conditions.
Using the basic theory of fuzzy mathematics, fuzzy sets represent the conditions and operations of the operation rules, and these fuzzy control rules and related information (such as PID coefficients and estimation indexes) are stored as data in the control parameters rectified by the microcontroller.The microcontroller can automatically achieve the optimal adjustment of PID parameters by applying fuzzy criteria according to the real-time collection of the control system for different parameter change rates.
The purpose of fuzzy self-tuning is to study the fuzzy relationship between the three parameters of PID and e, ec.By constantly detecting e and ec, determine three parameters online according to the fuzzy control criteria to meet different e and ec.The controller structure is shown in Figure 3. 3) The model of LSTM speed prediction according to heuristic adaptive As shown in Figure 4, the LSTM model is the main model of our study, and the reason is that the LSTM model is adept in handling the series data of time.In velocity prediction, the data is the time series, then the model of LSTM as a part of our innovative model are selected.Figure 5 shows that, the formation contains the gates of input, the gates of forgetting ft and the gates of output ot, where the gates of input and output are used to control the information flow of input and output, and forgetting gates are used to control the state of the previous moment, through which the three gates are used to achieve longterm memory.As shown in equation (1)-equation ( 5 (5) The ct of equation (1)-equation ( 5) denotes the state of the current unit at moment t, ht denotes the output of the current unit in the hidden layer, and the bias is represented by bf, bi, bo, and bc.wxf, whf, wcf, wxi, whi, wci, wxo, who, wco, wxc, and whc denote the weights of each component.
The ct in Equation ( 1)-Equation ( 5) shows the state of fuel cell at t, ht shows the output for the hidden layer, and bf, bi, bo, and bc show the bias.The parameters of w show the weights, which are gained through training.The resulting LSTM model is constructed to obtain the relationship between data in the before and after time in the time series data, which facilitates the accurate representation of the before and after relationship of the features.Therefore, the LSTM model is suitable for vehicle speed prediction.In this paper, the LSTM model provides support for multiple driving features to predict speed by combining the feature that the fully connected layer can combine multiple features.Unlike ordinary data, time series data with backward time will be influenced by the previous data, and the closer the time to the prediction, the more it can influence the accuracy of the prediction, then the larger the weight will be.So the input data are weighted as shown in Equation ( 6): where N denotes the length of the current input model of different time interval, i denotes the number for the time interval, and yi denotes the number of the i-numbered data.After the weighting process, the data with similar intervals prediction different time point, it could determines the more prediction.This solves the problem of decreasing prediction accuracy since the data of prolonged time, and provides the possibility of expanding the time interval and predicting the speed of vehicle over a long time.
In previous regression prediction models, a fixed time interval is usually used to model the relationship between predictors and vehicle speed, while ignoring the limitations of different time periods in the speed of vehicle prediction, which have different effects on vehicle speed prediction in reflecting the change of vehicle speed over time interval.The LSTM model of prediction according to time interval optimization is proposed to overcome the above limitations by adapting the time interval.This probability-based algorithm heats the solid to a sufficiently high temperature and then slowly cools it.When the solid reaches its ground state at room temperature, its internal energy is reduced to a minimum.In this paper, we take the RMSE of the LSTM model training results as the objective function of the simulated annealing algorithm, and the input variable of the simulated annealing algorithm is the time interval.For different time interval inputs, the accuracy of the LSTM model fluctuates very much.The simulated of annealing algorithm starts from a certain time interval and has low precision.With the decrease of temperature (time interval) parameter, the optimal global solution is randomly found in combination with the probabilistic burst characteristic in the space of solution.In the optimal global solution, the state of previous is assumed to be x (n), and the system turns its condition to x (n+1) by the gradient descent.Thus, the energy of the whole architecture turns from E (n) to E (n+1).The acceptance chance of acceptance for the whole architecture turn from x (n) to x (n+1) as: For equation (7), if E (energy) at the latter moment decreases, the transfer will be gotten (with chance P of 1).If E increases, the method cannot respond immediately (with probability P not 0), but performs the following probabilistic operation: In the first step, we generate a consistent distribution when the random number α in the range [0, 1].if α < P, then this change can be received.Otherwise, the changing is declined.Then we go to the next step and repeat the loop.p determines the chance P on the amount of vary in E and T, so P is dynamic.
In the model, the Combinatorial optimization problem is evaluated and analyzed through Simulated annealing algorithm.Where the temperature changes over time, and the value of internal energy is modeled as the RMSE value, that is, a simulated method of annealing algorithm for combinatorial optimization problems is presented.This method can solves the weakness of convention regression prediction models with determined time interval which leads to a decrease in prediction accuracy.
4) Fuzzy control combined with speed prediction models The total drag force on the vehicle is calculated from the vehicle longitudinal dynamics equation as follows: F = mgC cosϑ + (C AρV )/2 + mgsinθ + δ ma (9) where Ft is the vehicle traction resistance, θ is the road slope, Cr is the tire rolling resistance coefficient, δm is the rotating mass coefficient, Cd is the drag coefficient, A is the vehicle windward area, ρ is the air density, V is the vehicle speed, and a is the acceleration.
The vehicle demand power Preq is calculated from the current vehicle speed V and traction force Ft, as shown in Equation (10): ) A fuel cell test bench is used to test the output power and the additional cell's SOC.The main components include a fuel cell stack, controller, air compressor, simulated load, etc.
Algorithm1 Pseudo-code for LSTM model based on heuristic adaptive time-span strategy S:=s0; e:=E(s) // Set the current state to s0 and its energy E(s0) k:=0 //Frequency of assessment k while k<kmax and e>emax // if there is still time (evaluation number is less than kmax) and the result is not good enough(energy e is not low enough), then; sn:=neighbor(s) //Perturbations produce new solutions sn en:=E(sn) //sn energy of is E(sn) if random()<P(e,en,temp(k/kmax))then//decide whether to accept the new solution sn s:=sn;e:=en //Accept a new solution sn k:=k+1 //Assessment done.Count k plus one Return s //State of rotation s Figure 6.Simulation results with initial SOC of 0.4 Figure 6 shows the simulation results of the power cell initial state SOC of 0.4, and Figure 6(a) shows the fuel cell output power change curve of the traditional PID control strategy.From the simulation results, it can be seen that when the power cell SOC is low, the fuel cell needs a continuous larger output power, not only to meet the requirements of the whole vehicle dynamics but also a part to charge the power cell (in a smooth state) and continuously to achieve the balance of power demand and charging requirements.From the perspective of vehicle economy, the hydrogen fuel consumption rate under this condition is 114.9L/100 km, and the total energy utilization efficiency of the whole vehicle system is 0.183, so the vehicle operation economy needs to be improved.Figure 6(b) shows the simulation results of the heuristic adaptive time interval strategy according to the fuzzy adaptive PID control algorithm with an initial SOC of 0.4 for the power cell built in this paper.From the simulation results, it can be seen that under the premise that the actual vehicle speed in this working condition and power cell state meets the working condition demand when the power cell is at a lower SOC (0.4), the fuzzy adaptive PID control algorithm according to the heuristic adaptive time interval strategy controls the compensation power output of the fuel cell, so that the SOC gradually increases in the tiny trickle power charging to meet the SOC compensation and the overall vehicle dynamics requirements.From the perspective of vehicle economy, the hydrogen fuel consumption rate under this condition and battery charge state is 107.5 L/100 km, the total energy utilization efficiency of the whole vehicle system is 0.191, and the whole vehicle operating cost is improved compared with that under the common PID strategy.After the experiment, the solenoid valve controls the hydrogen fuel supply.The fuel cell reactor can maintain a stable reaction within a certain period of time under the action of the remaining hydrogen in the reactor after the solenoid valve is closed.The solenoid valve can respond quickly after the next opening under the experimental working condition, so the experiment meets the working condition requirements.
Figure 7. Simulation results with initial SOC of 0.7 Figure 7 shows the simulation results of the fuzzy adaptive PID control algorithm according to the heuristic adaptive time interval strategy to control the fuel cell strategy power cell with an initial SOC of 0.7.To meet the demand for actual vehicle speed, the power cell needs to be in a medium SOC state of 0.7.Under the control strategy, the power cell should output less power to maintain the SOC above 0.69.The fuel cell should output normal power to meet the vehicle's power performance requirements.The SOC will slowly decrease and eventually stabilize at a suitable value.From the perspective of vehicle economy, the hydrogen fuel consumption rate under this condition and battery charge state is 86.4 L/100 km, and the total efficiency of the whole vehicle system is 0.208.
Table 1 show the simulation data which based on the PID control with fuzzy adaptive algorithm according to the heuristic adaptive time interval strategy and the conventional PID control strategy under the same operating conditions.From table 1, we can see that the control strategy built outperforms the conventional PID control strategy in terms of hydrogen consumption per 100 km and total vehicle efficiency when the vehicle's power-driving performance is satisfied.The total vehicle operating efficiency is improved by 43% in the low charge condition and 83% in the medium charge condition.Therefore, the control strategy model built in this paper meets the performance requirements and improves economic performance.

CONCLUSION
To achieve more accurate control and detection of the output power of cathode open air-cooled PEMFC, an embedded power control system according to an STM32 microcontroller is developed, and a fuzzy adaptive PID control algorithm according to a heuristic adaptive period strategy is proposed.Through the sensor and sampling circuit to the PEMFC voltage circuit and other parameters, the microcontroller processes and operates the data to achieve the monitoring of the PEMFC output power.And the power output balance of the fuel cell and backup battery is adjusted in real time.The experimental model is evaluated from two doing states of low SOC and high SOC.The HATLSM control strategy is improved by about ten percent to the traditional PID control strategy in terms of hydrogen consumption and total efficiency of the whole vehicle as the evaluation criteria.The HATLSM control strategy greatly improves the economy and service life of the PEMFC.

Figure 1 .
Figure 1.Control system composition diagram

TABLE 1 SIMULATION
RESULTS IN THE COMPARISON CHART