Fuzzy logic based control of power of PEM fuel cell system for residential application
Khaled MAMMAR^{1}, Abdelkader CHAKER^{2}
^{1}Departement of Electrical Engineering, Université of Bechar ,
Bp 417, Bechar, Algeria
^{2}Department of Comuters and Informatics, Faculty of Electrical Engineering and Informatics,
^{2}Laboratory of Electrical network, E.N.S.E.T,
E.N.S.E.T, B.P 1742 El M'naouar, Oran, Algeria.
Emails: mammar.univ.dz@gmail.com, chaker@ecole.ensetoran.dz
Abstract
This paper presents a dynamic model of Fuel cell system for residential power generation. The models proposed include a fuel cell stack model, reformer model and DC/AC inverter model. Furthermore a fuzzy logic (FLC) controller is used to control active power of PEM fuel cell system. The controller modifies the hydrogen flow feedback from the terminal load. Simulation results confirmed the high performance capability of the fuzzy logic controller to control power generation.
Keywords
Polymerelectrolyte fuel cell, Dynamic model; Residential power; Fuzzy controller
Introduction
Proton in exchange membrane (PEM) fuel cells is one of the promising technologies for alternative power source of residential power generation in future. However, a fuel cell system is large, complex and expensive Designing and building prototypes is difficult and expensive. The alternative is modelling the fuel cell system for the simulation. The modelling of fuel cell is very important for power system, because it facilitates the understanding of the involved phenomena. Many models have been proposed to simulate fuel cells in the literature [1][6], which have generally each the own specificities and utilities, following the studied phenomena.
The model proposed in this paper includes the electrochemical and fluid dynamic aspects of chemical reactions inside the fuelcell stack. Furthermore, voltage losses due to ohmic, activation, and concentration losses are accounted for. Therefore, this dynamic PEMFC model complements existing models such as the ones developed in [5], [6]. The model is suitable for power generation. To study the transient response of a gridindependent PEM fuel cell power plant, this paper proposes to an electrochemical model for a 30 kW fuel cell, which incorporates an external reformer to generate hydrogen from methane.
Fuel cells are dc voltage sources connected to electric power load through DC/AC inverters. A method to connect the Proposed PEMFC model to a gridindependent through an interface block is presented. The fuelcell model, an external reformer and its interface block are implemented in MATLAB and incorporated with a power control analysis package.
Finally, a fuzzy logic based controller is designed for this purposes because of the numerous advantages it has high performance. Over the other types of controllers, the most important aspect being, the cost of the controller design and implementation. The proposed controller modify hydrogen flow for controlling active power to the load change
Hydrogen PEM fuel cells transform chemical energy into electrical and thermal energy by the simple chemical reaction [1],[2],[3]
H_{2} + 1/2 O_{2} _{}H_{2}O + heat + electrical energy (1)
In order to get an electric current out of this reaction, hydrogen oxidation and oxygen reduction are separated by a membrane, which is conducting protons from the anode to the cathode side. The semi reactions on both electrodes are
H_{2} _{} 2 H^{+} + 2 eanode
O_{2} + 4 e^{} _{} 2 O^{2}cathode (2)
While the protons are transported through the membrane, electrons are carried by an electric circuit in which their energy can be used. Modelling of fuel cells is getting more and more important as powerful fuel cell stacks are getting available and have to be integrated into power systems. In [5],[6]and [6] Jeferson M. Corrêa introduced a model for the PEMFC . The model is based on simulating the relationship between output voltage and partial pressure of hydrogen, oxygen, and currant.
The output voltage of a single cell can be defined as the result of the following expression [5], [6]:
_{} (3)
In (3), E_{Nenst} is the thermodynamic potential of the cell and its represents reversible voltage; V_{ac}_{t} is the voltage drop due to the activation of the anode and of the cathode; V_{ohm} is the ohmic voltage drop, a measure of the ohmic voltage drop associated with the conduction of the protons through the solid electrolyte and electrons through the internal electronic resistances; V_{conc} represents the voltage drop resulting from the concentration or mass transportation of the reacting gases [5]. The first term of (3) represents the FC open circuit voltage, while the three last terms represent reductions in this voltage to supply the useful voltage of the cell, , for a certain operating condition. Each one of the terms in (2) can be calculated by the following equations, using the parameters listed in Table I [6]:
The reversible voltage of the cell is calculated staring from a modified version of the equation of Nernst, with an extra term to take into account changes in the temperature with respect to the standard reference temperature, 30°C [5]
_{} (4)
where _{} is the change in the free Gibbs energy (J/mol); F is the constant of Faraday (96.487 C); _{} is the change ofthe entropy (J/mol); R is the universal constant of the gases (8.314 J/K mol); P_{H2} and P_{O2} while and are the partial pressures of hydrogen and oxygen (atm), respectively. ariable T denotes the cell operation temperature (K) and the T_{ref }reference temperature. Using the standard pressure and temperature (SPT) values for, _{} and _{} , (4) can be simplified to [5]
_{} (5)
As shown in [5], the activation over potential, including anode and cathode can be calculated by
_{} (6)
where I_{stack } is the cell operating current (A), and the ξ_{i} ’s represent parametric coefficients for each cell model, whose values are defined based on theoretical equations with kinetic, thermodynamic, and electrochemical foundations [5]. Co_{2} is the concentration of oxygen in the catalytic interface of the cathode mol/cm, determined by
_{}
The ohmic voltage drop results from the resistance to the electrons transfer through the collecting plates and carbon electrodes, and the resistance to the protons transfer through the solid membrane. In this model, a general expression for resistance is defined to include all the important parameters of the membrane.
_{} (7)
where R_{c }represents the resistance to the transfer of protons through the membrane, usually considered constant.
And.
_{}
ρ_{M} is the specific resistivity of the membrane for the electron flow ( cm), A is the cell active area cm and l is the thickness of the membrane (cm), which serves as the ectrolyte of the cell. The following numeric expression for the resistivity of the Nafion membranes is used [5]:
_{} (8)
where_{} the term is the specific resistivity (Ώ/ cm) at no current and at 30 C[5];
To determine an equation for this voltage drop, a maximum current density is defined, J_{max} under which the fuel is being used at the same rate of the maximum supply speed. The current density cannot surpass this limit because the fuel cannot be supplied at a larger rate. Typical values for are in the range of 500–1500 mA/cm .
Thus, the voltage drop due to the mass transport can be determined by
_{} (9)
Where B (V) is a parametric coefficient, which depends on the cell and its operation state, and J represents the actual current density of the cell (A/cm) .The static model of the PEM fuel cell is shown in Fig.1, and the parameter are given in Table 1.
Figure 1. PEMFC static model
Table 1. Model parameters [5],[6].
Parameters 
Values 
T 
343K 
A 
333 cm^{2} 
L 
178 μm 
B 
0.016 V 
R_{C} 
0.0003 Ω 
ζ_{1} 
0.948 
ζ_{2} 
0.00286+0.0002.lnA+(4.3.10^{5})lnC_{H2} 
ζ_{3} 
7.6.10^{5} 
ζ_{4} 
1.93.10^{4} 
Ψ 
23 
J_{max} 
1500 mA/cm^{2} 
J_{n} 
1.2 mA/cm^{2} 
Figure 2. A typical PEMFC cell voltage response surface .With simultaneous changes in the inlet partial pressure of hydrogen and current at a constant stack temperature of 70°
Figure 3. A typical PEMFC cell power response surface .With simultaneous changes in the inlet partial pressure of hydrogen and current at a constant stack temperature of 70°
Fuel Cell System Model
In [7], [8] and [9] Sharkh,Rahman,and Alam. introduced a model of PEMFuel cell system for residential power generation. This model has been modified to introduce a static model show in fig 1 the new model is shown in fig 4.
Fuel Cell Dynamic Model
This model is based on simulating the relationship between output voltage and partial pressure of hydrogen, oxygen, and current. A detailed model of the PEM fuel cell is shown in Fig. 4.
Figure 3. PEMFC dynamic model
The model parameters are as follows:
q_{H2}: input molar flow of hydrogen [kmol/s];
q_{O2}: input molar flow of oxygen [kmol/s];
P_{H2}: hydrogen partial pressure [atm];
Po_{2}: oxygen partial pressure [atm];
K _{H2} : hydrogen valve molar constant [kmol/(atm s)];
K _{O2} : oxygen valve molar constant [kmol/(atm s)];
N_{0 : }number of series fuel cells in the stack;
I_{stack}: stack current [A];
K_{r} : constant =_{} Kmol/ (s.A)
F : Farady constant 9684600 C/Kmol
Reformer Model
In [7] and [8] the authors introduced a simple model of a reformer that generates hydrogen through reforming methane. The model is a secondorder transfer function. The mathematical form of the model can be written as follows:
_{} (11)
Were CV: conversion factor [kmol of hydogen per kmol of methane];
q_{methane} methane flow rate [kmol/s];
τ _{1}τ_{2}: reformer time constants [s]
DC/AC inverter Model
In this paper, only a simple model of a DC/AC inverter is considered for the following reasons: the dynamic time constant of inverters is of the order of microseconds or at the most milliseconds. The time constants for the reformer and stack are of the order of seconds model of the inverter is given in [9], where output voltage and output power are controlled using the inverter modulation index and the phase angle of the AC voltage. Considering the fuel cell as a source, the inverter and load connection is shown in Fig. 5. The output voltage and the output power as a function of the modulation index and the phase angle can be written as
Figure 5. Fuel cell, Inverter and load connection diagram [9].
Figure 6. The DC/AC inverter model [9].
_{} (12)
_{} (13)
_{} (14)
_{} (15)
_{} (16)
Where the model parameter are as follows:
V_{ac }_{AC} output voltage of the inverter [V];
m: inverter modulation index;
δ :phase angle of the AC voltage [rad];
P_{ac}_{ AC} output power from the inverter [W];
Q_{ac}: reactive output power from the inverter [VAR];
V_{s} :load terminal voltage [V];
X: reactance of the line connecting the fuel cell to the load
I_{L }:load current [A];
θ :load phase angle [rad];
P :load power [W].
I_{stack} :stack current [A].
PI controllers are used to control the modulation index. The transfer function of the modulation index can be expressed as
_{} (17)
Where
K_{5},and K_{6}: are the PI gain, and V_{r} is the reference voltage signal. The block diagram of the inverter with the PI controllers is illustrated in Fig. 6
Assuming a lossless inverter, we get
_{} (18)
According to electrochemical relationships, a relationship between the stack current and the molar flow of hydrogen can be written as
_{} (19)
Were U is a utilization factor
From (13), (18 ) and (19)
_{} (20)
Assuming a small phase angle
_{} (21)
The equation (21) describes the relationship between output voltage phase angle and hydrogen flow . Equations (13) and (21) indicate that the active power as a function of the voltage phase angle can be controlled by controlling the amount of hydrogen flow.
The active power flow from the PEMFC to the load is controlled thought controlling the flow hydrogen. The proposed fuzzy logic controller controls the active power by controlling the hydrogen flow.
The fuzzy controller consists of five different steps (fig 7) [10], [11]
· definition of inputoutput variables of controller
· design of fuzzy control rule
· fuzzification
· inference
· defuzzification
The fuzzy controller inputs are the error e(k), and change of error ce(k). The output of the controller is the duty ratio of hydrogen flow u_{H2}(k). The error, change of error, and the output of the controller are given as follows:
_{} (22)
Were _{}is the flow hydrogen from the current feedback signal were is proportional to the terminal load fig (6), _{} is the methane reference signal and _{}is the hydrogen flow feedback signal.
_{} (23)
_{ }(24)
Were _{}is the inferred change of duty ratio by fuzzy controller and _{}is the gain factor of the controller [6], [7]
Figure 7. The block diagram of a fuzzy logic controller
Fig 8 shows the basic fuzzy partition of membership function for error, change of error, and change of control action. And fuzzy variables are expressed by linguistic variables such as” positive big (PB)” ,positive medium(PM)”,”zero(ZO)”,”negative medium(NM)” ,”negative big(NB)”. Table 2 shows the fuzzy model based on fuzzy rules[7].
Example fuzzy rules are:
· “ If e(k) is PM and ce(k) ZO then _{}is PM
· “ If e(k) is NB and ce(k) NM then _{}is NB
The inference method used is basic and simple; it is developed from the minimum operation function rule as a fuzzy implementing function. The membership function of e, ce and _{}are given by _{} , _{},_{}_{} .The commonly use MinMax method is given as:
_{} i=1…n (25)
_{} i=1…n (26)
The centroid defuzzification method determines the output value from center of gravity of the output membership function and is given by the expression.
_{} (27)
Based on table 2 and fig 8, the 3dimensinal representation of control input (_{}) for fuzzy variables (e, ce) is shown in fig 9.
Table 1: Linguistic control rule
CHANGE OF ERROR 

E R R O R 
U 
NB 
NM 
ZO 
PM 
PB 
NB 
NB 
NB 
NM 
NM 
ZO 

NM 
NB 
NM 
NM 
ZO 
PM 

ZO 
NM 
NM 
ZO 
PM 
PM 

PM 
NM 
ZO 
PM 
PM 
PB 

PB 
ZO 
PM 
PM 
PB 
PB 
Figure 8. Membership fonction for error (e), change (ce) and control (u)
Figure 9. The 3 dimensional representation of control input (_{}) for fuzzy variables (e,ce)
The model parameter are given in Table 3.The model of Fuel cell system for residential power generation and fuzzy logic block diagram shown in fig (10). It is tested with step change in the load as shown in fig (11) These abrupt changes in the active and reactive power are for testing the dynamic response of the system and do not necessarily represent change in residential load.
In a practical system, the response time of the reformer can be longer than tens second [11], [12]. Therefore the reformer controller parameters have significant effect on the active power control. In this simulation the fuzzy logic controller was able to modify hydrogen flow for controlling active power to the load change fig 12. The fuzzy logic controller is characterized by faster time response compared to the PID controllers used in fig 13.
Table 3 System parameters [8], [9].
Parameters 
Values 
Facteur de conversion CV 
2 
farady,s Constant, F 
9684600 C/Kmol 
Universal gas Constant R 
8314.47 j/Kmol.K 
Number of cells N_{0} 
333 
Hydrogen valve constant K_{H2} 
4.22*10^{5} Kmol/(s.A) 
Oxygen valve constant K_{O2} 
2.11*10^{5} Kmol/ (s.atm) 
Hydrogen time constant, _{} 
3.37 (s) 
Oxygen time constant, _{} 
6.74 (s) 
Utilization factor,U 
0.8 
PI gain constants K_{5},K_{6} 
10 
Hydrogen –Oxygen flow ratio r_{HO} 
1.168 
Methane reference signal, q_{ref} 
0.000015 Kmol/ s 
Reformer time constants τ_{1 , }τ_{2} 
2, 2 
Line reactance, X 
0.05Ω 
Voltage reference signal V_{r} 
240 V 
K_{r} constant =_{} 
0.996*10^{6} Kmol/ (s.A) 
Figure10. PEM fuel cell system and fuzzy logic block diagram
Figure11. Load step changes
Figure12. Active output power change (with fuzzy logic controller)
Figure13. Active output power change (with PID controller)
The change of the current is illustrated in fig 14. This change is very sensitive to variation of the active power load.
Figure14. current change
Figure 15 show the change of hydrogen flow. This change is similar to the change of active power
Figure15. Hydrogen flow rate change
The reactive power Qac follows immediately the change of the reactive power load. Because the reactive power is controlled directly from DC/AC inverter and the response of DC/AC inverter is not considerable fig 16
Figure16. Reactive output power change
The change of the output voltage phase angle and modulation index are illustrated in figures 15 and 16
Figure17. Output voltage phase angle change
We notice that, the reactive power value is superior to the reactive power. This is due to inductive effect losses of the line (x).
Figure18. Modulation index change
In this paper the fuel cell system model for residential generation is proposed. The proposed model includes a dynamic fuel cell model, a gas reformer model, DC/AC inverter model, and fuzzy logic controller unit block. Then the developed model is tested using computersimulated step change in the load active and reactive power demands. The simulation results indicate that converter and fuel quantities have to be controlled simultaneously to control the active and reactive power. It also indicate that the fuzzy logic controller is very effective to control hydrogen flow for active power load variation.
1. J. C. Amphlett, R. F. Mann, B. A. Peppley, P. R. Roberge, and A. Rodrigues: A model predicting transient responses of proton exchange membrane fuel cells. J. Power Sources, vol. 61, pp. 183–188, A. B., Name C. D., Title of the article, Journal, 1996.
2. J. J. Baschuck and X. Li: Modelling of polymer electrolyte membrane fuel cells with variable degrees of water flooding. J. Power Sources, vol. 86, pp. 181–196, 2000.
3. P. Famouri and R. Gemmen: PEM fuel cell electric circuit model. presented at the Power Electronics for Fuel Cells Workshop, Nat. Fuel Cells Res. Center, Univ. California, Irvine, CA, Aug. 8–9, 2002.
4. C. J. Hatziadoniu et al.: A simplified dynamic model of gridconnected fuelcell generators. IEEE Trans. Power Delivery, vol. 17, pp. 467–473, Apr. 2002.
5. Jeferson M. Corrêa, Student Member, IEEE, Felix A. Farret, Luciane N. Canha, and Marcelo G. Simões : An ElectrochemicalBased FuelCell Model Suitable for Electrical Engineering Automation Approach. IEEE Transactios on Industrial Electronics, vol .51, No 5, Octobr 2004.
6. Jeferson M. Corrêa, Student Member, IEEE, Felix A. Farret, Jonas R. Gomes, and, Marcelo Godoy Simões, Senior Member, IEEE: Simulation of FuelCell Stacks Using a Computer Controlled Power Rectifier With the Purposes of Actual High Power Injection Applications. IEEE Transactios on Industrial ,Applications, vol 39, N04, July/August 2003.
7. M. Y. ElSharkh, Member, IEEE, A. Rahman, Life Senior Member, IEEE, M. S. Alam, Senior Member, IEEE, A. A. Sakla, Senior Member, IEEE, P. C. Byrne, Member, IEEE, and T. Thomas, Member, IEEE: Analysis of Active and Reactive Power Control of a StandAlone PEM Fuel Cell Power Plant. IEEE Transactios on Power Ssystems , vol .19, N04, November 2004.
8. M. Y. ElSharkh and M.S Alam: A dynamic model for a standalone PEM fuel cell power plant for residential application. J. Power Sources, , submitted for publication, June 2004.
9. M. Y. ElSharkh , A. Rahman and M..S Alam: Neural networksbased control of active and reactive power of a StandAlone PEM Fuel Cell Power Plant. J. Power Sources, 19 June 2004, Available online.
10. Abhishek Sakhare, Asad Davari and Ali Feliachi: Fuzzy logic control of fuel cell for standalone and grid connection. Journal of Power Sources, Volume 135, Issues 12, 3 Pages 165176, September 2004.
11. Kisacikoglu, M.C.; Uzunoglu, M.; Alam, M.S: Fuzzy Logic Control of a Fuel Cell/Battery/Ultracapacitor Hybrid Vehicular Power System. Vehicle Power and Propulsion Conference, VPPC 2007. IEEE Volume , Issue , 912 Sept. 2007 Page(s):591 – 596, 2007.