> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/hypersim/examples/renewable-energy/pv-grid-support-functions.md).

# Photovoltaic Generation with Grid Support Functions

## Description

The **PV Generation Grid Support Functions** example, located in **File > Open an Example File > Renewable Energy**, demonstrates grid-following smart inverter grid-support functions in accordance with IEEE Std 1547-2018. A PV-fed two-level three-phase converter injects active and reactive power into a stiff AC voltage source representing the main grid.

The objective is to illustrate constant power factor control with reactive power priority and the inverter’s dynamic response to grid voltage variations, irradiance changes, and a ground fault.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-8f27536e5326b19faf76535b5b13836c17e874e3%2Fimage%20(1498).png?alt=media" alt=""><figcaption></figcaption></figure>

## Requirements

This example model does not require any additional hardware or licenses.

## Detailed explanation

The system uses a two-level three-phase converter connected to a stiff AC voltage source (main grid). On the DC side, a PV array supplies power. In the Model\_control subcircuit, a PV Controller block emulates maximum power point tracking (MPPT). Its output generates a normalized duty cycle that drives a boost converter. A DC voltage chopper follows the boost stage, and the DC-link capacitor (C3) at the chopper output smooths the DC input to the two-level converter. The converter receives its duty ratio from smart inverter controllers. An LCL filter at Bus 3 attenuates high-order switching harmonics. The filter output connects to the load at Bus 2 and the main grid at Bus 1.

The Model\_control subcircuit uses four grid-following (GFL) blocks from the Control Smart Inverters library:

* [**GFL Signal Conditioning Three-Phase (GFLSIC\_1)**](broken://pages/9aa6413d67d5c455088ffc1656a4aac35e99ff89) measures and conditions signals to per-unit values for the controller.
* [**GFL Secondary Control Three-Phase (GFLSC\_1)**](broken://pages/81614462f9f71c541771335d6dbc0751ba11a0fd) generates active and reactive power references to implement the IEEE Std 1547-2018 grid support functions \[1].
* [**GFL Primary Control Three-Phase (GFLPC\_1)**](broken://pages/6b6f19cd0f93a853e2f8228542e9412f395ea4e2) produces reference signals for the active and reactive components of the output current.
* [**GFL Wave Reference Three-Phase (GFLWR\_1)**](broken://pages/1ce5cb80eebb8821d9856a5d99d826f73a30fb45) generates the reference to drive the converter. With the average converter model used in this example, the reference is the duty ratio.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-1a71e279fe4e881d3d2a4b2d321a3883cf3e4a78%2Fimage%20(1499).png?alt=media" alt=""><figcaption><p>Montrol control</p></figcaption></figure>

The GFL Secondary Control block is configured to regulate a constant power factor of 0.95 with reactive power injection priority. The Event\_control subcircuit creates the scenarios and synchronizes them with the POW.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-4a056c5c24410e20e0a93d9a8fcca668e2e6241e%2Fimage%20(1500).png?alt=media" alt=""><figcaption><p>Event control</p></figcaption></figure>

The model applies the following dynamic changes to assess controller performance under varying grid conditions:

1. At t = 10 s, a 0.05 pu step increase is applied to the grid voltage from its nominal value.
2. At t = 13 s, a 0.05 pu step decrease returns the grid voltage to nominal.
3. At t = 16 s, PV irradiance changes from 1000 to 500 W/m2.
4. At t = 19 s, PV irradiance changes from 500 to 700 W/m2.
5. At t = 23.0008 s, fault Flt2 introduces a ground fault on load R4.
6. At t = 23.1 s, the breaker opens to disconnect load R4.
7. At t = 23.10145 s, the fault is cleared.
8. At t = 23.13478 s, the breaker closes.

## Simulation and results

To present the scenarios from steady state, data logging starts at 5 s; results before 5 s are not recorded.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-01ebee43899270664757d4b1a9069f699b555007%2Fimage%20(1501).png?alt=media" alt=""><figcaption><p>Simulation results</p></figcaption></figure>

At the beginning of the simulation, active power is slightly curtailed to maintain apparent power at 1 pu due to increased reactive power from the Constant Power Factor (CPF) function. At t = 5 s, a grid voltage change causes a small disturbance in power injection and power factor, which tracks the 0.95 reference adequately. At t = 11 s and t = 14 s, irradiance changes introduce larger power factor disturbances, but the controller returns the power factor to the 0.95 reference. Although irradiance decreases, the Pr signal remains at 1 pu because it limits the MPPT; actual power injection is constrained by available irradiance.

At t = 18.0008 s, a ground fault occurs on the grid side, causing a significant increase in grid currents. At t = 18.1 s, the breaker opens to clear the fault. After reclosing at t = 18.13478 s, the voltage recovers quickly while the current exhibits transient oscillations before stabilizing.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-280e2b7569783d6900712ca7437f94575dae774f%2Fimage%20(1502).png?alt=media" alt=""><figcaption></figcaption></figure>

## References

\[1] IEEE, "IEEE Standard for Interconnection and Interoperability of Distributed Energy Resources with Associated Electric Power Systems Interfaces," *IEEE Std 1547-2018 (Revision of IEEE Std 1547-2003),* no. doi: 10.1109/IEEESTD.2018.8332112, pp. 1-138, 2018.

{% hint style="danger" %}

## **Intellectual Property Disclaimer**

**Natural Resources Canada owns all intellectual property rights** in the Smart Inverter Modelling Toolbox software and related products.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/hypersim/examples/renewable-energy/pv-grid-support-functions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
