> 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/regc_b.md).

# REGC\_B

## Description

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

The **Renewable Energy Generator/Converter – Type B (REGC\_B)** block, located in the **Control Smart Inverters library**, is a WECC standard dynamic model used to represent the converter-level behavior of inverter-based resources (IBRs) such as photovoltaic (PV) plants, wind power plants (Type 3/4), and battery energy storage systems (BESS) in positive-sequence stability studies. The model represents the fast current execution dynamics of the power electronic converter, assuming that inner switching dynamics are much faster and therefore abstracted.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-8d72c439badcf295d306c65da715fbe37e123f7e%2FCSI_REGC_B_diagram.png?alt=media" alt="" width="700"><figcaption><p>REGC_B diagram</p></figcaption></figure>

REGC\_B executes active and reactive current commands from the electrical controller (for example, REEC) with fast dynamics and rate limits. An active power rate‑limiting function is included in the current execution path. The *RateFlag* parameter selects whether *Rrpwr* is applied as an active current rate limit or as an active power rate limit. These dynamics emulate the converter’s ability to track current references while limiting the rate of change of injected currents.

Using commanded currents, measured terminal voltage, and a fixed interface impedance, REGC\_B computes internal dq voltage components and generates three‑phase voltage references (Va\_ref, Vb\_ref, Vc\_ref) to drive a controlled voltage source. The resulting converter terminal voltage is provided at the *Vabc* output and is applied directly to the network.

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

## Mask parameters

{% hint style="info" %}
Note: In the “Variable & Constraints” column, entries marked recommended range are engineering guidance values and are not software-enforced limits.
{% 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-7b785fa7a4af37baae7f0c0430051e7845be562f%2FCSI_REGC_B_mask_GeneralTab.png?alt=media" alt="" width="700"><figcaption></figcaption></figure>

| Parameter    | Description                                                                                                                    | Variable & Constraints            |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------- |
| **Iqrmax**   | Rate limit on reactive current recovery after a fault when the initial reactive current is positive (injecting into the grid). | Iqrmax ∈ \[1, 999]                |
| **Iqrmin**   | Rate limit on reactive current recovery after a fault when the initial reactive current is negative (absorbing from the grid). | Iqrmin ∈ \[-999, -1]              |
| **RateFlag** | Determines whether *Rrpwr* limits active current or active power. 0 = active current rate limit; 1 = active power rate limit.  | RateFlag ∈ {0, 1}                 |
| **Tg**       | Converter controls delay emulation time constant (s). Typical: 0.02.                                                           | Tg ∈ \[0.017, 0.05]               |
| **Te**       | Converter firing delay emulation time constant (s). Typical: 0.0083.                                                           | Te ∈ \[0.005, 0.02]               |
| **Tfltr**    | Voltage measurement transducer filter time constant (s). Typical: 0.02.                                                        | Tfltr ∈ \[0.017, 0.05]            |
| **Rrpwr**    | Rate limit on active power recovery after a large voltage dip or a sudden change in active power command (pu/s). Typical: 10.  | Rrpwr ∈ \[1, 20]                  |
| **Imax**     | Maximum converter current limit (pu). Must be consistent with the associated REEC model.                                       | Imax recommended range: \[1, 1.5] |

### PLL parameters

For the EMT implementation, the REGC\_B block contains a PLL used during dynamic simulation. The following parameters configure the PLL.

| Parameter                    | Description                                                                                    | Variable & Constraints |
| ---------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------- |
| **Ki**                       | PI controller integral gain.                                                                   | Ki unconstrained       |
| **Kp**                       | PI controller proportional gain.                                                               | Kp unconstrained       |
| **Kd**                       | PI controller derivative gain.                                                                 | Kd unconstrained       |
| **Minimum frequency**        | Minimum expected frequency of the PLL input signal (Hz). Cannot be modified during simulation. | fmin unconstrained     |
| **Filter natural frequency** | Second‑order low‑pass filter cut‑off frequency (Hz).                                           | fcutoff unconstrained  |
| **Filter damping ratio**     | Second‑order low‑pass filter damping (zeta).                                                   | zeta unconstrained     |
| **Rate limiter**             | Rate limiter for frequency (Hz/s).                                                             | rate unconstrained     |
| {% endtab %}                 |                                                                                                |                        |

{% tab title="Generation parameters" %}

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

| Parameter     | Description                        | Variable & Constraints           |
| ------------- | ---------------------------------- | -------------------------------- |
| **Sbase**     | Base power (total) (VA).           | Sbase unconstrained              |
| **Vbase**     | Base voltage (rmsLL) (V).          | Vbase unconstrained              |
| **Re**        | Equivalent source resistance (pu). | Re recommended range: \[0, 0.01] |
| **Xe**        | Equivalent source reactance (pu).  | Xe recommended range: \[0, 0.25] |
| **Frequency** | Base frequency (Hz).               | freq unconstrained               |
| {% endtab %}  |                                    |                                  |

{% tab title="Initial Conditions" %}

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

| Parameter                          | Description                                                                 | Variable & Constraints |
| ---------------------------------- | --------------------------------------------------------------------------- | ---------------------- |
| **Initial terminal voltage**       | Initial terminal voltage magnitude (V), typically obtained from load flow.  | Vt0 unconstrained      |
| **Initial terminal voltage angle** | Initial terminal voltage angle (degree), typically obtained from load flow. | Va0 unconstrained      |
| **Initial active power**           | Initial terminal active power (W), typically obtained from load flow.       | P0 unconstrained       |
| **Initial reactive power**         | Initial terminal reactive power (VAR), typically obtained from load flow.   | Q0 unconstrained       |
| {% endtab %}                       |                                                                             |                        |
| {% endtabs %}                      |                                                                             |                        |

## Inputs

| Input     | Description                                          |
| --------- | ---------------------------------------------------- |
| **Iqcmd** | Reactive current command from REEC block (pu).       |
| **Ipcmd** | Active current command from REEC block (pu).         |
| **Qgen0** | Initial reactive power from load flow (pu).          |
| **Vt**    | Terminal voltage magnitude measured at the POC (pu). |

## Outputs

| Output         | Description                                                      |
| -------------- | ---------------------------------------------------------------- |
| **Vabc**       | Three‑phase network output voltage (V).                          |
| **Freq\_diff** | Difference between terminal frequency and system frequency (Hz). |
| **V\_t**       | Terminal voltage (pu).                                           |
| **P\_t**       | Terminal active power (W).                                       |
| **Q\_t**       | Terminal reactive power (var).                                   |

## 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] Model User Guide for Generic Renewable Energy System Models, EPRI, October 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/regc_b.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.
