> 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/example-models/mmc-example-models/hvdc-point-to-point-link-with-two-mmcs.md).

# HVDC Point-to-Point Link with two MMCs

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

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-ed4e8e6fe8119895edefbc361945ece1b9e7c825%2Fmmc-hvdc-ex.png?alt=media" alt=""><figcaption></figcaption></figure>

The **MMC HVDC P2P** example can be created by starting a new RT‑LAB project. From the menu bar, select **File > New > RT‑LAB Project**. Enter a name and location for your project, then click **Next**. From the available templates list, navigate to **MMC** and select **MMC\_HVDC\_P2P**, then click **Finish**.

This example model simulates a point‑to‑point HVDC link comprising two modular multilevel converter (MMC) stations. The main objectives are to demonstrate CPU and FPGA implementations (including Switching Function and Average models), showcase MMC station control and operating procedures, and enable the study of steady‑state behavior, transients, and fault responses.

### Model overview

The model consists of two MMC stations forming a point‑to‑point HVDC link, separated into two computation subsystems:

* **SM\_MMC1etCntrl**: High‑level control for both stations and the **first** MMC station model (transformer, breakers, AC grid), MMC Valves block, and the station’s **low‑level** control.
* **SS\_MMC2**: **Second** MMC station model (transformer, breakers, AC grid), MMC Valves block, and the station’s **low‑level** control.

And one console subsystem:

* **SC\_Console**: Operator console with displays, constants, and parameter blocks to set power references and MMC parameters; includes scopes for waveforms.

The model uses **MMCValves** block (usable for half‑bridge, full‑bridge, and clamp‑double submodules) which supports:

* Adjustable SM **capacitance** and **discharge resistance** during simulation.
* **Dead time** between each upper/lower gate pair.
* Simulation of **temporary or permanent SM‑capacitor short circuits**.
* **Normal** and **debugging** modes; in debugging, SM capacitor voltages can be forced to an **average** value (bypassing balancing temporarily) or to a **fixed** value.

This demo uses **half‑bridge submodules (HBSM)**; controls are adapted for HBSM and full‑bridge (FBSM). The model can be configured for half‑bridge, full‑bridge, clamp‑double, and T‑type cells. The demo is set to **50** submodules (SMs) per valve (can be adjusted in the initialization file `init_HVDC_2Stations_MMC.m`, located in the Simulink model directory).

{% hint style="info" %}
**Performance note:** For >50 SMs per valve, use FPGA. On CPU, multiple MMC blocks can be stacked to exceed 50 SMs/valve, but with real‑time performance limitations.
{% endhint %}

### Test system and parameters <a href="#testsystemandparameters" id="testsystemandparameters"></a>

The system corresponds to the arrangements depicted below:

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-62b83b2b38cdbe4a4756a187446b517825712bf2%2Fmmc-hvdc-ex2.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-9635145ca6ffe5b2e52576471e5a0190dbc71a83%2Fmmc-hvdc-ex3.png?alt=media" alt=""><figcaption></figcaption></figure>

The key parameters are:

* Grid voltage & frequency (Terminal 1): **400 kV**, **50 Hz**
* Grid voltage & frequency (Terminal 2): **400 kV**, **50 Hz**
* Transformer rating: **1400 MVA**; ratio: **400 kV / 320 kV**; impedance: **10%**
* Arm inductance L\_arm: **24 mH**
* MMC rating: **1000 MVA**
* SMs per valve (each MMC): **50**
* SM capacitance: $$2.5\times 10^{-5}\times NbSMs = 1.3\~\mathrm{mF}\ for\ 50\ SMs$$
* DC link Voltage: **± 290 kV**

This implementation can run on either the **CPU** or the **FPGA**, and the execution mode is selected using the **DEMOModelConfig** block in the **SC\_Console** subsystem.

* On the **CPU**, both the **Switching Function (SWF)** detailed model and the **Average Value Model (AVM)** are available.
* On the **FPGA**, only the detailed **SWF** model is supported.

To continue:

* For **CPU implementation**, refer to the **CPU implementation** tab on this page.
* For **FPGA implementation**, refer to the **FPGA implementation** tab on this page.

## Requirements <a href="#requirements" id="requirements"></a>

{% tabs %}
{% tab title="CPU implementation" %}

#### Simulator license

[Verify that an active RT-LAB license](https://www.opal-rt.com/docs/rt-lab/licensing-reference/simulator-license.md) with the following features is installed on the simulator to run this example model:

<table><thead><tr><th width="259.63629150390625">Feature Name</th><th width="109.5455322265625">Required Status</th><th>Description</th></tr></thead><tbody><tr><td>RTLAB_NUM_CORES</td><td>2 enabled (or more)</td><td>Activated cores for real-time simulation</td></tr><tr><td>ARTEMIS_RT</td><td>enabled</td><td>Real-time simulation with ARTEMiS toolbox</td></tr><tr><td>ARTEMIS_NUM_CORES</td><td>2 enabled (or more)</td><td>Activated cores for real-time simulation with ARTEMiS toolbox</td></tr><tr><td>ARTEMIS_NBSTATE</td><td>27 enabled (or more)</td><td>Activated electrical states for real-time simulation with ARTEMiS toolbox</td></tr><tr><td>ARTEMIS_SSN</td><td>enabled</td><td>SSN add-on blockset to ARTEMiS for optimizing electrical system models using an advanced decoupling technique</td></tr><tr><td>ARTEMIS_MMC_CONTROLLER</td><td>enabled</td><td>MMC high-level control blocks on CPU</td></tr></tbody></table>
{% endtab %}

{% tab title="FPGA implementation" %}

#### FPGA

This example model is designed for simulators and/or expansion units equipped with **VC707** FPGA boards. Refer to your **System Description Document** for details specific to the FPGA board used in your system.

#### Simulator license

[Verify that an active RT-LAB license](https://www.opal-rt.com/docs/rt-lab/licensing-reference/simulator-license.md) with the following features is installed on the simulator to run this example model:

<table><thead><tr><th width="259.63629150390625">Feature Name</th><th width="109.5455322265625">Required Status</th><th>Description</th></tr></thead><tbody><tr><td>RTLAB_NUM_CORES</td><td>2 enabled (or more)</td><td>Activated cores for real-time simulation</td></tr><tr><td>ARTEMIS_RT</td><td>enabled</td><td>Real-time simulation with ARTEMiS toolbox</td></tr><tr><td>ARTEMIS_NUM_CORES</td><td>2 enabled (or more)</td><td>Activated cores for real-time simulation with ARTEMiS toolbox</td></tr><tr><td>ARTEMIS_NBSTATE</td><td>27 enabled (or more)</td><td>Activated electrical states for real-time simulation with ARTEMiS toolbox</td></tr><tr><td>ARTEMIS_SSN</td><td>enabled</td><td>SSN add-on blockset to ARTEMiS for optimizing electrical system models using an advanced decoupling technique</td></tr><tr><td>ARTEMIS_MMC_CONTROLLER</td><td>enabled</td><td>MMC high-level control blocks on CPU</td></tr><tr><td>XSG_MMC_VALVES</td><td>12 (or more)</td><td>Activated MMC valves on FPGA</td></tr><tr><td>XSG_MMC_VALVES_CONTROLLERS</td><td>12 (or more)</td><td>Activated MMC valve controllers on FPGA</td></tr><tr><td>XSG_MMC_CELLS_PER_VALVE</td><td>512<strong>*</strong> (or more)</td><td>Activated MMC cells per valve on FPGA</td></tr></tbody></table>

**\***&#x43;orresponds to the limit set in the file **`init_HVDC_2Stations_MMC.m`**, located in the Simulink model directory. You may open this file and set the variable **`lib_nb_cells`** equal to **`nb_HBSM_T1`** and **`nb_HBSM_T2`**, which are both set to **50**. In this case, **`XSG_MMC_CELLS_PER_VALVE`** must be **50 or greater**.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-829f710a09c5547a2fbba26368c3fa1c6193e9c9%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Detailed explanation <a href="#detailedexplanation" id="detailedexplanation"></a>

{% tabs %}
{% tab title="CPU implementation" %}

#### Steps to run the model <a href="#modeloverviewandselection" id="modeloverviewandselection"></a>

1. **Adjust the initialization file**\
   Open the file **`init_HVDC_2Stations_MMC.m`** located in the Simulink model directory.\
   Modify parameters as needed (it may also be used as‑is). Save your changes.
2. **Adapt the Simulink model**\
   Open the Simulink model and navigate to the **SC\_Console** subsytem, then double‑click the **DEMOModelConfig** block; select the desired **Model Type** for both **MMC1** and **MMC2**, ensuring that both are set to **CPU**, and finally click **Configurate Model** to apply the settings.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-3fc1d301464c8e5ffefab74e79bfbf85f36cc585%2Fmmc-hvdc-ex4.png?alt=media" alt=""><figcaption></figcaption></figure>

3. **Build the model in RT‑LAB**\
   Save changes in Simulink. Then, build the model in RT-LAB.
4. **Set the execution mode**\
   For real‑time operation in RT‑LAB, set **Real‑Time mode** to **Software synchronized**.
5. **Load and execute the model**\
   In RT‑LAB, **Load** and **Execute** the model.
6. **Control and monitor the system**\
   Use the **console subsystem** to interact with the model and observe simulation results.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-da0d37cdefbe1562ad40879025015e66952b2677%2Fmmc-hvdc-ex5.png?alt=media" alt=""><figcaption></figcaption></figure>

**Controls**

* **Pac**: Active‑power reference (p.u.), adjustable from **−0.8** to **0.8** p.u.
* **QacT1**, **QacT2**: Reactive‑power references at Terminals 1 and 2 (p.u.), adjustable from **−0.3** to **0.3** p.u.
* **MMC parameters**: Set according to the model type (mask values are initialized from the initialization file variables).
* **Enable Pulses** (within each **MMCValvesParam** block): Enable/disable gating for the converters at Terminals 1 and 2.
* **DataLog**: **1** to enable, **0** to disable logging (stores scope data to a MATLAB file from real‑time simulation for offline analysis).
* **DCCB**: DC breaker status (**1** closed, **0** open).
* **ACCBT1**, **ACCBT2**: AC breaker statuses at Terminals 1 and 2 (**1** closed, **0** open).

**Monitoring (Scopes “T1” and “T2”; all in p.u. unless noted)**

* DC voltage and current
* 3‑phase voltages and currents
* 3‑phase active and reactive powers
* MMC arm currents
* **MMC valve voltages** (SI units)
* **Average MMC SM capacitor voltages**
  {% endtab %}

{% tab title="FPGA implementation" %}
{% hint style="info" %}
In FPGA mode, the number of SMs per valve is limited by the license; the **standard firmware supports up to 511 SMs per valve** (higher counts available upon request).
{% endhint %}

**Steps to Run the Model**

1. **Adjust the initialization file**\
   Open the file **`init_HVDC_2Stations_MMC.m`** located in the Simulink model directory.\
   Modify parameters as needed (it may also be used as‑is). Save your changes.
2. **Adapt the Simulink model**\
   Open the Simulink model and navigate to the **SC\_Console** subsytem, then double‑click the **DEMOModelConfig** block; select the desired **Model Type** for both **MMC1** and **MMC2**, ensuring that at least one of the two is set to **FPGA**, and finally click **Configurate Model** to apply the settings.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-3fc1d301464c8e5ffefab74e79bfbf85f36cc585%2Fmmc-hvdc-ex4.png?alt=media" alt=""><figcaption></figcaption></figure>

3. **Build the model in RT‑LAB**\
   Save changes in Simulink. Then, build the model in RT-LAB.
4. **Configure real‑time execution mode**\
   For real‑time execution, set RT‑LAB’s **Real‑Time mode** to **Hardware synchronized**.
5. **Load and execute the model**\
   In RT‑LAB, **Load** and **Execute** the model.
6. **Control and monitor the system**\
   Use the **console subsystem** to interact with the model and observe simulation results.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-da0d37cdefbe1562ad40879025015e66952b2677%2Fmmc-hvdc-ex5.png?alt=media" alt=""><figcaption></figcaption></figure>

**Controls**

* **Pac**: Active‑power reference (p.u.), adjustable from **−0.8** to **0.8** p.u.
* **QacT1**, **QacT2**: Reactive‑power references at Terminals 1 and 2 (p.u.), adjustable from **−0.3** to **0.3** p.u.
* **MMC parameters**: Set according to the model type (mask values are initialized from the initialization file variables).
* **Enable Pulses** (within each MMC parameter block): Enable/disable gating for the converters at Terminals 1 and 2.
* **DataLog**: **1** to enable, **0** to disable logging (stores scope data to a MATLAB file from real‑time simulation for offline analysis).
* **DCCB**: DC breaker status (**1** closed, **0** open).
* **ACCBT1**, **ACCBT2**: AC breaker statuses at Terminals 1 and 2 (**1** closed, **0** open).

**Monitoring (Scopes “T1” and “T2”; all in p.u. unless noted)**

* DC voltage and current
* 3‑phase voltages and currents
* 3‑phase active and reactive powers
* MMC arm currents
* **MMC valve voltages** (SI units)
* **Average MMC SM capacitor voltages**
  {% endtab %}
  {% endtabs %}

### Operating procedure (typical) <a href="#operatingproceduretypical" id="operatingproceduretypical"></a>

1. **Pre‑charge**: All breakers open; pulses disabled; capacitors pre‑charge; Terminal 1 DC voltage ≈ **0.6 p.u.**
2. Close **ACCBT1**; pulses remain disabled; Terminal 1 DC voltage ≈ **0.7 p.u.**
3. **Enable pulses** at Terminal 1; Terminal 1 DC voltage reaches **1.0 p.u.**
4. Set **QacT1**; measured reactive power tracks the reference.
5. Repeat steps 2–4 for Terminal 2.
6. Close **DCCB**; set **Pac**; measured active power tracks the reference.

## Simulation and results <a href="#simulationandresults" id="simulationandresults"></a>

{% tabs %}
{% tab title="CPU implementation" %}
Terminal 1 runs **SFM** (Switching Function Model) and Terminal 2 runs **AVM**. Follows the operating steps listed above. Setpoints: **Pac = 0.8 p.u.**, **QacT1 = 0 p.u.**, **QacT2 = 0 p.u.**

**Terminal 1 measurements** during steady state operation of the system illustrates that active and reactive powers track their references:

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-e746763935e5f8842efe83e7571cb9e81ae7af4d%2Fmmc-hvdc-ex6.png?alt=media" alt=""><figcaption></figcaption></figure>

**Terminal 2 measurements** during steady state operation of the system illustrates that active and reactive powers track their references:

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-7041717746a161c702427879b18a0013bcbd186a%2Fmmc-hvdc-ex7.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="FPGA implementation" %}
Terminal 1 and terminal 2 are operating in FPGA model type. Follows the operating steps listed above. Setpoints: **Pac = 0.8 p.u.**, **QacT1 = -0.3 p.u.**, **QacT2 = 0.2 p.u.**

* Simulation starts at t=0 s, all the breakers are open, pulses are disabled, and set-points are set to zero.
* ACCBT1 is closed around t=0.225 s and pulse for MMC1 is enabled at t=0.35 s.
* ACCBT2 is closed around t=0.56 s and pulse for MMC1 is enabled at t=0.77 s.
* DCCB is closed around at t=1.05 s.
* The response during these CBs closing and pulses enable for both MMC1 and MMC2 can observe in terminal 1 and terminal 2.
* At t=1.33, active power reference Pac is set as 0.8 p.u., Around t= 0.2s and t=0.26 s, QacT1 and QacT2 set-points changed are set as -0.3 p.u. and 0.2 p.u., respectively.

**Terminal 1 measurements** during start-up, changing set-parameters of **Pac**, **QacT1**, and **QacT2** while model running on FPGA:

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-784b436973d1db874b5d0487f19a398a254e74ea%2Fmmc-hvdc-ex8.png?alt=media" alt=""><figcaption></figcaption></figure>

**Terminal 2 measurements** during start-up, changing set-parameters of **QacT2** while model running on FPGA:

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-98e2f0c1297f77c67fffe49e0a5ea541bac6a86d%2Fmmc-hvdc-ex9.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## References <a href="#references" id="references"></a>

W. Li et J. Belanger, “An equivalent circuit method for modelling and simulation of modular multilevel converters in real-time HIL test bench,” IEEE Transactions on Power Delivery, vol. 31, no. 15, pp. 240—2409, 2016.

W. Li, L. -A. Grégoire and J. Bélanger, "A Modular Multilevel Converter Pulse Generation and Capacitor Voltage Balance Method Optimized for FPGA Implementation," in IEEE Transactions on Industrial Electronics, vol. 62, no. 5, pp. 2859-2867, May 2015, doi: 10.1109/TIE.2014.2362879.


---

# 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/example-models/mmc-example-models/hvdc-point-to-point-link-with-two-mmcs.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.
