> 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/simulation-control-monitoring-and-logging/simulate-a-drive-with-a-machine.md).

# Simulate a Drive with a Machine

## Overview

Different modeling resources within the FPGA design are used to simulate different parts of the electrical model. For example, in the case of a drive system, the power electronics circuit containing linear elements is simulated using the **eHS Solver**, whereas the machine configuration is simulated with a [**Machine Model**](https://www.opal-rt.com/docs/pe-add-on-simulink/model-and-simulation/add-and-configure-a-circuit-model-to-the-system-definition/machine-section.md). Due to this decoupling of the two parts of the simulation, additional considerations must be made when simulating a drive coupled to a machine.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FXy8ZgZYbk6zz7DmILRHD%2Fe8965e72-a9ee-411f-9115-89c40b9708c3.png?alt=media&amp;token=b59336c8-ec33-4043-8c7e-8f6051a271a8" alt=""><figcaption></figcaption></figure>

### Interface Requirements to Couple a Drive and a Machine

To couple a drive circuit with a machine, specific sets of [**Sources**](https://www.opal-rt.com/docs/pe-add-on-simulink/model-and-simulation/add-and-configure-a-circuit-model-to-the-system-definition/sources-section.md) and [**Measurements**](https://www.opal-rt.com/docs/pe-add-on-simulink/model-and-simulation/add-and-configure-a-circuit-model-to-the-system-definition/measurements-section.md) must be added to the circuit model. Typically include the following interface elements:

* Measurements for the phase voltages that will be output from the drive model (eHS) and fed into the machine model.
* Sources for the currents that will be output from the machine model and injected into the drive model (eHS).
* RC snubbers to compensate for the decoupling of the two solvers on the FPGA. See “Tuning the Snubber Values” below for more information.

A set of [**Template Circuits**](https://www.opal-rt.com/docs/pe-add-on-simulink/examples/template-circuits.md) is available in the **Examples** directory to serve as a starting point when designing a circuit model for a machine drive.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FtcHnoJwRUZYmmRhAH1jP%2Fef68626d-6d99-4919-8921-1395741f8830.png?alt=media&amp;token=fa640b49-e135-4872-b3d8-0e3bd252c01f" alt=""><figcaption></figcaption></figure>

## Configuring the Mapping between the Drive and the Machine

1. In the VeriStand System Definition, navigate to the **Machine Model configuration page**.
2. Under **Input Mapping Configuration**, map the appropriate voltage **Measurements** of the circuit to the inputs of the machine model. The available machine inputs may differ depending on the selected Machine Model. Refer to the **Template Circuits** for examples of connections made to different machines.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FNn2B6aTIYaz1y0v8QVo7%2Fb60134ce-a698-4248-ba07-10373ad502b6.png?alt=media&amp;token=09c60de1-0fbf-4146-8d55-e04f00bc05ff" alt=""><figcaption></figcaption></figure>

3. Navigate to the **Sources configuration page** and map the outputs of the machine model to the corresponding current sources in the circuit model. The available machine outputs may differ depending on the selected Machine Model. Refer to the **Template Circuits** for examples of connections made to different machines.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FrxnIqM3KKt4DWJNVp8VN%2F60b8e368-b0b4-49f2-9b57-2b24588a4f20.png?alt=media&amp;token=ecc43216-3dd2-4532-b9e2-2d74e27e1c18" alt=""><figcaption></figcaption></figure>

## Tuning the Snubber Values

An RC snubber is often used to stabilize the decoupling of two solvers on the FPGA (e.g., eHS solver & a machine). Ideal snubber values can be calculated based on parameters such as:

* Nominal speed of the machine being simulated
* Power rating of the machine being simulated

{% hint style="info" %}
For details on how to select a snubber value for your simulation, please contact [**OPAL-RT Technical Support**](http://www.opal-rt.com/contact-technical-support/).
{% endhint %}


---

# 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/simulation-control-monitoring-and-logging/simulate-a-drive-with-a-machine.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.
