A Grid-Tied Fuel Cell Multilevel Inverter with Low Harmonic Distortions

: As a result of global energy demand increase, concerns over global warming, and rapid exhaustion of fossil fuels, there is a growing interest in energy system dependence on clean and sustainable energy resources. Attractive power technologies include photovoltaic panels, wind turbines, and biomass power. Fuel cells are also clean energy units that substitute power generators based on fossil fuels. They are employed in various applications, including transportation, stationary power, and small portable power. Fuel cell connections to utility grids require that the power conditioning units, interfacing the fuel cells and the grids, operate accordingly (by complying with the grid requirements). This study aims to model a centralised, single-stage grid-tied three-level diode clamped inverter interfacing a multi-stack fuel cell system. The inverter is expected to produce harmonic distortions of less than 0.5% and achieve an efﬁciency of 85%. Besides the grid, the system consists of a 1.54 MW/1400 V DC proton exchange membrane fuel cell, a 1.3 MW three-level diode clamped inverter with a nominal voltage of 600 V, and an inductance-capacitance-inductance (LCL) ﬁlter. Two case studies based on the load conditions are considered to assess the developed system’s performance further. In case 1, the fuel cell system generates enough power to fully meet this load and exports the excess to the grid. In the other case, a load of 2.5 MW was connected at the grid-tied fuel cell inverter’s output terminals. The system imports the grid’s power to meet the 2.5 MW load since the fuel cell can only produce 1.54 MW. It is demonstrated that the system can supply and also receive power from the grid. The results show the developed system’s good performance with a low total harmonic distortion of about 0.12% for the voltage and 0.07% for the current. The results also reveal that the fuel cell inverter voltage and the frequency at the point of common coupling comply with the grid requirements. Author Contributions: Conceptualization, K.B.H.; methodology, K.B.H.; software, K.B.H.; validation, K.B.H. and D.N.L.; formal analysis, D.N.L.; investigation, D.N.L.; writing—original draft preparation, D.N.L.; writing—review and editing, D.N.L.; supervision, A.K.R. All authors read manuscript.


Introduction
Global energy demand increase, growing environmental awareness, and rapid exhaustion of fossil fuels are contributing factors for deploying energy systems dependent on renewable and other sustainable energy sources [1]. It is now a fact that the power industry should be established on renewable and sustainable energy sources. Moving towards these sources may empower the world to meet the double targets of diminishing greenhouse gas emissions, and ensuring reliable and cost-effective energy supply [1]. Appealing alternative energy sources include solar power, wind turbine, hydropower, biomass power, etc. Fuel cells are also clean energy technologies that have demonstrated the ability to be decent replacements for power units based on fossil fuels [2].
In general, fuel cells present numerous advantages over traditional power technologies and other clean energy sources. These advantages include higher power efficiency, noisefree operation, and less maintenance demand. However, they exhibit critical limitations, including poor voltage profile against current density, slow dynamic response, and higher current ripples [3].
Various fuel cell types exist in the market. Of all the varieties, the Proton Exchange Membrane Fuel Cell (PEMFC) is the most attractive, given its low operating temperature, low noise, high power density, high efficiency, and low pollution [4][5][6][7]. The design of PEMFCs is attracting, considerably, the attention of various countries and companies, as they support research and development into PEMFCs [8]. Today, PEMFCs are used in several applications, including aircrafts, spacecrafts, and automobiles [9].
As of now, no standard output voltage rating for fuel cells has been validated [10]. Most PEMFCs generate voltage ranging from 24 to 150 volts in direct current (VDC) [11], while the power ranges from 1 watt (W) to 100 kilowatts (kW) [12]. PEMFCs are associated in series and parallel to constitute multi-stack fuel cell systems to acquire high-power units [13]. In various applications, power conditioning units (PCUs) are required to control and convert the output parameters to suitable magnitude and type, ensure lesser to zero harmonics, and operate efficiently under all conditions [14]. Several design considerations exist in developing and implementing effective grid-tied fuel cell PCUs [15]. These key considerations result from design trade-off choices and include topology, efficiency, power quality, and cost [14,15]. Topology refers to the primary choice that needs to be made. Two topologies are predominant for fuel cell inverters: a single-stage PCU comprising only a Direct Current (DC) to Alternating Current (AC) converter, connected to the grid via a power transformer, and a double-stage PCU consisting of a DC to DC and DC to AC converters and a power transformer [16]. However, the double-stage PCU is the most preferred because of its benefits, including its ability to operate under an extensive voltage range [16]. This ensures a good conversion of energy. Additionally, the topology decouples the fuel cell from the inverter output, hindering the AC power ripple from inducing the double-line-frequency ripple [16].
On the other hand, the single-stage PCU is the most cost-effective topology because it eliminates the presence of DC to DC converter [17]. However, the topology is not well-liked since its minimum operating voltage is higher than the grid peak voltage to avoid the overmodulation operation [17]. Furthermore, the topology is regarded as bulky because it may require a sizeable DC-link capacitor to reduce the DC voltage ripple and improve efficiency, even if the high capacitor value does not fully address the issue [18]. To date, less research on fuel cell inverter employing the single-stage topology has been reported in the literature. This investigation's primary concern is to assess whether such topology is reliable and efficient enough for a large-scale grid-tied PEMFC. The assessment's motivation is that this topology, especially without an interfacing power transformer, is reported as a significant unit of modern and smart grids [19], because it offers control freedom while providing lower cost, higher efficiency, smaller size, and lower weight [20].
In a grid-tied operating mode, both topologies can be configured in the string, multistring, and centralised forms. Various single-stage inverter types, ranging from low to high levels, can be used depending on the power requirement [21]. For low power and low-voltage applications, the two-level inverter configuration is the most used PCU.
In contrast, for high-power and high-voltage applications, a multilevel inverter configuration is more suitable [22]. Applications of multilevel inverters range from medium to high voltage and comprise power distribution, motor drives, etc. [23]. For a given application, the choice of appropriate multilevel topology and its control scheme is not well defined and depends on various engineering compromises [13]. However, the most advanced multilevel inverter topologies include the diode clamped, the flying capacitor, and the cascade full-bridge inverters [24].
The diode clamped multilevel inverter is the most accepted topology [25]; the concept behind this type of inverter is to use diodes to limit the power devices voltage stress. An n-level inverter requires (n − 1) voltage sources, 2(n − 1) switching devices and (n − 1) (n − 2) diodes. By enlarging the voltage levels, the voltage quality is improved, and the waveform is nearly sinusoidal [26]. The voltage across each capacitor at the DC-link side is VDC/2, and each device voltage stress is limited to one capacitor voltage level VDC/2 through clamping diodes. Of diode clamped multilevel topologies, the three-level diode clamped inverter is one of the most available topologies in the market. It is widely used in industrial applications for voltage ranging from 2.3 to 6.6 kilovolts (kV) [26].
This study aims to model a centralised single-stage grid-tied three-level diode clamped inverter interfacing a multi-stack fuel cell unit. The inverter is expected to have less than 0.5% harmonic distortions and achieve an efficiency of 85%. The considered system components are a 1.54 megawatts (MW)/1400 VDC PEMFC, a 1.3 MW/600 V threelevel diode-clamped inverter, and an inductance-capacitance-inductance (LCL) filter. The inverter control scheme includes voltage and current regulators to provide a suitable power factor and satisfy the grid synchronisation requirements. The frequency and phase are synchronised with those of the grid through a phase-locked loop. Modelling and simulation are performed using MATLAB/Simulink. The rest of the paper is organised as follows: Section 2 provides a brief literature review of fuel cell PCUs; Section 3 deals with the research method adopted in this investigation. Section 4 analyses the simulation results. Section 5 is devoted to case studies to evaluate the system's performance further. Section 6 compares the results obtained in this research against other studies, and the last section concludes the results with pertinent contributions to the research problem investigation and recommendations for future studies.

Literature Review
Several articles regarding fuel cell PCUs and their controls are reported in the literature; however, less focus on the grid integration of PEMFCs. Ben Hamad and Kahn [26] presented the three standard PCU configurations for grid-tied fuel cells ( Figure 1). These configurations are based on single-stage and double-stage PCU topologies and consist of the string configuration (Figure 1a), the multi-string configuration (Figure 1b), and the centralised configuration (Figure 1c). Silaa et al. [27] designed and implemented a high order sliding mode control to keep operating a PEMFC at an adequate power point. The system consisted of a PEMFC, a DC to DC boost converter, a digital signal processing and control engineering (DSpace), sliding mode control and quasi-continuous high order sliding mode control algorithms, and a resistive load. To assess the proposed control strategy's effectiveness, experimental results are compared with the traditional sliding mode control. The results showed that a chattering reduction of 84% could be achieved using the proposed technique. Ceran and Orłowska [28] investigated the decline of power source performance in a hybrid power system based on a multi-criterion analysis of load distribution. The authors introduced a mathematical model intended for planning cooperation in a hybrid power system consisting of photovoltaic panels, wind turbines, and a discrete regenerative fuel cell. The model consisted of energy and multi-variant analyses of the decision-making. The planning cooperation was carried out in a long-term period, considering the decrease in the hybrid power system components' performance during the years of its activity. The results revealed that performance decrease in hybrid power system components affects planning the hybrid power system's operation in a power system. Do et al. [29] proposed a novel energy management technique for a PEMFC tractor with supercapacitor-battery hybrid energy storage. The PEMFC was the primary power supply, while the hybrid energy storage supplied additional power demand and recovered energy. The system model was implemented in a co-simulation environment, combining MATLAB/Simulink and AMESim software. An energy management strategy algorithm was developed to provide power to the tractor based on its operating conditions. Bizon et al. [30] analysed a hybrid power system's optimal and safe operation based on fuel cell and renewable energy sources. The fuel cell ensured the required DC power, resulting from the power flow balance on the DC bus via the air regulator or the fuel regulator, controlled by the power tracking control reference, or both regulators using a switched-mode of the power tracking reference. The fuel cell's optimal operation was ensured by searching for the maximum of multicriteria-based optimisation functions focused on fuel economy under perturbation, including variable renewable energy and dynamic load on the DC bus. Two search controllers based on the global extremum seeking scheme are involved in this search via the remaining fuel regulator and the DC to DC boost converter. The results revealed fuel savings under dynamic load, but without renewable power compared to the fuel consumed using the static feed-forward control. Moreover, with renewable energy, the needed fuel cell power on the DC bus is lower, so the fuel cell system operates more efficiently.
Spasova et al. [31] studied a fuel cell scheduling impact on local energy markets with multiple renewable sources. The effect of introducing priority-based power management on a communal energy market of prosumers was shown. The study focused on adding components capable of scheduling the fuel cell's operation to the internal agent. This addition improved the internal agent's performance in off-grid systems with heterogeneous power sources by balancing the battery's State-of-Charge (SOC) levels and stabilising the market prices into more predictable 24 h patterns. However, the authors concluded that a more comprehensive bidding strategy was required. The strategy should be locally optimised for each prosumer based on the prosumer predicted consumption patterns and should include a future prediction for the generation patterns. Zhang et al. [32] proposed an enhanced hybrid switching-frequency modulation strategy for a fuel cell vehicle to improve the voltage-gain range of a three-level DC to DC converter. The suggested modulation strategy retained similar benefits to the original modulation strategy with more suitable duty cycles. The experimental outcomes validated the feasibility of the proposed modulation strategy and the correctness of its operating principles. Sukumar et al. [33] proposed a power management system for a grid-connected photovoltaic-fuel cell hybrid system based on the load and solar radiation variation. The goal was to minimise the power exported from the grid and operate the fuel cell within a proper power range. This power management involved the control of the fuel cell's active power. The optimal control parameters for the fuel cell's active power control were found using the genetic algorithm and simplex technique.
On the other hand, many research articles emphasise on the grid integration of other alternative sustainable energy technologies, including photovoltaic systems, wind turbines, etc. Khan et al. [34] provided a detailed investigation of the dynamic behaviour and transient characteristics of a Doubly Fed Induction Generator during grid faults and voltage sags. Novel grid side controllers, adaptive proportional-integral controller, and proportional resonant with a resonant harmonic compensator to eliminate the negative impact of unbalanced grid voltage DC capacitor and achieve harmonic filtering to improve power quality were presented. An algorithm focusing on mitigation of harmonic currents and voltage fluctuation in DC-capacitor making capacitor more reliable under transient grid conditions and distorted active and reactive power delivered to the electric grid was proposed. A simulation was carried out to validate the effectiveness of proposed control algorithms. The results showed robustness, ripples free, and fault-tolerant capability of the proposed controller.
Hakimi and Hajizadeh, [35] carried out a study on the modelling and control of a modular multilevel converter for photovoltaic power units' grid integration. A dynamic model of a modular multilevel converter, including symmetrical components of voltage and current, was proposed. Adaptive robust current controllers were developed based on sliding mode and fuzzy controllers. To actualise the proposed controllers under unbalanced grid voltage fault, positive and negative sequences, current controllers were implemented to compensate for grid voltage fault and load power variation. The results demonstrated that the proposed current controllers are more effective under-voltage disturbance conditions and could satisfy the modular multilevel converter's stability. Tareen et al. [36] summarised an analytical review comparing three-phase static compensator and active power filter inverter topologies and their control schemes using industry standards and advanced high-power configurations. A comparison of the topologies, control strategies, and implementation structures of grid-connected high-power converters was presented. This study focused on different topological devices, such as passive filters, shunt and hybrid filters, and static compensators, to improve power quality. Appropriate control schemes, including sinusoidal pulse width modulation and space vector pulse width modulation techniques, were selected. The simulation and experimental results proved the effectiveness of active power filter-static compensator systems for harmonic mitigation.
Das Gupta et al. [37] analysed a grid-tied 50 kW solid oxide fuel cell with synchronous reference frame control. The system was connected to the grid through a double-stage inverter. The goal was to assess system performance. The results showed that fuel cell stack voltage decreases gradually with the increase in fuel cell current and power. The stack voltage, current, and power took 5 s to reach their steady-state. This slow response was due to the slow chemical reactions of gasses in the cells. In the presented SRF control (d-q control) method, the active and reactive power fed to the grid took 2 s to reach the demanded nominal. Rizqiawan et al. [38] designed a grid-connected inverter experiment module for a microgrid at a laboratory scale. The inverter was developed modularly to help students understand the basic concept of grid-connected inverters and their function. The unit included voltage control, power control, and synchronisation control. Voltage control under grid-forming mode generated a stable three-phase voltage from internal or external voltage reference. Under grid-injecting mode, power control produced a steady output power under constant power reference or droop power regulation. The current study focuses on the grid integration of large-scale PEMFC by achieving low harmonic distortion.
In general, harmonics are caused by nonlinear loads, drawing non-sinusoidal current from sinusoidal voltage sources. These loads include power electronics converters, motor drives, and electric arc furnaces. Loads, including fluorescent lamps, computers, fax machines, photocopiers, laser printers, battery chargers, etc., are also sources of harmonics. These harmonics impact negatively on sensitive equipment above several kilowatts of the connected loads [39]. The Institute of Electrical and Electronics Engineers (IEEE) and the International Electrotechnical Commission (IEC) standards set the harmonic distortion limits for both the current and the voltage in a power system based on the current and voltage levels. Conventional criteria used to reduce harmonics are input inductances, while the power conversion devices' output inductances serve as filters. However, realising practical filters becomes difficult due to the high cost and low system dynamic response because of the increase in systems' size. Generally, LCL filters are connected after inverters to eliminate harmonics resulting from inverters' switching.
In comparison with other filters, such as an inductance (L) and inductance-capacitance (LC) filters, an LCL filter has the benefit of achieving better attenuation capacity for complex harmonics. It has better dynamic characteristics [40,41]. However, an LCL filter can cause instability problems because of its zero impedance, which may create resonance for some frequencies. Various damping techniques, such as incorporating a passive physical element in series with the filter capacitor [42], have been proposed to overcome this issue. Among these damping techniques, the technique using a passive component is reliable and straightforward. However, the passive element causes power loss and weakens the LCL filter effect, which can be overcome using an active damping technique [43].
When operating in grid-connection mode, the inverter output voltage and frequency should be the same as those of the grid. Hence, the current injected into the grid should be balanced, sinusoidal, and have a total harmonic distortion lower than 5% [44]. The inverter control plays a vital role, and in such a case, the objective of the control action is to feed the extracted power to the grid properly. Several control strategies for grid-connected inverters have been proposed, such as Selective harmonics elimination pulse-width modulation (SHE-PWM), pulse-width modulation (PWM), and optimised harmonics stepped pulsewidth modulation (OHS-PWM) [45]. However, this research focuses on the PWM control approach. The PWM control approach can be grouped into open and closed-loop control systems; the open-loop PWM techniques are sinusoidal PWM, space vector PWM, sigmadelta modulation, and closed-loop current control methods. The closed-loop control consists of three significant steps for grid-connected inverters: outer loop control, inner loop control, and synchronisation [38]. The outer control loop can be a DC-link voltage control or a power control loop, which generates the inner current references. On the other hand, the inner current loop regulates the injected currents, while the synchronisation is achieved through a phase-locked loop (PLL), which uses the grid to provide the correct phase and frequency.
This literature review's primary purpose was to evaluate the current state and trend in fuel cell PCUs and their control approaches. These article assessments reveal that a minimal number of studies focus on the grid integration of fuel cells. Of the few existing studies, most concentrate on the double-stage PCUs given their benefits, including the ability to operate under an extensive voltage range and the fact that the topology decouples the fuel cell from the inverter output, hindering the AC power ripple from inducing the double-line-frequency ripple.
Despite the single-stage PCU drawbacks, the current study focuses on the grid integration of large-scale PEMFC using this PCU topology because of its cost-effectiveness to achieve low harmonic distortion and high efficiency. This research's main contribution is to demonstrate through a detailed design and simulation that a single-stage PCU can be efficiently be employed in a grid-tied PEMFC and comply with the grid requirement. Figure 2 below depicts the research design flow used in this investigation. This research design flow shows the various steps undertaken in the design and simulation of the grid-tied multi-stack PEMFC to achieve the study's objectives. The initial phase consisted of conducting a literature survey on PCUs types employed in systems powered from fuel cells and their control strategies. Based on the design specification, the next stage of the investigation consists of modelling the PEMFC to acquire a 1.54 MW at 1400 VDC. Once this phase is completed, the following step is the filter design to determine the grid and inverter sides' inductances, the capacitor, and the damping resistance. The filter's resonance frequency should be half of the switching frequency and ten times the grid frequency to avoid resonance caused by low and high harmonics ratings. If this condition is satisfied, the design of the inverter control can then be carried out. The inverter control scheme consists of regulating the frequency and the phase of the grid-tied multi-stack PEMFC through the phase-locked loop (PLL), then controlling the outer loop to produce the current reference in the dq0 reference frame, and at last designing the inner loop for the generation of the modulation signal. From this stage, a simulation can be carried to assess the total harmonic distortions of the voltage and the current and the grid-tied multi-stack PEMFC efficiency. The methodology's final phase is to verify if the investigation's primary goal, which is to realise total harmonic distortions of less than 0.5%, is achieved; otherwise, the filter must be redesigned.

System Description
The topology adopted in this study is the centralised configuration ( Figure 3). The fuel cell stack is directly connected to the utility grid through the inverter. Besides the multi-stack PEMFC, the system includes a three-level neutral point clamped inverter and a power filter unit connecting the system to the utility grid. The multi-stack PEMFC is realised through series and parallel connection of individual stacks. Each PEMFC stack generates 126 kW at 1400 VDC, and a total of 12 stacks are associated in parallel to form the multi-stack PEMFC. The overall power of the multi-stack PEMFC is 1.54 MW, while the voltage is 1400 V. Two DC-link capacitors are connected in series to eliminate the variation of the DC-link voltage. The capacitors' middle point is connected to the midpoints of diodes in each leg of the three-level neutral point clamped voltage source inverter. A low switching frequency is used to operate the inverter and achieve high efficiency.
The inverter converts the 1400 DC voltage of the fuel cell to AC to supply a local load and feed any excess into the utility grid depending on the generation conditions. To mitigate harmonic effects resulting from the inverter's switching, an LCL filter is interfaced between the inverter, the local load, and the grid. From the grid side, the grid-tied multistack fuel cell is viewed as a power unit generating 1.26 MW at 600 V. The control system controls the flow of active and reactive power between the multi-stack fuel cell system and the grid. Additionally, the control system regulates the multi-stack fuel cell frequency and phase to comply with the grid specifications.

Modelling the Multi-Stack Fuel Cell
The dynamic of a fuel cell is modelled using the following equations [46]:

1.
Fuel cell voltage The following equation gives the fuel cell voltage: where E, V act , V conc and V ohm are the Nernst voltage, the activation voltage, the concentration voltage, and the ohmic losses, respectively.

Nernst voltage
The Nernst voltage is expressed as: E 0 is the standard potential equals to 1.18 V, R is the gas constant, T is the gas temperature, F is the Faraday constant, pH 2 , pO 2 and pH 2 O are the effective gas partial pressures for hydrogen, oxygen, and water, respectively.

Activation loss
The activation loss is defined as follows: where: α, α 1 , and α 2 are charge transfer coefficients, and I 0 is the apparent exchange current of the fuel cell.

Concentration voltage
The following equation defines the concentration voltage: where I L is the maximum current density of the cell at a given flow rate.

Ohmic loss
The ohmic loss depends on the temperature as given in Equation (6) as: where γ and β are the constant coefficients of the fuel cell, T 0 = 973 • K, T is the fuel cell's operating temperature, and r is the internal resistance. The parameters used in the modelling of each PEMFC stack are provided in Table 1, whereas Table 2 gives the characteristics of the multi-stack PEMFC. In this case, each PEMFC stack is modelled to generate 126 kW at 1400 V. To form a 1.54 MW multi-stack PEMFC, a total of 12 stacks are connected in parallel.  Figure 4 shows the fuel cell output power, voltage, and current. The steady-state values of the power, voltage, and current are 1.5 MW, 1400 V, and 1070 A, respectively. The multi-stack takes about 0.5 s to reach these steady-state values. The power response in Figure 4a has a rising time of 22.437 milliseconds, corresponding to the time needed for the power signal to rise from 0 to 100% of its final value. Furthermore, before getting into the steady-state, the signal displays an overshoot and an undershoot of 11.741% and 3.217%, respectively.
The multi-stack voltage in Figure 4b exhibits a rising time of 5 milliseconds, and the overshoot and undershoot 115.864% and 1.939%, respectively. This voltage is divided between the two DC-link capacitors with the end goal that each will handle 700 V. The rising time of the current in Figure 4c is similar to the voltage wave. However, the current presents an overshoot and an undershoot of 1.970% and 68.052%, respectively.

Designing the Three-Level Neutral Point Clamped Inverter
A three-level neutral point clamped inverter consists of twelve switching elements and six clamping diodes. It consists of a series connection of four switches per leg, while six diodes called clamping diodes connect each leg output to the neutral point. The DC-link capacitor comprises two capacitors, and the capacitors midpoint is the neutral point. In contrast with the two-level topology, the switch's rated voltage in this type of inverters can be decreased by half, making it appropriate for high voltage and large-scale systems. In its switching shown in Table 3, given S a1 , S a2 , S a3 , and S a4, the four switches in each leg, if S a1 and S a2 are on and S a3 and S a4 are off, the output voltage is +VDC/2. On the contrary, the output voltage is −VDC/2. On the other hand, if Sa1 and Sa4 are out and Sa2 and Sa3 are on, the output voltage is zero [50,51]. Table 4 gives the design parameters of the inverter.

Modelling the LCL Filter
The modelling of a three-phase LCL filter requires input parameters such as the inverter rated power P n , the DC-link voltage V DC , the grid frequency f g , the switching frequency f sw , the sampling frequency f samp , and the grid voltage. The LCL filter parameters are given in Table 5, and its design is carried out using the following equations: 1.
Filter capacitor The base impedance Z b and base capacitance C b are given by the following equations [52]: where U n is the grid voltage and W g the grid frequency in rad per second.
The capacitor C f of the LCL filter is considered as 5% of the base capacitance is expressed in Equation (9) [53]:

Current ripple
The maximum current ripple at the output of the inverter is given by Equation (10) as follows [54]: L i is the inverter side inductor, T SW is the switching period, and m is the inverter modulation index considered in this study to be equal to m = 0.57 [55].
Inverter side current ripple should be limited to 10 to 25% of the maximum current (I max ), so ∆I Lmax can be expressed [56]: (11) In this study, the percentage is 1% to keep ∆I Lmax = 0.01I max , where I max = P n √ 2 3V ph (12) where V ph is the line to ground voltage. From Equation (7), Li can be expressed as [57]: The LCL filter should reduce the expected current ripple to 20%, resulting in an output current ripple of 2% [12,58]. Equations (14) and (15) relate to the harmonic current generated by the inverter with the one injected in the grid [54]: where, K a is the desired attenuation, ω SW is the switching frequency expressed in rad per second, and r is the ratio between the inverter side and the grid side inductances [59]: The resonant frequency ω res in rad per second, and the damping ratio (ζ) of the LCL filter are determined as in Equations (16) and (17), respectively [60].
where R d is the damping resistor. The last step in the design is the control of the resonant frequency. The resonant frequency must be minimally one half of the switching frequency because the filter requires enough attenuation in the converter switching frequency. The resonant frequency for the LCL filter can be calculated as [59]: 10f g < f res < 0.5f SW (19) It is necessary to check that the resonant frequency satisfies Equation (19). On the contrary, the parameters should be recalculated. The value of the damping resistor can be calculated according to Equation (20) as [42]:

Modelling the Inverter Controller
The inverter control primary function consists of adequately supplying the extracted power to the load connected at the inverter's output or the grid if it is grid-tied. This function is realised by using a dual-loop control of the current. The outer control loop might be a DC-link voltage control or a power control loop producing the inner current references ( Figure 5). In this study, the DC-link voltage is regulated to control the inverter power using an outer loop control. This voltage regulation provides the desired power transfer. DC voltage controller provides the current reference id_ref for the inner controller. The current reference is set to zero for the unity power factor. The following expression gives the energy stored in the DC-link capacitor: where C dc−link is the DC-link capacitor and V DC−link is the DC-link voltage. The total voltage across the DC-link capacitor should be greater than in Equation (22) to obtain the desired line to line voltage.
where V DC−min is the DC link minimum voltage, and V LL is the line to line voltage The DC voltage control consists of a PI controller to keep V DC equal to the reference voltage V ref . The bandwidth of the voltage controller is set between 0 and 20 Hz. The parameters k p_o and k i_o of the voltage controller given in Table 6, are tuned using the following equations [61]: where T s is the sampling period, and C dc−link is the DC link capacitor. Conversely, the inner control loop takes the error between reference currents generated by the outer control loop and measured currents to feed it into the controller. The inner control loop output (m d and m q ) is transformed from the dq0 to the abc frame to obtain the modulation fed into the PWM generator to produce the sinusoidal pulse width modulation signal (SPWM) then drives the inverter. For the three-level inverter, twelve pulses are required. The parameters k p_i and k i_i of the current controller are tuned using Equations (25) and (26) [61]: where L and R are the loop equivalent inductance and resistance, respectively. Various synchronisation techniques have been reported in the literature, among which the most employed strategy is the phase-locked loop (PLL) method. The injected output current of the inverter requires synchronisation with the grid voltage. Hence, the synchronisation control of the grid voltage's extracting angle plays an essential role in a grid-tied inverter. The PLL in the dq0 frame includes Clarke and Park transformations, a loop filter (PI controller), and a voltage-controlled oscillator [62]. Its closed-loop transfer function is similar to a second-order transfer [63]. Using Equations (27) and (28), k p_pll and k i_pll can be defined as follows [58]: k p_pll = 2ζ k i_pll (27) k i_pll = ω 2 n (28) where ω n is the natural frequency and ζ is the damping factor determined from the following equations [64]: In practice, the optimal damping factor is chosen as 0.707 to achieve an overshoot of approximately 5% [58]. The modelled parameters of the inverter control scheme are given in Table 6.

Results
The grid-tied fuel cell system depicted in Figure 3 was modelled and simulated using MATLAB/Simelectrical package to evaluate the system's performance based on parameters in Tables 2 and 4-6. The system temperature, hydrogen, and oxygen pressure, composition, and flow rate are unchanged. The results of the simulation are presented in Sections 4.1 and 4.2. These results analyses the control parameters and the inverter output characteristics.

Control
The voltage control consists of comparing the DC link voltage and the reference voltage set to 1400 V. The error from the comparison is used as input to the voltage PI controller to generate the Id reference (Id_ref). Figure 6a shows the actual and reference voltage of the DC link. The results prove that the designed controller exhibits a good response as the error between both signals is nearly zero. However, overshoots appear at the starting of the simulation; after that, both voltages stabilise to the same value. Figure 6b shows the comparison between the current (Id) and the current reference (Id_ref). The error between both currents is fed into the current controller in the d-axis to generate the voltage (Vd). The Id_ref value is approximately 1766 Amperes. Its rise time is 40.823 milliseconds, while the overshoot and undershoot are 21.341% and 1.994%, respectively.
Similarly, Figure 6c depicts the comparison of Iq and Iq reference (Iq_ref) currents. The error obtained between the two currents produces the voltage Vq through the current PI controller in the q-axis. The value of the Iq reference is zero.
The grid voltage in the dq0 frame is required to generate the voltage used to obtain the modulation signal. The voltage in the d-axis is 500 V, whereas that of the q-axis is zero since the grid always controls its reactive power. The voltage in the dq0 frame (Vd and Vq) used to obtain the modulation signal in the dq0 frame is shown in Figure 6d,e. Their values in the d and the q axis are 500 V. The resulting modulation signals in both axes have a magnitude of 0.7. These modulation signals are transformed from the dq0 to the abc frame, then fed into the pulse width generator to produce twelve pulses to drive the three-level inverter.
The phase-locked loop (PLL) produces an output signal related to the input signal phase. In this case, the PLL serves to track the frequency and phase of a sinusoidal threephase signal with an internal frequency oscillator. The control system adjusts the internal oscillator to maintain the phase difference to 0. Figure 6f shows the frequency of the PLL, which is around 50 Hz. This frequency corresponds as well to the grid frequency and varies slightly around 50 Hz. Furthermore, the PLL evaluates the grid voltage and phase angle employed to synchronise the dq0 frame current control. The designed PLL produced a proper phase angle to allow the synchronisation of the inverter to the grid. Under the grid-tied operating mode, the control scheme is expected to regulate the grid-tied PEMFC inverter's injected current. This is achieved in this investigation through a dual current control loop using PI controllers. The current control is implemented in the dq0 reference frame. The grid-tied inverter frequency and phase at the point of common coupling (PCC) with the grid are synchronised using a PLL. The results' analysis reveals a good system response. The error between the DC-link voltage and the reference voltage of the outer loop was nearly zero, implying that the DC power from the multi-stack PEMFC routed to the inverter is well regulated and exhibits a fast response. Similarly, the inner control loop results also indicate that the current injected into the grid is appropriately regulated and in phase with the voltage, thus achieving a unity power factor. On the other hand, the PLL analysis proves that the inverter frequency complies with the frequency at the PCC with the grid.

Inverter Characteristics
The inverter must operate to provide a voltage suitable to the grid. The three-level inverter balances the voltage level regardless of the control and load characteristics. It converts the DC-link voltage to a three-level AC voltage with the line to line value swinging between −VDC link to +VDC link as shown in Figure 7. This AC voltage represents the output voltage of the inverter without a filtering unit. The peak to peak voltage is approximately 2800 V; thus, the maximum and minimum values are +1400 V and −1400 V, respectively, while its root mean square (RMS) value is 938 V. This wave is in the form of pulses with varying widths based on the signal amplitude. Its fundamental frequency is similar to that of the grid frequency, which is 50 Hz. The phase-to-phase voltage is 3.841 milliseconds, while its fall time is 3.971 milliseconds. The overshoot and undershoot are 0.49% and 25.347%, respectively. The phase-to-phase voltage of the three-level inverter shown in Figure 7 includes harmonics caused by switching power electronics devices in the inverter. These harmonics negatively impact the system and can cause low efficiency, poor power factor, transient, etc. Standard, such as IEEE 519-2014, defines the allowable harmonic distortion for both the current and the voltage for a grid-tied power unit at the point of connection based on the current and voltage levels. For voltages ranging from 1 to 68 kV, the voltage's total harmonic distortion must not exceed 5%. Simultaneously, the current harmonic distortion limit for currents higher than 1000 A is 20% [65]. The total harmonic distortion of this phase-to-phase voltage was evaluated to 45.01% for frequencies up to 5 kHz when the fundamental is 50 Hz. This percentage is far above the limit as set by standards. Therefore, an LCL filter is placed between the inverter and the grid to reduce these harmonics. Figure 8 shows the phase-to-phase voltages and the currents at the output of the LCL filter. The voltage magnitudes are approximately 600 V (Figure 8a), while the phase currents are around 1213 A (Figure 8b). The rise time of the phase to phase voltage is about 5.853 milliseconds, while the fall time is 5.837 milliseconds. The overshoot and undershoot of the voltage are 0.324% and 1.985%, respectively. Similarly, the phase current rise time is 5.819 milliseconds, while the fall time is 5.823 milliseconds. Its overshoot and undershoot are 1.99% and 1.99%, respectively. Figure 9 depicts the histograms of total harmonic distortions (THD) at the LCL filter's output. The total harmonic distortions drop to 0.07% for the current (Figure 9a) and 0.12% for the voltage (Figure 9b), hence complying with the grid connection standards.

Case Studies
Two case studies are considered to evaluate the designed system's operation based on the load value. The first case considers a load less than the power generated by the multi-stack fuel cell, whereas in the second case, the load is higher than the multi-stack fuel cell power. These cases analyse the active and reactive power and the voltage and current of the load and the grid.

Case Study 1
In this case, the fuel cell system generates enough power to fully meet this load and exports the excess to the grid. Figure 10a shows the active and reactive power consumed by the load. The active power is approximately 917 kW, while the reactive varies between 0 and 287.8 nano VAR. This active power response is characterised by an overshoot of 14.935% between t = 0 and t = 0.3 s and an undershoot of 2.187% between t = 0.3 and t = 0.4 s. After that, this response stabilises to reach the steady-state value of 917 kW. The active and reactive power exported to the grid is depicted in Figure 10b. The grid receives an active power of about 573.9 kW, while the reactive power from the grid-tied inverter is 508.4 kVAR. The active power signal has a rise time of 61.950 milliseconds, and the overshoot and the undershoot are 10.92% and 8.35%, respectively. The reactive power has a rise time of 29.842 milliseconds, with an overshoot and an undershoot of 55% and 1.986%, respectively.
The phase-to-phase voltages and the phase currents at the load terminals are shown in Figure 10c

Case Study 2
This case study considers a load of 2.5 MW connected at the grid-tied fuel cell inverter's output terminals. The system imports the grid's power to meet the 2.5 MW load since the fuel cell can only produce 1.54 MW. Because the inverter's efficiency is 88%, the load can only receive approximately 1.23 MW from the grid-tied inverter, and any deficit must come from the grid. The active and reactive power curves measured at the load's output terminals are shown in Figure 11a. The active power's value is 2.5 MW, while the reactive power varies around zero (1.865e-7 VAR). The active power signal is characterised by an overshoot of 14.557% between t = 0 and t = 0.3 s and an undershoot of 1.998% between t = 0.3 and t = 0.4 s. After that, this response stabilises to reach the steady-state value of 2.5 MW. On the other hand, the reactive power displays an overshoot of 95.419% around t = 2 s, whereas the undershoot is 40.092%.
The active and reactive power received from the grid at the point of connection is shown in Figure 11b. The grid supplies about 1.3 MW to the load, while the fuel cell provides the remaining portion. The reactive power at the point of connection is about 862 kVAR. The active power curve is characterised by an overshoot of 11.932% between t = 0.1 and t = 0.2 s and an undershoot of 7.784% between t = 0.2 and t = 0.3 s. After that, this response stabilises to reach its steady-state value. On the other hand, the reactive power displays an overshoot of 55.882% between t = 0.1 and t = 0.2 s, whereas the undershoot is 1.985% between t = 0.2 and t = 0.3 s.
The phase-to-phase voltages and the phase currents at the low-pass filter's output terminal are shown in Figure 11c

Discussion
The primary concern when integrating distributed power units into a utility grid is the issue of power quality. Poor power quality can cause grid disturbance and significant economic losses. Grid-tied distributed units need to comply with grid codes and standards regulating their operation. One of the parameters considered in power quality analysis is the total harmonic distortion (THD). IEEE and IEC standards set the harmonic distortion limits for both the current and the voltage in a power system based on the current and voltage levels. For voltages ranging from 1 to 68 kV, the THD of the voltage must not exceed 5%, while the THD limit for currents higher than 1000 A is 20%. Table 7 compares the THD obtained in this study against previous studies. Benzazah et al. [59] conducted a study on a single-stage grid-tied three-level diode clamped inverter with an LCL filter to enlarge the grid compatibility with high power renewable generators. The proposed system presented good robustness against the grid voltage distortions. The simulation results demonstrated that the inverter control algorithm successfully converted renewable DC power to AC power with total harmonic distortions of 2.44% for the voltage and 0.16% for the current. In the same vein, Elbaset et al. [66] evaluated the performance of a PV grid-tied system consisting of a PV array, a DC to DC converter driven from a modified P&O controller, and a three-level inverter with an LC filter. The LC filter improved the inverter's power quality by decreasing the voltage harmonic distortion up to 1.01%.
Nourdine et al. [67] designed and analysed a three-phase single-stage grid-tied inverter with maximum power point tracking capability to extract full power from a PV plant and convey it to the grid with less cost and low current THD. The measured THD of the currents injected into the grid was 2.41%. Kim et al. [68] investigated the design and control of a grid-tied three-phase 3-level NPC inverter for photovoltaic systems. A 13 kW NPC inverter with an LC filter demonstrated a current THD of less than 3%. Novak et al. [69] developed a model of a double-stage PCU comprising a grid-interactive NPC inverter. The simulation results showed that the inverter current distortion was 0.72%. Arulkumar et al. [70] modelled and designed an NPC inverter for grid-tied photovoltaic inverters. The system achieved a current THD of 3%. Ramteke and Patil [71] designed an LCL filter to decrease a five-level inverter's harmonics for renewable power applications. The system exhibited a current THD of 0.33%.
Compared to the results of the studies mentioned above, the results obtained in this study show better THDs of the current and the voltage.

Conclusions
Increasing global electricity demand, environmental protection awareness, and the rapid decline of fossil fuels are contributing elements for deploying power units based on renewable resources. It is a reality that the power industry should be set up on renewable and sustainable energy sources. Moving towards these sources may enable the world to meet the targets of reducing greenhouse gas emissions and guaranteeing reliable and cost-effective energy supply. Attractive alternative energy sources include solar power, wind turbine, hydropower, biomass power, etc. Fuel cells are also clean energy units that substitute power generators based on fossil fuel. They are employed in various applications, including transportation, stationary power, and small portable power. Fuel cell connections to utility grids require that the power conditioning units interfacing the fuel cells and the grids operate accordingly (by complying with the grid requirements). This study aimed to model a centralised three-phase grid-tied three-level diode clamped inverter interfacing a multi-stack fuel cell system. The inverter was expected to produce harmonic distortions of less than 0.5%. Besides the grid, the design consisted of a 1.54 MW/1400 VDC proton exchange membrane fuel cell, a 1.3 MW three-level diode clamped inverter with a nominal voltage of 600 V, and an LCL filter. The results showed the developed system's good performance with a low total harmonic distortion of about 0.12% for the voltage and 0.07% for the current.
The topology adopted in this study is commonly considered less efficient and bulky because it may require a sizeable DC-link capacitor to reduce the DC voltage ripple and improve efficiency. Additionally, its minimum operating voltage is higher than the grid peak voltage to avoid the over-modulation operation. However, in this investigation, the efficiency achieved was 85%. Further research should focus on validating the obtained results with a setup test bench and carry out a sensitivity analysis to assess the system response under the system's parameters variation. Future studies should also compare the results obtained in this study against a double-stage inverter with similar design specifications. Upcoming analysis should also be oriented to more intelligent control methods to optimise the single-stage inverter performance. In the smart grid context, integrating two-way communication into the system is another aspect that should be investigated.