*4.2. Exposed Control Problem*

Taking a brief look at the CHIL test results reveals a power offset (shown in Figure 14), posing unexpected power flow in the grid. This roots in the fact that theoretical ancillary service was proposed under ideal conditions where the variables had infinite bandwidth, unit gain and zero latency. However, this is not valid in CHIL and in practice. As it is explained in the previous subsection, there are measurement devices between PCC and control system featuring limited bandwidth, delay and filtering effect. The PLL introduces phase delay and time delay as well. These weak points influence the precision of the phase angles based on which the voltages and currents are transformed from rotating values to static ones. The consequence inspires control system designers to consider the effect of the measurement chain in practical control design. In this case, the shifted phase angle caused by the non-ideal signal transmission procedure and the PLL can be corrected by means of equivalent delay compensation. However, it is worth noting that the signal transmission chain is a mix of absolute time delays and frequency-dependent phase angle lags. Frequency dependent lags are estimated at rated frequency, i.e., 50 Hz. After integrating the measurement delay into the control algorithm, the reactive power seen by the controller is almost identical to the measured value in the micro grid, as plotted in Figure 15.

**Figure 14.** CHIL PV; reactive power seen by the controller (maroon) and seen by the microgrid (black).

**Figure 15.** CHIL PV; reactive power seen by the controller(maroon) and seen by the micro grid (black) after compensation of the measurement chain.

#### *4.3. Final Test Results*

The simulation initiates from the steady state where the 175.8 kW–6.1 kvar load is connected to the PCC. The transients to be observed are induced by the connection and disconnection of the 27 kW–1.4 kvar load at 0 s and 10th s respectively. Figure 16 reports the CHIL test results in comparison with the offline simulation. The reference test case does not include the activation of any ancillary service. The results are marked as No AS CHIL and plotted in blue. The CHIL test results of the proposed Q/f ancillary service are marked as Proposed AS CHIL and plotted in yellow. The offline simulation test results are shown as well in order to compare the test between the offline simulation and CHIL. It is marked as Proposed AS Sim and plotted in red.

The CHIL test results prove that the proposed method is able to attenuate the frequency over-shooting caused by either the load connection or disconnection. In particular, the frequency undershoot is reduced by 0.15 Hz corresponding to an improvement of 27.3% considering that in the base case the undershoot is 0.55 Hz. Moreover, the overshoot is reduced by 0.14 Hz corresponding to 23.3% of the base case variation equal to 0.6 Hz. The ancillary service has a negative effect on the voltage transient as it was expected by the theoretical analysis: the voltage recovery process is prolonged, but the over-shooting peak is not significantly increased.

(**c**)PV reactive power transients;

**Figure 16.** Dynamic performances of the systems with (yellow) and without (blue) ancillary service in CHIL versus the ancillary service test results in offline simulation (red). ∗ pu values are obtained according to the base values of the synchronous generation system in Table 2.

#### **5. Conclusions**

This paper proposes a frequency-assisting ancillary service. It works in the context of modern micro grid with reduced inertia and it can be implemented in the distributed RESs. The proposed algorithm presents performances comparable to those of a traditional VSG in mitigating frequency transients due to load variations. Nevertheless, contrarily to VSG, the proposed service does not require energy reserve to be implemented since it does not affect the active power exchanged by the RES inverter with the grid. This represents an important added value of the proposed algorithm since it is implementable in all the RES devices distributed in the grid with almost null additional costs.

The ancillary service is explained theoretically by equations and verified in simulation. The performance is compared with that of the VSG method. Even though both of the ancillary services are able to achieve improvement on frequency transients, the working principles behind them are quite distinct and thereby, the requested types of power used for the ancillary services differ as well. Finally, a CHIL micro grid system is constructed to test the algorithm in an embedded system. However, it was noticed that without cautious consideration related to the non-ideal measurement and the delay caused by data processing, the control algorithm heads toward the performance deterioration and unexpected power loss. After modification, the ancillary service on processor proves to be effective on damping the over-shooting of frequency.

**Author Contributions:** Conceptualization, Y.H., S.B., L.P. and G.G.; methodology, Y.H., S.B., L.P. and G.G.; software, Y.H. and S.B.; validation, L.P. and G.G.; formal analysis, Y.H., S.B., L.P. and G.G.; investigation, Y.H. and S.B.; resources, L.P. and G.G.; data curation, Y.H. and S.B.; writing–original draft preparation, Y.H., S.B.; writing–review and editing, Y.H., S.B., L.P. and G.G.; supervision, L.P. and G.G.; All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflict of interest.
