> 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/microgrid-testbed-library/diesel-generator.md).

# Diesel Generator

## Description

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

The **Diesel Generator** block, located in the **microGrid Testbed/DER** library, models a diesel-based generation unit composed of a round-rotor synchronous machine, a speed governor, a synchronism relay, and excitation and load control. The synchronous machine is directly connected to the microgrid. A diesel engine and governor provide the input mechanical power to the synchronous machine, while the field excitation system regulates the voltage applied to the rotor windings.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-6b049b8bc7e4354b2f22cf3fbbc14f96a95f135c%2FMG_diesel_generator_diagram.png?alt=media" alt=""><figcaption><p>The main blocks of the diesel generator block</p></figcaption></figure>

{% hint style="danger" %}
This block requires a valid RT-LAB license on both the workstation and the simulator, with the OP1420 feature enabled. For more information, see [Microgrid Control & DERs](https://www.opal-rt.com/docs/rt-lab/model-and-simulation/power-systems-with-artemis/microgrid-control-and-ders.md).
{% endhint %}

## Mask parameters

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

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

<table><thead><tr><th width="249.20001220703125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>nominal power</strong></td><td>Nominal power of the synchronous machine (VA).</td></tr><tr><td><strong>nominal line-to-line voltage</strong></td><td>Nominal line-to-line RMS voltage of the synchronous machine (kV).</td></tr><tr><td><strong>Frequency</strong></td><td>Nominal operating frequency of the synchronous machine (Hz).</td></tr><tr><td><strong>Reactances</strong></td><td>Direct (d) axis and quadrature (q) axis reactances, and leakage reactance (pu).</td></tr><tr><td><strong>Time constants</strong></td><td>Direct and quadrature axis time constants, selectable between short-circuit or open-circuit values (s).</td></tr><tr><td><strong>Stator resistance</strong></td><td>Stator resistance of the synchronous machine (pu).</td></tr><tr><td><strong>Mechanical parameters</strong></td><td>Inertia coefficient (H), friction factor, and number of pole pairs (pu).</td></tr><tr><td><strong>Initial conditions</strong></td><td>Initial steady-state values: speed deviation (%), rotor electrical angle (degrees), phase currents (magnitude and angle), and field voltage (pu).</td></tr><tr><td><strong>Simulate saturation</strong></td><td>Enable to account for synchronous machine magnetic saturation.</td></tr><tr><td><strong>no-load curve</strong></td><td>Field current and terminal voltage values (pu).</td></tr></tbody></table>
{% endtab %}

{% tab title="Governor" %}

<table><thead><tr><th width="239.39996337890625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Regulator gains</strong></td><td>Regulator gains for the isochronous mode and the following mode.</td></tr><tr><td><strong>Time constants Isochronous mode</strong></td><td>Regulator time constants for the isochronous mode (s).</td></tr><tr><td><strong>PI regulator P following mode</strong></td><td>PI regulator gains for the following mode.</td></tr><tr><td><strong>Actuator time constants</strong></td><td>Actuator time constants of the governor (s).</td></tr><tr><td><strong>Torque limits</strong></td><td>Minimum and maximum torque limits (pu).</td></tr><tr><td><strong>Engine Time Delay</strong></td><td>Engine time delay (s).</td></tr><tr><td><strong>Initial mechanical power</strong></td><td>Initial mechanical power (pu).</td></tr><tr><td><strong>Droop in percentage</strong></td><td>Speed droop setting (%).</td></tr></tbody></table>
{% endtab %}

{% tab title="Excitation system" %}
**Controllers, Exciter and rectifier and initial values tabs**

<table><thead><tr><th width="240.199951171875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Low-pass filter time constant [Ts(s)]</strong></td><td>Time constant for the low-pass filter of the IEEE-DC1A excitation system (s)</td></tr><tr><td><strong>Voltage regulator gain and time constant [Ka, Ta]</strong></td><td>Gain and time constant parameters for the voltage regulator of the IEEE-DC1A excitation system (-, s).</td></tr><tr><td><strong>Voltage Regulator output limits [VRmin, VRmax]]</strong></td><td>Minimum and maximum outputs for voltage regulator of the IEEE-DC1A excitation system (pu).</td></tr><tr><td><strong>Damping filter parameters [Kf, Tf]</strong></td><td>Gain (Kf) and time constant (Tf) parameters for the damping filter of the IEEE-DC1A excitation system (-, s).</td></tr><tr><td><strong>Transient gain reduction lead and lag time constants [Tb, Tc]</strong></td><td>Time constant parameters for the lead-lag stages of the IEEE-DC1A excitation system(s).</td></tr><tr><td><strong>Exciter gain and time constant</strong></td><td>Gain and time constant parameters for the exciter of the IEEE-DC1A excitation system.</td></tr><tr><td><strong>Field voltage values</strong></td><td>Voltage values for the exciter of the IEEE-DC1A excitation system (pu).</td></tr><tr><td><strong>Exciter saturation values</strong></td><td>Function values for the saturation simulation of the IEEE-DC1A excitation system (pu).</td></tr><tr><td><strong>Initial values</strong></td><td>Initial terminal voltage and field voltage (pu).</td></tr><tr><td><strong>Sample time</strong></td><td>Simulation time step (s).</td></tr></tbody></table>
{% endtab %}

{% tab title="Load controller" %}
**Droop tab**

<table><thead><tr><th width="240.20001220703125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Proportional gain Kp</strong></td><td>Proportional gain Kp of the PI controller for the load control droop function.</td></tr><tr><td><strong>Proportional gain Ki</strong></td><td>Integral gain Ki of the PI controller for the load control droop function.</td></tr><tr><td><strong>Initial output</strong></td><td>Initial controller output for the load control droop function (pu).</td></tr><tr><td><strong>Output upper limit</strong></td><td>Upper output limit for the load control droop function (pu).</td></tr><tr><td><strong>Output lower limit</strong></td><td>Lower output limit for the load control droop function (pu).</td></tr></tbody></table>

**Reactive power tab**

<table><thead><tr><th width="240.20001220703125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Proportional gain Kp</strong></td><td>Proportional gain Kp of the PI controller for the load control reactive power function.</td></tr><tr><td><strong>Proportional gain Ki</strong></td><td>Integral gain Ki of the PI controller for the load control reactive power function.</td></tr><tr><td><strong>Initial output</strong></td><td>Initial controller output for the load control reactive power function (pu).</td></tr><tr><td><strong>Output upper limit</strong></td><td>Upper output limit for the load control reactive power function (pu).</td></tr><tr><td><strong>Output lower limit</strong></td><td>Lower output limit for the load control reactive power function (pu).</td></tr></tbody></table>
{% endtab %}

{% tab title="Synchronism check" %}

<table><thead><tr><th width="241">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Enable</strong></td><td>Enable or disable the relay operation.</td></tr><tr><td><strong>Data voltage threshold</strong></td><td>Voltage threshold limit (%).</td></tr><tr><td><strong>Delta angle and frequency threshold</strong></td><td>Angle and frequency threshold limits (degrees, Hz).</td></tr><tr><td><strong>Breaker Close time</strong></td><td>Breaker closing time (s).</td></tr><tr><td><strong>Freezing time</strong></td><td>Initial time during which the breaker command remains zero (breaker stays open) (s).</td></tr><tr><td><strong>Voltage check</strong></td><td>Enable or disable voltage check functionality.</td></tr><tr><td><strong>Vmin</strong></td><td>Threshold below which the bus/line is considered dead/de-energized (% of Vll).</td></tr><tr><td><strong>Vmax</strong></td><td>Threshold above which the bus/line is considered live/energized (% of Vll).</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Inputs

<table><thead><tr><th width="239.5999755859375">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>P ref</strong></td><td>Active power reference (pu).</td></tr><tr><td><strong>Q ref</strong></td><td>Reactive power reference (pu).</td></tr><tr><td><strong>V ref</strong></td><td>Voltage reference (pu).</td></tr><tr><td><strong>w ref</strong></td><td>Speed reference (pu).</td></tr><tr><td><strong>status</strong></td><td>Connection status: 0 = Disconnected from the grid, 1 = Connected to the grid.</td></tr><tr><td><strong>Islanded</strong></td><td>Islanded mode: 0 = Disabled, 1 = Enabled.</td></tr><tr><td><strong>V line</strong></td><td>Phase-to-ground voltages (a, b, c) measured on the high-voltage side of the transformer located after the model breaker.</td></tr><tr><td><strong>I line</strong></td><td>Phase currents (a, b, c) measured on the high-voltage side of the transformer located after the model breaker.</td></tr><tr><td><strong>V breaker</strong></td><td>Phase-to-ground voltages (a, b, c) measured on the low-voltage side of the transformer located after the model breaker.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="239.5999755859375">Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>Measurements</strong></td><td><p>Contains five monitoring signals:</p><ul><li>Active power delivered by the diesel generator (kW)</li><li>Reactive power delivered by the diesel generator (kVAr)</li><li>Terminal voltage RMS of the diesel generator (kV)</li><li>Terminal current RMS of the diesel generator (A)</li><li>Reserve reactive power of the diesel generator (pu)</li></ul></td></tr><tr><td><strong>A</strong></td><td>Connection to phase A of the grid.</td></tr><tr><td><strong>B</strong></td><td>Connection to phase B of the grid.</td></tr><tr><td><strong>C</strong></td><td>Connection to phase C of the grid.</td></tr></tbody></table>


---

# 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/microgrid-testbed-library/diesel-generator.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.
