**2. FC Hybrid Power System**

The synoptic architectures of the FC HPS and ESS are presented in Figure 1a. The FC power delivered on the DC can be controlled via the boost converter using the switching (SW) command generated by the boost controller under the EMS proposed in this paper. Also, the generated FC power depends on the fuel and air regulators controlled by the input references *IrefFuel* and *IrefAir*.

The Matlab-Simulink®diagram of the FC HPS architecture is presented in Figure 1b. The FC system is the main energy source to supply the load demand on the DC bus, which is modeled by an equivalent DC load for the inverter and an AC load in order to speed up the simulation.

The LF control will set the current reference *IrefLF* for the fuel flow rate (*FuelFr*) regulator to comply with the power flow balance on the DC bus (1), with the battery operating in charge-sustaining mode (2):

$$\mathbf{C}\_{\rm DC} \mu\_{\rm dc} d\mu\_{\rm dc}/dt = \eta\_{\rm boost} p\_{\rm FC,gen} + \, p\_{\rmESS} - \, p\_{\rm load} \, \tag{1}$$

$$P\_{ESS(AV)} \cong 0.\tag{2}$$

So, considering (2), (1) will be rewritten in the average value (AV) during a load cycle (LC) as (3):

$$0 = \eta\_{\text{lrowst}} P\_{\text{FC}\text{gen}(AV)} - P\_{\text{load}(AV)} \Rightarrow P\_{\text{FC}\text{gen}(AV)} = P\_{\text{load}(AV)} / \eta\_{\text{lrowst}} \tag{3}$$

Thus, the FC current generated by the FC system will be given by (4):

$$I\_{\rm FC(AV)} = P\_{\rm load(AV)} / \left(\eta\_{\rm boost} V\_{\rm FC(AV)}\right). \tag{4}$$

Consequently, the current reference *IrefLF* will be estimated by the LF control using the AV filtering method, based on the mean value (MV) technique of the FC current during a dithers' period:

$$I\_{refLF} \cong I\_{FC(AV)} = \,^\*P\_{\text{load}(AV)} / (\eta\_{\text{boost}} \, V\_{FC(AV)}) \tag{5}$$

The MV technique or another filtering technique can be used to smooth the values used in (5) for the safe operation of the FC system, thus avoiding fuel starvation due to sharp changes in load demand. The current reference *IrefLF* will set the fuel flow rate *FuelFr* value using the *FuelFr* regulator's relationship (6):

$$\text{FuelFr} = \frac{60000 \cdot R \cdot (273 + \theta) \cdot N\_{\text{C}} \cdot I\_{\text{LFnf}}}{2 \cdot F \cdot (101325 \cdot P\_{f(H2)}) \cdot (\mathcal{U}\_{f(H2)}/100) \cdot (\mathbf{x}\_{H2}/100)}.\tag{6}$$

Because of (5),

$$I\_{FC} \cong I\_{FC(AV)} \cong I\_{refLF}.\tag{7}$$

So, the current reference *Iref2* will optimally adjust the air flow rate (*AirFr*) value using the *AirFr* regulator's relationship (8):

$$AirFr = \frac{60000 \cdot R \cdot (273 + \theta) \cdot N\_{\mathbb{C}} \cdot \left(I\_{\mathbb{F}\mathbb{C}} + I\_{ref2}\right)}{4F \cdot (101325 \cdot P\_{f(O2)}) \cdot (\mathcal{U}\_{f(O2)} / 100) \cdot (y\_{O2} / 100)}.\tag{8}$$

Thus, the input references of the fueling regulators are set as follows: *IrefFuel* = *IrefLF* and *IrefAir* = *IFC* + *Iref2*.

The optimization function's optimum (computed in the block called "optimization function", in Figure 1) will be searched using the current reference *Iref1* that will set the FC current based on the 0.1 A hysteresis controller for the boost DC-DC converter.

A semi-active 100 Ah battery/100 F ultracapacitors ESS topology was chosen to dynamically compensate power in (1) and stabilize the DC voltage at 200 V (*uDC* - 200 V). The battery will operate in charge-sustaining mode due to the LF control applied to the fuel regulator (6), which will set the FC power close to the requested FC power on the DC bus. The FC power is *PFCgen*(*AV*) given by (3) if (2) is considered. Thus, the battery will compensate the minor imbalance in energy flow on the DC bus (1) due to the changes in load profile or the small difference between the FC current set by the LF control (5) *IFC* - *ILFre f* - *IFC*(*AV*) = *Pload*(*AV*)/(η*boostVFC*(*AV*)) and the value *IFC* + *Ire f* <sup>2</sup> set by the GES-based optimization loop (which is applied to the air regulator (7)). So, a 100 Ah capacity of the battery has been obtained for a 1 kW imbalance in energy flow during a 12 s load cycle using the design relationships from [5,7]. This capacity is more than sufficient, considering the sizing design presented in [2]. The sharp changes in load profile, such as pulses, can produce an imbalance in power flow on the DC bus (1) due to the large response time of the FC system and the battery, which is in the order of hundreds of milliseconds and tens of minutes, respectively. During the transitory regimes of the FC system and battery, the ultracapacitors' stack will dynamically compensate the power flow on the DC bus (1) via the bidirectional DC-DC power converter. The 100 F capacitance was obtained for a 1 kW/100 ms pulse using the design relationships from [5,7]. The DC voltage regulation was implemented on the ultracapacitors' stack side due to the slow response of the FC system, but also because the controlled inputs *AirFr* and *FuelFr* (via the fueling regulator) of the FC system and the controller of the FC boost converter are involved in the LF and optimization loops. Thus, if the DC voltage regulation will be implemented on the FC system's side using a proportional–integral–derivative (PID) compensation technique of one of the aforementioned loops, then a degradation of the performance indicators will be obtained compared with the cases when the DC voltage regulation is implemented

on the ultracapacitors' stack side or on the battery's side if an active ESS topology is selected instead of a semi-active type. If an active mitigation of the pulses on the DC bus must be implemented, then an active control of the bidirectional DC-DC power converter should be implemented in order to generate an anti-pulse from the ultracapacitors' stack [5,7]. In this case, the DC voltage regulation remains to be implemented on the battery side using a PID compensation technique of the control designed to compensate the minor imbalance in energy flow on the DC bus (1). The high frequency ripple on the DC voltage will be mitigated in all cases by a 100 μF capacitor (*CDC*) designed using the design relationships from [5,7].

The FC parameters (*NC*, θ, *Uf*(*H*2), *Uf*(*O*2), *Pf*(*H*2), *Pf*(*O*2), *xH*2, *yO*2*)* were set for a 6 kW FC system, and *R* = 8.3145 J/(mol K) and *F* = 96485 As/mol are two well-known constants. The energy efficiency of the boost DC-DC converter may be considered constant in this study *(*η*boost* = 0.9), because the boost controller operated in continuous current mode in the load range higher than 1 kW (so the case of light load was not considered), where the energy efficiency may vary in the range of 88% to 92%, but without significantly modifying the results obtained for a constant efficiency (as will be explained in the Discussion section).

The current references *Iref*<sup>1</sup> and *Iref*<sup>2</sup> were generated by the GES controller shown in Figure 2, as will be explained in next section.

**Figure 1.** *Cont*.

**Figure 1.** (**a**) The synoptic architectures of the fuel cell hybrid power system (FC HPS) and energy storage system (ESS). (**b)** The diagram of the FC HPS.

**Figure 2.** The diagram of the global extremum seeking (GES) control.

## **3. Energy Management Strategy**

Each GES control was implemented (see Figure 2) based on the relationships from [30]. The dither's frequencies were chosen to be *fd*<sup>1</sup> = 100 Hz and *fd*<sup>2</sup> = 2*fd*<sup>1</sup> = 200 Hz in order to improve the dithers' persistence by interference of the harmonics due to the nonlinear characteristics of the FC system. The cut off frequencies of the low-pass filter (LPF1 and LPF2 in Figure 2) and the high-pass filter (HPF1 and HPF2 in Figure 2) were set by the parameters *bl* = 1.5 and *bh* = 0.1. The tuning parameters were

designed based on relationships presented in [30], as follows: *k*<sup>1</sup> = 1, *k*<sup>2</sup> = 2. The normalization values of the input (the optimization function *y* = *f*(*v*1, *v*2), where *v*<sup>1</sup> and *v*<sup>2</sup> are the search variables) and the outputs (the reference currents *Ire f* <sup>1</sup> and *Ire f* <sup>2</sup> for the boost controller and the air regulator) were set to *kN f* = 1/*Y*max = 1/1000, *kNv*<sup>1</sup> = *X*max1= 50 and *kNv*<sup>2</sup> = *X*max2= 20. The normalization values were not strict, because the GES control was of the adaptive type, but choosing the right value would improve the searching speed. Readers interested in analyzing and designing a GES control for FC systems or PV, WT, and PV/WT FC HPSs may read [14,17] or [22,23,32], [33], and [35], respectively.

The searching speed was limited to 100 A/s by the slope limiters included in the *FuelFr* and *AirFr* regulators in order to ensure the safe operation of the PEM FC system. So, the FC current could increase up to 20 A during the FC time constant (*TFC*) of 0.2 s. The GES algorithm needed about 10 periods of dither (*Td*) to find the Global Maximum Power Point (GMPP) of the PV system for different steps in irradiance (because there was no limitation related to searching slope in this case, excepting the safe values given by the devices used in the boost the boost DC-DC power converter, which were very high compared to 100 A/s) [22,23]. Considering 10 dither periods to find the maximum efficiency point (MEP) of the FC system or the optimization function's optimum (which is defined in relation to the FC system's performance indicators), to avoid limitation due to FC response time, it was recommended to choose:

$$T\_{d(\max)} \cong T\_{\text{FC}} / 10. \tag{9}$$

This means *Td(max)* - 20 ms, so *fd(min)* - 50 Hz. The maximum frequency of the dither would be considered *fd(max)* = 200 Hz in order to have an acceptable increment per dithers' period (about 0.5 A per *Td(min)* = 5 ms). So, the frequency range of the dither was 70 Hz to 220 Hz, with a 30 Hz step in evaluation of the fuel economy based on the optimization function *f* defined by (10) [35]:

$$f(\mathbf{x}, A \text{ir} Fr, \text{Fuel} Fr, \text{P}\_{\text{Load}}) = k\_{\text{net}} \cdot P\_{\text{FCant}} + k\_{\text{fuel}} \cdot \text{Fuel}\_{\text{eff}}.\tag{10}$$

$$\dot{\mathbf{x}} = \mathbf{g}(\mathbf{x}, A \dot{\mathbf{r}} F r, \mathbf{F} \mathbf{u} \text{el} \mathbf{F} r, \mathbf{P}\_{\text{Load}}), \; \mathbf{x} \in \mathcal{X}; \tag{11}$$

where (11) models the dynamic part of the FC HPS [36], *x* is the state vector, and *PLoad* is the disturbance. The weighting coefficients *knet* (1/W) and *kfuel* (liters per minute (lpm)/W) were defined in accordance with the chosen EMS objective. For example, the FC system energy efficiency *(*η*sys* = *PFCnet*/ *PFC*) was maximized if *knet* = 1 and *kfuel* = 0 (in this case *f* = *PFCnet*). If *knet* = 1 and *kfuel* 0, then the fuel consumption efficiency (*Fuele*ff - *PFCnet* / *FuelFr*) was also considered in the optimization function. So, it was possible to improve the fuel economy for a value of the *kfuel* weighting coefficient in range 5 lpm/W to 50 lpm/W, with 5 lpm/W step in evaluation of the fuel economy.

The LF control was implemented based on (5) in order to set the value of the FC net power requested by power flow balance (3). So,

$$P\_{\rm FC,gen} = P\_{\rm FCnet} \cong P\_{\rm load} \;/\; \eta\_{\rm boost} \,\tag{12}$$

where,

$$P\_{\text{FCnet}} \cong P\_{\text{FC}} - P\_{\text{cm}};\tag{13}$$

$$P\_{cm} = I\_{cm} \cdot V\_{cm} = \left( a\_2 \cdot A \dot{r} F r^2 + a\_1 \cdot A \dot{r} F r + a\_0 \right) \cdot \left( b\_1 \cdot I\_{\text{FC}} + b\_0 \right). \tag{14}$$

The air compressor power (*Pcm*) was estimated with (14), considering the coefficients [37]:*a*<sup>0</sup> = 0.6, *a*<sup>1</sup> = 0.04, *a*<sup>2</sup> = −0.00003231, *b*<sup>0</sup> = 0.9987, and *b*<sup>1</sup> = 46.02.

In order to not exceed the maximum FC power, the range of the load demand was considered from 2 kW to 8 kW, with a 1 kW step in the evaluation of the fuel economy.

The total fuel consumption, *FuelT* = *FuelFr*(*t*)*dt*, will be estimated in the next section for different load levels in order to evaluate the fuel economy, measured in liters (L).
