**1. Introduction**

Renewable energy sources (RESs) are of strategic importance and crucial to the sustainability of energy production from an environmental point of view. They are playing an important role in distribution networks [1,2] transforming them from passive to active [3], and representing a challenge for power planning and operation [4,5]. The increasing penetration of RESs, which are usually interfaced with static power converters, reduces the inertia of the electric network, so issues related to stiff frequency transients and oscillations arise and the immunity against faults and disturbances is weakened [6,7]. Nevertheless, RESs themselves are foreseen to play a major and decisive role in maintaining the reliability and stability of the grid in the future [8]. Moreover, the idea to divide the distribution networks in several small zones capable of self-regulating can help to overcome those issues. These kinds of partitioned networks, which are called microgrids, are well reviewed and classified in [9]. The photovoltaic (PV) system is one of the most representative RESs, which takes an active part in the construction of these modern grids. Therefore, the grid codes of many countries have requested for PV systems' cooperation in case of faults and transients [10,11]. Another important aspect is related to the management of both active and reactive power among different sources and loads. This aspect is crucial for microgrids that can operate both in grid connected mode and in islanded mode [12]. In any case, among the most popular control strategies, which also help for the stability of the network, there are the well-known droop-based controls. These kinds of control are

very powerful because they can deal with different sources; they are flexible and can be used both in high voltage (HV) lines and low voltage (LV) distribution lines. In HV lines, it is well-know the assumption for which it is possible to decouple the frequency and voltage controls by acting on the active power (P/f) and reactive power (Q/V), respectively. This assumption is valid because in HV lines the inductive effect is predominant on the resistive one. On the contrary, in LV lines, where the resistive effect is the predominant one, the two droop controls can be exchanged each other having the P/V control and Q/f control [13–16]. In general, both effects are coupled. In particular, in the medium voltage lines the inductive and resistive effects are comparable, therefore, it is not possible none of the two assumptions. In this case, to decouple the problem it is possible to use the orthogonal linear rotational transformation matrix from the active and reactive actual powers to the modified ones as reported in [17]. Another way to decouple the two droop-controls, also considering the harmonic current in case of non linear loads, is through the usage of the virtual impedance [18–20].

Focusing, in particular, on the frequency stability of networks in which it is valid the assumption of predominant inductive effect, several approaches and control techniques have been studied and proposed. They can be categorized into two main groups: active power based frequency controls and reactive power based frequency controls. The active power based frequency controls are the most common used because they are related to the assumption itself of P/f and Q/V decoupling controls [21]. In this case, static reserves such as battery storage units can be dispatched to provide fast response when the system is under serious or peak load conditions [22,23]. Frequency-oriented advanced converter control algorithms, such as the virtual synchronous generator (VSG), are also viable methods tackling those problems [4,24,25]. They can be either provided by specific equipment or integrated into RES systems. In the former case, the energy reserve is utilized as a backup so it does not contribute to the nominal capacity. In the latter case, the availability of the VSG service could be restricted by ambient conditions; therefore, in order to ensure the service in any condition, auxiliary battery energy storage systems can be added to the RES [26]. The presence of additional equipment implies increased budget and complexity. In [27], the frequency-active power curve is studied and integrated into PV systems focusing on the curtailment, dead band and droop. Again, the droop-like control is limited by solar radiation and the efficiency of the PV systems is reduced. Ochoa [28] proposes an innovative control for wind system by shifting the maximum power point tracking (MPPT) to an optimized power point tracking, so that the power generation curve versus the ambient condition is smoothed. In this way, the wind farm contributes to the power grid capacity. Moreover, due to its self-regulating feature, it is not sensitive to grid conditions. All these methods present a common drawback related to the necessity to have an energy reserve to be implemented. For this reason, even if the active power based frequency controls are the most studied for the above-mentioned reasons, also the reactive power based frequency controls have been analyzed as well. It is worth nothing that, even if we are in the case in which it is valid the P/f and Q/V controls for the steady state power management, it is possible to use the reactive power during the transients to dump and help the frequency stability [29–35]. The first developed tools were the so-called power system stabilizers (PSSs) that act directly on the exciters of the synchronous generators (SGs) damping both the local and inter-area frequency oscillations [29,35]. Recently, thanks to the wide spread of the well-kwon flexible alternating current transmission systems (FACTSs) the supplementary damping controllers (SDCs) have also been developed [30–35]. Both the PSSs and SDCs provide an additional voltage signal to the voltage reference of the exciters of SGs or FACTSs. This signal is related to the frequency deviation. In order to avoid the influence of the voltage reference signal at the steady state regulation a washout filter is usually employed [34]. These methods, acting on the exciters of synchronous generators or on voltage references of FACTS are usually not really fast and, mainly, can be implemented only in few points of the grid.

Unlike the aforementioned previous researches, in this paper it is proposed a method based on a simple reactive power based frequency control carried out by RESs without introducing any additional reserve or reducing the active power efficiency. Moreover, no additional voltage reference is employed. For this reason, the proposed method can be applied in any RES converter, spreading the service in the grid and improving, in this way, its effectiveness.

Taking the PV system as an example, its excessive capacity design makes it possible to generate or absorb a considerable amount of reactive power also at the peak hours. The capacity of the PV inverter is defined according to the maximum evaluated solar irradiance of the day. However, the inverter is not used at its maximum power during the whole day. Indeed, it stands partially idling in most of the daytime and completely idling after the sunset. Therefore, the active power produced by the PV can be controlled according to MPPT while exchanging reactive power. For this reason, the proposed control, based on exchanging reactive power to smooth frequency transients can be implemented without affecting the main PV control (i.e., MPPT). In the following, the proposed ancillary service will be shortly indicated as *Q/f* control.

In order to evaluate the effectiveness of the proposed ancillary service, it is firstly tested by means of numerical simulations. Frequency transients and the consumed power for this service are illustrated. For proving the hypothesis based on which the ancillary service is proposed, significant internal variables of the synchronous generator (SG) are shown as well. Moreover, a comparison between the proposed method and the VSG method is carried out focusing on the working principles, performance, cost effectiveness and practicability. Then a controller-hardware-in-the-loop (CHIL) platform is set up based on which, the ancillary service is tested in real time.

The paper is organized as follows: Section 2 reports the theoretical aspects of the proposed ancillary service; Section 3 demonstrates the effectiveness of the ancillary service in simulation and the comparison with the VSG method; Section 4 describes the performance of the algorithm in CHIL highlighting the related issues and suggesting appropriate solutions; finally Section 5 draws the conclusions.

#### **2. The Proposed Ancillary Service**

#### *2.1. Scope and Comparison with VSG*

Advanced control strategies, such as virtual inertia generation, are studied and implemented on grid-tied inverters to mitigate the stiffness caused by lack of inertia technologies. Virtual synchronous generators usually are implemented using a reference for the active power dependent on the virtual inertia, the virtual friction factor, the frequency and the rate of the frequency change (ROCOF) while the set point of the reactive power is obtained by the voltage regulator. This method partially compensates the fast active power variations of the loads during transients and thus gives less pressure to SG's governor to recover the frequency. The differential component ROCOF makes the active power loop respond to the frequency change earlier; however, as a consequence, it can bring instability concerns. VSG can be carried out by the highly integrated RESs. RESs are expected to work at the MPPs which are determined by ambient conditions and therefore, the MPPs can be taken as the output active power of VSG at steady state. When frequency goes below the setpoint, VSG is required to provide fast active power response greater than the MPP and the amount over MPP must be supported by other reserves. These reserves serve the transients but do not contribute to the capacity of the network.

The purpose of the proposed ancillary service is to alleviate frequency transients without either introducing additional power reserves or sacrificing the maximum active power generation. This is achieved, in this paper, by relating the grid frequency to the reactive power *Q* exchanged by the RES inverter with the grid itself.

The main idea is to change the voltage across the terminals of the SG with a consequent variation of the electromagnetic torque developed by the machine. In order to achieve this objective, the reactive power can be utilized. Indeed, while the excitation system fixes the rotor flux, controlling the reactive power it is possible to change the stator flux and, consequently, the machine torque. Acting on the torque, it is possible to modify the speed transient of the SG and, as a consequence, the grid frequency transient. Therefore, a relationship between grid frequency and reactive power can be implemented in the inverter control for a transient assisting purpose. Frequency transients are due to unbalance between prime motor torque and electromagnetic torque. When electrical load increases, the electromagnetic torque increases and, while the prime motor adjust its torque, the machine speed decreases and so does the frequency. For this reason, when, for example, the grid frequency drops below its set point, the proposed ancillary service makes the inverter to absorb reactive power reducing the stator flux and limiting the increasing of the electromagnetic torque mitigating the speed transient. Finally, the proposed service is implemented by means of a linear relationship between the reactive power absorbed by the inverter and the frequency deviation from the rated value.

Table 1 summarizes and compares the features of the VSG method and the proposed *Q/f* method. *J* is the virtual moment of inertia; *F* is the virtual friction factor; *ω* is the electrical angular frequency; *v* is the voltage; *p* is the number of pole pairs. *P*∗ and *Q*∗ are the active and reactive power set points of the ancillary service control loops. In the VSG method, the fast change of the load power is compensated by a third entity, i.e., the VSG.


**Table 1.** Features of VSG and the proposed Q/f method.

In order to achieve a low-pass filtering effect on the change of the electromagnetic torque, the proposed method must be faster than the governing and excitation systems of the SG. Mostly, both systems are much slower than the power electronic devices.

It is worth noting that, in low voltage distribution grids with low X/R ratio it is not possible to decouple the frequency and voltage regulation using active and reactive power respectively. In those cases, a cross-coupled regulation of active and reactive power is used to regulate frequency and voltage [36]. Nevertheless, for grid connected PV plants, active power is usually injected to support microgrids during frequency transients [37]. Moreover, it has to be highlighted that, the proposed service is a *fast-transient* service. Indeed, the regulation proposed has its positive effect in the fast transient when, usually, excitation systems of synchronous generators are not yet capable of working. A sort of secondary regulation leading the reactive power to zero after the frequency transient can be designed. In this paper, for sake of simplicity, this possibility has not been investigated.
