1 Introduction

The global challenge currently in the energy area is power generation with minimal pollution and environmental degradation. The fuel cell (FC) technology is having remarkable evolution every year. The FC used to obtain practical results in this paper comprises an ion conductor electrolyte (membrane), and porous anode and cathode, which convert the chemical reactions directly into electricity. In a PEMFC (proton exchange membrane), the electrochemical combination of fuel (hydrogen) and oxidant (oxygen) produces electricity, heat and water (Larminie and Dicks 2003; Hirschenhofer et al. 2005).

Fuel cell stacks can be used both in vehicles (cars, buses and trains) and in stationary power plants to generate electricity for residential homes and industries. Another promising use of FC stacks is for electricity storage in conjunction with electrolyzers and hydrogen accumulators (Gonzatti and Farret 2017).

Some factors must be controlled in the normal operation of a FC in addition to the hydrogen flow, membrane temperature and humidity so that it can operate within some established limits such as electric power, pressure of the fuel gas and amount of air for the anode chemical reaction (Riascos et al. 2006; Farret and Simões 2006). In particular, the membrane temperature has a direct influence on the output power and lifetime of the fuel cell (Saygili et al. 2015).

In particular, this paper describes some practical tests for automation of a 3000 W PEMFC using a fuzzy logic control to establish the correct fan rotation to cool down the membrane. Furthermore, it includes also some strategies to run a purge to remove nitrogen and excess of water from the anode. In addition, well-established periodic short circuits were used to control the membrane humidity so improving the overall performance and stack lifetime. This FC is part of an electric power storage prototype operating in conjunction with metal hydrides and an alkaline electrolyzer (Gonzatti et al. 2016). This paper contributes to simultaneous application and reunion of various techniques to automate a stack of PEM. These techniques combine temperature control, hydrogen purge to eliminate anode contaminants and short circuit for reestablishment of voltage levels due to humidity loss. All parameters were set to a stack of 3 kW used to make part of an energy storage system.

2 Control of the Variables

The main variables used to control the FC stack discussed in this paper are: stack temperature, membrane humidity and accumulation of water and nitrogen in the anode side. These variables are the most important factors in any efficiency and lifetime of FC stacks.

2.1 Temperature

The good performance of FCs is reduced at low temperatures. On the other hand, too high temperatures may cause serious problems in the hydration of the membrane polymer, leading to high resistance and losses by ion conductivity (Saygili et al. 2015). A dry membrane can be produced by the reaction air supplied at a higher stoichiometry rate that causes removal of water particles from the membrane by the air flow (Larminie and Dicks 2003; Riascos and Pereira 2009). Therefore, the operating temperature (upper limit) has to be limited by the thermal characteristics of the stack materials (Ozen et al. 2016). Therefore, thermal management of PEM fuel cells is required in order to operate them at higher levels of efficiency and low material degradation.

According to Pei and Chen (2014), the operating temperature of a self-humidified fuel cell should be kept below \(60 \,{^{\circ }}\hbox {C}\) to prevent excessive dehydration of its internal membrane. High stack temperatures may lower the membrane temperature so preventing the outflow of water. To cool a FC stack is commonly used some external form of heat exchange with air or liquid circulation (water or antifreeze) or yet using thermodynamic cycles (Saygili et al. 2015).

An important factor of the heat exchange is to satisfy certain requirements, such as low cost and losses, simplified structure, high reliability and, most important of all, a good temperature control (Cheng et al. 2015).

2.2 Accumulation of Nitrogen and Water on the Anode

When air is supplied as the reaction oxidant, nitrogen may be transported through the membrane due to pressure or a concentration gradient (Chen et al. 2014; Strahl et al. 2014) preventing so any combination of hydrogen and oxygen. The reference (1) gives the nitrogen permeation rate through the membrane (Baik and Kim 2011).

$$\begin{aligned} J_{{\mathrm{N}}_{2} }^{\mathrm{C}\rightarrow \mathrm{A}} =k_{{\mathrm{N}}_{2} } \left( {\frac{P_{{\mathrm{N}}_{2} }^\mathrm{C} }{L}} \right) \end{aligned}$$
(1)

where

\(J_{{\mathrm{N}}_{2} }^{\mathrm{C}\rightarrow \mathrm{A}} :\) :

nitrogen permeation rate \((\hbox {mol m}^{-2} \hbox { s}^{-1})\);

\(k_{{\mathrm{N}}_{2} } :\) :

permeability coefficient of nitrogen \((\hbox {mol m}^{-1} \hbox { s}^{-1} \hbox { Pa}^{-1})\);

\(P_{{\mathrm{N}}_{2} }^\mathrm{C} :\) :

partial pressure of nitrogen (Pa);

L::

membrane thickness (m).

The permeability coefficient of nitrogen is given by (2) (Baik and Kim 2011).

$$\begin{aligned} k_{{\mathrm{N}}_{2} } =k_{{\mathrm{N}}_{2} }^0 \mathrm{e}^{\left( {\frac{-E_{{\mathrm{N}}_{2} } }{RT_{\mathrm{FC}} }} \right) } \end{aligned}$$
(2)
\(k_{{\mathrm{N}}_{2} }^0 :\) :

maximum permeability coefficient of nitrogen (Table 1) \((\hbox {mol m}^{-1} \hbox { s}^{-1} \hbox { Pa}^{-1})\);

\(E_{{\mathrm{N}}_{2} } :\) :

energy activation of nitrogen (Table 1) \((\hbox {J mol}^{-1})\);

\(T_{\mathrm{FC}} :\) :

temperature (K);

R : :

universal gas constant \((8.3145 \hbox { J mol}^{-1}\hbox {K}^{-1})\);

If it is assumed that the atmospheric air is composed by 78% nitrogen, the partial pressure of nitrogen on the cathode will be approximated by (3).

$$\begin{aligned} P_{{\mathrm{N}}_{2} }^\mathrm{C} =0.78P_{\mathrm{air}}^\mathrm{C} \end{aligned}$$
(3)

where:

\(P_{\mathrm{air}}^\mathrm{C} :\) :

pressure of air (Pa).

Table 1 Maximum permeability coefficient and activation energy obtained from the Arrhenius plot as a function of the relative humidity (Baik and Kim 2011)

The number of moles in accordance with Chen et al. (2014) is given by (4).

$$\begin{aligned} N_{{\mathrm{N}}_{2} }^\mathrm{A} =A_{\mathrm{M}} \int J_{{\mathrm{N}}_{2} }^{\mathrm{C}\rightarrow \mathrm{A}} \mathrm{d}t \end{aligned}$$
(4)

where:

\(A_{\mathrm{M}} :\) :

membrane area, \((\hbox {m}^{2})\).

According to Cheng et al. (2015), the molar fraction of nitrogen on the anode is given by (5).

$$\begin{aligned} x_{{\mathrm{N}}_{2} }^\mathrm{A} =\frac{N_{{\mathrm{N}}_{2} }^\mathrm{A} RT_{\mathrm{FC}}}{P^{\mathrm{A}}V_{\mathrm{ch}}^\mathrm{A} } \end{aligned}$$
(5)

where:

\(N_{{\mathrm{N}}_{2} }^\mathrm{A} :\) :

number of moles of nitrogen in the anode, (mol);

\(T_{\mathrm{FC}} :\) :

temperature of the fuel cell (K);

\(P^{\mathrm{A}}:\) :

pressure of anode (Pa);

\(V_{\mathrm{ch}}^\mathrm{A} :\) :

volume of the anode channel, \((\hbox {m}^{3})\).

Part of the water produced on the cathode is subject to its diffusion through the membrane and accumulation on the anode (Chen et al. 2014; Nikiforow et al. 2013). Therefore, the anode hinders the input of hydrogen and causes an excess of liquid water, blocking the membrane channels and causing instability in the FC performance (Yu et al. 2009). The voltage across the stack can even reach zero power generation (Mokmeli and Asghari 2010). Flooding also has a negative effect on the PEMFC durability, since it accelerates the electrode corrosion and catalyst (Pei and Chen 2014).

A solution to remove the excess of water, nitrogen and other impurities on the anode is by performing regular purging of hydrogen during operation of the stack. Removal of hydrogen from the anode carries the excess of water and the nitrogen permeating the membrane \((\hbox {cathode} \rightarrow \hbox {anode})\). A hydrogen purge consists of opening a valve located in the FC output by hydrogen pressure (Nikiforow et al. 2013). In general, elimination of the water deposited on the anode must be proportional to the generated electric power level (Hou et al. 2012). However, as water is being expelled out, a considerable amount of hydrogen comes together, thus decreasing the overall cell efficiency. The ideal is a compromise between drop of voltage and frequency purge and therefore loss of hydrogen (Nikiforow et al. 2013; Hou et al. 2012).

Reference Rabbani and Rokn (2013) reports that nitrogen mole fractions of 5% or less has no or minimal effect on the FC stack life. In their study is defined a 3% purge as the starting limit, i.e., the purge event will occur only when the concentration of \(\hbox {N}_{2}\) reaches 0.03 relative to \(\hbox {H}_{2}\).

2.3 Short-Circuit Technique for Humidification

Losses due to ohmic potential are related to the ion flow through the electrolyte resistance and electron flow through the electrode (Strahl et al. 2014). Some humidity control techniques are used to perform the correct humidification of the membrane and to decrease the FC voltage drop. These techniques enable its good performance and improved operation without damages to the membrane (Larminie and Dicks 2003; Zhan et al. 2014).

A humidity control technique is used to obtain an extra increase of cell power so increasing the water production (Pei and Chen 2014). An extra power can be achieved by switching regular short circuits between cathode and anode. This technique was registered in two patents (Fuglevand et al. 2000, 2002). Each short-circuit duration must be about 20% less than the switching periods, ranging from 0.01 s to 4 min. This technique causes an increase in the production of water and membrane hydration. Therefore, it decreases the voltage drop and increases the overall efficiency (Fuglevand et al. 2000, 2002; Kim et al. 2014). This periodic switching process can also be used during the initial FC warming-up procedure until it reaches the desired operating temperature.

In practical tests, Zhan et al. (2014) used periods of 10–50 s between every short circuit and a duration range between 20 and 200 ms. With these conditions was found out that in 1-h period the attenuation of voltage is small either with and without application of the short circuits. However, for longer periods without this technique, the voltage drops are about 20%.

Reference Kim et al. (2014) performed an experiment in which the short-circuit period was set at 100 ms. Longer short-circuit periods can cause excessive water flooding on the cathode and also damages to the whole set of membrane electrodes.

3 Automation and Control of a FC Stack

The control test conditions of the fuel cell stack H-3000 with air cooling are listed in Table 2. The manufacturer provided a stack with six fans to cool the membrane and to supply air for the electrode reactions, as shown in Fig. 1a.

Table 2 Characteristics FC H-3000 (Horizon Fuel Cell 2013)

The FC automation system described in this paper has monitored several variables, such as the \(\hbox {H}_{2}\) inlet pressure \((P_{\mathrm{H}})\), cell temperature \((T_{\mathrm{FC}})\), stack voltage \((V_{\mathrm{FC}})\) and cell current \((I_{\mathrm{FC}})\). These variables are enough to operate directly the load activation, hydrogen release and temperature control by fan speed and all necessary commands to perform the regular purge and short circuits (Fig. 2).

Fig. 1
figure 1

FC H-3000; a fans; b location of the thermocouples; c thermographic image during the stack operation

The monitoring and control systems were implemented in a LabVIEW platform and a data acquisition board. Among the various processing routines, one is responsible for the protocol to turn the FC on and off, whenever the temperature exceeded \(65 \,{^{\circ }}\hbox {C}\), or the current goes above 90 A, or yet the voltage is below 36 V. These parameters are defined by the fuel cell manufacturer Horizon Fuel Cell (2013).

The hydrogen valve is opened when the pressure is still within the permitted range (between 0.45 and 0.55 bar). The load is activated when the membrane temperature reaches \(30\, {^{\circ }}\hbox {C}\); otherwise, a heating routine performs periodic short circuits and purges until the cell reaches the set temperature. During the FC operation, regular short circuits, hydrogen purge and fan velocity controls are independently performed, as described in the following subsections.

Fig. 2
figure 2

Schematic of the monitoring system and FC control

In order to turn the fuel cell off, the load is firstly disconnected and the hydrogen supply is closed. If the FC temperature exceeds \(30\, {^{\circ }}\hbox {C}\), the fan is operated at full power until the temperature comes down, ensuring a safe shutdown temperature.

3.1 Control Temperature

The PEMFC stack used in the experiments uses the ambient air for heat exchange and as an oxidant. The manufacturer of this FC model has already provided it with fans.

The fan management strategy is defined according the diagram in Fig. 3 aiming at stack cooling procedure and to maintain the proper reaction airflow. The fans remain off during the FC heating up stage (below \(30 \,{^{\circ }}\hbox {C}\)) and they are activated at their maximum speed in case of it happens an overheating (above \(\hbox {65}\, {^{\circ }}\hbox {C}\)). Within the operating temperature range, the fuzzy control acts to maintain the set temperature at about \(42 \,{^{\circ }}\hbox {C}\). The minimum fan velocity is determined by the air oxygen consumption, with a stoichiometry rate equal to 3, according to Eq. (6) (Larminie and Dicks 2003).

$$\begin{aligned} Q_{\mathrm{air,FC}} =\frac{214.2 10^{-4} n I_{\mathrm{FC}} \lambda }{ \rho _{\mathrm{air}} } \end{aligned}$$
(6)

where:

\(Q_{\mathrm{air,FC}} :\) :

air flow (L/min);

n : :

number of cells (72);

\(I_{\mathrm{FC}} :\) :

stack current (A);

\(\lambda :\) :

stoichiometric ratio;

\(\rho _{\mathrm{air}} :\) :

air density \((\hbox {kg/m}^{3})\).

According to the thermographic images in Fig. 1b, it is clear that the temperature is unevenly distributed during operation of the FC stack.

Fig. 3
figure 3

Fans control strategy

To measure the stack temperature with a high-fidelity degree, eight type-K thermocouples were distributed along the stack and interconnected in parallel to each other, thereby providing the average operating stack temperature, as shown in Fig 1c.

The minimum fan speed is determined by (1), which depends basically on the stack current \((I_{\mathrm{FC}})\). The temperature is used as input signal for the heat control.

According to the thermographic images in Fig. 1b, it is clear that the temperature is unevenly distributed during operation of the FC stack.

To measure the stack temperature with a high-fidelity degree, eight type-K thermocouples were distributed along the stack and interconnected in parallel to each other, thereby providing the average operating stack temperature, as shown in Fig 1c.

The minimum fan speed is determined by (1), which depends basically on the stack current \((\hbox {I}_{\mathrm{FC}})\). The temperature is used as input signal for the heat control.

The stack cooling control was implemented in LabVIEW “Fuzzy System Designer.” The pertinence functions of temperature \((\Delta T)\) and temperature variation (\(\Delta T/\Delta t)\) errors were defined by three central triangular sets and laterally by two trapezoidal sets, totaling five sets for each input according Simões and Shaw (2007).

The pertinence functions and inference rules generated in the output area used the minimum logical product. The defuzzification method was the center of area. Figure 4 represents the control surface of the stack temperature.

Fig. 4
figure 4

Surface of the temperature control

3.2 Purge Control

The purge stopping time was designed so that the nitrogen concentration on the anode side does not exceed the molar fraction of 0.01. This procedure ensures less electrode corrosion and high concentration of hydrogen for the electrode reaction. Calculation of the purge time used the equations discussed in section II, subsection B and Tables 1 and 3, to generate the graph in Fig. 5. The curves in this figure represent the time required for the anode to have a specific molar fraction depending on the membrane humidity (U = 0–100%). The dashed line represents the time in terms of mole fractions with a humidity of 95%.

Table 3 Quantities used to calculate the molar fraction of nitrogen inside the anode

The membrane humidity is maintained at 95%, and all nitrogen is removed from the anode every time a purge is performed. In this automation, the purge procedure was performed at every time the concentration reached 1%, which is much below the levels (3%) used in Rabbani and Rokn (2013) to ensure minimal influence on the FC lifetime (Rabbani and Rokn 2013). Therefore, the time required for the nitrogen to pass through the membrane and reach a mole fraction of 0.01 in the anode side is 80 s, as shown in Fig. 5.

The purge was activated at fixed periods of 80 s, or whenever the voltage drop was higher than 10 V referring to the curve provided by the manufacturer, thereby ensuring that the water excess in the anode was also removed.

Reference Kim et al. (2014) showed that purge times of 500 and 300 ms have almost the same voltage drops, so avoiding loss of hydrogen. Therefore, the purge was performed with the shortest time, which is 300 ms.

Fig. 5
figure 5

Time required to let the anode with a specific molar fraction depending on the membrane humidity

3.3 Short-Circuit Control

Assuming that the voltage drop occurring at the ohmic overpotential is due to a dry membrane, the short-circuit technique was performed whenever was detected a voltage drop out of this range. In this work, this technique consists of blocks of two 1-s short circuits, each one lasting 100 ms, as shown in Fig. 6. The manufacturer provides the FC polarization curve. The short-circuit blocks are activated whenever the voltage difference (\(\Delta V\)) between the polarization curve and the operating voltage for a given current are greater or equal to 5 V (see Fig. 7). Yet, the blocks are applied whenever the ohmic resistance of the membrane \(({R}_{\mathrm{m}} )\) exceeds a double value with respect to the cell-to-cell ohmic resistance of \(0.2 \,\Omega \), though the minimum time was limited to 10 s. The minimum and maximum times between short circuits, as well as the short-circuit period, were based on Zhan et al. (2014) with criteria presented in Fuglevand et al. (2000, 2002).

Fig. 6
figure 6

Short-circuit implementation strategy

Fig. 7
figure 7

Stack polarization curve provided by the manufacturer and the smallest voltage variation allowed without use of the short-circuit technique

Fig. 8
figure 8

Temperature control test

Monitoring of the cell performance was done by observing the total stack voltage (72 cells). Thus, if the voltage of any single cell abnormally dropped due to dehydration, the monitoring system could not detect it. This strategy manages the situation and avoids an increased complexity of the monitoring system but still keeping a secure operation without damages to the FC stack. For this, the short-circuit technique was performed periodically at every 50 s, in case it was not activated within this period. This technique has been implemented in LabVIEW and performs periodic electrode short circuits through an IGBT device.

4 Results and Discussion

The FC stack was subjected to several 20-min operating tests using controls for temperature, hydrogen purge and periodic short circuits under different loads levels. In Fig. 8, the instantaneous stack temperature, the fan speed and the generated average power can be observed. It is noticeable that the temperature was always kept below the reference set level at the initial time. That is because the stack had just started its operation and was so far subjected only to the warm-up routine. However, fans were operating at around 16% of their maximum speed, supplying enough air for the reaction at a stoichiometric ratio equal to 3.

After the stack reached its average power level of around 1300 W, the temperature began to rise up above the reference. After about 300 s, the fuzzy control began to operate and raise the fan velocity above the speed established by the stoichiometric ratio. Besides the heat generated by the fuel cell stack to supply the electric power, there is a perturbation in the temperature due to the heat generated during application of the short-circuit technique. With these results, it can be concluded that the fuzzy logic control used in the experiments was robust enough to maintain the FC temperature at \(42 \,{^{\circ }}\hbox {C}\).

Fig. 9
figure 9

Behavior of the voltage and power during operation and at the presence of the short-circuit techniques and purge

Fig. 10
figure 10

Behavior of the hydrogen flow and power during operation and at the presence of the short-circuit techniques and purge

Fig. 11
figure 11

Increase of voltage drop and stack resistance during application of the short-circuit and purge techniques

Fig. 12
figure 12

Behavior of the voltage drop and hydrogen flow at the instants of short circuits and purges

The application of the short-circuit technique and purges avoided membrane dryness and flooding, consequently limiting the stack voltage drop (Fig. 9). It is noticeable during the tests that for powers up to 1300 W, the frequency of short circuits and purges was much lower than those during higher power levels, thus reducing so the hydrogen losses. It is different from the technique used by the manufacturer, which executed the purge and short circuit periodically and independent of the load and voltage drop of the stack (Gonzatti et al. 2014) (Fig. 10).

The effectiveness of the voltage control techniques can be better appreciated in Fig. 11, where the voltage drops and increase of the cell resistance are shown together with the purge and short-circuit application instants. The short circuits have an immediate action on the reestablishment of the voltage across the stack. On the other hand, the purges have a longer lasting action. It is possible to realize that at low power levels, the short-circuit technique reestablished a voltage higher than that of the purges, which ends up reversing the higher power levels. It must be said that the application of these two techniques include an additional consumption of hydrogen (Fig. 12).

That is, the highest consumption occurs during application of short circuits, and consumption is delayed because of the fluid dynamics. The total generated and consumed quantities during the test period are shown in Table 4.

Table 4 Total quantities generated and consumed during the test period

5 Conclusion

This paper deals with management and control of the reaction air flow and cooling air of a FC stack. Test results with these techniques were very effective to keep both membrane temperature within some established limits and to provide sufficient air to the electrode reaction.

The parameters that determine the instant and period of the short circuits and purges were obtained from theoretical and empirical data. They were effective in controlling the stack voltage drop due to dehydration of the membrane and nitrogen and water accumulation on the anode side. Even with an extra consumption of hydrogen due to application of the short-circuit and purge techniques, the efficiency was high enough, reaching a percentage of 40%. Furthermore, the control techniques described in this paper guaranteed the correct membrane temperature and humidity, as well as a good control of impurities in the stack anode with high efficiency and operation standards as required for a longer FC lifetime.

The techniques of short circuit, temperature control and periodic purges used for this paper can be applied to any other PEMFC stack since details of their application are all included.