Energy Management System for Hybrid PV/Wind/Battery/Fuel Cell in Microgrid-Based Hydrogen and Economical Hybrid Battery/Super Capacitor Energy Storage

: The present work addresses the modelling, control, and simulation of a microgrid integrated wind power system with Doubly Fed Induction Generator (DFIG) using a hybrid energy storage system. In order to improve the quality of the waveforms (voltages and currents) supplied to the grid, instead of a two level-inverter, the rotor of the DFIG is supplied using a three-level inverter. A new adaptive algorithm based on combined Direct Reactive Power Control (DRPC) and fuzzy logic controls techniques is applied to the proposed topology. In this work, two topologies are proposed. In the ﬁrst one, the active power injected into the grid is smoothened by using an economical hybrid battery and supercapacitor energy storage system. However, in the second one, the excess wind energy is used to produce and store the hydrogen, and then a solid oxide fuel cell system (SOFC) is utilized to regenerate electricity by using the stored hydrogen when there is not enough wind energy. To avoid overcharging, deep discharging of batteries, to mitigate ﬂuctuations due to wind speed variations, and to fulﬁl the requirement of the load proﬁle, a power management algorithm is implemented. This algorithm ensures smooth output power in the ﬁrst topology and service continuity in the second. The modelling and simulation results are presented and analysed using Matlab/Simulink. nu- and


Introduction
Current emphases on renewable energy sources (RESs) have led to a high volume of integration of hybrid systems to smart grids. This high integration leads to some problems regarding the power quality, reliability, and stability of the electrical grid system [1]. The possible solution is the microgrid, which exhibits less power fluctuation, improved power quality, energy, and lower unbalance due to the hybrid renewable sources provided by the Electrical Energy Storage Systems (EESSs) [2,3]. Suitable EESSs could provide a crucial approach to overcome the uncertainties and intermittency of the RESs' generations [1,3,4]. Generally, EESS permits a reliable electricity production that can be used at high generation cost, high demand, or when no other generation means are available [2][3][4][5][6]. The various and the 5kW solid oxide fuel cell system (SOFC) can regenerate electricity by using the stored hydrogen when there is not enough of wind energy. This solution can be adapted as an electric charging station for a future ecological electric vehicle. It can be used for charging fuel cells or a fully electric vehicle. A comparative analysis of the proposed topology and control with some tabulated references is addressed in Table 1 is addressed.
Energies 2021, 14, x FOR PEER REVIEW 3 of 30 topology can increase the local electricity network's stability and increase security of supply at a local level, thus contributing to a region's self-sufficiency. However, in the second one (Figure 1b), the wind excess energy is used to produce and store the hydrogen and the 5kW solid oxide fuel cell system (SOFC) can regenerate electricity by using the stored hydrogen when there is not enough of wind energy. This solution can be adapted as an electric charging station for a future ecological electric vehicle. It can be used for charging fuel cells or a fully electric vehicle. A comparative analysis of the proposed topology and control with some tabulated references is addressed in Table 1 is addressed.   The rest of the present work is organized as follows: in Section 2, the description of the proposed micro-grid hybrid energy system is explained. The proposed controller design and power management systems are given in Section 3. Section 4 presents several simulation tests, carried out under different conditions to show the effectiveness of the proposed systems. Finally, the main conclusions are presented in Section 5.

Description of the Proposed Micro-grid Hybrid Energy System
The system under study with a hybrid energy source is constituted by a WT-DFIG indirect frequency converter (AC/DC/AC) with a common DC bus and HESS, as depicted in Figure 1. A Maximum Power Point Tracking (MPPT) algorithm is selected to regulate the speed of the WT for maximum power extraction (see Figure 2). The WT-DFIG is associated with hybrid ESS combining the BBESS and SCESS to an FC with an electrolyzer system combined with BBESS, as shown in Figure 1a,b, respectively.  The rest of the present work is organized as follows: in Section 2, the description of the proposed micro-grid hybrid energy system is explained. The proposed controller design and power management systems are given in Section 3. Section 4 presents several simulation tests, carried out under different conditions to show the effectiveness of the proposed systems. Finally, the main conclusions are presented in Section 5.

Description of the Proposed Micro-grid Hybrid Energy System
The system under study with a hybrid energy source is constituted by a WT-DFIG indirect frequency converter (AC/DC/AC) with a common DC bus and HESS, as depicted in Figure 1. A Maximum Power Point Tracking (MPPT) algorithm is selected to regulate the speed of the WT for maximum power extraction (see Figure 2). The WT-DFIG is associated with hybrid ESS combining the BBESS and SCESS to an FC with an electrolyzer system combined with BBESS, as shown in Figure 1a,b, respectively.

Model Development for the Wind Energy Conversion
The aerodynamic power that can be captured by the turbine is given as follows [20,30]: where, P m is the mechanical power of the wind turbine, C p is the power coefficient, β is the blade angle, λ is the speed ratio, A is area swept by the rotor blades, and V t is the wind speed. An AC/DC/AC converter is used to partially connect the DFIG with the grid, controlled by using the proposed Direct Reactive Power Control (DRPC) as depicted in Figure 3 [31]. The model of the DFIG expressed as given below [20,30]: where, V sd and V sq are the stator voltages, V rd and V rq are the rotor voltages, I sd and I sq are the stator voltages, I rd and I rq are the rotor currents, R s and R r are the stator and rotor phase resistances, respectively; ls and lr are the stator and rotor leakage inductances, M is the magnetizing inductance, ω s and ω are the grid and mechanical pulsation, and L s = l s + M L r = l r + M . The Direct Torque Control (DTC) is based on the regulation of the rotor flux magnitude and the electromagnetic torque. They are estimated from the components of the rotor flux and the calculated values of the rotor current's α and β axes, as given below [18,30,31]: where, Φ rα , Φ rβ , and Φ r are the rotor flux components along α and β rotor axes and the rotor flux, T em is the DFIG electromagnetic torque, and p is the pair pole numbers. The principle of the proposed control technique is based on the DRPC applied to the three-level inverter. It is directly inspired by the system used in two level-inverter cases, as described in [22,31]. The active output power is controlled by the electromagnetic torque, while the reactive power is controlled by the rotor flux magnitude, which is computed by the selected fuzzy logic strategy.     Each level is schematized by three switches to analyze the potential generated by the inverter, which allows for the ability to independently connect the rotor inputs to the source potentials (represented by V dc /2, 0, and −V dc /2). By using the αβ-subspace, a voltage vector is computed and combined with the rotor flux spatial position. Thus, the different state number for this vector is 19, since the same voltage vector is computed by some of the 27 possible combinations, as shown in Figure 4. The three-level inverter space voltage vector diagram is divided into twelve sectors using the diagonal between the adjacent medium and the long vector. Thus, the optimal vector is selected from the rotor flux linkage and torque errors from all the 19 different available vectors, as shown in Figure 4. The controller design process structure is based on the hysteresis controller output relating to the variable torque (C trq ), the variable-flux (C flx ), and the rotor flux vector position (sector N). If the torque comparator's output is high or equal to two, the inverter state is considered high; otherwise, the state is low. Boolean variable C trq is used to represent the output of this corrector, which indicates whether the amplitude of the torque must be increased, decreased, or maintained constant, as expressed below: ∆tr dt > 0 Then; C trq = −1 If ∆tr < −ε tr 2 Then; C trq = −2 (5)  where, ∆tr is the electromagnetic torque error and ε tr is the torque hysteresis band state of switch. The output of the flux corrector is represented by C flx , which indicates directly if the amplitude of flux must be maintained constant (C flx = 0), decreased (C flx = −1), or increased (C flx = 1), as to maintain: |Φ r_ref − Φ r | ≤ ∆ϕ r , as follows: where, ∆φ r denotes the error of the rotor flux and ε flx is the flux hysteresis band state of switch. The optimally selected voltage vector is chosen using one of the solutions adopted, which is the commutation table represented by Table 2. By analyzing each available voltage vector's effect, it can be deduced that the torque and flux linkage is affected by the variation of the direction and module of the selected vector. To reduce the commutations number in the inverter's legs, the null voltages vectors (V 0 , V 7 , and V 14 ) are chosen alternately [23,31]. Thus, the DFIG compensates for the reactive power exchanged between the bus bar from the AC side (Q rg ) and the proposed system by knowing that the DC/AC converter II output is operating at unity power factor, as described in [22,31].
In order to be efficient with the system demands, it is important to size the super capacitors properly. In this case, the super capacitors must be able to provide a power of 7.5 kW for one hour (3600 s), the voltage at their terminals is around 440 V. This voltage level was obtained by putting several elements in series (176 elements with a nominal voltage of 2.5 V). The equivalent capacity is calculated from the following equations: Q SC = (I SC ) t = 17.045 (3600) = 61, 362C Therefore, the super capacitor size must be higher than 139.46 F. Where, P SC , U SC , I SC , Q SC , and C SC represent the super capacitor power, the super capacitor voltage, the super capacitor current, the super capacitor charge, and capacitance respectively.

Model Development for the Supercapacitor
The literature review concerning super capacitor Modelling can be divided into two groups using equivalent circuits. A nonlinear equivalent capacitance is adopted concerning the first group [32], while the super capacitor relaxation long-rang phenomena are taken into account via the application of fractional differentiation in Modelling [33]. In the present work, the super capacitor model is based on a simplified (R, C) model that is more suitable for applications where the capacitor's energy stored in the capacitor is of primary importance [20]. It consists of an equivalent series resistance ESR and a non-linear capacitance C(v sc0 ), as depicted by Figure 5. The super capacitor parameters are identified using the constant current tests method [34,35].

Model Development for the Battery Bank
In this application a standard battery model is selected and modeled as described below [22,37]: where, ESC, VBat, IBat, Qd, and CBat are the battery electromotive force, the battery voltage, the battery current, ampere-hours stored, and internal capacity, respectively. The Battery State of Charge (SOC), the amount of electricity stored during the charge, is an important parameter to be controlled. The battery SOC must be detectable by the proposed supervisory system to make decisions according to its status and the required power. In the battery the ampere-hours stored during a time, t corresponds to Qd, with a nominal capacity Cbat and a charging current Ibat.

Model Development for the Fuel Cell
Today, renewable energies are considered as an inescapable solution to reduce the dependence of society on fossil fuels. Thus, the use of hydrogen as an energy carrier is currently considered an exciting option in the energy transition trend, especially when renewable energy sources produce hydrogen. Among all fuel cell types, the solid oxide fuel cell (SOFC) is the most efficient one, and its efficiency is 70%. The SOFC has two major advantages over low-temperature types. First, it can achieve high electric efficiencies; this makes them particularly attractive for fuel-efficient stationary power generation. Second, the high operating temperatures allow for the direct internal processing of fuels such as natural gas. This reduces the system complexity compared with low-temperature power plants, which require hydrogen generation in an additional process step. The fact that high temperature fuel cells cannot easily be turned off is ac-

Model Development for the Battery Bank
In this application a standard battery model is selected and modeled as described below [22,37]: where, E SC , V Bat , I Bat , Q d , and C Bat are the battery electromotive force, the battery voltage, the battery current, ampere-hours stored, and internal capacity, respectively. The Battery State of Charge (SOC), the amount of electricity stored during the charge, is an important parameter to be controlled. The battery SOC must be detectable by the proposed supervisory system to make decisions according to its status and the required power. In the battery the ampere-hours stored during a time, t corresponds to Q d , with a nominal capacity Cbat and a charging current I bat .

Model Development for the Fuel Cell
Today, renewable energies are considered as an inescapable solution to reduce the dependence of society on fossil fuels. Thus, the use of hydrogen as an energy carrier is currently considered an exciting option in the energy transition trend, especially when renewable energy sources produce hydrogen. Among all fuel cell types, the solid oxide fuel cell (SOFC) is the most efficient one, and its efficiency is 70%. The SOFC has two major advantages over low-temperature types. First, it can achieve high electric efficiencies; this makes them particularly attractive for fuel-efficient stationary power generation. Second, the high operating temperatures allow for the direct internal processing of fuels such as natural gas. This reduces the system complexity compared with low-temperature power plants, which require hydrogen generation in an additional process step. The fact that high temperature fuel cells cannot easily be turned off is acceptable in the stationary sector, but most likely only there. The SOFC is also the most commercially-used system with the highest operating life. Moreover, the obtained water can be transported through steam turbines to produce more electricity, thus increasing the system efficiency. The SOFC consists of two electrodes separated by an electrolyte. The anode is fed with hydrogen and the cathode with oxygen [38]. The hydrogen oxidation takes place at the anode, whereas the oxygen reduction takes place at the cathode. The electrolyte allows the passage of ions and the electrons derived from the oxidation to move through the external circuit from the anode to the cathode. This principle is common to all fuel cells, while the type of electrolyte, geometry, and gas supply differ from one type to another, as shown in Figure 6 [39]. A fuel cell is a promising technology for micro-grid applications and direct power generation. It is a device that permits the conversion of chemical energy into electrical energy with a higher efficiency [22].
where, Vcell is the cell voltage in the stack, icell, i0, and iL are the operating exchange current of the cell and the limiting current at which the fuel is used up at a rate equal to its maximum supply rate, respectively. Rincell is the inherent resistance of the fuel cell, Acell and Bcell are the numerical constant coefficients of the fuel cell. The instantaneous change of the effective partial pressures of hydrogen and water vapor in the anode gas flow channel can be determined through the ideal gas equations, as follows [40]:  Equation (10) shows the combustion reaction with the simplest fuel separated by hydrogen on two characteristic half-sequences of SOFC fuel cells. The ideal open circuit cell voltage is given by the Nernst equation: where, V Nernst is Nernst voltage, which is the thermodynamic potential of the cell representing its reversible voltage, ∆G is Gibbs free energy from the reaction and p ref is the standard pressure 0.1 MPa. The Nernst potential is reduced when the electrical cell circuit is closed and given by the following equation: where, V cell is the cell voltage in the stack, i cell , i 0 , and i L are the operating exchange current of the cell and the limiting current at which the fuel is used up at a rate equal to its maximum supply rate, respectively. R incell is the inherent resistance of the fuel cell, A cell and B cell are the numerical constant coefficients of the fuel cell. The instantaneous change of the effective partial pressures of hydrogen and water vapor in the anode gas flow channel can be determined through the ideal gas equations, as follows [40]: dp ch dp ch Energies 2021, 14, 5722 11 of 31 Figure 7 shows the P-V and I-V characteristics using the developed model (Equations (14)- (18)) [41]. The FC stack is the input, and the output is the FC voltage. For a single cell, this voltage is expressed as [42]: (19) s 2021, 14, x FOR PEER REVIEW 11 of 30 Figure 7 shows the P-V and I-V characteristics using the developed model (Equations (14)- (18)) [41]. The FC stack is the input, and the output is the FC voltage. For a single cell, this voltage is expressed as [42]:

Model Development for the Electorlyzer
Three primary technologies are available in the electrolysis process proton exchange: Membrane electrolyzer, alkaline electrolyzer, and solid oxide electrolyzer (SOE). The high operating temperature of SOE systems, which are 550-1100 °C during working temperatures, removes the requirement for costly catalysts and enhances conversion efficiency and system integration potential. The high working temperature also offers the opportunity to use existing steam or heat sources for water to steam to minimize the energy input required for the SOE system. The decomposition of the water into oxygen and hydrogen is realized by an electrical current flow via the electrolyzer which is represented by the empirical VElec (IElec) equation given bellow [13,22]: Where r1 and r2 represent the ohmic resistances parameters of the electrolyzer, kElec, kT1, kT2, and kT3 are overvoltage parameters. AElec denotes the cell electrode area.

Power Management and DC-Grid Voltage Control
The main objective of the power management strategy is to ensure a sufficient level of power quality which depends on the form of the stored energy. Two case studies have been undertaken to analyse the power management strategy.

Hybrid Storage System with BBESS and SCESS
In this case, two buck-boost DC (BBDC) converters, via the DC-grid side, are connected, respectively, to the bank battery or super capacitor energy storage systems

Model Development for the Electorlyzer
Three primary technologies are available in the electrolysis process proton exchange: Membrane electrolyzer, alkaline electrolyzer, and solid oxide electrolyzer (SOE). The high operating temperature of SOE systems, which are 550-1100 • C during working temperatures, removes the requirement for costly catalysts and enhances conversion efficiency and system integration potential. The high working temperature also offers the opportunity to use existing steam or heat sources for water to steam to minimize the energy input required for the SOE system. The decomposition of the water into oxygen and hydrogen is realized by an electrical current flow via the electrolyzer which is represented by the empirical V Elec (I Elec ) equation given bellow [13,22]: where r 1 and r 2 represent the ohmic resistances parameters of the electrolyzer, k Elec , k T1 , k T2 , and k T3 are overvoltage parameters. A Elec denotes the cell electrode area.

Power Management and DC-Grid Voltage Control
The main objective of the power management strategy is to ensure a sufficient level of power quality which depends on the form of the stored energy. Two case studies have been undertaken to analyse the power management strategy.

Hybrid Storage System with BBESS and SCESS
In this case, two buck-boost DC (BBDC) converters, via the DC-grid side, are connected, respectively, to the bank battery or super capacitor energy storage systems (BBESS or Energies 2021, 14, 5722 12 of 31 SCESS). The BBDC converter control aims to maintain the DC voltage at its set value and adopt the BBESS or SCESS discharge/charge according to the demand. The BBESS buck-boost DC converter and its control are illustrated in Figure 8, where a hysteresis band control is used to switch the BBDC converter S BB1 and S BB2 , where the controller output of the battery bank is the reference current (see Figure 8b). The buck-boost converter permits the BBESS to maintain voltage lower than the reference voltage (V dc-ref ) of the DC-grid. Thus, several parallel-series-connected batteries are often necessary.
where, ηbatt is the battery efficiency, it is taken 100%  1, and MDPbatt is the maximum depth of discharge, which is taken in this study as 0.6 (SOCmax − SOCmin = 0.8 − 0.2).
6kW 1h 420V 0.6 1 = 23.81Ah (23) In this work, the charge/discharge of the battery is taken with an SOC range from 25% to 75% instead of 20% to 80% [22]. Given the power requirement and weather conditions, SCESS or BBESS can be considered either as a sink or power source. In case of hybrid power deficit/surplus, its charge/discharge should be within specified limits. The BBESS cannot feed the power instantaneously, given its inability to regulate the DC-grid voltage during transient state and its dynamic response, which is slow. Thus, a supercapacitor energy storage system is required, and a second BBDC converter is integrated between the DC-grid and the SCESS to increase the BBESS power when it is at low levels. The desired current of the BBESS is computed by the power flow available at the DC-grid, as depicted in Figure 9. This power flow is executed by the proposed energy management system (see Figure 10). The energy management strategy continuously requires the SCESS to provide an instantaneous power, and the BBESS provides an average power. Figure 9 shows that, when the battery SOC reaches 25% in the discharge mode or 75% charge mode, the super capacitor stores or provides the deficit or the excess required power.
In case of lower demand and a high wind energy generation, the BBESS receives the surplus power until it reaches its charge limit, since the SCESS supports the battery operations in rapid power variations, and then the super capacitor absorbs the additional power which is regulated via the BBDC (see Figures 9 and 10, where the management algorithm of the studied system is used for the first case, i.e., the Battery-Super-capacitor The BBESS rating is designed to provide in one hour approximately 6 kW. This rating is expressed as: (22) where, η batt is the battery efficiency, it is taken 100% ⇒ 1, and MDP batt is the maximum depth of discharge, which is taken in this study as 0.6 (SOC max − SOC min = 0.8 − 0.2).
In this work, the charge/discharge of the battery is taken with an SOC range from 25% to 75% instead of 20% to 80% [22]. Given the power requirement and weather conditions, SCESS or BBESS can be considered either as a sink or power source. In case of hybrid power deficit/surplus, its charge/discharge should be within specified limits. The BBESS cannot feed the power instantaneously, given its inability to regulate the DC-grid voltage during transient state and its dynamic response, which is slow. Thus, a supercapacitor energy storage system is required, and a second BBDC converter is integrated between the DC-grid and the SCESS to increase the BBESS power when it is at low levels. Figures 9 and 10 show the above-discussed control coordination flowchart among various sources. The associated BBESS and BBDC converter ensures the DC-grid voltage control. The desired current of the BBESS is computed by the power flow available at the DC-grid, as depicted in Figure 9. This power flow is executed by the proposed energy management system (see Figure 10). The energy management strategy continuously requires the SCESS to provide an instantaneous power, and the BBESS provides an average power. Figure 9 shows that, when the battery SOC reaches 25% in the discharge mode or 75% charge mode, the super capacitor stores or provides the deficit or the excess required power.
storage system, and there is no legend in this figure). Moreover, it contains the conditions and the equations. In case of low wind energy, the BBESS supplies the power requirement even for high demands supported by SCESS up to the SOC lower limit. The SCESS ensures service continuity by supplying the power requirement when the BBESS reaches its lower limit.

Hybrid Storage System with Battery Bank and FC Combined with Electrolyzer
For this second case, the SOC range of the BBESS is taken from 20% to 80% [31,43]. Figure 11 shows that the control input of the DC boost is generated by the FC controller. The FC controllers and the battery are developed in cases where there is a sudden change in power demand, in which the battery provides instantaneous power and the power supply of the battery should decrease, since the power output of the FC increases. To achieve high coordination between the FC and the BBESS, an FC combined with a DC boost controller is proposed, assuming a zero-battery current. Moreover, the FC should replace the BBESS in the case where the battery SOC is at 20% to provide power. The excess of the produced energy is used to charge the bank of the battery until its limit. The rest of the power is transferred to the electrolyzer through the buck-boost DC converter (see Figure 12), which is controlled in such a way that the duty cycle is increased to increase the DC-grid voltage when the SOC is at its limit (80%). power which is regulated via the BBDC (see Figures 9 and 10, where the management algorithm of the studied system is used for the first case, i.e., the Battery-Super-capacitor storage system, and there is no legend in this figure). Moreover, it contains the conditions and the equations. In case of low wind energy, the BBESS supplies the power requirement even for high demands supported by SCESS up to the SOC lower limit. The SCESS ensures service continuity by supplying the power requirement when the BBESS reaches its lower limit.

Hybrid Storage System with Battery Bank and FC Combined with Electrolyzer
For this second case, the SOC range of the BBESS is taken from 20% to 80% [31,43]. Figure 11 shows that the control input of the DC boost is generated by the FC controller. The FC controllers and the battery are developed in cases where there is a sudden change in power demand, in which the battery provides instantaneous power and the power supply of the battery should decrease, since the power output of the FC increases. To achieve high coordination between the FC and the BBESS, an FC combined with a DC boost controller is proposed, assuming a zero-battery current. Moreover, the FC should P L-AC , P L-DC , P g , P s , P r , P SC , P Bat P Net > 0 P r > 0

Deficit Power Excess Power
No Yes P r > 0 No  P rg < 0, P rg = P r + P Net P rg Yes < 0 P r = P Net -P rg P r = P Net = 0 P r = P Net + P rg > 0  P rg > 0, P Net = P rg -P r Yes No In case of lower demand and a high wind energy generation, the BBESS receives the surplus power until it reaches its charge limit, since the SCESS supports the battery operations in rapid power variations, and then the super capacitor absorbs the additional power which is regulated via the BBDC (see Figures 9 and 10, where the management algorithm of the studied system is used for the first case, i.e., the Battery-Super-capacitor storage system, and there is no legend in this figure). Moreover, it contains the conditions and the equations. In case of low wind energy, the BBESS supplies the power requirement even for high demands supported by SCESS up to the SOC lower limit. The SCESS ensures service continuity by supplying the power requirement when the BBESS reaches its lower limit.

Hybrid Storage System with Battery Bank and FC Combined with Electrolyzer
For this second case, the SOC range of the BBESS is taken from 20% to 80% [31,43]. Figure 11 shows that the control input of the DC boost is generated by the FC controller. The FC controllers and the battery are developed in cases where there is a sudden change in power demand, in which the battery provides instantaneous power and the power supply of the battery should decrease, since the power output of the FC increases. To achieve high coordination between the FC and the BBESS, an FC combined with a DC boost controller is proposed, assuming a zero-battery current. Moreover, the FC should replace the BBESS in the case where the battery SOC is at 20% to provide power. The excess of the produced energy is used to charge the bank of the battery until its limit. The rest of the power is transferred to the electrolyzer through the buck-boost DC converter (see Figure 12), which is controlled in such a way that the duty cycle is increased to increase the DC-grid voltage when the SOC is at its limit (80%).
power from the FC and the average power from BBESS operate according to the SOC of the battery. In the charge mode, the electrolyzer must store the excess of the power when the SOC reaches 80% and starts to produce hydrogen (see Figure 12), which is stored in its tank. Conversely, in the discharge mode, the FC must provide the power deficit when the SOC decreases to 20%. Moreover, in cases of low demand (PNet > 0) or of excess wind power, the surplus of the power is used to charge the BB until its limit (80%). Then, the battery operations are supported by the electrolyzer by absorbing the power excess, which is clearly illustrated in Figure 13. In the case of low power generation from RESs, the BBESS delivers the power needed by the FC, even with high demand (PNet < 0), ensuring the service continuity up to the SOC's lower limit. Thus, the DC-grid voltage (Vdc) control is ensured by the associated BBESS and BBDC, according to the flowchart given by Figure 13.    Figure 11 shows the FC associated to its DC boost converter and its control. It raises the power to provide the necessary power instantaneously. In Figure 13, it can be seen that the control of the DC-grid's voltage is achieved through the BBESS' association with the BBDC converter. The difference between the required and the generated powers can be expressed as below: Energies 2021, 14, 5722 15 of 31 P rAC = P AC − P s (25) P rg = P L−DC + P rAC (26) P Net = P r + P rg (27) where, P r and P s represent the rotor and stator powers of the DFIG. P L-DC and P L-AC represent the DC and AC load powers, P rAC denotes the transferred power via the DC/AC converter, P Bat and P SC denote the BBESS and SCESS powers, P Elect and P FC represent the electrolyzer and FC powers, P g and P AC represent the powers exchanged between the AC grid and the proposed management system.  The reactive power exchange between the AC side (grid) (QAC) and the microgrid is provided by the DFIG, where the DC/AC converter II is forced to operate at unity power factor, as expressed below: Where, φL-AC denotes the phase of the local load, QAC and QL-AC represents the reactive powers exchanged with the AC grid together and the AC load, Qs denotes the reactive power exchange between the AC grid and the stator of the DFIG, and Qrg denotes the transferred reactive power via DC/AC converter II. The proposed management and control strategies ensure that the instantaneous power from the FC and the average power from BBESS operate according to the SOC of the battery. In the charge mode, the electrolyzer must store the excess of the power when the SOC reaches 80% and starts to produce hydrogen (see Figure 12), which is stored in its tank. Conversely, in the discharge mode, the FC must provide the power deficit when the SOC decreases to 20%. Moreover, in cases of low demand (P Net > 0) or of excess wind power, the surplus of the power is used to charge the BB until its limit (80%). Then, the battery operations are supported by the electrolyzer by absorbing the power excess, which is clearly illustrated in Figure 13. In the case of low power generation from RESs, the BBESS delivers the power needed by the FC, even with high demand (P Net < 0), ensuring the service continuity up to the SOC's lower limit. Thus, the DC-grid voltage (Vdc) control is ensured by the associated BBESS and BBDC, according to the flowchart given by Figure 13.
The reactive power exchange between the AC side (grid) (Q AC ) and the microgrid is provided by the DFIG, where the DC/AC converter II is forced to operate at unity power factor, as expressed below: where, ϕ L-AC denotes the phase of the local load, Q AC and Q L-AC represents the reactive powers exchanged with the AC grid together and the AC load, Q s denotes the reactive power exchange between the AC grid and the stator of the DFIG, and Q rg denotes the transferred reactive power via DC/AC converter II.

Results and Discussion
In the present paper, the proposed combined hybrid EESS and WT-DFIG is connected to the micro-grid. The EESS consists of two different systems. The first one is composed of BBESS and SCESS, whereas the second is composed of fuel cells and electrolyzer combined with BBESS. This association can be used as an uninterruptible power supply when the micro-grid is disconnected, wherein the WT-DFIG generation is maximized or kept constant through the used MPPT and pitch angle control, depending on the presented situation.
The simulation results of the proposed energy management system are performed under Matlab/Simulink, and the used parameters can be found in Table 3 [22,42]. The proposed system performance simulations have used under-realized weather data (wind speed profile) and variable power requirements, which highlights the effects and contribution of this hybrid system on the injected and/or required energy's efficiency and quality. The simulation tests are given in two parts: In the first one, the BBESS and SCESS are associated with the WT-DFIG; In the second part, simulations are carried out, replacing that SCESS with an FC-electrolyzer configuration.

Results of the Topology1: Hybrid Storage System with BBESS and SCESS
In this study, a random wind speed and a variable local reactive power demand were used to test the system with the proposed controller. Figures 14 and 15 illustrate the used wind profile which was selected such that the DFIG operation area corresponds to zones I and II for the MPPT control and zone III for the blade pitch control (see Figure 2). the super capacitor and the battery is used to supply the load demand when the DFIG is unable to generate enough power. Figure 25 shows that Vdc is well maintained at its references (880 V).     Figures 28 and 29 show that the currents wave form is generated, which optimizes the power-transferred AC-grid with constant frequency (50 Hz) and fewer harmonics.  From the T em (Figure 16), Q AC ( Figure 17) and the Φ r (Figure 18), one can see clearly that the electromagnetic torque, the rotor flux, and the reactive power tracked their references very well, even with sudden changes of the wind and reactive power demand compensation. Therefore, the robustness of the proposed DRPC has been confirmed. Moreover, one can see that the coefficient of the power in zones I and II is optimized due to the torque adaptation, unlike zone III, where the torque must be kept fixed for a constant power generation. Furthermore, the rotor flux highly regulates the reactive power, with a contribution of the DFIG in these management operations (see Figure 19). Regarding Figure 20, the DFIG rotor flux components in the α-β frame and the sub-graphs (zooms) of this figure illustrate the passage during the three operation modes: Sub, super, and synchronous mode. The DRPC makes the DFIG rotor flux component in the natural frame (abc) and in the α-β frame have the same sinusoidal form as the rotor currents in both sub and super-synchronous operation modes, of which the sub-graphs of Figure 20 confirm these to be at t = 90 s and t = 560 s. In addition, during the synchronous operation mode, the rotor currents and even the rotor flux in the α-β frame have a continuous form, with a sub-figure of t = 225 s. In Figure 21, the power coefficient, tip speed ratio, and the blade pitch angle are perfectly controlled by the MPPT algorithm in all zones I, II, and III (β = 0, λ = λ opt = 9, C p = C p-max = 0.49), which means that the conversion system works at maximum power (P s-max ). Figures 22-24 depict the required, generated, and absorbed powers (P L ). One can deduce that, when P Net < 0, the extra power in the DC-link is stored in both the super capacitor and the battery; When P Net > 0, the extra power stored in both the super capacitor and the battery is used to supply the load demand when the DFIG is unable to generate enough power. Figure 25 shows that V dc is well maintained at its references (880 V). the super capacitor and the battery is used to supply the load demand when the DFIG is unable to generate enough power. Figure 25 shows that Vdc is well maintained at its references (880 V).

Figures 26 and 27
show that the super capacitor supplements extra power when the DFIG generates low energy (SOC ≤ SOCmin) and vice versa. When the battery is fully charged, the super capacitor is charged with excess power from the DFIG (SOC ≥ SOCmax). Figures 28 and 29 show that the currents wave form is generated, which optimizes the power-transferred AC-grid with constant frequency (50 Hz) and fewer harmonics.           . DFIG slip evolution. Figure 19. DFIG slip evolution.   Significant improvement in the injected power to the AC grid is observed when compared to the results obtained in [4,18,22]. Figure 28a-c show that the proposed DRPC offers a very low total harmonic distortion (THD) during all DFIG operation modes. When t = 90 s, the system worked under sub-synchronous mode and the THD = 0.24%; When t = 228 s, the system worked under the synchronous mode and the THD = 0.09%; When t = 560 s, the system worked under the super-synchronous mode, and the THD = 0.15%. Figure 29 presents the frequency response which is fixed around its reference with an error of 0.1% (49.95 Hz), which is better than the results that were obtained in [18].  Significant improvement in the injected power to the AC grid is observed when compared to the results obtained in [4,18,22]. Figure 28a-c show that the proposed DRPC offers a very low total harmonic distortion (THD) during all DFIG operation modes. When t = 90 s, the system worked under sub-synchronous mode and the THD = 0.24%; When t = 228 s, the system worked under the synchronous mode and the THD = 0.09%; When t = 560 s, the system worked under the super-synchronous mode, and the THD = 0.15%. Figure 29 presents the frequency response which is fixed around its reference with an error of 0.1% (49.95 Hz), which is better than the results that were obtained in [18].    Significant improvement in the injected power to the AC grid is observed when compared to the results obtained in [4,18,22]. Figure 28a-c show that the proposed DRPC offers a very low total harmonic distortion (THD) during all DFIG operation modes. When t = 90 s, the system worked under sub-synchronous mode and the THD = 0.24%; When t = 228 s, the system worked under the synchronous mode and the THD = 0.09%; When t = 560 s, the system worked under the super-synchronous mode, and the THD = 0.15%. Figure 29 presents the frequency response which is fixed around its reference with an error of 0.1% (49.95 Hz), which is better than the results that were obtained in [18].  Figures 26 and 27 show that the super capacitor supplements extra power when the DFIG generates low energy (SOC ≤ SOC min ) and vice versa. When the battery is fully charged, the super capacitor is charged with excess power from the DFIG (SOC ≥ SOC max ). Figures 28 and 29 show that the currents wave form is generated, which optimizes the power-transferred AC-grid with constant frequency (50 Hz) and fewer harmonics.    Figure 30 shows the studied system under the second topology, where the system shown in Figure 1b was simulated for about 10 h in one day under variable wind speed. Figures 31 and 32 represent the requirement profiles of the power. Figure 30 shows that the conversion system extracts the maximum power due to the pitch angle controller, regulating the power coefficient and the tip-speed ratio, while the mechanical speed is fixed. Figures 30 and 31 show that electromagnetic torque, the compensated reactive power, and the mechanical speed are perfectly regulated to their references. Figure 32 shows the responses of the required power represented by PReq, the absorbed power by the DFIG depicted by Pr, the generated stator Ps, and the generated rotor power Pr. Figure 33 shows the H2 generation and the SOC of the BBESS, which is limited within the range of 20-80%. Figure 34 shows that the battery bank charged at 80%, and the electrolyzer dissipates the power excess when PNet > 0 to generate H2 stored in a specific tank. Conversely, the energy stored in the battery bank is used to supply the required demand when the power generated from the DFIG is not sufficient (PNet < 0), and    Figure 30 shows the studied system under the second topology, where the system shown in Figure 1b was simulated for about 10 h in one day under variable wind speed. Figures 31 and 32 represent the requirement profiles of the power. Figure 30 shows that the conversion system extracts the maximum power due to the pitch angle controller, regulating the power coefficient and the tip-speed ratio, while the mechanical speed is fixed. Figures 30 and 31 show that electromagnetic torque, the compensated reactive power, and the mechanical speed are perfectly regulated to their references. Figure 32 shows the responses of the required power represented by PReq, the absorbed power by the DFIG depicted by Pr, the generated stator Ps, and the generated rotor power Pr. Figure 33 shows the H2 generation and the SOC of the BBESS, which is limited within the range of 20-80%. Figure 34 shows that the battery bank charged at 80%, and the electrolyzer dissipates the power excess when PNet > 0 to generate H2 stored in a specific tank. Conversely, the energy stored in the battery bank is used to supply the required demand when the power generated from the DFIG is not sufficient (PNet < 0), and    Figure 30 shows the studied system under the second topology, where the system shown in Figure 1b was simulated for about 10 h in one day under variable wind speed. Figures 31 and 32 represent the requirement profiles of the power. Figure 30 shows that the conversion system extracts the maximum power due to the pitch angle controller, regulating the power coefficient and the tip-speed ratio, while the mechanical speed is fixed. Figures 30 and 31 show that electromagnetic torque, the compensated reactive power, and the mechanical speed are perfectly regulated to their references. Figure 32 shows the responses of the required power represented by PReq, the absorbed power by the DFIG depicted by Pr, the generated stator Ps, and the generated rotor power Pr. Figure 33 shows the H2 generation and the SOC of the BBESS, which is limited within the range of 20-80%. Figure 34 shows that the battery bank charged at 80%, and the electrolyzer dissipates the power excess when PNet > 0 to generate H2 stored in a specific tank. Conversely, the energy stored in the battery bank is used to supply the required demand when the power generated from the DFIG is not sufficient (PNet < 0), and when these batteries are at 20% of the SOC, the FC gets connected to ensure service continuity. Figure 35 illustrates the DC-grid voltage responses, the electrolyzer, the voltages across the FC, and the BBESS, which clearly depict that the DC-grid voltage is well maintained at its required reference, even under the required demand changes and hybrid power generation.        Significant improvement in the injected power to the AC grid is observed when compared to the results obtained in [4,18,22]. Figure 28a-c show that the proposed DRPC offers a very low total harmonic distortion (THD) during all DFIG operation modes. When t = 90 s, the system worked under sub-synchronous mode and the THD = 0.24%; When t = 228 s, the system worked under the synchronous mode and the THD = 0.09%; When t = 560 s, the system worked under the super-synchronous mode, and the THD = 0.15%. Figure 29 presents the frequency response which is fixed around its reference with an error of 0.1% (49.95 Hz), which is better than the results that were obtained in [18]. Figure 30 shows the studied system under the second topology, where the system shown in Figure 1b was simulated for about 10 h in one day under variable wind speed. Figures 31 and 32 represent the requirement profiles of the power. Figure 30 shows that the conversion system extracts the maximum power due to the pitch angle controller, regulating the power coefficient and the tip-speed ratio, while the mechanical speed is fixed. Figures 30 and 31 show that electromagnetic torque, the compensated reactive power, and the mechanical speed are perfectly regulated to their references. Figure 32 shows the responses of the required power represented by P Req , the absorbed power by the DFIG depicted by P r , the generated stator P s , and the generated rotor power P r .       Figure 33 shows the H 2 generation and the SOC of the BBESS, which is limited within the range of 20-80%. Figure 34 shows that the battery bank charged at 80%, and the electrolyzer dissipates the power excess when P Net > 0 to generate H 2 stored in a specific tank. Conversely, the energy stored in the battery bank is used to supply the required demand when the power generated from the DFIG is not sufficient (P Net < 0), and when these batteries are at 20% of the SOC, the FC gets connected to ensure service continuity. Figure 35 illustrates the DC-grid voltage responses, the electrolyzer, the voltages across the FC, and the BBESS, which clearly depict that the DC-grid voltage is well maintained at its required reference, even under the required demand changes and hybrid power generation.          Remark 1. The case where 5-level hysteresis is used to compute electromagnetic torque and a three-level hysteresis comparator is used to achieve rotor flux, is considered. Moreover, the voltage across the SCESS and the BBESS is fixed around 420 Volts.

Power quality parameters according to IEC 61400-21:
The IEC 61400-21 defines parameters to be measured and reported at a Wind Energy Conversion system [44]: • Active and reactive power characteristic; • Flicker emissions; • Current harmonics (THD); • Active power controls; • Reactive power controls.

(1) Active and reactive power characteristic:
The proposed WT-DFIG system has been tested experimentally in [47], the measurement of the electrical characteristics are presented in Table 4: (2) Flicker measurement: To show the level of flicker emission of the WT system, the IEC standard flicker meter presented in [48] has been implemented on MATLAB/Simulink. The instantaneous flicker sensation (P fs ) of WT system is shown in Figure 36; however, the P fs is very low during all 10min of test. According to the IEC standard, the AC grid of 440 V is classified as a Low Voltage Network (0.44 kV), therefore, the authorized value of the short-term flicker emission (P st ) should be equal or less than 1 (≤1), according to IEC series standards [49]. To calculate P st , the Equations (32)- (36) have been used [50,51]: P st = (0.314·P 0.1 + 0.0525·P 1s + 0.0657·P 3s + 0.28·P 10s + 0.08·P 50s ) (32) where: P 50s = (P 30 + P 50 + P 80 ) 3 (33) P 10s = (P 6 + P 8 + P 10 + P 13 + P 17 ) 5 P x is the x-th percentile of the P sf values logged during a specified time interval, where x is 0.1, 0.7, 1, 1.5, 2.2, 3, 4, 6, 8, 10, 13, 17, 30, 50, and 80, respectively. The interval can be 10 min, as IEC 61000-4-30 standard assumes for a typical flicker severity evaluation.
Calculating these criteria for the WT-DFIG system controlled by the proposed method shows that the P st level is 0.2931, which is acceptable according to the IEC norms.

(3) Current harmonics:
At point of common coupling, the voltage harmonics depend on the Wind Energy Conversion System (WECS)'s harmonic current emission, the grid impedance, and the phase angle. Therefore, the current harmonics emitted by the WEC system must be reported (according to IEC 61400-21) [44,52]. The total harmonic current distortion (THD) is calculated based on the Equation (37) [44,52]: The generated currents' THD during the passage from one mode to another is presented in Figure 28. It is generally lower than one.

(4) Active power control:
The ability of the WT-DFIG to track a certain set point and to limit the activity power tested and measured at rated wind speeds using the proposed control method and the multi-level converter is presented in Figure 37 [44,52]. The WT-DFIG system is able to track a given limitation very quickly and precisely. This shows how WT-DFIG system can be adapted to changes in the existing connection capacity.  Calculating these criteria for the WT-DFIG system controlled by the proposed method shows that the Pst level is 0.2931, which is acceptable according to the IEC norms.

(3) Current harmonics:
At point of common coupling, the voltage harmonics depend on the Wind Energy Conversion System (WECS)'s harmonic current emission, the grid impedance, and the phase angle. Therefore, the current harmonics emitted by the WEC system must be reported (according to IEC 61400-21) [44,52].
The total harmonic current distortion (THD) is calculated based on the Equation (37) [44,52]: The generated currents' THD during the passage from one mode to another is presented in Figure 28. It is generally lower than one.

(4) Active power control:
The ability of the WT-DFIG to track a certain set point and to limit the activity power tested and measured at rated wind speeds using the proposed control method and the multi-level converter is presented in Figure 37 [44,52]. The WT-DFIG system is able to track a given limitation very quickly and precisely. This shows how WT-DFIG system can be adapted to changes in the existing connection capacity.

(5) Reactive power control:
Similar tests have performed for the remote control of reactive power, as well as for active power, according to IEC 61400-21. Figure 38 shows the reactionary response step in a highly accurate and fast manner in accordance with the set-point schedule as outlined in IEC 61400-21 [44]. Changes can occur in less than one second from the maximum import to the maximum reactive power export. With this very quick dynamic, the proposed WT-DFIG can make notable contributions to both power quality and power sys-

Conclusions
A DFIG combined with a hybrid energy storage system connected to a micro-grid is

(5) Reactive power control:
Similar tests have performed for the remote control of reactive power, as well as for active power, according to IEC 61400-21. Figure 38 shows the reactionary response step in a highly accurate and fast manner in accordance with the set-point schedule as outlined in IEC 61400-21 [44]. Changes can occur in less than one second from the maximum import to the maximum reactive power export. With this very quick dynamic, the proposed WT-DFIG can make notable contributions to both power quality and power system stability of the proposed inverter.

Conclusions
A DFIG combined with a hybrid energy storage system connected to a micro-grid is studied in the present paper. The proposed HESS is constituted by super capacitor, fuel cell, battery banks, and electrolyzer. The power generation source is represented by the WT-DFIG, while the HESS is used for power optimization. Two configurations have been considered in this work, namely DFIG with BBESS and SC, to ensure a rapid response with which to regulate the difference between the generation and the demand. The numerical results clearly validate the objectives of both systems. Significant improvement of the performances of the micro-grid under unfavourable and critical conditions is observed by the proposed DRPC controller and proposed power management strategy, where robustness, the fast-tracking error and stability of the hall system, and better energy management, are observed. Moreover, the use of a three-level inverter inserted inside of the rotor of the DFIG has significantly improved the quality of the power transferred to the AC-grid. The power quality measuring and its analysis according to IEC standards are were carried out. The flicker emissions level was very low (under the IEC norm). Moreover, the proposed DRPC offers a very low total harmonic distortion (THD) during all DFIG operation modes, and the system worked under sub-synchronous mode with a THD = 0.24%, as well as under the synchronous mode with a THD = 0.09%, and under the super-synchronous mode, with a THD= 0.15%. Moreover, the frequency response is fixed around its reference with an error of 0.1% (49.95 Hz), which is better than the results that were obtained in the literature. Moreover, the active and reactive power remote control shows the effectiveness of the proposed method for the WT-DFIG system. The study of the thermal application of the SOFC is a part of our future works.

Conclusions
A DFIG combined with a hybrid energy storage system connected to a micro-grid is studied in the present paper. The proposed HESS is constituted by super capacitor, fuel cell, battery banks, and electrolyzer. The power generation source is represented by the WT-DFIG, while the HESS is used for power optimization. Two configurations have been considered in this work, namely DFIG with BBESS and SC, to ensure a rapid response with which to regulate the difference between the generation and the demand. The numerical results clearly validate the objectives of both systems. Significant improvement of the performances of the micro-grid under unfavourable and critical conditions is observed by the proposed DRPC controller and proposed power management strategy, where robustness, the fast-tracking error and stability of the hall system, and better energy management, are observed. Moreover, the use of a three-level inverter inserted inside of the rotor of the DFIG has significantly improved the quality of the power transferred to the AC-grid. The power quality measuring and its analysis according to IEC standards are were carried out. The flicker emissions level was very low (under the IEC norm). Moreover, the proposed DRPC offers a very low total harmonic distortion (THD) during all DFIG operation modes, and the system worked under sub-synchronous mode with a THD = 0.24%, as well as under the synchronous mode with a THD = 0.09%, and under the super-synchronous mode, with a THD= 0.15%. Moreover, the frequency response is fixed around its reference with an error of 0.1% (49.95 Hz), which is better than the results that were obtained in the literature. Moreover, the active and reactive power remote control shows the effectiveness of the proposed method for the WT-DFIG system. The study of the thermal application of the SOFC is a part of our future works.   area swept by the rotor blades, m 2 C p , C p-max power coefficient or the rotor efficiency and its maximum value T em , T em-ref DFIG electromagnetic torque and its reference respectively, N.m T t turbine aerodynamic torque, N.m v rated rated wind speed, tr/min v cut-out , v cut-in cut out and cut in wind speed (limited) respectively, m/s P s , P r DFIG stator and rotor powers respectively, Watt P L-AC , P L-DC variable AC and DC load powers respectively, Watt P rAC power transferred through DC/AC converter II, Watt P SC , P Bat , P Elect supercapacitors, batteries banks, and electrolyzer powers respectively, Watt P FC generated fuel cell power, Watt P AC , P g exchanged powers between the proposed system and the AC grid, before and after the local variable AC load, respectively, Watt P Net DC power exchanged in the DC-grid, Watt P st storage power, Watt Q AC , Q AC-ref reactive power exchanged between the proposed system and the AC grid with its reference respectively, Var Q s DFIG stator reactive power, Var Q L-AC local variable AC load reactive power, Var Q rAC , Q rAC-ref reactive power transferred through DC/AC converter II and its reference respectively, Var V Sc , V bat , V FC , V Elec supercapacitors, batteries banks, fuel cell, and electrolyzer voltages respectively, Volt V dc , V dc-ref direct voltage in the DC grid and its reference respectively, Volts I rα , I rβ and V rα , V rβ current and voltage components along α and β rotor axes respectively, A and Volts E electromotive force corresponding to the open circuit battery voltage, Volts C bat internal battery capacity, F R in internal battery resistance, Ω I bat , I Elect battery current and electrolyzer current respectively, A i 1 dt charge supplied and drawn by the battery, Ah E 0 , K, A unloaded battery voltage, polarization voltage, and exponential zone amplitude respectively, Volts Nernst voltage: the thermodynamic potential of the cell representing its reversible voltage, Volts V cell cell voltage in the stack, Volts U rev electrolyzer reversible cell voltage, Volts T electrolyzer cell temperature, • C R s , R r stator and rotor phase resistances respectively, Ω l s , l r , M stator and rotor leakage inductances with magnetizing inductance respectively, H V sd , V sq , V rd , V rq d-q stator and rotor voltages respectively, Volts I sd , I sq , I rd , I rq d-q stator and rotor currents respectively, A p being the pair pole number i cell , i 0 , i L operating, exchange current of the cell and the limiting current at which the fuel is used up at a rate equal to its maximum supply rate respectively, A R incell inherent resistance of the fuel cell, Ω A cell & B cell numerical constant coefficients of the fuel cell ∆G gibbs free enthalpy change, J/kmol R universal gas constant, Nm/(kmol K) F Faraday constant, F = 96,439 C/mol M i mole flow rate of species i (mol/s) ρ air density, kg/m 3 υ wind velocity, m/s λ, λ opt tip speed ratio and its optimal value Ω t , Ω, Ω ref turbine rotor speed, DFIG mechanical speed, and its reference respectively, tr/min Φ rα , Φ rβ & Φ r , Φ r_ref rotor flux components along α and β rotor axes and rotor flux and its reference, Wb φ L-AC , β local load phase shift and blade pitch angle respectively, • P wind aerodynamic power, Watt