Performance Assessment of Grid-forming and Grid-following Converter-interfaced Battery Energy Storage Systems on Frequency Regulation in Low-inertia Power Grids

—Power systems with large shares of converter- interfaced renewables may be characterised by low grid inertia due to the lack of frequency containment provided by syn- chronous generators. Battery energy storage systems (BESSs), which can adjust their power output at much steeper ramping than conventional generation, are promising assets to restore suitable frequency regulation capacity levels. BESSs are typically connected to the grid with a power converter, which can be operated in either grid-forming or grid-following modes. This paper quantitatively assesses the impact of large-scale BESSs on the frequency containment of low inertia power grid and compares the performance of grid-forming and grid-following control modes. Numerical results are provided considering a detailed dynamic model of the IEEE 39-bus system where fully characterized models of stochastic demand and generation are taken into account. In order to assess the performance of the BESS control modes in a practical operative context, daily long simulations are considered where reserve levels for frequency containment and restoration are allocated considering the current practice of a transmission system operator in Europe. Numerical analyses on various metrics applied to grid frequency show that grid-forming outperforms grid-following converter control mode.

Abstract-Power systems with large shares of converterinterfaced renewables may be characterised by low grid inertia due to the lack of frequency containment provided by synchronous generators. Battery energy storage systems (BESSs), which can adjust their power output at much steeper ramping than conventional generation, are promising assets to restore suitable frequency regulation capacity levels. BESSs are typically connected to the grid with a power converter, which can be operated in either grid-forming or grid-following modes. This paper quantitatively assesses the impact of large-scale BESSs on the frequency containment of low inertia power grid and compares the performance of grid-forming and grid-following control modes. Numerical results are provided considering a detailed dynamic model of the IEEE 39-bus system where fully characterized models of stochastic demand and generation are taken into account. In order to assess the performance of the BESS control modes in a practical operative context, daily long simulations are considered where reserve levels for frequency containment and restoration are allocated considering the current practice of a transmission system operator in Europe. Numerical analyses on various metrics applied to grid frequency show that grid-forming outperforms grid-following converter control mode.

I. INTRODUCTION
P OWER systems are going through the transition from a significant share of conventional power generation to massive renewable resources interfaced by power electronics. Renewable power generation levels larger than 15% of the overall annual electricity generation is now a reality for several European countries [1]. In Australia, the total wind and solar capacity is rapidly increasing and has reached 20% in the National Electricity Market (NEM) [2]. In the United States, the installed capacity of renewable generation has reached 20% of the total generation capacity at the national level, with peaks over 40% in the grids of the Western Electricity Coordinating Council (WESS) and California Independent System Operator (CAISO) [3]. Y As broadly acknowledged in the power systems community, a large deployment of converter-interfaced generation determines lower grid inertia levels and calls for a review of frequency containment concepts and the identification of assets capable to maintain the power balance. In fact, some power systems are already facing this control challenge. The Australian Energy Market Operator (AEMO) has observed that lower frequency containment provided by generators results in a lack of effective control of frequency under normal operating conditions [4]. Consequently, the lack of consistent and certain frequency containment delivered from conventional power plants has impacted AEMO's ability to effectively plan the system reserves. CAISO has also observed a progressive deterioration of its frequency containment and restoration performance: the frequency response measure (FRM 1 ) has steadily decreased from 263 MW/0.1 Hz in 2012 to 141 MW/0.1 Hz in 2016 [5].
In this context, converter-interfaced battery energy storage systems (BESSs) are advocated as a potential solution for grid frequency regulation (e.g., [6]) thanks to their large ramping rates, high round-trip efficiency and commercial availability [7]. Recently installed large BESSs, like the 100 MW/129 MWh unit of the Hornsdale Power Reserve (HPR) in Australia [8] and the 300 MW/1200 MWh unit at Moss Landing in California [9], have shown the applicability of this technology in practical contexts.
As BESSs can provide significant value to both frequency containment and restoration services, quantitatively evaluating their performance is of fundamental importance for transmission grid operators. To the best of the Authors' knowledge, very few researches have attempted to quantitatively assess the impact of BESS converter control strategies on the grid frequency using a detailed model of a realistic low-inertia power system. The work in [10] studies the impact of a BESS on grid frequency transients using a dynamic model of a simple lowinertia grid. However, the BESS is modeled as an ideal power source and falls short of capturing the dynamic interactions between the converter and the grid. In [11], BESS's and grid's dynamic models are used to show that the BESS can reduce frequency oscillations after a disturbance. Nevertheless, this work only assesses the post-disturbance performance of BESS under a single system operation point. Yet, [10] and [11] have not considered the possible influences of different converter controls. In this context, this paper contributes to the current state of the art by explicitly modelling the BESS dynamics and comparing grid-forming and grid-following control strategies.
The simulation framework used in this paper is based on the one proposed in [12]. It consists of a detailed dynamic model of the low-inertia 39-bus power system hosting conventional and renewable power generation and converterinterfaced BESS. In this paper, this model is coupled with a day-ahead schedule layer so as to statistically evaluate the daily system frequency containment via 24-hour long timedomain simulations. In order to reproduce a realistic grid operative scenario for the numerical analyses, power reserves for frequency containment and restoration are allocated following the procedure adopted by a transmission system operator (TSO). This stage, also described in the paper, leverages a unit commitment formulation fed by forecasts of renewable generation and demand computed with state-of-the-art methods.
The contributions of this paper are listed here below. 1) Propose a comprehensive benchmark framework, that comprises a day-ahead schedule layer with procedures nowadays adopted by TSOs and a day-long real-time operation stage that provides a way to assess the frequency containment performance of power systems under daily operation. 2) A comprehensive simulation model of a low-inertia power grid that includes detailed dynamic models of all the devices in order to obtain the dynamics that are not captured by simplified models. Particularly, we consider the dynamic interactions between the low-inertia power grid and the converter-based BESS, and the closed-loop dynamics between the converter and the battery DC voltage model. 3) Quantitative comparison of the impact of grid-forming versus grid-following converter-interfaced BESS on the system frequency containment via suitably-defined frequency metrics. The rest of the paper is structured as follows. Section II presents the state of the art on converters' control. Section III describes the adopted frequency control strategies. Section IV describes the simulation framework and power reserves allocation. Section V illustrates the study cases and simulation results, and Section VI concludes the paper.

II. STATE OF THE ART ON CONVERTERS' CONTROL
There are generally two main approaches to achieve the power control for power converter-interfaced units: gridfollowing and grid-forming controls [13]- [15]. Here below we recall the definitions of grid-following and grid-forming controls proposed in [13].
In a grid-following converter, the current injected by the converter is controlled with a specific phase displacement from the grid voltage at the point of common coupling (PCC). As a consequence, the knowledge of the fundamental frequency phasor of the grid voltage is needed at any time for the correct calculation of the converter's reference current, whose amplitude and angle with respect to the grid voltage phasor are properly modified by outer control loops so as to inject the required amount of active and reactive power or control the RMS voltage.
In a grid-forming unit, the magnitude and angle of the voltage at the PCC are controlled. As a consequence, the knowledge of the fundamental frequency phasor of the grid voltage at the point of connection is not strictly necessary. Depending on the characteristics of the network to which the converter is connected, an isolated system or a slack bus, it is possible by means of additional outer loops to adapt the injected instantaneous active and reactive power also to provide voltage and frequency support. In an isolated system, a grid-forming unit could behave itself like a slack-bus. When connected with other power sources, through an inductive line, the grid-forming converter is controlling the active power by the modification of the angle. The voltage magnitude is independent of the active power control.
In contrast to the grid-following control whose concept has been widely accepted, several variants of control laws allowing the grid-forming capability have been recently proposed [16]- [18]. Some new controllers have been proposed to make the converter behave like synchronous machine, e.g. Virtual Synchronous Generator (VSG) [19]- [21], Virtual Synchronous Machine (VSM) [22], [23], VISMA [24], Synchronverter [25], [26], droop-based control [27], [28]. Some of those controllers (e.g., VSG and VSM) use a Phase Locked-Loop (PLL) to decouple the power control from frequency control capability, while the droop-based controls are PLL-free. The benefit of using PLL-free controls is to avoid the stability issues caused by PLL and possibly the interaction between the PLL and power controller [29]. Another recently introduced gridforming control law is the Virtual Oscillator (VOC) [30], [31]. It provides a way to synchronize and control the converter by acting as a non-linear oscillator. This control may be more advantageous in case of voltage unbalance and distortion due to its non-linear characteristics. However, its robustness of interacting with the grids, that comprise various generation resources (i.e., the mix of synchronous generations and powerelectronics devices interfaced generations), has not yet been properly studied and may be the subject of future studies. In this context, the droop-based PLL-free grid-forming control proposed in [28] is considered in this paper as it has been proved to be robust on a wide range of short circuit ratio (i.e., 1.2 to 20) as well as under contingency analysis in low-inertia power grids [12].

III. IMPLEMENTED FREQUENCY CONTROL STRATEGIES
A. Power converter controls 1) PLL-free grid-forming converter control: a grid-forming converter controls the magnitude and angle of the voltage at its terminals, thus linking the active power exchange with the angle difference between the modulated voltage and the grid voltage at PCC. In this context, the estimate of grid voltage angle is necessary and can be achieved in two ways: by using a PLL or directly linking the active power exchange to the angle difference between the grid and the modulated voltages to create a PLL-free controller.
We opt for the PLL-free grid-forming control proposed in [28]. This control layout, highlighted in blue Fig. 1, is an effective and simple scheme that allows the converter to synchronize with the grid and provide the frequency containment. Specifically, the frequency droop coefficient m p corresponds to the active power-frequency p f droop coefficient. The reactive power compensation with droop n q adjusts the voltage magnitude reference according to the difference between actual reactive power output and the reference reactive power. A first-order low-pass filter with cut-off frequency ! LP is added to avoid fast frequency variations imposed by the control of the converter's terminal and filter out the power measurements noise; a lead-lag filter with time constants T 1 and T 2 is applied to the power measurements to improve the converter dynamics [32]. It is worth noting that in the adopted gridforming control, a virtual impedance is included in order to keep the control as it was proposed in the original MIGRATE project report [28]. However, the virtual impedance is only activated to limit the current under over-current condition (e.g. short-circuits). Under the normal operating conditions we tested, it is not activated. 2) Grid-following converter operated with grid-supporting mode: the grid-forming control adjusts the modulated voltage with respect to the grid voltage at PCC, whereas the gridfollowing control adjusts the injected power with respect to the grid voltage at the PCC. As shown in Fig. 2, the gridfollowing converter controls the values of active and reactive power by controlling the amplitude and phase of the injected current with respect to the grid-voltage at the PCC. In this case, a three-phase PLL is required to estimate the fundamental frequency phasor of the grid voltage, so as to generate the instantaneous value of the current reference and, eventually, the voltage reference. In this regard, the active and reactive power are controlled independently.
The grid-following converter is operated with gridsupporting mode by adding higher-level frequency and voltage droop regulators. The active power is regulated according to the f p control gain K following f p , as the frequency deviates from the reference value. The reactive power is regulated according to the v q control gain K following v q , as the difference between the measured voltage and the voltage reference exceeds the dead-band of V tr . Fig. 3 illustrates the PLL with moving average filter (MAF) from [33] used for tracking the fundamental phasor of grid voltage at the PCC. It consists of a phase detector, a loop filter and a voltage controlled oscillator. The loop filter includes a frequency-adaptive MAF and a PI controller so as to enhance the PLL's filtering capability [34]. The time window length, T wd , of the frequency-adaptive MAF is adjusted online according the frequency variation as T wd = 1/f g , wheref g is the PLL estimated frequency. The parameter w LF is the cut-off frequency of the low-pass filter applied to reduce the oscillation off g , which is used by both the frequency-adaptive MAF and upper-level frequency regulator.  B. Frequency controls in synchronous generators 1) Frequency containment and restoration regulation: the synchronous generators provide both frequency containment and frequency restoration, as shown is Fig. 4. The parameter R p is the static droop coefficient for frequency containment, T s is the integration time constant for the frequency restoration regulation, w ref is reference frequency (i.e., nominal frequency), w meas is measured actual frequency, P set is the power set-point scheduled for the generator, and P ref is the power reference for the turbine-governor system.

PWM
2) Hydraulic turbine and governor system: As it will be detailed in Section IV-E, the low-inertia 39-bus power grid includes only hydropower plants, being thermal generation replaced by wind power [12]. The adopted governing system for hydropower plants is shown in Fig. 5 and is from [35]. It consists of a PI governor, a servomotor, and a non-linear turbine-water column model that accounts for the effects of varying flow on the effective water starting time. Parameters k p,gov and k i,gov are the proportional and integral gains of the PI governor, k a and T a are the gain and time constant of the servomotor, and T w the water starting time of the hydro water column.
The values of the parameters presented in this section are listed in Appendix A.

C. Sensitivity Analysis
We conducted a sensitivity analysis of the system frequency response with respect to the critical converter control parameters. Two critical controls parameters that have a major impact on the control of the converters are studied: the p f droop coefficient (f p control gain) and the cut-off frequency of the low-pass filter 2 . The sensitivity of the system frequency response to these parameters is studied on the same low-inertia 39-bus power grid presented in Section IV-E. To excite the converter control response, we simulated a large contingency: the outage of G4 (i.e., tripping of 300 MW generation power).
In order to be in line with the p f droop coefficients (f p control gains) adopted in the 24-hour long simulation cases in Section V, the same p f droop coefficients (f p control gains) are selected in the contingency tests, namely, 2% (225MW/Hz) and 1% (450MW/Hz). As for the cut-off frequency of the low-pass filters, it should be tuned in a range that is wide enough while also insuring controls' stability [28], [34]. To this end, the cut-off frequency is tuned in the range   Fig. 7 show the system post-contingency Rate-of-Change-of-Frequency (RoCoF) for the p f droop coefficients 2% (f p control gain 225MW/Hz) and 1% (f p control gain 450MW/Hz), respectively. The RoCoF is computed as the discrete first time derivative of the system frequency 3 with time difference t = 20 ms. The fact that the RoCoF instead of frequency is used as an index for comparing different cases, is to better highlight the differences in post-contingency system frequency performance. On one hand, for both grid-forming and grid-following controls, the case with lower p f droop coefficient 1% (higher f p control gain 450 MW/Hz) exhibits higher RoCoF than the case with higher p f droop coefficient 2% (lower f p control gain 225 MW/Hz). This is consistent with the expectation that the lower p f droop coefficient (higher f p control gain) leads to larger amount of active power injected by the converter into the power grid, thereby allowing improved system frequency containment. On the other hand, with the same p f droop coefficient (f p control gain), the cut-off frequency of the low-pass filter also affects the performance of the converter controls. For the grid-forming control, reducing the cut-off frequency increases the postcontingency RoCoF, whereas for the grid-following control, reducing the cut-off frequency decreases post-contingency RoCoF. In the grid-forming control, the equivalent inertia constant is represented by the term 1 2mp! LP [28], whereby the frequency is better contained with lower ! LP as it corresponds to higher equivalent inertia. In the grid-following control, the higher ! LF for the low-pass filter in PLL allows to capture faster frequency dynamics, therefore enabling the converter to react faster to the frequency decreasing after the contingency.
In this respect, the cut-off frequency of the low-pass filter that allows the best converter contribution to the system frequency containment has been adopted, i.e., 5 Hz for the grid-forming control and 25 Hz for the grid-following control. From Fig. 6 and Fig. 7 it can be seen that, overall, the gridforming control outperforms the grid-following control for both the cases with p f droop coefficients 2% and 1% (f p control gains 225MW/Hz and 450 MW/Hz). Nevertheless, in the condition where the grid-forming control adopts an unfavorable cut-off frequency while the grid-following control uses an advantageous one, the grid-forming converter may not outperform the grid-following converter.

A. Framework structure
The proposed simulation framework has two layers: realtime simulations and a scheduling stage. The former is used to evaluate the performance of the converter controllers by analysing the whole grid dynamic behavior. The latter allows to size power reserve requirements and reproduce realistic operative scenarios for the real-time simulations. Fig. 8 illustrates the overall simulation process, where L and W denote measurements of power demand and wind generation, respectively. The process starts with dividing the measurements into two subsets, one for training the forecasting and model, and one to feed the real-time simulations. Measurements and forecasts are discussed in IV-B.
Accordingly, the demand profile denoted by the sequence L={l 1 , l 2 , ..., l n } is separated as L 1 ={l 1 ,l 2 , ...,l n 24 } and L 2 ={l n 23 , l n 22 , ..., l n }, and the wind generation profile denoted by the sequence W ={w 1 , w 2 , .., w m } is separated as W 1 ={w 1 ,w 2 , ...,w m 24 } and W 2 ={w m 23 , w m 22 , ..., w m }. 4 L 2 and W 2 are directly applied to the RTS to be reproduced in the day-long simulations. At the day-head schedule layer, L 1 and W 1 are sent to the forecasting models (described in Section. IV-B) to obtain the demand and wind generation forecasting results, which are then used to compute the frequency restoration reserve, with the procedure described in Section IV-C. Additionally, L 1 is also used for computing the frequency containment reserve as is considered as 10% of peak load (described in Section IV-C). Then, a unit commitment model determines an optimal hourly generation and reserve schedule accounting for the demand and wind generation forecasting results, the frequency containment and restoration reserves, as well as the power network and operational constraints (detailed in Section IV-D). Eventually, the RTS executes simulations of the dynamic models of the low-inertia 39-bus power grids which are implemented with the realistic demand and wind generation profiles (i.e., L 2 and W 2 ) and the energy generation and reserve schedules provided by the unit commitment model.
It is worth to note that, in the low-inertia 39-bus power grid, all the devices (including type-III wind power plants, synchronous generators, converter-interfaced BESS and frequency and voltage-dependent dynamic loads) are fully modelled in time domain to make the simulations as close as possible to the realistic scenario. Moreover, the converter is modeled by switching devices (i.e., IGBT and Diode) in order to adequately capture the dynamics due to the interaction between the grid-forming/grid-following converter and the system frequency. In view of the high computational complexity and the microsecond-scale time-integration step required by the high sampling frequency devices (i.e., Pulse Width Modulation (PWM) generator of the converter and Phase Measurement Units (PMUs)), we choose to adopt a real-time simulation platform. All dynamic models used for the simulations are built in MATLAB/Simulink and executed in an OPAL-RT eMEGAsim real-time simulator. For the sake of reproduciblilty, all the models are open-source available online [36].
The demand and wind generation forecasting, the system reserves allocation, the unit commitment model and the dynamic models of the low-inertia 39-bus power grid are described in the following sub-sections.

B. Measurements and forecasting
Although it is not a specific contribution of this paper, forecasting stochastic generation and demand is a necessary element of the process and thus briefly discussed here below. 1) Wind power: wind production measurements are at a 1second resolution and coming from two real wind farms with a nominal capacity of 17 MW and 50 MW. Measurements are scaled proportionally to match the capacity of the four wind farms considered in the case study (i.e., 1500 MW, 1200 MW, 750 MW and 600 MW). Forecasts are computed in terms of prediction intervals, which express the range where the realization is predicted to happen at a certain confidence level, and thus are the suitable format to evaluate reserve requirements. For the reasons that will be discussed in IV-C, the target confidence level is 99.8%. Prediction intervals of wind generation are computed with a quantile regression forest model from the existing literature [37], [38] trained on historical numerical weather predictions and plant production data. Fig. 9 shows the day-ahead hourly wind forecast and the corresponding prediction intervals at 99.8% confidence level. 2) Power demand: the active power measurements are adapted from a monitoring system based on PMUs installed in the 125 kV sub-transmission system of Lausanne, Switzerland [39]. Reactive power is computed assuming a constant power factor for the loads. Since the demand level of Lausanne is smaller than the demand level of the IEEE 39-bus benchmark power grid, the measured load profiles are scaledup to match the rating power of the 19 loads in the 39bus power grid. Specifically, 7 different demand profiles (i.e., corresponding to measurements at different network buses of Lausanne) and their combinations are used such that the scaled-up profiles for the 19 loads are all different. Forecasting is based on a Seasonal Auto Regression Integrated Moving Average (SARIMA) model with seasonality order of 24 hours, seasonal AR order of 5 (non-zero terms at lags 1, 2, 3 and 5), AR order of 1, MA order of 18 (non-zero terms at lags 1, 6 and 18), and a trend difference order of 1. Fig. 10 shows the day-ahead hourly demand forecast and the corresponding 99.8% prediction intervals.

C. System reserves
Power reserves for frequency containment and restoration are calculated referring to the norms of the Swiss national TSO, Swissgrid. Both are allocated as symmetric products and calculated as described next [40], [41].
1) Frequency containment reserve: typically, national TSOs within a large interconnected system procure reserves for frequency containment proportionally to the size of their systems. Swissgrid, as the Swiss TSO within the electricity grid of continental Europe (UCTE), procures reserve as the pro rata of its maximum load compared to the total UCTE one [42]. Since our low-inertia 39-bus power system is assumed to be non-interconnected, we set the frequency containment reserve as 10% of the peak load, ±500 MW, using the deterministic notion proposed in [43].
2) Frequency restoration reserve: ENTSO-E operation handbook recommends attaining zero frequency error with a probability of 99.8% [44]. According to this principle, and since grid imbalances are caused by stochastic generation and demand, we size the power reserve for frequency restoration considering 99.8% prediction intervals of the wind generation and power demand. Fig. 11 shows, in addition to the 99.8% prediction intervals of wind and demand already discussed, the allocated power reserve for frequency restoration. The total positive, R + h (negative, R h ), reserve at hour h is the sum of the upper (lower) quantile of the wind and demand prediction intervals. However, since the power reserve is symmetric, the applied total secondary frequency reserve at each hour is

D. Unit commitment for generation and reserve scheduling
We formulate a security constrained unit commitment (SCUC) model for generation and frequency containment and restoration reserves scheduling based on the DC power flow. This model is used as a replace of the day-ahead market set-up to schedule the active power profiles. The BESSs are treated here as an additional frequency regulation service provider. For the sake of a fair comparison in the results section, they are not included in the SCUC (where only synchronous generators are included) because this would determine different operating conditions for the generators, making it difficult to compare the dynamic system performance in the cases with and without the BESS. As a matter of fact, the exclusion of the BESS in the SCUC produces the same boundary conditions on the system allowing to quantify the impact of the BESS on the system dynamics.
The objective is to minimize the economic cost of energy generation and reserve procurement considering the power network constraints, operational (security) constraints, load and renewable energy generation forecast, and reserve requirements. The SCUC model is given in (1). The SCUC model (1) is a mixed integer linear programming problem [45]. p min gn  p gn,t + p r gn,t  p max gn (1l) The objective cost function Cost uc includes the energy generation cost (linear) E cost , generator start-up cost (linear) Up cost , generator shut-down cost (linear) Dw cost and reserve cost Rev cost . ⌦ = {p gn,t , u on n,t , u up n,t , u dw n,t } is the set of decision variables. n is the cost parameter of energy generation. C up n,t , C down n,t , C reserve n,t are the cost parameters of generator start-up, shut-down and reserve. p gn,t is the energy generation of the generator at bus n and time step t. p dn,t is the active power load forecast. p l,t is the active power flow of transmission line l. A(n, l) is the network matrix with A(n, l) = 1 if n is the sending end of transmission line l and A(n, l) = 1 if n is the receiving end of transmission line l. G n is the shunt conductance at bus n. As we are using the DC power flow, the voltage amplitudes are assumed equal to 1 p.u. for all the buses. Constraint (1e) is the active power balance equation. Constraint (1f) is the DC power flow equation. p l,t is the power flow through the transmission line l at time step t. ✓ s l,t , ✓ r l,t are the voltage phase angles at the sending end and receiving end of transmission line l. u on n,t is the unit commitment variable. u up n,t is the unit start-up variable. u dw n,t is the unit shut-down variable. Constraint (1g) is the ramp-rate bound. Ramp up n,t , Ramp dw n,t are the upper and lower bounds of generators' ramp rates. Constraint (1h) is the relationship among the generator start-up, shut-down and in-operation variables. Constraint (1i) is the bound of start-up and shutdown variables. Constraint (1j) is the requirement of total reserve which is equal to the sum of frequency containment and restoration reserves computed in Section IV-C. Constraint (1k) is the bound for active power generation. Constraint (1l) is the bound of reserve (plus energy generation). Constraint (1m) is the bound of power flow of the transmission line. Constraint (1n) is the phase angle stability bound for all (non-slack bus) generators compared with the slack bus generator. N slack is the set of slack bus generator. N P V is the set of nonslack bus generator. Constraint (1o) is the phase angle bound for all transmission line for security consideration. For the unit commitment variables, u on n,t , u up n,t , u dw n,t = 1 means the generator is in-operation, start-up action and shut-down action, respectively. Otherwise, u on n,t , u up n,t , u dw n,t = 0 means the generator is off-operation, no start-up action or shut-down action.

E. Low-inertia IEEE 39-bus power grids
The low-inertia power system considered in this work is derived from the IEEE 39-bus benchmark system, where four synchronous generators (one thermal power plant and three hydro power plants) are replaced with four wind farms. The detailed description of the model is given in [12]. For clarity, its main features are summarized here. The configuration of the low-inertia 39-bus system is shown in Fig 12. Its inertia constant (referred to a 10 GW base and obtained by summing the inertia constant of all the conventional power plants) has decreased from 7.84 s of the original grid to 1.98 s. Conventional generators are simulated with a sixthorder model for the synchronous generator, a prime mover and governor model [46], and an excitation system associated with an Automatic Voltage Regulator (AVR) [47]. Each wind farm is simulated by scaling up a detailed model of a Type-III wind turbine, including a sixth-order order model for the doublefed induction generator (DFIG) and the averaged model for the AC/DC back-to-back converter [48]. Available power measurements from the wind farms are assumed to be the mechanical power on the turbine shaft. This is done in order to retain a detailed dynamic modelling representation of interactions among the wind turbines and the power grid. Loads are reproduced with a three-phase frequency and voltagedependent EPRI LOADSYN load model [49] associated with the input power demand measurements. For the BESS, we consider a single system with a power rating of 225 MVA and energy capacity of 175 MWh. Its model consists of the battery pack and a four-quadrant DC/AC power converter, as shown in Fig. 13. The battery pack is simulated with a threetime-constant equivalent circuit model with SOC-dependant parameters, reported in Table I. The arrows in the table imply that theses values vary linearly with the SOC in the indicated range. We use the model proposed in [50], [51] for a Lithium-Titanate-Oxide battery, assuming a 2s156p ( 5 ) configuration of the battery packs (with identical parameters) feeding a single DC bus. The power converter is modelled in detail at the level of the switching devices.
The BESS power rating (approx. 5% of the peak demand) is chosen so as to be of meaningful size for the system. The BESS's energy capacity is chosen as a function of the power rating of the power converter. Commercially available BESSs are commonly designed so that they may be fully charged or discharged in between 30 minutes to 2 hours (according to the C-rate limitations of the cells).

A. Case studies
For the purpose of comparison, we test five cases over 24hour long simulations, where the same generation and reserve schedules obtained from the SCUC are reproduced. Fig. 14a and Fig. 14b show the generation and reserve schedules determined for the day of operations. Table II lists the five cases tested over the 24-hour long simulations. Case 1 is the base configuration with no BESS.
Case 2 and Case 3 feature a BESS connected to the low-inertia power grid via a PLL-free grid-forming converter with the p f droop coefficients of 2% and 1%, corresponding to the f p control gains of 225 MW/Hz and 450 MW/Hz, respectively. Case 4 and Case 5 are the two cases where the BESS is connected to the low-inertia power grid through a gridfollowing converter with f p control gains of 225 MW/Hz and 450 MW/Hz, respectively. For the sake of brevity, in the following of this section we also use f p control gains for the grid-forming converter.

B. Metrics
In order to quantitatively evaluate the frequency containment, the following metrics are used.
• Frequency Probability Density Function (PDF), identified using the 24-hour frequency measurements from the 19 simulated PMUs (with a reporting rate of 50 frames per second) located at 19 load buses [52].
where L is the number of loads and N is the total sampling number of frequency measurements for each load. • Relative Rate-of-Change-of-Frequency (rRoCoF): where f pcc is the difference between one grid frequency sample and the next (once-differentiated value) at the bus where the BESS is connected to, P BESS is the oncedifferentiated BESS active power, and t is the sampling interval. The frequency PDF and IFD measure grid frequency deviations from the nominal value and are used to assess frequency containment performance. The rRoCoF measures the RoCoF regulation at PCC weighted by the delivered active power of the BESS and is used to compare the performance of gridforming versus grid-following converters.

C. Results and discussions
This section presents and discusses the simulation results for the 5 cases listed in Table II. Fig. 15a shows the system frequency for the 5 cases. In the zoomed region, we show the grid frequency dynamics at the beginning of the 15-th hour, where a considerable frequency deviation happens. The cases with a higher f p control gain attain more frequency containment because of the larger regulating power provided, as visible in the zoomed region of Fig. 15b. While Fig. 15 provides a general view of the system frequency responses, the defined metrics allow a better scrutiny of the control performance and will be described next.

1) IFD:
The IFD results in Table III shows that the case without BESS (i.e., Case 1) scores the highest IFD. In Case 2 and Case 3, IFD decreases by 11.0% and 20.3%, respectively, compared to Case 1. In Case 4 and Case 5, IFD decreases by 10.0% and 18.7%, respectively. This is in accordance with the expectation that the higher f p control gain (i.e., 49 450 MW/Hz) provides more frequency containment, therefore reducing deviations of the grid frequency.
2) PDF: Fig. 16 shows the PDF estimated from the frequency measurements on the 19 loads. The PDF results are consistent with the value of IFD, demonstrating that the higher control gain results in smaller standard deviation and higher probability at 50 Hz. By comparing Case 2 and Case 4, the two cases with the lowest f p control control gain, we can observe that the grid-forming and grid-following converters achieve an equivalent increment of performance for frequency containment. After examining the values of IFD and PDF standard deviation for Case 3 and Case 5, we can observe that, for a higher f p control gain, the grid-forming converter performs better than the grid-following converter, achieving a 2% reduction of IFD and 1% reduction of PDF standard deviation.
3) rRoCoF: Fig. 17 illustrates the Cumulative Density Functions (CDFs) of rRoCoF for the larger and smaller f p gains for both grid-forming and grid-following converter. For the smaller gain in Fig. 17a, the grid-forming converter performs better than the grid-following converter as it achieves lower RoCoF per Watt of regulating power. The standard deviation of rRoCoF for Case 2 and 4 are rRoCoF case2 = 0.0016 and rRoCoF case4 = 0.0065, respectively. Fig. 17b shows that also for the larger gain, the grid-forming converter performs better than the grid-following as it achieves smaller frequency rates. In this case, the corresponding standard deviations of rRoCoF are rRoCoF case3 = 0.0013 and rRoCoF case5 = 0.0064 for Case 3 and 5, respectively. Fig. 18 shows the evolution in time of the BESS state of charge (SOC). It is interesting to observe its decreasing trend, that, since the average grid frequency along the day is 50 Hz due to the frequency restoration action, is to ascribe to power losses on the AC-and DC-side filters. Thanks to the high fidelity of the dynamic models, we are capable to numerically quantify the impact of converter controls on the SOC evolution. Since the energy losses are proportional to the apparent power S BESS = p P 2 BESS + Q 2 BESS , Table III reports the integral of the BESS apparent power over the 24 hours of the simulation.
On one hand, the PDF of frequency (therefore the active  power of BESS) is more dependent on the droop setting. As we compare Case 3 vs Case 2 or Case 5 vs Case 4, we do observe that the cases with the high control gain 450MW/Hz correspond to higher apparent power due to converter's higher active power output than in the cases with the low control gain 225MW/Hz. Therefore, for the same control law, we observe a larger SOC decrease in the case with higher control gain. On the other hand, the grid-following unit exhibits a higher apparent power throughput than in the case of grid-forming unit due to its converter's higher reactive power output, as shown in Fig. 19. The grid-following converter provides higher reactive power because of its voltage-reactive power (v-q) regulator, which supports the grid voltage by injecting reactive power as the grid-voltage varies. Conversely, the grid-forming unit adjusts the converter's voltage magnitude to limit the reactive power deviation from its reference value, therefore reducing the impact of grid voltage variation on the reactive power exchange. In this paper, the full-replica dynamic model of the lowinertia 39-bus power grid has been used to assess the performance of grid-forming and grid-following converter-interfaced BESS in enhancing frequency containment regulation. In order to reproduce a real operational scenario, frequency containment and restoration reserves are allocated with the same margins and procedures adopted by TSOs nowadays. To this end, a SCUC problem embedding prediction intervals from real forecasters of wind generation and electric demand is formulated. Based on the SCUC schedule, we run 24-hour long dynamic simulations reproducing the real outcome of the stochastic wind generation and demand (both from highresolution measurements at a 1-second resolution). In the simulations, we compare the performance of 5 cases: no BESS, BESS with grid-forming converter small (225 MW/Hz) and large (445 MW/Hz) f p gains, and BESS with grid-following converter with same gains.
The results quantitatively verified, by means of suitablydefined frequency metrics, that the grid-forming control strategy outperforms the grid-following one achieving better frequency containment and lower relative RoCoF. Simulations also quantitatively demonstrate that large-scale BESSs are capable of significantly improving the system frequency containment, and the level of improvement is proportionally related to the level of f p gain. Table IV lists the values of the parameters in the frequency controls that are applied in the low-inertia -39 bus power grid.