Fuzzy Logic Control of Fuel Cell System For Residential Power Generation
Fuzzy Logic Control of Fuel Cell System For Residential Power Generation
Fuzzy Logic Control of Fuel Cell System For Residential Power Generation
6, 2009, 328334
FUZZY LOGIC CONTROL OF FUEL CELL SYSTEM
FOR RESIDENTIAL POWER GENERATION
Khaled Mammar
Abdelkader Chaker
This paper presents a dynamic model of a 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 the active power of PEM fuel cell system. The controller modies the hydrogen ow feedback from the terminal load.
Simulation results conrmed the high performance capability of the fuzzy logic controller to control power generation.
K e y w o r d s: polymer-electrolyte fuel cell, dynamic model, residential power, fuzzy controller
1 INTRODUCTION
Proton 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 consumptive. Designing
and building prototypes is dicult and expensive. The
alternative is modelling the fuel cell system and its simu-
lation. The modelling of the fuel cell is very important for
the power system because it facilitates the understanding
of the involved phenomena. Many models have been pro-
posed to simulate fuel cells in the literature [1-6], which
have generally their own specicities and utilities, follow-
ing the studied phenomena.
The model proposed in this paper includes the elec-
trochemical and uid dynamic aspects of chemical reac-
tions inside the fuel-cell stack. Furthermore, voltage losses
due to ohmic, activation, and concentration losses are ac-
counted for. Therefore, this dynamic PEMFC model com-
plements the existing models such as the ones developed
in [5, 6]. The model is suitable for power generation. To
study the transient response of a grid-independent PEM
fuel cell power plant, this paper proposes an electrochem-
ical 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 the elec-
tric power load through DC/AC inverters. A method to
connect the proposed PEMFC model to a grid - indepen-
dent through an interface block is presented. The fuel-cell
model, an external reformer and its interface block are im-
plemented 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, higher than other types of controllers.
The most important aspect is the cost of the controller de-
sign and implementation. The proposed controller modi-
es the hydrogen ow for controlling the active power to
the load change.
2 FUEL CELL STATICS MODEL
Hydrogen PEM fuel cells transform chemical energy
into electrical and thermal energy by the simple chemical
reaction [1-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 e
anode
O
2
+ 4 e
2 O
2
cathode
(2)
While the protons are transported through the mem-
brane, 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] Jeferson M. Correa introduced a model
for the PEMFC . The model is based on simulating the
relationship between the output voltage and partial pres-
sure of hydrogen, oxygen, and current.
The output voltage of a single cell can be dened by
the following expression [5, 6]
V
FC
= E
Nernst
V
act
V
ohm
V
conc
(3)
where, E
Nernst
is the thermodynamic potential of the
cell and its represents reversible voltage; V
act
is the volt-
age drop due to the activation of the anode and of the
M
is the specic resistivity of the membrane for the
electron ow (cm), A is the cell active area (cm
2
) 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 Naon membranes is used [5] after introducing:
the current density J
stack
= I
stack
/A and the relative
temperature = T (K)/303 K
=
181.6
_
1 + 0.03J
stack
+ 0.062
2
J
3.5
stack
[ 0.634 3J
stack
] e
4.18(1)
(8)
where
181.6
0.634
is the specic resistivity (cm) at no
current and at 30
C, [5].
2.4 Concentration or Mass Transport Voltage
Drop
To determine an equation for this voltage drop, a max-
imum current density is dened J
max
under which the
fuel is being used at the same rate of the maximum sup-
ply speed. The current density cannot surpass this limit
because the fuel cannot be supplied at a larger rate. Typ-
ical values for are in the range of 500 1500 mA/cm
2
.
Thus, the voltage drop due to the mass transport can be
determined by
V
con
= Bln
_
1
J
J
max
_
(9)
where B (in volts) is a parametric coecient which de-
pends on the cell and its operation state, and J represents
the actual current density of the cell (A/cm
2
).
The static model of the PEM fuel cell is shown in
Fig. 1, and the parameters are given in Tab. 1.
3 FUEL CELL SYSTEM MODEL
In [7-9] Sharkh, Rahman, and Alam introduced a
model of PEMFuel cell system for residential power gener-
ation. This model has been modied to introduce a static
model show in Fig. 1 the new model is shown in Fig. 4.
330 K. Mammar A. Chaker: FUZZY LOGIC CONTROL OF FUEL CELL SYSTEM FOR RESIDENTIAL POWER GENERATION . . .
Tab. 1. Model parameters [5, 6].
T 343 K
A 333 cm
2
L 178m
B 0.016 V
RC 0.3 m
1 -0.948
2 0.00286+0.0002ln A + 4.3 10
5
ln(cH2)
3 7.610
5
4 -1.9310
4
23
Jmax 1500 mA/cm
2
Jn 1.2 mA/cm
2
Fig. 1. PEMFC static model
Fig. 2. Typical PEMFC cell voltage response surface with simulta-
neous changes in the inlet partial pressure of hydrogen and current
at a constant stack temperature of 70
C
Fig. 3. Typical PEMFC cell power response surface with simulta-
neous changes in the inlet partial pressure of hydrogen and current
at a constant stack temperature of 70
C
3.1 Fuel Cell Dynamic Model
This model is based on simulating the relationship be-
tween the output voltage and partial pressure of hydro-
gen, oxygen, and current. A detailed model of the PEM
fuel cell is shown in Fig. 4.
Fig. 4. PEMFC dynamic model
The model parameters are as follows:
qH2 input molar ow of hydrogen (kmol/s),
qO2 input molar ow of oxygen (kmol/s),
pH2 hydrogen partial pressure (bar),
pO2 oxygen partial pressure (bar),
KH2 hydrogen valve molar constant (kmol/bar/s)),
KO2 oxygen valve molar constant (kmol/bar/s),
N0 number of series fuel cells in the stack,
I
stack
stack current (A),
Kr = N0/4F constant, (kmol/s/A)
F Farady constant 9684600 C/kmol.
3.3 Reformer Model
In [7, 8] the authors introduced a simple model of a re-
former that generates hydrogen through reforming methane.
The model is a second-order transfer function. The mathemat-
ical form of the model can be written as follows
qH2
q
methane
=
CV
12s
2
+ (1 + 2)s + 1
(11)
where, CV is the conversion factor (kmol of hydogen per kmol
of methane), q
methane
is the methane ow rate (kmol/s) and
1, 2 are the reformer time constants (s).
3.4 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 con-
stant of inverters is of the order of microseconds or at the
utmost milliseconds. The time constants for the reformer and
stack are of the order of seconds. The model of the inverter
is given in [9], where the 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.
Journal of ELECTRICAL ENGINEERING 60, NO. 6, 2009 331
Fig. 5. Fuel cell, Inverter and load connection diagram [9]
Fig. 6. The DC/AC inverter model [9]
Here the model parameter are as follows
Vac AC output voltage of the inverter (V)
m inverter modulation index
phase angle of the AC voltage (rad)
Pac AC output power from the inverter (W)
Qac reactive output power from the inverter (W)
VL load terminal voltage (V)
X reactance of the line connecting the fuel cell to the
load
IL load current (A)
load phase angle (rad)
PL load power (W)
I
stack
stack current (A)
The output voltage and the output power as a function of the
modulation index and the phase angle providing the phase
angle of the load voltage VL is set to zero can be written as
Vac = mV
cell
(12)
Pac =
mV
cell
VL sin()
X
(13)
Qac = mV
cell
mV
cell
VL cos()
X
(14)
IL =
PL
Vs cos()
(15)
and assuming a lossless inverter
Pac = V
cell
I
stack
, (16)
we get
I
stack
= mILcos( + ). (17)
PI controllers are used to control the modulation index.
The transfer function of the modulation index can be ex-
pressed as
m =
K5 + sK6
s
(Vr Vac), (18)
were K5 , and K6 are the PI gain, and Vr is the reference
voltage signal. The block diagram of the inverter with the PI
controllers is illustrated in Fig. 6.
According to electrochemical relationships, a relationship
between the stack current and the molar ow of hydrogen can
be written as
qH2 =
N0I
stack
2FU
, (19)
were U is a utilization factor. From (13), (18 ) and (19)
sin() =
2FUX
mVsN0
qH2
.
= , (20)
assuming a small phase angle. Equation (20) describes the
relationship between the output voltage phase angle and hy-
drogen ow. Equations (13) and (20) indicate that the active
power as a function of the voltage phase angle can be con-
trolled by controlling the amount of hydrogen ow.
4 FUZZY LOGIC CONTROLLER
The active power ow from the PEMFC to the load is con-
trolled though controlling the ow of hydrogen. The proposed
fuzzy logic controller controls the active power by controlling
the hydrogen ow. The fuzzy controller consists of ve dier-
ent steps (Fig. 7) [10, 11].
Step (i) denition of input-output variables of controller
Step (ii) design of fuzzy control rule
Step (iii) fuzzication
Step (iv) inference
Step (v) defuzzication
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 the hydrogen ow uH2(k). The error, change of error, and
the output of the controller are given as follows
e(k) = qH2 + q
meth,ref
q
H2,b
. (22)
Here qH2 is the ow hydrogen from the current feedback
signal proportional to the terminal load Fig. (6), q
methane
is
the methane reference signal and q
H2,b
is the hydrogen ow
feedback signal.
Fig. 7. The block diagram of a fuzzy logic controller
332 K. Mammar A. Chaker: FUZZY LOGIC CONTROL OF FUEL CELL SYSTEM FOR RESIDENTIAL POWER GENERATION . . .
Fig. 8. Membership function for error (e), error change (ce) and
control (u)
Fig. 9. The 3-dimensional representation of control input u
H2
for
fuzzy variables (e, ce)
ce(k) = e(k) e(k 1) (23)
uH2(k) = uH2(k 1) +uH2(k). (24)
Here uH2(k) is the inferred change of duty ratio by fuzzy
controller and is the gain factor of the controller [6, 7].
Fig. 8 shows the basic fuzzy partition of the membership
function for error, change of error, and change of control ac-
tion. 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:
Rule 1: If e(k) is PM and ce(k) ZO then uH2(k) is PM
Rule 2: If e(k) is NB and ce(k) NM then uH2(k) is NB
The inference method used is basic and simple, it is de-
veloped from the minimum operation function rule as a fuzzy
implementing function. The membership function of e, ce and
uH2 are given by Ei , CEi , H2iCi .
The commonly use min-max method is given for i = 1 . . . n
as
Ri(e, ce) = min
_
ei(e), cei(ce)
_
(25)
Ci(uH2) = max
_
Ri(e, ce), uH2i(uH2)
_
(26)
The centroid defuzzication method determines the output
value from center of gravity of the output membership func-
tion and is given by the expression
uH2 =
n
i=0
Ci(uH2i)uH2i
n
i=0
Ci(uH2i)
(27)
Based on Tab. 2 and Fig. 8, the 3-dimensional representation
of control input for fuzzy variables uH2(e, ce) is shown in
Fig. 9.
Table 2. Linguistic control rule
Error Change of Error
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
5 SIMULATION RESULTS
The model parameters are given in Table 3.The model
of the fuel cell system for residential power generation and
fuzzy logic block diagram is shown in Fig. 10. It is tested
with a 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 the change in residential load.
In a practical system, the response time of the reformer
can be longer than tens of seconds [11, 12]. Therefore the
reformer controller parameters have a signicant eect
on the active power control. In this simulation the fuzzy
logic controller was able to modify the hydrogen ow for
controlling active power to the load change, Fig. 12. The
fuzzy logic controller is characterized by a faster time
response compared to the PID controllers used in Fig.
13. The change of the current is illustrated in Fig. 14.
This change is very sensitive to variation of the active
power load. Fig. 15 shows the change of hydrogen ow.
This change is similar to the change of the active power.
The reactive power Q
ac
follows immediately the change
of the reactive power load because the reactive power is
Journal of ELECTRICAL ENGINEERING 60, NO. 6, 2009 333
Fig. 10. PEM fuel cell system and fuzzy logic block diagram
Fig. 11. Load step changes Fig. 12. Active output power change
with fuzzy logic controller
Fig. 13. Active output power change
with PID controller
Fig. 14. Current change Fig. 15. Hydrogen ow rate change Fig. 16. Reactive output power change
Fig. 17. Output voltage phase angle change Fig. 18. Modulation index change
334 K. Mammar A. Chaker: FUZZY LOGIC CONTROL OF FUEL CELL SYSTEM FOR RESIDENTIAL POWER GENERATION . . .
controlled directly from DC/AC inverter and the response
of DC/AC inverter is not considerable, Fig. 16. We notice
that the reactive power value is superior to the reactive
power. This is due to inductive eect losses of the line
(x). The change of the output voltage phase angle and
modulation index are illustrated in Figs. 15 and 16.
Tab. 3. System parameters [8, 9].
Conversion factor CV 2
Faradays constant F 9684600 C/kmol
Universal gas constant R 8.31447 J/mol/K
Number of cells N0 333
Hydrogen valve constant KH2 4.2210
5
kmol/s/A
Oxygen valve constant KO2 2.1110
5
kmol/s/bar
Hydrogen time constant H2 3.37 s
Oxygen time constant O2 6.74 s
Utilization factor U 0.8
PI gain constants K5, K6 10
H2 -O2 ow ratio rH-O 1.168
Methane reference signal q
ref
0.000015 kmol/s
Reformer time constants 1, 2 2s, 2s
Line reactance X 0.05
Voltage reference signal Vr 240 V
6 CONCLUSION
In this paper the fuel cell system model for residential
generation is proposed. The proposed model includes a dy-
namic fuel cell model, a gas reformer model, DC/AC inverter
model, and fuzzy logic controller unit block. Then the devel-
oped model is tested using a computer-simulated step change
in the load active and reactive power demands. The simulation
results indicate that the converter and fuel quantities have to
be controlled simultaneously to control the active and reac-
tive power. They also indicate that the fuzzy logic controller
is very eective to control the hydrogen ow for active power
load variation.
References
[1] AMPHLETT, J. C.MANN, R. F.PEPPLEY, B. A.ROB-
ERGE, P. R.RODRIGUES, A. : A model predicting transient
responses of proton exchange membrane fuel cells, J. Power
Sources 61 (1996), 183188.
[2] BASCHUCK, J. J.LI, X. : Modelling of polymer electrolyte
membrane fuel cells with variable degrees of water ooding, J.
Power Sources 86 (2000), 181196.
[3] FAMOURI, P.GEMMEN, R. : PEM fuel cell electric circuit
model. presented at the Power Electronics for Fuel Cells Work-
shop, Fuel Cells Res. Center, Univ. California, Irvine, CA, Aug.
8-9, 2002.
[4] HATZIADONIU, C. J. : A simplied dynamic model of grid-
connected fuel-cell generators, IEEE Trans. Power Delivery 17
(April 2000), 467473.
[5] CORR
OES,
M. G. : An Electrochemical-Based Fuel-Cell Model Suitable for
Electrical Engineering Automation Approach, IEEE Transactios
on Industrial Electronics 51 No. 5 (October 2004).
[6] CORR
OES,
M. G. : Simulation of Fuel-Cell Stacks Using a Computer- Con-
trolled Power Rectier With the Purposes of Actual High- Power
Injection Applications, EEE Transactios on Industrial Applica-
tions 39 No. 4 (July/August 2003).
[7] EL-SHARKH, M. Y.RAHMAN, A.ALAM, M. S.SAKLA,
A. A.BYRNE, P. C.THOMAS, T. : Analysis of Active
and Reactive Power Control of a Stand-Alone PEM Fuel Cell
Power Plant, IEEE Transactions on Power Systems 19 No. 4
(November 2004).
[8] EL-SHARKH, M. Y.ALAM, M. S. : A dynamic model for a
stand-alone PEM fuel cell power plant for residential application,
J. Power Sources, submitted for publication June 2004 ???.
[9] EL-SHARKH, M. Y.RAHMAN, A.ALAM, M. S. : Neu-
ral networks-based control of active and reactive power of a
Stand-Alone PEM Fuel Cell Power Plant, J. Power Sources 135
(June 2004), 8894, Available online.
[10] SAKHARE, A.DAVARI, A.FELIACHI, A. : Fuzzy logic
control of fuel cell for stand-alone and grid connection, J. Power
Sources 135 No. 1-2, 3 (September 2004), 165176.
[11] KISACIKOGLU, M. C.UZUNOGLU, M.ALAM, M. S. :
Fuzzy Logic Control of a Fuel Cell/Battery/Ultra-capacitor Hy-
brid Vehicular Power System, Vehicle Power and Propulsion
Conference, 2007, VPPC 2007. IEEE Volume, Issue 9-12 Sept.
pp.591596.
Received 3 February 2009
Khaled Mammar was born in 1973 in Tiaret Algeria He
received his BS degree in Electrical Engineering from the Uni-
versity of Sciences and Technology of Oran, Algeria, in1997,
and the MS degree from the same University of Sciences and
Technology of Oran, in 2002. He is currently Assistant Profes-
sor of Electrical and Computer Engineering at the University
of Bechar. His research interests include fuel cell power sys-
tems, power control, power electronics, as well as intelligent
control.
Abdelkader Chaker is Professor at the Department of
Electrical Engineering at the ENSET, in Oran Algeria. He re-
ceived PhD degree in Engineering Systems from the University
of Saint-Petersburg. His research activities include the control
of large power systems, multimachine multiconverter systems,
the unied power ow controller. His teaching includes neural
process control and real time simulation of power systems.