> 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/library-blocks-reference/control-smart-inverters/regfm_a1.md).

# REGFM\_A1

## Description

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-9edcf11c170f1262ee59aa08c2a6691c00753cf9%2FCSI_REGFM_A1_block.png?alt=media" alt="" width="215"><figcaption></figcaption></figure>

The **Renewable Energy Grid-Forming Model Type A1 (REGFM\_A1)** block, located in the **Control Smart Inverters library**, is a WECC positive-sequence model of a droop-controlled grid-forming inverter. The model represents a controllable internal voltage source behind a coupling impedance and includes active-power/frequency droop control, reactive-power/voltage droop control, and transient fault current limiting. \[1]

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

The control structure is organized into three main functions.

### P-f droop control

This control generates the internal voltage angle/frequency command and support active-power sharing as presented in figure below.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-6a8690420176bdc4f0764f813fd2a9bdb355625d%2FCSI_REGFM_A1_PfDroop.png?alt=media" alt="" width="400"><figcaption><p>P-f Droop Logic</p></figcaption></figure>

### Q-V droop control

This control generates the internal voltage magnitude command and support voltage regulation/reactive-power sharing as presented in figure below.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-3fd99be58e2f2779a91e1fa72e0c9c01eac7aa78%2FCSI_REGFM_A1_QVDroop.png?alt=media" alt="" width="400"><figcaption><p>Q-V Droop Logic</p></figcaption></figure>

### Current limiting control

This control constrains inverter current during short-circuit and large-disturbance conditions as presented in figure below.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-0d6db8f7449add895a598701ce3a9cc8ca62070b%2FCSI_REGFM_A1_CurrentLimiter.png?alt=media" alt="" width="270"><figcaption><p>Current Limiting Logic</p></figcaption></figure>

### Load Flow

This block is implemented so the IBR can be initialized in steady-state operation. For load flow purposes, REGFM\_C1 is generally considered a PV bus, so it is necessary to define the voltage magnitude in pu and the active power P to be delivered by the IBR at the terminals in W. In the case of the SLACK bus, the voltage magnitude and angle in pu and degrees, respectively, must be defined.

To calculate the initial conditions of the model from the load flow, it is important to know the type of filter used in the model's interface circuit. In the original model described in \[1], only the RL filter option can be used, but if an external current limiting function with an RLC (or simply LC) filter is used, this filter type must be selected, and the capacitance value added in the general tab to correctly calculate the initial conditions.

## Mask parameters

{% hint style="info" %}
Note: Always run load flow using this block to correctly initialize internal model states.
{% endhint %}

{% tabs %}
{% tab title="General" %}

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-13dbf16d160ce48fc2d3aebae6aa26832b01d73a%2FCSI_REGFM_A1_mask_GeneralTab.png?alt=media" alt="" width="500"><figcaption></figcaption></figure>

| Parameter                                             | Description                                                                                                                                                 | Variable & Constraints |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| **Base Voltage**                                      | Base voltage used for per-unit calculations (V).                                                                                                            | Vbase ∈ \[0, 1e64]     |
| **Base Power**                                        | Base apparent power used for per-unit calculations (VA).                                                                                                    | Sbase ∈ \[0, 1e64]     |
| **Base frequency**                                    | Nominal frequency used for per-unit calculations (Hz).                                                                                                      | fnom ∈ \[0, 1e64]      |
| **Inverter coupling resistance**                      | Coupling resistance between inverter source and terminal (pu).                                                                                              | Re unconstrained       |
| **Inverter coupling reactance**                       | Coupling reactance between inverter source and terminal (pu).                                                                                               | Xe ∈ \[0, 1e64]        |
| **cut-off angular frequency of the low pass filters** | Low-pass filter cut-off angular frequency used for measurement filtering (rad/s). This parameter is also used for voltage measurement in Q‑V droop control. | omega ∈ \[0, 1e64]     |
| **Filter Type**                                       | <p>Filter type used for initialization:<br>- RL (1)<br>- RLC (2)</p>                                                                                        | FilterRL ∈ {1, 2}      |
| **Filter capacitance**                                | Filter capacitance used in initialization calculations (pu).                                                                                                | Cf unconstrained       |
| {% endtab %}                                          |                                                                                                                                                             |                        |

{% tab title="P-f Droop" %}

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-2e706a66196a8bb57374efd0bbb341c6417daf2f%2FCSI_REGFM_A1_mask_PfDroopTab.png?alt=media" alt="" width="500"><figcaption></figcaption></figure>

| Parameter    | Description                                                              | Variable & Constraints |
| ------------ | ------------------------------------------------------------------------ | ---------------------- |
| **mp**       | P-f droop gain (%).                                                      | mp unconstrained       |
| **Pmin**     | Minimum active power command limit (pu).                                 | Pmin ≤ Pmax            |
| **Pmax**     | Maximum active power command limit (pu).                                 | Pmax ≥ Pmin            |
| **kppmax**   | Proportional gain of the active-power limit controller (Pmax/Pmin loop). | kppmax unconstrained   |
| **kipmax**   | Integral gain of the active-power limit controller (Pmax/Pmin loop).     | kipmax ∈ \[0, 1e64]    |
| {% endtab %} |                                                                          |                        |

{% tab title="Q-V Droop" %}

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-7f5cffc9cb5e8dc13d2af1e07ace978b54a03eb9%2FCSI_REGFM_A1_mask_QVDroopTab.png?alt=media" alt="" width="500"><figcaption></figcaption></figure>

| Parameter    | Description                                                                                                                                                                     | Variable & Constraints |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| **mq**       | Q-V droop gain (%).                                                                                                                                                             | mq unconstrained       |
| **Qmin**     | Minimum reactive power command limit (pu).                                                                                                                                      | Qmin ≤ Qmax            |
| **Qmax**     | Maximum reactive power command limit (pu).                                                                                                                                      | Qmax ≥ Qmin            |
| **kpqmax**   | Proportional gain of the reactive-power limit controller (Qmax/Qmin loop).                                                                                                      | kpqmax unconstrained   |
| **kiqmax**   | Integral gain of the reactive-power limit controller (Qmax/Qmin loop).                                                                                                          | kiqmax ∈ \[0, 1e64]    |
| **kpv**      | Proportional gain of the voltage controller.                                                                                                                                    | kpv unconstrained      |
| **kiv**      | Integral gain of the voltage controller.                                                                                                                                        | kiv ∈ \[0, 1e64]       |
| **AWpv**     | Anti-windup gain of the voltage controller.                                                                                                                                     | AWpv unconstrained     |
| **Emin**     | Lower limit of the output of the voltage loop.                                                                                                                                  | Emin ≤ Emax            |
| **Emax**     | Upper limit of the output of the voltage loop.                                                                                                                                  | Emax ≥ Emin            |
| **Vflag**    | <p>Voltage control mode selection:<br>- External terminal voltage V<sub>t</sub> after coupling impedance (1)<br>- Internal inverter voltage E before coupling impedance (2)</p> | Vflag ∈ {1, 2}         |
| **QVflag**   | <p>Control input selection:<br>- Reactive power Q (1)<br>- Voltage V (2)</p>                                                                                                    | QVflag ∈ {1, 2}        |
| {% endtab %} |                                                                                                                                                                                 |                        |

{% tab title="Current Limiter" %}

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-31ae90b5f1363ba30c56187fd06e8882f74e6f16%2FCSI_REGFM_A1_mask_CurrentLimiterTab.png?alt=media" alt="" width="500"><figcaption></figcaption></figure>

| Parameter                       | Description                                                                                                                              | Variable & Constraints            |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| **Imax**                        | Maximum transient inverter output current (pu).                                                                                          | Imax ∈ \[0, 1e64]                 |
| **Current limiting function**   | Selects whether current limiting uses the internal (1) model function or an external (2) implementation.                                 | isCurrentLimiterInternal ∈ {1, 2} |
| **Time constant of the filter** | Time constant used to smooth the current-limiting function response (s), typically chosen slightly larger than the simulation time step. | Tcfilter ∈ \[0, 1e64]             |
| {% endtab %}                    |                                                                                                                                          |                                   |

{% tab title="Load Flow" %}

| Parameter                  | Description                                                                                    | Variable & Constraints    |
| -------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------- |
| **Bus Type**               | Initialization bus mode: Swing (fixed V and angle), PV (fixed P and V), or PQ (fixed P and Q). | BusType ∈ {Swing, PV, PQ} |
| **Voltage**                | Desired terminal voltage for initialization (pu).                                              | Vlf unconstrained         |
| **Angle**                  | Desired terminal voltage angle for initialization (deg).                                       | AngleLF unconstrained     |
| **Active power**           | Desired terminal active power for initialization (MW).                                         | PsetLF unconstrained      |
| **Reactive power minimum** | Minimum terminal reactive power used during load-flow initialization (MVAr).                   | QminLF ≤ QmaxLF           |
| **Reactive power maximum** | Maximum terminal reactive power used during load-flow initialization (MVAr).                   | QmaxLF ≥ QminLF           |
| **Reactive power**         | Desired terminal reactive power for initialization (MVAr).                                     | QsetLF unconstrained      |
| {% endtab %}               |                                                                                                |                           |
| {% endtabs %}              |                                                                                                |                           |

## Inputs

| Input    | Description                                                   |
| -------- | ------------------------------------------------------------- |
| **Vref** | Reference voltage at the Point of Interconnection (POI) (pu). |
| **Pref** | Reference active power injection at the POI (pu).             |

## Outputs

| Output  | Description               |
| ------- | ------------------------- |
| **ABC** | Three phase terminal port |

## 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.

## References

\[1] W. Du et al., "Model Specification of Droop-Controlled, Grid-Forming Inverters (REGFM\_A1)," PNNL-35110, Pacific Northwest National Laboratory, September 2023.

## Acknowledgements

{% 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/hypersim/library-blocks-reference/control-smart-inverters/regfm_a1.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.
