## 1 Introduction  
As the renewable energy sources (RES) penetration level increases, frequency deviations are more frequent because of the inherent uncertainty of solar and wind sources. As RES are typically connected to the grid through a power electronic inverter, substituting the conventional power plants with power electronic inverters will decrease the inertia of the power system. Long-term renewable energy integrations studies show that the rise in renewables could call for increased levels of frequency control [1; 2; 3]. Frequency control is included in the ancillary services necessary to guarantee the quality of supply and stability in the power systems [4]. In particular, it assures the real-time balance between electricity generation and demand. Energy storage systems (ESS) are capable of providing different services to the electric grid: peak shaving, load leveling, spinning reserve, capacity firming, up to frequency regulation. Above all, batteries are well suited to provide balancing services and fast frequency response because of their short response times. Therefore, the share of battery energy storage systems (BESS) in the frequency regulation market is rapidly increasing [5] thanks to the rapid decrease in battery investment cost and to the increase in renewable energy generation. Many of the utility-scale batteries around the world provide innovative ancillary services to the power system. In Alaska, the electricity utility installed a 3 MW/750 kWh lead-acid battery system into an island system, as spinning reserve, in order to mitigate the curtailment of energy from wind farms and to provide frequency response within 0.5 s [6]. In this way, diesel Gensets have been limited. In Illinois, a 31.5 MW battery storage was located near a wind farm project and solar plant to provide fast frequency response as well as other ancillary services. Similarly, Australia's energy market operator contracted Tesla's 100 MW/129 MWh lithium-ion battery in Hornsdale. This battery was considered the largest ESS when it was built and it provides frequency control and participates in the ancillary services market (ASM) [7]. In Germany, it was recognized that battery energy storage systems (BESS) can play an active role in providing fast frequency response: in 2017, BESS systems provided about 200 MW of Frequency Containment Reserve (FCR), about 31% of the market. In Italy, to date, only significant thermal and programmable hydroelectric plants (i.e., larger than 10 MVA) compulsory provide ancillary services. Recently, a general reform of dispatching services was proposed: in the meantime, several pilot projects have been defined, such as the one aimed at opening the ASM for resources not already enabled (these resources could provide ancillary services per unit or via aggregate) [8; 9; 10]. Furthermore, in order to exploit the batteries' capability to provide very quick and accurate response power, transmission system operators (TSOs) are reviewing their network codes to test and introduce innovative ancillary services also suitable for ESS. For example, in the UK, in 2016, National Grid conducted an enhanced frequency response (EFR) tender under which it contracted eight battery storage facilities for four years to provide rapid response frequency reserves with high technical requirements on response speed (within 1 sec) [11]. In 2019, the Italian TSO launched a public consultation to introduce and test fast primary frequency control regulation, named Fast Reserve service, with a response time of 1 s [10]. FCR in European markets must be delivered continuously during the contracted period (Article 156 of System Operation Guidelines) [12]. This is a problem for an asset featuring a limited energy reservoir (such as a battery), because when it is completely charged or discharged, it can no longer provide a symmetric service and faces penalties (that can even lead to exclusion from the market).