> 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-average-generator-for-full-bridge-converter-switching-function.md).

# PWM Average Generator for Full-Bridge Converter (Switching Function)

## Description

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

The **PWM Average Generator for full-bridge converter** block is a pulse generator averaged over the simulator time step. It uses interpolation to compute transition instants within each sample time.

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

The generator produces a pulse value based on natural (carrier-based) sampling and the simulator time step. If a transition occurs within a sample time, the output is the ON-time ratio within that step (a value between 0 and 1). For example, a value of 0.25 means the 0-to-1 transition occurred at 0.25 · Ts (ON during 25% of the time step). A value of 0.75 for a 1-to-0 transition means the pulse was active for 75% of the computing time (entered OFF at 0.75 · Ts).

When **Use signal as PWM carrier frequency** is enabled: At the first step, the block reads **Fc** and uses the initial phase parameter to compute the initial interpolation of the carrier signal, then stores the read frequency. At subsequent steps, if **Fc** does not change, the carrier is not recalculated; if **Fc** changes, the carrier is recalculated according to the new frequency.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-31fe783c3d0bb11187b1a186781809f479ee44d1%2Fimage%20(547).png?alt=media" alt="" width="336"><figcaption><p>Opeation of the block</p></figcaption></figure>

{% hint style="danger" %}
To properly initialize, in **Simulation Settings** (Advanced tab), select **Solve Control inputs before**.\
Use with the **Full-Bridge Converter (Switching Function)**.
{% 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-0d700c0c92d931178bf1da4d03790c30e70d58b6%2Fimage%20(546).png?alt=media" alt="" width="546"><figcaption></figcaption></figure>

<table><thead><tr><th width="219.5999755859375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Description</strong></td><td>Use this field to add information about the block.</td></tr><tr><td><strong>Use signal as PWM carrier frequency</strong></td><td>When enabled, the component uses the frequency input signal to calculate the carrier; otherwise, it uses the PWM carrier frequency parameter, use_sig_Fc = [0, 1].</td></tr><tr><td><strong>PWM carrier frequency</strong></td><td>Frequency of the triangular carrier signal (Hz) FrequencyCarrier = [0, 1e12].</td></tr><tr><td><strong>PWM carrier initial phase</strong></td><td>Initial phase of the carrier (°) InitialPhase = [0, 360].</td></tr><tr><td><strong>PWM dead time</strong></td><td>Deadtime protection (s) to avoid adjacent arms closing simultaneously. The Deadtime value must not be greater than the simulator time step (Ts), Deadtime = [0, Ts].</td></tr></tbody></table>

{% hint style="info" %}
For precision, the simulator time step must not exceed one tenth of the carrier period (1/Fc).\
**Deadtime** must not be greater than the simulator time step (Ts).
{% endhint %}

## Inputs

<table><thead><tr><th width="221.199951171875">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Vref</strong></td><td>Monophasic reference voltage signal.</td></tr><tr><td><strong>Fc</strong></td><td>Frequency signal used to calculate the carrier.</td></tr></tbody></table>

## Outputs

<table><thead><tr><th width="222" valign="top">Output</th><th>Description</th></tr></thead><tbody><tr><td valign="top"><strong>P</strong></td><td>Vectorized signal containing four firing pulses to control the converter.<br>Vref : Monophasic reference voltage signal (V)<br>Fc : Frequency signal used to calculate the carrier (Hz)<br>P1 : Signal containing a firing pulse to control Q1.<br>P2 : Signal containing a firing pulse to control Q2.<br>P3 : Signal containing a firing pulse to control Q3.<br>P4 : Signal containing a firing pulse to control Q4.<br>Carrier : Triangular carrier signal.</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-average-generator-for-full-bridge-converter-switching-function.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.
