On Energy Management Control of a PV-Diesel-ESS Based Microgrid in a Stand-Alone Context

Ahmed Belila 1,2, Mohamed Benbouzid 2,3,* ID , El-Madjid Berkouk 4 and Yassine Amirat 5 ID 1 Laboratoire d’Electronique de Puissance, Ecole Militaire Polytechnique, Bordj El Bahri, Alger 16111, Algeria; belila.ahmed.emp@gmail.com 2 Institut de Recherche Dupuy de Lôme (UMR CNRS 6026 IRDL), University of Brest, 29238 Brest, France 3 Logistics Engineering College, Shanghai Maritime University, Shanghai 201306, China 4 Laboratoire de Commande de Processus, Ecole Nationale Polytechnique, Alger 16000, Algeria; emberkouk@yahoo.fr 5 Institut de Recherche Dupuy de Lôme (UMR CNRS 6026 IRDL), ISEN Yncréa Ouest Brest, 29200 Brest, France; Yassine.Amirat@isen-ouest.yncrea.fr * Correspondence: Mohamed.Benbouzid@univ-brest.fr; Tel.: +33-2-9801-8007


Introduction
Algeria has embarked on the renewable energies path to provide global and sustainable solutions to the environmental challenges and the problems of preserving fossil energy resources through the launch of an ambitious development program. The Algerian potential for renewable energy is strongly dominated by solar energy [1]. Algeria considers this energy source as an opportunity and a lever for economic and social development, particularly through the establishment of wealth and job-creating industries [2].
Hybrid power systems such as Photovoltaic Generator-Diesel Generator (PVG-DG) are among the most promising microgrids for the production of electric energy for remote areas in Algeria. In remote locations with access difficulties to the power grid, stand-alone DG are traditionally the often used systems for a wide range of applications [3], such as military applications and manufacturing facilities [4]. In a PVG-DG-based microgrid, the generated power is strongly dependent on weather conditions. This dependency will affect energy balance and may lead to supply disruptions. To deal with these issues, an energy storage system (ESS) is generally added to the microgrid. It is one of the best solution to ensure the reliability and power quality of the hybrid power systems (PVG-DG) and favors the increased penetration of the PVG [5][6][7][8]. Most applications of the PVG-DG-ESS-based • Compared to [18], [23], and [24], the proposed control strategy clearly shows the transition between the IMC and PMC operating modes. Furthermore in PMC conditions, the DG is controlled to operate at its nominal power.

•
In terms of control, an IMC strategy based on resonant regulator is proposed.

•
In terms of energy management, the EMC is tested first using a standard SOC profile emulating the microgrid different states. Then real data are used to simulate the load and solar radiations. Furthermore, the second case SOC profile is estimated using the system parameters and the extracted data.

•
The proposed ESS control strategy, IMC operating mode, and PMC one are experimentally validated.
This paper is organized as follows. Section 2 presents the system structure and modeling. Section 3 describes the energy management control and the supervisory algorithm. Section 4 illustrates the effectiveness of the proposed technique with simulation results and Section 5 illustrates experimental results. Figure 1 shows the structure of the parallel hybrid system. This configuration has superior performances compared with the series configuration [20]. It is based on the connection of the DG to the AC bus while the PVG is connected to the DC bus through a boost converter controlled by the common method in this field MPPT P&O strategy [9]. The bidirectional buck-boost converter is used to link the ESS to the DC bus. It regulates the DC bus voltage and ensures the ESS charging/discharging modes. Storage batteries are charged either by the PVG or the DG depending on the energy availability and the adopted operating strategy (IMC or PMC).

System Structure and Modeling
Energies 2018, 11, x FOR PEER REVIEW 3 of 22 Furthermore, the second case SOC profile is estimated using the system parameters and the extracted data.  The proposed ESS control strategy, IMC operating mode, and PMC one are experimentally validated.
This paper is organized as follows. Section 2 presents the system structure and modeling. Section 3 describes the energy management control and the supervisory algorithm. Section 4 illustrates the effectiveness of the proposed technique with simulation results and Section 5 illustrates experimental results. Figure 1 shows the structure of the parallel hybrid system. This configuration has superior performances compared with the series configuration [20]. It is based on the connection of the DG to the AC bus while the PVG is connected to the DC bus through a boost converter controlled by the common method in this field MPPT P&O strategy [9]. The bidirectional buck-boost converter is used to link the ESS to the DC bus. It regulates the DC bus voltage and ensures the ESS charging/discharging modes. Storage batteries are charged either by the PVG or the DG depending on the energy availability and the adopted operating strategy (IMC or PMC).

PVG Model
The photovoltaic cell is the main part of a PV system. A single-diode mathematic model can be used to simulate silicon photovoltaic cells (Figure 2a). A photovoltaic cell is a photosensitive device, which can be modeled by a current source generating the photo current (Iph), a diode, a seriesresistance taking into account the internal resistance (RS), and a parallel resistance (RP) representing the leakage current [15,27].
The equivalent circuit current and voltage are given by: with the thermal potential given by:

PVG Model
The photovoltaic cell is the main part of a PV system. A single-diode mathematic model can be used to simulate silicon photovoltaic cells (Figure 2a). A photovoltaic cell is a photosensitive device, which can be modeled by a current source generating the photo current (I ph ), a diode, a series-resistance taking into account the internal resistance (R S ), and a parallel resistance (R P ) representing the leakage current [15,27].
The equivalent circuit current and voltage are given by: with the thermal potential given by: where I ph is the photo current, I 0 is the diode saturation current, q is the Coulomb constant (1.602 × 10 −19 C), K is the Boltzmann constant (1.38 × 10 −23 J/K), and T is the cell temperature (K). For a PVG containing n s and n p panels in series and parallel respectively, the output current is given by: where:

DG Model
The DG developed torque can be expressed by (4). It depends of the fuel flow (ϕ) adjusted by the governor and the combustion process that introduce a delay time τ 1 [28,29].
The governor is an electromechanical device using a control signal C to adjust the fuel flow [13,28].
For the electric generator, the electromagnetic torque is given by: The mechanical equation can be written as:

Battery Model
For energy conversion, a simple modeling approach has been adopted for the ESS (battery). In this case, the battery equivalent circuit is illustrated by Figure 2b [26], where the battery voltage is given by: The battery state of charge (SOC) is given by [16,18]: where SOC(0) is the state of charge initial value, i(t) is the battery output DC current, R bat and C bat are the battery internal resistance and nominal capacity, respectively.

Energy Management Control and Supervisory Algorithm
Three types of converter can be distinguished in the structure of the studied microgrid structure ( Figure 1)

Energy Management Control and Supervisory Algorithm
Three types of converter can be distinguished in the structure of the studied microgrid structure ( Figure 1): (1) A boost converter that links the PVG to the DC bus. It allows extracting the PVG maximum power or limiting the power (LP mode). (2) A buck-boost converter that links the ESS to the DC bus. It allows regulating the DC bus voltage by controlling the ESS charge/discharge operations [30]. (3) A bidirectional inverter that interfaces the DC and the AC buses. It ensures the energy transfer between these two buses.
According to the power load and the SOC, the EMC activates the convenient mode. The PMC mode is activated in two cases: (1) when the SOC drops below a limit value SOC min and (2) when the ESS and the PVG fail to satisfy a peak load.

ESS Control Strategy
Given its current reversibility, the buck-boost converter allows the ESS charging/discharging operation [31,32]. The converter model associated to batteries is shown by Figure 3a [15]. The relationships between the converter inputs (V bat , I bat ) and output (U dc , I bat ) are given by the control schemes described in Figure 3b.
The DC bus voltage can be expressed by: The energy transfer between the DC bus and the ESS is controlled by acting on the battery current references [26]. These references are imposed by the voltage control loop of the DC bus ( Figure 3c). As shown in Figure 3c

Energy Management Control and Supervisory Algorithm
Three types of converter can be distinguished in the structure of the studied microgrid structure ( Figure 1): (1) A boost converter that links the PVG to the DC bus. It allows extracting the PVG maximum power or limiting the power (LP mode). (2) A buck-boost converter that links the ESS to the DC bus. It allows regulating the DC bus voltage by controlling the ESS charge/discharge operations [30]. (3) A bidirectional inverter that interfaces the DC and the AC buses. It ensures the energy transfer between these two buses.
According to the power load and the SOC, the EMC activates the convenient mode. The PMC mode is activated in two cases: (1) when the SOC drops below a limit value SOCmin and (2) when the ESS and the PVG fail to satisfy a peak load.

ESS Control Strategy
Given its current reversibility, the buck-boost converter allows the ESS charging/discharging operation [31,32]. The converter model associated to batteries is shown by Figure 3a [15]. The relationships between the converter inputs (Vbat, Ibat) and output (Udc, Ibat) are given by the control schemes described in Figure 3b.
The DC bus voltage can be expressed by: The energy transfer between the DC bus and the ESS is controlled by acting on the battery current references [26]. These references are imposed by the voltage control loop of the DC bus ( Figure 3c). As shown in Figure 3c

Isolated Mode Control (IMC)
The objective of the IMC mode is to control the inverter so that the LC filter/inverter operates as a voltage source to ensure a constant voltage across the load in terms of amplitude and frequency. The voltage across the filter capacitor must be regulated. Since the reference signal has AC components (contains non-zero frequencies), the resonant controller is preferred compared to the PI one. It particularly allows achieving good regulation and tracking performances [33,34]. Figure 4 illustrates the control principle in an isolated mode. The resonant controller (C1, C2) associated with the two voltage control loops has the following form [33,35].
where p (rad/s) is the pulsation of the voltage to regulate and c0, c1, c2, c3, d0, and d1 are the controller's settings. The closed-loop control transfer function F(s) can thus be simplified as follows: where The controller coefficients, c0, c1, c2, c3, d0, and d1, may also be computed by interpreting the closed-loop characteristic polynomial p(s) as a third-order Naslin polynomial [29].

Isolated Mode Control (IMC)
The objective of the IMC mode is to control the inverter so that the LC filter/inverter operates as a voltage source to ensure a constant voltage across the load in terms of amplitude and frequency. The voltage across the filter capacitor must be regulated. Since the reference signal has AC components (contains non-zero frequencies), the resonant controller is preferred compared to the PI one. It particularly allows achieving good regulation and tracking performances [33,34]. Figure 4 illustrates the control principle in an isolated mode. The resonant controller (C 1 , C 2 ) associated with the two voltage control loops has the following form [33,35].
where ω p (rad/s) is the pulsation of the voltage to regulate and c 0 , c 1 , c 2 , c 3 , d 0 , and d 1 are the controller's settings. The closed-loop control transfer function F(s) can thus be simplified as follows: where The controller coefficients, c 0 , c 1 , c 2 , c 3 , d 0 , and d 1 , may also be computed by interpreting the closed-loop characteristic polynomial ∆p(s) as a third-order Naslin polynomial [29].
∆P(s) = s + p + jω p s + p − jω p (s + p)(s + p + jω n )(s + p − jω n ) (16) where p is the real part and ω n (rad/s) is the imaginary part of the complex root of the filter function. The identification process leads to:

Parallel Mode Control (PMC)
In this case, the PVG and ESS are connected to the AC bus through a DC/AC converter associated to an LC filter ( Figure 1). The schematic diagram of the LC low-pass filter could be found in [27]. Thus, the DG and inverter can operate in parallel with synchronized output voltages. To ensure the synchronization process a phase locked loop (PLL) is used to estimate the angular frequency at AC he bus; however, the inaccessibility at the rotor of the DG, imposes a master operation mode of the DG ( Figure 4). In this PLL, the phase angle θ is detected by synchronizing the PLL rotating reference frame and the DG output voltage vector [27]. where p is the real part and n (rad/s) is the imaginary part of the complex root of the filter function. The identification process leads to:

Parallel Mode Control (PMC)
In this case, the PVG and ESS are connected to the AC bus through a DC/AC converter associated to an LC filter ( Figure 1). The schematic diagram of the LC low-pass filter could be found in [27]. Thus, the DG and inverter can operate in parallel with synchronized output voltages. To ensure the synchronization process a phase locked loop (PLL) is used to estimate the angular frequency at AC he bus; however, the inaccessibility at the rotor of the DG, imposes a master operation mode of the DG ( Figure 4). In this PLL, the phase angle θ is detected by synchronizing the PLL rotating reference frame and the DG output voltage vector [27].
The synchronization scheme ensures that the d-axis to be aligned with the DG voltage vector. In this case, Vsq = 0, then P and Q become proportional to id and iq, respectively [27,34].
The output voltages of the inverter in the synchronous dq frame are given by: The synchronization scheme ensures that the d-axis to be aligned with the DG voltage vector. In this case, V sq = 0, then P and Q become proportional to i d and i q , respectively [27,34].
Energies 2018, 11, 2164 8 of 23 The output voltages of the inverter in the synchronous dq frame are given by: (20) The inner control loop contains two PI current controllers to regulate the current supplied by the converter to match its reference value. The reference values of currents i d * and i q * can be derived from the imposed reference power's P* and Q*. These reference current values are compared with the measured currents i d and i q flowing through the inductor filter. The output of the current controllers is utilized to reconstruct the reference voltages of the SVM switching strategy, which determine the switching time of the insulated gate bipolar transistor (IGBT) switches. In this way, a nominal output power DG can be imposed via the reference active power.
It should be noted that the SVM is the more frequently used switching strategy in terms of use of the DC bus voltage and the THD of the generated AC voltages. It depends only on the phase angle and instantaneous value of the input voltage [36].

Supervisory Algorithm
The proposed energy management algorithm handling the different operation modes of the PVG-DG-ESS-based microgrid is depicted by the flowchart of Figure 5a. The proposed algorithm main objective is load demand satisfaction, while optimizing the DG, PVG, and ESS operations. The modular structure of this algorithm makes it capable of operating autonomously whatever the load demand.
The inner control loop contains two PI current controllers to regulate the current supplied by the converter to match its reference value. The reference values of currents id* and iq* can be derived from the imposed reference power's P* and Q*. These reference current values are compared with the measured currents id and iq flowing through the inductor filter. The output of the current controllers is utilized to reconstruct the reference voltages of the SVM switching strategy, which determine the switching time of the insulated gate bipolar transistor (IGBT) switches. In this way, a nominal output power DG can be imposed via the reference active power.
It should be noted that the SVM is the more frequently used switching strategy in terms of use of the DC bus voltage and the THD of the generated AC voltages. It depends only on the phase angle and instantaneous value of the input voltage [36].

Supervisory Algorithm
The proposed energy management algorithm handling the different operation modes of the PVG-DG-ESS-based microgrid is depicted by the flowchart of Figure 5a. The proposed algorithm main objective is load demand satisfaction, while optimizing the DG, PVG, and ESS operations. The modular structure of this algorithm makes it capable of operating autonomously whatever the load demand.

ESS Supervision
To avoid overloading, the maximum value of the SOC is set to SOCmax = 90%. Beyond this value, the supervisory algorithm must limit the PVG power if the system is in the IMC mode or disconnect the DG if the system is in the PMC mode. To avoid deep discharging, the minimum value of the SOC is set to SOCmin = 25%. Below this value the DG will be solicited and the system is in the PMC mode.
The proposed algorithm only requires an initially charged ESS charged. Then, it ensures service continuity even in critical situations. When the ESS is not used for a long period, this will be considered as a disconnection mode (not frequent situation). The ESS needs therefore to be charged to its SOCmax to be used as an initial SOC for the next system starting.

DG Supervision
To optimize the DG lifetime and the fuel consumption, it is recommended to operate at the nominal power and limit the number of On/Off cycles. For that purpose, the implemented supervisory algorithm considers the above-mentioned criteria according to the following guidelines:  The DG start-up must be load-out and delayed with about 3 to 5 seconds after it starts to avoid operation during its transient.  When solicited, the DG runs at its nominal point in all possible operating scenarios regardless load changes.  The DG will stop only if the SOC reaches its maximum.

PVG Supervision
The PVG can operate either in MPPT or limited power (LP) modes. The LP mode, whose principle is illustrated by Figure 5b, is activated by the supervisory algorithm only in the IMC mode, when the load is satisfied and the ESS is fully charged.

Load Supervision
To prevent deep discharging (SOC < SOCmin), a priority is assigned to each load according to its importance. Switching between loads is done by the supervisory algorithm according to the discharge degree.
The system is therefore protected in this case against one of the following critical situations, which require a shutdown of the system:  When the DG does not start.

ESS Supervision
To avoid overloading, the maximum value of the SOC is set to SOC max = 90%. Beyond this value, the supervisory algorithm must limit the PVG power if the system is in the IMC mode or disconnect the DG if the system is in the PMC mode. To avoid deep discharging, the minimum value of the SOC is set to SOC min = 25%. Below this value the DG will be solicited and the system is in the PMC mode.
The proposed algorithm only requires an initially charged ESS charged. Then, it ensures service continuity even in critical situations. When the ESS is not used for a long period, this will be considered as a disconnection mode (not frequent situation). The ESS needs therefore to be charged to its SOC max to be used as an initial SOC for the next system starting.

DG Supervision
To optimize the DG lifetime and the fuel consumption, it is recommended to operate at the nominal power and limit the number of On/Off cycles. For that purpose, the implemented supervisory algorithm considers the above-mentioned criteria according to the following guidelines:

•
The DG start-up must be load-out and delayed with about 3 to 5 seconds after it starts to avoid operation during its transient.

•
When solicited, the DG runs at its nominal point in all possible operating scenarios regardless load changes.

•
The DG will stop only if the SOC reaches its maximum.

PVG Supervision
The PVG can operate either in MPPT or limited power (LP) modes. The LP mode, whose principle is illustrated by Figure 5b, is activated by the supervisory algorithm only in the IMC mode, when the load is satisfied and the ESS is fully charged.

Load Supervision
To prevent deep discharging (SOC < SOC min ), a priority is assigned to each load according to its importance. Switching between loads is done by the supervisory algorithm according to the discharge degree.
The system is therefore protected in this case against one of the following critical situations, which require a shutdown of the system:

•
When the DG does not start.
• When there is a malfunction in the DC/AC converter. Therefore, the energy surplus produced by the DG is not transferred to the ESS and the SOC continues to decrease.

•
When there is a malfunction in the DC/DC buck/boost converter related to the ESS.

Simulation Results
In this section, the effectiveness of the proposed control strategies and the supervisory algorithm is examined by simulating the PVG-DG-ESS-based microgrid whose parameters are given in Table 1. It should be mentioned that the system components sizing was the one using the HOMER software. In terms of supervision, both IMC and PMC control strategies are complementary during one operating cycle. Each strategy is activated by the EMC (Energy Management Control), which is based on the proposed supervisory algorithm (Figure 1) that defines the microgrid different operating scenarios according to the information transmitted by the ESS control strategy. Simulations were carried out for two cases (Figure 6). The first one corresponds to an emulated SOC that shows the performance of the EMC in different operation modes including critical ones. The second case corresponds to an estimated SOC that shows the performance of the proposed EMC for a real load profile that corresponding to the energy consumption of three "Saharan cabins" installed in the southern region of Algeria, taking into account the region illumination profile (Adrar region). The energy requirements of each cabin are summarized in Appendix A.

Emulated SOC
In order to impose all the supervisory algorithm operating modes given in Figure 5a, the SOC has been emulated ( Figure 6a) and a load profile has been imposed in a manner to change the operating mode (IMC to PMC) and show the behavior of the ESS during both charging and discharging phases. The achieved simulation results are given by Figures 7a, 8a, 9a, 10a, and 11a.

Emulated SOC
In order to impose all the supervisory algorithm operating modes given in Figure 5a, the SOC has been emulated ( Figure 6a) and a load profile has been imposed in a manner to change the operating mode (IMC to PMC) and show the behavior of the ESS during both charging and discharging phases. The achieved simulation results are given by Figures 7a, 8a, 9a, 10a and 11a. In order to impose all the supervisory algorithm operating modes given in Figure 5a, the SOC has been emulated ( Figure 6a) and a load profile has been imposed in a manner to change the operating mode (IMC to PMC) and show the behavior of the ESS during both charging and discharging phases. The achieved simulation results are given by Figures 7a, 8a, 9a, 10a, and 11a.    The PVG operates in the MPPT mode as shown by Figure 9a and the ESS is in a discharge state (Figure 8a). The system is then in IMC operating mode.  From 0.8 to 1.2 s, the SOC riches its lower limit value SOCmin. The DG is solicited with a nominal operating regime, assumed equal to 8kW (Figure 10a), to supply the load power and charge the ESS. The system is then in the PMC operating mode until the SOC riches the limit value SOCmax.  From 1.2 to 1.6 s, the SOC riches its upper limit value SOCmax. The IMC operating mode is then reactivated.  From 1.6 to 1.8 s the SOC riches its lower limit value SOCmin. The PMC operating mode is then reactivated.  From 1.8 to 2 s, the SOC is less than 20%. The supervisory algorithm disconnects then the load with the lowest priority (P3) and the system is in a low state of charge (LSOC) operating mode.    • From 0 to 0.2 s, the batteries are charged (SOC > SOC max ) and the PVG power produced exceeds the load requirement. The LP mode is then activated. • From 0.2 to 0.8 s, SOC min < SOC < SOC max . Both PVG and ESS provide the load required power. The PVG operates in the MPPT mode as shown by Figure 9a and the ESS is in a discharge state (Figure 8a). The system is then in IMC operating mode. • From 0.8 to 1.2 s, the SOC riches its lower limit value SOC min . The DG is solicited with a nominal operating regime, assumed equal to 8kW (Figure 10a), to supply the load power and charge the ESS. The system is then in the PMC operating mode until the SOC riches the limit value SOC max . • From 1.2 to 1.6 s, the SOC riches its upper limit value SOC max . The IMC operating mode is then reactivated.
• From 1.6 to 1.8 s the SOC riches its lower limit value SOC min . The PMC operating mode is then reactivated. • From 1.8 to 2 s, the SOC is less than 20%. The supervisory algorithm disconnects then the load with the lowest priority (P3) and the system is in a low state of charge (LSOC) operating mode. • From 2 to 2.2 s, the ESS continues its discharging (10% < SOC < 15%) and the P2 load is then disconnected. P1 is the load that is still connected to the system that is in a very low state of charge (VLSOC) operating mode. • At 2.2 s, the SOC drops below 10%. All the loads are disconnected and the system is in the disconnection (DISC) mode.
It is worth noting that the simulated operation modes (LSOC, VLSOC, and DISC), between 1.8 and 2.3 s, are among the most critical ones as shown in Figure 5a flowchart. They have been scheduled to protect the system against components malfunction.

Estimated SOC
In order to simulate the developed control strategies, as well as the proposed supervisory algorithm with a real microgrid, we have assumed the following:

•
One second of simulation corresponds to one hour of operation. For a simulation step of 5 µs, this allows assuming a constant ESS current during 0.018 s.

•
The SOC is now estimated (Figure 6b) and the microgrid is simulated for 3 days (72 s of simulation).

•
The system has been simulated using the MATLAB-Simulink environment for a daily radiation profile of the Adrar region and the load profile of three Saharan cabins, as previously mentioned.
The achieved simulation results are given by Figures 7b, 8b, 9b, 10b and 11b. Here, it can be noticed that: • From 0 to 40 h, 25% < SOC < 90%. Both PVG and ESS provide the load required power. The system is then in the IMC operating mode with 40 hours of autonomy. • From 40 to 48 h, the SOC riches its lower limit value SOC min . The DG is solicited with a nominal operating regime to supply the load power and charge the ESS. The system is then in the PMC operating mode until the SOC riches the limit value SOC max . • From 48 to 72 h, the ESS is charged (SOC = 90%). The DG is disconnected, the IMC operating mode is reactivated and the system operating cycle is therefore 2 days.
For the fuel consumption analysis, the DG consumed fuel is load dependent. The DG manufacturer fuel consumption curve can be obtained from data sheet and mathematically approximated by [15].
where P inp (kW) is the DG input power. It can be calculated as [15]: For DG nominal power operation and for the same load profile, Table 2 provides a comparative evaluation of fuel consumption and cost of the studied PVG-FG-ESS-based microgrid and a DG-based system for a 48h operating cycle. The achieved results clearly show the benefits of the proposed EMC that considerably reduces the DG operating time leading to substantial savings in terms of cost, maintenance, and above all fuel supply, which is a critical issue for isolated or islanded site [37,38]. In the same context, and for the ESS wear cost analysis-the ESS wear cost depends on the number and amplitude of charging/discharging cycles undergone by the storage system (i.e., batteries). If it is assumed that the number of cycles is constant, regardless of their amplitude, then the cycle cost is given by the ratio of the batteries total price over the number of cycles [39].
While observing Figure 8b, the ESS number of charging/discharging cycles can be estimated at 8.4 cycles per 8 hours in the IMC operating mode and at 3 cycles in the PMC operating mode. Then, the wear cost gain can be deduced for a PVG-DG-ESS microgrid with the proposed EMC compared to the classical PVG-ESS microgrid, as shown by Table 3 results. The achieved results clearly show that the proposed EMC (with DG nominal operation) allows reducing the ESS wear cost by about 10.71% per operating cycle (OC = 48 hours), leading therefore to substantial savings in terms of ESS maintenance and system cost.

Stability Analysis
Since the proposed EMC strategy is based on two complementary controls, namely IMC and PMC, the stability analysis of the system mainly concerns the evolution of its frequency during transition periods from an operation mode to another one. Figure 12 clearly shows the performance of the proposed strategy in terms of frequency regulation. Indeed, the frequency fluctuation is of the order of 0.005 Hz in the IMC operation mode and does not exceed 0.025 Hz in the PMC operation mode. (i.e., batteries). If it is assumed that the number of cycles is constant, regardless of their amplitude, then the cycle cost is given by the ratio of the batteries total price over the number of cycles [39]. While observing Figure 8b, the ESS number of charging/discharging cycles can be estimated at 8.4 cycles per 8 hours in the IMC operating mode and at 3 cycles in the PMC operating mode. Then, the wear cost gain can be deduced for a PVG-DG-ESS microgrid with the proposed EMC compared to the classical PVG-ESS microgrid, as shown by Table 3 results. The achieved results clearly show that the proposed EMC (with DG nominal operation) allows reducing the ESS wear cost by about 10.71% per operating cycle (OC = 48 hours), leading therefore to substantial savings in terms of ESS maintenance and system cost. Table 3. ESS wear cost.

. Stability Analysis
Since the proposed EMC strategy is based on two complementary controls, namely IMC and PMC, the stability analysis of the system mainly concerns the evolution of its frequency during transition periods from an operation mode to another one. Figure 12 clearly shows the performance of the proposed strategy in terms of frequency regulation. Indeed, the frequency fluctuation is of the order of 0.005 Hz in the IMC operation mode and does not exceed 0.025 Hz in the PMC operation mode. It should be mentioned that in the PMC operation mode, as described in Subsection 3.3, the inaccessibility of the DG rotor imposes a master operation mode of the DG, which means that in this case, the stability issue is influenced by the dynamics of generator rotor angles and power angle relationships. This justifies the performance degradation in terms of frequency regulation in the PMC mode compared to the IMC one. It should be mentioned that in the PMC operation mode, as described in Section 3.3, the inaccessibility of the DG rotor imposes a master operation mode of the DG, which means that in this case, the stability issue is influenced by the dynamics of generator rotor angles and power angle relationships. This justifies the performance degradation in terms of frequency regulation in the PMC mode compared to the IMC one.

Experimental Validations
Experiments are carried out, on a reduced scale test bench, to show the practical feasibility of the developed control strategies, namely the ESS control, the IMC, and the PMC. Figure 13 shows the used experimental test bench. Its main components and parameters are listed in Table 4.
Real-time experiments are carried out using the acquisition board PCI6052E, with several input/output. The control blocks are built in MATLAB-Simulink. The used experimental validation parameters are given in Table 4.

ESS Control Validation
In this case, a variable resistive load is used. The buck-boost converter is controlled to ensure a constant voltage across the capacitor of DC bus regardless of the load variations. Figure 14a shows the PVG, the load, and the battery currents. It can be noticed that when the load current is higher than the PVG one, the ESS is therefore in the discharging state (Ibatt > 0). When the load current increases, the ESS moves to the charging state (Ibatt < 0). Figure 14b shows the DC bus voltage and the load current. It can be noticed that the variation of the load current (increase or decrease) does not affect the DC bus voltage regulated at 48V, therefore proving the performance of the implemented control.

ESS Control Validation
In this case, a variable resistive load is used. The buck-boost converter is controlled to ensure a constant voltage across the capacitor of DC bus regardless of the load variations. Figure 14a shows the PVG, the load, and the battery currents. It can be noticed that when the load current is higher than the PVG one, the ESS is therefore in the discharging state (I batt > 0). When the load current increases, the ESS moves to the charging state (I batt < 0). Figure 14b shows the DC bus voltage and the load current. It can be noticed that the variation of the load current (increase or decrease) does not affect the DC bus voltage regulated at 48V, therefore proving the performance of the implemented control.
constant voltage across the capacitor of DC bus regardless of the load variations. Figure 14a shows the PVG, the load, and the battery currents. It can be noticed that when the load current is higher than the PVG one, the ESS is therefore in the discharging state (Ibatt > 0). When the load current increases, the ESS moves to the charging state (Ibatt < 0). Figure 14b shows the DC bus voltage and the load current. It can be noticed that the variation of the load current (increase or decrease) does not affect the DC bus voltage regulated at 48V, therefore proving the performance of the implemented control.

IMC Validation
The control algorithm illustrated by Figure 4, has been implemented after acquisition of the voltages U c1 and U c2 through PCI6052E analog inputs. The implemented resonant regulators calculated parameter values are given in the Table 5. Figure 15a shows the AC bus line voltages and the current waveforms in phase a. It is observed that the waveforms are well filtered, therefore validating the chosen LC filter parameters. Figure 15b shows that phase a voltage is well regulated at its reference value 20 V and it is not affected by the load variations, thus proving the adequate calculation of the regulator parameters and the control robustness against load variations.

IMC Validation
The control algorithm illustrated by Figure 4, has been implemented after acquisition of the voltages Uc1 and Uc2 through PCI6052E analog inputs. The implemented resonant regulators calculated parameter values are given in the Table 5. Figure 15a shows the AC bus line voltages and the current waveforms in phase a. It is observed that the waveforms are well filtered, therefore validating the chosen LC filter parameters. Figure 15b shows that phase a voltage is well regulated at its reference value 20 V and it is not affected by the load variations, thus proving the adequate calculation of the regulator parameters and the control robustness against load variations.

PMC Validation
To validate the control strategy in the PMC operating mode and due to DG unavailability, the distribution grid is used for emulation purposes. For safety considerations, the conventional 380V three-phase AC distribution system is decrease to a 20 V one using a step-down transformer.
The PMC requires validation in both current flow directions, since in this mode we have to impose a DG nominal power.

PMC Validation
To validate the control strategy in the PMC operating mode and due to DG unavailability, the distribution grid is used for emulation purposes. For safety considerations, the conventional 380 V three-phase AC distribution system is decrease to a 20 V one using a step-down transformer.
The PMC requires validation in both current flow directions, since in this mode we have to impose a DG nominal power.
In terms of experiments, this means that the PMC operating mode should be validate for both positive and negative reference active power. It should me mentioned that a positive current corresponds to an ESS charging cycle.
The PMC mode control scheme, illustrated by Figure 4, is implemented by synchronizing the grid with the inverter. A battery of 12 V and 100 Ah is used as an ESS, whose characteristics are given in Table 5.
The energy transfer between the battery and the distribution grid (emulating the DG), for a fixed load power, has been realized for the following reference powers: • P* > 0: P = 20 W and P = 30 W (Figure 16a,b). • P* < 0: P = −10 W and P = −20 W (Figure 17a,b). It should be noted here that the reference reactive power is considered to be zero, since in the studied system the DG can ensure a reactive energy transfer up to cosφ = 0.8.
The obtained experimental results for the reference active powers 20W and 30W, respectively, are given in Figures 18 and 19, with Q* = 0 and PLoad = 16 W. In both cases: grid load filter Figure 19a,b confirms this result. In fact, the batteries are in charging states in both cases, with the difference that Ibatt is remarkably greater in the second case corresponding to P* = 30 W. In the studied hybrid microgrid, this experimental case is similar to the simulated one when the DG is solicited to supply the load and charge the ESS in the PMC operating mode. It should be noted here that the reference reactive power is considered to be zero, since in the studied system the DG can ensure a reactive energy transfer up to cosφ = 0.8.
The obtained experimental results for the reference active powers 20W and 30W, respectively, are given in Figures 18 and 19, with Q* = 0 and PLoad = 16 W. In both cases: grid load filter Figure 19a,b confirms this result. In fact, the batteries are in charging states in both cases, with the difference that Ibatt is remarkably greater in the second case corresponding to P* = 30 W. In the studied hybrid microgrid, this experimental case is similar to the simulated one when the DG is solicited to supply the load and charge the ESS in the PMC operating mode. It should be noted here that the reference reactive power is considered to be zero, since in the studied system the DG can ensure a reactive energy transfer up to cosϕ = 0.8. The obtained experimental results for the reference active powers 20W and 30W, respectively, are given in Figures 18 and 19, with Q* = 0 and P Load = 16 W. In both cases: Figure 19a,b confirms this result. In fact, the batteries are in charging states in both cases, with the difference that I batt is remarkably greater in the second case corresponding to P* = 30 W. In the studied hybrid microgrid, this experimental case is similar to the simulated one when the DG is solicited to supply the load and charge the ESS in the PMC operating mode. It should be noted here that the reference reactive power is considered to be zero, since in the studied system the DG can ensure a reactive energy transfer up to cosφ = 0.8.
The obtained experimental results for the reference active powers 20W and 30W, respectively, are given in Figures 18 and 19, with Q* = 0 and PLoad = 16 W. In both cases: grid load filter Figure 19a,b confirms this result. In fact, the batteries are in charging states in both cases, with the difference that Ibatt is remarkably greater in the second case corresponding to P* = 30 W. In the studied hybrid microgrid, this experimental case is similar to the simulated one when the DG is solicited to supply the load and charge the ESS in the PMC operating mode.   . (25) This case is equivalent to the simulated hybrid microgrid when the DG, PVG, and ESS operate in PMC to supply a peak load.
For P* = −20 W, Ifilter is in phase with Igrid and in phase opposition with Iload. Then: filter grid load which corresponds to an active power injection (Pinj = 20 − 16 = 4 W) to the grid. This case is not one of the above-presented simulation scenarios of the studied hybrid microgrid. It has been, however, presented to assess the PMC strategy performances. Figure 20 confirms this result. In fact, the batteries are in a discharging state with a remarkably greater discharging current in the second case where P* = −20 W. Experimental results obtained for negative reference active powers −10 W and −20 W, respectively, are given in Figures 19-21.
For P* = −10 W, I filter is in phase opposition with I grid and I load . Then: This case is equivalent to the simulated hybrid microgrid when the DG, PVG, and ESS operate in PMC to supply a peak load.
For P* = −20 W, I filter is in phase with I grid and in phase opposition with I load . Then: which corresponds to an active power injection (P inj = 20 − 16 = 4 W) to the grid. This case is not one of the above-presented simulation scenarios of the studied hybrid microgrid. It has been, however, presented to assess the PMC strategy performances. Figure 20 confirms this result. In fact, the batteries are in a discharging state with a remarkably greater discharging current in the second case where P* = −20 W. load grid filter This case is equivalent to the simulated hybrid microgrid when the DG, PVG, and ESS operate in PMC to supply a peak load.
For P* = −20 W, Ifilter is in phase with Igrid and in phase opposition with Iload. Then: filter grid load I I I  (26) which corresponds to an active power injection (Pinj = 20 − 16 = 4 W) to the grid. This case is not one of the above-presented simulation scenarios of the studied hybrid microgrid. It has been, however, presented to assess the PMC strategy performances. Figure 20 confirms this result. In fact, the batteries are in a discharging state with a remarkably greater discharging current in the second case where P* = −20 W.

Conclusions
This paper dealt with the energy management control of a PV-Diesel-ESS-based microgrid in a stand-alone context. In terms of control, an isolated mode control strategy based on a resonant regulator has been proposed. In parallel mode control conditions, the diesel generator was controlled to operate at its nominal power. In this context, a supervisory algorithm optimizing the power flow between the microgrid various components ensured switching between the two modes for different possible scenarios.
The effectiveness of the proposed control strategies has been proved first by simulations where the energy management control has been successfully tested using a standard SOC profile emulating the microgrid different states and then real data to simulate the load and solar radiations. Regarding the energy storage system, it has been clearly shown that the proposed energy management control strategy, with DG nominal operation, have allowed reducing the wear cost, leading therefore to substantial savings in terms of ESS maintenance and system cost. In terms of stability, it has been shown that the frequency fluctuation, during transition periods from an operation mode to another one, is of the order of 0.005 Hz in the IMC operation mode and does not exceed 0.025 Hz in the PMC operation mode.
Experiments, on a reduced scale test bench, have been carried out. The achieved results clearly validate the proposed energy management control strategies along with the supervisory algorithm.
Author Contributions: A.B. designed the system architecture and performed the simulations and the

Conclusions
This paper dealt with the energy management control of a PV-Diesel-ESS-based microgrid in a stand-alone context. In terms of control, an isolated mode control strategy based on a resonant regulator has been proposed. In parallel mode control conditions, the diesel generator was controlled to operate at its nominal power. In this context, a supervisory algorithm optimizing the power flow between the microgrid various components ensured switching between the two modes for different possible scenarios.
The effectiveness of the proposed control strategies has been proved first by simulations where the energy management control has been successfully tested using a standard SOC profile emulating the microgrid different states and then real data to simulate the load and solar radiations. Regarding the energy storage system, it has been clearly shown that the proposed energy management control strategy, with DG nominal operation, have allowed reducing the wear cost, leading therefore to substantial savings in terms of ESS maintenance and system cost. In terms of stability, it has been shown that the frequency fluctuation, during transition periods from an operation mode to another one, is of the order of 0.005 Hz in the IMC operation mode and does not exceed 0.025 Hz in the PMC operation mode.
Experiments, on a reduced scale test bench, have been carried out. The achieved results clearly validate the proposed energy management control strategies along with the supervisory algorithm.