> 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-sources/pwm-generator-for-3-level-converter-switching-devices.md).

# PWM Generator for 3-Level Converter (Switching Devices)

## Description

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-41c0053efe8443111425507f170d1e60f7c260af%2Fimage%20(983).png?alt=media" alt="" width="203"><figcaption></figcaption></figure>

The **PWM generator for 3-level converter** block generates pulses for carrier-based pulse-width modulation (PWM) converters using a three-level topology.

The reference signal (Vref), also called the modulation signal, is naturally sampled and compared with two symmetrical level-shifted triangular carriers. Each converter arm (one per phase in a three-level converter) has three states: +1, 0, or −1. When the reference signal is greater than the positive carrier, the arm state is +1; when it is less than the negative carrier, the state is −1; otherwise, the state is 0. Pulses are generated based on the current arm state. Natural sampling models the behavior of an analog PWM generator.

The carrier frequency fc is defined by the converter output voltage frequency and the switching ratio:

$$
f\_c = Switching ratio \times Output Voltage Frequency.
$$

One reference signal is required to generate the four pulses of an arm; for a three-level converter, three reference signals generate the twelve pulses.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-16cb699042d3157c360dea211b648ead99eca92d%2Fimage%20(985).png?alt=media" alt="" width="563"><figcaption><p>Pulses generated for a single-phase, half-bridge three-level converter.</p></figcaption></figure>

To control the 3-Level Converter (Switching Devices), the pulse generator outputs (1, 2), (5, 6), and (9, 10) for the upper switching components of the first, second, and third arms, and (3, 4), (7, 8), and (11, 12) for the lower switching components of the first, second, and third arms.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-f6db7a21fa0f96f5ed95b771b5c7e027779bd55a%2Fimage%20(986).png?alt=media" alt="" width="563"><figcaption><p>Internal circuit</p></figcaption></figure>

{% hint style="danger" %}
Use this component with the **3-Level Converter (Switching Devices)**.
{% 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-942686a8770a13911110310bde434757d8f77b5d%2Fimage%20(984).png?alt=media" alt="" width="544"><figcaption></figcaption></figure>

<table><thead><tr><th width="220.39996337890625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>Add descriptive information about the block.</td></tr><tr><td><strong>PWM carrier frequency</strong></td><td>Frequency of the triangular carrier signal (Hz)<br>FrequencyCarrier = [0, 1e12].</td></tr><tr><td><strong>PWM carrier initial phase</strong></td><td>Initial phase of the carrier (°). A value of 90° sets the triangle carrier at the midpoint between its minimum and maximum with a positive slope. InitialPhase = [0, 360].</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="140.4000244140625">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Vref</strong></td><td>Vectorized reference voltage containing the phase-to-ground voltages from the AC side (Va, Vb, Vc).</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="147.5999755859375" valign="top">Output</th><th>Description</th></tr></thead><tbody><tr><td valign="top"><strong>P</strong></td><td><p>Vectorized signal containing twelve firing pulses to control the converter.<br><strong>Va:</strong> Reference voltage signals from phases A on the AC side (V).<br><strong>Vb:</strong> Reference voltage signals from phases B on the AC side (V).<br><strong>Vc</strong>: Reference voltage signals from phases C on the AC side (V).</p><p><strong>P1</strong>: Firing pulse to control Q1 (phase A upper arm).</p><p><strong>P2</strong>: Firing pulse to control Q2 (phase A upper arm).<br><strong>P3</strong>: Firing pulse to control Q3 (phase A lower arm).</p><p><strong>P4</strong>: Firing pulse to control Q4 (phase A lower arm).</p><p><strong>P5</strong>: Firing pulse to control Q5 (phase B upper arm).</p><p><strong>P6</strong>: Firing pulse to control Q6 (phase B upper arm).</p><p><strong>P7</strong>: Firing pulse to control Q7 (phase B lower arm).</p><p><strong>P8</strong>: Firing pulse to control Q8 (phase B lower arm).<br><strong>P9</strong>: Firing pulse to control Q9 (phase C upper arm).<br><strong>P10</strong>: Firing pulse to control Q10 (phase C upper arm).<br><strong>P11</strong>: Firing pulse to control Q11 (phase C lower arm).<br><strong>P12</strong>: Firing pulse to control Q12 (phase C lower arm).</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/hypersim/library-blocks-reference/control-sources/pwm-generator-for-3-level-converter-switching-devices.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.
