> 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/simulink-blocks-reference/efpgasim-library/simulink-sps-workflow/machines/induction-machine-command.md).

# Induction Machine Command

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-4548ce8396f53fd8cff34d3ae9c54f3f5cc2a202%2Fehs-machine-induction-block.png?alt=media" alt="" width="300"><figcaption></figcaption></figure>

The **Induction Machine Command** block, located in the **eFPGAsim/External circuit editor workflow/Machines** library, provides configuration and control of an Induction Machine (IM) model. The IM solver core is implemented on an FPGA-based board and operates at a higher sampling rate than the RT-LAB system.

## Model equations

### Park transform

Although the model exchanges signals in the phase domain, its internal equations are expressed in the d-q reference frame. The corresponding Park transformation is given below:

$$
\begin{bmatrix} V\_d \ V\_q \end{bmatrix} = T \begin{bmatrix} V\_a \ V\_b \ V\_c \end{bmatrix}  \\\[8pt]
T = \sqrt{\frac{2}{3}} \begin{bmatrix} \cos(\theta) & \sin(\theta) \\\[4pt] -\sin(\theta) & \cos(\theta) \end{bmatrix} \begin{bmatrix} 1 & -\frac{1}{2} & -\frac{1}{2} \\\[4pt] 0 & \frac{\sqrt{3}}{2} & -\frac{\sqrt{3}}{2} \end{bmatrix}
$$

Since the model is computed in a fixed reference frame, the transformation is evaluated with **θ = 0** for stator variables and **θ = −θ**<sub>**rotor**</sub> for rotor variables. This approach accounts for the rotor position while maintaining a stationary reference frame

### Electrical equation

The FPGA-based machine model solves the following set of equations. The electrical parameters of the machine can be tuned through the parameter entries provided in this mask.

$$
\frac{d\psi\_{dq}}{dt} = \left(RL^{-1}+\Omega\right)\cdot\psi\_{dq} + i\_{4}\cdot V\_{dq} \\\[8pt]
I\_{dq} = L^{-1}\cdot\psi\_{dq}  \\\[8pt]
\text{Where }V\_{dq} = \begin{bmatrix} V\_{sd}\ V\_{sq}\ V\_{rd}\ V\_{rq} \end{bmatrix}  \space \text{Machine Voltage array in the dq domain}\\\[8pt]
\text{and } \psi\_{dq} = \begin{bmatrix} \psi\_{sd}\ \psi\_{sq}\ \psi\_{rd}\ \psi\_{rq} \end{bmatrix} \space \text{Machine flux array in the dq domain} \\\[16pt]
\Omega = \begin{bmatrix} 0 & 0 & 0 & 0\\\[2pt] 0 & 0 & 0 & 0\\\[2pt] 0 & 0 & 0 & -\omega\_e\\\[2pt] 0 & 0 & \omega\_e & 0 \end{bmatrix}  \\\[8pt]
R = \begin{bmatrix} -R\_s & 0 & 0 & 0\\\[2pt] 0 & -R\_s & 0 & 0\\\[2pt] 0 & 0 & -R\_r' & 0\\\[2pt] 0 & 0 & 0 & -R\_r' \end{bmatrix} \\\[8pt]
L^{-1} = \frac{1}{L\_r\left(L\_m+L\_{ls}'\right)-L\_m^2} \begin{bmatrix} L\_r & 0 & -L\_m & 0\\\[2pt] 0 & L\_r & 0 & -L\_m\\\[2pt] -L\_m & 0 & L\_m+L\_{ls}' & 0\\\[2pt] 0 & -L\_m & 0 & L\_m+L\_{ls}' \end{bmatrix}
$$

### Torque equation

The torque is computed on the CPU part of the simulator (unlike the electrical modeling portion). Here is the equation implemented for the torque calculation:

$$
T\_e=pp\cdot (\psi\_{sd}i\_{sq}-\psi\_{sq}i\_{sd})
$$

Where $$i\_{sd}$$ and $$i\_{sq}$$ are the machine stator currents in the dq domain, $$\psi\_{sd}$$ and $$\psi\_{sq}$$ are the machine stator flux in the dq domain and $$pp$$ is the machine's number of pole pair.

## Mask parameters

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

{% tabs %}
{% tab title="Motor Parameters" %}

<table data-search="false"><thead><tr><th width="169.800048828125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Model mode</strong></td><td>Sets the machine parameters manually or by importing from JMAG-RT .rtt file.<br>Accordingly, the corresponding fields in the mask are disabled.</td></tr><tr><td><strong>RTT file name</strong></td><td>The .rtt file name can be provided in single quotation mark (') to import machine parameters including stator/rotor leakage inductances (Lls/Llr), stator/rotor resistances (Rs/Rr), mutual inductance (Lm), and number of pole pairs.<br>In this case, the machine parameters of the mask are disabled with the values extracted from the .rtt file.<br>This motor support JMAG 10.5 or later version of .rtt files.</td></tr><tr><td><strong>Parameters as imports of the block</strong></td><td><p>When enabled, additional input ports are added to the block, allowing the model inductance and resistance parameters to be controlled externally. Since parameter updates increase CPU usage, frequent real-time tuning may cause overruns. To reduce this risk, consider increasing the simulation time step.</p><p>These parameters can also be modified during real-time simulation from the RT-LAB Project tab by changing the values of the <strong>Rs</strong>, <strong>Lls</strong>, <strong>Rr</strong>, <strong>Llr</strong>, and <strong>Lm</strong> constants available in the signal tree.</p></td></tr><tr><td><strong>Stator leakage inductance Lls [H]</strong></td><td>Stator leakage inductance parameter in Henry of the induction machine model (also known as Lls).</td></tr><tr><td><strong>Stator resistance Rs [Ohm]</strong></td><td>Stator resistance parameter in Ohm of the induction machine model (also known as Rs).</td></tr><tr><td><strong>Rotor leakage inductance Llr' (referred to the stator) [H]</strong></td><td>Rotor leakage inductance parameter in Henry of the induction machine model (also known as Llr'). This parameter must be set as referred to the stator.</td></tr><tr><td><strong>Rotor resistance Rr' (referred to the stator) [Ohm]</strong></td><td>Rotor leakage resistance parameter in Ohm of the induction machine model (also known as Rr'). This parameter must be set as referred to the stator.</td></tr><tr><td><strong>Mutual inductance Lm [H]</strong></td><td>Magnetizing inductance parameter in Henry of the induction machine model (also known as Lm).</td></tr><tr><td><strong>Pole Pairs</strong></td><td>Number of the machine pole pair. It must be an integer from 0 to 63.</td></tr><tr><td><strong>Fix referential angle</strong></td><td>Since the model is computed in a fixed reference frame, this angle can be used to choose the reference angle. Default = 0.</td></tr><tr><td><strong>Show Rotor/Stator Voltages override port</strong></td><td>When enabled, input ports are added to the block, allowing external control of the stator and rotor voltages.<br>By default, the rotor voltages are fixed at 0 V, corresponding to a squirrel-cage induction machine, while the stator terminals are connected to an inverter.</td></tr><tr><td><strong>Solver Time Step [sec]</strong></td><td>Value of the FPGA model time step. Minimum= 375e-9. Maximum= 2.5e-6.</td></tr></tbody></table>
{% endtab %}

{% tab title="Configuration" %}

| Parameter                             | Description                                                                                                                                                                                                          |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Hardware Controller Name (OpCtrl)** | Links this block to an OpCtrl block by entering the same 'Controller Name' as specified in the OpCtrl block. The OpCtrl block controls initialization of the settings of one specific FPGA-based card in the system. |
| **FPGA Clock period \[sec]**          | For information only: period of the FPGA clock.                                                                                                                                                                      |
| **Communication Port Numbers**        | Specifies the communication port used to interface with the FPGA core. Refer to the bitstream documentation to determine the correct port number and configure this setting accordingly.                             |
| {% endtab %}                          |                                                                                                                                                                                                                      |
| {% endtabs %}                         |                                                                                                                                                                                                                      |

## Inputs

| Input                           | Description                                                                                                                                                                                                               |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **rpm**                         | Machine's mechanical speed in RPM.                                                                                                                                                                                        |
| **Rs/Rr/Lls/Llr/Lm**            | Machine's electrical parameters when they are set as a block inputs. Note: these inputs are not value restricted, the parameters needs to be consistent to avoid instabilities.                                           |
| **force\_v\_stator\|rotor**     | Boolean input to force the stator\|rotor voltages to the vabc\_stator\|rotor\_forced inputs provided to the block. These inputs are activated only if the checkbox "Show Rotor/Stator Voltages override port" is checked. |
| **vabc\_stator\|rotor\_forced** | Voltage value that Vabc of the stator\|rotor must be forced at. These inputs are activated only if the checkbox "Show Rotor/Stator Voltages override port" is checked.                                                    |
| **rst**                         | This input is a software reset. When set to "1", the solver is in the reset mode (reset of internal states and outputs to 0). When set to "0", the solver is not in the reset mode.                                       |

## Outputs

| Output           | Description                                                                                                                                                                                                                                             |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **IM\_out**      | <p>Bus composed of machine's monitoring outputs.</p><ul><li>Iabc\_stator</li><li>Iabc\_rotor</li><li>Idq\_stator</li><li>Idq\_rotor</li><li>Phi\_dq\_stator</li><li>Phi\_dq\_rotor</li><li>Vdq\_stator</li><li>Vdq\_rotor</li><li>Theta\_elec</li></ul> |
| **comm\_status** | Status of the communication ports. Composed of 3 elements: \[DataOut DataIn(speed) LoadIn].                                                                                                                                                             |
| **Running**      | <p>Solver state.<br>When 0, the solver is initializing. When 1, the solver is initialized and running.</p>                                                                                                                                              |

## Characteristics and limitations

**Solving method:** An induction machine model with fixed d-q (Park) referential was used.

**Offline simulation:** This block is incapable of offline simulation. Use the SPS Software induction machine block for offline simulation.

**Communication delays:** The block latency is 2 CPU time steps.

| Direct Feedthrough   | NO  |
| -------------------- | --- |
| Discrete sample time | YES |
| XHP support          | YES |
| Work offline         | NO  |


---

# 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/simulink-blocks-reference/efpgasim-library/simulink-sps-workflow/machines/induction-machine-command.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.
