> 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/pmsm-bldc-section.md).

# PMSM BLDC Section

## Overview

The PMSM BLDC model implements three machine types which provide parametrization for different machines (Permanent Magnet Synchronous Machine and Brushless DC Motor) and allow for different levels of model fidelity (Constant or Variable parametrization): PMSM Constant Ld/Lq, PMSM Variable Ld/Lq, and BLDC Constant Ls.

The **PMSM Constant Ld/Lq** and **BLDC Constant Ls** machine types simulate a machine with constant inductance and magnetic flux parameters. The **PMSM Variable Ld/Lq** machine type simulates a PMSM whose inductance and magnetic flux parameters are variable based on the operating state of the simulation (in this case, based on Id and Iq), which allows for greater model fidelity.

## Model Description

Permanent Magnet Synchronous Machines are common electrical machines in the the automotive and transportation industry. The PMSM is usually chosen because of its excellent power density (produced power over size or weight) or its capability to reach higher speed than other machine types. However, controlling a PMSM is usually more challenging when compared to other machine types. Since it is a synchronous machine, the controller must be aware of the rotor position at all times in order to properly control the torque. In addition, there is a chance of de-fluxing the magnet if the control is not stable, which would lead to a modification of the machine properties.

The following figures illustrate the equivalent circuits of the PMSM machine model in the *abc* frame and in the *dq* frame.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2Fk1YmRh0lMcOCmGh76Qpj%2F1f58655d-34a0-4a43-bd65-1c9409a613d0.png?alt=media&amp;token=8627dc87-b323-4773-8791-ff8080fe87bb" alt=""><figcaption><p>Figure 1. Electrical model for the PMSM in the three-phase domain (left) and in the dq reference frame (right)</p></figcaption></figure>

### General Equation <a href="#general-equation" id="general-equation"></a>

The equation of the PMSM model can be expressed as follows:

$$
I\_{abc}
========

\bigl\[L\_{abc}(\theta\_e)\bigr]^{-1}
\left{
\int (V\_{abc} - R\_{abc} I\_{abc}), dt
---------------------------------------

\psi\_{abc}
\right}
\\\[8pt]
$$

where **L**<sub>**abc**</sub> is the time-varying inductance matrix (global inductance for Constant Ld/Lq and Variable Ld/Lq models), **I**<sub>**abc**</sub> is the stator current inside the winding, **R**<sub>**abc**</sub> are the stator resistances and **V**<sub>**abc**</sub> is the voltage across the stator windings. **ψ**<sub>**abc**</sub> defines the magnet flux linked into the stator windings.

### Electrical Angle

The electrical angle is expressed as follows:

$$
\theta\_e = pp \cdot \theta\_m \\\[8pt]
$$

### Reference Frame Transformation

A Park-Clarke transformation, described below, is applied to the three-phase (*abc*) signals to obtain a direct-quadrature *(dq*) rotating reference frame locked to the **Electrical Angle**, **θ**<sub>**e**</sub>. An offset may be applied to the transform angle using the **DQ Transform Angle Offset** parameter, **θ**<sub>**offset**</sub>.

$$
\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\_e + \theta\_{offset}) & \sin(\theta\_e + \theta\_{offset}) \\
-\sin(\theta\_e + \theta\_{offset}) & \cos(\theta\_e + \theta\_{offset})
\end{bmatrix}
\begin{bmatrix}
1 & -\tfrac{1}{2} & -\tfrac{1}{2} \\
0 & \tfrac{\sqrt{3}}{2} & -\tfrac{\sqrt{3}}{2}
\end{bmatrix}
\\\[8pt]
$$

The transformation reduces sinusoidal varying quantities of inductances, flux, current, and voltage to constant values in the *dq* frame, thus greatly facilitating the analysis and control of the device under study.\
It is important to note that there are many different types of transforms and this often leads to confusion when interpreting the machine states in the *dq* frame. The one used here, which is typically standard in Japan, presents the advantage of being orthonormal (notice the $$\sqrt{\frac{2}{3}} \\\[8pt]$$ factor).

This particular orthonormal transform is power-invariant, meaning that the power computed in the *dq* frame by performing a dot product of currents and voltages is equivalent to the one computed in the three-phase domain, namely:

$$
V\_{abc} I\_{abc} = V\_{dq} I\_{dq} \\\[8pt]
$$

The principle of the reference frame transformation is illustrated in Figure 2. Consider a fixed, three-phase reference frame *abc* with all machine quantities rotating at the electric frequency **ω**. If we observe these quantities in a *dq* frame rotating at the same speed, the quantities will remain constant. In this figure, the angle **θ** represents the angular position of the rotating frame, whose *d*-axis is aligned with Phase A at **t** = 0. This indicates that the **DQ Transform Angle Offset** is 0°. The back-EMF voltage ***V***<sub>***bemf***</sub> directly follows the *q*-axis because the magnet flux is aligned with the *d*-axis by definition. The machine current ***I*** leads ***V***<sub>***bemf***</sub> and the *q*-axis by an angle called ***β***.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2Fw4veVe0YT8rQQHgoqwzB%2F12f80b4e-c1e6-4908-b002-c74cf81f938a.png?alt=media&amp;token=6679aaff-90bb-4c79-8c09-22c8a5b15800" alt=""><figcaption><p>Figure 2: <em>abc</em> to <em>dq</em> reference frame transformation<br></p></figcaption></figure>

### Torque

The **Electromagnetic Torque** can be expressed by the following expression, where ***pp*** is the number of **Pole Pairs** and is the partial derivative of the instantaneous permanent magnet flux.

$$
T\_e = pp \left\[ I\_{abc} \cdot \frac{\partial \psi\_{abc}}{\partial \theta\_r} + (L\_d - L\_q), i\_d, i\_q \right] \\\[8pt]
$$

If the back EMF of the machine is sinusoidal, as is the default case for PMSM machines, the torque can be further simplified.

$$
T\_e = pp \left\[ \sqrt{\tfrac{3}{2}}, \psi\_M, i\_q + (L\_d - L\_q), i\_d, i\_q \right] \\\[8pt]
$$

Because this model uses the orthonormal *abc* to *dq* transform, equations do not contain the $$\frac{3}{2} \\\[8pt]$$ factor typically present in other PMSM torque equations.

### Power

The instantaneous active and reactive power, **P** and **Q**, are calculated in the model as follows:

$$
P = V\_a I\_a + V\_b I\_b + V\_c I\_c \\\[8pt]

Q = \frac{1}{\sqrt{3}}
\left\[
(V\_b - V\_c), I\_a

* (V\_c - V\_a), I\_b
* (V\_a - V\_b), I\_c
  \right]
  \\\[8pt]
  $$

where V<sub>a</sub>, V<sub>b</sub>, and V<sub>c</sub> are the instantaneous stator voltages.

The results are processed through low-pass filters before being written to the **Three-Phase Active Power** and **Three-Phase Reactive Power** channels. The cutoff frequency of the filters is calculated as follows, where **T**<sub>**s**</sub> is the machine timestep. If the machine timestep is 120ns, for instance, the cutoff frequency is 133Hz.

$$
f\_c
\= \frac{1}{1 \times 10^{4} \times T\_s \times 2\pi}
\= \frac{1}{1 \times 10^{4} \times 120 \times 10^{-9} \times 2\pi}
\= 133,Hz
\\\[8pt]
$$

### DQ Voltage

Because the **Reference Frame Transformation** is power invariant, the values of **P** and **Q** calculated in the phase domain are equivalent to those calculated in the *dq* frame, as summarized in equation <mark style="background-color:$warning;">?</mark>. As a result, we can use the set of equations below to approximate the **Direct Axis Stator Voltage** and **Quadrature Axis Stator Voltage**. Unlike the other machine quantities, which are computed as part of the machine model on the FPGA, the calculations for **Vd** and **Vq** are performed on the Real Time CPU.

$$
P = V\_d I\_d + V\_q I\_q \\\[8pt]

Q = V\_q I\_d - V\_d I\_q \\\[8pt]

V\_d = \frac{P \cdot I\_d - Q \cdot I\_q}{I\_d^{2} + I\_q^{2}} \\\[8pt]

V\_q = \frac{P \cdot I\_q + Q \cdot I\_d}{I\_d^{2} + I\_q^{2}} \\\[8pt]
$$

### Back-EMF Characteristics

The default shape of the back EMF voltage of the machine is dependent upon the selected **Machine Type**. Both the **PMSM Constant Ld/Lq** and the **PMSM Variable Ld/Lq** generate a sinusoidal back EMF by default, while the **BLDC Constant Ls** generates a trapezoidal signal. The back EMF profile shape of all three machine types can also be customized by setting **Back EMF Profile** to **User-Defined** and specifying a [**Back EMF File \[JSON\]**](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/back-emf-file-json.md) file.

In the case of the **BLDC Constant Ls**, the default trapezoidal back EMF shape is constructed from a cosine table as described in the equation below, where **λ**<sub>**m**</sub> is the **Permanent Magnet Flux Linkage** and **H** is the **Back EMF Flat Area** in degrees.

<figure><img src="https://2999842053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe9Kk9pJCHht2LLBSxPap%2Fuploads%2FqunbTTWdCXzyNHxpwyCQ%2F1175e7e2-4a55-4866-a928-c4bf05e72b77.png?alt=media&amp;token=dd757f3c-0d39-4a61-9154-0b23a86c6dcc" alt=""><figcaption><p>Figure 3. Trapezoidal Back EMF shape</p></figcaption></figure>

$$
\frac{\partial \psi\_{a}}{\partial \theta\_{r}} \lambda\_{M}
============================================================

\max!\left(
\min!\left(
\frac{\cos(\theta\_{r})}{\cos!\left(\tfrac{H}{2}\right)},
1
\right),
-1
\right)
\\\[8pt]
$$

## Parameters

In the System Explorer window configuration tree, expand the Power Electronics Add-On custom device and select Circuit Model >> PMSM BLDC to display this page and configure the PMSM BLDC machine model. Parameters are configurable at edit-time only.

The following parameters are available for any selected **Machine Type**.

### Machine Model Settings

<table><thead><tr><th width="199.77783203125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>Specifies the name of the machine model.</td></tr><tr><td><strong>Description</strong></td><td>Specifies a description for the machine model.</td></tr></tbody></table>

### Machine Configuration

<table><thead><tr><th width="200.48895263671875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Machine Type</strong></td><td><p>Choose from one of the following types. Certain machine configuration parameters and channels automatically populate depending on the selected <strong>Machine Type</strong>.</p><ul><li><strong>PMSM Constant Ld/Lq</strong></li><li><strong>PMSM Variable Ld/Lq</strong></li><li><strong>BLDC Constant Ls</strong></li></ul></td></tr></tbody></table>

### Input Mapping Configuration

Use the Input Mapping Configuration to route signals to the **Voltage Phase A**, **Voltage Phase B**, and **Voltage Phase C** inputs of the machine model. Available routing options may vary depending on the selected [**Hardware Configuration**](https://www.opal-rt.com/docs/pe-add-on-simulink/hardware-configurations-reference/default-hardware-configurations.md).

<table><thead><tr><th width="201.02227783203125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Group</strong></td><td><p>Specifies the group that will be routed to the input voltages of the machine. The available routing options are defined by the selected Hardware Configuration, however it is typical to see the following options by default:</p><ul><li><strong>Measurements</strong> - eHS circuit model measurements</li></ul></td></tr><tr><td><strong>Element</strong></td><td>Specifies the index of the measurement in the group that has been selected as the input voltage of the machine.</td></tr></tbody></table>

## Machine-Specific Parameters

Parameters on the PMSM/BLDC page are populated automatically depending on the selected machine type.

<details>

<summary><strong>PMSM Constant Ld/Lq</strong></summary>

<table><thead><tr><th width="182.3333740234375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Direct Axis Inductance</strong></td><td>Direct-axis inductance of the machine, L<sub>d</sub> (H) (Default Value: 0.002984)</td></tr><tr><td><strong>Quadrature Axis Inductance</strong></td><td>Quadrature-axis inductance of the machine, L<sub>q</sub> (H) (Default Value: 0.004576)</td></tr><tr><td><strong>Back EMF Profile</strong></td><td>Sets waveform shape of back EMF: Default = sinusoidal; User Defined uses a <strong>Back EMF File [JSON]</strong>, (Default Value: Default)</td></tr><tr><td><strong>Preview</strong></td><td>Displays a preview of the back EMF waveform shape defined in the <strong>Back EMF File</strong>. This button is displayed when <strong>Back EMF Profile</strong> is set to <strong>User Defined</strong> and the <strong>Back EMF File Path</strong> is specified.</td></tr><tr><td><strong>Back EMF File Path</strong></td><td>Specifies the path to the <strong>Back EMF File</strong> on disk. This control is displayed when <strong>Back EMF Profile</strong> is set to <strong>User Defined</strong>.</td></tr><tr><td><strong>Initial Angle</strong></td><td>Initial angle of the machine (useful when simulating multiple machines requiring a phase shift), θ<sub>0</sub> (deg) (Default Value: 0°)</td></tr><tr><td><strong>Phase A Resistance</strong></td><td>Phase A resistance of the machine, R<sub>a</sub> (Ω) (Default Value: 0.12)</td></tr><tr><td><strong>Phase B Resistance</strong></td><td>Phase A resistance of the machine, R<sub>b</sub> (Ω) (Default Value: 0.12)</td></tr><tr><td><strong>Phase C Resistance</strong></td><td>Phase A resistance of the machine, R<sub>c</sub> (Ω) (Default Value: 0.12)</td></tr><tr><td><strong>Pole Pairs</strong></td><td>Number of pole pairs, pp (Default Value: 3)</td></tr><tr><td><strong>Direct Quadrature Transform Angle Offset</strong></td><td>Angle offset applied to <strong>Reference Frame Transformation</strong>. Aligned (d-axis aligned with Phase A at t=0) or 90 Degrees behind Phase A (q-axis aligned with Phase A at t=0), θ<sub>offset</sub> (Default Value: Aligned)</td></tr><tr><td><strong>Permanent Magnet Flux Linkage</strong></td><td>Peak permanent magnet flux linkage, ψ<sub>M</sub> (Wb) (Default Value: 0.25366)</td></tr><tr><td><strong>Applied Solver Timestep</strong></td><td>Timestep at which the machine model executes. (If Optimize Solver Timesteps is enabled in Circuit Model page, Ts is set automatically.) T<sub>s</sub> (s) (Default Value: 1.2e-7)</td></tr><tr><td><strong>Minimum Solver Timestep</strong></td><td>Minimum achievable timestep for the machine model, T<sub>sm</sub> (s) (Default Value: 1.0e-7)</td></tr></tbody></table>

</details>

<details>

<summary><strong>PMSM Variable Ld/Lq</strong></summary>

<table><thead><tr><th width="141">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Model File</strong></td><td><p>Specifies the path to the JSON or encrypted JSON Machine Model file on disk. Refer to <strong>PMSM Machine Model File [JSON]</strong> for details regarding the file format.</p><p>For information about JSON encryption, contact <strong>OPAL-RT Support.</strong></p></td></tr><tr><td><strong>Enable Advanced Channels</strong></td><td>Allows certain parameters to be exposed as tunable VeriStand Channels (enabled after Model File is specified). See PMSM Variable Ld/Lq Channels section. (Default Value: False)</td></tr><tr><td><strong>Back EMF Profile</strong></td><td><p>Sets the waveform shape of the back EMF:</p><ul><li><strong>Default</strong> - The back EMF is sinusoidal.</li><li><strong>User Defined</strong> - The shape of the back EMF waveform is defined by the <strong>Back EMF File [JSON]</strong>. (Default Value: Default)</li></ul></td></tr><tr><td><strong>Preview</strong></td><td>Displays a preview of the back EMF waveform shape defined in the <strong>Back EMF File</strong>. This button is displayed when <strong>Back EMF Profile</strong> is set to <strong>User Defined</strong> and the <strong>Back EMF File Path</strong> is specified.</td></tr><tr><td><strong>Back EMF File Path</strong></td><td>Specifies the path to the <strong>Back EMF File</strong> on disk. This control is displayed when <strong>Back EMF Profile</strong> is set to <strong>User Defined</strong>.</td></tr><tr><td><strong>Initial Angle</strong></td><td><p>Initial angle of the machine</p><p>This may be useful when simulating two separate 3-phase machines that require a phase shift between them, θ<sub>0</sub> (deg) (Default Value: 0)</p></td></tr><tr><td><strong>Applied Solver Timestep</strong></td><td><p>The timestep at which the machine model executes.</p><p>New outputs are computed by the FPGA machine model at each timestep. If <strong>Optimize Solver Timesteps</strong> is enabled in the Circuit Model page, the <strong>Applied Solver Timestep</strong> is automatically set to an optimal value and cannot be modified, T<sub>s</sub> (s) (Default Value: 1.2e-7)</p></td></tr><tr><td><strong>Minimum Solver Timestep</strong></td><td>The minimum achievable timestep at which the machine model can execute, T<sub>sm</sub> (s) (Default Value: 1.0e-7)</td></tr></tbody></table>

</details>

<details>

<summary><strong>BLDC Constant Ls</strong></summary>

<table><thead><tr><th width="180.28887939453125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Stator Inductance</strong></td><td>Stator inductance of the machine, L<sub>s</sub> (H) (Default Value: 0.002984)</td></tr><tr><td><strong>Back EMF Profile</strong></td><td><p>Sets the waveform shape of the back EMF:</p><ul><li><strong>Default</strong> - The back EMF is <strong>trapezoidal</strong>.</li><li><strong>User Defined</strong> - The shape of the back EMF waveform is defined by the <a href="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/back-emf-file-json.md"><strong>Back EMF File [JSON]</strong></a>. (Default Value: Default)</li></ul></td></tr><tr><td><strong>Preview</strong></td><td>Displays a preview of the back EMF waveform shape defined in the <strong>Back EMF File</strong>. This button is displayed when <strong>Back EMF Profile</strong> is set to <strong>User Defined</strong> and the <strong>Back EMF File Path</strong> is specified.</td></tr><tr><td><strong>Back EMF File Path</strong></td><td>Specifies the path to the <strong>Back EMF File</strong> on disk. This control is displayed when <strong>Back EMF Profile</strong> is set to <strong>User Defined</strong>.</td></tr><tr><td><strong>Back EMF Flat Area</strong></td><td><p>Describes the length of the flat area of the trapezoidal back-EMF waveform, in degrees. This control is displayed when <strong>Back EMF Profile</strong> is set to <strong>Default</strong>.</p><p>Please see <strong>Trapezoidal Back-EMF Characteristics</strong> for a description of the waveform, H (deg) (Default Value: 0)</p></td></tr><tr><td><strong>Initial Angle</strong></td><td><p>Initial angle of the machine</p><p>This may be useful when simulating two separate 3-phase machines that require a phase shift between them, θ<sub>0</sub> (deg) (Default Value: 0°)</p></td></tr><tr><td><strong>Permanent Magnet Flux Linkage</strong></td><td>Peak permanent magnet flux linkage, ψ<sub>M</sub> (Wb) (Default Value: 0.25366)</td></tr><tr><td><strong>Phase A Resistance</strong></td><td>Phase A resistance of the machine, R<sub>a</sub> (Ω) (Default Value: 0.12)</td></tr><tr><td><strong>Phase B Resistance</strong></td><td>Phase B resistance of the machine, R<sub>b</sub> (Ω) (Default Value: 0.12)</td></tr><tr><td><strong>Phase C Resistance</strong></td><td>Phase C resistance of the machine, R<sub>c</sub> (Ω) (Default Value: 0.12)</td></tr><tr><td><strong>Pole Pairs</strong></td><td>Number of pole pairs, pp (Default Value: 3)</td></tr><tr><td><strong>Direct Quadrature Transform Angle Offset</strong></td><td><p>The angle offset applied to the <strong>Reference Frame Transformation</strong>.</p><ul><li><strong>Aligned</strong> - Indicates that the <em>d</em>-axis is aligned with Phase A at <strong>t</strong> = 0. In this case, <strong>θ</strong><sub><strong>offset</strong></sub> = 0°. This is illustrated in Figure 2.</li><li><strong>90 Degrees behind Phase A</strong> - Indicates that the <em>q</em>-axis is aligned with Phase A at <strong>t</strong> = 0. In this case, <strong>θ</strong><sub><strong>offset</strong></sub> = -90°, θ<sub>offset</sub> (Default Value: Aligned)</li></ul></td></tr><tr><td><strong>Applied Solver Timestep</strong></td><td><p>The timestep at which the machine model executes.</p><p>New outputs are computed by the FPGA machine model at each timestep. If <strong>Optimize Solver Timesteps</strong> is enabled in the <strong>Circuit Model Section</strong>, the <strong>Applied Solver Timestep</strong> is automatically set to an optimal value and cannot be modified, T<sub>s</sub> (s) (Default Value: 1.2e-7)</p></td></tr><tr><td><strong>Minimum Solver Timestep</strong></td><td>The minimum achievable timestep at which the machine model can execute, T<sub>sm</sub> (s) (Default Value: 1.2e-7)</td></tr></tbody></table>

</details>

## Section Channels

The list of available channels in the PMSM BLDC section depends on the selected Machine Type. Channels listed under General Channels are available for all machine types; additional advanced channels are available for PMSM Variable Ld/Lq when Enable Advanced Channels is enabled. Channel values can be modified dynamically at execution time.

<table><thead><tr><th width="206.5999755859375">Channel Name</th><th>Description</th></tr></thead><tbody><tr><td><p><strong>Current Phase A</strong></p><p><strong>(Output)</strong></p></td><td>Phase A current measured at the stator, I<sub>a</sub> (A)</td></tr><tr><td><p><strong>Current Phase B</strong></p><p><strong>(Output)</strong></p></td><td><p>Phase B current measured at the stator, I<sub>b</sub></p><p>(A)</p></td></tr><tr><td><p><strong>Current Phase C</strong></p><p><strong>(Output)</strong></p></td><td>Phase C current measured at the stator, I<sub>c</sub> (A)</td></tr><tr><td><p><strong>Average Voltage A</strong></p><p><strong>(Output)</strong></p></td><td><p>Averaged Phase A voltage measured at the stator. The voltage is processed through a low-pass filter with a cutoff frequency of 159 Hz.</p><p><span class="math">f_c = \frac{1}{2\pi \times 1e{-}3} = 159\,Hz \\[8pt]</span>, V<sub>a,avg</sub> (V)</p></td></tr><tr><td><p><strong>Average Voltage B</strong></p><p><strong>(Output)</strong></p></td><td>Averaged Phase B voltage measured at the stator. The voltage is processed through a low-pass filter with a cutoff frequency of 159Hz, V<sub>b,avg</sub> (V)</td></tr><tr><td><p><strong>Average Voltage C</strong></p><p><strong>(Output)</strong></p></td><td>Averaged Phase C voltage measured at the stator. The voltage is processed through a low-pass filter with a cutoff frequency of 159Hz, V<sub>c,avg</sub> (V)</td></tr><tr><td><p><strong>Three-Phase Active Power</strong></p><p><strong>(Output)</strong></p></td><td>Three-phase instantaneous active electrical power. See the <strong>Power</strong> section for more information on how this value is calculated, P (W)</td></tr><tr><td><p><strong>Three-Phase Reactive Power</strong></p><p><strong>(Output)</strong></p></td><td>Three-phase instantaneous reactive electrical power. See the <strong>Power</strong> section for more information on how this value is calculated, Q (VAR)</td></tr><tr><td><p><strong>Direct Axis Stator Current</strong></p><p><strong>(Output)</strong></p></td><td>Direct-axis stator current in dq reference frame For a description of the <em>abc</em> to <em>dq</em> transform used to compute this value, see <strong>Reference Frame Transformation,</strong> I<sub>d</sub> (A)</td></tr><tr><td><p><strong>Quadrature Axis Stator Current</strong></p><p><strong>(Output)</strong></p></td><td>Quadrature-axis stator current in dq reference frame For a description of the <em>abc</em> to <em>dq</em> transform used to compute this value, see <strong>Reference Frame Transformation,</strong> I<sub>q</sub> (A)</td></tr><tr><td><p><strong>Back-EMF Phase A</strong></p><p><strong>(Output)</strong></p></td><td>Phase A to neutral voltage induced by the electromotive force, V<sub>bemf,a</sub> (V)</td></tr><tr><td><p><strong>Back-EMF Phase B</strong></p><p><strong>(Output)</strong></p></td><td>Phase B to neutral voltage induced by the electromotive force, V<sub>bemf,b</sub> (V)</td></tr><tr><td><p><strong>Back-EMF Phase C</strong></p><p><strong>(Output)</strong></p></td><td>Phase C to neutral voltage induced by the electromotive force, V<sub>bemf,c</sub> (V)</td></tr><tr><td><p><strong>Permanent Magnet Flux Linkage</strong></p><p><strong>(Output)</strong></p></td><td><p>Latest-value measurement of the <strong>Permanent Magnet Flux Linkage</strong> used at the input of the electrical model.</p><p>For the <strong>PMSM Constant Ld/Lq</strong> and <strong>BLDC Constant Ls</strong> machine types, this channel returns the constant value defined by the user in the Machine Configuration section.</p><p>For the <strong>PMSM Variable Ld/Lq</strong> machine type, this channel returns the value obtained from the <strong>Fm</strong> table in the <strong>Machine Model File,</strong> ψ<sub>M</sub> (Wb)</p></td></tr><tr><td><p><strong>Direct Axis Inductance</strong></p><p><strong>(Output)</strong></p></td><td><p>Latest-value measurement of the <strong>Direct Axis Inductance</strong> used at the input of the electrical model.</p><p>For the <strong>PMSM Constant Ld/Lq</strong> and <strong>BLDC Constant Ls</strong> machine types, this channel returns the constant value defined by the user in the Machine Configuration section.</p><p>For the <strong>PMSM Variable Ld/Lq</strong> machine type, this channel returns the value obtained from the <strong>Ld</strong> table in the <strong>Machine Model File,</strong> L<sub>d</sub> (H)</p></td></tr><tr><td><p><strong>Quadrature Axis Inductance</strong></p><p><strong>(Output)</strong></p></td><td><p>Latest-value measurement of the <strong>Quadrature Axis Inductance</strong> used at the input of the electrical model.</p><p>For the <strong>PMSM Constant Ld/Lq</strong> and <strong>BLDC Constant Ls</strong> machine types, this channel returns the constant value defined by the user in the Machine Configuration section.</p><p>For the <strong>PMSM Variable Ld/Lq</strong> machine type, this channel returns the value obtained from the <strong>Lq</strong> table in the <strong>Machine Model File,</strong> L<sub>q</sub> (H)</p></td></tr><tr><td><p><strong>Direct Axis Stator Voltage</strong></p><p><strong>(Output)</strong></p></td><td><p>Direct-axis stator voltage in the <em>dq</em> reference frame.</p><p>For a description of the <em>abc</em> to <em>dq</em> transform used to compute this value, see <strong>Reference Frame Transformation,</strong> V<sub>d</sub> (V)</p></td></tr><tr><td><p><strong>Quadrature Axis Stator Voltage</strong></p><p><strong>(Output)</strong></p></td><td><p>Quadrature-axis stator voltage in the <em>dq</em> reference frame.</p><p>For a description of the <em>abc</em> to <em>dq</em> transform used to compute this value, see <strong>Reference Frame Transformation,</strong> V<sub>q</sub> (V)</p></td></tr><tr><td><p><strong>Electrical Angle</strong></p><p><strong>(Output)</strong></p></td><td><p>Position of the rotating magnetic field, as defined by the <strong>Electrical Angle Equation.</strong></p><p>If this signal is routed to a <strong>Waveform Channel</strong> or an <strong>Analog Output Channel</strong>, its value is expressed in Turns. The signal ranges in value from 0 to 1, with 1 representing a full rotation, θ<sub>e</sub> (deg)</p></td></tr><tr><td><p><strong>Electromagnet Torque</strong></p><p><strong>(Output)</strong></p></td><td>Torque generated through power at the stator. Refer to the <strong>Torque</strong> section for more information, T<sub>e</sub> (Nm)</td></tr></tbody></table>

### PMSM Variable Ld/Lq

The following VeriStand channels are displayed under the **Advanced** section when the **Enable Advanced Channels** option is enabled on the **PMSM Variable Ld/Lq** configuration page.

<table><thead><tr><th width="203.3333740234375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><p><strong>Direct Axis Inductance Override</strong></p><p><strong>(Input)</strong></p></td><td><p>Direct-axis inductance of the machine</p><p>When <strong>Enable Inductance Override</strong> is True, this value overrides the direct axis inductance value defined in the <strong>Machine Model File [JSON]</strong> table. When <strong>Enable Inductance Override</strong> is False, this channel is not used.</p><p>This value can be modified while the simulation is running, L<sub>d</sub> (H) (Default Value: 0.002984)</p></td></tr><tr><td><p><strong>Enable Permanent Magnet Flux Linkage Override</strong></p><p><strong>(Input)</strong></p></td><td><p>Enables the <strong>Flux Linkage Override</strong> channel, allowing the user to modify the permanent magnet flux linkage of the machine while the simulation is running.</p><p>When True, the flux linkage of the machine is read from the <strong>Flux Linkage Override</strong> channel.</p><p>When False, the flux linkage is read from the table in the <strong>Machine Model File [JSON].</strong> (Default Value: False)</p></td></tr><tr><td><p><strong>Enable Inductance Override</strong></p><p><strong>(Input)</strong></p></td><td><p>Enables the <strong>Direct Inductance Override</strong> and <strong>Quadrature Inductance Override</strong> channels, allowing the user to modify the inductances of the machine while the simulation is running.</p><p>When True, the inductances of the machine are read from the <strong>Direct Inductance Override</strong> and <strong>Quadrature Inductance Override</strong> channels.</p><p>When False, the direct axis and quadrature axis inductances are read from the table in the <strong>Machine Model File [JSON].</strong> (Default Value: False)</p></td></tr><tr><td><p><strong>Enable Resistance Override</strong></p><p><strong>(Input)</strong></p></td><td><p>Enables the <strong>Resistance Phase A Override, Resistance Phase B Override,</strong> and <strong>Resistance Phase C Override</strong> channels, allowing the user to modify the phase resistances of the machine while the simulation is running.</p><p>When True, the phase resistances of the machine are read from the <strong>Resistance Phase A Override, Resistance Phase B Override,</strong> and <strong>Resistance Phase C Override</strong> channels.</p><p>When False, the phase resistances are read from the table in the <strong>Machine Model File [JSON].</strong> (Default Value: False)</p></td></tr><tr><td><p><strong>Permanent Magnet Flux Linkage Override</strong></p><p><strong>(Input)</strong></p></td><td><p>Permanent magnet flux linkage of the machine</p><p>When the <strong>Enable Flux Linkage Override</strong> channel is set to True, instead of reading the Flux Linkage from the 2D ψ<sub>M</sub> lookup table defined in the Model File, the machine model will use the following scalar channel value as an input.</p><p>When <strong>Enable Flux Linkage Override</strong> is True, this value overrides the flux linkage value defined in the <strong>Machine Model File [JSON]</strong> table. When <strong>Enable Flux Linkage Override</strong> is False, this channel is not used.</p><p>This channel value can be modified while the simulation is running, ψ<sub>M</sub> (Wb) (Default Value: 0.25366)</p></td></tr><tr><td><p><strong>Quadrature Axis Inductance Override</strong></p><p><strong>(Input)</strong></p></td><td><p>Quadrature-axis inductance of the machine</p><p>When <strong>Enable Inductance Override</strong> is True, this value overrides the direct axis inductance value defined in the <strong>Machine Model File [JSON]</strong> table. When <strong>Enable Inductance Override</strong> is False, this channel is not used.</p><p>This value can be modified while the simulation is running, L<sub>q</sub> (H) (Default Value: 0.004576)</p></td></tr><tr><td><p><strong>Resistance Phase A Override</strong></p><p><strong>(Input)</strong></p></td><td><p>Phase A resistance of the machine</p><p>When <strong>Enable Resistance Override</strong> is True, this value overrides the Phase A resistance value defined in the <strong>Machine Model File [JSON]</strong>. When <strong>Enable Resistance Override</strong> is False, this channel is not used.</p><p>This channel value can be modified while the simulation is running, R<sub>a</sub> (Ω) (Default Value: Read from JSON Model File when Advanced Channels are enabled)</p></td></tr><tr><td><p><strong>Resistance Phase B Override</strong></p><p><strong>(Input)</strong></p></td><td><p>Phase B resistance of the machine</p><p>When <strong>Enable Resistance Override</strong> is True, this value overrides the Phase B resistance value defined in the <strong>Machine Model File [JSON]</strong>. When <strong>Enable Resistance Override</strong> is False, this channel is not used.</p><p>This channel value can be modified while the simulation is running, R<sub>b</sub> (Ω) (Default Value: Read from JSON Model File when Advanced Channels are enabled)</p></td></tr><tr><td><p><strong>Resistance Phase C Override</strong></p><p><strong>(Input)</strong></p></td><td><p>Phase C resistance of the machine</p><p>When <strong>Enable Resistance Override</strong> is True, this value overrides the Phase C resistance value defined in the <strong>Machine Model File [JSON]</strong>. When <strong>Enable Resistance Override</strong> is False, this channel is not used.</p><p>This channel value can be modified while the simulation is running, R<sub>c</sub> (Ω) (Default Value: Read from JSON Model File when Advanced Channels are enabled)</p></td></tr></tbody></table>


---

# 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/pmsm-bldc-section.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.
