> 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/example-models/power-converters/ac-dc-three-level-pwm-converter.md).

# AC/DC Three-Level PWM Converter

This example shows the operation of an AC-DC three-level PWM Converter.

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

## Description

Converter rating: 500 Volts DC, 500 kW

* AC Supply: three-phase, 600 V, 30 MVA, 60 Hz system
* Voltage-sourced Converter (VSC):\
  \- Three-level, three-phase IGBT bridge (modeled using the "Three-Level Bridge" block) controlled by a PWM modulator (carrier frequency of 1620 Hz)\
  \- DC Link: 2 capacitors of 75000 uF
* Controller: The DC regulator uses two PI regulators to control the DC voltage while maintaining a unity input power factor for the AC supply.

## Simulation

### Simulation Parameters

* Discrete (no continuous states)
* Two sample times:\
  Ts\_Power = 5 µs (used by PSB for the simulation of the power system + converters)\
  Ts\_Control = 100 µs (used for the simulation of the DC regulator)

{% hint style="info" %}
Initial conditions are set at the start of the simulation (by automatically loading the file **ThreeLevelPWMVoltageSourceConverter.mat** prior to the simulation).\
This file has been generated by running an initial simulation to steady-state for an integer number of cycles of 60 Hz. The final states (both SPS and Simulink® controllers states) were saved in a structure with time, called xInit. This variable was saved in ThreeLevelPWMVoltageSourceConverter.mat file.
{% endhint %}

### Simulation results

* In the simulation (lasting 200 ms), we can observe the following signals: 1) the DC voltage (Vdc Scope) 2) the primary voltage and current (phase A) of the AC supply (VaIa Scope), 3) the device currents of leg A of the IGBT bridge (double-click on the "Measurements & Signals" block to look inside the "Ia\_Devices" Scope). 4) the phase-to-phase AC voltage generated by the VSC (Vab\_VSC Scope)
* At t=50 ms, a 200-kW load is switched-in. We can see that the dynamic response of the DC regulator to this sudden load variation (200 kW to 400 kW) is satisfactory. The DC voltage is back to 500 V within 1.5 cycle and the unity power factor on the AC side is maintained.
* At t=100 ms, a "Stop Pulsing" signal is activated (pulses normally sent to the converter are blocked). We can see that the DC voltage drops to 315 V. A drastic change in the primary current waveform can also be observed. When the pulses are blocked, the Three-Level Bridge block operation becomes similar to a three-phase diode bridge.

### Regenerate Initial Conditions

The initial states required to start in steady state have been saved in the ThreeLevelPWMVoltageSourceConverter.mat file. When you start simulation, the StartFcn callback (in the Model Properties/Callbacks) automatically loads into your workspace the contents of this .mat file ("xInit" variable).

If you modify this model or change parameter values of power components, the initial conditions stored in "xInit" will no longer be valid. To regenerate the initial conditions for your modified model, follow these steps:

{% stepper %}
{% step %}
In the Simulation/Configuration Parameters → Data Import/Export Parameters menu, clear the "Initial state" parameter and check the "Final states" parameter.
{% endstep %}

{% step %}
Double-click the Breaker block and temporarily disable the breaker closing by multiplying the "Switching time(s)" parameter by 100.
{% endstep %}

{% step %}
Double-click the Timer block labeled "0=Stop pulsing". Temporarily disable pulse blocking by multiplying the "Time(s)" parameter by 100.
{% endstep %}

{% step %}
Change the Simulation Stop Time to 0.5 second. Note: to generate initial conditions coherent with the 60 Hz voltage source phase angle, the Stop Time must be an integer number of 60 Hz cycles.
{% endstep %}

{% step %}
Start simulation. When completed, verify steady state by inspecting waveforms on the Ctrl\_Signals scope. The final states saved in the "xFinal" structure with time can be used as initial states for future simulations.

Execute these commands to copy and save the final conditions as initial conditions:

{% code lineNumbers="true" %}

```matlab
xInit = xFinal;
save myModel_init xInit
```

{% endcode %}
{% endstep %}

{% step %}
In File → Model Properties → Callbacks → StartFcn, change the name of the initialization file from "ThreeLevelPWMVoltageSourceConverter" to "myModel\_init". Next time you start a simulation with this model, the variable xInit saved in myModel\_init.mat will be loaded into your workspace.
{% endstep %}

{% step %}
In Simulation/Configuration Parameters, check "Initial state".
{% endstep %}

{% step %}
Start simulation and verify that your model starts in steady state.
{% endstep %}

{% step %}
Double-click the Breaker block and reset the "Switching time(s)" parameter back to 0.05 s (remove the 100 multiplication factor).
{% endstep %}

{% step %}
Double-click the Timer block labeled "0=Stop pulsing". Re-enable pulse blocking at t = 0.1 s by removing the 100 multiplication factor.
{% endstep %}

{% step %}
Change the Simulation Stop Time back to 0.2 s.
{% endstep %}

{% step %}
Save your model.
{% endstep %}
{% endstepper %}

## Command

Example model name: power\_3levelVSC

{% code lineNumbers="true" %}

```matlab
open('power_3levelVSC')
```

{% endcode %}


---

# 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/example-models/power-converters/ac-dc-three-level-pwm-converter.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.
