> 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/smart-power-simulation-software-sps/blocks-functions-tools/power-converters/converters/half-bridge-mmc.md).

# Half Bridge MMC

## Description

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-c0b02c8d1d359159ffc8999703819ff44633dcbc%2Fhalf_bridge_MMC_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **Half Bridge MMC** bloc&#x6B;**,** located in the **OPAL-RT SPS Software/Power Electronics** library, implements a half-bridge modular multilevel converter.

The converter consists of multiple series-connected power modules. Each power module consists of one half-bridge and one capacitor on the DC side.

You can choose from four model types:

* **Switching devices** — The converter is modeled with IGBT/diode pairs. A multilevel PWM generator produces firing pulses (0/1 signals), which trigger switching in the converter.
* **Switching function** — The converter is based on a switching-function model. The model uses two voltage sources and two diodes on the AC side, and two current sources on the DC side. The converter is controlled by firing pulses produced by a PWM generator (0/1 signals) or by firing pulses averaged over a specified period (PWM averaging: signals from 0 through 1). Both modes of operation produce harmonics normally generated by a PWM-controlled converter and also correctly simulate the rectifying operation and blanking time. This model type is suitable for real-time simulation.
* **Average model (Uref-controlled)** — The converter is modeled using a switching function model directly controlled by the reference voltage signals. A PWM generator is not required. This model provides the fastest simulations.
* **Aggregate model** — The converter is modeled using a switching-function model where only one equivalent module is used to represent all modules. This aggregate model represents control system dynamics, converter harmonics, and circulating currents phenomena. However, because a single virtual capacitor represents all capacitors of one arm, the model assumes that capacitor voltages of all power modules are balanced. As a result, a capacitor voltage-balancing scheme cannot be simulated. The aggregate model runs much faster than a detailed model that would use two switching devices and one capacitor for each individual power module of one arm. This aggregate model is also suitable for real-time simulation.

## Parameters

<table data-header-hidden><thead><tr><th width="234"></th><th></th></tr></thead><tbody><tr><td><strong>Model type</strong></td><td><p>Specify the model type to use:</p><ul><li>Switching devices (default)</li><li>Switching function</li><li>Average model (Uref-controlled)</li><li>Aggregate model</li></ul></td></tr><tr><td><strong>Number of power modules</strong></td><td>Specify the number of series-connected power modules that are in the converter. The default value is 1.</td></tr><tr><td><strong>Capacitor value (F)</strong></td><td>Specify the capacitance, in farads, of the capacitors connected on the DC side of each power module. You can specify a single value that sets all the capacitances to the same value, or specify a vector containing different capacitance values for every power module. The default value is 10e-3.</td></tr><tr><td><strong>Capacitor initial voltage (V)</strong></td><td>Specify the capacitor initial voltage, in volts, of the capacitors connected on the DC side of each power module. You can specify a single value that sets all the capacitor initial voltage to the same value, or specify a vector containing different initial voltage for every power module. The default value is 1000.</td></tr><tr><td><strong>Device on-state resistance (Ohms)</strong></td><td>Internal resistance of the switching devices, in ohms. This parameter is available only when you set the <strong>Model type</strong> parameter to Switching devices. The default value is 1e-3.</td></tr><tr><td><strong>Snubber resistance (Ohms)</strong></td><td>The snubber resistance, in ohms. To eliminate the snubbers, set the snubber resistance to inf. This parameter is available only when you set the <strong>Model type</strong> parameter to Switching devices. The default value is 1e6.</td></tr><tr><td><strong>Snubber capacitance (F)</strong></td><td>The snubber capacitance, in farads. To eliminate the snubbers, set the snubber capacitance to 0. This parameter is available only when you set the <strong>Model type</strong> parameter to Switching devices. The default value is inf.</td></tr><tr><td><strong>Diode on-state resistance (Ohms)</strong></td><td>Internal resistance of the diodes, in ohms. This parameter is available only when you set the <strong>Model type</strong> parameter to Switching function, Average model (Uref-controlled), or Aggregate model. The default value is 1e-3.</td></tr><tr><td><strong>Diode snubber resistance (Ohms)</strong></td><td>The snubber resistance, in ohms. To eliminate the snubbers, set the snubber resistance to inf. This parameter is available only when you set the <strong>Model type</strong> parameter to Switching function, Average model (Uref-controlled), or Aggregate model. The default value is 1e6.</td></tr><tr><td><strong>Diode snubber capacitance (F)</strong></td><td>The snubber capacitance in farads. To eliminate the snubbers, set the snubber capacitance to 0. This parameter is available only when you set the <strong>Model type</strong> parameter to Switching function, Average model (Uref-controlled), or Aggregate model. The default value is inf.</td></tr><tr><td><strong>Diode forward voltage (V)</strong></td><td>Forward voltage, in volts, across the diode when it is conducting. This parameter is available only when you set the <strong>Model type</strong> parameter to Switching function, Average model (Uref-controlled), or Aggregate model. The default value is 1e-3.</td></tr><tr><td><strong>Sample time (s)</strong></td><td>Specify the sample time of the block. To implement a continuous block, set to 0. This parameter is available only when you set the <strong>Model type</strong> parameter to Switching function, Average model (Uref-controlled), or Aggregate model. The default value is 10e-6.</td></tr></tbody></table>

## Inputs and Outputs

<table data-header-hidden><thead><tr><th width="237.199951171875"></th><th></th></tr></thead><tbody><tr><td><strong>g</strong></td><td>Vectorized gating signal that controls the converter. The gating signal contains the firing pulses to control two switches at each power module in the converter (double the <strong>Number of power modules</strong> pulses). This port is visible only when you set the <strong>Model type</strong> parameter to Switching devices or Switching function.</td></tr><tr><td><strong>Uref</strong></td><td>Vectorized reference voltage signal that controls the converter. The vectorized signal contains one reference voltage for each power module in the converter. This port is visible only when you set the <strong>Model type</strong> parameter to Average model (Uref-controlled).</td></tr><tr><td><strong>N</strong></td><td><p>Vectorized signal of two elements [<em>N_on</em>, <em>N_blk</em>]. <em>N_on</em> represents the number of power modules in the <em>ON</em> state, and <em>N_blk</em> the number of power modules in the blocked state. The number of power modules in the blocked state is normally set to zero for a nominal operation of the converter. The number of power modules in the <em>ON</em> state is obtained by summing all the pulses that trigger the upper switching devices (Q1) that are in the <em>ON</em> state.<em>N_blk</em> must be equal to <code>0</code> if the converter is deblocked and equal to the number of power modules if blocked. Then, as for the Average model, it is not possible to block an individual module.</p><p><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-eae9c739865da8619894f047fb8b373a459062f8%2Fhalf_bridge_MMC_model_diagram.png?alt=media" alt="" data-size="original"></p><p>This port is visible only when you set the <strong>Model type</strong> parameter to Aggregate model.</p></td></tr><tr><td><strong>BL</strong></td><td>You can block all firing pulses to the converter by applying a scalar signal value of 1 at the BL input. It is not possible to block an individual module. When the input signal is 1, all modules in the MMC are blocked.</td></tr><tr><td><strong>1</strong></td><td>Output terminal 1 of the converter.</td></tr><tr><td><strong>2</strong></td><td>Output terminal 2 of the converter.</td></tr><tr><td><strong>m</strong></td><td>Measurement signal containing the voltage of capacitors connected on the DC side of each power module. If you set the <strong>Model type</strong> parameter to Aggregate model, the measurement has only one element that gives the average value of all the capacitors.</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/smart-power-simulation-software-sps/blocks-functions-tools/power-converters/converters/half-bridge-mmc.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.
