> 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/model-and-simulation/create-a-circuit-model/add-custom-models.md).

# Add Custom Models

## Overview

Although the electrical circuit model and electric machine models cover the majority of simulation needs, most projects require some degree of customization. The Power Electronics Add-On for VeriStand was designed to enable users to extend its functionality to meet all requirements. Customization comes in two varieties depending on the simulation constraints:

1. Adding a VeriStand compatible simulation model
2. Integrating LabVIEW FPGA models into the [**Hardware Configuration**](https://www.opal-rt.com/docs/pe-add-on-simulink/hardware-configurations-reference/default-hardware-configurations.md).

## Importing a VeriStand Compatible Simulation Model to the CPU <a href="#importing-a-veristand-compatible-simulation-model-to-the-cpu" id="importing-a-veristand-compatible-simulation-model-to-the-cpu"></a>

The easiest customization path is to import custom simulation models into the VeriStand System Definition. Typically, these models are created using The MathWorks Simulink. Importing simulation models is a feature that is native to VeriStand, although the model inputs and outputs can be connected to the channels provided by the Power Electronics Add-On. For more information about this feature, please refer to the resources below:

* [How VeriStand Imports Models from MathWorks Simulink® Software](https://www.ni.com/documentation/en/veristand/latest/manual/import-models-simulink/)
* [Mapping Channels and Aliases](https://www.ni.com/docs/en-US/bundle/veristand/page/map-channel-alias.html)

Imported models are run on the real time CPU of the target (not the FPGA), and thus their timestep is limited by that of the Primary Control Loop (PCL)–typically between 1 ms and 0.1 ms. Due to this limitation, typical use cases for imported simulation models include custom mechanical loads attached to the electrical machine, or local converter controllers.

## Custom FPGA models <a href="#custom-fpga-models" id="custom-fpga-models"></a>

Models that need to run at timesteps smaller than 0.1 ms must be executed on the FPGA, which cannot be achieved by standard VeriStand model importing. For this reason, the Power Electronics Add-On was designed to allow custom or third-party models to be executed in parallel to OPAL-RT models on the FPGA. The skillset to implement custom FPGA models includes but is not limited to:

* NI LabVIEW
* NI LabVIEW FPGA
* NI LabVIEW Realtime
* VeriStand Custom Device development

To understand how to integrate a custom FPGA model into the Power Electronics Add-On, please contact [**OPAL-RT Technical Support**](https://www.opal-rt.com/contact-technical-support/).


---

# 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/model-and-simulation/create-a-circuit-model/add-custom-models.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.
