> 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/pe-add-on-opal-rt/system-definition-configuration/configure-the-circuit-model/pwm-generators.md).

# PWM Generators

## Overview

Use the PWM Generators to generate pulse width modulated signals on the FPGA. These signals can be mapped directly to I/O or circuit blocks like model **Gates**.

<figure><img src="https://1300141755-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCyfrFRdgX5VC5iwM13Zm%2Fuploads%2FZc7A72Adiw9lj7DsqzGN%2Fimage.png?alt=media&amp;token=e2aac8fe-6c21-459d-b3ad-634123123fde" alt=""><figcaption><p>Wave mode: Symmetric vs asymmetric</p></figcaption></figure>

In the **System Explorer** window configuration tree, expand the **Power Electronics Add-On (OPAL-RT Circuit)** custom device and select **Circuit >> PWM Generators** to display this page.

## Parameters

<figure><img src="https://1300141755-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCyfrFRdgX5VC5iwM13Zm%2Fuploads%2FCX2yy0YjTQaqoyjX0haU%2Fimage.png?alt=media&amp;token=df8991bd-e447-46ab-ab96-7d545b45bb2d" alt="" width="563"><figcaption></figcaption></figure>

For each PWM Generator, the following parameters are available at edit-time.

<table><thead><tr><th width="244.22235107421875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Frequency (Hz)</strong><br><strong>Default Value: 0</strong></td><td><p>Defines the frequency of the carrier signal that is used to generate PWM.</p><p><mark style="background-color:$warning;">Some error in the signal frequency may exist for frequencies below 1kHz. See PEA-133 in the</mark> <a href="https://opal-rt.atlassian.net/wiki/spaces/PNIVSOC/pages/1136198637"><mark style="background-color:$warning;"><strong>Known Issues</strong></mark></a> <mark style="background-color:$warning;">for more information.</mark></p></td></tr><tr><td><strong>Duty Cycle (%)</strong><br><strong>Default Value: 0%</strong></td><td>Fraction of one period for which the PWM signal is active, as a percentage. Changing this value will update the default value of the <strong>Duty Cycle</strong> channel that corresponds to the selected PWM generator.</td></tr><tr><td><strong>Dead Time (s)</strong><br><strong>Default Value: 0s</strong></td><td>Time during which both the PWM signal and its complementary are held in an inactive state, immediately before the PWM signal goes active.</td></tr><tr><td><strong>Phase Shift (Degrees)</strong><br><strong>Default Value: 0 deg</strong></td><td>Phase offset of the generated PWM relative to the other PWMs using the same frequency engine.</td></tr><tr><td><strong>Polarity</strong><br><strong>Default Value: High</strong></td><td><p>The polarity of the signal.</p><ul><li><strong>Active High</strong> - Outputs a HIGH voltage when the signal is True and a LOW voltage when the signal is False.</li><li><strong>Active Low</strong> - Outputs a HIGH voltage when the signal is False and a LOW voltage when the signal is True.</li></ul></td></tr><tr><td><strong>Wave Mode</strong><br><strong>Default Value: Asymmetric</strong></td><td><p>Defines the location of the signal pulse within the PWM period.</p><ul><li><strong>Symmetric</strong> <em>-</em> The pulse is centered within the PWM period.</li><li><strong>Asymmetric</strong> <em>-</em> The rising edge of the pulse is aligned with beginning of the PWM period.</li></ul></td></tr><tr><td><strong>Update Moment</strong><br><strong>Default Value: Beginning</strong></td><td><p>Defines when the <strong>Duty Cycle</strong> is updated to a commanded value.</p><ul><li><strong>Beginning</strong> - The PWM duty cycle is updated to a new value at the beginning of the PWM period.</li><li><strong>Middle</strong> - The PWM duty cycle is updated to a new value and the middle of the PWM period.</li><li><strong>Both</strong> - The PWM duty cycle is updated to a new value at the beginning and middle of the PWM period.</li></ul></td></tr></tbody></table>

## PWM Generators section channels

In the **System Explorer** window configuration tree, expand the **Power Electronics Add-On** custom device, then **Circuit Model >> PWM Generators** to display the following subsections and custom device channels. Assign values to the channels to configure the PWM Generators. The value of an input channel can be modified dynamically at execution time.

### PWM Generator X

<table><thead><tr><th width="202.26678466796875">Channel name</th><th>Description</th></tr></thead><tbody><tr><td><strong>Frequency (Hz) (Input)</strong></td><td><p>Defines the frequency of the carrier signal that is used to generate PWM.</p><p>Default Value: 0Hz.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>If two (or more) generators are set to run at different frequencies, there is no guarantee that they will be in phase.<br>To ensure that two or more generators running at the same frequency stay phase locked with each other, their frequency must be changed at the same time (using <a href="https://www.ni.com/docs/en-US/bundle/veristand/page/add-user-channel.html"><strong>Calculated Channels</strong></a> for example).</p></div></td></tr><tr><td><strong>Phase Shift (Degrees) (Input)</strong></td><td>Phase offset of the generated PWM relative to the other PWMs using the same frequency engine.<br>Default Value: 0Degrees</td></tr><tr><td><strong>Duty Cycle (Input)</strong></td><td>Fraction of one period for which the PWM signal is active, as a percentage (%)<br>Default Value: 0%.</td></tr></tbody></table>

### PWM Reset

<table><thead><tr><th width="201.55560302734375">Channel name</th><th>Description</th></tr></thead><tbody><tr><td><strong>PWM Reset (Input)</strong></td><td><p><strong>False</strong> - Normal operation<br><strong>True</strong> - Resets all PWMs</p><p>Default Value: 0 (False).</p></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/pe-add-on-opal-rt/system-definition-configuration/configure-the-circuit-model/pwm-generators.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.
