> 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/ehs/model-in-schematic-editor/library-blocks-reference/machines-blocks/permanent-magnet-synchronous-machine-6-phase.md).

# Permanent Magnet Synchronous Machine 6-phase

## Description

<figure><img src="https://3212678799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABuoXNYgvaoO7wIe3bfO%2Fuploads%2Fgit-blob-777b5f8d3920adc2af1eae7604c47d3d784cc4be%2FSE_6pPMSM.png?alt=media" alt=""><figcaption></figcaption></figure>

The **Permanent Magnet Synchronous Machine 6-phase** block implements a six-phase PMSM (6-Ph PMSM) model with optional resolver and encoder sensors.

{% hint style="info" %}
This block is only available in the eHS library.
{% endhint %}

### **Equations & characteristics** <a href="#equations-and-characteristics" id="equations-and-characteristics"></a>

#### General PMSM solver equations <a href="#general-pmsm-solver-equation" id="general-pmsm-solver-equation"></a>

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

$$
\begin{aligned}
I\_{a b c x y z}=\[L\_{a b c x y z}(\theta)]^{-1} \cdot \[\int\left(V\_{a b c x y z}-R I\_{a b c x y z}\right) d t-\psi\_{a b c x y z}]\\
\end{aligned}
$$

where **L**<sub>**abcxyz**</sub> is the time-varying inductance matrix (global inductance for DQ0 and VDQ models), **I**<sub>**abcxyz**</sub> is the stator current inside the winding, **R** is the stator resistance, **V**<sub>**abcxyz**</sub> is the voltage across the stator windings and **ψ**<sub>**abcxyz**</sub> defines the magnet flux linked into the stator windings.

{% hint style="info" %}
The solver computes the outputs in phase domain, using phase domain states. The integration type used is Backward Euler.
{% endhint %}

#### Standard DQ0 motor characteristics <a href="#standard-dq0-motor-characteristics" id="standard-dq0-motor-characteristics"></a>

Under normal conditions, the ideal sinusoidal stator voltages of the PMSM, back-EMFs, and inductances all have sinusoidal shapes. One can transform the equation using the Park transformation with a referential locked on the rotor position **θ** using the following two equations:

$$
\begin{aligned}
\left\[\begin{array}{l}
{V\_{d{1} s}} \\
{V\_{q{1} s}} \\
{V\_{0{1} s}} \\
{V\_{d{2} s}} \\
{V\_{q{2} s}} \\
{V\_{0{2} s}} \\
\end{array}\right]=\mathrm{T}\left\[\begin{array}{l}
{V\_{a s}} \\
{V\_{b s}} \\
{V\_{c s}} \\
{V\_{x s}} \\
{V\_{y s}} \\
{V\_{z s}} \\
\end{array}\right]
\end{aligned} \\\[8pt]

T
\=\frac{2}{3}
\left\[\begin{matrix}cos(\theta\_{e})\&cos(\theta\_{e}-\frac{2\pi}{3})\&cos(\theta\_{e}+\frac{2\pi}{3})&0&0&0\\
-sin(\theta\_{e})&-sin(\theta\_{e}-\frac{2\pi}{3})&-sin(\theta\_{e}+\frac{2\pi}{3})&0&0&0\\
\frac{1}{2}&\frac{1}{2}&\frac{1}{2}&0&0&0\\
0&0&0\&cos(\theta\_{e}- \varepsilon)\&cos(\theta\_{e}-\frac{2\pi}{3}- \varepsilon)\&cos(\theta\_{e}+\frac{2\pi}{3}- \varepsilon)\\
0&0&0&-sin(\theta\_{e}- \varepsilon)&-sin(\theta\_{e}-\frac{2\pi}{3}- \varepsilon)&-sin(\theta\_{e}+\frac{2\pi}{3}- \varepsilon)\\
0&0&0&\frac{1}{2}&\frac{1}{2}&\frac{1}{2}
\end{matrix}\right]
$$

and

$$
\begin{aligned}
\left\[\begin{array}{l}
{V\_{a s}} \\
{V\_{b s}} \\
{V\_{c s}} \\
{V\_{x s}} \\
{V\_{y s}} \\
{V\_{z s}} \\
\end{array}\right]=\mathrm{T}^{-1}\left\[\begin{array}{l}
{V\_{d{1} s}} \\
{V\_{q{1} s}} \\
{V\_{0{1} s}} \\
{V\_{d{2} s}} \\
{V\_{q{2} s}} \\
{V\_{0{2} s}} \\
\end{array}\right]
\end{aligned}
\\\[8pt]

# T^{-1}

\left\[\begin{matrix}cos(\theta\_{e})\&sin(\theta\_{e})&1&0&0&0\\
cos(\theta\_{e}-\frac{2\pi}{3})&-sin(\theta\_{e}-\frac{2\pi}{3})&1&0&0&0\\
cos(\theta\_{e}+\frac{2\pi}{3})&-sin(\theta\_{e}+\frac{2\pi}{3})&1&0&0&0\\
0&0&0\&cos(\theta\_{e}- \varepsilon)&-sin(\theta\_{e}- \varepsilon)&1\\
0&0&0\&cos(\theta\_{e} -\frac{2\pi}{3} - \varepsilon)&-sin(\theta\_{e}-\frac{2\pi}{3}- \varepsilon)&1\\
0&0&0\&cos(\theta\_{e} +\frac{2\pi}{3} - \varepsilon)&-sin(\theta\_{e}+\frac{2\pi}{3}- \varepsilon)&1
\end{matrix}\right]

\\\[8pt]
$$

The Park transform (also called ‘DQ’ transform) reduces sinusoidal varying quantities of inductances, flux, current, and voltage to constant values in the D-Q 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 Park transforms and this often leads to confusion when interpreting the motor states inside the D-Q frame. The one used here presents the advantage of being amplitude-invariant which means that the peak amplitude of the signals in the D-Q frame by performing a transformation will be numerically equal to the one computed in the phase domain.

The corresponding equations in the DQ0 domain, for representation, are:

$$
\begin{aligned}
\left\[\begin{matrix}\phi\_{d1}\\\phi\_{q1}\\\phi\_{01}\\\phi\_{d2}\\\phi\_{q2}\\\phi\_{02} \end{matrix}\right]
===============================================================================================================

\left\[\begin{matrix}L\_{d1}&0&0\&M\_{d21}&0&0\\
0\&L\_{q1}&0&0\&M\_{q21}&0\\
0&0\&L\_{01}&0&0&0\\
M\_{d12}&0&0\&L\_{d2}&0&0\\
0\&M\_{q12}&0&0\&L\_{q2}&0\\
0&0&0&0&0\&L\_{02}\\
\end{matrix}\right]
\left\[\begin{matrix}i\_{d1}\\
i\_{q1}\\
i\_{01}\\
i\_{d2}\\
i\_{q2}\\
i\_{02} \end{matrix}\right]
\+
\left\[\begin{matrix}\phi\_{PM1}\\
0\\
0\\
\phi\_{PM2}\\
0\\
0 \end{matrix}\right]
\end{aligned}
\\\[16pt]

V\_{d1}=R\_{s1}i\_{d1}+L\_{d1}\frac{di\_{d1}}{dt}+M\_{d21}\frac{di\_{d2}}{dt} - \omega\_{e} (L\_{q1}i\_{q1}+M\_{q21}i\_{q2})\\\[8pt]

V\_{q1}=R\_{s1}i\_{q1}+L\_{q1}\frac{di\_{q1}}{dt}+M\_{q21}\frac{di\_{q2}}{dt} + \omega\_{e} (L\_{d1}i\_{d1}+M\_{d21}i\_{d2}+\phi\_{PM1}) \\\[8pt]

V\_{d2}=R\_{s2}i\_{d2}+L\_{d2}\frac{di\_{d2}}{dt}+M\_{d12}\frac{di\_{d1}}{dt} - \omega\_{e} (L\_{q2}i\_{q2}+M\_{q12}i\_{q1}) \\\[8pt]
V\_{q2}=R\_{s2}i\_{q2}+L\_{q2}\frac{di\_{q2}}{dt}+M\_{q12}\frac{di\_{1}}{dt} + \omega\_{e} (L\_{d2}i\_{d2}+M\_{d12}i\_{d1}+\phi\_{PM2}) \\\[8pt]
V\_{01}=R\_{s1}i\_{01}+L\_{01}\frac{di\_{01}}{dt}  \\\[8pt]
V\_{02}=R\_{s2}i\_{02}+L\_{02}\frac{di\_{02}}{dt}
$$

With this transform (and only this transform) the PMSM torque can be expressed by the following equation, where ***pp*** is the **number of pole pairs**.

$$
T\_c = p p' \Bigl\[ \left( e\_a i\_a + e\_b i\_b + e\_c i\_c + e\_x i\_x + e\_y i\_y + e\_z i\_z \right)

* \frac{3}{2} \bigl( (L\_{d1}-L\_{q1}) i\_{d1} i\_{q1} + (L\_{x2}-L\_{q2}) i\_{x2} i\_{q2} \bigr) \\\[8pt]
  \qquad\qquad + \frac{3}{2} \bigl( (M\_{x21}-M\_{q12}) i\_{x2} i\_{q1} + (M\_{d12}-M\_{q21}) i\_{d1} i\_{q2} \bigr) \Bigr]
  \\\[8pt]
  $$

where

$$
\[, e\_a = u\_a \cdot \psi\_{m\_1} ,]
\\\[8pt]
$$

same for phase **y** and ***z***.

$$
\[, e\_x = u\_x \cdot \psi\_{m\_2} ,]
\\\[8pt]
$$

and **u**<sub>**a**</sub>**&#x20;, u**<sub>**x**</sub> are the unit vector template of the BackEMF profile and $$\psi\_{m\_i} ,$$is the flux linkage constant of the winding i.

{% hint style="info" %}
The synchronous component of Torque includes impact due to Zero Sequence Current. $$\psi\_{m\_1} ,$$and $$\psi\_{m\_2} ,$$are ideally the same but provided separately since the PMSM supports 2 non-identical winding sets.
{% endhint %}

Figure 1 explains the principle of the Park transform. Considering fixed ABC referential with all quantities (***V***<sub>***bemf***</sub>, *motor current **I***) rotating at the electric frequency **ω**, if we observe these quantities in a D-Q frame turning at the same speed we can see that the motor quantities will be constant.

This is easy to see for the Back-EMF voltage ***V***<sub>***bemf***</sub> that directly follows the Q-axis (because the magnet flux is on the D-axis by definition). In Figure 1, ***I*** leads the Q-axis by an angle called **β** (beta). The modulus of the vector ***I*** is called ***I***<sub>***amp***</sub>. In the figure below, **θ** is the rotor angle, aligned with the D-axis.

<figure><img src="https://3212678799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABuoXNYgvaoO7wIe3bfO%2Fuploads%2Fgit-blob-63e181a04eb67e8d2521aa319c4c69730a96e471%2FSE_Park-transform.png?alt=media" alt=""><figcaption><p>Figure1: Park Transform with definition of Theta and Beta</p></figcaption></figure>

{% hint style="info" %}
The above figure is for D1Q1 reference frame, the D2Q2 reference frame has a phase shift of $$\epsilon$$, which is the phase shift between the winding sets.
{% endhint %}

### Mechanical model

The equation of the mechanical model in torque mode can be expressed as follows

$$
\omega\_r\left\[k+1\right]=a \times \omega\_r\left\[k\right]+b \times \left(T\_{e}\left\[k\right]-T\_{l}\left\[k\right]-T\_{f,s}\left\[k\right]\right)
$$

with

$$
a=1-\frac{F\_vT\_S}{J} \\\[8pt]
b=\frac{30}{\pi}\frac{T\_S}{J} \\\[8pt]
$$

where $$\omega\_r$$ is the rotor speed in RPM, $$T\_e$$ is the electromagnetic torque in $$N.m$$, $$T\_i$$ is the torque command in $$N.m$$, $$F\_v$$ is the viscous friction coefficient in $$N.m.s/rad$$, $$J$$ is the rotor moment of inertia in $$kg.m^2$$, and $$T\_s$$ the time step in $$s$$. There is a dead-zone implementation with the static friction torque $$T\_{f,s}$$, if the net torque doesn't exceed the static friction torque threshold value $$F\_s$$, given in $$N.m$$, the speed remains zero.

In speed mode, the rotor speed is directly set to the speed command $$\omega\_{r,c}$$.

A resolver is a rotary transformer where the magnitude of the signal through the resolver windings varies sinusoidally as the shaft rotates.

## Single excitation resolver <a href="#single-excitation-resover" id="single-excitation-resover"></a>

The equations of the resolver can be expressed as follows:

$$
\theta\_{res}=\left(\theta\_{mec}+\theta\_{offset}\right) R\_{pp} \\\[8pt]
\text{cosine}=\text{Excitation} \times \left\[ R\_{cc} \cos \left( \theta\_{res} \right) + R\_{cs} \sin \left( \theta\_{res} \right) \right] \\\[8pt]
\text{sine}= \left(-1\right)^{R\_{dir}} \times \text{Excitation} \times \left\[ R\_{sc} \cos \left( \theta\_{res} \right) + R\_{ss} \sin \left( \theta\_{res} \right) \right]
$$

where $$\theta\_{res}$$ is the resolver angle, $$\theta\_{mec}$$ is the mechanical angle of the machine, $$\theta\_{offset}$$ is the angle offset, $$R\_{pp}$$ is the number of pole pairs of the resolver, $$R\_{cc}$$, $$R\_{sc}$$, $$R\_{cs}$$, and $$R\_{ss}$$ are the resolver sine cosine gains and $$R\_{dir}$$ is the direction of the sensor rotation (0 = clockwise, 1 = counterclockwise).

{% hint style="info" %}
$$R\_{dir}$$ does not have an effect to the resolver angle, but change the resolver sine sign to match the counterclockwise convention.
{% endhint %}

When the gains are set to its default values ( $$R\_{cc}=1$$, $$R\_{sc}=0$$, $$R\_{cs}=0$$, and $$R\_{ss}=1$$), the sensor rotation is clockwise, and the excitation is a sinusoidal wave ( $$\text{Excitation}=\sin 2 \pi f t$$, where $$f$$ is the excitation frequency), the outputs are given by the following expressions:

$$
\text{cosine}=\sin \left( 2 \pi f t \right) \times \cos \left( \theta\_{res} \right) \\\[8pt]
\text{sine}= \sin \left( 2 \pi f t \right) \times \sin \left( \theta\_{res} \right)
$$

It means the excitation signals are modulated by the sine and cosine of the rotor position angle.

## **Excitation source**

The excitation signal can be selected among one of the following options:

* DC: a continuous signal is used as excitation, so the outputs are $$\text{cosine}= \cos \left( \theta\_{res} \right)$$ and $$\text{sine}= \sin \left( \theta\_{res} \right)$$;
* AC: a constant-frequency sinusoidal, unitary amplitude waveform is used as excitation

  $$\text{Excitation}=\sin 2 \pi f t$$, so the outputs are those expressed in the previous section.
* External: a external signal, coming from one of the analog inputs, is used as excitation. This incoming signal may be rescaled by the Analog Input Differential Rescaling module (AIR).

## **Resolver gains**

The resolver gains can be used to simulate non-ideal conditions of the sensor, occurring due to manufacturing imperfections.

**Amplitude imbalance:** Output phases have unequal inductances. Assuming the coupling between the rotor excitation winding and the cosine winding as the reference:

$$
\begin{aligned}
\left\[\begin{matrix}R\_{cc} & R\_{cs}\R\_{sc} & R\_{ss}\end{matrix}\right]
\end{aligned}=\begin{aligned}
\left\[\begin{matrix}1 & 0\0 & \alpha\end{matrix}\right]
\end{aligned}
$$

where $$0< \alpha <1$$

**Imperfect quadrature:** Output phases are not in perfect spatial quadrature. Assuming the angle $$\theta\_{res}=0$$ when the rotor excitation winding is aligned with the cosine winding:

$$
\begin{aligned}
\left\[\begin{matrix}R\_{cc} & R\_{cs}\R\_{sc} & R\_{ss}\end{matrix}\right]
\end{aligned}=\begin{aligned}
\left\[\begin{matrix}1 & 0\ \cos \alpha & \sin \alpha\end{matrix}\right]
\end{aligned}
$$

where $$\alpha$$ is the angle between the cosine winding and the sine winding. When $$\alpha = 90°$$, the windings are in perfect quadrature, and the default gain values are recovered.

## **Faults**

One of the windings is not connected due to a fault. In this case, the corresponding gain is equal to zero.

<p align="center"><span class="math">\begin{aligned} \left[\begin{matrix}R_{cc} &#x26; R_{cs}\\R_{sc} &#x26; R_{ss}\end{matrix}\right] \end{aligned}=\begin{aligned} \left[\begin{matrix}1 &#x26; 0\\ 0 &#x26; 0\end{matrix}\right] \end{aligned} \text{ or }\begin{aligned} \left[\begin{matrix}R_{cc} &#x26; R_{cs}\\R_{sc} &#x26; R_{ss}\end{matrix}\right] \end{aligned}=\begin{aligned} \left[\begin{matrix}0 &#x26; 0\\ 0 &#x26; 1\end{matrix}\right] \end{aligned}</span></p>

## **Excitation time shift**

When the excitation signal comes from an external source (one of the analog input channels) the signal can be shifted by a given amount of time.

Number of resolver pole pairs affects the number of electrical turns per mechanical turns.

Resolver sine cosine gains affect the sine (first axis) and cosine (second axis) modulation output. Default values set to 1, 0, 0, 1 make it so the sine modulation has a sine form and the cosine modulation has a cosine form. If set to 0, 1, 1, 0, the sine modulation would have a cosine and the cosine modulation would have a sine form.

Number of pulses per revolution (**Q**<sub>**ppr**</sub>) defines how many times signals A and B pulse between two Z pulses (one full rotation).

Direction of the sensor rotation describes if A leads B (Clockwise) or if B leads A (Counterclockwise)

## Parameters

{% tabs %}
{% tab title="Electrical" %}

<table><thead><tr><th width="180">Parameter</th><th width="310">Description</th><th width="100">Sets Feature</th><th width="120">I/O &#x26; monitoring</th></tr></thead><tbody><tr><td><strong>Topology type</strong></td><td>Type of motor. Two options <strong>Dual Stator Isolated Neutral</strong> and <strong>Dual Stator Common Neutral</strong></td><td>No</td><td>N/A</td></tr><tr><td><strong>M</strong><sub><strong>conf</strong></sub><strong> Motor configuration type</strong></td><td>Selected: Constant DQ</td><td>No</td><td>N/A</td></tr><tr><td><strong>R</strong><sub><strong>s1</strong></sub><strong> Stator resistances - Windings 1</strong></td><td>Resistances of the stator windings specified for every phase a, b, and c (Ω)</td><td>No</td><td>N/A</td></tr><tr><td><strong>R</strong><sub><strong>s2</strong></sub><strong> Stator resistances - Windings 2</strong></td><td>Resistances of the stator windings specified for every phase, X, Y and Z (Ω)</td><td>No</td><td>N/A</td></tr><tr><td><strong>L</strong><sub><strong>dq1</strong></sub><strong> Stator inductances (DQ) - Windings 1</strong></td><td>d and q axis inductances of Winding 1 (H)</td><td>No</td><td>N/A</td></tr><tr><td><strong>L</strong><sub><strong>dq2</strong></sub><strong> Stator inductances (DQ) - Windings 2</strong></td><td>d and q axis inductances of Winding 2 (H)</td><td>No</td><td>N/A</td></tr><tr><td><strong>M</strong><sub><strong>dq1</strong></sub><strong> Mutual inductances (DQ) - Winding 1</strong></td><td>Md12 and Mq12 (H)</td><td>No</td><td>N/A</td></tr><tr><td><strong>M</strong><sub><strong>dq2</strong></sub><strong> Mutual inductances (DQ) - Winding 2</strong></td><td>Md21 and Mq21 (H)</td><td>No</td><td>N/A</td></tr><tr><td><strong>dΦ/dθ Back EMF profile</strong></td><td>Selected: Sinusoidal</td><td>No</td><td>N/A</td></tr><tr><td><strong>ε Phase shift between Winding</strong></td><td>Phase shift between Winding 1 and 2 (°)</td><td>No</td><td>N/A</td></tr><tr><td><strong>pp Number of pole pairs</strong></td><td>Number of machine pole pairs.</td><td>No</td><td>N/A</td></tr><tr><td><strong>dq0 DQ transform</strong></td><td>Selected: Amplitude Invariant</td><td>No</td><td>N/A</td></tr><tr><td><strong>θ</strong><sub><strong>dq0</strong></sub><strong> DQ transform angle</strong></td><td>Selected: A aligned to D</td><td>No</td><td>N/A</td></tr><tr><td><strong>L</strong><sub><strong>0</strong></sub><strong> Zero sequence inductance</strong></td><td><p>if <strong>Dual Stator Common Neutral</strong> is selected, zero Sequence Inductance Value for Winding 1 and 2 (H)</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>If L01 and L02 are unknown, retain the default value of 1e15.</p></div></td><td>No</td><td>N/A</td></tr><tr><td><strong>Stator currents - Winding 1, i</strong><sub><strong>s1</strong></sub></td><td>Phase currents at stator phases a, b, and c (A)</td><td>No</td><td><p>To model<br>To AO</p><p>To SFP<br>To Waveform</p></td></tr><tr><td><strong>Stator currents - Winding 2, i</strong><sub><strong>s2</strong></sub></td><td>Phase currents at stator phases X, Y, and Z (A)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Stator currents (DQ) - Winding 1, i</strong><sub><strong>sdq1</strong></sub></td><td>Currents in d1, q1, and 01 sequence current (A)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Stator currents (DQ) - Winding 2, i</strong><sub><strong>sdq1</strong></sub></td><td>Currents in d2, q2, and 02 sequence current (A)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Stator voltages - Winding 1, V</strong><sub><strong>s1</strong></sub></td><td>Phase voltages at stator phases a, b, and c (V)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Stator voltages - Winding 2, V</strong><sub><strong>s2</strong></sub></td><td>Phase voltages at stator phases X, Y, and Z (V)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Back EMF voltages - Winding 1, B</strong><sub><strong>emf1</strong></sub></td><td>Phase-to-neutral back-EMF generated from the permanent magnet flux linkage for Winding Set 1 (V)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Back EMF voltages - Winding 2, B</strong><sub><strong>emf2</strong></sub></td><td>Phase-to-neutral back-EMF generated from the permanent magnet flux linkage for Winding Set 2 (V)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>Electrical rotor position, θ</strong><sub><strong>e</strong></sub></td><td>Position of the rotor from 0 to 360 degrees (°)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>R</strong><sub><strong>s</strong></sub><strong> Snubber resistance</strong></td><td>Snubber resistances on phases a, b, and c (Ω)</td><td>No</td><td>N/A</td></tr><tr><td><strong>C</strong><sub><strong>s</strong></sub><strong> Snubber capacitance</strong></td><td>Snubber capacitances on phasesa, b, and c (F)</td><td>NO</td><td>N/A</td></tr></tbody></table>
{% endtab %}

{% tab title="Mechanical" %}

<table><thead><tr><th width="180">Parameter</th><th width="300">Description</th><th width="100">Stets feature</th><th width="120">I/O &#x26; Monitoring</th></tr></thead><tbody><tr><td><strong>J Rotor inertia</strong></td><td>Rotor moment of inertia available only in Torque mode (kg·m<sup>2</sup>)</td><td>No</td><td>N/A</td></tr><tr><td><strong>F</strong><sub><strong>s</strong></sub><strong> Static friction torque</strong></td><td>Static friction torque (N·m)</td><td>No</td><td>N/A</td></tr><tr><td><strong>F</strong><sub><strong>v</strong></sub><strong> Viscous friction coefficient</strong></td><td>Viscous friction available only in Torque mode (N·m·s/rad)</td><td>No</td><td>N/A</td></tr><tr><td><strong>ctrl Mechanical control mode</strong></td><td><p>Options: Speed or Torque.</p><p>In <strong>Speed (0) mode</strong>, the mechanical model is bypassed and the speed command is applied directly.<br>In <strong>Torque (1) mode</strong>, the torque command drives the mechanical model to compute speed.</p></td><td>Yes</td><td>From model</td></tr><tr><td><strong>T Torque command</strong></td><td>Torque command to the mechanical model (N·m)</td><td>Yes</td><td>From model</td></tr><tr><td><strong>ω</strong><sub><strong>r0</strong></sub><strong> Initial rotor speed command</strong></td><td>Initial rotor speed setpoint (rpm)</td><td>No</td><td>N/A</td></tr><tr><td><strong>ω</strong><sub><strong>rc</strong></sub><strong> Rotor speed command</strong></td><td>Rotor speed command to the mechanical model (rpm)</td><td>Yes</td><td>From model</td></tr><tr><td><strong>Rotor speed, ω</strong><sub><strong>r</strong></sub></td><td>Mechanical rotor speed (rpm)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>θ</strong><sub><strong>0</strong></sub><strong> Initial rotor angle</strong></td><td>Rotor position at time t = 0 (°)</td><td>No</td><td>N/A</td></tr><tr><td><strong>Rotor angle θ</strong></td><td>Mechanical rotor angle (0–360°) (°)</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr></tbody></table>
{% endtab %}

{% tab title="Resolver" %}

<table><thead><tr><th width="180">Parameter</th><th width="310">Description</th><th width="100">Sets feature</th><th width="120">I/O &#x26; Monitoring</th></tr></thead><tbody><tr><td><strong>Enable resolver Ren</strong></td><td><p><strong>Disable</strong> the resolver.</p><p><strong>Enable</strong> the resolver, the following parameters are displayed.</p></td><td>No</td><td>N/A</td></tr><tr><td><strong>Resolver feedback signals R</strong><sub><strong>sc</strong></sub></td><td>Resolver sine and cosine feedback signals proportional to the angle.</td><td>No</td><td>To model<br>To AO<br>To SFP<br>To Waveform</td></tr><tr><td><strong>R</strong><sub><strong>pp</strong></sub><strong> Number of resolver pole pairs</strong></td><td>Resolver pole-pair count.</td><td>No</td><td>N/A</td></tr><tr><td><strong>R</strong><sub><strong>dir</strong></sub><strong> Direction of the sensor rotation</strong></td><td>Options: Clockwise or counterclockwise.</td><td>No</td><td>N/A</td></tr><tr><td><strong>R</strong><sub><strong>θ</strong></sub><strong> Angle offset Δθ (Sensor − Rotor)</strong></td><td>Angle offset between resolver and rotor position (°)</td><td>No</td><td>N/A</td></tr><tr><td><strong>R</strong><sub><strong>k</strong></sub><strong> Resolver sine/cosine gains</strong></td><td>The sine/cosine modulation output sine/cosine component amplitude. Default value are 1, 0, 0 and 1.</td><td>No</td><td>N/A</td></tr><tr><td><strong>E</strong><sub><strong>mod</strong></sub><strong> Excitation mode</strong></td><td><p>Selected: single (just one excitation signal)</p><p>Number of resolver excitation windings.</p></td><td>No</td><td>N/A</td></tr><tr><td><strong>E</strong><sub><strong>type</strong></sub><strong> Excitation source type</strong></td><td><p>Options AC, DC External<br><strong>AC</strong>: generated in FPGA at the specified frequency,</p><p><strong>DC:</strong> single excitation only<br><strong>External</strong> provided from outside the model.</p></td><td>No</td><td>N/A</td></tr><tr><td><strong>E</strong><sub><strong>src1</strong></sub><strong> Excitation source</strong></td><td>External excitation source in External mode.</td><td>No</td><td>From AI</td></tr><tr><td><strong>E</strong><sub><strong>f</strong></sub><strong> Excitation frequency</strong></td><td>Frequency of the excitation when in AC mode (Hz)</td><td>No</td><td>From model</td></tr><tr><td><strong>E</strong><sub><strong>ts</strong></sub><strong> Excitation time shift</strong></td><td>Compensates time offset between the carrier generation input and modulated signal output (s)</td><td>No</td><td>N/A</td></tr></tbody></table>
{% endtab %}

{% tab title="Encoder" %}

<table><thead><tr><th width="180">Parameter</th><th width="310">Description</th><th width="100">Sets feature</th><th>I/O &#x26; Monitoring</th></tr></thead><tbody><tr><td><strong>Enc</strong><sub><strong>en</strong></sub><strong> Enable encoder</strong></td><td><p><strong>Disable</strong> the encoder.</p><p><strong>Enable</strong> the encoder, the following parameters are displayed.</p></td><td>No</td><td>N/A</td></tr><tr><td><strong>Enc</strong><sub><strong>type</strong></sub><strong> Encoder type</strong></td><td>Options : Quadrature or Hall Effect.</td><td>No</td><td>N/A</td></tr><tr><td><strong>A B Z encoder signals Q</strong><sub><strong>ABZ</strong></sub></td><td>Quadrature encoder A, B, and Z signals in Quadrature mode</td><td>No</td><td>To DO</td></tr><tr><td><strong>A B C encoder signals H</strong><sub><strong>ABC</strong></sub></td><td>Hall-effect encoder A, B, and C signals in hall effect mode.</td><td>No</td><td>To DO</td></tr><tr><td><strong>Q</strong><sub><strong>ppr</strong></sub><strong> Number of pulses per revolution</strong></td><td>Number of pulses in one full revolution of the encoder in Quadrature mode.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Q</strong><sub><strong>dir</strong></sub><strong> Direction of the sensor rotation</strong></td><td>Direction in which the sensor is turning, A leads B or B leads A in Quadrature mode.</td><td>No</td><td>N/A</td></tr><tr><td><strong>Q</strong><sub><strong>θ</strong></sub><strong> Angle offset Δθ (Sensor − Rotor)</strong></td><td>Angle offset between the encoder and the rotor position from 0 to 360 degrees in Quadrature mode (°)</td><td>No</td><td>N/A</td></tr><tr><td><strong>Q</strong><sub><strong>rat</strong></sub><strong> Encoder speed ratio</strong></td><td>Sensor-to-mechanical position ratio. Encoder angle = Qrat × machine mechanical angle in Quadrature mode.</td><td>No</td><td>N/A</td></tr><tr><td><strong>H</strong><sub><strong>θ</strong></sub><strong> Hall effect sensor position</strong></td><td>Positions of phases a, b, and c in Hall effect mode (°)</td><td>No</td><td>N/A</td></tr><tr><td><strong>H</strong><sub><strong>rat</strong></sub><strong> Hall effect sensor speed ratio</strong></td><td>Mechanical to encoder ratio. Angle of Encoder = Hrat * machine mechanical angle in Hall effect mode</td><td>No</td><td>N/A</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
The I/O type and quantities depend on the selected firmware.
{% endhint %}

## Conserving ports

| Port                 | Description                                                                                                                                                                      |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Stator terminals (6) | Six electrical conserving ports corresponding to the six terminals of the stator winding. Terminals can be identified by clicking them to view their port identifiers in the UI. |

## Characteristics and limitations <a href="#limitations" id="limitations"></a>

| Characteristic                          | Value                       |
| --------------------------------------- | --------------------------- |
| Variable DQ Mode with saturation tables | Planned for future releases |
| User Defined BEMF Profile               | Planned for future releases |
| Parameter update on the fly             | Planned for future releases |
| Double excitation resolver              | Planned for future releases |
| Power measurement                       | Planned for future releases |
| Power Invariant Transformation          | Planned for future releases |
| “A aligned to Q” Transform Angle        | Planned for future releases |


---

# 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/ehs/model-in-schematic-editor/library-blocks-reference/machines-blocks/permanent-magnet-synchronous-machine-6-phase.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.
