# 虛擬同步機（構網型） (`vsm`)

> 讓換流器表現得像同步發電機：頻率經由虛擬慣量與下垂阻尼跟隨功率變化。

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

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

**分類:** 控制 · **種類:** `{"block":"vsm","kind":"control"}`

## 何時使用

用於需要抑制孤島或弱電網上快速頻率變化的構網型換流器，除了分擔負載也提供慣量。若只在意負載分擔，請用下垂控制；kp 相同時，兩者穩態的負載分擔相同。

## 接腳

| 接腳 | 訊號域 | 意義 |
|---|---|---|
| `p` | 訊號 | 換流器輸出的量測實功，單位 W |
| `q` | 訊號 | 量測虛功，單位 var，電感性負載為正 |
| `theta` | 訊號 | 電壓參考的角度，單位為弧度 |
| `w` | 訊號 | 電壓的角頻率，單位 rad/s |
| `e` | 訊號 | 電壓參考的振幅（每相峰值），單位 V |

## 常用參數

- `e0`: Voltage amplitude (peak, per phase) at the reactive power qset (預設值: 必填)
- `prated`: Rated active power: the base of h and kp (預設值: 必填)
- `h`: Inertia constant: stored energy at the nominal speed over the rated power (預設值: 必填)
- `kp`: Frequency droop per unit, the inverse of the damping: the frequency settles kp·f0 lower at the rated power (預設值: 必填)
- `kq`: Voltage droop per unit: the amplitude falls by kq·e0 at the rated reactive power (預設值: 必填)

## 參數

| 鍵 | 單位 | 預設值 | 典型範圍 | 說明 |
|---|---|---|---|---|
| `f0` | Hz | 50 |  | Nominal frequency, at the power pset (50 Hz mains, IEC 60038:2009 Table 1) |
| `e0` | V | 必填 |  | Voltage amplitude (peak, per phase) at the reactive power qset |
| `prated` | W | 必填 |  | Rated active power: the base of h and kp |
| `qrated` | var | 選填（預設關閉） |  | Rated reactive power: the base of kq (prated when absent) |
| `h` | s | 必填 |  | Inertia constant: stored energy at the nominal speed over the rated power |
| `kp` | — | 必填 |  | Frequency droop per unit, the inverse of the damping: the frequency settles kp·f0 lower at the rated power |
| `kq` | — | 必填 |  | Voltage droop per unit: the amplitude falls by kq·e0 at the rated reactive power |
| `fc` | Hz | 必填 |  | Cutoff of the filter on the measured reactive power |
| `pset` | W | 0 |  | Active power at which the frequency is f0 |
| `qset` | var | 0 |  | Reactive power at which the amplitude is e0 |
| `theta0` | rad | 0 |  | Angle at the start |

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

## 模型

標么轉速依搖擺方程式 2*h*d(w/w0)/dt = (pset - p)/prated - (w/w0 - 1)/kp 變化，其中 w0 = 2*pi*f0：h 是以 prated 為基準的慣量常數（秒），阻尼 1/kp 讓頻率穩定在下垂線 w = w0*(1 - kp*(p - pset)/prated) 上。功率步階 dP 之後，頻率起初以每秒 f0*dP/(2*h*prated) Hz 變化，再以時間常數 2*h*kp 穩定。theta 是 w 的積分，維持在 0 到 2*pi 之間。振幅依 Q-V 下垂 e = e0*(1 - kq*(Qf - qset)/qrated) 決定，q 先以 fc 濾波。kp 相同時，換流器與下垂控制一樣依額定比例分擔實功；此虛擬同步機等同功率濾波器截止頻率為 1/(2*pi*2*h*kp) 的下垂控制。h = 0 表示沒有慣量，kp = 0 則頻率固定在 f0。w 限制在 0 到兩倍標稱轉速之間，e 限制在 0 到 2*e0 之間。方塊沒有直通，可以放在它所驅動的迴路內。把 theta 與 e 接到反 Park 轉換（dq2abc），d = e、q = 0。

## 常見錯誤

- 慣量大而下垂小時，與線路電感構成緩慢且阻尼小的搖擺：負載步階後功率會以機電頻率振盪。請加大 kp 或減小 h，加入慣量前先檢查步階響應。
- 慣量是虛擬的，所需能量來自直流鏈。在時間常數 2*h*kp 內的額定功率步階必須由電源或直流鏈電容供應，否則直流鏈電壓會下陷。
- 與下垂控制相同，下垂特性假設輸出阻抗以電感為主；線路為電阻性時，請加串聯電感或虛擬阻抗。

Problems 規則: `pin.unconnected`

## 規格書與來源

沒有規格書。e0 是換流器所建立電網的相電壓峰值，prated 與 qrated 是換流器的額定，h 由設計決定（同步發電機約為數秒），kp 與 kq 取自電網規範或微電網設計。fc 取數赫茲。

## 範例

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

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