Optimal Coordination of Active Generators in a Grid-Connected Microgrid Coordinación Óptima de Generadores Activos en una Microrred Interconectada

In a microgrid composed of distributed active generators based on renewable energy sources, with heterogeneous features and generation profiles, the availability of the energy resource, the energy reserve capacity, and the degradation of the storage unit, define the constraints for the management and dispatch of each active generator. This can result in sub-optimal use of distributed energy resources in comparison with the operation of a single generation unit. However, under the current trend oriented to distributed installations, the overall operation could be improved if an aggregated operation is considered within the management level. This paper proposes a coordinated operation of the storage units associated with distributed active generators for a hybrid grid-connected microgrid. In order to optimize the use of the active generators, including the equalization of the state of charge of the storage units, a mathematical model is proposed. This model tries to avoid uneven degradation of the storage units, and, consequently, enhance the reserve capacity and reduce the depth of discharge by achieving the operation of the distributed system as a unified system. The simulations are carried out in GAMS and MATLAB in order to validate the system’s operation. The results show a better performing grid-connected microgrid with the proposed approach.


Introduction
The use of Renewable Energy Sources (RESs) such as photovoltaic (PV) generators or Wind Turbines (WT) have allowed the diversification of the energy generation matrix and the substitution of conventional sources based on fossil fuels, which produce a high environmental impact (Keyhani 2016). In this sense, electrical microgrids appear as a solution to integrate Distributed Energy Resources (DERs) with heterogeneous characteristics to feed local electrical loads both in isolated and grid-connected modes (IEEE 2011, Attribution 4.0 International (CC BY 4.0) Share -Adapt Lasseter 2002, Guerrero, Vasquez, Matas, de Vicuna, andCastilla 2011). The main characteristic of microgrids is that they allow controlling all their components and distributed resources as a single and coordinated entity. Therefore, an Energy Management System (EMS) is required to optimize the use of local resources according to pre-established operating objectives (CEN-CENELEC-ETSI 2014, Katiraei, Iravani, Hatziargyriou, andDimeas 2008, Toro, Baron, andMojica-Nava 2019).
The high variability of RESs based on PV and WT, in addition to their dependence on environmental conditions, impose additional technical challenges in terms of reliability and availability of the energy resource. One of their main characteristics is that these types of sources, by themselves, are commonly used as non-dispatchable sources and, therefore, do not participate in the regulation and management of the microgrid (Rafique and Jianhua 2018), since they usually operate following a Maximum Power Point Tracking (MPPT) algorithm that seeks to obtain the maximum available energy (Thongam andOuhrouche 2011, de Brito, Galotto, Sampaio, e Melo, andCanesin 2013). Therefore, within the microgrid models renewable energy is usually considered as an uncontrollable input (Arcos-Aviles, Pascual, Guinjoan, Marroyo, Sanchis, and Marietta 2017).
In order to include a certain degree of flexibility in the EMS of the networks that incorporate RESs, a possible approach to deal with the surplus of energy is to manage the power exchange between the generation unit and an additional storage system (Blaabjerg, Yang Y., Yang D., and Wang 2017). This strategy constitutes the operation of active generators, which integrate variable energy resources with Energy Storage Systems (ESSs), power conditioning systems and a dedicated local control algorithm (Kanchev, Colas, Lazarov, and Francois 2014). In this way, active generators can deliver energy in a smoothed way in the short term, and balance the generation and demand for energy in the medium term. Thus, active generators based on highly variable RESs, such as PV and WT generators, can be used as dispatchable units as long as their storage systems are operated under a partial State of Charge (SoC) Imenes 2015, Hill, Such, Chen, Gonzalez, andGrady 2012).
In the scheduling process for the operation of energy devices in microgrids based on active generators, a set point of operation for each active generator is usually assigned from the EMS. In other words, the EMS considers distributed active generators as independent and dispatchable units (Choudar, Boukhetala, Barkat, and Brucker 2015). Therefore, in order to achieve the requirements assigned to the active generator, each ESS independently compensates the generated energy of its associated RES, by storing or delivering energy. The management of microgrids with active generators has already been addressed. For instance, in (Yan, Abbes, Francois, and Bevrani 2016) an optimization algorithm is developed by taking into account the restrictions of each one of the storage units. In , an algorithm is proposed for the management of active generators in a microgrid by means of state flow control. In Limouchi, Taher, and Ganji (2016), the dispatch of active and reactive power for microgrids with active generators is carried out. Although these works define restrictions related to the operation of ESSs, no strategies have been proposed in order to achieve an aggregated or collaborative operation between active generators intended to reduce the overall degradation of the storage units due to uneven cycles of operation and and different depths of discharge.
In Diaz, Luna, Vasquez, and Guerrero (2017), the coordination of the ESSs integrated into the active generators for an islanded microgrid is presented. In this work, the concept of SoC equalization for distributed ESSs is introduced with the aim to minimize the difference between their charging profiles by adjusting parameters on the primary controllers and the power-sharing process. As a result, the overall operation of distributed low-capacity ESSs was coordinated and their charge profiles were equalized, which in the end, achieved that the distributed energy storage units operate just as a single aggregate system with greater capacity would. This approach of managing distributed units as a single and aggregated one, adds to the electrical system the inherent advantages of a distributed system, such as redundancy, the easy expansion, and elimination of a single point of failure, without losing the simplicity offered in the management process when dealing with a single centralized storage unit. However, the work in Diaz, Luna, Vasquez, and Guerrero (2017), does not aim to optimize the operation of the microgrid and not include exchanges of energy with the utility grid.
In this work, a schedule is proposed for the charging and discharging profiles of the ESSs which are integrated into the active generators of a grid-connected microgrid, in order to equalize the SoC profiles in an optimal and coordinated way. In consequence, the main aim is to achieve the operation of the distributed ESSs as a single with a greater capacity. Firstly, a general optimization problem is defined considering the active generators and the power exchange with the main grid. After that, the model is improved by equalizing the SoCs for the distributed ESSs. As a result, the ESSs would work in an analogous way to which a centralized storage system based on batteries does, if possible. In the end, the proposed strategy manages to reduce the overall degradation of the distributed energy storage systems based on batteries.
This document is organized as follows: section II presents the general description of the microgrid considered for the case study; section III defines the energy management system of the microgrid and the mathematical model of the equalization for the SoCs of the ESSs; section IV, the validation of the proposed strategy is presented; and, finally, section V presents conclusions.

Microgrid Description
The microgrid established as a case study is connected to the conventional electrical network and is composed of active generators based on RES with banks of batteries based ESSs, as shown in Figure 1. The main grid defines the voltage and frequency of the microgrid, while the DERs operate as power sources (Katiraei, Iravani, Hatziargyriou, and Dimeas 2008). The primary controllers are not the object of this study, so interested readers can refer to other sources such as Farrokhabadi, König, Cañizares, Bhattacharya, and Leibfried (2018); Diaz, Vasquez, and Guerrero (2018); and Luna, Diaz, Graells, Vasquez, and Guerrero (2017  The microgrid includes an EMS to schedule the charging and discharging of the batteries based on the prediction of the available renewable energy and the energy demand of the load for a 24-hour time horizon. In this work, a reliable prediction for this time horizon is assumed (Negnevitsky, Johnson, and Santoso 2007). Therefore, the effects of uncertainty over the proposed strategy related to the generation/demand forecast are not considered. Interested readers may consult related literature such as Li, Vrakopoulou, and Mathieu (2018), and Gigoni et al. (2018).
For the development of the proposal presented in this document, the simplified mathematical models defined by Fathima and Palanisamy (2015), and Moradi, Esfahanian, Abtahi, and Zilouchian (2018) have have been used to determine the output power of RESs integrated into the active generators.
In the case of WT, the defined model sets the wind speed as input in a piece-wise function that can be written as where, ( ) is the WT power as a function of the wind speed ; = 1500 /( / ) 3 is a constant related to the geometrical characteristics of the rotor; = 10 / is the nominal wind speed; and = 24 / is the cut-off wind speed (Wais 2017).
For the PV model, the irradiance is defined as input. In this way, the power is established as a linear relation, so that where, ( ) is the output power of the PV in terms of the irradiance, ; = 200 / 2 is the minimum irradiance from which the solar cells start generating energy; = 1, 415 2 is the generation coefficient of the PV arrays; and = 1000 / 2 is established as the standard irradiance on the terrestrial surface, for which the rated PV power is defined.
On the other hand, the ESSs of the active generators considered in this paper are banks of lithium-ion (Li-ion) batteries, since this technology is displacing the traditional batteries of Lead-acid in stationary applications, due to its longer duration and better performance (Marra and Yang 2015). The batteries operate under a constant power load strategy, and their should be maintained between a 20% and 90% to avoid operation in unsafe regions (Linden and Reddy 2001, Diaz, Luna, Vasquez, and Guerrero 2017, Luna, Meng, Diaz, Graells, Vasquez, and Guerrero 2018, Marra and Yang 2015.

Energy Management System (EMS)
The implemented EMS seeks to schedule the use of the ESSs of the different active generators in such a way that the consumption of electrical energy absorbed from the main grid is minimized, and, at the same time, maximizes the use of the generated renewable energy within the microgrid. To this effect, the optimization problem poses a general model that allows the scalability of the number of active generators and the flexibility related to the characteristics of their DERs. It should be noted that the model focuses on the ESSs management and does not consider any demand response program.

Formulation of the Mathematical Model
The optimization model is defined for a time horizon of = 24 h. The discrete time is represented by the index ℎ = 1, 2, . . . , , in intervals of Δℎ = 1 hour. In this way, the number of time slots is = Δℎ . On the other hand, the index = 1, . . . , is used to define the active generators. The inputs of the model are the prediction of the RES generation, (ℎ) and the electric demand of the microgrid, (ℎ).
The variables defined in the model are the average values at each time interval and have been denoted with lowercase letters so that they can easily be recognized within the optimization problem.
The definition of a set of constraints is required to confine the solution to a feasible region. First, the microgrid must comply with the energetic balance (as shown in Figure. 1) which can be defined as, where (ℎ) is the power of the active generators, and (ℎ) and (ℎ) are the absorbed/injected power from/to the main grid.
In turn, the power provided by the active generators, (ℎ), corresponds to the sum of the power generated by the associated RES and ESS, so that, , ∀ℎ, (4) where ℎ (ℎ) and (ℎ) are the amount of power charged and discharged by the ESSs, respectively.
The SoC of the ESSs, (ℎ), can be estimated using the Ah-counting method as a function of the previous time and the energy stored/discharged at the current time, so that, = 0, 95 and ℎ = 0, 98 correspond to the discharging and charging efficiencies of the ESSs, respectively, and are their capacities in kWh.Ft In addition, all variables have been defined as positive and have been upper-bounded. This has been modeled as 0 ≤ (ℎ) ≤ ℎ * (1 − (ℎ)), ∀ℎ, (10) where (ℎ) is a binary variable to establish the status of charge of the ESSs. In Equation (6), the upper bound of (ℎ) is the nominal power of its associated RES, . The power exchange between the microgrid and the utility is limited to not exceed = 2 kW, which corresponds to physical and/or market constraints. Likewise, The boundaries of the charging and discharging powers for the ESSs defined in Equations (9) and (10)  Regarding the SoC of the ESSs, in the case of Liion technologies, even when they can be within the range [0%, 100%], the SoCs should not exceed the limits , = [20%, 90%] to avoid an accelerated degradation (Linden and Reddy 2001). This restriction has been considered as a soft constraint by including the variables (ℎ) and (ℎ). In this way, the boundaries of the SoCs can be written as, The deviations are bounded in such a way that, The decision variables are (ℎ), ℎ (ℎ), (ℎ), (ℎ), (ℎ), and (ℎ) , and have been included in the vector . In light of the above,, the objective function, ( ), is established as, where is the price of electricity per kWh; , is a penalty for injecting power into the main grid; and and correspond to the penalty coefficients related to the soft constraints to lower and upper boundaries of the SoC presented in Equations (11) and (12). Thus, the first term in Equation (16) is related to the cost of using energy from the main grid. The second term is a penalty for injecting energy into the main grid (de la Hoz et al. 2019), which manages to prioritize the local use of RES energy and, consequently, store the energy surplus in the ESSs, whenever possible. Meanwhile, the last two terms in Equation (16) are penalties for injecting energy into the main grid, which help the ESSs to work mainly with partial SoC, to avoid their early degradation.
To sum up, the optimization model defined for the management of the microgrid is composed of Equations (3)-(16).

SoC Equalization
In this section, the coordination of the ESSs is proposed in such a way that they behave as a single ESS (aggregate storage system), i.e., their SoCs are equalized so that the charging/discharging cycles are unified. This condition has been modeled through the error variable between the SoCs, (ℎ) defined as, The error of equalization should be minimized, so this condition has been included in the objective function: where^is the previously-defined decision vector plus the equalization errors of the ESSs, (ℎ). Also, = 0, 00001 DKK is the penalty coefficient related to those equalization errors. It has been adjusted by trial and error.

Validation
To evaluate the proposed strategies, GAMS v. 24.2.3 is used as an algebraic modeling language, selecting the BONMIN solver (GAMS 2013b, GAMS 2013a), while the input parameters and results are processed and analyzed by using Matlab R2018b (Mathworks 2016). The available power profiles of the renewable resources were obtained by means of the Equations (1) and (2), using wind speed and irradiance data from Aalborg, Denmark, which were acquired in (Aalborg University n.d.). Pseudo-code 1 summarizes the validation process.

2:
Load data of wind speed, solar irradiance, and Consumption;

3:
Obtain power generation profiles based on RES models;

4:
Load the parameters related to ESSs;

5:
Arrange the input data in a .gms file;

6:
Call GAMS using the input data. As a particular case, = 0, 1 , which is convenient to apreciate the efects of the proposed equalization scheme. Also, is set to , while = 1 and = 1.

Comparison of strategies in a 24-hour time horizon
The behavior of the system with the optimization strategy, described in section III.A. (optimization strategy from now on), and with the optimization plus equalization, presented in section III.B. (equalization scheme hereafter), is simulated for a specific day, so that the differences in operation of the proposed management systems can be observed. For this, the power profiles of the RES and the demand curve presented in Figure 2 and the parameters related to ESS included in Table 1 are established. In Figure 2 ( ) corresponds to the generation profile for the WT generator in the active generator 1 (AG1), ( 1 ) corresponds to generation profile for the PV generator in the active generator 2 (AG2), ( 2 ) corresponds to generation profile for the PV generator in the active generator 3 (AG3), and ( 2 ) corresponds to the load profile.  The scheduling of the active generators considering the selected generation scenario using the two optimization strategies is shown in Figure 3(a) and (b), while the expected SoCs are presented in Figure 3(c) and (d). In this case, it is not necessary to absorb energy from the main grid. When the ESS equalization is applied, the scheduling of the active generators shown in Figure 3(b) and the SoC behavior observed in Figure 3(d) are obtained. In this case, it is also not required to absorb energy from the main grid.
It is observed that, in the equalized case, the active generator with the highest stored energy tends to provide more energy to the microgrid when the do not equalize. When the equalization is achieved, the power scheduling is equal for the active generators with the same capacity (AG2 and AG3) while the unit with more capacity supplies more power. Therefore, the second strategy makes the ESS reaches lower DoDs, in this case, 50 %. Addionally, with the equalization, the shape of the SoCs is smoother with less micro-cycles.
In addition, the differences between the SoCs of the ESSs remain below 40% and decrease along T, reaching zero from the middle of the day (Figure 4). In general, with the second strategy, the maximum DoD of the ESS is reduced and the behavior of the SoC profiles is softer, which means less degradation. The equalization manages the SoCs of the ESSs of the active generators in the fulfillment of the schedule in order to improve their performance.

Histogram of the minimum SoCs of the ESSs
In order to have a more representative sample of generation scenarios that show the impact of the ESS equalization of the active generators on the optimization of a hybrid gridconnected microgrid, eight days were randomly taken and the minimum SoC reached by the ESSs were obtained following the two proposed optimization strategies. An initial SoC of 50% was defined so that the effect of this parameter on results was decoupled. In Figure 5, the histogram of the minimum SoC reached every selected day for the three ESSs following both strategies is presented. For the selected scenarios, the optimized strategy caused DoDs greater than 65% in most cases, (17 times of 24), whereas, with the equalized strategy, this condition was evident 12 times. Additionally, a full discharge ( = ) was reached 14 times with the optimized strategy, while this occurred only 7 times when the equalization was performed.
Since the lifetime of the batteries is inversely related to the DoD (Linden and Reddy 2001), it is evident that the equalized strategy manages better the overall operation of the ESS and avoids the uneven degradation caused by an uneven DoD.
It should be noted that the costs associated with the implementation of each strategy ( ) were recorded under the selected scenarios and were the same for both strategies in most cases, except one, where the cost with the optimized strategy was 1,3662 DKK and with the equalized one was 1,389 DKK. Therefore, it is concluded that the proposed equalization strategy has few effect on the cost of operation of the microgrid (1,64% in the worst case of the selected scenarios).

Conclusion
In this work, a novel energy management system is developed to minimize the exchange of energy between microgrids, based on active generators, and the electricity grid. In the proposal, optimal coordination of the ESSs of distributed active generators is carried out, so that they can work in an equalized manner, behaving as a unified storage unit, whenever possible, and avoiding uneven degradation. The mathematical formulation is defined in a generalized way that allows considering several active generators with different sizes and storage characteristics. From the results of the simulation, it can be seen that the scheduling of the active generators is better distributed by means of SoC equalization, since their use depends on the energy stored and the energy capacities of their ESS. Meanwhile, in a conventional optimization approach, the use of the active generators is made indistinctly regardless of their current capacities and energy reserves. Additionally, smoother SoCs profiles and lower DoDs values are obtained in the ESSs of the active generators through their optimal coordination, which in the end is reflected in less degradation of the batteries, without affecting the operating costs of the microgrid. As future work, a quantitative analysis of the degradation of batteries using this strategy could be performed while also considering the uncertainty of the forecasting of renewable energy sources and loads.