A Novel and Optimal Battery Sizing Procedure Based on MG Frequency Security Criterion Using Coordinated Application of BESS, LED Lighting Loads, and Photovoltaic Systems

This paper proposes a novel and optimal battery sizing procedure for the primary frequency control (PFC) of islanded microgrid (MG). The Battery Energy Storage System (BESS), Photovoltaic (PV) systems and LED Lighting Loads (LEDLLs) are coordinated to quickly intercept frequency deviation in the stage of PFC. The PVs decrease their power generation in the case of surplus of power generation. The LEDLLs decrease their power consumption in the case of power shortage. The BESS participates in PFC in both cases by injecting/absorbing power. Some batteries with overloading characteristics are capable of fast discharge/charge for a short period, which can be used to reduce the required battery size for PFC application. The conventional overloading characteristics is based on constant power discharge/charge, but the BESS power varies in response to frequency deviation. To overcome this problem, a modified overloading characteristic is presented based on variable power discharge/charge, which is used to propose a battery sizing algorithm. The Genetic Algorithm is used to optimally determine the frequency controllers’ coefficients of the BESS, PVs and LEDLLs to minimize the required battery size while maintaining the MG frequency within safe operational limits. The proposed battery sizing procedure is evaluated on the CIGRE low voltage benchmark system using simulation in MATLAB/Simulink software. The results show that beside the overloading characteristics of the battery, the participation of PVs and LEDLLs in PFC also reduces the required battery size, because their participation reduces the share of BESS participation in PFC.


I. INTRODUCTION
A micro-grid (MG) is a small low voltage distribution system, which consists of several micro-sources (MSs), loads, energy storage systems (ESSs). It can operate either in islanded mode or in grid-connected mode [1], [2]. In the grid-connected mode, the MG frequency is controlled by the main grid. When MG is suddenly islanded from the utility grid, the MG suffers from the unbalanced load-generation, and since MG has low overall inertia, it may undergo larger frequency deviations compared to a bulk power system [3]. An MG with inadequate reserve power may experience blackout. Therefore, The associate editor coordinating the review of this manuscript and approving it for publication was Lei Wang.
having enough and fast-responding reserve power for PFC is critical. Distributed generation (DG) units such as solid oxide fuel cells (SOFCs), micro-turbines (MTs) and diesel generators (DEGs), are not able to participate in PFC due to their slow response. On the other hand, the response of battery ESS (BESS) is much quicker, which is in the order of milliseconds [4].
The BESS has various applications in an MG like frequency regulation, energy management, power quality conditioner and etc [5]. In [6], an algorithm is proposed for smart energy management of a BESS based on load forecasting of an island power system. In [7], a novel control algorithm is presented for distributed BESSs to decrease frequency and voltage deviations. In [8], the feasibility of BESS contribution VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ to the primary frequency control (PFC) in a bulk power system is investigated. The authors in [9] focused on the impact of the PFC provided by BESSs on the transient response of electric grids. In [10], a hierarchical control of BESSs for controlling multiple BESSs to provide frequency response is proposed. The studies in [7]- [10] mainly considered the nominal power of the batteries for PFC application. However, there are some batteries with overloading characteristics are capable of fast discharge/charge for a short period. The work in [11], used this capability rather than the nominal power of the battery to reduce the required battery size for performing PFC.
The proposed overloading characteristics in [11] is based on constant power discharge/charge. However, the battery power varies with the frequency deviation and it is not constant. Therefore, in this paper, a modified overloading characteristic is proposed for battery sizing, which considers the variable power discharge/charge. In addition, unlike [11] that sized battery for frequency interception, in this paper, the allowable frequency deviation limits are used as the frequency security criterion to size the battery. It means by proper sizing and control of the battery, not only the frequency deviation is intercepted but also it is maintained in the allowable and safe limits. The capability of a BESS for PFC depends on its available capacity for charge/discharge; therefore, after completing each PFC task, its output power must be brought back to zero by power sharing among the DGs [12]. In [4], BESS has been utilized for PFC while the slow-responding DGs have been utilized for secondary frequency control (SFC) and restoring the BESS power to their initial values. The photovoltaic (PV) systems are not inherently responsive to frequency deviations; However, various studies [13]- [18] have attempted to enable PVs to participate in frequency control. According to the German grid code [13], in cases that the grid frequency increases above 50.2 Hz, the grid-connected PVs should decrease 40 % of their output power per Hz. In [14], the PVs have been enabled to participate in PFC when the frequency exceeds 50.67 Hz. The frequency triggering setpoints like 50.2 Hz in [14] or 50.67 Hz in [13] immensely impairs the capability of PVs to participate in PFC. In [15], the PVs are used alongside BESS for PFC that their output power is reduced when the frequency goes beyond the nominal value. However, performing PFC without any backup for SFC may force the BESS to reach its SOC limits in case of shortage or surplus of power, and also forces PV to work out of its MPP, which is not economical. In [16], some strings of a PV array have been connected/disconnected by dc-relays for frequency regulation based on droop characteristics. In order to use the PVs as the main device for PFC, it should reserve a portion of its output power for performing PFC in case of power shortage, which means the waste of renewable energy. In addition, the reserve power provided by the PVs is not reliable because of their intermittent nature. In [17], a novel control scheme has been developed that enables PVs to adjust their active output power for contributing to frequency control. The works in [15], [17] used the right side of the MPPT for frequency regulation regardless of the advantages or technical restrictions of the left or right side of the PV power-voltage curve (PPVC) over the other side. In this paper, the advantages of the left side of the PPVC over the right side and the technical restrictions of the right side is discussed, and then the left side of the PPVC is used for participation in PFC.
Another option for participation in frequency control is demand response (DR). Lighting loads are one of the major loads in the domestic load profile [19], and LED lighting loads are replacing the other types of lighting loads due to their benefits [20], [21]. In [22], it has been stated that smart lighting systems such as driver-controlled LEDs are the DR solutions for smart grids. In [23], a decentralized control strategy has been presented for a two-area interconnected power system to facilitate the active participation of LEDLLs; Each LED load has responded independently to the local frequency signal. In [24], the potential contribution of LEDLLs has been described as frequency reserves to provide ancillary services. It has also proposed an illumination control strategy and several control modes to regulate LED illumination. Analog dimming and pulse width modulation (PWM) are two approaches for controlling of LEDs luminance [25].
In this paper, for controlling the frequency of the islanded MG, a two-level control method consisting of PFC and SFC is proposed. In the PFC stage, the LEDLLs and fast-acting MSs like BESS and PVs are utilized while in the SFC stage, slow-acting DG units like DEG, SOFC and MT are utilized. The LEDLLs decrease their power consumption in case of power shortage. They use local frequency measurements, and they locally respond to frequency deviations. The PVs decrease their power generation in response to frequency rise. The BESS uses the overload capability of the battery to perform PFC in both cases of power shortage and surplus, and it has a dominating role compared to the PVs and LEDLLs. A modified overloading characteristic based on variable power discharge/charge is presented. Based on the modified overloading characteristics, a battery sizing algorithm is proposed to size the required battery size for PFC that also ensures the health of the battery while fast discharging/charging for performing PFC. The Genetic Algorithm is used to optimally determine the coefficients values of the proportional frequency controllers of the PVs, LEDLLs and BESS to minimize the required battery size while maintaining the frequency within safe operational limits. Two cases with the most severe shortage and the most severe surplus of power generation are considered as the worst frequency contingencies that the MG ever experiences. In order to investigate the effect of the participation of PV and LEDLLs alongside BESS, the simulations and battery sizing process are performed once with BESS, PV and LEDLLs responsible for PFC and once with only BESS. Considering the aforementioned reviewed studies, the contributions of this study are listed as follows: • A novel and optimal procedure for battery sizing is proposed; The GA is used to optimally determine the frequency controllers coefficients of the PVs, LEDLLs and BESS to maintain the MG frequency within safe operational limits while the capacity of the PVs and LEDLLs are fully used for participation in PFC. This results in less participation of the BESS in PFC and reduction of the required battery size.
• Unlike [11] that performed battery sizing regardless of the allowable frequency deviation, in this paper, the allowable and safe range of frequency deviations are introduced as a frequency security criterion for battery sizing.
• Introducing a novel battery sizing algorithm based on the modified overloading characteristics of the battery which ensures the health of the battery while fast discharging/charging for performing PFC with variable power discharge/charge.
• In various studies like [15], [17], the right side of the PPVC is used for frequency regulation. But they haven't explained the rationale behind this decision. In this paper, the technical differences of the left side and the right side, and the advantages of the left side over right side is discussed. Then, the left side is used for enabling the PV to participate in PFC. To the best of authors' knowledge, such a comparative analysis study hasn't been done thus far.
• Unlike [13], [14], in this paper, the full capability of the PVs is used to participate in PFC in case of power surplus, without considering any frequency triggering setpoints.
• The capability of LEDLLs is used to participate in PFC in case of power shortage without affecting the consumers' comforts.
The schematic diagram of the sections of the manuscript and their connections are presented in Fig. 1. In the next section, the proposed method for controlling the MG frequency is described. The model of controllers for PFC, the control method for coordination of PFC and SFC is presented in section 2. The novel and optimal battery sizing algorithm is also described in section 2. In section 3, simulation studies are presented to evaluate the optimal battery sizing and the proposed method for frequency control of islanded MG.

II. PROPOSED SCHEME FOR CONTROLLING MG FREQUENCY AND BATTERY SIZING
This section describes the control scheme for PFC, the model of BESS, PV and LEDLLs, and the coordination of PFC and SFC for overall frequency control scheme of islanded MG. At the end of this section, the novel and optimal battery sizing algorithm is described.
For the secure operation of an islanded MG, a frequency control scheme is essential. In this paper, a coordinated twostage control strategy consisting of PFC and SFC is proposed. The MSs are divided into two groups of fast responding MSs (FRMSs) and slow responding MSs (SRMSs), which are responsible for PFC and SFC, respectively.
A. CONTROL SCHEME FOR PFC  Fig. 2(a) shows that the BESS power can be increased/ decreased based on its droop characteristic in response to frequency deviation. P max inj and P max abs are the maximum powers that BESS can inject and absorb, respectively. The BESS contribution to PFC can be written as follows: where, K BESS is the P BESS -ω droop coefficient. ω max and ω min are the maximum frequency rise and drop that the MG experiences, respectively. Fig. 2(b) shows the LEDLLs droop characteristic.
In case of power shortage, the power consumption of the LEDLLs is reduced to 0 as the frequency reaches ω min . P pres LEDLL is the current power consumption of the LEDLLs before the frequency deviations. The following equations can express LEDLLs contribution to PFC: where, K LEDLL is the P LEDLLs -ω droop coefficient. Fig. 2(c) shows the droop characteristics of the PV. In case of power surplus, its output power can be decreased to P min as the frequency reaches ω max . P min and P MPP are the minimum and the maximum powers that a PV can generate at a certain climate condition. The PV contribution to PFC can be written as follows: where K PV is the P PV -ω droop coefficient.   injection/absorption. Q ref is set to zero because reactive power control is not studied. The detailed information about the BESS model including the inverter control is available in [11], [26]. Fig. 4 shows the BESS controller for developing P ref in both the islanded modes and gird-connected. in the islanded mode, a proportional controller (K BESS ), determines the required injection/absorption of BESS active power (P ref ) proportional to frequency deviation ( ω) for participating in PFC.
The authors in [11] stated that the SOC of battery must be in a safe range of operation, and if it is led out of safe range, it may bring permanent damage to the battery. In [27], the safe range of operation for the SOC is introduced by upper and lower limits, which respectively are 80% and 20 %. With respect to upper and lower SOC limits, the SOC-ref is set to 50%, so that the battery has upward and downward capacity for charge and discharge, respectively. As shown in  In the BESS control scheme in Figures 4 and 5, the SOC of battery is determined using the coulomb counting [15].
There are some batteries capable of overloading or fast charging/discharging. In other words, they can inject or absorb power with much higher rates than their nominal power for a short period, which is known as ''permissible overloading duration''. It is worth noting that if the battery is fast charged/discharged longer than this period, it would be damaged [11]. The battery manufacturer provides the technical data about overloading capability and permissible duration. In this paper, the battery used for PFC is also capable of overloading, which helps to choose a battery with a much lower power rating than sizing a battery based on its rated power. Fig. 6 shows a typical scheme for a PV system. The PV array is connected to the MG by a DC/DC converter and a DC/AC inverter. The objective of the maximum power point tracking (MPPT) algorithm is to ensure the extraction of maximum available power from the PV array. This task is realized by controlling the voltage of the PV array through the DC/DC boost converter. The inverter converts the voltage of DC link to AC voltage while keeping unity power factor.

2) PV MODEL AND CONTROL
The PV is enabled to contribute to PFC through modifications of the boost converter controller.   like [15], [17], the right side of the PPVC is used for frequency regulation. But they haven't explained the rationale behind this decision. In the following, the technical differences of the left side and the right side of the PPVC, and their advantages over the other one is discussed. Fig. 8 (d) shows that the change rates of the PV power is variable on the right side of the PPVC and almost constant on the left side. It means that the characteristics of the PPVCs on the left side is linear compared to the right side. Another challenge which makes the utilization of the right side of the PPVC more difficult for participation in PFC is that the duty cycles of zero power points (ZPPs) varies on the right side in a wide range. For example, in Fig. 7 (c), for solar irradiances of 1200 W/m 2 and 500W/m 2 and the temperatures of 10 • C and 50 • C, ZPPs are marked black dots. The values of V oc for these ZPPs are 336 V and 289.6 V, respectively. Considering the V dc to be 500 V, their corresponding duty cycles are 0.328 and 0.421, respectively. For participation of PV in PFC and other ancillary services, the duty cycles are of the MPPs and ZPPs are necessary to be continuously known. As the values of V PV and duty cycle for the ZPPs on the right side vary for different temperatures and solar irradiances, another algorithm like the MPPT algorithm should be used to track the ZPPs. It should be noted that any miscalculation in setting the duty cycle for using the right side in PFC can result in applying a voltage on the PV array more than V oc , which results in injecting power to PV array and damaging it. In comparison to the right side of the PPVC, Fig. 7 (c) shows that the values of V PV for ZPPs on the left side of the PPVCs are zero, and using Eq. 8, their corresponding duty cycles are all equal to 1. By increasing the duty cycles from the duty cycle of the MPP (D MPP ) to 1, the PV power is decreased from MPP to zero. However, the maximum limit of the duty cycle (D max ) limit is set to 0.97 (slightly below 1) to ensure that PVs will never be short-circuited and damaged. Using this approach, the left side of the PPVCs can be simply used for enabling the PV to participate in PFC without needing an algorithm similar to the MPPT algorithm to obtain the duty cycles of ZPPs on the left side of PPVCs. Considering the linear characteristics of the left side of the PPVC, and also the challenge of obtaining the duty cycles of the ZPPs on the right side of the PPVC, the utilization of the left side for enabling the PVs to participate in PFC is much easier than the right side. Fig. 8 shows the modified converter control for participation of PV in PFC using the left side of the PPVC. It consists of two operating modes, namely grid-connected and islanded mode. For both modes, the MPPT algorithm regulates the duty cycle of the boost converter to operate the PV array at MPP. In islanded mode, when the frequency rises above the nominal value, in order to decrease the PV power, the produced duty cycle by the MPPT algorithm is sampled and held constant in the memory for being continuously modified by the proportional frequency controller of the PV, which is denoted by K Dut_Fre . In short periods of frequency deviations, it is acceptable to take the climate conditions constant, and therefore, the held duty cycle remains the MPP duty cycle during this period. The held duty cycle and the output signal of K Dut_Fre produce the modified duty cycle for the converter, which is limited within the upper bound (D max ) and lower bound (D MPP ). As soon as the frequency is restored to its nominal value, the proportional frequency controller becomes deactivated, and the MPPT control becomes operational, and starts updating the duty cycle for MPPT function. Fig. 9 shows the mechanism of PV contribution to the PFC. Fig. 9 (a) shows that the duty cycle of the PV converter increases from D MPP to D max in response to the frequency deviation from the nominal value to the maximum frequency rise.
The equations (9) and (10) present the mathematical equation of the variations of PV converter duty cycle in response to frequency deviation: where K Duty_Fre is the slope coefficient of duty cycle variations with respect to frequency deviations. Fig. 9 (b) shows that as the duty cycle of the PV converter increases from D MPP to D max , V PV decreases from V MPP to V min . The variations of V PV with respect to the duty cycle variations can be expressed as follows: where K Vol_Dut is the slope coefficient of the variations of V PV with respect to duty cycle variations. Fig. 9 (c) shows that as the V PV decrease from V MPP to V min , the PV power decreases from P MPP to P min . The mathematical equation of the variations of V PV with respect to PV power variations can be expressed as: where K Pow_Vol is the slope coefficient of PV power variations with respect to the variations of V PV . The characteristics of PV contribution to PFC is shown in Fig. 9 (d), and expressed by equations (5) and (6). As the frequency increases from ω 0 to ω max , the PV output power decreases from P MPP to P min . Equation (15), expresses the relation between the PV droop coefficient (K PV ) and K Duty_Fre , K Vol_Dut and K Pow_Vol :

3) LEDLLs MODEL AND CONTROL
In order to represent and model the dimmable capability of the LEDLLs, they are modelled as a single dynamic load that its active power can be controlled for the frequency control as shown in Fig. 10. P pres LEDLLs is LEDLLs power consumption of the consumers when the MG frequency is at its nominal value. When frequency drops, the LEDLLs frequency controller, which is a proportional controller (K LEDLL ), senses the frequency deviation and proportionally to the frequency deviation determines required amount of decrease/increase in LEDLLs power consumption.

C. COORDINATION OF PFC AND SFC
In the grid-connected mode, the MG frequency is controlled by the main grid. However, in the islanded mode, the MG frequency changes rapidly following a disturbance due to its low inertia, which can be governed using equation (16).
where ω is the MG frequency, H MG is the total inertia of MG, P TL and P TG are the total load and generation of MG, respectively. A frequency disturbance results in shortage or surplus of power generation in the islanded MG. Based on equation (16), Fig. 11 shows the coordinated process of PFC and SFC for overall control of MG frequency following a disturbance. P main is the power of the utility grid that ensures demand-supply balance in the MG in the grid-connected mode. The power consumption of the LEDLLs that participates in frequency control is denoted by P LEDLLs . P L represents the power consumption of other MG loads. P G is power generation of those MSs that don't participate in frequency control. BESS with the overloading capability of the battery, plays an important role in the PFC. The PVs cooperate with the BESS in the case of power surplus while the LEDLLs cooperate with the BESS in the case of power shortage to intercept the frequency deviation. On the other hand, SRMSs like DE, SOFC and MT are responsible for SFC. Using the proportional-integral controller, their output power is increased/decreased until the frequency returns to its nominal value. In response to a frequency deviation, both PFC and SFC stages will be activated, but the response of SRMSs are relatively much slower than the FRMSs. Therefore their contribution is very low during the PFC stage. When SFC stage ends, the frequency returns to 50 Hz and the power of BESS and PV and the power consumption of the LEDLLs return to their pre-disturbance value as proposed in [4], which makes them ready for the next PFC action.

D. NOVEL AND OPTIMAL BATTERY SIZING METHOD
Some batteries with overloading capability can inject/absorb power multiple times of their rated power for a short period of time, and also as the PFC lasts for a short period, instead of using the nominal power of battery, its overloading characteristics is used for battery sizing. The overloading characteristics presented in [11], which are summarized in Table 1 and Figures 12 and 13, express that the battery can inject/absorb the power equal to K i FastDis /K j FastCha times of its rated power for the permissible durations of T i OD−Time /T j OC−Time , respectively. K i FastDis and K i FastCha are the overloading discharge/charge coefficients representing the rates of fast power discharge/charge. Variables i and j are used for numbering the overloading coefficients and their permissible duration in discharge and charge modes, respectively. Although K 1 FastDis /K 1 FastCha represent the highest rate of power injection/absorption among the overloading discharge/charge coefficients, their corresponding permissible duration are the shortest ones. On the other hand, K 3 FastDis /K 3 FastCha represent the lowest rate of fast power injection/absorption with the longest permissible durations. It means that the higher the   rate of power injection/absorption, the shorter the permissible duration is, and vice versa. It is worth noting that the battery manufacturers provide the data about the overloading characteristics for each battery type in its datasheet.
In order to calculate the required battery size, it is proposed in [11] to divide the maximum injected/absorbed power by K i FastDis /K j FastCha , respectively. Since the overloading characteristics of the battery in charge and discharge modes are different so, the required battery size for the shortage and surplus scenarios should be determined separately and then the bigger one is adopted for sizing capacity of the battery. It should be noted that the battery can tolerate higher discharge rates than its rated power for a short period, but the inverter can only provide its rated power. Therefore, the power rating of the inverter is equal to the maximum injected/absorbed by the BESS. The problem with the battery sizing algorithm in [11] is that its presented overloading characteristics is based on constant power discharge/charge and the BESS power is not constant and it varies in response to the frequency deviation. This totally questions the application of the proposed battery sizing algorithm and its results in [11]. The contribution of our proposed battery sizing algorithm, which solved this problem, is that the overloading characteristics of the battery is redefined based on the permissible energy discharge/charge limits (E i FastDis /E j FastCha ) instead of the permissible durations. It means that during fast discharge/charge operations, the battery is allowed to discharge/charge a limited energy. In discharge mode, the value for E i FastDis is equal to the area under curve of each overloading coefficients in Fig. 12, and in charge mode, the value of E j FastCha is equal to the area above curve of each overloading coefficients in Fig. 13. For instance, the integral value of the red area in Fig. 12 represents the E 1 FastDis , and the integral value of the yellows area in Fig. 13 represents E 3 FastCha . Therefore, the values of E i FastDis /E i FastCha can be calculated using equations (17) and (18): The red, orange and yellow areas are the permissible energy limits of the first, second and third overloading coefficients. It can be seen in Fig. 12 and 13 that the higher the rate of power injection/absorption, the less the permissible energy limits are, and vice versa. The modified overloading characteristics of a battery is presented in Table 2. Using the modified overloading characteristics in Table 2, the power rating of the battery (P rated BAT ) can be calculated using equations (19), (20) and (21).
where P short max and P sur max are the maximum injected and absorbed power by the BESS during the shortage and surplus scenarios. η BESS represents the efficiency of the BESS. The BESS efficiency is considered equal during discharge and charge operations [28], which is 0.9 [29]. The battery sizing algorithm is shown in Fig. 14. In order to reduce the battery size, initially the largest values of K i FastDis /K j FastCha are chosen by setting i and j to 1. If the corresponding discharge energy limit is violated, a smaller overloading coefficient will be chosen for discharge mode with more permissible energy limits. For this purpose, the values of the variable i will be increased by one. On the other hand, if the corresponding charge energy limit is violated, a smaller overloading coefficient will be chosen for charge mode with more permissible energy limits by increasing the value of the variable j by one. It is worth noting that in small disturbances such as changes in load demand, the battery is not required to use high discharge/charge rates to handle frequency. In addition, according to Figures 12 and 13, the permissible discharge/charge energy limits are much more in low discharge/charge rates than in higher ones. Therefore, in small disturbances, the permissible discharge/charge energy limits won't be problematic for the healthy operation of the battery.
The PVs and the LEDLLs can participate in PFC, but they cannot handle it on their own. Therefore, the MG management center installs a central BESS unit in the MG to participate in PFC alongside PV and LEDLLs. The frequency controllers of the BESS, PV and LEDLLs controls their participation in PFC. For instance, by increasing K BESS , BESS absorbs/injects more power at a higher rate in response to frequency deviation, which results in faster frequency interception and less frequency deviation. However, injecting/absorbing more power in response to frequency deviation results in a battery with a higher power rating, which means that decreasing frequency deviation increases the capital cost of the battery.
Unlike BESS, the capacity of the PV and LEDLLs for participation in PFC are limited. However, their participation alongside BESS, decreases the share of BESS power injection/absorption for PFC, and consequently decreases the required power rating of the battery. The allowable range for frequency deviation from nominal frequency is ±1 pu [30]. The Genetic Algorithm (GA) is used to determine K BESS , K Dut_Fre and K LEDLLs to ensure that the frequency deviations remain within these allowable range while the most benefit is taken from the capacity of the PV and LEDLLs to participate in PFC to reduce the battery size. Therefore, the optimization variables are K BESS , K Dut_Fre and K LEDLLs . Fig. 15 shows the process of optimal battery sizing using GA [31].
For each sets of optimization variables in each population, the simulations of both cases of surplus and shortage of power generation are run. In the next step, the required battery size is calculated using the simulation results and the process presented in Fig. 14. Then, the fitness function (FF) is calculated, which is presented as follows: The GA calculates the value of FF for each sets of optimization variables in each population. It continues making new populations till the stopping criteria is met and the optimal value of optimization variables and battery size are achieved.
The FF consists of two parts that each one is related to each of the shortage and surplus cases. The rationale behind the first part of the proposed FF is to maintain the frequency above the lower allowable limit of the frequency (49.5 Hz) in the case of most severe power shortage while minimizing the required battery size. By doing this, it is also ensured that in the most severe case of power surplus, the frequency is kept lower than the upper allowable limit, because statistically, the most severe case of power surplus is less severe than the most severe case of power shortage. On this basis, the second part of the proposed FF is designed to minimize the frequency deviation and the required battery size in the case of power surplus. The variables K 1 and K 2 prioritizes the realization of each parts of the FF. In order to ensure the realization of the first part of FF, which is more important than the second part, K 1 is set to 10 and K 2 is set to 1.
As the GA may increase K BESS , K Dut_Fre and K LEDLLs so much that could destabilizes the stability of the MG, maximum limits should be considered for these control variables.
Considering ω o to be 50 Hz, the maximum limit of K Dut_Fre is considered to be equal to the value that releases the full capacity of the PV for participation in PFC before the frequency reaches 50.15 Hz. Therefore, the value of ω max for determining the maximum limit of K Dut_Fre using equation (4), is set to 50.15 Hz. As far as the LEDLLs are concerned, the maintenance of the consumers' comforts is a critical issue; Hence, the fast restoration of the LEDLLs power consumption to their pre-disturbance value is important. Considering maximum frequency drop to be 49.5 Hz, if the power consumption of the LEDLLs is decreased fully at a higher frequency than 49.5 Hz like 49.7 Hz, the LEDLLs power consumption and their luminance level remains at zero level for a period till the frequency reaches 49.7 from 49.5 Hz. This delay in the restoration of LEDLLs power consumption is contrary to the consumers' comfort, which is critical to be avoided. On the other hand, if their power consumption is decreased till 49.5 Hz, it restores with frequency without any delays. Therefore, the value of ω min for determining the maximum limit of K LEDLLs using equation (4), is set to 49.5 Hz. The maximum limit of K BESS should be a value that ensures enough power is injected/absorbed by the BESS to maintain the MG frequency within allowable limits without the participation of the PV and LEDLLs.

III. SIMULATION STUDIES
In order to evaluate the novel and optimal battery sizing procedure and the proposed control scheme for frequency control of the islanded MG, an MG network is simulated by MATLAB/Simulink software. In addition, in order to investigate the effect of the participation of PV and LEDLLs alongside BESS, the simulations and battery sizing process are performed once with BESS, PV and LEDLLs responsible for PFC and once with only BESS.

A. MG SPECIFICATION
The MG network under study is shown in Fig. 16 consisting of a 0.4 kV distribution feeder connected to a 20 kV distribution network through a 400 kVA transformer. The network and its parameters are taken from the CIGRE low voltage distribution benchmark system [11], [32]. The total installed capacity of the DGs is 84.2 kW. The MG contains a SOFC, MT, DEG, BESS and two PV systems. The power rating of the DEG and MT is 31.1 kVA. The MT is based on the model of GAST turbine-governor presented in [33]. The DEG model is based on the one presented in [34]. The power rating of SOFC is 10 kW, and its model has been taken from [33]. The power ratings of the two PVs are 2.7 kW and 9.3 kW. The type of PV panels is Sun-power SPR-305E-WHT-D. Statistically, 11.1 % of the domestic loads are lighting loads [19], which are equal to 7.59 kW out of total MG load (66 kW). The MG is a 3 phase network, but the LEDLLs are single-phase loads. Assuming that the type of these lighting loads are LED, and they are equally distributed on all 3 phases, and to investigate the capabilities of the LEDLLs in frequency regulation studies, the LEDLLs are considered as a single dynamic three-phase load, and their power consumption is controlled as explained in section 2.2.3. The battery used in the BESS unit is Lithium Iron Phosphate (LiFePO 4 ) type. The  overloading characteristics of LiFePO 4 battery, which is presented in [11], is shown in Table 3. As explained previously, the overloading characteristics in Table 3, which is based on constant power discharge/charge, is not applicable for battery sizing. Therefore, the modified overloading characteristics, which is defined based on Table 2, is presented in Table 4. According to [11], the shortage of 20 kW power generation and the surplus power of 14.7 kW after unplanned islanding are the most extreme contingencies that the MG ever experiences. Here, these contingencies are used here as case studies for frequency control studies and optimal battery sizing.

B. PFC ONLY WITH BESS
In this section, the frequency simulations studies are performed for two cases of shortage and surplus of power generation while the BESS is just responsible for the PFC. Since PVs and LEDLLs are not supposed to participate in PFC and K Dut_Fre and K LEDLLs are set to zero and K BESS is just optimally determined using GA. The maximum and minimum limits of K BESS is set to 80000 and 0, respectively. It took the GA almost 1 day and 6 hours to find the optimal value of K BESS , which is 67892.

1) POWER SHORTAGE SCENARIO
The generation and consumption power of the MG before unplanned islanding at 5 th sec are 44.05 kW and 64.05 kW, respectively, which results in 20 kW shortage of power in the islanded mode. Fig. 17 shows the DGs power generation. Fig. 18 shows that the MG frequency drops as the power shortage occurs. The BESS immediately injects 33.87 kW to keep the frequency deviation within safe range, which results  in the interception of the frequency deviation at 49.501 Hz above the lower frequency limit (49.500 Hz). The SRMs like the SOFC, MT and DEG, gradually increase their power generation to permanently eliminate the power shortage. When the frequency returns to 50.000 Hz, the BESS power returns to zero. The total injected energy of the BESS is equal to the area under the BESS curve, which is 170.83 kWs.

2) POWER SURPLUS SCENARIO
In this section, the worst case of power surplus is investigated. The total generation and power consumption of the MG before unplanned islanding from the utility grid at 5 th sec, are 51.85 kW and 37.15 kW, respectively, which results in 14.7 kW surplus power after islanding. Fig. 19 shows the power generation of the DGs. Fig. 20 shows that the MG frequency quickly rises due to the surplus power caused after islanding. In the PFC stage, the BESS fast starts absorbing power from the MG, and absorbs maximum power of 24.63 kW. The BESS performance results in the quick interception of the frequency overshoot at 50.364 Hz below the lower frequency limit (50.500 Hz). The MT, SOFC and DEG gradually decrease their power generation to eliminate the surplus power in the MG. When the SFC stage ends, the MG frequency return to 50.000 Hz, and the BESS power returns to zero. The total absorbed energy of the BESS is equal to the area above the BESS curve, which is 78.34 kWs. VOLUME 8, 2020  It is worth noting that PV is operating at MPP and D MPP is constant at 0.52 during the frequency control period.

3) BATTERY SIZING
In the cases of power surplus and shortage, the BESS absorbed and injected maximum powers of 24.63 kW and 33.86 kW, respectively. As the battery uses its overloading characteristics, the power rating of the battery can be determined using equations (19)- (21). Initially, the largest overloading discharge/charge coefficients are used: The permissible energy discharge/charge limits are 222 kWs and 111 kWs, respectively, which are calculated using equations (17) and (18). The discharged and charged energies of the BESS during shortage and surplus scenarios are 170.83 kW and 78.34 kW, respectively. Considering the BESS efficiency, the discharged and charged energies of the battery during these scenarios are 189.81 kW and 87.04 kW, respectively. As the permissible energy discharge/charge limits are more than the discharged and charged energies of battery during shortage and surplus scenarios, the discharge and charge energy limits are not violated. Therefore the battery with the size of 4.44 kW is sufficient to handle PFC without being damaged. It should be noted that if the battery sizing method presented in [7]- [10] was used, the power rating of the battery would be equal to the maximum injected/absorbed power, which is 33.86 kW. Hence using the overloading characteristics results in almost 87 % reduction of the required power rating of the battery for PFC.

C. PFC WITH BESS, LEDLLs AND PVs
In this section, the frequency simulations studies are 'generation while the BESS, LEDLLs and PVs are responsible for the PFC. The initial values of P LEDLLs and D MPP are 7.3 kW and 0.52, respectively. Based on the explanations given at the end of the section 2-D, the maximum limits of K Dut_Fre and K LEDLLs are set to 2.8 and 14600 using equations (10) and (4), respectively. The maximum limit of K BESS is set to 67750 which was determined in the previous section for maintaining the frequency within the allowable limits using only BESS. The minimum limits of K Dut_Fre and K LEDLLs and K BESS are set to zero. It took the GA almost 5 days and 4 hours to find the optimal values of K Dut_Fre and K LEDLLs and K BESS , which are 2.8 and 14600 and 54183, respectively. The GA chose the maximum limits for K Dut_Fre and K LEDLLs to use the full capacity of the LEDLLs and PVs to reduce the required battery while maintaining the frequency deviation within allowable limits.

1) POWER SHORTAGE SCENARIO
The initial conditions and the disturbance are the same as the shortage scenario in the previous section. Fig. 21 shows the LEDLLs power consumption and the DGs power generation. Fig. 22 shows that the MG frequency drops due to the power shortage after islanding. The BESS and LEDLLs respond to the frequency drop quickly. The LEDLL decreases its power consumption from 7.3 kW to 0 kW and the BESS rapidly increases its output power to 27.03 kW. As the result of fast and coordinated performance of the LEDLLs and BESS in the PFC, the frequency is intercepted at 49.501 Hz above the lower frequency limit (49.500 Hz). In comparison to the   shortage scenario in the previous section, the participation of LEDLLs alongside BESS decreases the share of BESS power injection for PFC from 33.86 kW to 27.03 kW. As can be seen in Fig. 22, the PVs don't contribute to the PFC, and they generate the MPP, which means that the PVs power generation is not lost in reserve. The SRMs like the SOFC, MT and DEG, gradually increase their output power. Five seconds after the islanding, as the result of the performance of the SRMs, the LEDLLs power consumption returns to 5 kW, which is almost 68% of their total power consumption. It means that the consumers just experienced a low luminance for a very short period, which is negligible. Therefore the consumers' comforts are not affected by the participation of the LEDLLs in PFC. When the SFC stage ends, the frequency returns to 50.000 Hz, and also, the LEDLLs power consumption and the BESS power return to their pre-disturbance value. The total injected energy of the BESS is 132.87 kWs during the frequency control period.

2) POWER SURPLUS SCENARIO
The initial conditions and the disturbance is the same as the power surplus scenario in the previous section. Fig. 23 shows the DGs power. Fig. 24 shows the MG frequency that rises quickly due to the surplus power caused after islanding. In the PFC stage, the BESS starts absorbing power from the MG  that it reached the maximum injected power of 14.21 kW. As frequency triggering points are not considered for PVs participation in the PFC, they fast start decreasing their power generation from 2.7 kW and 9.3 kW to 0.11 kW and 0.38 kW, respectively. The coordinated performance of the PVs and BESS results in the interception of the frequency overshoot at 50.263 Hz, which is much lower than the maximum frequency rise in the surplus scenario in the previous section. Fig. 25 shows that the duty cycle of the PVs converters reached its maximum value when the frequency reached 50.15 Hz. It means that the PVs decreased their power to the minimum level before the frequency reached its peak. The MT, SOFC and DEG gradually decrease their power generation to eliminate the surplus power in the MG. When the SFC stage ends, the MG frequency returns to 50.000 Hz, the PVs power generation returns to MPP and the BESS power returns to zeros. The total absorbed energy of the BESS is 49.21 kWs during the frequency control period.

3) BATTERY SIZING
In the cases of power surplus and shortage, the BESS absorbed and injected maximum powers of 15.56 kW and 27.29 kW, respectively. As the battery uses its overloading characteristics, the power rating of the battery can be determined using equations (19) The permissible energy discharge/charge limits are 152 kWs and 76 kWs, respectively, which are calculated using equations (17) and (18). The discharged and charged energies of the BESS during shortage and surplus scenarios are 132.87 kW and 49.21 kW, respectively. Considering the BESS efficiency, the discharged and charged energies of the battery during these scenarios are 147.64 kW and 44.29 kW, respectively. As the permissible energy discharge/charge limits are more than the discharged and charged energies of battery during shortage and surplus scenarios, the discharge and charge energy limits are not violated. Therefore the battery with the size of 3.04 kW is sufficient to handle PFC without being damaged. In comparison to the case where only BESS is used for PFC, the participation of PVs and LEDLLs in PFC alongside BESS decreases the required battery size from 4.44 kW to 3.04 kW, which is almost 31 % smaller.
In [32] where the MG network under study is originally introduced, it is stated that the power rating of the BESS is 30 kW. It means that the power rating of the MG equipment and other technical issues are designed for BESS power injection/absorption up to 30 kW. The maximum injected/absorbed power by BESS with the coordinate application of the PVs and LEDLLs is 27.03 kW, which is less than 30 kW. Therefore, there is not any technical limitations of using the designed battery considering the power rating of the MG equipment.

IV. CONCLUSION
A frequency control scheme, consisting of the PFC and the SFC was proposed for the frequency control of the islanded MG. The BESS, LEDLLs and PVs were coordinated to handle PFC while the distributed generators like the DEG, MT and SOFC were used to restore frequency in the SFC stage. A battery sizing algorithm was presented that used the overloading characteristics of the battery instead of the nominal power of the battery to determine the battery size. The battery sizing algorithm considered the permissible discharge/charge energy limits to avoid damaging the battery while fast discharging/charging during the PFC. Unlike the PVs and LEDLLs, the size of the BESS was unspecified. It was also proposed that by decreasing/increasing the gain of the frequency controller of the BESS, the injected/absorbed BESS power can be decreased/increased in response to the frequency deviation. The same approach was taken with regard to the PVs and LEDLLs to use their capacities for participation in PFC. In order to show the effect of the participation of the PVs and LEDLLs alongside the BESS, the simulations studies were performed once with only BESS and once with the coordination of the BESS, PVs and LEDLLs. The GA was used to tune the frequency controllers coefficients of the BESS, PVs and LEDLLs to determine the minimal required battery size while maintaining the MG frequency within allowable limits.
The simulation results showed that using the overloading characteristics considerably reduced (almost 87 %) the required battery size. In addition, the GA found the minimal battery size by using the full capacity of the PVs and LEDLLs for PFC. If the PVs and the LEDLLs hadn't contributed to the PFC, the battery size would be almost 31 % larger than the case that only BESS was responsible for PFC, because the BESS should have provided their share in the PFC instead.
In the power shortage scenario that LEDLLs participated in PFC alongside BESS, the power consumption of LEDLLs returned to 5 kW (≈ 68% of their total power consumption) in 5 seconds after islanding. It means that the residential consumers only experienced a low luminance for a very short period, and the disruption of the consumers' comfort is negligible.
The technical differences of the left side and the right side of the PPVC was also discussed, that due to the advantages of the left side over the right side, it was proved that the left side of the PPVC is more suitable than the right side for the participation of PVs in PFC.