> 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/wind-grid-support-functions.md).

# Wind Generation with Grid Support Functions

## Description

The **WT Generation Grid Support Functions** example, located in **File > Open an Example File > Renewable Energy**, models a grid-following wind generation system that injects active and reactive power into a weak AC grid.

The objective is to demonstrate grid support functions, including voltage regulation with reactive power priority, under voltage sags/swells and wind speed variations in accordance with IEEE Std 1547-2018.

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

## Requirements

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

## Detailed explanation

A three-phase two-level inverter interfaces the system with the grid and regulates active and reactive power exchange with an AC voltage source representing a weak grid. On the DC side, a 13.2 kW synchronous generator (SG) produces AC power as a function of wind speed. A three-phase diode full-bridge rectifier converts the SG output to DC, followed by a boost converter. The boost converter control and the pitch angle controller operate in synchrony to hold speed at 1 pu and extract maximum power; see \[1] for additional details. The primary active power control method in the *Primary Control* block is set to “DC link,” maintaining the DC link voltage at its reference by drawing the required active power from the DC link capacitance.

On the AC side, an LCL filter at Bus 2 attenuates high-order harmonics produced by switching. The filter output connects to the main grid at Bus 3.

The GFL\_Control subcircuit uses four blocks from the Control Smart Inverters library:

* [**GFL Signal Conditioning Three-Phase (GFLSIC\_1)**](broken://pages/9aa6413d67d5c455088ffc1656a4aac35e99ff89) measures required signals and converts them to per-unit values.
* [**GFL Secondary Control Three-Phase (GFLSC\_1)**](broken://pages/81614462f9f71c541771335d6dbc0751ba11a0fd) generates active and reactive power references to implement grid support functions per IEEE Std 1547-2018 \[2].
* [**GFL Primary Control Three-Phase (GFLPC\_1)**](broken://pages/6b6f19cd0f93a853e2f8228542e9412f395ea4e2) produces the 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 signal to drive the two-level converter. In this model an average converter is used, so 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-061833230a112176f76c2ad993de0d3f178eaa25%2Fimage%20(1504).png?alt=media" alt=""><figcaption><p>GFL control</p></figcaption></figure>

The GFL *Secondary Control* block is configured to hold the grid voltage at nominal by dispatching reactive power, with reactive power prioritized over active power. The controller takes no corrective action while the grid voltage remains within a per-unit band around nominal. For deviations outside the acceptable range, it adjusts reactive power to compensate.

The Event\_control subcircuit generates the following scenarios, synchronized by the POW:

1. t = 5 s: 0.1 pu grid voltage sag.
2. t = 7 s: grid voltage returns to nominal.
3. t = 9 s: 0.1 pu grid voltage swell.
4. t = 11 s: grid voltage returns to nominal.
5. t = 13 s: 0.02 pu grid voltage sag.
6. t = 15 s: grid voltage returns to nominal.
7. t = 17 s: 0.02 pu grid voltage swell.
8. t = 19 s: grid voltage returns to nominal.
9. t = 21 s: wind speed increases from 9 m/s to 11.5 m/s.

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

## Simulation and results

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

At t = 5 s, the 0.1 pu sag prompts the controller to inject reactive power and quickly compensate the voltage deviation. At t = 7 s, when the grid returns to nominal, the controller stops exporting reactive power. At t = 9 s, the 0.1 pu swell causes reactive power consumption, which ceases at t = 11 s when voltage returns to nominal. At t = 13 s and t = 17 s, the 0.02 pu sag and swell remain within normal operating limits; therefore, the controller takes no action and reactive power dispatch stays unchanged. At t = 21 s, the wind speed step from 9 m/s to 11.5 m/s increases active power, while reactive power remains unchanged due to decoupled active/reactive control.

## References

\[1] J. J. S.-G. W. W. P. a. R. W. D. N. W. Miller, "Dynamic modeling of GE 1.5 and 3.6 MW wind turbine-generators for stability simulations," in *2003 IEEE Power Engineering Society General Meeting*, 2003.

\[2] 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/wind-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.
