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

# WTGQ\_A

## Description

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

The **Wind Turbine Generator Torque Controller (WTGQ\_A)** block, located in the **Control Smart Inverters library**, is a WECC generic model representing the electromagnetic torque (or active power) control of a doubly-fed induction generator (DFIG). Physically, this component models the action of the rotor-side converter, which regulates generator torque by controlling rotor currents. Its primary objective is to extract the desired amount of aerodynamic power from the wind while ensuring stable generator operation and appropriate interaction with the mechanical drive train.

The WTGQ\_A model includes a flag (**tflag**) that determines whether the torque reference is based on power control or speed control. In power-control mode, the reference is calculated from the error between the electrical active power produced by the generator (**Pe**) and the plant power reference (**Pref0**). Torque is then derived from active power using generator speed (**wg**) from the drive-train model [WTGT\_A](https://www.opal-rt.com/docs/hypersim/library-blocks-reference/control-smart-inverters/wtgt_a.md). In speed-control mode, the reference is computed from a piecewise-linear function that defines speed reference at a given power level, based on four setpoints provided by the OEM. The resulting speed reference is also used by the pitch controller [WTGP\_A](https://www.opal-rt.com/docs/hypersim/library-blocks-reference/control-smart-inverters/wtgp_a.md). \[1]

Block diagram is 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-8e2b06ec66c3a1523ba652b2925fc085cfc173b4%2FCSI_WTGQ_A_diagram.png?alt=media" alt="" width="600"><figcaption></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 %}

## Mask parameters

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

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

| Parameter     | Description                                                                                | Variable & Constraints |
| ------------- | ------------------------------------------------------------------------------------------ | ---------------------- |
| **tflag**     | <p>Flag to specify the PI controller input:<br>0 = speed control;<br>1 = power control</p> | tflag ∈ {0, 1}         |
| **Vdip**      | Minimum voltage dip before the PI controller integrator freezes                            | Vdip ∈ \[0, 1]         |
| **Kip**       | PI controller integral gain                                                                | Kip ∈ \[0, 1e64]       |
| **Kpp**       | PI controller proportional gain                                                            | Kpp ∈ \[0, 1e64]       |
| **Tp**        | Power measurement lag time constant, typically set to 0.05 s                               | Tp ∈ \[0.02, 1]        |
| **Twref**     | Speed reference time constant, typically set to 60 s                                       | Twref ∈ \[5, 60]       |
| **Temax**     | Electrical torque maximum limit, typically set to 1 pu                                     | TeMax ∈ \[0.9, 1.2]    |
| **Temin**     | Electrical torque minimum limit, typically set to 0.05 pu                                  | TeMin ∈ \[0, 0.1]      |
| **p1**        | Power-speed curve first power point                                                        | p1 ∈ \[0, 1e64]        |
| **s1**        | Power-speed curve first speed point                                                        | s1 ∈ \[0, 1e64]        |
| **p2**        | Power-speed curve second power point                                                       | p2 ∈ \[0, 1e64]        |
| **s2**        | Power-speed curve second speed point                                                       | s2 ∈ \[0, 1e64]        |
| **p3**        | Power-speed curve third power point                                                        | p3 ∈ \[0, 1e64]        |
| **s3**        | Power-speed curve third speed point                                                        | s3 ∈ \[0, 1e64]        |
| **p4**        | Power-speed curve fourth power point                                                       | p4 ∈ \[0, 1e64]        |
| **s4**        | Power-speed curve fourth speed point                                                       | s4 ∈ \[0, 1e64]        |
| {% endtab %}  |                                                                                            |                        |
| {% endtabs %} |                                                                                            |                        |

## Inputs

| Input     | Description                                              |
| --------- | -------------------------------------------------------- |
| **Pe**    | Electrical power, measured at the terminal (pu)          |
| **Pref0** | Plant power reference (pu)                               |
| **wg**    | Generator speed, from WTGT\_A (pu)                       |
| **Vt**    | Positive-sequence voltage, measured at the terminal (pu) |

## Outputs

| Output   | Description                                                                                                                               |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Pref** | Power reference, sent to [REEC\_A](https://www.opal-rt.com/docs/hypersim/library-blocks-reference/control-smart-inverters/reec_a.md) (pu) |
| **wref** | Speed reference, sent to [WTGP\_A](https://www.opal-rt.com/docs/hypersim/library-blocks-reference/control-smart-inverters/wtgp_a.md) (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/wtgq_a.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.
