# 內嵌式永磁同步馬達 (`ipmsm`)

> d 軸與 q 軸電感不同的永磁馬達，除磁鐵轉矩外還有磁阻轉矩。

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

[元件參考](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/) · [English](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/machines/ipmsm/)

**分類:** 馬達 · **種類:** `{"kind":"machine","model":"ipmsm"}`

## 何時使用

用於有凸極的磁鐵馬達，例如牽引與壓縮機驅動。兩個電感相等時改用表面式永磁同步馬達。

## 接腳

| 接腳 | 訊號域 | 意義 |
|---|---|---|
| `a` | 電氣 | 定子 a 相，作電動機時電流流入 |
| `b` | 電氣 | 定子 b 相，作電動機時電流流入 |
| `c` | 電氣 | 定子 c 相，作電動機時電流流入 |
| `n` | 電氣 | 星形中性點，可不接 |
| `shaft` | 機械 | 機械軸，轉速單位為 rad/s |

## 常用參數

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

## 參數

| 鍵 | 單位 | 預設值 | 典型範圍 | 說明 |
|---|---|---|---|---|
| `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 | 選填（預設關閉） |  | 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 |

_參數說明在兩種語言中都是英文。_

## 模型

與表面式永磁同步馬達共用 dq 模型，λd = ld·id + psif，λq = lq·iq。轉矩為 Te = (3/2)·pp·(psif·iq + (ld - lq)·id·iq)，所以 lq 大於 ld 時，id 小於零的磁阻部分為正。在靜止座標系中，磁通帶有兩倍電氣角的凸極項。零序使用平均值 (ld + lq)/2，模型不含鐵損與飽和。

## 常見錯誤

- 不要把 ld 與 lq 對調。內嵌式馬達通常 lq 比較大，對調後磁阻項的正負會反過來，負的 id 反而讓轉矩變小。
- 把 id 固定在 0 的控制器只用到磁鐵轉矩，浪費了磁阻轉矩。要讓每安培轉矩最大，請給它小於零的 id 參考值。
- 和表面式永磁同步馬達一樣，轉子角度必須來自位置感測器，且它的 theta0 要等於馬達 theta0 除以極對數。開迴路運轉超過失步轉矩就會失步，而 poles 是極數，不是極對數。

## 規格書與來源

rs 取星形繞組線對線電阻的一半，ld 與 lq 取自規格書或有限元素分析結果，因為它們不是線對線電感。psif 由反電動勢常數換算，方法和表面式永磁同步馬達相同。

## 範例

以指令 `file.openExample` 開啟範例，名稱為 `demo:ipmsm`.

---
由 `cargo xtask reference` 依使用說明文字與參數規格產生，請勿手動編輯。
