> 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/hypersim/library-blocks-reference/network-machines/permanent-magnet-synchronous-machine-pmsm.md).

# Permanent Magnet Synchronous Machine (PMSM)

## Description

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-f91db59d9755b36ba636a2459b372dc07b976fcc%2Fimage%20(342).png?alt=media" alt=""><figcaption></figcaption></figure>

The **Permanent Magnet Synchronous Machine (PMSM)** block, located in the **Network Machines** library, is a Norton-equivalent (non-iterative) model. Specify the machine electrical parameters using fundamental parameters (per unit). The PMSM is controlled externally via the mechanical power or mechanical torque input.

**Both control modes** ultimately act on the torque and therefore use the PMSM mechanical data. In mechanical power control, the block computes the torque reference internally from the reference power and the actual PMSM speed. In mechanical torque control, the torque reference is provided directly.

Features:

* **Dampers:** up to 2 damper windings on each of the d and q axes.
* **Magnetic saturation:** total, independent, or d-axis only.
* **Stator connection:** wye with neutral, wye grounded, or delta.
* **Shaft:** up to 5 masses.

When saturation is enabled, provide appropriate saturation curve points. For independent d- and q-axis saturation, each table defines the positive part of the curve; the negative part is obtained by symmetry. The number of points for the d- and q-axis curves can differ. For total saturation or d-axis-only saturation, only the d-axis table is used.

In load flow, the PMSM participates as a PV node and is represented as a source behind an impedance. The load-flow result is valid only when d- and q-axis reactances are equal (surface-mounted PMSM).

The machine can have in the q axis 2 damper windings, Q1 and Q2. Similarly, it can have in the d axis 2 damper windings, D1 and D2.

The rotor reference frame is such that the q axis is ![](https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-60c535f9a306ffe6305189c55d6a7c744f466bec%2Funknown%20\(100\).svg%2Bxml?alt=media) rad ahead of the d axis.

{% hint style="info" %}
**This model ignores hysteresis**. Under certain conditions, the PMSM can diverge as the implemented model of the synchronous machine is non-iterative.
{% endhint %}

### Base values for per-unit conversion

| Base value                                                               | Description                                     |
| ------------------------------------------------------------------------ | ----------------------------------------------- |
| $$S\_{base} = S\_{rated}$$                                               | Base power                                      |
| $$V\_{base\_stator} = \sqrt{\frac{2}{3}},V\_{LL}$$                       | Base stator voltage (peak) for wye connection   |
| $$V\_{base\_stator} = \sqrt{2}, V\_{LL}$$                                | Base stator voltage (peak) for delta connection |
| $$I\_{base\_stator} = \frac{S\_{base}}{3, V\_{base\_stator}}$$           | Base stator current (peak)                      |
| $$T\_{base} = \frac{3}{2}, \frac{p}{2}, \frac{S\_{base}}{\omega\_{sm}}$$ | Base mechanical torque                          |
| $$\Psi\_{base} = \frac{V\_{base\_stator}}{\omega\_{s}}$$                 | Base flux (peak)                                |

### Model equations

The Park transform is defined as follows:

$$
T = \frac{2}{3} \begin{bmatrix} \cos \theta\_{s} & \cos \left(\theta\_{s}-\frac{2 \pi}{3}\right) & \cos \left(\theta\_{s}+\frac{2 \pi}{3}\right) \\\[6pt] -\sin \theta\_{s} & -\sin \left(\theta\_{s}-\frac{2 \pi}{3}\right) & -\sin \left(\theta\_{s}+\frac{2 \pi}{3}\right) \\\[6pt]\ \frac{1}{2} & \frac{1}{2} & \frac{1}{2} \end{bmatrix}
$$

where $$\theta\_s$$ is the angle between phase a and the d-axis.

## Electrical system (p.u. and generating convention) equations

$$
v\_{q} = -r\_{s} i\_{q} + \frac{\omega\_{r}}{\omega\_{s}} \psi\_{d} + \frac{1}{\omega\_{s}} \frac{d \psi\_{q}}{dt} \\\[8pt] v\_{d} = -r\_{s} i\_{d} - \frac{\omega\_{r}}{\omega\_{s}} \psi\_{q} + \frac{1}{\omega\_{s}} \frac{d \psi\_{d}}{dt}  \\\[8pt] v\_{0} = -r\_{s} i\_{0} + \frac{1}{\omega\_{s}} \frac{d \psi\_{0}}{dt}  \\\[8pt] 0 = r\_{D1} i\_{D1} + \frac{1}{\omega\_{s}} \frac{d \psi\_{D1}}{dt}  \\\[8pt]
0 = r\_{D2} i\_{D2} + \frac{1}{\omega\_{s}} \frac{d \psi\_{D2}}{dt}  \\\[8pt]
0 = r\_{Q1} i\_{Q1} + \frac{1}{\omega\_{s}} \frac{d \psi\_{Q1}}{dt}  \\\[8pt]
0 = r\_{Q2} i\_{Q2} + \frac{1}{\omega\_{s}} \frac{d \psi\_{Q2}}{dt}
$$

## Flux current (pu)

$$
\psi\_{q} = -x\_{q} i\_{q} + x\_{mq} i\_{Q1} + x\_{mq} i\_{Q2}\\\[8pt]
\psi\_{d} = -x\_{d} i\_{d} + x\_{md} i\_{D1} + x\_{md} i\_{D2} + \psi\_{f}\\\[8pt] \psi\_{0} = -x\_{0} i\_{0}\\\[8pt]
\psi\_{D1} = -x\_{md} i\_{d} + x\_{D1} i\_{D1} + x\_{md} i\_{D2} + \psi\_{f}\\\[8pt]
\psi\_{D2} = -x\_{md} i\_{d} + x\_{D2} i\_{D2} + x\_{md} i\_{D1} + \psi\_{f}\\\[8pt]
\psi\_{Q1} = -x\_{mq} i\_{q} + x\_{Q1} i\_{Q1} + x\_{mq} i\_{Q2}\\\[8pt]
\psi\_{Q2} = -x\_{mq} i\_{q} + x\_{Q2} i\_{Q2} + x\_{mq} i\_{Q1}
$$

\
where $$\omega\_r$$ is the electric speed (rad / s) and $$\psi\_f$$ the flux produced by the permanent magnets (pu).

## Reactance relationships (pu)

Since the flux equations are in per-unit, any reactance can be equivalently specified as an inductance.

$$
x\_{d} = x\_{md} + x\_{l} \\\[8pt]
x\_{q} = x\_{mq} + x\_{l} \\\[8pt]
x\_{D1} = x\_{md} + x\_{lD1} \\\[8pt]
x\_{D2} = x\_{md} + x\_{lD2}\\\[8pt]
x\_{Q1} = x\_{mq} + x\_{lQ1} \\\[8pt]
x\_{Q2} = x\_{mq} + x\_{lQ2}
$$

## Electromagnetic torque (pu)

$$
t\_{em} = \psi\_{d} i\_{q} - \psi\_{q} i\_{d}
$$

## Mechanical equations (mass i)

$$
2 H\_{i} \frac{d \omega\_{im}}{dt} = \\\[8pt]
T\_{im} - T\_{em} - K\_{di} \omega\_{im} - D\_{i}(\omega\_{im} - \omega\_{sm}) - D\_{i,i-1}(\omega\_{im} - \omega\_{(i-1)m}) - D\_{i,i+1}(\omega\_{im} - \omega\_{(i+1)m})\\\[8pt] - K\_{i,i-1}(\delta\_{im} - \delta\_{(i-1)m}) - K\_{i,i+1}(\delta\_{im} - \delta\_{(i+1)m})\\\[10pt]
\frac{d \delta\_{im}}{dt} = \omega\_{im} - \omega\_{sm}
$$

Where: $$T\_{im}$$ is the mechanical torque developed on the i-th mass (Nm); $$T\_{em}$$ is the electromagnetic torque developed by the PMSM (Nm); $$\omega\_{im}$$ is the mechanical speed of mass i (rad/s); $$\omega\_{sm}$$ is the mechanical synchronous speed (rad/s); $$\delta\_{im}$$ is the mechanical angle of mass i; $$K\_{di}$$ is the absolute damping coefficient (Nm/rad/s); $$D\_{i}$$ is the self damping coefficient (Nm/rad/s); $$D\_{i,j}$$ is the mutual damping coefficient (Nm/rad/s); $$K\_{i,j}$$ is the angular stiffness (Nm/rad); $$H\_{i}$$ is the inertia constant (s).

{% hint style="info" %}
When the machine is used in motor mode, the mechanical torque is negative and positive in generator mode.
{% endhint %}

## Mask parameters

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-d029833b4f63d1c07b5436543bcf42a6543ad9d0%2Fd.jpg?alt=media" alt=""><figcaption></figcaption></figure>

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

<table><thead><tr><th width="210">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Base power</strong></td><td>Nominal power (MVA)</td></tr><tr><td><strong>Base voltage</strong></td><td>Nominal line-to-line voltage (kV)</td></tr><tr><td><strong>Frequency</strong></td><td>Nominal frequency (Hz)</td></tr><tr><td><strong>Number of poles</strong></td><td>Number of poles.</td></tr><tr><td><strong>d-axis damper</strong></td><td>Number of dampers on the d-axis (maximum 2).</td></tr><tr><td><strong>q-axis damper</strong></td><td>Number of dampers on the q-axis (maximum 2).</td></tr><tr><td><strong>Stator connection</strong></td><td>Stator winding connection: wye with neutral, wye grounded, or delta.</td></tr><tr><td><strong>Rs</strong></td><td>Stator resistance (pu)</td></tr><tr><td><strong>Xl</strong></td><td>Stator leakage reactance (pu)</td></tr><tr><td><strong>X0</strong></td><td>Zero-sequence reactance (pu)</td></tr><tr><td><strong>Xd</strong></td><td>d-axis synchronous reactance (pu)</td></tr><tr><td><strong>Xq</strong></td><td>q-axis synchronous reactance (pu)</td></tr><tr><td><strong>XlD1</strong></td><td>D1 damper winding leakage reactance (required when 1 or 2 d-axis dampers are included; ignored otherwise) (pu)</td></tr><tr><td><strong>RD1</strong></td><td>D1 damper winding resistance (required when 1 or 2 d-axis dampers are included; ignored otherwise) (pu)</td></tr><tr><td><strong>XlD2</strong></td><td>D2 damper winding leakage reactance (required when 2 d-axis dampers are included; ignored otherwise) (pu)</td></tr><tr><td><strong>RD2</strong></td><td>D2 damper winding resistance (required when 2 d-axis dampers are included; ignored otherwise) (pu)</td></tr><tr><td><strong>XlQ1</strong></td><td>Q1 damper winding leakage reactance (required when 1 or 2 q-axis dampers are included; ignored otherwise) (pu)</td></tr><tr><td><strong>RQ1</strong></td><td>Q1 damper winding resistance (required when 1 or 2 q-axis dampers are included; ignored otherwise) (pu)</td></tr><tr><td><strong>XlQ2</strong></td><td>Q2 damper winding leakage reactance (required when 2 q-axis dampers are included; ignored otherwise) (pu)</td></tr><tr><td><strong>RQ2</strong></td><td>Q2 damper winding resistance (required when 2 q-axis dampers are included; ignored otherwise).</td></tr><tr><td><strong>Flux magnet</strong></td><td>Permanent magnet flux (Wb)</td></tr></tbody></table>
{% endtab %}

{% tab title="Mechanical data" %}

<table><thead><tr><th width="204">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Number of mass</strong></td><td>Add up to 5 masses on the machine shaft. Selecting 1 mass simulates only the machine. Selecting additional masses progressively adds the next mass on the shaft.</td></tr><tr><td><strong>H</strong></td><td>Inertia constants (s), listed per mass when enabled:<br>1) Generator,<br>2) Low Pressure Turbine B (LPB),<br>3) Low Pressure Turbine A (LPA),<br>4) Intermediate Pressure (IP) Turbine,<br>5) High Pressure (HP) Turbine.</td></tr><tr><td><strong>Kd</strong></td><td>Absolute damping coefficients per mass (Nm/rad/s): Generator, LPB turbine, LPA turbine, IP turbine, HP turbine.</td></tr><tr><td><strong>Kij</strong></td><td>Shaft stiffness coefficients between adjacent masses (Nm/rad): Generator–LPB, LPB–LPA, LPA–IP, IP–HP.</td></tr><tr><td><strong>D</strong></td><td>Self damping coefficients per mass (Nm/rad/s): Generator, LPB turbine, LPA turbine, IP turbine, HP turbine.</td></tr><tr><td><strong>Dij</strong></td><td>Mutual speed-deviation damping coefficients between adjacent masses (Nm/rad/s): Generator–LPB, LPB–LPA, LPA–IP, IP–HP.</td></tr><tr><td><strong>F</strong></td><td>Fraction of total external torque applied to the turbine masses: LPB, LPA, IP, HP. The sum of F must equal 1.</td></tr></tbody></table>
{% endtab %}

{% tab title="Control" %}

<table><thead><tr><th width="212">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Mechanical control</strong></td><td>Select the external control signal:<br>1) Mechanical power (pu), or<br>2) Mechanical torque (pu).</td></tr></tbody></table>
{% endtab %}

{% tab title="Saturation " %}

<table><thead><tr><th width="220">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Saturation</strong></td><td>Enable or disable one of the following: Independent, Total, or dAxis. Only saturation.</td></tr><tr><td><strong>d-axis saturation curve points</strong></td><td>Number of d-axis saturation curve points (maximum 10).</td></tr><tr><td><strong>Imd (pu)</strong></td><td>d-axis magnetizing current points of the saturation curve.</td></tr><tr><td><strong>Fluxmd (pu)</strong></td><td>d-axis magnetizing flux points of the saturation curve.</td></tr><tr><td><strong>q-axis saturation curve points</strong></td><td>Number of q-axis saturation curve points (maximum 10).</td></tr><tr><td><strong>Imq (pu)</strong></td><td>q-axis magnetizing current points of the saturation curve.</td></tr><tr><td><strong>Fluxmq (pu)</strong></td><td>q-axis magnetizing flux points of the saturation curve.</td></tr></tbody></table>

{% hint style="info" %}
**The first point of each saturation curve must not be zero.** For independent saturation or d-axis only, the first point corresponds to the machine linear inductance.
{% endhint %}
{% endtab %}

{% tab title="Load flow" %}

<table><thead><tr><th width="213">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>Voltage</strong></td><td>Desired terminal voltage of the machine (pu)</td></tr><tr><td><strong>Active power</strong></td><td>Desired active power output at the machine terminals (MW)</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Conserving ports

<table><thead><tr><th width="212">Port</th><th>Description</th></tr></thead><tbody><tr><td><strong>S</strong></td><td>AC stator connector (3-phase only).</td></tr><tr><td><strong>N</strong></td><td>AC neutral connector (single-phase only).</td></tr></tbody></table>

## Inputs

<table><thead><tr><th width="210">Input</th><th>Description</th></tr></thead><tbody><tr><td><strong>Tm_i</strong></td><td>Mechanical torque (pu)</td></tr><tr><td><strong>Pm_i</strong></td><td>Mechanical power (pu)</td></tr></tbody></table>

## Outputs

This block has no outputs.

## Signals available for monitoring and external I/O connections (via sensors form)

All block inputs and outputs are available as signals for monitoring and for external I/O connections.

Additional signals are also available and are listed below with their descriptions.

<table><thead><tr><th width="210">Signal</th><th>Description</th></tr></thead><tbody><tr><td><strong>Flux0s</strong></td><td>Stator zero-sequence flux (pu)</td></tr><tr><td><strong>Fluxds</strong></td><td>Stator d-axis flux (pu)</td></tr><tr><td><strong>Fluxqs</strong></td><td>Stator q-axis flux (pu)</td></tr><tr><td><strong>Fluxm</strong></td><td>Mutual magnetization flux (pu)</td></tr><tr><td><strong>Fluxmd</strong></td><td>d-axis mutual magnetization flux (pu)</td></tr><tr><td><strong>Fluxmq</strong></td><td>q-axis mutual magnetization flux (pu)</td></tr><tr><td><strong>I0s</strong></td><td>Zero-sequence stator current (pu)</td></tr><tr><td><strong>ID1</strong></td><td>d-axis damper D1 winding current (pu)</td></tr><tr><td><strong>ID2</strong></td><td>d-axis damper D2 winding current (pu)</td></tr><tr><td><strong>IQ1</strong></td><td>q-axis damper Q1 winding current (pu)</td></tr><tr><td><strong>IQ2</strong></td><td>q-axis damper Q2 winding current (pu)</td></tr><tr><td><strong>Ias</strong></td><td>Phase A stator current (A)</td></tr><tr><td><strong>Ibs</strong></td><td>Phase B stator current (A)</td></tr><tr><td><strong>Ics</strong></td><td>Phase C stator current (A)</td></tr><tr><td><strong>Ids</strong></td><td>d-axis stator current (pu)</td></tr><tr><td><strong>Iqs</strong></td><td>q-axis stator current (pu)</td></tr><tr><td><strong>Im</strong></td><td>Magnetization current (pu)</td></tr><tr><td><strong>Imd</strong></td><td>d-axis magnetization current (pu)</td></tr><tr><td><strong>Imq</strong></td><td>q-axis magnetization current (pu)</td></tr><tr><td><strong>Pmec</strong></td><td>Mechanical power (Nm).</td></tr><tr><td><strong>Pmec_pu</strong></td><td>Mechanical power (pu).</td></tr><tr><td><strong>Pmec_ss</strong></td><td>Mechanical power calculated by load flow; used to initialize the turbine/prime mover block (pu)</td></tr><tr><td><strong>PowerAngle</strong></td><td>Machine load angle (rad)</td></tr><tr><td><strong>Ps</strong></td><td>Active power (W).</td></tr><tr><td><strong>Ps_pu</strong></td><td>Active power (pu).</td></tr><tr><td><strong>Qs</strong></td><td>Reactive power (VAr).</td></tr><tr><td><strong>RotorAngle</strong></td><td>Rotor angle relative to a synchronous reference frame (rad)</td></tr><tr><td><strong>RotorAngle_HP</strong></td><td>Mass 5 (HP turbine) rotor angle relative to a synchronous reference frame (rad)</td></tr><tr><td><strong>RotorAngle_IP</strong></td><td>Mass 4 (IP turbine) rotor angle relative to a synchronous reference frame (rad)</td></tr><tr><td><strong>RotorAngle_LPA</strong></td><td>Mass 3 (LPA turbine) rotor angle relative to a synchronous reference frame (rad)</td></tr><tr><td><strong>RotorAngle_LPB</strong></td><td>Mass 2 (LPB turbine) rotor angle relative to a synchronous reference frame (rad)</td></tr><tr><td><strong>Tem</strong></td><td>Electromagnetic torque (Nm).</td></tr><tr><td><strong>Tem_pu</strong></td><td>Electromagnetic torque (pu).</td></tr><tr><td><strong>ThetaS</strong></td><td>Rotor electrical angle (angle between phase-a axis and d-axis) (rad)</td></tr><tr><td><strong>Tmec (Nm)</strong></td><td>Mechanical torque on the shaft (SI).</td></tr><tr><td><strong>Tmec_pu</strong></td><td>Mechanical torque on the shaft (pu).</td></tr><tr><td><strong>Tmec_HP</strong></td><td>Mechanical torque applied to the HP turbine mass (rad)</td></tr><tr><td><strong>Tmec_HP_IP</strong></td><td>Mechanical torque between the HP and IP turbine masses (pu)</td></tr><tr><td><strong>Tmec_IP</strong></td><td>Mechanical torque applied to the IP turbine mass (pu)</td></tr><tr><td><strong>Tmec_IP_LPA</strong></td><td>Mechanical torque between the IP and LPA turbine masses (pu)</td></tr><tr><td><strong>Tmec_LPA</strong></td><td>Mechanical torque applied to the LPA turbine mass (pu)</td></tr><tr><td><strong>Tmec_LPA_LPB</strong></td><td>Mechanical torque between the LPA and LPB turbine masses (pu)</td></tr><tr><td><strong>Tmec_LPB</strong></td><td>Mechanical torque applied to the LPB turbine mass (pu)</td></tr><tr><td><strong>Tmec_LPB_GEN</strong></td><td>Mechanical torque between the LPB turbine masses and the machine (pu)</td></tr><tr><td><strong>V0s</strong></td><td>Zero-sequence stator voltage (pu)</td></tr><tr><td><strong>Vds</strong></td><td>d-axis stator voltage (pu)</td></tr><tr><td><strong>Vqs</strong></td><td>q-axis stator voltage (pu)</td></tr><tr><td><strong>Vt</strong></td><td>Machine terminal voltage (pu)</td></tr><tr><td><strong>Wm</strong></td><td>Mechanical or electrical speed of the machine (pu)</td></tr><tr><td><strong>Wm_HP</strong></td><td>Mechanical or electrical speed of the HP turbine (pu)</td></tr><tr><td><strong>Wm_IP</strong></td><td>Mechanical or electrical speed of the IP turbine (pu)</td></tr><tr><td><strong>Wm_LPA</strong></td><td>Mechanical or electrical speed of the LPA turbine (pu)</td></tr><tr><td><strong>Wm_LPB</strong></td><td>Mechanical or electrical speed of the LPB turbine (pu)</td></tr><tr><td><strong>Wrpm</strong></td><td>Mechanical speed of the machine (r/min)</td></tr></tbody></table>

## References

\[1] *Dynamic Simulation of Electric Machinery Using Matlab/Simulink*. Chee-Mun Ong, Prentice Hall PTR 1997


---

# 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/hypersim/library-blocks-reference/network-machines/permanent-magnet-synchronous-machine-pmsm.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.
