> 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/model-and-simulation/modular-multilevel-converters-mmc.md).

# Modular Multilevel Converters (MMC)

<https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145457429/VSC+Configuration+Block>

## Description <a href="#vscconfigurationblock-description" id="vscconfigurationblock-description"></a>

As VSC's topology may have many variants, each is made of same basic types of components, which are defined below so the user can flexibly configure them to form different VSC topologies.

**SM**:

The term Submodule (SM) is borrowed from the modular multi-level converter (MMC) referring to the basic unit consisting of several switches (IGBT/diode) and capacitors. Typical SM include Half-bridge (HB) SM, full-bridge (FB) SM, clamp-double (CD) SM, T-type SM (T-SM), and etc. In this block, SM is defined slightly different than the SM in an MMC. SM in this block only includes the switches part of a converter unit and doesn't include the capacitor. And furthermore, switches of one phase of 2-level converter (similar to HB SM), 3-level NPC converter, T-type converter (similar to T-SM) can also be deemed as an SM. Therefore, SM in this block is a group of switches which converts between ac and dc voltages. Normally, the dc side of SM is connected to a capacitor and the ac side of SM is connected to either a DAB or an interface node.

**Capacitor**:

The capacitor is excluded from SM because for some converter topologies, such as 2-level, NPC, T-type converters, multiple SM (phases) share the same capacitor. This block is flexible that capacitors can be either simulated inside the block (referred as internal capacitors) or externally using SPS capacitor blocks (referred as external capacitors). Note in this block, a capacitor can be in the form either with one single capacitor or with two (upper C1 and lower C2) capacitors connected in series with or without midpoint grounded.

**DAB**:

The converter can include Dual Active Bridge (DAB) or, in general, multi active bridge (MAB) converters. A DAB consists of several SM, the inductor/resistor and/or the transformer. In this block, the SM connected to DAB are called a DAB SM.

**Interface node**:

In this block, an interface node is a node connecting the ac side of SM and the external circuit. For a converter, such as 2-level, NPC, or T-type converter, one interface node represents one ac phase of the converter. For an MMC converter, one interface node represents a single-phase ac output of multiple SM connected in series. In this block, the SM connected to interface node are called an interface-node SM.

**How to configure the converter topology in this model?**

1. Identify the numbers of SM, Capacitors (internal and external), DAB, DAB SM, interface-node, and interface-node SM in the converter. Assuming:
2. N\_sm: number of SM
3. N\_c: number of capacitor
4. N\_cin: number of internal capacitor
5. N\_cex: number of external capacitor
6. N\_DAB: number of DAB
7. N\_smD: number of DAB SM, i.e. SM connected to DAB
8. N\_node: number of interface-node
9. N\_smN: number of interface-node SM, i.e. SM connected to interface-node
10. Name each SM, internal Capacitors, external capacitors, DAB, and nodes in numerical order:
11. SM-1, SM-2, … SM-N\_sm;
12. Cin-1, Cin-2, …, Cin-N\_cin;
13. Cex-1, Cex-2, …, Cex-N\_cex;
14. DAB-1, DAB-2, …, DAB-N\_DAB;
15. Node-1, Node-2, …, Node-N\_node;
16. Connect SM with capacitors using 'Cap index of SM' parameter.
17. A row vector of index with same dimension as number of SM;
18. The i-th element being j or -j (j is a positive integer) means the i-th SM is connected to the j-th capacitor;
19. j means the j-th internal capacitor; and -j means the j-th external capacitor. (Note the j-th internal capacitor and the j-th external capacitor are two different capacitors.)
20. Connect SM with DAB using 'DAB index of SM' parameter.
21. A row vector of index with same dimension as number of SM;
22. i-th element being j or -j (j is a positive integer) means the i-th SM is connected to the j-th DAB;
23. j means positive connection (the positive current of DAB flows into the SM's positive terminal) and -j means negative connection (the positive current of DAB flows into the SM's positive terminal) .
24. Connect SM with interface nodes using 'Interface-Node index of SM' parameter.
25. A row vector of index with same dimension as number of SM;
26. i-th element being j means i-th SM is connected to j-th Interface-Node;
27. Set other parameters properly in the mask.

**How to connect to external circuit?**

1. Properly configure the converter by setting the right parameters of this block. This block also do calculation for all internal voltages and currents.
2. Converter ac nodes:
3. For each ac interface node, put a [VSC Node Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145227875/VSC+Node+Block) from the library in the same subsystem containing this [VSC Configuration Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145457429/VSC+Configuration+Block). The [VSC Configuration Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145457429/VSC+Configuration+Block) and [VSC Node Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145227875/VSC+Node+Block)s should be in the same level.
4. Connect input/output signals between the node blocks and the converter config block. The node currents measured in node block are sent to converter config block. And calculated node voltages are sent back in the opposite direction.
5. Set a unique ID in the [VSC Node Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145227875/VSC+Node+Block) corresponding to the interface node ID in this converter config block.
6. Connect the external circuit to the ports of [VSC Node Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145227875/VSC+Node+Block)s which represent the interface nodes of the converter.
7. External capacitor:
8. For each external capacitor, put a [VSC External Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145424627/VSC+External+Capacitor+Block) from the library in the same subsystem containing this VSC Configuration Block. The VSC Configuration Block and [VSC External Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145424627/VSC+External+Capacitor+Block)s should be in the same level.
9. Connect input/output signals between the [VSC External Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145424627/VSC+External+Capacitor+Block)s and the VSC Configuration Block. The capacitor voltages measured in the [VSC External Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145424627/VSC+External+Capacitor+Block) are sent to the VSC Configuration Block. And the currents injecting into the external capacitor are sent back in the opposite direction.
10. Set a unique ID in the [VSC External Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145424627/VSC+External+Capacitor+Block) corresponding to the **Cex ID** in this VSC Configuration Block.
11. Connect the external circuit to the ports of [VSC External Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145424627/VSC+External+Capacitor+Block)s.
12. Internal capacitor:
13. For each Internal capacitor that connects to external circuit with extra charging path, put a [VSC Internal Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145359035/VSC+Internal+Capacitor+Block) from the library in the same subsystem containing this VSC Configuration Block. The VSC Configuration Block and [VSC Internal Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145359035/VSC+Internal+Capacitor+Block)s should be in the same level.
14. Connect input/output signals between the [VSC Internal Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145359035/VSC+Internal+Capacitor+Block)s and the VSC Configuration Block. The charging currents from external circuit are measured in the [VSC Internal Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145359035/VSC+Internal+Capacitor+Block) and sent to the VSC Configuration Block. And the capacitor voltage of the internal capacitor are sent back in the opposite direction.
15. Set a unique ID in the [VSC Internal Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145359035/VSC+Internal+Capacitor+Block) corresponding to the **Cin ID** in this VSC Configuration Block.
16. Connect the external circuit to the ports of [VSC Internal Capacitor Block](https://opal-rt.atlassian.net/wiki/spaces/PMMCDoc/pages/145359035/VSC+Internal+Capacitor+Block)s.

<br>


---

# 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/model-and-simulation/modular-multilevel-converters-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.
