> 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/rt-lab/simulink-blocks-reference/smart-inverter-library/gfm-reference-generation-three-phase.md).

# GFM Reference Generation Three Phase

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-33f0818c285b797ce1b6fbc6a7d4b667d4db4990%2FCSI_RT_GFM_ref_generation_3P_block.png?alt=media" alt="" width="120"><figcaption></figcaption></figure>

The \*\*GFM Reference Generation 3-phase\*\* block, located in the \*\*Smart Inverter Library\*\*, produces the reference control signal that drives a three-phase, two-level grid-forming (GFM) inverter. Its output can connect directly to a three-phase two-level inverter modeled as an “average model (Uref-controlled)”. If the inverter is modeled with “switching devices,” use an intermediate Pulse Width Modulation (PWM) block.

The block conditions the d–q control signal from upstream controllers based on the inverter’s nominal input DC and output AC voltages and the selected modulation index. It limits the peak value of the control signal, compensates for phase-angle deviation caused by a sample-time mismatch between Powergui and this block, and aligns the final phase angle with the cosine-based Park transformation used in the Signal Conditioning block.

{% hint style="danger" %}
This block requires a valid license on both the simulator and the workstation with the feature SMART INVERTER enabled.
{% endhint %}

Operation overview:

1. Compute the modulation index (MI) from the measured DC voltage and the inverter’s nominal AC voltage.
2. Update the d–q reference using: $$V\_{dq} = \frac{ V\_{dq-ref}}{ MI}$$ .
3. From the updated d–q values, compute per-phase amplitude and phase:

$$
V\_x = \sqrt{V\_d^2 + V\_q^2} \\
\\
θ\_x = atan(\frac{V\_q }{ V\_d})
$$

4. Generate the final control signals:

$$
v\_{refa} = V\_a · sin(ωt + θ\_a + θ\_x + θ\_{correction})\\
v\_{refb} = V\_b · sin(ωt − \frac{2π}{3} + θ\_b + θ\_x + θ\_{correction}) \\
v\_{refc} = V\_c · sin(ωt + \frac{2π}{3} + θ\_c + θ\_x + θ\_{correction})
$$

Here, $$θ\_x = \frac{π}{2}$$ because a cosine-based Park transformation is used in the Signal Conditioning block, and $$θ\_{correction}$$ compensates for the sample-time mismatch.

## Mask parameters

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-b59294825b442d84421a0bf423ff87325a1eacba%2FCSI_RT_GFM_ref_generation_3P_mask.png?alt=media" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="190">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Nominal Operating Voltage</strong></td><td>Nominal RMS line-to-line AC voltage of the grid-forming converter (V)</td></tr><tr><td><strong>Nominal Frequency</strong></td><td>Nominal AC frequency of the grid-forming converter (Hz)</td></tr><tr><td><strong>Maximum Modulation Index</strong></td><td>Maximum modulation index of the control signal; sets the peak value of the control signal (pu)</td></tr><tr><td><strong>Nominal DC voltage</strong></td><td>Nominal input DC voltage of the inverter (V)</td></tr><tr><td><strong>Sample Time</strong></td><td>Input sampling period (s)</td></tr></tbody></table>

## Inputs

| Input        | Description                                                                                                       |
| ------------ | ----------------------------------------------------------------------------------------------------------------- |
| **wt**       | Angle variation with time, synchronized to zero crossings of the fundamental (positive sequence) of phase A (rad) |
| **Vdq\_ref** | Direct and quadrature axis reference control voltage (pu)                                                         |
| **Vdc**      | Measured DC voltage (pu)                                                                                          |

## Outputs

| Output   | Description                   |
| -------- | ----------------------------- |
| **Uref** | Reference control signal (pu) |

## Signals available for monitoring and external I/O connections (via sensors form)

All block inputs and outputs are available as signals for monitoring and for external I/O connections.

{% 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 %}

{% hint style="info" %}

## Acknowledgements <a href="#acknowledgements" id="acknowledgements"></a>

The development of the <code class="expression">page.vars.block\_name</code> block in the Smart Inverter Control Library is a contribution of CanmetENERGY at Natural Resource Canada.
{% 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/rt-lab/simulink-blocks-reference/smart-inverter-library/gfm-reference-generation-three-phase.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.
