Integration of a Multi-Stack Fuel Cell System in Microgrids: A Solution Based on Model Predictive Control

: This paper proposes a multi-objective model predictive control (MPC) designed for the power management of a multi-stack fuel cell (FC) system integrated into a renewable sources-based microgrid. The main advantage of MPC is the fact that it allows the current timeslot to be optimized while taking future timeslots into account. The multi-objective function solves the problem related to the power dispatch at time that includes criteria to reduce the multi-stack FC degradation, operating and maintenance costs, as well as hydrogen consumption. Regarding the scientiﬁc literature, the novelty of this paper lies in the proposal of a generalized MPC controller for a multi-stack FC that can be used independently of the number of stacks that make it up. Although all the stacks that make up the modular FC system are identical, their levels of degradation, in general, will not be. Thus, over time, each stack can present a di ﬀ erent behavior. Therefore, the power control strategy cannot be based on an equal distribution according to the nominal power of each stack. On the contrary, the control algorithm should take advantage of the characteristics of the multi-stack FC concept, distributing operation across all the stacks regarding their capacity to produce power / energy, and optimizing the overall performance. Split the power reference equally between the di ﬀ erent fuel cells; (2) Daisy Chain: Distributes the power reference sequentially to the stacks; and (3) Optimization-based distribution. The power reference is shared between the di ﬀ erent FCs to achieve the highest e ﬃ ciency available at that power reference. Results show that the equidistribution method provides results close to those of a single stack FC system, while the daisy-chain distribution method


Introduction
The beginning of a new decade is always expected as a period of new challenges and opportunities, but the period 2020-2030 has started with global problems that directly and seriously affect humanity. There are many voices that warn about current and future climate change impacts on human health, and how our societies can lessen those adverse impacts through adaptation strategies and by reducing greenhouse gas emissions [1]. In this sense, governments from different parts of the world and with different political ideology, agree on the need for a worldwide effort during this decade to offset the fossil fuel depletion and reduce the greenhouse gas emission. Then, the European Commission and the United States Department of Energy (DOE) have set their targets for 2030 in the promotion of renewable energy sources (RES), sharing up to 27% of energy from renewables [2,3]. Meanwhile, China's National Development and Reform Commission (NDRC) has set a draft policy to increase the RES target from 20% to 35% by 2030 [4]. Therefore, the global population has not only started the current decade facing a human health threat but also must end the decade by solving the challenges of climate change.  [11] Single stack 10 kW --- [12] Single stack 10-50 kW --- [13] Single stack 150 kW --- [

Materials and Methods
The microgrid under study was based on the production of energy entirely obtained from renewable resources, which guaranteed the production and storage of energy with zero CO 2 emissions, Figure 1. The microgrid included different renewable energy generation systems consisting of a 15 kWp photovoltaic plant (5 kWp monocrystalline technology, 5 kWp polycrystalline technology, and 5 kWp thin-film technology), along with a hydrogen system composed by a modular fuel cell of 7.5 kWe made up of 3 stacks of 2.5 kW each, a 10 kWe alkaline electrolyzer (7 kWe for the bipolar electrolytic stack and 3 kWe for auxiliaries), and a lead-acid battery storage bank with a storage capacity of 36 kWh [22].
It is located on "La Rábida" Campus, at the University of Huelva (Huelva is located in the southwest of Spain), and according to its topology, all the generation and consumption systems were connected to an internal DC bus supported by a battery bank. The renewable generation was provided by solar radiation, which allowed the production of up to 15 kWp from PV panels. To guarantee the power balance at all times, there were 2 ESSs available. The first ESS was a 36 kWh lead-acid battery bank; the direct connection of this battery bank to the internal DC bus avoided the need for power conditioners to guarantee the regulation of the bus voltage. The second ESS was a hydrogen loop, consisting of an alkaline electrolyzer that produces 2 Nm 3 /h of hydrogen under a rate load power of 10%-100% and efficiency of 85%. Additionally, a 7.5 kWe modular multi-stack FC system acted as a hydrogen consumer with an efficiency of 47%, and a compressed hydrogen storage tank of 1 Nm 3 and 30 bars (this is equivalent to 88 kWh; that is 2.4 times the energy stored in the battery bank). This hydrogen loop allowed achieving a power-to-hydrogen and hydrogen-to-power roundtrip efficiency around 40%. Finally, all the power conditioning, as well as the bidirectional power flow between the main power grid and the microgrid, were guaranteed by DC/DC and DC/AC power converters.
As has been commented in Section 1, one of the options for improving FC effectiveness, extending its lifespan, and reducing costs, were to use such stacks in a modular architecture to develop scalable power FC systems as needed [23]. Using a modular architecture to implement the FC system as a connection of independent stacks (multi-stack) aimed to meet with the power demand (with one, several, or all stacks running) while taking into account the level of stacks degradation and O&M costs. This allowed the microgrid energy management system (EMS) to control the multi-stack FC system according to technical and economic criteria, leading to optimized behavior, reducing the degradation, preserving the lifespan, and minimizing the hydrogen consumption [24]. As has been commented in Section 1, one of the options for improving FC effectiveness, extending its lifespan, and reducing costs, were to use such stacks in a modular architecture to develop scalable power FC systems as needed [23]. Using a modular architecture to implement the FC system as a connection of independent stacks (multi-stack) aimed to meet with the power demand (with one, several, or all stacks running) while taking into account the level of stacks degradation and O&M costs. This allowed the microgrid energy management system (EMS) to control the multi-stack FC system according to technical and economic criteria, leading to optimized behavior, reducing the degradation, preserving the lifespan, and minimizing the hydrogen consumption [24].
An additional advantage of a multi-stack configuration was the possibility to discriminate one of them in the case of located damage or excessive losses, avoiding the disconnection of the entire FC system. These characteristics provided high flexibility and scalability, robustness, reliability, and good performance to the microgrid [19,25].
Considering n identical stacks (Figure 2a), our experience says that even in the beginning, when all stacks are brand new, there is a great possibility that their behaviors will be different. Of course, with time and use, the differences in the stacks' behavior will be increasingly evident. Therefore, the control strategy cannot be based on an equal distribution according to each stack nominal power. On the contrary, the controller should take advantage of the characteristics of the multi-stack FC concept, distributing operation in each stack and optimizing overall performance. That is, the input to the MPC controller will be the reference power established by the EMS, and based on technical and economic criteria, the MPC defines the setpoint of each stack. To carry out this distribution, the control system must always know the real state of each stack to determine its real capacity to produce energy. Figure 2b shows a branch of the fuel cell (stack + BoP + power electronics), and Figure 2c the complete multi-stack real fuel cell system integrated into the microgrid (see Figure 1). The stacks are based on the FCgen-1020ACS model from Ballard ® (Seattle, WA, USA). It is a polymer electrolyte membrane (PEM) stack made up of a stack with 80 single planar cells in series, with an active surface of 0.0145 m 2 /cell. Its current nominal power is 2.5 kW [26]. Technical characteristics are reported in Table 2. An additional advantage of a multi-stack configuration was the possibility to discriminate one of them in the case of located damage or excessive losses, avoiding the disconnection of the entire FC system. These characteristics provided high flexibility and scalability, robustness, reliability, and good performance to the microgrid [19,25].
Considering n identical stacks (Figure 2a), our experience says that even in the beginning, when all stacks are brand new, there is a great possibility that their behaviors will be different. Of course, with time and use, the differences in the stacks' behavior will be increasingly evident. Therefore, the control strategy cannot be based on an equal distribution according to each stack nominal power. On the contrary, the controller should take advantage of the characteristics of the multi-stack FC concept, distributing operation in each stack and optimizing overall performance. That is, the input to the MPC controller will be the reference power established by the EMS, and based on technical and economic criteria, the MPC defines the setpoint of each stack. To carry out this distribution, the control system must always know the real state of each stack to determine its real capacity to produce energy. Figure 2b shows a branch of the fuel cell (stack + BoP + power electronics), and Figure 2c the complete multi-stack real fuel cell system integrated into the microgrid (see Figure 1). The stacks are based on the FCgen-1020ACS model from Ballard ® (Seattle, WA, USA). It is a polymer electrolyte membrane (PEM) stack made up of a stack with 80 single planar cells in series, with an active surface of 0.0145 m 2 /cell. Its current nominal power is 2.5 kW [26]. Technical characteristics are reported in Table 2.

Model Predictive Control (MPC) for Multi-Stack FC System
Regarding the microgrid scheme shown in Figure 1, the EMS was responsible for defining the operating point of each source. In the case of the FC system, the EMS provided the power reference that the FC system must supply to the internal bus.

Model Predictive Control (MPC) for Multi-Stack FC System
Regarding the microgrid scheme shown in Figure 1, the EMS was responsible for defining the operating point of each source. In the case of the FC system, the EMS provided the power reference that the FC system must supply to the internal bus.
Based on the advantages that a multi-stack FC system presents, the MPC controller receives the power reference (Figure 2a), and it will decide the power setpoints under a multi-objective scenario that involves both technical and economic criteria in the multi-stack FC system, that is: To guarantee the power demand, to reduce the degradation, minimize the hydrogen consumption, and secondarily to diminish the operating costs.

Generalized Model for Multi-Stack FC System with n Stacks
In a general way, MPC theory makes explicit use of the plant model to optimize its expected future behavior. Then, a suitable model of the plant allows the MPC controller to lead it to its best performance. Based on the above, the first step to carry out the controller design was to dispose of an appropriate plant model that allows predicting the future behavior of the plant. In this section, the generalized model of the multi-stack FC system with n stacks will be depicted. The proposed model was defined as a linear parameter variant (LPV) model, which allowed defining the non-linear behavior of the multi-stack FC system as a linearized model in each sampling period [21].

Multi-Stack FC System Power
In accordance with the architecture under study, the predicted output power of the multi-stack FC system, P sys , will be determined by the sum of the individual operating powers of each of the n stacks, P f c x , x = 1 . . . n, at each sampling time k, Expression (1).

Multi-Stack FC System Degradation
Regarding the multi-stack FC system degradation, due to the fact that its operating conditions strongly influence its lifespan [27], each stack degradation, D f c x , will be quantified in terms of its voltage drop considering the operating hours and cycles (V/h), ∆V f c_x time , with respect to its nominal operating conditions, P f c Nx . Voltage drop, ∆V f c_x time , is an experimentally calculated parameter. It quantifies the voltage drop of one cell based on the number of hours and operation cycles under nominal operating conditions [28]. For simplicity, a linear relationship among the degradation factor and the working power was assumed. This assumption was based on the experience of the authors with numerous tests and works with fuel cells with different nominal power and their operation under different working conditions. As a result of this research, it was shown that the degradation parameter normally provided by the manufacturers was not constant and depended directly on the operating current/power due to the interaction between these variables and the temperature and humidity on the membrane. Similar considerations have been obtained in scientific works such as [29,30]. The instantaneous minimization of the degradation parameter related to each stack did not guarantee the long-term optimization of the multi-stack system. The controller required the accumulated degradation value of each stack. Therefore, stack degradation, D f c x was calculated from the integral of its accumulated degradation, Expression (2).
Discretizing Equation (2) according to the backward-Euler method, a linear model can be obtained to determine the accumulated degradation considering the instantaneous delivered power, Expression (3). where: Groups all the terms that multiply; P f c x (k) associated to stack x at sampling time k (V/W).
Based on each stack degradation, it is possible to determine the remained rated power value, P f c Nx (k + 1), according to the accumulated stack degradation, D f c x , and the nominal current, I f c Nx , at sampling time k, Expression (4):

Multi-Stack FC System Cost
The operating cost of each stack, C f c x , in €, will be defined by 2 power variable terms associated with the operation and maintenance (O&M) costs and the depreciation cost [31]. The last term will be defined by the equipment acquisition cost, C x 0 , the degradation associated with the operating power, Energies 2020, 13, 4924 8 of 24 D x , and the maximum expected degradation, D f c max , Expression (5). Unlike the degradation term, the optimization of the overall multi-stack FC system cost can be ensured by minimizing the economic cost function in each sampling period. For this reason, it was not necessary to take into account the accumulated cost. where: Groups all the terms that multiply P f c x (k) associated with stack x at sampling time k (€/W) Considering the Expression (5), the overall cost of the multi-stack FC system, C sys , can be calculated as the sum of the individual costs, Expression (6).

Multi-Stack FC System Hydrogen Consumption
Regarding the molar hydrogen consumption ratio for each stack, . n H2 , it can be calculated considering the Faraday Law [7], which defines linearity with respect to operating current, I f c x (k), as it is expressed in (7).
Considering the operating stack voltage in each sampling period, V f c x (k), it is possible to obtain the expression of the hydrogen consumption ratio, in volume, of each stack, H 2 x , as a function of the operating power, as expressed in (8). Like the cost term, the optimization of the overall hydrogen consumption can be ensured by minimizing the consumption ratio in each sampling period. For this reason, it is not necessary to take into account the accumulated consumption.
where: r x (k): Groups all the terms that multiply P f c x (k) associated to stack x at sampling time k (Nm 3 /Wh). (8), the overall hydrogen consumption of the multi-stack FC system, H 2 sys , can be calculated as the sum of each individual consumption, Expression (9).

Considering the Expression
If the stack operating voltage cannot be obtained through direct measurement, it can be estimated from its polarization curve and the accumulated stack degradation, Expression (10). Due to the slow dynamics of this type of system, it is possible to use sampling periods of the order of 10s of seconds, without affecting the performance of the system. Based on the above, the use of static models, such as the polarization curve, allows in a simplified way to obtain an acceptable approximation of the fuel cell's behavior. where: a, b, c, d, e: Fuel cell parameters for voltage model. With the premises considered in Sections 3.1.1-3.1.4, the generalized LPV discrete state-space model for a multi-stack FC system consisting of n stacks for a given sampling time T s was presented in (11a) and (11b). This can be expressed in the most compact way as (12).
Each row in the state Equations (11a) and (11b) can be obtained as follows: D f c 1 (k + 1) to D f c n (k + 1) from Equation (2). Regarding the power generated by the multi-stack FC system, P sys (k), row n + 1, it can be obtained from Expression (1). The overall cost, C sys (k), row n + 2, can be defined from each individual cost and its sum, Equations (5) and (6), respectively. Finally, hydrogen consumption, H 2 sys (k), row n + 3, comes from (8) and (9).
Regarding v D f c 1 (k) to v H 2sys (k), represent model disturbances, which are approximated as the error between the value estimated by the model and the real value measured directly on the plant in the previous sample time k − 1. where: As can see in Expression (11a), (11b) and (12), the model proposed allows the inclusion of uncertainties in the degradation parameter in the form of perturbations in the output vector. This disturbance vector was estimated based on the difference between the real value obtained from a stack voltage and the value obtained by the model in the previous instant. Thanks to the inclusion of this parameter and the use of predictive control techniques, an intrinsic feedforward action was integrated to estimate the error committed in the model and the correction in the control law.

MPC Controller
This section describes the formulation of a predictive controller for optimal power generation of a multi-stack FC system, considering constraints, and technical and economic parameters. In this case, a linear constrained MPC controller has been used, in which the solution of the optimization problem is done by Quadratic programming (QP).
The main objective of the controller was always to guarantee the operating power defined by the EMS that governs the microgrid. The second objective was to operate the FC system under optimal considerations, increasing its lifespan, and reducing the operating losses and cost. For this purpose, the controller calculates the optimal power distribution of the multi-stack FC system, considering the accumulated equipment degradation, current hydrogen consumption, and operating cost.
The proposed control scheme is shown in Figure 3, where n manipulated variables have been assigned to the controller, corresponding to the output power of each of the stacks in the modular system, P f c x (k).
The multi-stack FC system outputs have been defined as the instantaneous degradation of each stack, D f c x (k), as well as the total generated power, P sys (k), total hydrogen consumed, H 2 sys (k), and operating and maintenance cost of the complete multi-stack FC system, C sys (k).
Finally, the controller receives the power setpoint of the multi-stack FC system, P REF (k), calculated by the overall microgrid EMS in each sampling time k. This strategy allows the power reference of the modular system to be included in the control scheme.
In this controller proposal, it is posed a tracking problem, in which the main objective of the control system is established, the tracking of the reference power, ( ). Similarly, the cost function presents an economic optimization problem, in which individual fuel cell degradations are considered, as well as the system cost and hydrogen consumption. This raises a multi-objective optimization problem, which allows a more conservative use of the system from a technical and economic point of view according to the weighting factors, ( ).
Finally, a term associated with the weighting of the change in operating power is included, ∆ ( ), thus that operating conditions related to system dynamics can be established, with the appropriate tuning of the weighting factors, ( ). Based on the above, and particularizing (13) for the LPV system model, (11), the designed cost function is presented in (14):

Objective Function
According to the general formulation of the MPC controller, the objective function to be solved at each sampling time k is given by Expression (13). (13) where: N p : Prediction horizon. N u : Control horizon. α( j): Weighting factor of output tracking error.
y(k + j k): Output prediction at sampling time k + j based on measurements known at sampling time k. r(k + j): Output reference at sampling time k + j. λ( j): Weighting factor that penalizes, from sampling time k, changes in the control action. ∆u(k + j − 1): control action at sampling time k + j − 1.
In this controller proposal, it is posed a tracking problem, in which the main objective of the control system is established, the tracking of the reference power, Similarly, the cost function presents an economic optimization problem, in which individual fuel cell degradations are considered, as well as the system cost and hydrogen consumption. This raises a multi-objective optimization problem, which allows a more conservative use of the system from a technical and economic point of view according to the weighting factors, α(k).
Finally, a term associated with the weighting of the change in operating power is included, ∆P f c x (k), thus that operating conditions related to system dynamics can be established, with the appropriate tuning of the weighting factors, λ(k).

Constraitns
Model predictive control is an optimization control algorithm that allows managing constrained optimization problems. In general, the optimization problem allows considering constraints of the output vector and magnitude and dynamics of the control vector, Expression (15). These constraints are normally restrictions imposed by the operating conditions of the real plant.
Restrictions on system output variables, D f c x (k), P sys (k), C sys (k) and H 2 sys (k) are imposed by the real limits, i.e., always degradation, cost, and hydrogen consumption must be positive values, and the multi-stack FC system output power should obviously be lower than the sum of individual stacks nominal power in the sampling time k.
Similarly, the maximum operating power of each stack, P f c x (k), will be given by the nominal power value considering the accumulated degradation, P f c Nx (k).
Finally, with the aim of making conservative use of the stacks, the constraints regarding the power slew rate for the manipulated variables, ∆P f c x (k), are established.
Based on the above, and particularizing (15) for the LPV system model, Expression (11a) and (11b), the system constraints are presented in (16):

Tuning
The main objective of the MPC controller was to ensure that the power reference demanded by the EMS was met, fulfilling the premises of minimum degradation of the stacks and minimum costs and losses of the multi-stack FC system. Considering the objective function, Expression (14), the tuning of the weighting factors (α x , α n+1 , α n+2 , α n+3 , and λ x , being, x = 1 . . . n,) will allow the problem to be tailored to the fundamental objective determined by the design criteria.
Assuming there is a great amount of controller parameters, the analytical tuning process can be very complex, and that is why it was proposed to face it in a heuristic way. To that end, a set of cause-effect relationships that can help the tuning process was defined.
In the first instance, to increase the lifespan of the multi-stack FC system, the tuning analysis focused on the power distribution according to the accumulated degradation of each stack. In this way, the stack that develops higher degradation will have a greater associated weighting factor inside the objective function (penalty), Expression (14), which will limit its operating power to the detriment of those stacks with less accumulated degradation. For this purpose, α x must have a high value and it is estimated considering the accumulated degradation with respect to the maximum one.
In response to the main objective of the controller, to assure the reference power at all times, the weighting factor associated with the output power tracking error, α n+1 , must have a high value (it acts as a strong constraint), in such a way that any difference between P sys (k) and P REF (k) should be penalized.
The weighting factor α n+2 determines the weight of the economic objective in the optimization problem. Because the cost term is closely related to the multi-stack FC system degradation, the increase in the lifetime of the system will be translated in a parallel way into a cost reduction. Considering the fundamental objectives of the controller, the reduced value of the weighting parameter will be used, thus that the weight of this term was reduced, in favor of the technical optimization.
Weighting factor α n+3 was related to the hydrogen consumption of the multi-stack FC system, thus that the use of a high value of the weighting factor will result in more balanced power distribution between stacks thus that the hydrogen resource is used more efficiently. Increasing system performance was a fundamental objective in the design criteria of the controller, and, therefore, a relatively high value of the associated weighting parameter is used.
Finally, the term associated with the control effort, λ x , can be used to reduce power variations and, therefore, avoid abrupt changes in the power setpoints of the stacks. As the sampling period was relatively large (in fact, in practice, it was set at 1 minute), and considering the restrictions on power variation, reduced values of this parameter can be used, thus that the penalty for variation of the operating point was not a critical parameter.
Based on the design criteria and after some trial and error cycles, the controller parameters were heuristically tuned (please, see Table 3). (*) Initially, the same degradation is considered for all the stacks. As each stack is put into operation, the respective accumulated degradation varies.

Results
The MPC control strategy presented in this work has been carried out under Matlab ® environment, simulating an interval of 1125 days. This interval has been determined considering the time when the first stack of the multi-stack FC system reaches the end of its lifespan in the most favorable case. Given that the stack degradation has been quantified in terms of the voltage drop, the criterion taken to establish that a stack has reached the end of its useful life has been that this voltage has dropped 100 mV/cell. In this case, as each stack was made up of 80 cells, the voltage drop at the stack output will be 8 V with respect to its nominal operating conditions.
To analyze the effectiveness of the proposed MPC controller in terms of extending the stack lifespan, minimizing hydrogen consumption, and reducing costs, according to the multi-objective, the multi-stack configuration was compared with two other FC systems. The first one was a single-stack FC system of 7.5 kW (the nominal power of the single-stack FC system coincides with the sum of the three stacks-based FC system proposed by authors). The model was similar to that developed in Section 3.1 but considering a single stack that must always supply the demanded power. The second comparison was made with a multi-stack FC system (also three stacks) that works under an equidistribution strategy that shares the required power between the stacks uniformly. Table 4 shows the degradation rates associated with stacks in all the considered cases, according to the number of cells, and the average, maximum, and minimum values determined by the tolerances given by the manufacturer [26]. As has been commented in Section 3.1.2, the degradation rate was an experimentally calculated parameter. For this purpose, a cell voltage monitoring system (CVM) was used [27]. This CVM monitors the cells' voltage with the aim to evaluate the total degradation accumulated by the stack (stack degradation is the sum of cell degradation). For the single-stack FC system, the considered degradation rate corresponded to the average degradation of the multi-stack FC system.
The sampling time chosen was 1 minute since it was short enough considering that the objective of the paper was to check the performance of the strategy along the whole lifetime of the FC system (1125 days). Figure 4a shows the power profile that the EMS of the microgrid demands from the FC system (please see Figure 3). This power profile has been chosen because it allows achieving different power steps that force the multi-stack FC system works in different operating regimes and, therefore, allow to validate the MPC controller performance. The same profile was repeated for the 1125 days with the aim to compare three fuel cell systems along all is lifespan. To carry out this comparison, a common load profile repeated during the whole period was needed. Figure 4b shows the reference power tracking performance for the three cases. The reference power is always met by the FC system in the three cases.
of the three stacks-based FC system proposed by authors). The model was similar to that developed in Section 3.1 but considering a single stack that must always supply the demanded power. The second comparison was made with a multi-stack FC system (also three stacks) that works under an equidistribution strategy that shares the required power between the stacks uniformly. Table 4 shows the degradation rates associated with stacks in all the considered cases, according to the number of cells, and the average, maximum, and minimum values determined by the tolerances given by the manufacturer [26]. As has been commented in Section 3.1.2, the degradation rate was an experimentally calculated parameter. For this purpose, a cell voltage monitoring system (CVM) was used [27]. This CVM monitors the cells' voltage with the aim to evaluate the total degradation accumulated by the stack (stack degradation is the sum of cell degradation). For the single-stack FC system, the considered degradation rate corresponded to the average degradation of the multi-stack FC system. The sampling time chosen was 1 minute since it was short enough considering that the objective of the paper was to check the performance of the strategy along the whole lifetime of the FC system (1125 days). Figure 4a shows the power profile that the EMS of the microgrid demands from the FC system (please see Figure 3). This power profile has been chosen because it allows achieving different power steps that force the multi-stack FC system works in different operating regimes and, therefore, allow to validate the MPC controller performance. The same profile was repeated for the 1125 days with the aim to compare three fuel cell systems along all is lifespan. To carry out this comparison, a common load profile repeated during the whole period was needed. Figure 4b shows the reference power tracking performance for the three cases. The reference power is always met by the FC system in the three cases.   The stacks degradation is represented in Figure 5. DFCsingle-stack corresponds to the degradation in the single-stack FC system (case 1), DFC1EQ, DFC2EQ, and DFC3EQ represent the degradation of the stacks 1, 2, and 3, respectively, in case 2 (multi-stack FC system with equal power distribution), and DFC1MPC, DFC2MPC, and DFC3MPC show the degradation of the stacks 1, 2, and 3, respectively, in case 3 (multi-stack FC system with proposed MPC control algorithm). As was explained in Section 3, degradation was associated with the maximum power that each stack can provide at every moment. The proposed control algorithm gave greater relevance to the current degradation to carry out the power distribution between the stacks of the FC system.   The stacks degradation is represented in Figure 5. DFC single-stack corresponds to the degradation in the single-stack FC system (case 1), DFC1 EQ , DFC2 EQ, and DFC3 EQ represent the degradation of the stacks 1, 2, and 3, respectively, in case 2 (multi-stack FC system with equal power distribution), and DFC1 MPC , DFC2 MPC , and DFC3 MPC show the degradation of the stacks 1, 2, and 3, respectively, in case 3 (multi-stack FC system with proposed MPC control algorithm). As was explained in Section 3, degradation was associated with the maximum power that each stack can provide at every moment. The proposed control algorithm gave greater relevance to the current degradation to carry out the power distribution between the stacks of the FC system.  The stacks degradation is represented in Figure 5. DFCsingle-stack corresponds to the degradation in the single-stack FC system (case 1), DFC1EQ, DFC2EQ, and DFC3EQ represent the degradation of the stacks 1, 2, and 3, respectively, in case 2 (multi-stack FC system with equal power distribution), and DFC1MPC, DFC2MPC, and DFC3MPC show the degradation of the stacks 1, 2, and 3, respectively, in case 3 (multi-stack FC system with proposed MPC control algorithm). As was explained in Section 3, degradation was associated with the maximum power that each stack can provide at every moment. The proposed control algorithm gave greater relevance to the current degradation to carry out the power distribution between the stacks of the FC system.  Another output variable of the developed state-space model was hydrogen consumption, drawn in Figure 6a. Detailed plots at the end of the lifespan of the single-stack FC system were highlighted in Figure 6b, and at the end of the lifespan of the multi-stack FC system in Figure 6c. As before, it has been represented the hydrogen consumption in the three cases: Single-stack FC system, multi-stack FC system with equal power distribution, and multi-stack FC system with the proposed MPC control algorithm.
Energies 2020, 13, x FOR PEER REVIEW 16 of 24 Another output variable of the developed state-space model was hydrogen consumption, drawn in Figure 6a. Detailed plots at the end of the lifespan of the single-stack FC system were highlighted in Figure 6b, and at the end of the lifespan of the multi-stack FC system in Figure 6c. As before, it has been represented the hydrogen consumption in the three cases: Single-stack FC system, multi-stack FC system with equal power distribution, and multi-stack FC system with the proposed MPC control algorithm.
(a) (b) (c) Figure 6. (a) Hydrogen consumption of the FC system in the three cases (single-stack FC system, multi-stack FC system with equal power distribution, and multi-stack FC system with MPC controller). (b) Detail to highlight the multi-stack FC system with MPC regarding the single stack system. (c) Detail to highlight the multi-stack FC system with MPC regarding the multi-stack FC system with equal power distribution (1 kNm 3 = 10 3 Nm 3 ).
Finally, Figure 7 shows the costs of each analyzed FC system (O&M costs and the depreciation cost) throughout their respective lifespan.  Figure 6. (a) Hydrogen consumption of the FC system in the three cases (single-stack FC system, multi-stack FC system with equal power distribution, and multi-stack FC system with MPC controller). (b) Detail to highlight the multi-stack FC system with MPC regarding the single stack system. (c) Detail to highlight the multi-stack FC system with MPC regarding the multi-stack FC system with equal power distribution (1 kNm 3 = 10 3 Nm 3 ).
Finally, Figure 7 shows the costs of each analyzed FC system (O&M costs and the depreciation cost) throughout their respective lifespan.
To summarize the obtained results, Table 5 offers a comparison between the three considered scenarios (single-stack FC system, multi-stack FC system with equal power distribution, and multi-stack FC system with the proposed MPC control algorithm). The comparison has been done in terms of stack degradation, hydrogen consumption, and cost. Note that the data have been taken from the day when the single-stack FC system has arrived at the end of its lifespan, day 545 ( Figure 5 and Table 5a,b shows the values of day 960, when the first stack of the multi-stack FC system under equal power operation reached its maximum degradation value. Finally, Table 5c shows the values obtained at the end of the lifespan of the multi-stack FC system with the MPC controller developed in this work. This situation occurs on day 1125 of operation. Energies 2020, 13, x FOR PEER REVIEW 17 of 24 Figure 7. Operating costs of the FC system in the three cases (single-stack FC system, multi-stack FC system with equal power distribution, and multi-stack FC system with MPC controller) (1 k€ = 10 3 €).
To summarize the obtained results, Table 5 offers a comparison between the three considered scenarios (single-stack FC system, multi-stack FC system with equal power distribution, and multistack FC system with the proposed MPC control algorithm). The comparison has been done in terms of stack degradation, hydrogen consumption, and cost. Note that the data have been taken from the day when the single-stack FC system has arrived at the end of its lifespan, day 545 ( Figure 5 and Table 5a,b shows the values of day 960, when the first stack of the multi-stack FC system under equal power operation reached its maximum degradation value. Finally, Table 5c shows the values obtained at the end of the lifespan of the multi-stack FC system with the MPC controller developed in this work. This situation occurs on day 1125 of operation.  Operating costs of the FC system in the three cases (single-stack FC system, multi-stack FC system with equal power distribution, and multi-stack FC system with MPC controller) (1 k€ = 10 3 €). Graphs depicted in Figure 8 illustrates the evolution of the delivered power (plots on the left) and the voltage supplied (plots on the right) by the three stacks of the multi-stack FC operating with the MPC controller, at different times throughout the simulation period.
Energies 2020, 13, x FOR PEER REVIEW 18 of 24 Graphs depicted in Figure 8 illustrates the evolution of the delivered power (plots on the left) and the voltage supplied (plots on the right) by the three stacks of the multi-stack FC operating with the MPC controller, at different times throughout the simulation period.

Discussion
Based on obtained results, as can be appreciated in Figure 5, the degradation of the FC system is considerably higher in the case of using a single stack to provide the power demanded by the EMS. The lifespan in the case of a single stack decreases something more than 50% compared to the case of using the proposed MPC controller to manage the multi-stack FC system. Furthermore, in the case of using a multi-stack FC system, the lifespan of the whole system also increases when the proposed MPC controller is applied to carry out the power distribution. The degradation by using the proposed MPC controller is lower because the operating power is calculated to minimize the degradation of the system, and, therefore, makes a power distribution between stacks based on the degradation level of each one.
Additionally, the controller parameters have been selected before carrying out the simulations (Table 3), has been set the same for all the stacks, thus, = = = 10 in the simulations, which would logically correspond to a set of brand new stacks. Therefore, there is no preference for deteriorating (or preserving) some stacks more than others. Thus, depending on the degradation dynamic of each stack, this will be its lifespan. In that way, as stack 2 has a higher deterioration dynamic value, this is the first that finishes its lifespan. However, if the stacks are not brand new, with different initial conditions (with respect to their degradation degree), it is possible to tune (even adaptively) each depending on this. For that, it is compulsory to know at any time the degradation degree of each stack. This has been resolved by authors [27,29,30]. Based on these developments, it is possible that even from brand new stacks with the same at the beginning of their operation, knowing the degradation degree in real-time for each stack, it is feasible to adapt it looking for a uniform degradation degree for all stacks, pursuing that all reach the same lifespan. That is, achieving that all the characteristics (DFC1MPC, DFC2MPC y DFC3MPC) coincide in Figure 5.
Regarding hydrogen consumption, as can be seen in Figure 6a, at the beginning of the lifespan of the stacks, hydrogen consumption is similar in the three cases. However, as the stacks are degraded, the voltage decreases. Hence, to provide the same power, a higher current is required, and, according to Faraday's Law, hydrogen consumption increases; therefore, the greater the degradation, the greater the hydrogen consumption. Therefore, taking into account that FC electrical efficiency is directly related with hydrogen consumption, systems operating at the same power, Figure 4b, but with different hydrogen consumption, Figure 6b (single-stack FC system consumes more hydrogen than multi-stack with equal power distribution, and FC system with equal power distribution consumes more hydrogen than multi-stack with MPC) reveals that MPC-based control strategy improves the FC system performance. The percentage of efficiency improvement coincides with the percentage of hydrogen consumption reduction.

Discussion
Based on obtained results, as can be appreciated in Figure 5, the degradation of the FC system is considerably higher in the case of using a single stack to provide the power demanded by the EMS. The lifespan in the case of a single stack decreases something more than 50% compared to the case of using the proposed MPC controller to manage the multi-stack FC system. Furthermore, in the case of using a multi-stack FC system, the lifespan of the whole system also increases when the proposed MPC controller is applied to carry out the power distribution. The degradation by using the proposed MPC controller is lower because the operating power is calculated to minimize the degradation of the system, and, therefore, makes a power distribution between stacks based on the degradation level of each one.
Additionally, the controller parameters have been selected before carrying out the simulations (Table 3), α x has been set the same for all the stacks, thus, α 1 = α 2 = α 3 = 10 in the simulations, which would logically correspond to a set of brand new stacks. Therefore, there is no preference for deteriorating (or preserving) some stacks more than others. Thus, depending on the degradation dynamic of each stack, this will be its lifespan. In that way, as stack 2 has a higher deterioration dynamic value, this is the first that finishes its lifespan. However, if the stacks are not brand new, with different initial conditions (with respect to their degradation degree), it is possible to tune (even adaptively) each α x depending on this. For that, it is compulsory to know at any time the degradation degree of each stack. This has been resolved by authors [27,29,30]. Based on these developments, it is possible that even from brand new stacks with the same α x at the beginning of their operation, knowing the degradation degree in real-time for each stack, it is feasible to adapt it looking for a uniform degradation degree for all stacks, pursuing that all reach the same lifespan. That is, achieving that all the characteristics (DFC1 MPC , DFC2 MPC y DFC3 MPC ) coincide in Figure 5.
Regarding hydrogen consumption, as can be seen in Figure 6a, at the beginning of the lifespan of the stacks, hydrogen consumption is similar in the three cases. However, as the stacks are degraded, the voltage decreases. Hence, to provide the same power, a higher current is required, and, according to Faraday's Law, hydrogen consumption increases; therefore, the greater the degradation, the greater the hydrogen consumption. Therefore, taking into account that FC electrical efficiency is directly related with hydrogen consumption, systems operating at the same power, Figure 4b, but with different hydrogen consumption, Figure 6b (single-stack FC system consumes more hydrogen than multi-stack with equal power distribution, and FC system with equal power distribution consumes more hydrogen than multi-stack with MPC) reveals that MPC-based control strategy improves the FC system performance. The percentage of efficiency improvement coincides with the percentage of hydrogen consumption reduction.
This situation is even worse in the case of a single stack FC system, where hydrogen consumption increases notably. Likewise, it can be verified that the hydrogen consumption of the multi-stack system applying the MPC control strategy developed in this work is slightly lower than in the case of equal power distribution operation, as can be appreciated in Figure 6c. From the analysis of these figures, it can be established that hydrogen consumption worsens more as the degradation of the stacks increases.
The degradation optimization implies a reduction in depreciation costs, as the lifespan is extended. As shown in Figure 7, the cost of the single-stack FC system is very high compared to the multi-stack one. Really, the final cost, if the availability of power needs to be satisfied over time, is considerably higher, because it would be necessary to add the replacement cost to equalize the lifespan of the multi-stack FC system.
On the other hand, a decrease in costs is also observed in a multi-stack FC system if the proposed MPC algorithm is used instead of the uniform power distribution.
The analysis of the data presented in Table 5 emphasizes what was previously commented on. There is a noticeable difference between using a single-stack and using a multi-stack system in terms of lifespan and costs (both in terms of O&M and depreciation cost). In the case of the multi-stack FC system with equal power distribution, while the single-stack is fully degraded at day 545, stack 1 is degraded at 45.9%, stack 2 at 54.3%, and stack 3 at 37.7%. The hydrogen consumption is reduced by 3.6% (consequently, the FC system efficiency is improved in the same percentage), and a cost-saving of 75.4%. This difference is even more pronounced in the case of the multi-stack FC system with MPC-based control; stack 1 is degraded at 43.1% for stack 1, stack 2 at 54.3%, and stack 3 at 36.4%. The hydrogen consumption is reduced by 4% (same percentage for the efficiency improvement), and a cost-saving of 77.4%.
Taking into account the time when the FC system arrives at the end of its lifespan, an increase of 76.4% is observed in the stacks lifespan of the multi-stack FC system with equal power distribution compared to the single-stack FC system. This improvement reaches 106.8% in the case of the multi-stack FC system based on the proposed MPC controller compared to the single-stack FC system.
In each sampling period, the power delivered by each stack (Figure 8) is corrected (this is due to the application to the multi-stack system), since it depends on the degradation suffered by the corresponding stack. Since the stack voltage is progressively decreasing due to degradation, stacks would need to supply higher current to provide the same power, increasing the hydrogen consumption. The multi-stack FC system is connected to the microgrid by means DC/DC converters (Figure 1), therefore, despite the fact that the stacks output voltages vary, the power conditioning stages guarantee the DC bus voltage.
As results show, starting from three brand new stacks, the degradation dynamic of each one is different (in fact, the own manufacturer informs of a tolerance, within it which can be any of the stacks), thus, over time, the degree of degradation of each stack is different and, therefore, the voltage level and obviously the power delivered of each one is also different.
Focused on the multi-stack FC system, analyzing the time intervals shown in Figure 8 (please follow the sequence (a) to (h) with the reading), it can be observed that the power delivered by each stack to satisfy the total power requirement is very similar at the beginning of their lifespan because the three stacks present similar initial degradation. However, as the days go by, stack 3 is less damaged than stack 1, and stack 1 is less damaged than stack 2, thus the MPC controller establishes that the power supplied by each stack must be different (lower degradation, the higher capability to supply power). Therefore, the MPC controller guarantees the degradation of all the stacks is homogenized, preserving the lifespan of the most degraded one and, hence, prolonging the lifespan of the multi-stack system.
In summary, the MPC-based proposal presented in this work achieves an optimization, both technical and economic, of the whole FC system in the short and the long term.

Conclusions
In this paper, a multi-objective model predictive control (MPC) has been developed for the power management of a multi-stack FC system integrated into a renewable sources-based microgrid. The MPC controller has solved the problem related to the power dispatch to the microgrid while including criteria to reduce the multi-stack FC degradation, O&M costs, as well as hydrogen consumption.
For this purpose, a generalized state-space model of the multi-stack FC system has been developed that allows predicting the future output of the FC system by means of the MPC controller. The model includes both technical and economic variables like stack degradation, hydrogen consumption, and O&M cost, and depreciation cost. In addition, the proposal presents the advantage that all the state vector is measurable, thus it is fully available to carry out, practically and easily, control strategies based on the state vector feedback.
The developed model is defined as an LPV model, which allows defining the non-linear behavior of the multi-stack FC system as a linearized model in each sampling period. Obtained results demonstrate that the multi-stack FC systems working under the developed MPC controller meet with the microgrid power demand over time; but also, at the same time, the stacks degradation and consequently, hydrogen consumption and the total cost of operating the FC system, are reduced regarding other previous solutions found in the scientific literature. In fact, as both the number of stacks in the FC and jumps in power demand of the microgrid increase, the supremacy of the developed solution also increases.
The novelty of this paper lies in the proposal of a generalized MPC controller for a multi-stack FC that can be used independently of the number of stacks that make it up. The controller takes advantage of the characteristics of the multi-stack FC concept, distributing operation across all the stacks regarding their capacity to produce energy and optimizing the overall microgrid performance.

Conflicts of Interest:
The authors declare no conflict of interest.

Notation and Symbols
α( j) Weighting factor of output tracking error. C f c x (k) Total operating cost of the stack x at sampling time k (€).

C O&M f cx
Operation and maintenance cost of the stack x (0.00004 €/Wh). C sys (k) Multi-stack FC system cost at sampling time k (€). C x 0 Acquisition cost of the stack x (8000 €). Hydrogen consumption of the muti-stack fuel cell system at sampling time k (Nm 3 ).
Hydrogen consumption of the stack x at sampling time k (Nm 3 ). I f c x (k) Operating current of the stack x at sampling time k (A).

I f c Nx
Nominal current of the stack x (A). λ( j) Weighting factor that penalizes, from sampling time k, changes in the control action.

N cell
Number of cells in the stack. N p Prediction horizon (5). N u Control horizon (5).
. n H2 (k) Molar hydrogen consumption ratio of the stack x at sampling time k (mol/h). P f c x (k) Operating power of the stack x at sampling time k (W). P f c Nx (k) Nominal power of the stack x at sampling time k (W).

P REF (k)
Multi-stack FC system reference power at sampling time k (W). P sys (k) Output power of the multi-stack FC system at sampling time k (W). r(k + j) Output reference at sampling time k + j. r x (k) Hydrogen consumption ratio of the stack x at sampling time k (Nm 3 /h). ρ H2 Molecular hydrogen gas density (0.0899 Kg/Nm 3 ).

T s
Sampling period (s).

V x (k)
Operating voltage of the stack "x" at sampling time k (V). y(k + j k) Output prediction at sampling time k + j based on measurements known at sampling time k. z Number of electrons involved in the reduction-oxidation reaction (z = 2).