## 2 Frequency and Active Power Control Schemes  
### Proposed Method  
The active power regulation scheme proposed in the paper is illustrated in Figure 1. The local BESS controller consists of two modules, the frequency regulation and the SOC control (in green). Links to the supervisory control and data acquisition (SCADA) system are shown with an orange dotted line; signals from the economic dispatch module (described in Section 3) are shown with a blue dash-dotted line. Figure 1: Proposed active power and frequency control scheme implemented locally (battery energy storage system-BESS) and centrally (automatic generation control-AGC). For simplicity, a single energy storage system is assumed in the schematic diagrams of this section and in the simulation results presented in Section 5. The control principles can easily apply when dealing with multiple independent storages, by applying the local BESS controller of Figure 1 to each unit, without any further change needed to the algorithms of the central AGC system or the economic dispatch module presented in Section 3. For this reason, the subscript \"bi\" is used in BESS parameters to include the general case of having more than one independently controlled battery units in the isolated grid. The output of the frequency control module, \(P^{*}_{bi,f}\), is formulated by the superposition of three terms: \(P^{*}_{bi,fcr}\) and \(P^{*}_{bi,ir}\) representing droop (\(R_{bi}\)) and inertia emulation (\(H_{bi}\)), respectively, and the AGC dispatch order \(P^{*}_{bi,age}\). Dispatch orders (\(P^{*}_{gi,age}\), \(P^{*}_{bi,age}\)) are formed by superposing secondary regulation terms (\(P^{*}_{gi,infr}\), \(P^{*}_{bi,aftr}\)) on the economic dispatch (ED) base points (\(P^{*}_{gi,ED}\), \(P^{*}_{bi,ED}\)). Although more sophisticated secondary regulation schemes are available in the literature [55], a standard AGC scheme is chosen here as a basis, to develop a method widely applicable, scalable and easy to implement. A time delay of 1 s is assumed in data transmission between regulating units and the AGC system, as noted in Table 12 of Appendix A. All necessary filtering, dead bands and rate limiters are omitted in Figure 1 for the sake of clarity, but are described in Table 12 of Appendix A, for reproducibility purposes. In Figure 1, parameter \(B\) stands for the bias factor (\(B=\sum\limits_{gi\in G}1/R_{gi}+\sum\limits_{bi\in ESS}1/R_{bi}\)), described in detail in [11; 55]. \(G\) and \(ESS\) are the sets of conventional units and storages, respectively. A proportional integral (PI) controller regulates the frequency deviation to zero. The total aFRR (\(P^{*}_{afr,tot}\)) is allocated to regulating units according to their participation factors \(p\!f_{gi}\) and \(p\!f_{bi}\), which sum to unity in both directions (upwards and downwards). Participation factors \(p\!f_{gi,ED}\) and \(p\!f_{bi,ED}\), determined in the scheduling process, are modified in real-time operation according to Equations (1) and (2) to account for the SOC regulation, as explained latter in this section. SOC needs to be supervised and regulated within its normal variation range, to avoid a detrimental effect on battery life, especially when BESSs participate in the provision of aFRR. In this paper's implementation, SOC is regulated within the economic dispatch process, as explained in Section 3, to ensure sufficient energy reserves for sustained FCR and aFRR provision, in an economically optimal manner. Nevertheless, battery safety dictates that SOC monitoring and regulation are also implemented at the local battery system level, modulating its output power as needed. To this effect, the term \(P^{*}_{bi,soc}\) is included in Figure 1, ensuring that SOC remains close to its reference \(SOC^{*}_{bi}\) using a proportional (P) controller.