# Interior PMSM (`ipmsm`)

> A magnet motor with different d and q inductances, so it also makes reluctance torque.

![ipmsm](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/ipmsm.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/machines/ipmsm/)

**Group:** Machines · **Kind:** `{"kind":"machine","model":"ipmsm"}`

## When to use it

Use it for magnet motors with salient poles, such as traction and compressor drives. Use Surface PMSM when the two inductances are equal.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `a` | electrical | Stator phase a, current enters when motoring |
| `b` | electrical | Stator phase b, current enters when motoring |
| `c` | electrical | Stator phase c, current enters when motoring |
| `n` | electrical | Star point, optional |
| `shaft` | mechanical | Mechanical shaft, speed in rad/s |

## Common parameters

- `psif`: Magnetic flux of the magnets per phase (Default: 0.1)
- `ld`: Inductance along the magnet axis (Default: 1m)
- `lq`: Inductance across the magnet axis (Default: 2m)
- `rs`: Stator winding resistance per phase (Default: 0.2)
- `poles`: Number of poles of the machine (Default: 8)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `rs` | Ω | 0.2 |  | Stator winding resistance per phase |
| `ld` | H | 1m |  | Inductance along the magnet axis |
| `lq` | H | 2m |  | Inductance across the magnet axis |
| `l0` | H | optional (off) |  | Inductance of the neutral path |
| `psif` | Wb | 0.1 |  | Magnetic flux of the magnets per phase |
| `poles` | — | 8 |  | Number of poles of the machine |
| `j` | kg·m² | 1m |  | How strongly the rotor resists speeding up |
| `b` | N·m·s/rad | 0 |  | Friction that grows with speed |
| `w0` | rad/s | 0 |  | Shaft speed at the start |
| `theta0` | rad | 0 |  | Rotor position at the start |

_Parameter descriptions are in English in both languages._

## Model

It shares the dq model of Surface PMSM, with λd = ld·id + psif and λq = lq·iq. The torque is Te = (3/2)·pp·(psif·iq + (ld - lq)·id·iq), so when lq is larger than ld the reluctance part is positive for id below zero. In stationary variables the flux has a saliency term at twice the electrical angle. The zero sequence uses the mean (ld + lq)/2, and there is no iron loss or saturation.

## Common mistakes

- Do not swap ld and lq. An interior machine usually has the larger lq, and swapped values flip the reluctance term so a negative id then lowers the torque.
- A controller that holds id at 0 uses only the magnet torque and wastes the reluctance torque. Give it an id reference below zero for the most torque per ampere.
- As for Surface PMSM, the rotor angle must come from a Position Sensor whose theta0 matches the machine theta0 divided by the pole pairs. Open-loop operation falls out of step past the pull-out torque, and poles is a pole count, not pole pairs.

## Datasheet and sources

Take rs as half the line-to-line resistance of the star winding, and take ld and lq from the datasheet or a finite-element result because they are not the line-to-line inductance. Get psif from the back-EMF constant as for Surface PMSM.

## Example

Open the example with the command `file.openExample` and the name `demo:ipmsm`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
