# Grid-connected inverter with virtual synchronous machine

Control demonstration of grid-connected converters to help maintain grid stability

## Introduction

Synchronous generators (SG) contribute to the transient grid stability through rotating mass inertia. An increased presence of grid-connected, converter-based, distributed energy resources (DER) has a negative cumulative impact on the transient stability characteristic of the power system. One solution to counter this problem is to modify converter control so that it can mimic the dynamics of a SG and provide virtual inertia. This application demonstrates a grid-connected inverter with the ability to act as a virtual synchronous generator (VSG).## VSG model

The VSG consists of an energy source, a converter, and a control mechanism. The VSG control block is based on the following the swing equations for SGs.

Swing Equation:

$\ddot{\theta}=\frac{1}{J}\left({T}_{e}-{T}_{m}-{D}_{p}\dot{\theta}\right)$

Electromagnetic torque:

${\mathrm{T}}_{\mathrm{e}}={M}_{f}{i}_{f}\u2329i,\stackrel{~}{\mathrm{sin}\theta}\u232a$

Three-phase generated voltage:

$e=\dot{\theta}{M}_{f}{i}_{f}\stackrel{~}{\mathrm{sin}\theta}$

Reactive power:

$Q=-\dot{\theta}{M}_{f}{i}_{f}\u2329i,\stackrel{~}{\mathrm{cos}\theta}\u232a$

where:

$\stackrel{~}{sin\theta}=\left[\begin{array}{c}\mathrm{sin}\theta \\ \mathrm{sin}(\theta -\frac{2\pi}{3})\\ \mathrm{sin}(\theta +\frac{2\pi}{3})\end{array}\right]$

$\stackrel{~}{\mathrm{cos}\theta}=\left[\begin{array}{c}\mathrm{cos}\theta \\ \mathrm{cos}\theta -\frac{2\pi}{3}\\ \mathrm{cos}\theta +\frac{2\pi}{3}\end{array}\right]$

Virtual inertia is proportional to the nominal power of the VSG divided by the maximum allowable rate of frequency change.

## Model description

The electromagnetic torque calculation and reference signals for the inverter are shown in Figure 3. The electromagnetic torque (left of Figure 3) is calculated using the Swing Equations described in the VSG Model section. The PWM reference signals are generated and routed to the inverter via the voltage of the DC link (VDC, shown in Inverter Voltage References at the right of Figure 3), the phi angle from the reactive power regulation loop (previously calculated in Reactive Power Regulation at the bottom right of Figure 2), and sine transformations (calculated in Trigometric Functions in the middle of Figure 3).

No. of processing cores | 1 |
---|---|

Max. matrix memory utilization | 32.13% |

Max. time slot utilization | 66% |

Simulation step, electrical | 1µs |

Execution rate, signal processing | 250µs |

## Simulation

- Transient of the active power response in the variation of the mechanical friction
coefficient (D) while the moment inertia is set to the value of J=0.3.
Higher values of D give a transient response that acheives the steady-state without overshoot (Figure 5, left). Lower values of D give an oscillatory response (Figure 5, center), where the steady-state is reached after 1s. With an optimal value of D, (Figure 5, right) the active power reaches the steady-state in 0.2s.

- Transient of the active power response in the variation of D while the moment inertia is increased to the value of J=0.8. This is the case for VSGs with a higher power rating.
- Transient of the active power response in the variation of the mechanical friction
coefficient (D) while the moment inertia is decreased to the value of J=0.1. This is the case
for VSGs with a lower power rating.
Figure 7: Transient response for J=0.1

Smaller VSGs have a small moment of inertia. The transient of the active power response can, thus, be smoother and can reach the referent value in a shorter period of time.

These examples show that within its given power rating, a converter-based DER can emulate the presence of various-sized SGs. Anyone interested in modelling and testing DER grid support by providing virtual inertia is welcome to use this model and send us their feedback.

This application example is included in the free Virtual HIL Device license and can be simulated on your PC. The Table 2 lists the file names and minimum hardware requirements needed to simulate the model.Table 2. Minimum requirements Files Typhoon HIL files examples\models\grid-connected converters\virtual sync machine inverter

virtual sync machine inverter.tse,

virtual sync machine inverter.cus

TyphoonTest IDE script examples\tests\102_virtual_sync_machine_inverter

test_virtual_sync_machine_inverter.py

**Minimum hardware requirements**No. of HIL devices 1 HIL device model HIL402 Device configuration 1

## Authors

The model featured in this application note was originally created by our academic partners. For domain-specific questions, the original authors of the application can be contacted directly:

- Prof. Felipe Bovolini Grigoletto ([email protected])
- Prof. Márcio Stefanello, ([email protected]), Federal University of Pampa, Brazil (UNIPAMPA).