> 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/add-and-configure-a-circuit-model-to-the-system-definition/machine-section/machine-configuration-files/pmsm-machine-model-file-json.md).

# PMSM Machine Model File \[JSON]

For a PMSM BLDC model configured to use the PMSM Variable Ld/Lq machine type, a JSON file is required to define the machine characteristics. The file must contain the following information:

<table><thead><tr><th width="180.77777099609375">Parameter (JSON key)</th><th width="96.55560302734375" align="right">Value type</th><th width="269.6666259765625">Description</th><th>Example</th></tr></thead><tbody><tr><td><strong>PolePairs</strong></td><td align="right">int</td><td>Number of pole pairs of the machine.</td><td><code>"PolePairs": 2</code></td></tr><tr><td><strong>DqTransformAngleOffset</strong></td><td align="right">double</td><td>Angle offset applied to the abc → dq transform, before Id and Iq are referenced to look up Ld, Lq, and Fm (degree)<br>A value of 0 indicates that the direct axis is aligned with Phase A when the rotor angle θ = 0. In other words, the active power reaches a maximum when Id is at a maximum. This is the default behavior. For more information, see the Reference Frame Transformation description.</td><td><code>"DqTransformAngleOffset": 0</code></td></tr><tr><td><strong>TableInputCutoffFrequency</strong></td><td align="right">double</td><td>Sets the low-pass filter cutoff frequency for the Id and Iq inputs of the Ld, Lq, and Fm lookup tables (Hz).<br>This parameter is optional; if omitted the default is 200 Hz. Typically adjusted only if the Permanent Magnet Flux Linkage (Fm) table data is not constant, since improper tuning can affect PMSM output currents. Contact OPAL-RT Support for additional information.</td><td><code>"TableInputCutoffFrequency": 500</code></td></tr><tr><td><strong>Ra</strong></td><td align="right">double</td><td>Phase A resistance of the machine (Ω)</td><td><code>"Ra": 0.04</code></td></tr><tr><td><strong>Rb</strong></td><td align="right">double</td><td>Phase B resistance of the machine (Ω)</td><td><code>"Rb": 0.04</code></td></tr><tr><td><strong>Rc</strong></td><td align="right">double</td><td>Phase C resistance of the machine (Ω)</td><td><code>"Rc": 0.04</code></td></tr><tr><td><strong>Id_axis</strong></td><td align="right">double[]</td><td>One-dimensional array of current values along the direct axis of the stator (A).<br>Must be the same size as Iq_axis, up to 128 values, arranged in ascending order.</td><td><code>"Id_axis": [ -50.0, 0.0, 50.0 ],</code></td></tr><tr><td><strong>Iq_axis</strong></td><td align="right">double[]</td><td>One-dimensional array of current values along the quadratic axis of the stator (A). Must be the same size as Id_axis, up to 128 values, arranged in ascending order.</td><td><code>"Iq_axis": [ -50.0, 0.0, 50.0 ],</code></td></tr><tr><td><strong>Ld</strong></td><td align="right">double[][]</td><td>Two-dimensional array of direct-axis inductance values (H). Size must be n x n, where n is the number of values in Id_axis and Iq_axis. Figure 1 describes how values are mapped from the JSON array to the Ld table.</td><td><code>"Ld": [ [ 0.0004, 0.00042, 0.00041 ], [ 0.00041, 0.00044, 0.00043 ], [ 0.0004, 0.00042, 0.000425 ] ],</code></td></tr><tr><td><strong>Lq</strong></td><td align="right">double[][]</td><td>Two-dimensional array of quadratic-axis inductance values (H). Size must be n x n. Figure 1 describes mapping to the Lq table.</td><td><code>"Lq": [ [ 0.0004, 0.00042, 0.00041 ], [ 0.00041, 0.00044, 0.00043 ], [ 0.0004, 0.00042, 0.000425 ] ],</code></td></tr><tr><td><strong>Fm</strong></td><td align="right">double[][]</td><td>Two-dimensional array of Permanent Magnet Flux Linkage values (Wb). Size must be n x n. Figure 1 describes mapping to the Fm table. For most use cases this table is constant. Entering variable data may cause unexpected simulation results and could require tuning TableInputCutoffFrequency. Contact OPAL-RT Support for additional information.</td><td><code>"Fm": [ [ 0.1, 0.1, 0.1 ], [ 0.1, 0.1, 0.1 ], [ 0.1, 0.1, 0.1 ] ]</code></td></tr></tbody></table>

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FYrejAUyB6Uc6851Ln2US%2Fimage.png?alt=media&amp;token=d8f31550-40d3-447a-b063-af181ba2a016" alt=""><figcaption><p>Layout of the Ld, Lq, and Flux tables</p></figcaption></figure>

An example Machine Model File in JSON format is available (intended as a template only; it does not contain valid simulation data):

{% file src="/files/KxywPva9me9YlR1U5Ymp" %}

{% hint style="info" %}
Do not modify the provided URLs or their query parameters.

Contact OPAL-RT Support for assistance with **TableInputCutoffFrequency** tuning or variable Fm table usage.
{% 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/model-and-simulation/add-and-configure-a-circuit-model-to-the-system-definition/machine-section/machine-configuration-files/pmsm-machine-model-file-json.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.
