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

# REEC\_C

## Description

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

The **Renewable Energy Electrical Controller – Type C (REEC\_C)**, located in the **Control Smart Inverters library**, is a WECC standard dynamic model for the purpose of modeling battery energy storage systems (BESS). This model removes some of the complexity around the switching logic for current injection during a fault, as much of this was developed in [REEC\_A](https://www.opal-rt.com/docs/hypersim/library-blocks-reference/control-smart-inverters/reec_a.md). It also includes a simple model for the charging and discharging of the battery to allow for modeling the state of charge (SOC) of the battery.

It regulates current, voltage, and reactive power using measurements at the Point of Measurement (POM), while tracking voltage and reactive power objectives defined at the Point of Interconnection (POI). The block model mainly contains four parts as shown in figure below:

* Active current controls, which generate the active current command Ipcmd,
* Reactive current controls, which generate the reactive current command Iqcmd,
* The converter current limit logic, which limits the active and reactive current to within the ratings of the converter
* Simplified battery SOC mechanism that constrains the active current command Ipcmd.

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

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

### Active power control <a href="#active-power-control" id="active-power-control"></a>

Active power control is not modulated by speed; therefore, do not use this model with WTGT\_A or WTGT\_B (i.e., not for WTG modeling) \[1]. See modeling detail developed in [REEC\_A](https://www.opal-rt.com/docs/hypersim/library-blocks-reference/control-smart-inverters/reec_a.md).

### Reactive Power Control <a href="#reactive-power-control" id="reactive-power-control"></a>

Compared to [REEC\_A](https://www.opal-rt.com/docs/hypersim/library-blocks-reference/control-smart-inverters/reec_a.md), this model removes state transitions around reactive current injection; the Iq injection path is always active unless the gain is set to zero or the deadband is made extremely wide \[1].

### Current limit logic <a href="#current-limit-logic" id="current-limit-logic"></a>

The converter current limit (Ipmin and Ipmax) allows both power generation and absorption, suitable for storage applications \[1]. See modeling detail developed in [REEC\_A](https://www.opal-rt.com/docs/hypersim/library-blocks-reference/control-smart-inverters/reec_a.md).

### Battery state of charge <a href="#battery-state-of-charge" id="battery-state-of-charge"></a>

REEC\_C contains an additional path with a simple representation for a battery charging/discharging mechanism. Thus, the model is primarily intended for use in modeling BESS.

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

## Mask parameters

{% 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-bb2dbf728694968fc3e1a719e3c87946fa844b4b%2FCSI_REEC_C_mask_GeneralTab.png?alt=media" alt="" width="700"><figcaption></figcaption></figure>

| Parameter    | Description                                                                                                                  | Variable & Constraints |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| **PfFlag**   | <p>Power factor control selector:<br>1 = power factor control;<br>0 = Q control (can be driven by external signal)</p>       | PfFlag ∈ {0, 1}        |
| **VFlag**    | <p>Control mode selector:<br>1 = Q control;<br>0 = voltage control</p>                                                       | VFlag ∈ {0, 1}         |
| **Tp**       | Active power Pe filter time constant (s)                                                                                     | Tp unconstrained       |
| **Vmax**     | Voltage regulator upper output limit (pu)                                                                                    | Vmax unconstrained     |
| **Vmin**     | Voltage regulator lower output limit (pu)                                                                                    | Vmin unconstrained     |
| **Vref1**    | User-defined reference bias (pu). Can be set externally or left fixed                                                        | Vref1 unconstrained    |
| **Qmax**     | Maximum reactive power limit (pu)                                                                                            | Qmax unconstrained     |
| **Qmin**     | Minimum reactive power limit (pu)                                                                                            | Qmin unconstrained     |
| **QFlag**    | <p>Reactive power control flag:<br>1 = voltage or Q control;<br>0 = constant power factor or Q control</p>                   | QFlag ∈ {0, 1}         |
| **Kqp**      | Q regulator proportional gain (dimensionless). Typically zero when using voltage-based control                               | Kqp unconstrained      |
| **Kqi**      | Q regulator integral gain (1/s)                                                                                              | Kqi unconstrained      |
| **Kvp**      | Voltage regulator proportional gain (dimensionless)                                                                          | Kvp unconstrained      |
| **Kvi**      | Voltage regulator integral gain (1/s)                                                                                        | Kvi unconstrained      |
| **Kqv**      | Voltage error-to-reactive current gain (dimensionless). If zero, no dynamic Iq response to voltage deviation                 | Kqv unconstrained      |
| **Tiq**      | Time constant for Iq control response (s)                                                                                    | Tiq unconstrained      |
| **Vdip**     | Low-voltage threshold for reactive current injection (pu). Below this threshold, the inverter injects Iq for voltage support | Vdip unconstrained     |
| **Vup**      | <p>High-voltage threshold for reactive current injection (pu).<br>If Vup > 99, Iq injection is reduced or disabled</p>       | Vup unconstrained      |
| **dbd1**     | Lower bound of voltage error deadband (pu)                                                                                   | dbd1 unconstrained     |
| **dbd2**     | Upper bound of voltage error deadband (pu)                                                                                   | dbd2 unconstrained     |
| **Trv**      | Voltage measurement filter time constant (s)                                                                                 | Trv unconstrained      |
| **Iqhl**     | Maximum reactive current injection limit (pu)                                                                                | Iqhl unconstrained     |
| **Iqll**     | Minimum reactive current injection limit (pu)                                                                                | Iqll unconstrained     |
| **Pmax**     | Maximum active power limit (pu)                                                                                              | Pmax unconstrained     |
| **Pmin**     | <p>Minimum active power limit (pu).<br>Can be above zero in storage modes</p>                                                | Pmin unconstrained     |
| **Tpord**    | Power reference filter time constant (s)                                                                                     | Tpord unconstrained    |
| **dPmax**    | Maximum power ramp-up rate (pu/s)                                                                                            | dPmax unconstrained    |
| **dPmin**    | Maximum power ramp-down rate (pu/s)                                                                                          | dPmin unconstrained    |
| **PFlag**    | <p>Active power flag:<br>1 = active current command has speed dependency;<br>0 = no dependency</p>                           | PFlag ∈ {0, 1}         |
| **Imax**     | Maximum converter current limit (combined P and Q) (pu)                                                                      | Imax unconstrained     |
| **PqFlag**   | <p>P/Q priority flag for current limit:<br>0 = Q priority;<br>1 = P priority</p>                                             | PqFlag ∈ {0, 1}        |
| **SOCmax**   | Maximum allowable state of charge (pu)                                                                                       | SOCmax unconstrained   |
| **SOCmin**   | Minimum allowable state of charge (pu)                                                                                       | SOCmin unconstrained   |
| **T**        | <p>Battery discharge duration (s).<br>Relevant only in storage mode</p>                                                      | T unconstrained        |
| {% endtab %} |                                                                                                                              |                        |

{% tab title="Voltage-dependent limits" %}

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

| Parameter    | Description               | Variable & Constraints |
| ------------ | ------------------------- | ---------------------- |
| **Vq1**      | VDL1 voltage point 1 (pu) | Vq1 unconstrained      |
| **Vq2**      | VDL1 voltage point 2 (pu) | Vq2 unconstrained      |
| **Vq3**      | VDL1 voltage point 3 (pu) | Vq3 unconstrained      |
| **Vq4**      | VDL1 voltage point 4 (pu) | Vq4 unconstrained      |
| **Iq1**      | VDL1 Iqmax point 1 (pu)   | Iq1 unconstrained      |
| **Iq2**      | VDL1 Iqmax point 2 (pu)   | Iq2 unconstrained      |
| **Iq3**      | VDL1 Iqmax point 3 (pu)   | Iq3 unconstrained      |
| **Iq4**      | VDL1 Iqmax point 4 (pu)   | Iq4 unconstrained      |
| **Vp1**      | VDL2 voltage point 1 (pu) | Vp1 unconstrained      |
| **Vp2**      | VDL2 voltage point 2 (pu) | Vp2 unconstrained      |
| **Vp3**      | VDL2 voltage point 3 (pu) | Vp3 unconstrained      |
| **Vp4**      | VDL2 voltage point 4 (pu) | Vp4 unconstrained      |
| **Ip1**      | VDL2 Ipmax point 1 (pu)   | Ip1 unconstrained      |
| **Ip2**      | VDL2 Ipmax point 2 (pu)   | Ip2 unconstrained      |
| **Ip3**      | VDL2 Ipmax point 3 (pu)   | Ip3 unconstrained      |
| **Ip4**      | VDL2 Ipmax point 4 (pu)   | Ip4 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-e3053c7a1816132e0fcc3539535f297b032ba3ff%2FCSI_REEC_C_mask_InitCond.png?alt=media" alt="" width="500"><figcaption></figcaption></figure>

| Parameter     | Description                                 | Variable & Constraints  |
| ------------- | ------------------------------------------- | ----------------------- |
| **Vref0**     | Initial voltage reference (pu)              | Vref0 unconstrained     |
| **Pref0**     | Initial active power reference (pu)         | Pref0 unconstrained     |
| **Qref0**     | Initial reactive power reference (pu)       | Qref0 unconstrained     |
| **SOC\_init** | Initial state of charge (pu; typically 0.5) | SOC\_init unconstrained |
| {% endtab %}  |                                             |                         |
| {% endtabs %} |                                             |                         |

## Inputs

| Input      | Description                                                                                           |
| ---------- | ----------------------------------------------------------------------------------------------------- |
| **Vt**     | Terminal voltage measured at the POC (pu)                                                             |
| **pfaref** | Power factor angle reference (rad)                                                                    |
| **Pe**     | Active power measured at the POC (pu)                                                                 |
| **Qext**   | Reactive power reference (pu), initialized from load flow or supplied by an external plant controller |
| **Qgen**   | Reactive power measured at the POC (pu)                                                               |
| **Pref**   | Active power reference (pu), initialized from load flow or supplied by an external plant controller   |
| **Paux**   | Auxiliary input signal (pu)                                                                           |
| **Pgen**   | Plant active power output (pu)                                                                        |

## Outputs

| Output    | Description                   |
| --------- | ----------------------------- |
| **Iqcmd** | Reactive current command (pu) |
| **Ipcmd** | Active current command (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.

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