You are on page 1of 12

ARTICLE IN PRESS

Control Engineering Practice 17 (2009) 874–885

Contents lists available at ScienceDirect

Control Engineering Practice


journal homepage: www.elsevier.com/locate/conengprac

Design and experimental validation of a constrained MPC for the air feed
of a fuel cell
J.K. Gruber a,, M. Doll b, C. Bordons a
a
Dep. de Ingenierı́a de Sistemas y Automática, Universidad de Sevilla, Spain
b
Institut für Systemdynamik, Universität Stuttgart, Germany

a r t i c l e in f o a b s t r a c t

Article history: Fuel cells represent an area of great industrial interest due to the possibility to generate clean energy,
Received 18 July 2008 especially PEM (Polymer Electrolyte Membrane or Proton Exchange Membrane) fuel cells for their use in
Accepted 10 February 2009 stationary and automotive applications. The oxygen excess ratio expressing the proportion between
Available online 14 March 2009
oxygen reacting in the cells and oxygen entering the stack is widely used to guarantee safety and to
Keywords: reach a high performance. To control the oxygen excess ratio a model predictive control (MPC) has been
Model predictive control developed using the compressor motor voltage to manipulate the air flow rate entering the fuel cell.
Fuel cell The design of the MPC is carried out with a commercial fuel cell. The proposed MPC is implemented and
Control design validated in experiments and compared with the original built-in controller. The behaviour of the
Identification
system and the controller is illustrated by means of experimental results.
Air feed control
& 2009 Elsevier Ltd. All rights reserved.

1. Introduction the air flow. The ratio between the oxygen consumed due to the
electrochemical reaction and the oxygen flow generated by the
Fuel cells are electrochemical devices that generate electrical compressor is denoted as oxygen excess ratio or lO2 (Pukrushpan,
energy from chemical reactants continuously, this while fuel and Stefanopoulou, & Peng, 2004a). This ratio must fulfil the
oxidant are provided. Although they were invented more than a stoichiometric relation required to produce the current de-
century ago, they have received a great deal of attention in the last manded, otherwise a phenomenon called oxygen starvation
decades as good candidates for clean electricity generation both in occurs. This phenomenon implies a fast stack degradation and
stationary and automotive applications. There are many unre- low power generation, and the only way to finish it is by stopping
solved issues regarding materials, manufacturing and mainte- the reactants flow and the current demand (Bordons, Arce, & del
nance, automatic control being one of the most important Real, 2006). Different studies are reported about this undesired
ones. There are many types of fuel cells, this work being focussed phenomenon, and in the literature controlling lO2 is proposed in
on PEM (Polymer Electrolyte Membrane or Proton Exchange order to prevent it (Pukrushpan et al., 2004a; Thounthong &
Membrane) cells, which run at low temperature and show Sethakul, 2007). Many control strategies have been proposed in
fast dynamical response, high power density, small size, low literature, ranging from feed-forward control (Pukrushpan, Stefa-
corrosion and high efficiency, which make them suitable for nopoulou, & Peng, 2004b; Pukrushpan, Stefanopoulou, Varigonda,
mobile applications (Rodatz, Paganelli, Sciarretta, & Guzzella, Eborn, & Haugstetter, 2006), LQR (Pukrushpan et al., 2004b;
2005; Stefanopoulou & Suh, 2007). It is clear that good Rodatz, Paganelli, & Guzella, 2003), neural networks (Almeida &
performance of these devices is closely related to the kind of Simões, 2005) or model predictive control (MPC) (Bordons et al.,
control that is used, so a study of new control alternatives is 2006; Gruber, Bordons, & Dorado, 2008), although they have not
justified. It is clear that implementing and studying advanced been validated on real plants. In this paper the regulation of lO2
controllers are important issues for improving efficiency. using MPC theory, manipulating the compressor to compensate
Hydrogen and oxygen must be supplied to the fuel cell in order the reactants flow consumption generated by a power load profile
to maintain the electrochemical reaction. The main control is proposed and tested on a real fuel cell.
variable in PEMFC power systems is the air flow which is supplied The proposed control strategy incorporates the effect of the
by a compressor. Hydrogen is usually stored in a pressurised tank, load demanded to the fuel cell, which is the main disturbance,
so it is fed through a fast opening valve to track a desired ratio of therefore including implicitly a feed-forward effect. The controller
was designed using a model obtained from experimental data and
tested later on a real fuel cell.
 Corresponding author. Tel.: +34 954 488 161; fax: +34 954 487 340. The paper is organised as follows. Section 2 presents a
E-mail address: jgruber@cartuja.us.es (J.K. Gruber). description of the fuel cell and the control problem. In Section 3

0967-0661/$ - see front matter & 2009 Elsevier Ltd. All rights reserved.
doi:10.1016/j.conengprac.2009.02.006
ARTICLE IN PRESS

J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885 875

a detailed description of the controller design is given. In Section 4 computer (Intel Core 2 Duo E6750 at 2.67 GHz, 1 GB RAM) which is
the experimental results are shown and, finally, in Section 5 the not exclusively dedicated to real-time applications.
major conclusions are drawn.
2.2. System output and disturbance

2. System description The fuel cell system is used in a configuration with two
measurable outputs, the stack voltage V st and the air flow at
This section describes the used fuel cell, the system input, the cathode inlet W ca;in . Furthermore, the load current Iload is
output and disturbance as well as the control objective. considered as a measurable disturbance. The oxygen excess ratio
lO2 is a lumped variable and can be estimated from the system
2.1. The Nexa module output and the disturbance.
Generally, the oxygen excess ratio can be defined as the ratio
The work has been performed on a 1.2 kW Ballard PEM fuel cell between the oxygen W O2 ;ca;in entering the cathode and the oxygen
(Nexa Power Module Ballard, 2003, see Fig. 1), which can be W O2 ;reacted reacting in the fuel cell stack. The oxygen excess ratio
considered as a benchmark since it is widely used by many lO2 is considered as a performance variable of the system and its
research groups worldwide and it is representative of state-of- regulation is an important issue since this parameter determines
the-art PEM technology. The stack is composed of 46 cells with a the safety of the fuel cell.
110 cm2 membrane each. The system is auto-humidified and air- The oxygen excess ratio is defined as (Pukrushpan et al.,
cooled by a small fan. As for the hydrogen feeding of the fuel cell, a 2004b)
dead-end mode with flushes was adopted. The anode–cathode W O2 ;ca;in
pressure ratio is controlled to avoid membrane stress or damage, lO2 ¼ (1)
W O2 ;reacted
and therefore the hydrogen and oxygen mass flows are correlated.
In this project, an external controller that overrides the manu- with the oxygen mass flow rate as a function of the mass flow rate
facturer’s built-in controller has been developed and, in order of dry air W a;ca;in at the cathode inlet
to simulate a variable power demand, the energy produced was W O2 ;ca;in ¼ xO2 ;ca;in W a;ca;in (2)
delivered to an electronic load.
The fuel cell power module delivered by the manufacturer The oxygen mass fraction, xO2 ;ca;in , can be calculated by
includes its own on-board control system and software for yO2 ;ca;in MO2
measuring and collecting data of internal states over a serial xO2 ;ca;in ¼ (3)
yO2 ;ca;in M O2 þ ð1  yO2 ;ca;in ÞMN2
port. The mentioned software gives access to a wide range
of measurements, but with a relatively high sampling time where MO2 and M N2 denote the molar masses of oxygen and
of 200 ms. Furthermore, the measured data from Ballard’s nitrogen, respectively. For the oxygen mole fraction a value of
software package can be written in a file, but they cannot be yO2 ;ca;in ¼ 0:21 is assumed. The mass flow rate of dry air at the
accessed in real time for further purposes. cathode inlet is defined as
To permit immediate access to the measurements of the fuel 1
W a;ca;in ¼ W (4)
cell sensors a LabVIEW programme was developed to read the 1 þ oca;in ca;in
data from the serial port. This task was done earlier by Alejandro
with the humidity ratio
del Real and Alicia Arce from the Departamento de Ingenierı́a de
Sistemas y Automática of the University of Seville. To allow the Mv pv;ca;in
oca;in ¼ (5)
measurement of some variables with a smaller sampling time Ma;ca;in pa;ca;in
a National Instruments multifunction card (PCI 6229) was used.
being M v the molar mass of vapour. The molar mass of air at the
The analogue outputs of the card allow the application of signals
cathode inlet is calculated with
to the actuators of the fuel cell and, as a consequence, the
implementation of an external controller. Both Ballard’s software Ma;ca;in ¼ yO2 ;ca;in M O2 þ ð1  yO2 ;ca;in ÞMN2 (6)
package and the LabVIEW programme run on the same personal
The vapour pressure pv;ca;in and the dry air pressure pa;ca;in used to
calculate the humidity ratio oca;in are defined as

pv;ca;in ¼ fca;in psat ðT ca;in Þ (7)


pa;ca;in ¼ pca;in  pv;ca;in (8)
with fca;in denoting the relative humidity of air at the cathode
inlet. psat ðT ca;in Þ and pca;in represent the vapour saturation pressure
at a certain temperature and the pressure at the cathode inlet,
respectively.
The rate of oxygen consumption is proportional to the current
withdrawn from the fuel cell and can be written as (Larminie &
Dicks, 2003)
nIst
W O2 ;reacted ¼ M O2 (9)
4F
with n ¼ 46 the number of cells of the used fuel cell stack and F
the Faraday constant.
The fuel cell system based on (1)–(9) has 2 degrees of freedom.
One is the stack current Ist , considered as a disturbance of the
system. The second one is the input signal V cm (compressor motor
Fig. 1. The Ballard Nexa fuel cell module in the laboratory. voltage), which will be presented in Section 2.4. The compressor
ARTICLE IN PRESS

876 J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885

motor voltage affects directly the pressure at the cathode inlet and The setpoint for the oxygen excess ratio will be determined later
its effect is therefore taken in account in (8). in experiments with the fuel cell.

2.4. Control input


2.3. Control objective
The main goal of an external controller is the regulation of the
As already mentioned in Section 2.2 the oxygen excess ratio lO2 oxygen excess ratio lO2 . As seen in Fig. 2 and in (1), lO2 depends
has a fundamental influence on the safety of the fuel cell system. basically on the stack current Ist and the air flow rate W ca;in at the
In this way, Pukrushpan et al. (2004a) proposes to regulate lO2 ¼ 2 cathode inlet. Due to the fact that the stack current is a
to guarantee safety and to provide high efficiency. In Arce, disturbance, a manipulation of the air flow rate has to be used
Ramirez, del Real, and Bordons (2007) a variable profile for this to regulate the oxygen excess ratio.
variable is proposed that gives the highest efficiency for each As the used fuel cell is a closed system the compressor cannot
value of the load. Deviations of lO2 from the reference implies be controlled externally in its standard configuration. Hence, the
lower efficiency, and negative deviations increase the starvation manufacturer’s built-in controller had to be overridden by using a
phenomenon probability. ML4425CS microcontroller connected to the compressor motor.
The oxygen starvation phenomenon occurs when the oxygen Therewith a new system input, the input voltage V cm , was created
partial pressure falls below a critical level at any location at the allowing the manipulation of the compressor motor and, as a
cathode (Pukrushpan et al., 2004a). Tests showed that the oxygen consequence, the air flow rate at the cathode inlet. Note that in
starvation phenomenon can cause damages to the electro-catalyst the used configuration the compressor motor is still powered
of the fuel cell, as well as reducing its performance (Thounthong & internally, i.e. the air supply compressor load is drawn from the
Sethakul, 2007). To avoid this phenomenon, the oxygen excess fuel cell stack. Being a power-autonomous system the fuel cell is
ratio lO2 always has to be greater than 1 subject to several limitations, e.g. the conflict controlling the
lO2 41 (10) oxygen excess ratio manipulating the air flow rate. For detailed
information on the possible conflicts see Suh and Stefanopoulou
Hence, one of the control objectives is the regulation of the oxygen (2006).
excess ratio to avoid oxygen starvation.
The second objective of the fuel cell control is the maximisa-
tion of the net output power. The net output power P net can be 3. Control design for the oxygen excess ratio
defined generally as the difference between the power generated
by the fuel cell stack PFCS and the power Paux used by the Finally, with the defined control objectives and the new system
compressor, air fan and other auxiliary equipment. Hence, the net input the controller design was carried out. The idea was to
power can be written as control the oxygen excess ratio lO2 manipulating the compressor
motor voltage V cm . As mentioned before, the measurements from
P net ¼ P FCS  Paux (11) the fuel cell sensors can be read only every 200 ms over the serial
Fig. 2 shows the relation between the net power P net and the port. With an estimation of the oxygen excess ratio lO2 using the
oxygen excess ratio lO2 for different stack currents Ist and air flow data over the serial port it is impossible to control a system with
rates W ca;in . The figure was generated with a detailed simulation fast dynamics as the fuel cell is (del Real et al., 2007). As the
model of the fuel cell based on first principles (del Real, Arce, & estimation of the oxygen excess ratio lO2 (1) depends directly on
Bordons, 2007). For the simulation an ambient air temperature the air flow W ca;in and the stack current Ist , a higher signal rate of
of T ca;in ¼ 298:15 K and a relative humidity of fca;in ¼ 1 were used. these two measurements is necessary. To overcome this problem,
The pressure at the cathode inlet pca;in and the membrane water several experiments were carried out to identify the dynamics of
content (a variable which is not explicitly considered in this the mentioned variables.
article, but which has an effect on the net power of the fuel cell)
are calculated as described in del Real et al. (2007). For a constant 3.1. Measurement of the air flow rate W ca;in
stack current and a low air flow rate the net power increases with
an increasing air flow rate. For higher flow rates a further increase The air flow is measured with a sensor which was already
of the flow rates has a negligible effect on the net power. A more placed at the compressor inlet by the manufacturer of the fuel
or less constant net power is reached for all stack currents cell system. In several experiments the sensor output V sensor
when the value for the oxygen excess ratio is greater than 4. (a voltage) was measured with a sampling time of 10 ms by the

120slpm 160slpm
100slpm 140slpm
80slpm
1200 60slpm 40A
35A
1000
30A
Pnet [W]

800 25A

600 20A
15A
400 10A
200 5A
10slpm 20slpm 30slpm 40slpm
0
1 2 3 4 5 6 7 8 9 10
λO2 [−]

Fig. 2. Net power of the fuel cell model (del Real et al., 2007) in steady state for different values of the stack current Ist (dashed line) and air flow rate W ca;in (solid line).
ARTICLE IN PRESS

J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885 877

data acquisition card. It was observed that, after applying a step in available over the serial port. Due to these reasons the stack
the input voltage V cm , the sensor voltage V sensor reached steady current measurements are unusable for control purposes.
state within one sampling period. This means that the air flow Installing a new sensor to measure the stack current Ist was
rate W ca;in reaches its steady state value in less than 10 ms. The impossible due to the construction of the fuel cell system as a
measurements of the air flow rate W ca;in provided over the serial closed system. For that reason an estimator of the stack current
port were correlated with the sensor voltage V sensor measured was used. The current generated by the stack is used to feed the
with the data acquisition card. With this configuration it was load ðIload Þ and the auxiliary equipment of the fuel cell system
possible to calculate the nonlinear map between the sensor ðIaux Þ. Hence, the stack current can be defined as
voltage and the corresponding air flow rate.
Ist ¼ Iload þ Iaux (13)
The sensor at the cathode inlet is a thermal sensor measuring
the air speed. As shown in Olin (1999), the air speed has to be Using the measured load current Iload the current Iaux has to be
identified as a polynomial depending on the sensor voltage. This estimated to calculate the stack current Ist . Several experiments
means that the values of the air flow rate W ca;in supplied over with the fuel cell were carried out to get information about the
the serial port were used to calibrate the characteristic curve behaviour of the current Iaux of the auxiliary equipment. Fig. 4
of the sensor. Using a least squares algorithm the characteristic shows the parasitic losses Iaux for different values of the input
curve was identified with a third degree polynomial voltage V cm obtained from experiments. It can easily be seen from
the figure, that the relation between these two variables cannot
W ca;in ¼ c3 V 3sensor þ c2 V 2sensor þ c1 V sensor (12) be approximated by a second order polynomial with constant
parameters. Therefore, to estimate the current Iaux during
Fig. 3 shows a comparison of the identified characteristic curve
experiments, an adaptive algorithm was implemented. The
and the measurements of the air flow rate provided over the serial
current Iaux has been defined as a quadratic function
port.
Iaux ¼ c0 þ c1 V cm þ c2 V 2cm (14)
3.2. Estimation of the oxygen excess ratio lO2 being V cm the input signal and c0 , c1 and c2 the adaptive
parameters. The estimation of the parameters is carried out on-
The oxygen excess ratio lO2 (1) is a lumped variable (see line using the Recursive Least Squares (RLS) method. The
Section 2.2) and cannot be measured directly and has to be influence of old data was reduced by using a forgetting factor
estimated through other measurements. The estimation of the of g ¼ 0:99. The high value for the forgetting factor has been
performance variable depends on the air flow rate W ca;in , the stack chosen to avoid a too high sensitivity in the parameter estimation
current Ist , the pressure pca;in , the relative air humidity fca;in and which would result in an adaption to noise in the measurements.
the temperature T ca;in . As was described in the previous section, As initial values for the parameters have been used c0 ¼ 0:2, c1 ¼
the air flow of the compressor can be measured directly. For the 0:4 and c2 ¼ 0:07. With (14) and the measured load current, Iload ,
stack current Ist measurements are available over the serial port, the stack current Ist can be calculated using (13). A comparison of
but with a high sampling time (200 ms). Additionally, the values the estimated stack current, the measured stack current (over the
of the stack current Ist are filtered numerically before being serial port) and the load current can be seen in Fig. 5. It can be

100

80
Wca,in [slpm]

60

40

20

0
0 0.5 1 1.5 2 2.5 3 3.5
Vsensor [V]

Fig. 3. Static nonlinearity between air flow rate W ca;in at the cathode inlet and measured sensor voltage V sensor with experimental data (dots) and the identified
characteristic curve (solid line).

2
Iaux [A]

0
0 0.5 1 1.5 2 2.5 3 3.5
Vcm [V]

Fig. 4. Parasitic losses Iaux due to the compressor, air fan and other auxiliary equipment of the fuel cell.
ARTICLE IN PRESS

878 J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885

24
22

Ist, Iload, Ist, e [A]


20
22
18 20
16 18
16
14
14
12 12
10 8.4 8.42 8.44 8.46 8.48
7 9 11 13 15
t [s]

Fig. 5. Comparison of stack current Ist (thin line), load current Iload (dashed line) and estimated stack current Ist;e (thick line) in transient and stationary sense.

observed that the estimated stack current has the same value as consisting of a division of the air flow rate W ca;in (12) at the
the measured stack current in steady state. During transitions the cathode inlet and the stack current Ist (13) and (14) and an
estimated stack current shows a similar behaviour as the load additional function containing the remaining variables and
current, but not the same value (see zoom in Fig. 5). The figure parameters. The additional function f ðÞ depends on the pressure
shows that the parasitic losses, i.e. the difference between pca;in , the temperature T ca;in , the relative humidity fca;in, the
estimated stack current and load current, are always greater than number n of cells of the fuel cell stack, the Faraday constant F,
zero. the oxygen mole fraction yO2 ;ca;in and the molar masses M O2 , MN2
Due to the design of the used fuel cell system it was impossible and M v of oxygen, nitrogen and vapor, respectively. The pressure
to measure the cathode inlet pressure pca;in in the fuel cell. One at the cathode inlet can be calculated with (15) and the
possibility to calculate the cathode inlet pressure is the use of temperature and the relative humidity are assumed to be constant
the equations given in the mathematical model of the fuel cell with T ca;in ¼ 298:15 K and fca;in ¼ 1. The Faraday constant has a
(del Real et al., 2007). The cathode inlet pressure is based on value of F ¼ 96485 C=mol and the used fuel cell stack possesses
several ordinary differential equations, making the computation n ¼ 46 cells. For the oxygen mole fraction and the molar masses
of the cathode inlet pressure a computationally complex task with the values yO2 ;ca;in ¼ 0:21, M O2 ¼ 32 g=mol, M N2 ¼ 28 g=mol and
respect to the fast dynamics of the system (see Section 3.1). Mv ¼ 18:02 g=mol were used.
Therefore, a simplified model of the cathode inlet pressure was With the air flow rate, depending mainly on the applied input
developed. From simulation of the mathematical model (del Real voltage u ¼ V cm , and the stack current, considered as a distur-
et al., 2007) it was known that the pressure pca;in depends mainly bance w ¼ Ist , a simple model for the model output y ¼ lO2 can be
on the air flow rate W ca;in at the cathode inlet, but also in some written as
part on the chemical reaction in the fuel cell stack and, as a
consequence, on the stack current Ist . With this knowledge the y ¼ f ðu; wÞ (17)
following model of the cathode inlet pressure: To gather information about the behaviour of the fuel cell, several
4 6 experiments in open loop with changes in the stack current and
pca;in ¼ 1:0033 þ 2:1  10  W ca;in  475:7  10  Ist (15)
compressor motor voltage have been carried out. Fig. 6 shows
was identified with simulation data. some experimental results which were used in the later model
Additionally two assumptions are made: the relative humidity identification. The stack current and the compressor motor
of the air at the cathode inlet has a value of fca;in ¼ 1 and the voltage were varied over their whole admissible intervals. Note
temperature is the one of ambient air ðT ca;in ¼ 298:15 KÞ. Finally, that even if stack current and compressor motor voltage were
with the measurement of the air flow rate W ca;in and the described used in a wide range, not all combinations of these two variables
simplifications, the oxygen excess ratio can be estimated as are admissible, e.g. very low compressor motor voltage and high
pointed out in (1). stack current, in order to avoid starvation. This fact also prevented
the use of more sophisticated signals for the compressor motor
and the stack current like pseudo random binary sequences
3.3. Identification of a prediction model (PRBS). It can be observed in the figure that with a raising stack
current the compressor motor voltage was increased for safety
For the control structure a model predictive control has been reasons. During the experiments, the oxygen excess ratio was
chosen due to the optimality of the calculated control signal. normally in an interval of lO2 ¼ ½2:5; 10 which contains the area
The possibility to consider constraints in the computation of the of the maximum net power (see Section 2.3).
control action is another advantage of MPC. The physical model In the first step the knowledge of the physical model for the
described in (1)–(15) cannot be used as a control-oriented model oxygen excess ratio was used to find a suitable structure for a
due to its complexity. Therefore, in order to use a model predictive prediction model. Based on (1)–(15) the following model was used
controller to regulate the oxygen excess ratio lO2 with the input during the identification:
voltage V cm , a prediction model has to be developed. The
equations describing the physical model have been used to define 1 X1
yðkÞ ¼ y0 þ a uðk  iÞ (18)
the general structure of a prediction model. wðk  1Þ i¼1 i
The equation to calculate the oxygen excess ratio lO2 (1) can be
expressed in short form as where the disturbance w ¼ Ist was considered to have an
immediate effect on the oxygen excess ratio without dynamics
W ca;in (del Real et al., 2007). This instantaneous effect was considered in
lO2 ¼  f ðpca;in ; T ca;in ; fca;in ; n; F; yO2 ;ca;in ; M O2 ; M N2 ; Mv Þ (16)
Ist the denominator of the prediction model and is based directly on
ARTICLE IN PRESS

J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885 879

12
10

λO2 [−]
8
6
4
2
0 200 400 600 800 1000 1200 1400 1600
t [s]
40
30
Ist [A]

20
10
0
0 200 400 600 800 1000 1200 1400 1600
t [s]
4
3
Vcm [V]

2
1
0
0 200 400 600 800 1000 1200 1400 1600
t [s]

Fig. 6. Experimental results of the fuel cell used for the model identification. Top: oxygen excess ratio lO2 , middle: stack current Ist , bottom: compressor motor voltage V cm .

7 5.5 7

6.5 6
5
6 5.5
6 4.5
λO2 [−]

λO2 [−]

λO2 [−]

λO2 [−]
5
5.5 4
5
4.5
5 3.5
4
4.5 3 4
627.6 628 628.4 628.8 1318.5 1319 1319.5 622 622.2 622.4 1396.6 1396.8 1397 1397.2
t [s] t [s] t [s] t [s]
14 25 11 13

13
Ist [A]

Ist [A]

Ist [A]

Ist [A]

12 20 10.5 12.5

11

10 15 10 12
627.6 628 628.4 628.8 1318.5 1319 1319.5 622 622.2 622.4 1396.6 1396.8 1397 1397.2
t [s] t [s] t [s] t [s]
2 2
2
1.9
1.95
1.8
Vcm [V]

Vcm [V]

Vcm [V]

Vcm [V]

1.8 1.9 1.5


1.6

1.85 1.4
1.7
1.8 11 1.2
627.6 628 628.4 628.8 1318.5 1319 1319.5 622 622.2 622.4 1396.6 1396.8 1397 1397.2
t [s] t [s] t [s] t [s]

Fig. 7. Results of the model identification in some operation points of the fuel cell with a comparison of the oxygen excess ratio lO2 and the output y of the identified model.
Top: oxygen excess ratio lO2 (solid line) and output of the identified model (19) (dash–dotted line), middle: stack current Ist , bottom: compressor motor voltage V cm .
ARTICLE IN PRESS

880 J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885

Using the step response model (19) the future output can be
6
predicted as
5
4 y^ ¼ Gu þ f (20)
αi [−]

3 where vector y^ is the output prediction, G is a matrix containing


2 the step response parameters of the identified model, u represents
the vector of future control increments and f contains the free
1
response and the identified offset y0 from (19). Note that the
0 parameters ai of the identified model (19) are scaled by the
1 2 3 4 5 6 7 8 9 10 11 12
disturbance w (stack current Ist ). This means that the matrix G has
i [−] to be recalculated in every sampling period and cannot be
Fig. 8. Identified model parameters ai . calculated off-line.
With the prediction model (20) the manipulated variable has
to be calculated to minimise the cost function
the oxygen consumption rate (9) and the oxygen excess ratio (1).
The input-to-output dynamics have been considered as an X
N NX
u 1

impulse response as the compressor motor voltage u ¼ V cm J¼ ðy^ ðt þ jjtÞ  yref ðt þ jÞÞ2 þ gðDuðt þ jÞÞ2 (21)
j¼1 j¼0
influences only indirectly the oxygen excess ratio y ¼ lO2 due to
its effect on the pressure at the cathode inlet pca;in . The offset y0 where N and Nu denote the prediction and control horizon.
represents a constant correction term for the output prediction. The parameter g represents the weighting factor1 for the control
As the used system is a stable fading memory system, it can be increments and yref contains the desired reference trajectory.
approximated by a finite impulse response model (Boyd & Chua,
1985). The identification was carried out with the least squares
3.4.1. Unconstrained minimisation
method using experimental data with a sampling time of
Without considering constraints in the control action and the
t s ¼ 10 ms. The finally identified model has the form
system output, the control action is calculated by minimising the
X12 cost function (21)
1
yðkÞ ¼ y0 þ a uðk  iÞ (19)
wðk  1Þ i¼1 i u ¼ arg min J (22)
u

which corresponds to an impulse response model with a The explicit solution for the minimisation is defined as (Camacho
truncation order of 12 whose coefficients are scaled by the stack & Bordons, 2004)
current Ist . Fig. 7 shows a comparison of the oxygen excess ratio
lO2 and the output of the identified model at different operation u ¼ ðGT G þ gIÞ1 GT ðyref  f Þ (23)
points. It can be seen from the figure that the oxygen excess ratio 3.4.2. Constrained minimisation
lO2 adopts instantaneously a new value after a change in the stack In the constrained case the future control action is computed
current Ist whereas a variation in the compressor motor voltage by solving the following minimisation problem:
V cm shows a dynamic adoption of a new value for the oxygen
excess ratio lO2 . The reaction to changes in the stack current Ist u ¼ arg min J
u
and the compressor motor voltage V cm justify the chosen model s:t: Lupc (24)
structure. The impulse response (see Fig. 8) with 12 elements nc Nu nc
signifies that the compressor motor voltage V cm influences the where L 2 R and c 2 R being nc the number of constraints.
oxygen excess ratio lO2 over an interval of 120 ms. The minimisation problem can now be solved using quadratic
The validity of the identified model has been verified with a programming (QP). In the first step the cost function (21) can be
second data set obtained in experiments. This set was generated reformulated in the following form (without considering the
in open loop operation varying the compressor motor voltage constant terms of the original cost function):
in an interval of V cm ¼ ½0:5; 2 V and the stack current in Ist ¼ J ¼ 12uT Hu þ bu (25)
½3; 32 A, resulting in an oxygen excess ratio of lO2 ¼ ½2:5; 10. Fig. 9
T T
presents the comparison between the measured oxygen excess with H ¼ ðG G þ gIÞ and b ¼ ðf  yref Þ G. Finally, with the matrix
ratio lO2 and the output y of the identified model (19) for some H and the vector b already defined, the control signal can be
operation points. Furthermore the mean square error (MSE) computed using QP.
between model output and measured value during identification The proposed model predictive control structure to regulate
and verification of the prediction model (19) for different the oxygen excess ratio can now be implemented on the fuel cell
operation points was calculated and can be seen in Table 1. The as shown in Fig. 10.
good fit of the model output in Fig. 9 and the calculated MSEs for
the verification justify the use of the identified model.
4. Experimental results

3.4. Model predictive control of lO2 In the first step, several experiments with the fuel cell in open
loop were carried out. During these experiments the stationary
With the identified model (19) a linear MPC with parameter behaviour was tested with different values for the motor
adaptation to stack current changes was developed. In order to compressor voltage V cm and the load current Iload . The gathered
work with control increments instead of absolute values (19) was data was used to generate a stationary map correlating the net
transformed to a step response model. Based on the transformed power P net, the air flow rate W ca;in and the oxygen excess ratio lO2
model a Dynamic Matrix Control (DMC) (Cutler & Ramaker, 1980)
to regulate the oxygen excess ratio lO2 can be designed. With the 1
In MPC literature the weighting factor for the control increments is normally
DMC constraints in the control signal and the system output can denoted l. To avoid confusion with the oxygen excess ratio, the weighting factor is
be considered. represented by g.
ARTICLE IN PRESS

J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885 881

8 6.5
9
7
7 6
8

λO2 [−]

λO2 [−]

λO2 [−]
λO2 [−]

6 5.5
6
7
5
5
5 6
4
4.5
276.6 277 277.4 277.8 884.5 885 885.5 867.4 867.6 867.8 900.4 900.6 900.8
t [s] t [s] t [s] t [s]
8 12.5
9.5
7
12

Ist [A]
Ist [A]

Ist [A]
Ist [A]

12 9
10 5

4
8
3 11.5 8.5
276.6 277 277.4 277.8 884.5 885 885.5 867.4 867.6 867.8 900.4 900.6 900.8
t [s] t [s] t [s] t [s]

1.8 0.9
1.1 1

Vcm [V]
Vcm [V]
Vcm [V]

Vcm [V]

1.7 0.8 1
0.8
0.9
1.6 0.7
0.8 0.6
276.6 277 277.4 277.8 884.5 885 885.5 867.4 867.6 867.8 900.4 900.6 900.8
t [s] t [s] t [s] t [s]
Fig. 9. Results of the model verification in some operation points of the fuel cell with a comparison of the oxygen excess ratio lO2 and the output y of the identified model.
Top: oxygen excess ratio lO2 (solid line) and output of the identified model (19) (dash–dotted line), middle: stack current Ist , bottom: compressor motor voltage V cm .

Table 1 (see Fig. 11). The experimental results show that the obtained net
Mean square error between model output and measured value during identifica- power is almost constant for values lO2 44. Therefore, a value of
tion and verification of the prediction model (19) for different operation points.
lref
O2 ¼ 4 has been chosen for the setpoint of the oxygen excess
Oxygen excess ratio Identification Verification ratio. Note that the value for the reference can be changed
without affecting the proposed controller. It has to be mentioned
MSE, lO2 ¼ ½2:5; 3:5 0.0046 0.0055 that in many publications using a simulation model to show
MSE, lO2 ¼ ½3:5; 4:5 0.0105 0.0083 control strategies, e.g. Pukrushpan et al. (2004a) and Suh and
MSE, lO2 ¼ ½4:5; 5:5 0.0160 0.0146
Stefanopoulou (2005), the setpoint for the oxygen excess ratio is
MSE, lO2 ¼ ½5:5; 8:5 0.0286 0.0343
set to a value of 2. As in this article the proposed control strategy
ref
is applied to the physical fuel cell, the chosen setpoint lO2 ¼ 4
gives some additional security to avoid the starvation phenom-
enon. Fig. 11 also shows the stationary map of the fuel cell
simulation model. The comparison of the experimental results
Iload and the ones obtained with the simulation model (del Real et al.,
2007) shows in general a good fit, but presents a small offset in
the reached net power.
ref
λO2 Vst After determining a suitable reference for the oxygen excess
Fuel ratio, the MPC from Section 3.4 was implemented in LabVIEW in
λO2 Control Vcm λO2
cell the configuration shown in Fig. 10. The experiments showed that
Wca,in system Wca,in
system the unconstrained minimisation problem can be solved within the
sampling time of 10 ms. But it was observed that the built-in
supervisory system executes an emergency shutdown of the
fuel cell system in order to avoid oxygen starvation when the
compressor motor speed is reduced too fast. Therefore, constraints
Fig. 10. MPC control structure. in the increments of the control action were included in the
ARTICLE IN PRESS

882 J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885

120 slpm 160 slpm


100 slpm 140 slpm
80 slpm
1200 40A
60 slpm

35A
1000
30A
800
Pnet [W]
25A 25A
23A
600 20A 20A
19A
15A 15A
400 10A
10A

200 5A
40 slpm
10 slpm 20 slpm 30 slpm
0
0 1 2 3 4 5 6 7 8 9 10
λO2 [−]

Fig. 11. Stationary behaviour of the fuel cell. Comparison of model (del Real et al., 2007) for different stack currents Ist (dotted line) and air flow rates W ca;in (solid line) with
experimental data (dots).

minimisation problem in order to limit the maximum reduction of current in less than 100 ms. This fast reaction is important to
the compressor voltage and, as a consequence, the compressor reduce the starvation phenomenon probability. In the case of
motor speed. To solve the QP problem a built-in LabVIEW function positive deviations the error compensation by the controller takes
was used. Due to hardware limitations the MPC problem a longer time, in the example shown in the figure the compensa-
considering these constraints could not be solved within the tion requires approximately 500 ms. Although the controller
proposed sampling time of 10 ms. Therefore, the sampling time needs more time to compensate positive deviations, the peaks
had to be changed to ts ¼ 20 ms and the parameters of the do not harm the fuel cell as the oxygen excess ratio is bigger than
impulse response were adjusted adequately. the desired value and, as a consequence, clearly above critical
The constrained MPC with a sampling time of t s ¼ 20 ms was values.
implemented and tested extensively. For the prediction and In order to perform a sensitivity analysis with respect to
control horizons values of N ¼ 7 and N u ¼ 7 were chosen, varying ambient conditions, several tests with the proposed MPC
respectively. The control increments were weighted with a factor were carried out along 3 months. As a performance index the MSE
of g ¼ 8. The control signal and its increments are limited to has been used. To allow a better comparison, the performance
index for the system in steady state and for the system during
0:5 Vpuðt þ jjtÞp5:2 V; j ¼ 1; . . . ; N transitions is given in Table 2 for three different experiments
 0:06 VpDuðt þ jjtÞ; j ¼ 0; . . . ; Nu  1 (26) where the MPC was used to control the oxygen excess ratio to a
ref
value of lO2 ¼ 4. The calculation of the performance index for the
The system dynamics with respect to the stack current Ist transient behaviour was carried out with the experimental data
are much faster than the system reaction to changes in the reaching from 0.5 s before a step in the load until 1 s after applying
compressor motor voltage V cm (Pukrushpan et al., 2004b). the step. It has to be mentioned that the measured air
The different transient behaviours make it physically impossible temperature during the experiments varied between approxi-
to avoid the characteristic peaks (Pukrushpan et al., 2004a; mately 21.5 and 28:5 C. The MSEs indicate that the proposed MPC
Gruber et al., 2008) in the oxygen excess ratio after changes in the performs well, in spite of having considered in the design phase
stack current Ist with the proposed control strategy. Therefore, that the ambient conditions were fixed.
constraints in the system output were not considered, only the Finally, several experiments to compare the proposed MPC
already shown limitations in the control signal and its increments with the fuel cell’s built-in controller were carried out. Measure-
were used. ments showed that the original controller has a sampling time of
Fig. 12 presents some results of the fuel cell system controlled approximately 1 ms. Furthermore, it was observed that the built-
by the proposed MPC with stepwise changes in the external load in controller does not control the oxygen excess ratio to a constant
Iload . It can be seen that the controller stabilises the oxygen excess value, but to a variable value depending on the load current. To be
ratio around the desired value. After an increase in the load able to compare results, the reference given to the MPC has to
current the error in the oxygen excess ratio is compensated correspond to the value used by the built-in controller. Therefore,
rapidly. The longer peaks after a reduction of the load current are a reference generator for the MPC was developed from experi-
due to the restrictions in the control increments. The results show mental data generated with the built-in controller. The reference
that the applied MPC controls the system in a wide range for the generator calculates the desired value for the oxygen excess ratio
load current. Furthermore it can be observed in the results that based on the measured value of the load current. Using a
the stack voltage V st and the net output power P net reach steady predefined shape for the load current, experiments with the fuel
state shortly after the step in the load current was applied. cell stack controlled by the original controller and by the MPC
The results of Fig. 13 are based upon the same experiment were carried out. Fig. 14 shows some experimental results of the
presented in Fig. 12. The figure shows in detail the trajectory of the fuel cell controlled by the original controller and the constrained
oxygen excess ratio after changes in the load current. In the results MPC. The maximum deviation of the oxygen excess ratio after a
it can be observed that the constrained MPC reacts very fast to load current change is the same for both controllers. It can be
errors in the oxygen excess ratio. It compensates negative observed that the proposed control strategy compensates devia-
deviations from the desired value resulting from a rising load tions after a rising load current, as in the previous results, in less
ARTICLE IN PRESS

J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885 883

8
6

λO2 [−]
4
2
0
0 10 20 30 40 50 60
t [s]
Wca,in [slpm] 100

50

0
0 10 20 30 40 50 60
t [s]
40
Vst [V]

35

30
0 10 20 30 40 50 60
t [s]
30
Iload [A]

20
10
0
0 10 20 30 40 50 60
t [s]
Vcm [V]

3
2
1
0
0 10 20 30 40 50 60
t [s]
1000
Pnet [W]

750
500
250
0
0 10 20 30 40 50 60
t [s]

Fig. 12. Experimental results of fuel cell system controlled by the proposed MPC with stepwise changes in the load current.

8
6
λO2 [−]

4
2
0
0 10 20 30 40 50 60
t [s]
5 5 6.5

4.5 4.5 6

4 4 5.5
λO2 [−]

λO2 [−]

λO2 [−]

3.5 3.5 5

3 3 4.5

2.5 2.5 4

2 2 3.5
2.7 3 3.3 3.6 26.5 27 27.5 35 35.5 36 36.5 37
t [s] t [s] t [s]

Fig. 13. Behaviour of the oxygen excess ratio after stepwise changes in the load current. Experimental results from the fuel cell controlled by the proposed MPC.

than 100 ms. The comparison of the air flow rate W ca;in at the (20 ms for the MPC, 1 ms for the built-in controller). The figure
cathode inlet shows that the proposed MPC reacts much faster also shows for both controllers the stack voltage V st . As this
than the built-in controller, in spite of the higher sampling time measurement is read over the serial port with a sampling time of
ARTICLE IN PRESS

884 J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885

200 ms the comparison of the cell voltage does not permit a clear stack current changes. The control strategy has been tested and
statement. In general it can be observed that the built-in validated on a commercial stand-alone fuel cell. For that purpose,
controller reacts much slower than the MPC and requires more the original built-in controller had to be overridden and the
time to compensate deviations in the oxygen excess ratio. In order constrained MPC was implemented externally.
to compare the performance of the two controllers the sum of The experimental results of the fuel cell system controlled by
square errors (SSE) is given in Table 3 for the entire experiment the constrained MPC showed that the proposed strategy compen-
shown in Fig. 14 and for some sections of this experiment sates negative deviations in the oxygen excess in a fast way. The
containing setpoint changes. The SSEs and the results from Fig. 14 error compensation in less than 100 ms reduces the starvation
indicate that the proposed MPC performs better than the built-in phenomenon probability and increases the safety of the fuel cell.
controller and that the compensation of errors in the oxygen In the comparison of the proposed strategy with the original
excess ratio is carried out faster. controller it was observed that the constrained MPC reacts much
faster and stabilises the oxygen excess ratio around the desired
value approximately five times faster. The computation times to
5. Conclusions

A model predictive controller for the oxygen excess ratio, using Table 3
the compressor motor to regulate the air flow rate, has been Sum of square errors for the experiment shown in Fig. 14 and for some sections of
setpoint changes.
developed. The designed linear MPC uses parameter adaptation to
Performance index MPC Built-in c.
Table 2
Mean square error for several experiments with the proposed MPC. SSE, t ¼ ½0; 60 s 49.98 87.98
SSE, t ¼ ½2:5; 4 s 4.77 13.76
Performance index Experiment 1 Experiment 2 Experiment 3 SSE, t ¼ ½26; 27:5 s 1.02 3.50
SSE, t ¼ ½42; 43:5 s 0.35 0.84
MSE (steady state) 1:091  102 1:574  102 1:123  102 SSE, t ¼ ½23:5; 25 s 8.55 16.46
MSE (transition) 1:388  101 1:356  101 2:073  101
Comparison of the proposed MPC and the original built-in controller.

30
Iload [A]

20

10

0
0 10 20 30 40 50 60
t [s]
6 4
5 5
5
λO2 [−]

λO2 [−]

λO2 [−]

λO2 [−]

4 4 3
4
3 3
3 2
2.5 3 3.5 4 23.5 24 24.5 25 26 26.5 27 27.5 42 42.5 43 43.5
t [s] t [s] t [s] t [s]
60 60
50 65
Wca,in [slpm]

Wca,in [slpm]

Wca,in [slpm]

Wca,in [slpm]

40 50 50 60

30 55
40 40
2.5 3 3.5 4 23.5 24 24.5 25 26 26.5 27 27.5 42 42.5 43 43.5
t [s] t [s] t [s] t [s]
38 38 34
38
36 36 32
Vst [V]

Vst [V]

Vst [V]

Vst [V]

36 34 34
30
32 32
34 28
2.5 3 3.5 4 23.5 24 24.5 25 26 26.5 27 27.5 42 42.5 43 43.5
t [s] t [s] t [s] t [s]

Fig. 14. Comparison of the experimental results of the fuel cell system controlled by the MPC (solid line) and the original fuel cell controller (dashed line) with a variable
reference for the oxygen excess ratio (dotted line).
ARTICLE IN PRESS

J.K. Gruber et al. / Control Engineering Practice 17 (2009) 874–885 885

calculate the control signal and the reliability of the proposed Camacho, E. F., & Bordons, C. (2004). Model predictive control (2nd ed.). Berlin:
control strategy could be improved using a dedicated real-time Springer.
Cutler, C. R., & Ramaker, B. C. (1980). Dynamic matrix control—A computer control
controller. algorithm. In: Proceedings of the 1980 joint automatic control conference. San
Due to the fast dynamics the magnitude of the peaks of the Francisco, CA.
oxygen excess ratio after load current changes could not be del Real, A. J., Arce, A., & Bordons, C. (2007). Development and experimental
validation of a PEM fuel cell dynamic model. Journal of Power Sources, 173(1),
reduced. For the reduction of these peaks additional batteries 310–324.
or ultracapacitors can be used. With the additional equipment Gruber, J. K., Bordons, C., & Dorado, F. (2008). Nonlinear control of the air feed of a
supplying current peaks, the transient behaviour could be fuel cell. In: Proceedings of the 2008 automatic control conference. Seattle, WA
(pp. 1121–1126).
improved since the load requirements are smoothed.
Larminie, J., & Dicks, A. (2003). Fuel cell systems explained (2nd ed.). New York:
Wiley.
Olin, J. (1999). Industrial thermal mass flowmeters. Measurement & Control, 193,
Acknowledgements 83–90.
Pukrushpan, J., Stefanopoulou, A., Varigonda, S., Eborn, J., & Haugstetter, C. (2006).
Control-oriented model of fuel processor for hydrogen generation in fuel cell
Financial support by the Spanish Ministry of Education and applications. Control Engineering Practice, 14, 277–293.
Science under Grant DPI2007-66718-C04-01 is gratefully appre- Pukrushpan, J. T., Stefanopoulou, A. G., & Peng, H. (2004a). Control of fuel cell
breathing. IEEE Control Systems Magazine, 24, 30–46.
ciated. Pukrushpan, J. T., Stefanopoulou, A. G., & Peng, H. (2004b). Control of fuel cell
power systems: Principles, modelling and analysis and feedback design. In:
References Advances in industrial control. Berlin: Springer.
Rodatz, P., Paganelli, G., & Guzella, L. (2003). Optimization air supply control of a
PEM Fuel Cell system. In: Proceedings of the 2003 American control conference.
Almeida, P. E. M., & Simões, M. G. (2005). Neural optimal control of PEM fuel cells Rodatz, P., Paganelli, G., Sciarretta, A., & Guzzella, L. (2005). Optimal power
with parametric CMAC networks. IEEE Transactions on Industry Applications, management of an experimental fuel cell/supercapacitor-powered hybrid
41(1), 237–245. vehicle. Control Engineering Practice, 13, 41–53.
Arce, A., Ramirez, D. R., del Real, A. J., & Bordons, C. (2007). Constrained explicit Stefanopoulou, A. G., & Suh, K.-W. (2007). Mechatronics in fuel cell systems. Control
predictive control strategies for PEM fuel cell systems. In: Proceedings of the Engineering Practice, 15, 277–289.
46th IEEE conference on decision and control. Louisiana, LA (pp. 6088–6093). Suh, K.-W., & Stefanopoulou, A. G. (2005). Coordination of converter and fuel cell
Ballard (2003). Nexa power module user’s sanual. Burnaby, Canada: Ballard power controllers. In: Proceedings of the 13th Mediterranean conference on control and
systems Inc. automation. Limassol, Cyprus (pp. 563–568).
Bordons, C., Arce, A., & del Real, A. J. (2006). Constrained predictive control Suh, K.-W., & Stefanopoulou, A. G. (2006). Inherent performance limitations of
strategies for PEM fuel cells. In: Proceedings of the 2006 American control power-autonomous fuel cell system. In: Proceedings of the 2006 American
conference. Minneapolis, MN (pp. 2486–2491). control conference. Minneapolis, MN (pp. 490–495).
Boyd, S., & Chua, L. O. (1985). Fading memory and the problem of approximating Thounthong, P., & Sethakul, P., 2007. Analysis of a fuel starvation phenomenon
nonlinear operators with Volterra series. IEEE Transactions on Circuits and of a PEM fuel cell. In: Power conversion conference (PCC’ 07). Nagoya, Japan
Systems, CAS-32(11), 1150–1161. (pp. 731–738).

You might also like