3.2.2. VSG Control

At the same time, a parallel comparison is made between the proposed method and VSG. The VSG is implemented by inserting an extra voltage source inverter (VSI) supplied by a DC voltage source. The control algorithm is depicted by the block diagram shown in Figure 6. Similar to the swing equation of the SG, the virtual inertia and the virtual friction factor amplify the ROCOF and the frequency deviation, respectively. A corresponding electric power is thus generated to emulate the change of mechanical power of the SG in order to dampen the frequency transient. Here in the test, a virtual inertia J = 15 kgm2 and a friction factor F = 33 Nms are used to replicate the change of the mechanical torque. Therefore, the set point is the nominal mechanical angular frequency and the output is the set point of mechanical torque (both in SI values). Based on the mechanical angular frequency and the base values of the VSG shown in Table 2, the set point of the active power in pu value can be obtained which will be limited between [−1, 1] pu. Since the main focus is on frequency, the set point of the reactive power of VSG is set equal to zero. With set points of active and reactive power and the measured voltage, set points of c-d-axis and c-q-axis currents can be calculated. Feedback loops are controlled by PI regulators with *Kp* = 0.3 and *Ki* = 20. The outputs are set to the set points of c-d-axis and c-q-axis voltages in pu values limited between [−2, 2] pu. Feed-forward control is applied to compensate the voltage drop across the output filter. The regulators have been tuned by means of a trial and error procedure in order to obtain a fast and stable response by each control loop.

**Figure 6.** Control block diagram of the VSG.
