184 IEEE TRANSACTIONS ON ENERGY CONVERSION, VOL. 26, NO. 1, MARCH 2011 PEM Fuel Cell Stack Modeling for Real-Time Emulation in Hardware-in-the-Loop Applications Fei Gao, Student Member, IEEE, Benjamin Blunier, Member, IEEE, Marcelo Godoy Simões, Senior Member, IEEE, and Abdellatif Miraoui, Senior Member, IEEE Abstract—In this paper, a multiphysical proton exchange membrane fuel cell stack model, which is suitable for real-time emulation is presented. The model covers three physical domains: electrical, fluidic, and thermal. A Ballard 1.2 kW 47 cells fuel cell stack model is introduced. The corresponding fuel cell system auxiliary models are given based on experimental tests. Based on the modeling equations, the fuel cell dynamic phenomena in different physical domains are analyzed and the corresponding time constant expressions are given. Using the real-time stack model, a fuel cell stack emulator based on a buck converter is used to emulate the fuel cell stack electrical part. The experimental results show that the emulator can reproduce the real-stack behavior with a great agreement. Such a fuel cell stack emulator can be used for hardware-in-the-loop applications, in order to test and validate the fuel cell system design. Index Terms—Fuel cells, power electronics, real-time systems, simulation. I. INTRODUCTION UEL cells technology, recently, a very active research field because of many possible applications in distributed generation solutions. Fuel cell systems are complex multiphysical systems, which covers three major physical domains: electrical, fluidic, and thermal. A stand-alone proton exchange membrane (PEM) fuel cell stack itself cannot be used directly as an energy supply and require stack control and energy management. The fuel cell dc output voltage is highly dependent to the current, which imposes a high-output voltage variation. The voltage variation range is not acceptable for most of the dc electrical devices. Moreover, if the electrical device needs an ac supply, the fuel cell system must be connected to an inverter to provide alternating current [1]. One of the key challenges of fuel cell systems is the design of an appropriate power converter for conditioning the power output. During the design phase, the converter needs to be tested and adjusted with the real-fuel cell stack, and then, it must be validated. However, the design and the development of fuel cell F Manuscript received March 29, 2010; revised May 25, 2010; accepted June 1, 2010. Date of publication July 19, 2010; date of current version February 18, 2011. Paper no. TEC-00133-2010. F. Gao, B. Blunier, and A. Miraoui are with the Department of Electrical Engineering, Transport and Systems Laboratory (SeT), Université de Technologie de Belfort-Montbéliard (UTBM), Belfort Cedex 90010, France (e-mail: fei.gao@utbm.fr; benjamin.blunier@utbm.fr; abdellatif.miraoui@utbm.fr). M. G. Simões is with the Colorado School of Mines, St. Golden, CO 804011887 USA (e-mail: msimoes@mines.edu). Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org. Digital Object Identifier 10.1109/TEC.2010.2053543 auxiliary systems, such as testing of air compressor control, power and energy management, and performance optimization may damage a fuel cell very easily. In addition, fuel cell test costs (hydrogen consumption and the need of safety installations) are still relatively high, in addition of the requirement of safety and special installations to conduct experiments with a real-fuel cell. The aforementioned drawbacks support the interest in designing a PEM fuel cell real-time model-based emulator for hardware-in-the-loop (HiL) applications. In fuel cell system power converter design as well as in other developments, the fuel cell auxiliaries can be tested and improved with the realtime fuel cell emulator initially without any risks for the fuel cell stack, with low cost of operation. A fuel cell model-based emulator requires that the output physical quantities, such as voltage of a real stack must be reproduced accurately by the emulator. The computation time of the emulator should be in real time for HiL tests. Therefore, the model complexity is a compromise between accuracy and computational speed. In addition, as mentioned earlier, the realtime model should be multiphysical model in order to simulate the different physical phenomena occurring in the fuel cell stack. Different approaches for fuel cell models are found in the literature [2]–[9], but few of them considered the detailed fluidic and thermal behaviors. Most of the proposed models are singledomain models. Some of them considered the fluidic domain in the fuel cell. But the complete electrical, fluidic, and thermal phenomena are never included in a single model as proposed in this paper. Moreover, many real-time PEM fuel cell emulators have been proposed [10]–[15]. A common drawback of these emulators is that the fuel cell models used for the emulator are too simplified and do not represent accurately all the system physics and nonlinearities. Most of these proposed emulators consider only the electrical system level or an electrical equivalent model. In fact, a fuel cell is a multiphysical system and other physical domains, such as fluidic and thermal phenomena should be considered in the model. In this paper, a complex multiphysical model is shortly presented in a first part. This model can predict the fuel cell stack behavior in different physical domains. With the model equations, a fuel cell dynamic phenomena analysis is done. The proposed multiphysical model is then implemented in a realtime system for simulation. The design of the fuel cell emulator using a dc/dc buck converter is detailed in a second part. The experimentation in the last section shows that the emulator can reproduce the fuel cell power output very accurately and fuel cell physical quantities in different domains can be supervised during the emulator operation. 0885-8969/$26.00 © 2010 IEEE GAO et al.: PEM FUEL CELL STACK MODELING FOR REAL-TIME EMULATION IN HARDWARE-IN-THE-LOOP APPLICATIONS TABLE I TABLE OF INDEXES USED IN EQUATIONS 185 model presented hereafter. Thus, a concentration losses term is not necessary in (1) for this model. The dynamic activation losses voltage Vact (V) due to the “double-layer effect” in the electrical domain is as follows: d i 1 Vact = Vact 1− (3) dt Cdl ηact where Cdl is the single-fuel cell double-layer capacitance (F). The cell static activation losses ηact (V) can be obtained from the well-known Butler–Volmer potential equation αnF −( 1 −α ) n F i = j0 S e R T η a c t − e R T η a c t (4) II. MULTIPHYSIC FUEL CELL SYSTEM MODEL A multiphysical PEM fuel cell stack model used for fuel cell real-time simulation is summarized in this section. More detailed model equations with fully experimental validation are presented in [16] and [17]. More informations for the sources of the physical equations presented hereafter in modeling sections can be found in detail in [16]. Table I gives all the indexes used model equations in the following sections. A. Cell Electrical Model The single-cell voltage output can be computed using the following equation: Vcell = Ecell − Vact − Vohm (1) where Ecell is the single-cell electromotive force (V), Vact is the cell activation losses at catalyst layer (V), and Vohm is the cell resistive losses (V). The cell electromotive force can be obtained from the Nernst equation as follows: Ecell = E0 − 0.85 × 10−3 (T − Tc ) RT + ln PO 2 × PH 2 2F (2) where T is the temperature of the cell (K), E0 is the reversible nearest potential for single cell (1.229 V), Tc is the temperature correction offset (298.15 K), PO 2 is the oxygen pressure (atm) at the interface of cathode catalyst layer, PH 2 is the hydrogen pressure (atm) at the interface of anode catalyst layer, R is the ideal gas constant (8.31 J/mol), and F is the Faraday constant (96 485 C/mol). It should be noted that the gas pressures used in the model are the pressures at the interface of the catalyst layers of the anode and cathode sides. The well-known “concentration losses” in a fuel cell are due to the pressures drop through the gas diffusion layer (GDL) (i.e., from the gas channels to the catalyst interface). If the channels pressures are used in (2), the equation should take into account a concentration losses correction term in addition to (1). But in the proposed model, the pressures of the species at the catalyst layer can be directly obtained due to the fluidic where i is the stack current (A), S is the catalyst layer section area (m2 ), n is the number of electrons involved in the reaction, α is the symmetry factor, and j0 is the exchange current density (A/m2 ). When ηact is large, (4) becomes the well-known Tafel equation i RT ηact = ln . (5) αnF j0 S The cell resistive losses Vohm are mainly due to the membrane resistance. These losses can be obtained by computing the membrane resistance expression using the Joule’s law i δ m em Vohm = Rm em i = r(Tm em , λ(z))dz (6) S 0 where δm em is the membrane thickness (m) and r(T, λ(z)) is the membrane local resistivity (Ωm). B. Cell Fluidic Model The fluidic dynamic response of fuel cells is generally due to the gas pressure dynamic in the fuel cell channels (cooling, cathode, and anode), which is given by the mass balance Mgas VCh RT d PCh dt = Ch q̇fluid (7) in/out where Vch is the volume of the channels (m3 ), Mgas is the gas molar mass (kg/mol), Pcv is the gas pressure in the channels (Pa), and qfluid is the fluid mass flow(s) (kg/s) entering or leaving the channels. The gas pressure drop in the channels due to the mechanical losses assuming a laminar flow can be expressed by the Darcy– Weisbach equation ΔP = 64 ρch L V2 Re 2 Dhydro S (8) where Dhydro is the channels hydraulic diameter (m), Vs is the mean fluid velocity in the channels (m/s), ρch is the channels gas density (kg/m3 ), L is the length of the channel (m), and Re is the fluid Reynolds number. In the other side, the gas mass flow rate (kg/s) through the GDL is directly related to the stack current, as described by the 186 IEEE TRANSACTIONS ON ENERGY CONVERSION, VOL. 26, NO. 1, MARCH 2011 following equations: as follows: MO 2 i 4F MH 2 i = 2F MH 2 O i . = 2F q̇O 2 = q̇H 2 q̇H 2 O,pro d (9) δGDL RT Pa (qb /Mb ) − Pb (qa /Ma ) Ptot S Dab (10) (12) where δGDL is the GDL thickness (m), S is the GDL layer section area (m2 ), Ptot is the mean gas total pressure (Pa) in the GDL layer, M is the gas molar mass (kg/mol), b stands for species other than species a, and Dab is the binary diffusion coefficient between the species a and b (m2 /s). In the membrane layer, the water content can be written as follows [18]: ⎧ ⎨ 0.0043 + 17.81 · aH 2 O − 39.85 · a2H 2 O (13) +36 · a3H 2 O , [0 < aH 2 O 1] λ= ⎩ 14 + 1.4 · (aH 2 O − 1), [1 < aH 2 O 3] where aH 2 O is the water activity, calculated from the partial water vapor pressure PH 2 O (Pa) and the water saturation pressure Psat (Pa). The water balance in the membrane layer can be described by two different phenomena: the electroosmosic drag described by (14), and the back diffusion described by (15). Jdrag = (14) Jbd (15) where nsat = 22 is the electroosmotic drag coefficient for maximum hydration condition, ρdry is the dry density of the membrane (kg/m3 ), D( λ) is the mean water diffusion coefficient in the membrane (m2 /s), δm em is the membrane thickness (m), λA is the membrane water content of anode side, λC is the membrane water content of cathode side, and Mn is the equivalent mass of the membrane (kg/mol). The total water mass flow (kg/s) in membrane can be then expressed as follows: qH 2 O,net = Jdrag + Jbd . + Q̇fc forced convection Q̇nc r natural convection and radiation (11) b= a i nsat λA + λC · · · MH 2 O 11 2 2F ρdry λA − λC = · Dλ · · S · MH 2 O Mn δm em dTCV = Q̇cond + dt conduction The multigas diffusion of each species (oxygen, hydrogen, nitrogen, and water vapor) in the GDL can be described by the Stefan–Maxwell equation ΔPa = (ρ V Cp ) (16) C. Cell Thermal Model The thermal dynamic response of a fuel cell is due to the thermal capacity of each layer in the cell. This dynamic for each thermal control volume (CV) can be generally described + + Q̇ ass m convective m ass flow Q̇src (17) internal sources where ρ is the mean layer volume density (kg/m3 ), V is the layer volume (m3 ), Cp is the layer thermal capacity (J/kg), and Q̇ stands for the different types of heat flow entering or leaving the layer volume (J/s): conduction, forced convection, natural convection, radiation, convective mass flow, and internal heating sources. The heat flows between solid materials layers in the fuel cell stack are transferred by conduction according to the Fourier’s Law Q̇cond = λm Scontact (Tlayer1 − Tlayer2 ) δ (18) where λm is the material thermal conductivity (W/mK), S is the contact area (m2 ), and δ is the material thickness (m). The heat exchanges between the solid material and the forced fluid flow is described by the Newton cooling law Q̇fc = hfc Scontact (Tfluid − Tsolid ) (19) where hfc is the forced convection heat transfer coefficient (W/m2 K). In addition, considering the fuel cell bipolar plate size and the number of cells in one stack, the heat exchanges due to the natural convection and radiation is be considered Q̇nc r = hnc r Sext (Tamb − Tsolid ) (20) where hnc r is the combined natural convection and radiation heat transfer coefficients (W/m2 K), Sext is the external area of the bipolar plate (m2 ), and Tamb is the external temperature (K). The convective mass transport brings an additional heat flow into each layer (q̇fluid Cp,fluid ) (Tfluid − Tlayer ) . (21) Qm ass = fluid When the fuel cell stack produces electricity from the electrochemical reactions, the heat is also generated at the same time. The main heat sources in the fuel cell are due to the irreversible losses in the electrochemical reaction and the resistive losses from the membrane resistance. The main irreversible losses occur in the cathode catalyst layer: the entropy changes in the reaction and the activation losses. These losses can be calculated as follows: T ΔS + i · Vact Q̇src 1 = −i · 2F activation entropy change where ΔS is the entropy change (J/mol). (22) GAO et al.: PEM FUEL CELL STACK MODELING FOR REAL-TIME EMULATION IN HARDWARE-IN-THE-LOOP APPLICATIONS Fig. 1. Fig. 2. Cathode air compressor outlet flow rate with fitting curve. The fuel cell internal resistance is generally due to the polymer membrane resistance. Another heat source due to the resistive losses can be obtained according to the Joule’s Law Q̇src 2 = i2 · Rm em . 187 Cooling fan speed at different stack temperatures. TABLE II COOLING FAN SPEED AND STACK TEMPERATURE (23) D. Fuel Cell Stack Model The model is set and validated for an air cooled 1.2 kW 47 cells Ballard Nexa stack supplied by compressed air and pure hydrogen. The entire fuel cell stack is modeled by stacking N single-cell models together. Every single-cell model in the stack has the same physical model equations as presented earlier, but has different boundary conditions. The boundary conditions of cell k are obtained from the adjacent cells (k − 1 and k + 1). E. Fuel Cell Auxiliaries Model In addition to the fuel cell stack itself, the vision Ballard Nexa stack system needs some other auxiliary components, such as electronic control broad, air compressor, and cooling fan. In order to model the entire fuel cell stack system, the models of these components are needed. From the experimental data, the air compressor and cooling fan empirical mathematic model can be obtained. 1) Air Compressor Empirical Model: In order to keep the air stoichiometry, the air compressor outlet flow rate (inlet of the cathode channels) of the Ballard Nexa fuel cell system depends directly on the stack current. The relation between the stack current and the cathode air flow rate is obtained by experimentation as presented in Fig. 1. From experimental data, the relationship between the stack current and the cathode air inlet flow rate can be approximated by an empirical fourth-order polynomial equation Nair inlet = 6.04 × 10−5 · i4 − 4.71 × 10−3 · i3 + 9.65 × 10−2 · i2 + 1.05 × i + 16.1 (24) where Nair inlet is the air inlet flow rate (slpm) in the cathode channels. 2) Cooling System Empirical Model: The Ballard Nexa fuel cell system is cooled by a controlled cooling fan. The relation- ship between the fuel cell stack temperature and fan speed is shown in Fig. 2. From the experimental measurement, it can be clearly concluded that the fan speed control is divided into a constant speed zone (straight lines at the bottom) and regulated zone (the curve at high temperature), depending on the stack temperature, as shown in Table II. According to the manufacture datasheet, the Ballard Nexa stack cooling fan maximum flow rate is about 3600 slpm. From the experimental data, the empirical air cooling fan model of the Ballard Nexa fuel cell system can be then obtained. F. Fuel Cell Dynamic Phenomena Analysis In a fuel cell stack, different dynamic phenomena exist in electrical, fluidic, and thermal domains, as described in the previous section. In electrical domain, the dynamic is due to the double layer capacitance at the catalyst interface. In the fluidic domain, the dynamic is due to the channels volume and the water balance through the cathode and the anode. In the thermal domain, the dynamic is due to the heat generation and heat capacity of material. Each dynamic of each domain expression can be approximated by a first-order system. Thus, from the equation analysis, the “time constant” expression of each dynamic phenomenon can be obtained. It should be noticed that the transient time of a first-order system is about four times its time constant. 188 IEEE TRANSACTIONS ON ENERGY CONVERSION, VOL. 26, NO. 1, MARCH 2011 1) Electrical Dynamics (Double Layer Capacitance): From the electrical dynamic (3)–(5), the time-constant expression in the fuel cell electrical domain is the following: i Cdl RT ln τelectrical = . (25) αn F i j0 S In the Ballard Nexa 1.2 kW fuel cell stack, the double layer capacitance of the single cell is measured using experimental method. The value of this capacitance is about 150 F/m2 . From the Ballard Nexa fuel cell stack characteristic data given in [16], the electrical time constant in the Ballard Nexa fuel cell stack is found to be around 0.16 s. 2) Fluidic Dynamics (Gas Channels Dynamics): The first kind of dynamics in the fluidic domain are due to the channels gas volume. The cooling, cathode, and anode channels pressure time constant in the fluidic domain can be obtained from (7)–(11) [16]: τfluidic channels = 32L2 μgas . 2 Dhydro Pch (26) In the Ballard Nexa 1.2 kW fuel cell stack, from the fuel cell gas supply channels geometry and gas property [16], the cooling channels pressure time constant is found to be around 8.14 μs, the cathode channels pressure time constant is about 6.92 ms and the anode channels pressure time constant is about 25.1 ms. The anode time constant is much bigger than the cathode side, because the anode supply channels are longer in the Ballard Nexa system. 3) Fluidic Dynamics (Membrane Water Diffusion): The second kind of dynamics in the fluidic domain are due to the membrane water diffusion [see (13)–(16)] and water vapor partial pressure balance in the cathode and anode channels. This membrane water diffusion dynamic time constant in fluidic domain can be calculated according to the following equation: τfluidic = where Csrc = 0.011δm em i2 iΔS + . 2F (0.5193λ − 0.326) S In the Ballard Nexa 1.2 kW fuel cell stack, from the fuel cell stack properties data given in [16], the fuel cell temperature dynamic time constant can be estimated to be between 37.15 and 124.3 s. Thus, the cell temperature transients can last about 497 s (8 min and 17 s). 5) Discussions: From the previous dynamic analysis, the Ballard Nexa 1.2 kW fuel cell stack dynamic phenomena can be summarized in Table III. It can be concluded that the thermal transient in the fuel cell is the most significant dynamic. The water diffusion through the membrane can be relatively fast or slow, because the water flux in the membrane depends on several variable physical quantities, such as membrane water content, stack current, cathode vapor pressure, and anode vapor pressure. But none of the electrical and fluidic dynamic transients last more than 1 s. Thus, from the point of view of a long-term model-based fuel cell simulation, the thermal dynamic phenomena is the most important because the thermal dynamic transient time is much bigger than those in the electrical and fluidic domains. III. FUEL CELL STACK EMULATOR DESIGN m em Psat Vano de 9.5955 · R T (Dλ ρdry S/δm em Mn ) + (nsat i/44 F ) (27) where Psat is the water saturation pressure (Pa). In the Ballard Nexa 1.2 kW fuel cell stack, assuming the nominal operating temperature 338.15 K, a maximum stack current of 40 A, the membrane properties given in [16] and the membrane water content, the membrane water dynamic time constant can be approximated between 0.0082 and 0.12 s. 4) Thermal Dynamics (Stack Thermal Capacities): The thermal dynamics in the fuel cell are mostly due to the material thermal capacity and different heat fluxes, as mentioned in (17)–(23). From these equations, the cell level temperature time constant in the thermal domain can be obtained τtherm al = TABLE III DIFFERENT DYNAMIC TRANSIENT TIMES IN BALLARD NEXA SYSTEM ρcell Vcell Cp hfc Scontact + hnc r Sext +Csrc (28) Based on the real-time model simulation, the design of a fuel cell emulator is introduced hereafter. The fuel cell stack voltage is emulated by a classical controlled dc/dc buck converter connected to the proposed multiphysical fuel cell system model. A. Real-Time Model Implementation The governing physical equations presented in the previous section of fuel cell modeling can describe the fuel cell phenomena in different physical domains. However, these equations cannot be used directly for real-time simulation purpose in their present form. An appropriate equation arrangement and a suitable solution algorithm should be considered for program implementation. For the portability and compatibility reason, the presented model is decided to be coded in C-language-based S-function for MATLAB/Simulink environment. In order to use a generic ordinary differential equations system solver algorithm (ODE solver), the model should be rearranged to a well-known GAO et al.: PEM FUEL CELL STACK MODELING FOR REAL-TIME EMULATION IN HARDWARE-IN-THE-LOOP APPLICATIONS nonlinear state-space representation as follows: ẋ = A(x, u) · x + B(x, u) · u y = C(x, u) · x + D(x, u) · u 189 (29) where x is the model dynamic state-variable vector, ẋ is the time derivative of state vector x, u is the input variable vector of model, y is the output vector of model, and A, B, C, and D are the nonlinear coefficients matrix obtained from the proposed physical equations in nonlinear model. The state vector of present model contains all dynamic variables in each cell (please refer to dynamic equations in modeling section), which can be described in (30). ⎫ ⎞ ⎛ Vact ⎪ ⎪ ⎟ ⎪ ⎜ Pch (O2 , H2 , H2 O) ⎪ ⎪ ⎟ ⎬ ⎜ ··· ⎟ ⎜ states of cell 1 ⎟ ⎜ ⎟ ⎜ Tcv (channels, GDL, ⎪ ⎪ ⎟ ⎜ ⎪ x = ⎜ catalyst, membrane) ⎪ ⎟ . (30) ⎪ ⎭ ⎟ ⎜ ··· ⎟ ⎜ ⎜ ··· } states of cell 2 ⎟ ⎟ ⎜ ⎠ ⎝ ··· ··· } states of last cell Each cell in stack has the same state-variable structure with different numerical values, because the physical equations that describe each cell are the same, but the boundary conditions of each cell are different. Thus, the derivative state vector ẋ can be expressed as follows: ⎫ ⎛ ⎞ dVact /dt ⎪ ⎪ ⎜ dPch /dt ⎪ ⎟ ⎬ ⎜ ⎟ derivative states of cell 1 ⎟ ... ⎜ ⎜ ⎟ ⎪ ⎜ dTcv /dt ⎪ ⎟ ⎪ ⎭ ẋ = ⎜ ⎟ . (31) ... ⎜ ⎟ ⎜ ··· } derivative states of cell 2 ⎟ ⎜ ⎟ ⎝ ⎠ ··· ··· } derivative states of last cell The model input vector describes the external boundary conditions applied to the fuel cell stack model in different physical domains. These boundary conditions can be described as follows: ⎛ ⎞ istack ⎜ q̇O 2 ⎟ ⎜ ⎟ ⎜ PH 2 ⎟ ⎜ ⎟ u = ⎜ PH 2 O ⎟ . (32) ⎜ ⎟ ⎜ q̇co oling ⎟ ⎝ ⎠ Pamb Tamb And at last, the output vector y contains all the desired fuel cell variables (dynamic or static) for further use at outside of simulation. An example of y can be seen in the following: ⎛ ⎞ Vcell ⎜ Rm em ⎟ ⎜ ⎟ ⎜ Pch ⎟ ⎜ ⎟ y = ⎜ q̇H 2 O,net ⎟ . (33) ⎜ ⎟ ⎜ Tcatho de ⎟ ⎝ ⎠ Tano de Tm em Fig. 3. Real-time fuel cell model current solving algorithm. The correspond nonlinear matrix A, B, C, and D can be then obtained using the formula of the physical equations presented in modeling section. These vectors in (29) is coded using C-language specific 1-D and 2-D table structure. The nonlinear mathematical operations are done by C-based mathematical library. Once the model structure is generalized, an appropriate ODE solver algorithm should be applied for the current model, in order to resolve this complex differential equations system. For the nonlinear model stability consideration, an implicit solver, which is proposed by MATLAB/Simulink environment, is used to resolve numerically and iteratively the presented statespace fuel cell stack model. The solver flow diagram for the current real-time model is presented in the Fig. 3. This proposed solver algorithm with the previous state-space model codes are then implemented in a commercial Opal-RT QNX-based real-time processor board via the real-time workshop interface.The Opal-RT system provides also a digital control area network (CAN) bus communication board. The values of output vector y from the model is sent to CAN communication driver at each time step, these values are then sent to the CAN bus of fuel cell emulator that will be described in the following section. The 2.8-GHz processor embedded in the Opal-RT system gives the real-time computation capacity for the current complex mathematical fuel cell stack model. B. Emulator Structure With Digital Communication Bus The actual fuel cell emulator structure is given in Fig. 4. 190 IEEE TRANSACTIONS ON ENERGY CONVERSION, VOL. 26, NO. 1, MARCH 2011 Fig. 5. Fig. 4. Fuel cell emulator structure. The fuel cell stack model communicates with the dc/dc buck power converter via a digital CAN bus. A 150-MHz DSP is used as a gateway between CAN message and converter driver, this DSP is used also as converter controller (see Section III-E for more details). The converter is connected to an active load. The actual current value in the load is measured by a current sensor connected at the output of the power converter. The measured current value is then sent to the CAN bus and to the real-time model to compute the corresponding voltage reference. With the given load current, the corresponding fuel cell stack output voltage is computed by the fuel cell model and its value is sent back to the dc/dc converter. Then, the embedded controller regulates the converter voltage to meet the desired voltage output. The gate driver/insulated gate bipolar transistor (IGBT) for this converter is an available commercial Semikron unit. The gate driver is matched to the transistor. The converter design for optimization of switching losses, or anything related to the gate driver is not considered in this paper, because this paper deals with the low-frequency bandwidth of the fuel cell transient response and gate driver/transistor switching is subject of circuit design, which is considered to be properly done by the manufacturers. It has to be noted that, all the model predicted quantities (electrical, fluidic, and thermal) are sent to the CAN bus continuously, despite they are required by the emulator or not (e.g., in the actual emulator, only the stack voltage value is required for the dc/dc converter). These state variables, such as individual cell temperatures or membrane water content, which can be got from the CAN bus, can be used in the fuel cell stack supervision interface. C. Buck Converter Design for the Emulator Power Interface A typical dc/dc buck converter is used to control the power of the fuel cell emulator, as shown in Fig. 5. As discussed in the previous sections, the thermal dynamic is the most important dynamic behavior. The temperature transients can last some minutes, which is much longer than others dynamics. Thus, for a fuel cell stack emulation, the thermal dynamics should be able to be reproduced by the dc/dc converter. DC/DC buck converter diagram. The power output of the designed converter is set to 1.2 kW with a voltage ranging from 20 to 50 V and a current between 1 and 50 A. Even all other kind of dynamics can be well predicted by the real-time model, the voltage dynamics due to transient phenomena below 100 ms cannot be easily reproduced by a conventional buck converter with a 10-kHz pulsewidth modulation (PWM) and a maximum voltage ripple requirement of about 1% [19]. Thus, only phenomena with dynamic transient times larger than 100 ms have been considered. It means that the converter has to be able to answer ten times faster than the reference voltage variations caused by fuel cell transient, i.e., in less than 10 ms (cutoff frequency larger than 100 Hz). D. Converter L and C Conditioning 1) Converter Inductance: The converter inductance value is calculated from the converter minimum current, in order to ensure that the converter is always working in continuousconduction mode (CCM). CCM is required for a linear operation of the converter, and the minimum current is guaranteed by the auxiliary power required to run a fuel cell. In order to match the fuel cell stack voltage range, the expected converter output voltage is between 20 and 50 V. Thus, the expected duty cycle range of IGBT is between 30% and 80%. In order to calculate the values of the output filter (inductance and capacitance) for the buck converter, the PWM period time TPW M (s), the converter supply voltage Vd (V), and the converter minimum current Im in (A) are required. Knowing these values, the minimum value of inductance can be obtained [19] L> 10−4 × 60 TPW M Vd = 0.75 × 10−3 (H). = 8Im in 8×1 (34) Thus, L = 1 mH is chosen for the converter. 2) Converter Capacitance: The converter capacitance value should be chosen to meet the converter dynamic response needs. With the fixed inductance value L (H) and the converter minimum cutoff frequency fc,m in (Hz), the maximum value of the converter capacitance can be obtained 2 2 1 1 √ √ = C 2πfc,m in L 2π × 100 × 10−3 = 2533 × 10−6 (F). (35) On the other hand, the capacitance is also used to filter the converter output voltage ripple. Generally, the dc/dc converter GAO et al.: PEM FUEL CELL STACK MODELING FOR REAL-TIME EMULATION IN HARDWARE-IN-THE-LOOP APPLICATIONS 191 output voltage ripple should be less than 1% of the output voltage ΔVO m ax 1% · VO (m in) = 0.01 × 20 = 0.2(V). (36) Thus, the minimum capacitance value can be obtained [19] C> = 2 VO (m ax) TPW M 8LΔVO m ax 50 × 10−8 = 312.5 × 10−6 (F). 8 × 10−3 × 0.2 (37) From (35) and (37), C = 680 μF is chosen for converter. E. Buck Converter Real-Time Control Implementation The buck converter (IGBT switch) is controlled by a classic proportional integral (PI) closed loop with an antiwindup feedback. The PI loop controls the converter voltage output from the reference voltage calculated by the multiphysical model. The controller is embedded in a 150-MHz DSP board. The same DSP is used also as a gateway of the CAN bus and the power converter. The DSP receives the desired voltage value from the model via the CAN bus, computes the corresponding duty cycle value, and then, generates the PWM output for the driver of the converter. The inductance and capacitance values were chosen to match the dynamics of the fuel cell response, based on experimental evaluation of a fuel cell transient response, as discussed in previous section. The PI controllers were fine tuned and debugged using the real-time prototyping interface of dSpace, and extensive experimentation confirmed the stability and optimized response. More detail in this subject can be found in [20]. The controller parameters Kp , Ki , and Kt (antiwindup) are adjusted during experimentation using the experimental Ziegler–Nichols tuning rule [21]. It should be noted that the converter conditioning and design are not the major concern of this paper. For further reading, a more analytically and detailed fuel cell-related power converter design can be found in a recent paper [22]. IV. EXPERIMENTAL RESULTS AND DISCUSSIONS Fig. 6. Experimental setup for the fuel cell stack model validation. Fig. 7. Experimental setup (designed emulator, load, and power supply). A. Experimental Setup The experimental platform of Ballard Nexa stack is presented in Fig. 6. The Ballard Nexa stack is a ultra compact fuel cell system that has 47 individual cells connected in series. The embedded control board communicates via RS232 with the supervision software provided by Ballard. This software can provide some important stack parameters during the stack operation, such as stack current, stack voltage, cathode temperature, gas pressure, fan speed, etc. In addition to this supervision software, two supplementary experimental devices were added in this test platform. First, a National Instrument 60 channels differential voltage measurement DAQmx system is implemented on the stack to measure the individual cells voltage. The measured voltages data are collected and treated in a Labview environment. Second, a professional forward looking infrared (FLIR) infrared camera is set on the top of the stack to measure the individual cells temperature. This camera capture infrared images of the stack every second during the stack operation. These images can be then treated by a dedicated FLIR software to extract the temperature of predefined measurement points. The synchronization between the Ballard software, the Labview environment, and the FLIR camera is done by the synchronized real-time clock in each device. The stack is connected to an electronic load. The load is running under current control mode. Different current profiles are set by the load, this profiles can be applied automatically to the stack during operation. The photograph of the experimental emulator setup is shown in Fig. 7. The CAN bus-based supervision interface can record the data sent by the model or measured on the power converter. 192 IEEE TRANSACTIONS ON ENERGY CONVERSION, VOL. 26, NO. 1, MARCH 2011 Fig. 8. Stack current profile. Fig. 9. Stack voltage responses. The same electronic load is connected to the emulator for the emulator tests. The load reproduces exactly the same prerecorded current profiles than the ones used in the real-stack tests. Thus, the emulator can be compared to the real stack using exactly the same current profiles. B. Results and Discussions The model and the emulator have been validated temporally and experimentally with the Ballard Nexa 1.2 kW 47 cells fuel cell stack system. The test stack current profile of about 900 s is shown in Fig. 8. This profile, covering currents from 5 to 35 A, is also applied to the proposed multiphysical fuel cell stack model for model validations. Based on the stack current, the model fuel cell stack voltage value is then used by the buck converter controller in order to emulate the real-stack power output characteristics. The real-stack voltage, the predicted stack voltage by the model and the emulator converter output voltage are shown and compared in Fig. 9. From Fig. 9, it can be concluded that the model prediction is very close to the experimental measurement. The max prediction error is less than 1.2 V, which gives less than Fig. 10. Zoom-in at 50s: stack voltage (model, real stack, and emulator). Fig. 11. Individual cell voltages at 230 s. 4% of relative error. It can be also found that the emulator output voltage based on the model prediction is very close to the model predicted one over the whole current range. A zoom-in at about 50 s (first transient) for these three curves is given in Fig. 10 in order to give a clearer comparison. In addition to the real-stack electrical power output emulation with the dc/dc converter, the model itself can predict much more fuel cell state variables then the stack voltage. Beside the model temporal prediction, the spatial distribution of the fuel cell stack physicals can be also obtained from the proposed model. Fig. 11 shows the stack individual cell voltages prediction at 230 s. The predicted value have a good accuracy compared to experimental data. In the thermal domain, the measured temperatures of individual cells are compared to the model predicted ones, as shown in Fig. 12(a) and (b). The stack spatial and temporal evolution is well reproduced by the model. The slight differences between the simulation and the experimentation are due to the measurement method: the measured cell temperature is the single-cell bipolar plate surface temperature, but in the model, the temperature is the single-cell average temperature. The given model is a 1-D fuel cell model; thus, the nonuniform temperature distribution is not considered in the other two axes. GAO et al.: PEM FUEL CELL STACK MODELING FOR REAL-TIME EMULATION IN HARDWARE-IN-THE-LOOP APPLICATIONS Fig. 12. Fig. 13. 193 Cell temperature evolution. (a) Measured cell temperatures evolution. (b) Simulated cell temperatures evolution. Cathode air outlet temperature. A more accurate model validation in the thermal domain is given in Fig. 13. The measured cathode air outlet temperature is compared to the model result. It can be concluded that the thermal transient behavior is accurately predicted by the model. V. CONCLUSION In this paper, a dynamic multiphysical fuel cell stack model is presented. The model emcompasses electrical, fluidic, and thermal domains. The modeling approach has been validated against a Ballard Nexa 1.2 kW fuel cell system. Based on experimental data, the system auxiliaries empirical models, such as cathode air compressor and cooling system, is also introduced. The model is developed for real-time simulation purposes in HiL applications. A cross-domain fuel cell dynamic behavior analysis is presented and the dynamic time-constant analytical expressions are given. The results show that in the fuel cell stack, the thermal dynamics are the most significant ones. Based on the real-time model and dynamic behavior analysis, a novel fuel cell emulator structure with a CAN communication bus is proposed. The fuel cell stack power output is emulated using a dc/dc buck converter. The converter is designed to meet the real-fuel cell dynamic responses. However, due to the power converter switching frequency and the error requirements, the dynamics that have a transient time less than 100 ms are, therefore, not taken into account for the final fuel cell emulator power output, because these dynamics are difficult to be reproduced by a conventional power converter. It should be noted that these dynamics are relatively short compared to the significant thermal dynamic effect for long-time period. According to the results in Table III, if all the dynamic effects in a fuel cell would be reproduced by the emulator, the power converter should be able to respond in 1 μs with a good accuracy (1 MHz) from low power up to some kilowatts. A typical conventional converter cannot achieve this goal. For future improvements, a new converter with nonlinear control method should be considered and tested. The model results show a great accuracy with experimental measurements in different domains and the real-time model itself can predict nonmeasurable physical quantities during the fuel cell operation. The emulator power output has also been validated for a real-stack data with a very good agreement. Such an emulator is of great interest for real-time HiL applications and it is envisioned that this emulator can contribute for real experiments, studies, and design with realistic results without a fuel cell stack and all the required installations and auxiliaries required for a fuel cell to operate. REFERENCES [1] Blunier, A. Miraoui, Pile Combustible (French). Paris: Ellipses, 2007. [2] S. Pasricha and S. Shaw, “A dynamic pem fuel cell model,” IEEE Trans. Energy Convers., vol. 21, no. 2, pp. 484–490, Jun. 2006. [3] N. Souleman, O. Tremblay, and L.-A. Dessaint, “A generic fuel cell model for the simulation of fuel cell power systems,” in Proc. IEEE Power Energy Soc. Gen. Meeting, Jul. 2009, pp. 1–8. [4] K. Stanton and J.-S. Lai, “A thermally dependent fuel cell model for power electronics design,” in Proc. IEEE 36th Power Electron. Spec. Conf., Jun. 2005, pp. 1647–1651. 194 IEEE TRANSACTIONS ON ENERGY CONVERSION, VOL. 26, NO. 1, MARCH 2011 [5] F. Grasser and A. Rufer, “An analytical, control-oriented state space model for a pem fuel cell system,” in Proc. Power Convers. Conf., Nagoya, Apr. 2007, pp. 441–447. [6] S. Pasricha, M. Keppler, S. Shaw, and M. Nehrir, “Comparison and identification of static electrical terminal fuel cell models,” IEEE Trans. Energy Convers., vol. 22, no. 3, pp. 746–754, Sep. 2007. [7] W. Friede, S. Raël, and B. Davat, “Mathematical model and characterization of the transient behavior of a PEM fuel cell,” IEEE Trans. Power Electron., vol. 19, no. 5, pp. 1234–1241, Sep. 2004. [8] J. Correa, F. Farret, V. Popov, and M. Simoes, “Sensitivity analysis of the modeling parameters used in simulation of proton exchange membrane fuel cells,” IEEE Trans. Energy Convers., vol. 20, no. 1, pp. 211–218, Mar. 2005. [9] M. Hatti, M. Tioursi, and W. Nouibat, “Static modelling by neural networks of a pem fuel cell,” in Proc. IEEE 32nd Annu. Conf. Ind. Electron., Nov. 2006, pp. 2121–2126. [10] P. Acharya, P. Enjeti, and I. Pitel, “An advanced fuel cell simulator,” in Proc. APEC 2004, vol. 3, pp. 1554–1558. [11] J. M. Corrêa, F. A. Farret, J. R. Gomes, and M. G. Simões, “Simulation of fuel-cell stacks using a computer-controlled power rectifier with the purposes of actual high-power injection applications,” IEEE Trans. Ind. Appl., vol. 39, no. 4, pp. 1136–1142, Jul./Aug. 2003. [12] M. Ordonez, M. Iqbal, and J. Quaicoe, “Development of a fuel cell simulator based on an experimentally derived model,” in Proc. Can. Conf. Electr. Comput. Eng., May 2005, pp. 1449–1452. [13] T.-W. Lee, S.-H. Kim, Y.-H. Yoon, S.-J. Jang, and C.-Y. Won, “A 3 kw fuel cell generation system using the fuel cell simulator,” in Proc. IEEE Int. Symp. Ind. Electron., May 2004, vol. 2, pp. 833–837. [14] N. Parker-Allotey, A. Bryant, and P. Palmer, “The application of fuel cell emulation in the design of an electric vehicle powertrain,” in Proc. IEEE 36th Power Electron. Spec. Conf., Jun. 2005, pp. 1869–1874. [15] G. Marsala, M. Pucci, G. Vitale, M. Cirrincione, and A. Miraoui, “A prototype of a fuel cell PEM emulator based on a buck converter,” Appl. Energy, vol. 86, pp. 2192–2203, Oct. 2009. [16] F. Gao, B. Blunier, A. Miraoui, and A. E. moudni, “Cell layer level generalized dynamic modeling of a PEMFC stack using VHDL-AMS language,” Int. J. Hydrogen Energy, vol. 34, no. 13, pp. 5498–5521, 2009. [17] F. Gao, B. Blunier, A. Miraoui, and A. El Moudni, “A multiphysic dynamic 1-d model of a proton-exchange-membrane fuel-cell stack for real-time simulation,” IEEE Trans. Ind. Electron., vol. 57, no. 6, pp. 1853–1864, Jun. 2010. [18] T. Springer, T. Zawodzinski, and S. Gottesfeld, “Polymer electrolyte fuel cell model,” J. Electrochem. Soc., vol. 138, no. 8, p. 2334-2342, 1991. [19] N. Mohan, T. M. Undeland, and W. P. Robbins, Power Electronics: Converters, Applications, and Design, 3rd ed. New York: Wiley, 2002. [20] F. Gao, B. Blunier, D. Bouquain, A. Miraoui, and A. E. moudni, “Polymer electrolyte fuel cell stack emulator for automotive hardware-in-the-loop applications,” in Proc. IEEE Veh. Power Propulsion Conf., Sep. 7–11, 2009, pp. 998–1004. [21] K. Åström, T. Hägglund, C. Hang, and W. Ho, “Automatic tuning and adaptation for PID controllers-a survey,” Control Eng. Pract., vol. 1, no. 4, pp. 699–714, 1993. [22] J. J. Cooley, E. Seger, S. Leeb, and S. R. Shaw, “Characterization of a 5 kw solid oxide fuel cell stack using power electronic excitation,” in Proc. 25th Ann. Appl. Power Electron. Conf. Expo., 2010, pp. 2264–2274. Benjamin Blunier (S’07–M’08) received the M.S. and M.Sc. degrees in electrical and control system engineering from the University of Technology of Belfort-Monbteliard (UTBM), Belfort, France, in 2004. Since 2008, he has been an Assistant Professor at UTBM, where he is currently a Researcher and a Teacher. He is the author of the first textbook in French Fuel Cells : Pile à Combustible : Principes, Technologies Modélisation et Application (France: Ellipses-Technosup, 2007). His research interests include electric and hybrid vehicles, fuel cells, and especially on their modeling and air management. Fei Gao (S’09) was born in Beijing, China, in 1983. He received the M.Sc. degree in electrical and control system engineering from the University of Technology of Belfort-Montbeliard, Belfort, France, in 2007, where he is currently working toward the Ph.D. degree in electrical engineering. His current research interests include fuel cells, system modeling, and hardware-in-the-loop applications. Marcelo Godoy Simões (S’89–M’95–SM’98) received the B.S. and M.Sc. degrees in electrical engineering from the University of Sao Paulo, Sao Paulo, Brazil, in 1985 and 1990, respectively, the Ph.D. degree in electrical engineering from the University of Tennessee, Knoxville, TN, in 1995, and the LivreDoclncia (D.Sc.) degree in mechanical engineering from the University of Sao Paulo, in 1998. He is currently an Assistant Professor with the Power Electronics Laboratory, Engineering Division, Colorado School of Mines, Golden, CO, where he has been engaged in establishing research and education activities in the development of intelligent control for high-power-electronics applications in renewable and distributed energy systems. He is the Director of the Advanced Control of Energy Power System Research Center, Colorado, and a Visiting Professor with the Universit de Technologie de Belfort-Montbliard, Belfort, France. He has authored or coauthored more than 50 journal papers and 100 conference papers in his academic career. He is the author of the books Alternative Energy Systems: Design and Analysis With Induction Generators (Boca Raton, FL: CRC Press, 2005) and Integration of Alternative Sources of Energy (Piscataway, NJ: Wiley/IEEE Press, 2007). Dr. Simões was the recipient of a National Science Foundation (NSF) Faculty Early Career Development in 2002, the NSFs most prestigious award for new faculty members. He has organized several IEEE activities (Power Electronics Specialists Conference 2005, Power Electronics Education Workshop 2005, and Future Energy Challenge), and also organized and founded the IEEE Power Electronics Denver Chapter. He has been engaged with IEEE in several capacities. He is currently an Associate Editor of the IEEE TRANSACTIONS ON POWER ELECTRONICS, Chair for the IEEE Industry Applications Society (IAS) Industrial Automation and Control Committee, and Vice-Chair for the IAS Manufacturing Systems Development and Applications Department, and also participates in the new Intelligent Grid Technical Committee of the IEEE Industrial Electronics Society. Abdellatif Miraoui (M’07–SM’09) was born in Morocco, in 1962. He received the M.Sc. degree from Haute Alsace University, Cedex, France, in 1988, and the Ph.D. degree and the Habilitation to Supervise Researches from Franche-Comte University, Besancon, France in 1992 and 1999, respectively. Since 2000, he has been a Professor of electrical engineering at University of Technology of BelfortMontbeliard (UTBM), Belfort, France, where he has been the Director of the Electrical Engineering Department since 2001 and Vice-President of Research Affairs since 2008. He is also the Head of “Energy Conversion and Command” Research Team and the editor of the International Journal on Electrical Engineering Transportation. His research interests include fuel cell energy, integration of ultra capacitor in transportation, design and optimization of permanent magnet machines, and electrical propulsion/traction. Dr. Miraoui is a member of IEEE Power Electronics Society, Industrial Electronics Society, and IEEE Vehicular Technology Society.