> 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/switched-reluctance-motor.md).

# Switched-Reluctance Motor

## Description

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

The **Switched-Reluctance Motor** block, located in the **eFPGAsim/External circuit editor workflow/Machines** library, is used to initialize, monitor and control the FPGA-based switched-reluctance motor (SRM) solver.

## Mask parameters

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

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

<table data-search="false"><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>SRM Type</strong></td><td>The solver is compatible with several types of 3/4/5 phases SRM models. Select the type of SRM motor you want to simulate in the list.</td></tr><tr><td><strong>Table mode</strong></td><td>Two options: Flux table or Current and Torque table</td></tr><tr><td><strong>Flux table [Wb]</strong></td><td>If Flux table is selected, Magnetization characteristic table: a 2-D look-up table containing the SRM flux linkage as a function of stator current (row) and rotor position (column). The table size is not sized constrained but will be reformatted to fit in FPGA memory space dedicated to it.</td></tr><tr><td><strong>Theta Axis [Deg]</strong></td><td>If Flux table is selected, flux table breakpoint values of theta axis in degrees. Theta is the mechanical or rotor angle. Verify the first breakpoint is 0deg and the last is 180/(number of rotor poles).</td></tr><tr><td><strong>Current Axis [Amps]</strong></td><td>If flux table is selected, Flux table breakpoint values of Current axis in Amps. Verify the first breakpoint is 0 Amps and the last is maximum current amplitude.<br><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-4482358d630893c61741df19c55d23e99ac27a05%2Fehs-srm-current-flux-curves.png?alt=media" alt=""></td></tr><tr><td><strong>Theta Axis [Deg] (Current table)</strong></td><td>If Current and Torque table is selected,</td></tr><tr><td><strong>Flux Axis [Wb] (Current table)</strong></td><td>If Current and Torque table is selected,</td></tr><tr><td><strong>Torque Table [N.m.]</strong></td><td>If Current and Torque table is selected,</td></tr><tr><td><strong>Theta Axis [Deg] (Torque table)</strong></td><td>If Current and Torque table is selected,</td></tr><tr><td><strong>Current Axis [] (Torque Table)</strong></td><td>If Current and Torque table is selected,</td></tr><tr><td><strong>Stator resistance [Ohm]</strong></td><td>Value of the stator resistance. Same value is use for all phases.</td></tr><tr><td><strong>Mechanical Mode</strong></td><td><p>This parameter lets you activate the embedded mechanical equation of the solver.<br>If you prefer use an external mechanical equation, please select the <strong>force speed mode</strong>. In that case, you set the motor speed in RPM.</p><p>In the other hand, you set the <strong>torque load mode</strong>.</p></td></tr><tr><td><strong>Inertia [kg·m²]</strong></td><td>Motor inertia. This data is used to process the embedded mechanical equation.</td></tr><tr><td><strong>Friction [Nm · s / rad]</strong></td><td>Motor friction. This data is used to process the embedded mechanical equation.</td></tr><tr><td><strong>Plot my tables</strong></td><td>This option allows you to see the table formatting results of your table.</td></tr></tbody></table>

{% hint style="info" %}
During the simulation, the current can exceed the table maximum value. In this case, the lookup table output will be saturated to its value at maximum current. To avoid this approximation, you can still specify a larger table with extrapolated values.
{% endhint %}
{% endtab %}

{% tab title="Communication settings" %}

| Parameter                             | Description                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Controller Name**                   | Motor friction. This data is used to process the embedded mechanical equation.                                                                                                                                                                                                                                                                       |
| **DataIn/LoadIn/DataOut port number** | <p>Communication ports number to and from the FPGA to send and receive solver data.<br>Port numbers are bitstream dependant (See bitstream technical documentation to know the right port numbers).<br>If your bitstream was changed, see the technical notes that accompanied the bitstream to know which port numbers are linked to the block.</p> |
| {% endtab %}                          |                                                                                                                                                                                                                                                                                                                                                      |
| {% endtabs %}                         |                                                                                                                                                                                                                                                                                                                                                      |

## Inputs

| Input              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Fixedspeedmode** | This input is used to select the mode of Tload/RPM input. If the input value is greater or equal than 1, the FPGA SRM solver use the fix speed specified by the RPM input. Else the FPGA SRM solver will use the Tload value as Torque load input to process the mecanichal equation. The mechanical parameter as Inertia and Friction can be tuned in the block mask. This input is slow to process so it can generate overruns. Prefer to load it with a constant or a static signal. |
| **Tload/RPM**      | This input is used as the Torque load in N.m or RPM speed of the motor depending on the Fixspeedmode input state.                                                                                                                                                                                                                                                                                                                                                                       |
| **rst**            | Solver rst signal. If rst = 1, the FPGA solver stop the current calculation sequence and reset all ouputs and internal states to 0.                                                                                                                                                                                                                                                                                                                                                     |

## Outputs

<table data-search="false"><thead><tr><th>Output</th><th>Description</th></tr></thead><tbody><tr><td><strong>MotorOut</strong></td><td>This output is a composite signal combining all monitoring information from the SRM FPGA-based solver.</td></tr><tr><td><strong>CurrentA/B/C/D/E</strong></td><td>Entrant Current in motor phase a/b/c/d/e. d/e currents are used only with 4- and 5-phase motors, in Amperes.</td></tr><tr><td><strong>FluxA/B/C/D/E</strong></td><td>Flux of phase a/b/c/d/e. d/e flux are used only with 4- and 5-phase motors, in Webers.</td></tr><tr><td><strong>Theta Mec/Elec</strong></td><td>Angle of the rotor / Angle in the current referential, in degrees.</td></tr><tr><td><strong>Torque</strong></td><td>Torque generated by the motor, in Newton-meters.</td></tr><tr><td><strong>Wm</strong></td><td>Motor Rotor Speed, in radians per second.</td></tr><tr><td><strong>SaturationFlags</strong></td><td>Able saturation flags, used to determine if the model hit the limit of the table.</td></tr></tbody></table>

## Characteristics and limitations

| Direct Feedthrough   | N/A |
| -------------------- | --- |
| 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/switched-reluctance-motor.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.
