BESS Primary Frequency Control Strategies for the West Africa Power Pool

: In recent years, power systems have been moving from conventional power plants toward the integration of renewable energy sources (RES). This trend is taking shape in many developing economies, including in the West Africa Power Pool (WAPP). The integration of RES, however, stresses grid security and stability due to the variability and intermittency of the underlying renewable sources. Battery Energy Storage Systems (BESS) have been identiﬁed as a possible solution to address the frequency control challenges in the WAPP Interconnected Transmission System (WAPPITS) in order to help to accommodate high levels of RES. This paper analyzes the application and effectiveness of BESS in providing primary frequency control reserves in the WAPPITS. The analyses are based on numerical simulations that were performed using an open-loop model based on historic frequency measurements from the WAPPITS. The simpliﬁed model provided a ﬁrst-order analysis of the frequency control and state of charge (SOC) restoration logic for BESS installations. This study indicates that a droop-based control strategy that is able to react only to the symmetrical and fast frequency oscillations in the network could be appropriate for regulating BESS in the system. Moreover, it demonstrates that the deployment of BESS alone does not solve frequency control problems and a deep revision of the frequency control service is required, mainly involving traditional power plants.


Introduction
The integration of renewable energy sources (RES) into the West Africa Power Pool (WAPP) Interconnected Transmission System (WAPPITS) has increased significantly; between 2016 and 2021, about 439 MW of solar PV was installed, representing 1.9% of the total installed generation capacity. The total energy generated from solar PV now represents 0.7% of the energy that is generated in the subregion. The installed capacity of solar PV and wind power is expected to grow to about 40% of the total generation capacity between 2030-2033 in order to fulfill the regional goal of increasing electricity access for the citizens of the Economic Community of West Africa States (ECOWAS) [1]. The WAPPITS' list of regional priority generation projects has RES projects (including hydro) representing 68.9% (10.67 GW) of all expansion projects, of which 29.5% (3.15 GW) involve solar and wind power [1].
The increasing penetration levels of RES will likely create operational challenges for the dynamic behavior of the WAPPITS [1,2]. Notable among the operational challenges is the impact of RES on frequency stability. Since wind and solar RES resources are generally inverter-based, these generators reduce system inertia relative to generation capacity, making the system frequency very susceptible to any loss of generation, transmission line or load [3][4][5][6][7]. The variability and uncertainty of the output of RES generation also results in an increase in the variability and uncertainty of net load in the short term [8]. This requires a greater amount of flexibility and an increase in the need for primary frequency control reserves, which are typically provided by conventional or hydropower generation plants.
The WAPPITS has faced frequency stability challenges due to the lack of the active and reliable participation of conventional power plants in primary frequency control. Currently, the WAPPITS operates as three independent, synchronous blocks and primary frequency control has been identified as one of the main reasons that the WAPPITS cannot synchronize these blocks so as to operate as an interconnected transmission system [9][10][11][12].
Whilst efforts are being made to address these challenges, it has also been recommended that the WAPPITS deploy Battery Energy Storage Systems (BESS) for frequency regulation, especially with the ongoing effort to increase RES penetration [13]. This is based on the ability of BESS to provide grid services, such as primary frequency control due to the fast dynamic response of these systems, offer generation-demand balance alternatives to grid operators, provide other ancillary services able to stabilize the grid and provide high power capability relative to stored energy capacity [14][15][16]. Several studies have also indicated that BESS installations are a credible alternative for frequency regulation in maintaining grid stability with a high penetration of RES generation [17][18][19][20][21][22][23][24][25][26].
One of the most important studies devoted to analyzing the integration of BESS in the WAPP is the assessment of battery storage applications in the WAPP utilities and countries, which was performed by the World Bank in [13]; however, the study has some limitations. Only the technical performance of the WAPP Power System, with and without BESS, was analyzed. The study primarily assumed the existence of reasonably adequate frequency control reserves and assessed the capability of BESS to stabilize the system in a dynamic/transient domain given by its fast response capabilities. The analysis fell short of evaluating the impact of the possible existing frequency control challenges (based on actual frequency data) on the inherent performance of BESS, its effective application for frequency regulation in the WAPPITS and the possible control strategies to be deployed to ensure BESS services are provided without interruption.
An analysis of the impact of existing frequency behavior on BESS effectiveness (inherently and on the grid) is important, since when comparing BESS and conventional power plants, it must be noted that the operational range and duration of BESS installations are limited by their energy storage (EU Network Codes define BESS as Limited Energy Reservoirs) [27]. In addition, round-trip storage losses when the state of charge (SOC) fluctuates create a fundamental power offset when BESS is used in primary frequency regulation. Hence BESS systems require constant input power that is proportional to the round-trip efficiency multiplied by the power produced/consumed in order to prevent service interruption due to BESS SOC saturation [14].
Research and studies on the application of frequency control and SOC restoration logic to effectively utilize BESS installations for primary frequency control have been conducted using empirical battery models, which were developed using either MATLAB/Simulink or DigSilent and actual frequency measurements from the grid as the input [14,[28][29][30][31][32].
These studies primarily used numerical simulations that were based on actual frequency measurements from the transmission system operator (TSO) to size and locate BESS for primary frequency control, both in an interconnected and an isolated system [19,33]. The performance and effectiveness of BESS have also been investigated with respect to a range of frequency control and SOC restoration strategies; these analyses have primarily focused on the ability of BESS installations to assure effective frequency control and guarantee service continuity [15,16,19,29,[34][35][36][37][38][39][40][41][42][43][44][45][46][47][48][49]. However, the listed studies used frequency measurements from mostly European and Asian countries as the reference data. None of them concentrated on proposing an effective strategy for BESS operation in the WAPPITS, whose critical and unique grid condition could lead to different considerations.
For the purposes of this study, the primary topic of consideration is the application of control strategies for both frequency regulation and SOC restoration. The frequency regulation strategy determines the limits at which the BESS attempts to restore system fre-quency. The SOC regulation strategy is necessary to avoid BESS saturation at maximum or minimum SOC. Researchers have conducted similar analyses using control strategies such as the frequency and deadband dependent strategy, hybrid SOC and frequency dependent charging strategy, dynamic strategies and the model predictive control (MPC) strategy.
(i) Frequency and deadband dependent strategy: The charging and discharging of BESS is dependent on the grid frequency and whether it is within a specified frequency deadband around the nominal (desired) frequency [31,42]. For example, BESS is discharged when f < f min = f nom − δ f and charged when f > f max = f nom + δ f . f is the measured frequency value, f nom is the nominal frequency, f min is the specified minimum frequency value, f max the specified maximum frequency value and the deadband is δ f . (ii) Hybrid SOC and frequency dependent charging strategy: This control strategy utilizes a frequency control similar to (i) but with BESS charge/discharge limits that depend on the SOC. For example, a simple strategy requires that the battery charges when the SOC is less than a specified SOC and discharges when the SOC reaches a certain maximum SOC, typically with a deadband on SOC limits so as to avoid oscillation [14,29,32,42]. (iii) Dynamic strategies: In these strategies, the BESS compensates for fast frequency deviations-i.e., discharging or charging in response to high deviations in frequencywhile also applying a time-dependent offset to the frequency control signal in order to drive the BESS SOC to within specified thresholds. A similar model uses a frequency setpoint that is based on a moving average of a pre-defined time window to determine the charging and discharging setpoints [15,16,29,32]. All variations of this method build the SOC restoration strategy into the frequency regulation settings. (iv) Model predictive control (MPC) strategy: In this strategy, the power system is characterized by uncertainties related to load forecasting, RES forecasting and system dynamics and, therefore, it requires input data that are capable of predicting such uncertainties. The MPC predicts control uncertainties (future events and operational changes) and makes appropriate decisions to minimize their impact on grid stability. MPC strategies are based on internal models and use optimization methods to fit the control variables to historical data over a specified time horizon. MPC has been used to predict near-optimal locations for where BESS should be sited in order to compensate for major disturbances [29,45]. This approach also helps to make timely and optimal decisions on grid operations, such as storing energy before peak times, altering the settings of a slow acting power plant or bringing additional power plants online in advance of dispatch [45].
Dynamic strategies are of particular interest compared to the classical frequency and deadband dependent strategies for the WAPPITS area, which is characterized by large fluctuations that are hardly manageable by BESS alone. The present work investigated alternative dynamic and restoration strategies that are able to optimize BESS behavior for balancing fast frequency fluctuations and compared them not according to economic criteria, as proposed in the majority of works, but in terms of technical feasibility and based on technical performance indicators.
More specifically, the objective of this paper is to contribute to the literature by (i) analyzing and highlighting the application and effectiveness of BESS in providing primary frequency control in the WAPPITS, (ii) analyzing the impact and effectiveness of previously studied BESS frequency control logic when applied to a weak grid system, (iii) analyzing SOC restoration logic that can ensure service continuity and effective frequency regulation and (iv) determining the optimal size of BESS installations in order to accomplish the goal in (i) by means of a combination of MILP optimization and a dynamic grid model. The analysis used the WAPPITS as a case study, represented as a simplified open-loop BESS/grid model that was developed in MATLAB/Simulink and driven by frequency measurements from the WAPPITS. This paper is organized as follows Section 2 presents an analysis of frequency trends in the WAPPITS; Section 3 introduces the proposed methodology; Sections 4-6 describe the development of a Simulink BESS simulation model, frequency and state of charge restoration controls; approach to estimate power imbalance of the grid, the MILP model and Section 7 presents the simulation results and discussion.

Statistical Analysis of Frequency Trends in the WAPPITS
The WAPPITS is currently composed of nine separate power systems that connect fourteen countries. The nominal grid frequency is 50 Hz, with an allowable frequency deviation limit of 200 mHz [12]. As stated earlier, the WAPPITS currently operates as three separate synchronous blocks, as shown in Figure 1. While it would be desirable to synchronize all of the blocks, global synchronization has been challenged by multiple problems, including significant frequency fluctuations within and between the blocks. Figure 1 depicts the frequency trend of the three synchronous blocks that was measured during a one-month period in the dry season [12]. The left panel in Figure 2 illustrates one month of data; the right panel shows data for four days. While shown together, note that each block records frequency at different sample rates (Block 1 at 60 s, Block 2 at 4 s and Block 3 at 10 s).

Synchronous Block 1
The frequency was measured over a one-month time period with a sampling time of 60 s. The frequency was within the acceptable target of 50 ± 0.2 Hz 16.9% of the time, the lowest in-control fraction of any block. This block also tended toward over frequency (83.0% of measurements) while it was underfrequency 0.15% of the time; the mean frequency was 50.3 Hz. The very unstable and chaotic variation in frequency and the bias in the mean frequency value could indicate the incorrect configuration of the primary frequency regulation services/assets within the block.

Synchronous Block 2
The frequency data for Block 2 were sampled every 4 s. The frequency fluctuated rapidly and chaotically and was not at the nominal frequency for the majority of the time. The probability distribution (Figure 3, center) was bimodal with modes at approximately 49.9 Hz and 50.1 Hz, which resulted in the frequency being within the ±0.2 Hz limits 85.1% of the time with a mean frequency of 50.08 Hz. When outside the acceptable range, the system tended toward over frequency (13.1%) rather than underfrequency (1.8%). The bimodal frequency distribution could indicate that secondary regulation was insufficient to restore the frequency to nominal.

Synchronous Block 3
The frequency was sampled every 10 s for one month. Similar to the frequency trend in the other two synchronous blocks, the frequency changed rapidly and showed some signs of instability, but with larger excursions than the other two blocks. The frequency was within the ±0.2 Hz limits 68.8% of the time. When outside the acceptable range, it was over frequency 26.6% and underfrequency 4.6% of the time. The mode of the probability distribution was at 50.1 Hz, which was within the acceptable operating range, with a mean of 50.09 Hz. While the frequency deviations appeared to be symmetrically distributed, the deviations occurred randomly with no obvious pattern for either time of day or day of month.
All three synchronous blocks of the WAPPITS showed fast oscillations in frequency, indicating inadequate or ineffective primary and secondary frequency control. Additionally, there was a higher probability of over frequency than underfrequency operations. The prevalence of over frequency operation could be caused by the grid operator overscheduling production or by load shedding schemes, which prematurely shed load and lead to excess generation. The rapid frequency oscillations might also be due to the improper implementation of primary and secondary frequency controllers in operational power plants and/or a lack of frequency control reserves in the WAPPITS to manage frequency. Finally, it should be noted that the high frequency spikes might be attributed to major faults in power distribution or the operation of underfrequency load shedding (UFLS) schemes that shed too much load in too short a period.
Given the deviations from the desired nominal behavior, one or more interventions would be needed to stabilize the frequency. Conventionally, this would be provided by proper contracting with, and control strategies for, conventional swing generators. However, it has been suggested that, because of the increasing RES penetration in the area, new BESS technologies could be installed to provide primary and secondary frequency regulation by relying on the fast dynamic response of BESS installations and incidentally using these systems to deal with the current frequency control issues.
This study considered the question of whether BESS is well-suited for this type of frequency control, given what is known about the frequency control issues within the WAP-PITS. The study addressed the need for a fast, first-order analysis to assess the potential of BESS deployments prior to a more in-depth, and costly, study of BESS sizing and displacement. This would include analyzing and identifying which BESS control strategies would provide effective regulation services, given what is known about the current frequency instability in the WAPPITS. The methodology used here could also be utilized to answer similar questions, e.g., planning for a rapid expansion of electric vehicles, prior to more detailed planning.

Proposed Methodology
The proposed methodology was used to assess BESS suitability for the provision of frequency control in the WAPP area. The model adopted consisted of three main modules as shown in Figure 6: 1.
Simulink BESS model: This module aimed to simulate, with an open-loop MAT-LAB/Simulink model, BESS behavior for frequency reserve provision in the WAPP area. Different parameters and control logics were tested to evaluate which would be the best BESS regulating strategy; 2.
Simplified grid model: By means of a simplified single machine model, the instantaneous power mismatch between generation and demand in the synchronous area was computed, taking the measured frequency deviations as the input; 3.
MILP model: This last module takes the BESS power provision with different control strategies, simulated in the first module, and the grid power imbalance as the input. By means of a mixed integer linear programming (MILP) model, the optimal size of batteries that should be installed in the system to compensate the power imbalances was identified.

Simulink BESS Model
To compare different BESS control strategies for primary frequency regulation, this study implemented an open-loop MATLAB/Simulink BESS model. The model evaluated the ability of BESS to provide frequency control services. The BESS was operating by itself, i.e., it was not connected to an external grid. The effectiveness of each control model was assessed (see Figure 7).
The analysis used the following assumptions:

4.
The input to the BESS controller was the frequency measurement time series that was collected from the WAPPITS grid. 5.
The frequency input was not affected by the power output of the BESS, i.e., detailed grid characteristics were not implemented in the model. This provided a fast method to simulate BESS behavior given a known grid behavior, allowing multiple control approaches to be explored at low computational cost. The results of this preliminary study will allow a down-selection of control approaches and a subsequent phase of this study will simulate the WAPPITS grid in order to understand the dynamic response of the grid to the BESS inputs. The following paragraphs describe the blocks that compose the Simulink model from Figure 6.

Primary Frequency Reserve Controller
The primary frequency reserve controller (PFRC) defined the power setpoint according to the PFRC requirements. The objective of the PFRC was to stabilize the system frequency at the nominal value by ensuring that the power balance was maintained in the grid. This analysis only simulated frequency control; operating reserves for contingency situations were not included. The controller followed a defined droop control model, as shown in Figure 8. The PFRC's input was the frequency measurements obtained from the WAPPITS. Based on the frequency deviation from the nominal frequency (∆ f = f − f nom ), the BESS injected or absorbed power according to the droop curve. The droop controller used the following parameters: • Deadband (DB), which is the range of ∆ f , where the BESS does nothing; • Droop (σ), which is the slope of the droop curve, assumed to be symmetrical for injecting and absorbing power for this analysis; • Regulation band (∆P max ), which is a dimensionless parameter defined as ∆P max = P reg P n where P reg is the regulating power, i.e., the contractual power that the battery makes available for PFRC P reg = [−P min , P max ], and P n is the nominal power of the battery. The droop value is expressed as: For this study, ∆ f , the input for the droop control curve, was computed using one of two methods. First, the classical approach (labelled "Logic A") calculated the frequency deviation as the near-instantaneous deviation of the frequency from the desired frequency (∆ f = f meas − f nom where f nom = 50 Hz). The second approach used a dynamic or sliding method ("Logic B") where the frequency deviation was computed relative to a moving average, over a given time interval, of the measured frequency (∆ f = f meas − f aver where f aver is a moving average over the given time interval).
The first approach was tested on the system with different deadband and droop values as a reference case. However, since the WAPPITS experiences large frequency oscillations and the mean frequency is biased toward over frequency, any practical BESS would have insufficient storage to compensate for the prolonged imbalance (excess generation) across the system. Therefore, the second model forces the BESS to compensate for the rapid frequency deviations while ignoring the long-term (typically high) bias in the system's frequency.
The definition of "rapid frequency variation" is set by the transfer function of the f aver calculation, a moving average filter that is applied to the previous N data samples. For a filter of this type, the transfer function is: where f s is the sampling frequency. As an example, for Block 2, the frequency was sampled at 10 s (0.1 Hz) and a 15-min (900 s) moving average implied N = 90. Taking the usual −3 dB as the filter roll off (half-power point), the moving average filter attenuates changes that happened more rapidly than 149 s by 0.5 or more. Subtracting ∆ f = f meas − f aver inverts the low-pass filter to a high-pass filter. Therefore, "rapid" in this example corresponded to system frequency excursions with (sampled) frequencies in excess of ≈7 mHz.
The implementation of this model on the BESS installations assumed that other control improvements would provide the necessary positive control to restore long-term mean system frequency to, at or near the desired nominal value for all frequency excursions happening slower than the cutoff frequency of ∆ f . Logic B was also tested with a range of droop and deadband values and, additionally, with a range of moving average windows.

SOC Restoration
Two SOC restoration strategies were also implemented:

•
Logic α: When BESS reached a minimum or maximum state of charge, the frequency control provision was interrupted and replaced by a charging or discharging current, at a pre-set C-rate, to restore the SOC to the operational range; • Logic β: This modified the ∆ f signal to make it proportional to the ∆ SOC: where G is a selected gain parameter.
Logic α, the classical restoration strategy, had the disadvantage of interrupting the BESS' service provision when the SOC fell outside of the operational range. Additionally, charging or discharging at the desired C-rate during restoration might be suboptimal relative to the state of the grid during restoration. Logic β overcame this disadvantage by conditioning the available BESS power to never (with the proper setting of G) allow the SOC to move outside of the operational range.

Empirical BESS Model
In order to provide realistic data, a proper BESS model was required. This study utilized the empirical BESS model described in reference [18] and was derived from the experimental measurements of a BESS for stationary application in JRC's Smart Grid and Interoperability Laboratory (SGILab) in Ispra (Italy). The experimental unit was a Li-ion nickel-manganese-cobalt (NMC) battery pack with a nominal energy capacity (E n ) of 570 kWh and a nominal power (P n ) of 250 kW.
The main parameters characterizing the BESS numerical model were: • Nominal power P n ; • Nominal energy E n ; • Nominal energy to power ratio (EP r ): EP r = E n /P n ; • Minimum/maximum SOC: SOC min , SOC max ; • A maximum C-rate, the discharge current normalized to battery capacity, function of SOC and of EP r , shown in Figure 9: Crate ,max ; Figure 9. The control surface of the BESS efficiency.
• A variable charging and discharging efficiency function of SOC and of the C-rate, as shown in Figure 10: η c and η d ; the figure, resulting from the experimental characterization of the battery pack, shows the value of battery round-trip efficiency when cycling with different C-rate values and SOC. Efficiency results were compromised at very low C-rate and extreme SOC values (above 80% and below 20%). The empirical BESS model simulated a quasi-steady-state operation by computing the energy flow to/from the battery and updating the state of charge at each time step. The model received the power setpoint P s from the PFRC as its input. P s was negative when the battery charged and positive when it discharged. Based on P s , the battery updated its SOC accordingly. The real power required from the battery was computed based on the charging and discharging efficiencies of the battery, which were a function of the SOC and the battery C-rate. The real power required from the battery was computed using the expression: The state of charge (SOC) variation of the BESS at each time step was given as The output power P out provided by the battery to the system was normally equal to P S and it was equal to 0 when the battery reached the SOC limits (SOC min , SOC max ); the maximum power output provided by the battery decreased when the battery was close to saturation and the maximum C-rate was lower than the nominal.
The model also calculated some metrics: (1) The regulating energy E PFCR, which is the total energy required by the frequency controller within a defined time interval (between the starting time (t s ) and ending time (t e )): (2) The energy provided by the battery to the system was computed as the integral of the output power (P out ): (3) The loss of regulation (LOR) indicates the amount of energy that the BESS was unable to provide. It was expressed as the ratio of the energy not provided by the battery to the regulating energy required from the BESS: (4) Number of full charge-discharge cycles N cycles:

Power Imbalance Estimation
The simplified grid model adopted to estimate the instantaneous power imbalance (P u ) on the national grid was based on a single synchronous machine dynamic model. The relation between the power imbalance and the frequency deviations is a function of the system inertia and the speed governor (i.e., frequency regulator) characteristics [50,51]. The model depended on the total capacity of active generators in the interconnected system (regulating energy G), the equivalent time constant of the system (T a ), the time constant of the speed governor (T 1 ), the transfer function equations for the speed governor and system inertia ( Figure 11). In the proposed approach, the frequency sampled in the WAPPITS was taken as the input and the corresponding power imbalance was calculated. The model was implemented and run in the Matlab environment. Figure 11. The single bus power system model.
The equivalent time constant of the system (T a ) was computed as the average of the time constant of each of the connected generators (T i ), taken from the WAPP data, and weighted according to their capacity (P i ). P tot was the total capacity of the generators connected to the system and Ngen was the total number of generators: The model allowed us to compute the per unit power imbalance ( . ∆P) starting from the measured per unit frequency deviation ( . ∆ f = ∆ f / f nom ). The power imbalance at each time step, expressed in watts, was then computed as follows: ∆P · P tot (11)

MILP Model for Optimal BESS Sizing
In this section, the simple MILP optimization model that was used to find the optimal size of the batteries to be installed in the system (P BESS ) is described. The goal of the model was to identify the quantity and optimize the size of the batteries to provide the maximum possible service to the grid whilst assuring that the power provided by the batteries could be accepted by the grid.
The input parameters were the power imbalance of the system at each time step P u,t , computed as described in the previous paragraph, and the per unit power output of the batteries providing primary frequency control in the system, according to the different control logics described in Section 6: . P out = P out /P n . The time interval of each timestep t (which was the only independent index) was subsequently set to 1 s.
The objective function (O f ), described in Equation (12), was the minimization of the absolute sum of the differences between the power provided by the total installed batteries and the total required by the grid at each time step t. The power provided by the installed batteries was given by the total installed capacity (P BESS ), the dependent variable of the problem, multiplied by the power provided by a battery with unitary power . P out .
Given the necessity of linearization, a new positive variable z(t) was defined and the model was expressed as: . P out,t · P BESS − P u,t ≤ z t (14) The model did not directly consider the BESS parameters. The parameters were already taken into account in characterizing battery behavior, as detailed in the previous Simulink model. The MILP model received the BESS power output as its input. This simplified the MILP optimization to achieve an optimal feasible solution.
The model was coded in Python language with the package pyomo and run with the academic license of the solver "gurobi".

Simulation Results and Discussion
This section presents the simulation results for the BESS performance assessment in the WAPPITS. The three modules of the proposed procedure were run for several scenarios considering different BESS PFCR control strategies. The frequency control logics (A and B) and system restoration logics (alpha and beta) were tested using the Simulink model (module 4.1). The results of the simulation helped to characterize battery behavior using one-month actual frequency measurements from the WAPPITS. The details of the simulations' settings are reported in Tables 1 and 2. A step function was used to pass from the 0.25 Hz sampling time to the 1 Hz time step of the simulations. The different control models were tested using the frequency measurements of Block 2, which were sampled at 4 s (the highest rate). The frequency behavior of Block 2 was more representative of the typical power system with some reasonable frequency control compared to the other blocks, which were sampled at 10 s and 60 s (lower rates). Given the similarities between the frequency trends of the blocks, the conclusions can assumably also be extended to Block 1 and Block 3.
The simulations were run for a battery with the same characteristics as that tested in the laboratory (EPR ratio of 2.28 h) but with a unitary nominal power P n of 1 MW to simplify the analysis. The regulating power of the battery P reg was the maximum available that was equal to (−P n , P n ). The SOC limits were set as: SOC min = 0; SOC max = 100. The numerical values of the variable efficiency and maximum C-rate were those reported in Figures 9 and 10.
After computing the power imbalance in the grid according to procedure 4.2, the optimal BESS size to be installed in the Block 2 area was estimated using the procedure of module 4.3. Each run of this last procedure corresponded to a different setting of the PFCR, previously simulated in Simulink.

PFRC Control Logic A
The BESS behavior was assessed by running the Simulink model with control logic A. Table 1 summarizes the scenarios (cases 1-9) that were analyzed based on a range of droop and deadband settings. The typical ranges of droop and DB that were used were selected from the ENTSO-E (European Network of Transmission System Operators for Electricity) area, as well as relaxed values, which were suggested as a reference for the WAPP region. Figures 12 and 13 show the results of the SOC over time and the SOC distribution, respectively, for each of the analyzed cases. The results using control logic A show that the battery saturated at 100% SOC in less than 3 h (around 10,000 s) in all analyzed cases without being able to discharge and hence, its role of providing services for primary frequency response was almost non-existent. The loss of regulation recorded was around 60% in all nine simulated cases. The observed battery behavior was due to the predominantly high frequency values recorded in the region. The results also show that neither the width of the deadband nor the droop values had much influence on the battery behavior. This can be seen from a comparison of the root mean square error (RMSE) values of the SOC profiles. The RMSE did not exceed 10% for scenarios with same droop but different deadbands (e.g., 1, 2 and 3) or for scenarios with same deadband but different droops (1, 4 and 7).

Frequency Control Logic B
The frequency control logic B was based on filtering the measured frequency in order to isolate the higher frequency variations from slower fluctuations, as described previously. Figure 14 shows an example of the fast and slow frequency fluctuations that were filtered from the measured frequency data. The study tested frequency control logic B with three different moving average windows sizes (600, 1800 and 3600 s) and three different droop values (0.075, 0.2 and 0.4). The scenarios (cases 10-18) that were analyzed are shown in Figure 14.   Figures 15 and 16 show the frequency control logic B simulation results for the SOC over time and the SOC distribution, respectively. Given the symmetrical frequency fluctuations to be compensated by the battery, it tended to discharge and reach SOC values of close to 0%. This was due to batteries' internal losses when charging and discharging (modeled by charging and discharging efficiencies), which resulted in a higher power output than input (such behavior will be fixed by adopting a proper SOC restoration strategy, i.e., logic α or logic β). The results also show that the droop values influenced the speed at which battery was discharged. For example, with a moving average window of 600 s, the time to reach 0% SOC passed from 15,000 s with a droop of 0.075 to 20,000 s and 30,000 s with droops of 0.2 and 0.4.  This trend was less visible when the moving average window was increased due to the higher amplitude fluctuations and the higher amount of energy that the battery had to provide. For example, the total energy requested by the PFRC from the battery during the test time period in case 18 was 253 MWh with a moving average window of 3600 s compared to 218 with a moving average window of 1800 s in case 15 and 152 MWh with a moving average window of 600 s in case 12. Consequently, while the BESS tended to stay at SOC < 20% (case 12) for 90% of the time with a small moving average window, this reduced to 50% in case 18. Since the purpose of the study was to analyze the ability of BESS to stabilize fast and small amplitude fluctuations, all subsequent analyses in this study utilized a 600 s moving average window. The average absolute value of power requested by the PFRC was 0.2 MW in case 12 compared to 0.3 MW in case 18.

SOC Restoration Strategies
The two SOC restoration logics previously described (α and β) were tested using a moving average window of 600 s. Logic α was simulated with different droop values and logic β was simulated with different values for the gain. Figures 17 and 18 show results of the SOC over time and the SOC distribution, respectively. The average SOC distribution in both cases was approximately 50%. The BESS did not saturate and thus, continuously provided the required service for the primary frequency response. For logic α, the BESS would need to be recharged to the target 50% SOC about 10 times per month. This is based on the assumption that the BESS is recharged at the nominal value. This results in a BESS unavailability of 23 h per month. For Logic β, the sum of relative differences between the power provided by the battery and power required to regulate the fast frequency oscillations increased as the gain increased. For example, 16% of the total power for case 22 compared to 5% for case 25 and 6% for case 20. The results show that this restoration logic effectively managed the SOC whilst also ensuring there was no interruption in the energy provision from the BESS for the primary frequency response.  The effectiveness of the proposed frequency control logics was also assessed on the basis of the number of cycles provided by batteries, the total loss of regulation and the energy provided to the system (proportional to the number of cycles).
For frequency control logic A, the loss of regulation was approximately 60% of the total energy required. The loss of regulation was not significantly influenced by changing the droop and deadband values. This is because the battery reached saturation. Frequency control logic B was comparatively responsive to a change in droop values. Changing the droop values could double the total number of cycles provided by the battery. For example, the number of cycles increased from 55 cycles in case 10 for a droop of 0.075 to 111 cycles in case 12 for a droop of 0.4. The loss of regulation was almost null in logic B compared to logic A (2% against 60%). A lower loss of regulation enabled the BESS to provide the required service for more than 95% of the time in all cases, with or without SOC restoration. Restoration logic α allowed the battery to work 99% of the time (actually, the remaining 1% was caused by the recharging period and, if this were accurately planned then it could be further reduced, e.g., in moments when the frequency is inside the deadband). This logic allowed an increase in the number of cycles that the battery was able to operate. For example, comparing cases with the same settings, the number of cycles was 89 in case 10 and 97 in case 19. Figure 19 shows the simulation results for the number of cycles, the loss of regulation and the energy provided by the battery to the system.

BESS Sizing
Given the measured frequency deviation on the grid, the active power imbalance was estimated by means of the model shown in Figure 9., with the parameters reported in Table 3. The values of T 1 and G were taken from the literature and corresponded to the typical values of hydro generators. T a and P tot were instead evaluated from the WAPP data. The results are shown in Figure 20.   The estimated power imbalance oscillated between a minimum of −50 MW and a maximum of 100 MW. The optimal size of the BESS in terms of power (P BESS ) and energy (E BESS ) that could supply such an imbalance, found by means of the minimization of power fluxes (as described earlier), is reported in Table 4 with each line corresponding to a different case. For the sake of simplicity, only the results for the moving average window of 600 s are reported. The non-supplied energy (NSE) indicator was computed as the difference between the installed batteries' energy output and the total energy requested by the system. This differs from the LOR since it depends not only on battery saturation, but also on the chosen battery size (when the installed BESS are too small, this indicator increases). The column called "NSE service" represents the NSE considering the total energy required by the specific control logic (A or B). Logic B had a lower required energy because it only required the regulation of faster fluctuations. "NSE tot" is the NSE with respect to the total power imbalance in the system (in the case of logic A, it was equal to "NSE service"). The last two columns show the percentage of NSE with respect to total energy required. For scenarios 1-9, where the actual frequency measurement was used as the input for the BESS model (control logic A), a relatively large battery size was required. This was due to the higher amplitude of oscillations that needed to be balanced. The total energy not supplied with respect to that required by the system was above 60% in all scenarios. When control logic B was applied (scenarios 10-25), the required battery size did not always change significantly from that of scenarios 1-9. Comparing the simulations with the same DB and droop settings: from scenario 1 to 10, the size of the battery was more than halved; for scenarios 4 to 11, the battery size reduced by 20%; and for scenarios 7 to 12, battery size remained almost the same. On the contrary, the energy not supplied relative to that required by the system to balance the fast oscillation reduced significantly. In case 1, the NSE was 68%, while it was 43% in case 10, 67% in case 4, 29% in case 11, 63% in case 7 and 23% in case 12. When a SOC restoration logic was applied, the battery size was further optimized and was able to reduce the NSE to a minimum of 19% in case 21, corresponding to restoration logic α and a droop of 0.4. The simulation results show that in order to have an optimally sized battery at a reduced cost with a lower NSE, the BESS should be designed with control logic B and a SOC restoration logic to ensure the effective provision of a regulation service. Figure 21 provides details of the behavior of the installed BESS with different control models when the droop = 0.2 and DB = 0.02 Hz. The installed battery was of a similar size (37,36 and 38 MW) and it was able to provide regulation for the fast fluctuations in all cases, until time = 2.667 × 10 5 (4 s). At that moment, in case 11, i.e., the scenario without SOC restoration, the BESS had a SOC of 3% and the C-rate was limited at 0.034 1/h. For this reason, there was a higher amount of NSE with respect to cases 20 and 24, where the SOC was still at 44% and the C-rate could reach 0.45 1/h. However, since power imbalances were higher than the installed BESS capacity in the three cases, the picture shows plateaus in the power output from time 2.667 × 10 5 (4 s) to 2.669 × 10 5 (4 s), which indicates that energy was not supplied. Instead of using the MILP model, BESS could have been sized to be able to respond to all power peaks, but this would have caused an oversizing of the system that would have resulted in a large capacity of the BESS not being fully utilized for the majority of time.

Conclusions
In this paper, the application and effectiveness of a Battery Energy Storage System (BESS) in providing primary frequency control reserves in the WAPPITS was analyzed. Based on numerical simulations that were performed using simple open-loop BESS modeled in MATLAB/Simulink, the paper analyzed two frequency controls and state of charge restoration logics for the better utilization, performance and effectiveness of BESS using actual frequency measurements from the WAPPITS.
For the BESS frequency control logic analysis, the simulation results show that the use of the moving average frequency control logic decomposed the frequency trend into fast, smaller oscillations and slow, wider oscillations with only the faster oscillations being regulated. This frequency control logic would be an effective way of using the BESS to provide regulation service in the WAPPITS, considering the existing frequency trend.
For the BESS SOC restoration strategy control logic analysis, the BESS charged and discharged quickly due to the chaotic nature of the frequency in the WAPPITS. The SOC restoration strategy, which was based on the change in frequency being proportional to the SOC, was effective in ensuring a guaranteed availability and a higher BESS regulating service continuity.
The simulation results also show that, with the existing frequency trend in the WAP-PITS, a BESS may not be the solution to the current frequency control challenges and, therefore, call for the need to put in place the necessary regulatory and technical frameworks that would require conventional power plants to provide some significant amount of primary frequency control. The deployment of BESS without solving the fundamental frequency control issues would be expensive, since huge BESS sizes would be required to provide the balancing services. This is shown by the results of the optimal BESS sizes established in the paper. A possible overreliance on BESS for frequency regulation in the WAPPITS would lead to an increase in battery average C-rate and BESS life cycles and the need to frequently replace the BESS.
A limitation of the present analysis is the use of discrete values for the parameters in the input to the Simulink model (e.g., the droop and deadband settings). A sensitivity analysis with a continuous variation of their values or a Monte Carlo sampling could be useful to further investigate the different control strategies. Moreover, this paper adopted an open-loop BESS model that is already present in the literature, without modeling the entire WAPPITS. Further analysis on the application and effectiveness of BESS will be carried out using a comprehensive power flow and a dynamic model of the WAPPITS.

Conflicts of Interest:
The authors declare no competing financial interests.