> 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/pe-add-on-simulink/examples/template-circuits.md).

# Template Circuits

## Description

The **Template Circuits directory** contains a set of circuits specifically designed for use with **Machine Models**. These templates provide a convenient starting point when simulating a machine and its drive system. Refer to the table below for the locations of the available Template Circuits.

Available circuits and compatibility with each of the Machine Models:

<table><thead><tr><th width="312.66668701171875">Circuit</th><th>Compatible Machines</th></tr></thead><tbody><tr><td><strong>Three Phase Open Winding</strong></td><td>IM SM</td></tr><tr><td><strong>Two-Level Inverter Field Voltage</strong></td><td>IM SM (RRSM)</td></tr><tr><td><strong>Two-Level Inverter Six Phase</strong></td><td>6-Phase PMSM BLDC</td></tr><tr><td><strong>Two-Level Inverter Three Phase</strong></td><td>PMSM BLDC, PMSM SH, IM SM (SCIM), IM with Saturation</td></tr></tbody></table>

## Detailed explanation

### Three Phase Open Winding

The Three‑Phase Open‑Winding model is designed for use with either machine type in the **IM SM machine model** when the **Zero Sequence option is enabled**. The Zero Sequence model allows the simulation of unbalanced conditions in an open‑winding configuration. When this option is included, all three stator phase currents must be mapped back to the circuit model, instead of the usual two‑current mapping used when the zero‑sequence path is not modeled. To adapt this circuit for use with the Round Rotor Synchronous Machine type within the IM SM model, add a Field Voltage circuit as shown in the Two‑Level Inverter Field Voltage circuit template.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FWlIqvZZ0nodvaSB3RxJv%2Fimage.png?alt=media&amp;token=96126f87-a1bf-40c9-b7e2-d8c4d299396d" alt=""><figcaption><p><em>Three Phase Open Winding.slx</em></p></figcaption></figure>

### Two-Level Inverter Field Voltage

The Two-Level Inverter with Field Voltage model is intended for use with the **IM SM machine model** configured as a **Round Rotor Synchronous Machine**.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FnUngGrBr1LCFNN9ZJwmY%2Fimage.png?alt=media&amp;token=54024915-08d8-4b76-a8ae-6f93750155f1" alt=""><figcaption><p><em>Two-Level Inverter Field Voltage.slx</em></p></figcaption></figure>

### Two-Level Inverter Six Phase

The Six-Phase, Two-Level Inverter model is intended for use with the **6-Phase PMSM BLDC model**.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2F9o4i03T22c3H7oRQr8KB%2Fimage.png?alt=media&amp;token=67313cca-1229-4b2b-b5d6-a1eb8ef72a33" alt=""><figcaption><p><em>Two-Level Inverter Six Phase.slx</em></p></figcaption></figure>

### Two-Level Inverter Three Phase

The Three-Phase, Two-Level Inverter model is intended for use with most three-phase machine models, such as the **PMSM BLDC**, the **PMSM SH**, the **IM SM model** configured as a Squirrel-Cage Induction Machine, and the **IM with Saturation**.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FszMtmnauKZ0BkfNFoscm%2Fimage.png?alt=media&amp;token=13d74e97-5e7e-4f0f-920a-395792f8b81a" alt=""><figcaption><p>Two-Level Inverter Three Phase.slx</p></figcaption></figure>

## Configuration

### Integrate a template circuit into a VeriStand project

1. Create a new VeriStand Project and add the Power Electronics Add-On to the System Definition.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2Fn5fCewIjKb0v1cCoT5uh%2Fimage.png?alt=media&amp;token=f539adaa-ce2f-446d-aa5c-3538c4fbd174" alt="" width="496"><figcaption></figcaption></figure>

2. Select the hardware configuration at this step

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FheS3754NMIofUL0vNbIy%2Fimage.png?alt=media&amp;token=16a4ab5f-fe82-4231-9aa5-a6af453485a2" alt="" width="563"><figcaption></figcaption></figure>

3. Add the circuit model

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FnwmVmPPQtx75Q9OSvxOt%2Fimage.png?alt=media&amp;token=6a21df5e-9481-4ba0-a824-7f8655e8dc1b" alt="" width="563"><figcaption></figcaption></figure>

### Mapp all the connections

Expand the sections below to follow the mapping connections to make with your template

<details>

<summary><strong>Three Phase Open Winding</strong></summary>

1- Navigate to the **Machine Model configuration page**, under **Input Mapping Configuration**, map the three phase voltage Measurements to inputs of the machine model.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FmqcWxtAcTOG05IgDzYXU%2Fimage.png?alt=media&amp;token=0c3370c2-d6c6-4ccf-bec7-a924bb03a24c" alt=""><figcaption></figcaption></figure>

2- Navigate to the **Sources configuration page**, map the three Stator Current Phase outputs of the machine model back to the current sources and provide the required signals for both DC voltage sources in the model, Vdc and Vdc1.

{% hint style="info" %}
Selecting the CPU (VeriStand) option allows the DC voltages to be controlled from the User Interface. Alternately, signals could be provided through the Analog Input channels.
{% endhint %}

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FW2avQoTutxMDeddjAQcN%2Fimage.png?alt=media&amp;token=0650d3ef-5731-41a6-8b61-ae83aebd4d8c" alt=""><figcaption></figcaption></figure>

3- Navigate to the **Switches configuration page**, configure the switch mappings as required by the application. In a typical HIL application, the inverter IGBTs are controlled by an external signal physically connected to a Digital Input channel.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2Fr0dJ83zdahdkzX8FlWcT%2Fimage.png?alt=media&amp;token=fcadd43c-9691-4f71-abb1-d3bdc4f81b38" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><strong>Two-Level Inverter Field Voltage</strong></summary>

1- Navigate to the **Machine Model configuration page**, under **Input Mapping Configuration**, map the three phase voltage Measurements to inputs of the machine model.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FAWcuzUkImnTQlkLr2Wg6%2Fimage.png?alt=media&amp;token=debfe915-090a-4be6-8b67-5fb1f40fb165" alt=""><figcaption></figcaption></figure>

2- Navigate to the **Sources configuration page**, map the three Stator Current Phase outputs of the machine model back to the current sources and provide the required signals for DC voltage sources in the model.

{% hint style="info" %}
Selecting the CPU (VeriStand) option allows the DC voltages to be controlled from the User Interface. Alternately, signals could be provided through the Analog Input channels.
{% endhint %}

This model simulates a three-phase voltage source and diode rectifier feeding the inverter. The source voltages, Va\_in, Vb\_in, and Vc\_in, can be controlled using the **Sinewave Generators**. Alternately, these components could be replaced with a single DC voltage source, as demonstrated in the Three Phase Open Winding circuit model.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FDFoVk2cgir5a7JoKAenH%2Fimage.png?alt=media&amp;token=d6872260-7de8-44e2-ab07-6a2049d83ebe" alt=""><figcaption></figcaption></figure>

3- Navigate to the **Switches configuration page**, configure the switch mappings as required by the application. In a typical HIL application, the inverter IGBTs are controlled by an external signal physically connected to a Digital Input channel.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2Fhf39oPPicmixHNJDwezm%2Fimage.png?alt=media&amp;token=eb3c0399-fa77-45b2-a9a7-cfed7cd19b71" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><strong>Two-Level Inverter Six Phase</strong></summary>

1- Navigate to the **Machine Model configuration page**, under **Input Mapping Configuration**, map the three phase voltage Measurements to inputs of the machine model.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2Fds4d6JJIqG4bFsVgpJEv%2Fimage.png?alt=media&amp;token=dae91919-102d-481c-a7ba-bcf489ce89e9" alt=""><figcaption></figcaption></figure>

2- Navigate to the **Sources configuration page**, map the three Current Phase outputs of the machine model back to the current sources and provide the required signals for DC voltage sources in the model.

{% hint style="info" %}
Selecting the CPU (VeriStand) option allows the DC voltages to be controlled from the User Interface. Alternately, signals could be provided through the Analog Input channels.
{% endhint %}

This model simulates a three-phase voltage source and diode rectifier feeding the inverter. The source voltages, Va\_in, Vb\_in, and Vc\_in, can be controlled using the **Sinewave Generators**. Alternately, these components could be replaced with a single DC voltage source, as demonstrated in the Three Phase Open Winding circuit model.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FRVbihVoJVInL7NHof4s3%2Fimage.png?alt=media&amp;token=813505e8-c543-46ae-8579-d8888bb6d907" alt=""><figcaption></figcaption></figure>

3- Navigate to the **Switches configuration page**, configure the switch mappings as required by the application. In a typical HIL application, the inverter IGBTs are controlled by an external signal physically connected to a Digital Input channel.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FjmuTQQ4mNvHHhmrH624O%2Fimage.png?alt=media&amp;token=fab7d764-0c86-46c0-9305-fa7b49df6073" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><strong>Two-Level Inverter Three Phase</strong></summary>

1- Navigate to the **Machine Model configuration page**, under **Input Mapping Configuration**, map the three phase voltage Measurements to inputs of the machine model.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FSfNYk0rT9Slf7muDBVsg%2Fimage.png?alt=media&amp;token=8a393687-a539-4335-817c-e3f6330bbe54" alt=""><figcaption></figcaption></figure>

2- Navigate to the **Sources configuration page**, map the Current Phase outputs of the machine model back to the current sources and provide the required signals for DC voltage sources in the model.

{% hint style="info" %}
Selecting the CPU (VeriStand) option allows the DC voltages to be controlled from the User Interface. Alternately, signals could be provided through the Analog Input channels.
{% endhint %}

This model simulates a three-phase voltage source and diode rectifier feeding the inverter. The source voltages, Va\_in, Vb\_in, and Vc\_in, can be controlled using the **Sinewave Generators**. Alternately, these components could be replaced with a single DC voltage source, as demonstrated in the Three Phase Open Winding circuit model.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FQNT6Pjxq7vQYdXkP2Njm%2Fimage.png?alt=media&amp;token=be5dbac3-a751-408f-bfb2-81448549372e" alt=""><figcaption></figcaption></figure>

3- Navigate to the **Switches configuration page**, configure the switch mappings as required by the application. In a typical HIL application, the inverter IGBTs are controlled by an external signal physically connected to a Digital Input channel.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FnMAVTLmp9Jad32YB8oMF%2Fimage.png?alt=media&amp;token=370c1dbc-8780-4923-b0e3-8a35ac0dcc28" alt=""><figcaption></figcaption></figure>

</details>


---

# 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/pe-add-on-simulink/examples/template-circuits.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.
