# MMC 橋臂 (`mmcArm`)

> 模組化多階換流器（MMC）的一個橋臂：n 個半橋或全橋子模組串聯，各有自己的電容，由訊號 m 決定投入多少。

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

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

**分類:** 開關元件 · **種類:** `{"kind":"mmcArm"}`

## 何時使用

用於組出 MMC 逆變器、STATCOM 或 HVDC 線路的一端：每個相腳兩個橋臂，各串一個橋臂電感。要看子模組電壓、均壓與切換漣波時用 switched；橋臂很長或模擬時間很長時用 averaged。

## 接腳

| 接腳 | 訊號域 | 意義 |
|---|---|---|
| `p` | 電氣 | 橋臂一端，電流由此流入時橋臂電流為正 |
| `n` | 電氣 | 橋臂另一端 |
| `m` | 訊號 | 投入指數（輸入訊號）：0 旁路所有子模組，1 全部投入；全橋子模組在 −1 to 0 時反向投入 |

## 常用參數

- `n`: Submodules in series in the arm: 1 to 8 when switched, up to a million when averaged (預設值: 4)
- `c`: Capacitance of each submodule (預設值: 必填)
- `v0`: Voltage of each submodule capacitor at the start (預設值: 0)
- `level`: Level of detail: `switched` (every submodule with its switches, picked by the sorting balance) or `averaged` (the arm-averaged model: no ripple, any n) (預設值: switched)
- `fc`: Carrier frequency of the phase-shifted PWM; 0 inserts the nearest level. Switched level only (預設值: 0)

## 參數

| 鍵 | 單位 | 預設值 | 典型範圍 | 說明 |
|---|---|---|---|---|
| `n` | — | 4 |  | Submodules in series in the arm: 1 to 8 when switched, up to a million when averaged |
| `c` | F | 必填 |  | Capacitance of each submodule |
| `v0` | V | 0 |  | Voltage of each submodule capacitor at the start |
| `level` | — | switched |  | Level of detail: `switched` (every submodule with its switches, picked by the sorting balance) or `averaged` (the arm-averaged model: no ripple, any n) |
| `bridge` | — | half |  | Submodule type: `half` (inserted or bypassed, m from 0 to 1) or `full` (also inserted reversed, m from −1 to 1) |
| `fc` | Hz | 0 |  | Carrier frequency of the phase-shifted PWM; 0 inserts the nearest level. Switched level only |
| `sorting` | — | 1 |  | Set to 0 to switch the sorting balance off: submodules go in by index, lowest first, and the capacitor voltages drift apart. Switched level only |
| `ron` | Ω | 1m |  | Resistance of a submodule switch when on |
| `roff` | Ω | 1meg |  | Resistance of a submodule switch when off |

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

**適用於:** 模組化多階轉換器 · HVDC 轉換器研究 · 電容平衡研究

**不適用於:** 兩階轉換器的橋臂 → [`sixSwitch`](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/switches/sixSwitch/)

## 公式

| 公式 | 方程式 | 出處 |
|---|---|---|
| 運轉點的電容電壓 | Vc = Vdc/n | Lesnicar & Marquardt, IEEE Bologna PowerTech (2003), modular multilevel converter |
| 橋臂電壓 | v = m·n·Vc | Hagiwara & Akagi, IEEE Trans. Power Electron. 24(7) (2009), pp. 1737-1746, arm voltage from the insertion index |
| 橋臂電容中的能量 | E = n·½·C·Vc² | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 7 (energy in a capacitor) |

## 快速驗算

輸入:

- `vdcb`: 直流鏈電壓 = 800 V
- `n`: 橋臂的子模組數 = 4 —, `n`
- `c`: 子模組電容 = 4.7m F, `c`
- `m`: 投入指數 = 500m —

輸出:

- `vc0`: 電容電壓 = `vdcb/n` V
- `varm`: 橋臂電壓 = `m*n*vc0` V
- `earm`: 橋臂電容中的能量 = `n*0.5*c*vc0^2` J

## 模型邏輯

- 切換式：每個半橋子模組有一個接到電容的上開關與一個旁路的下開關；全橋有兩個橋臂。
- mmcBalance 方塊選出 round(m * n) 個子模組，fc 大於 0 時改用相移 PWM；充電時投入電壓最低的電容。
- 平均式：電壓源 m * vsum 串聯導通電阻，vsum 由 m * i 經 c / n 充電。
- 可以畫出 arm:i、arm:vsum，以及切換式的各電容電壓與選取訊號。

## 模型

模擬前，橋臂會變成基本元件。switched：每個半橋子模組是一個接到電容的上開關，加上一個把它旁路的下開關；全橋子模組有兩組這樣的橋腳，因此也能反向投入。一個 mmcBalance 方塊讀取 m、橋臂電流與每個電容電壓並選出子模組：投入 round(m·n) 個（最近準位），或在 fc 大於 0 時用 n 個載波的移相 PWM。橋臂電流為電容充電時投入電壓最低的電容，放電時投入電壓最高的，而且只改變準位變化所需的子模組；sorting 為 0 時改依編號由小到大投入，電容電壓會逐漸分散。averaged：電壓源 m·vsum 串聯導通開關的電阻，其中 vsum 是電容電壓總和，以 m·i 經 C/n 充電。可繪出訊號 arm:i（橋臂電流）、arm:vsum，以及 switched 時的 arm:v1 至 arm:vn（電容電壓）與 arm:g1 至 arm:gn（選擇結果）。

## 常見錯誤

- 橋臂必須串聯橋臂電感。同一相腳的兩個橋臂若直接跨在直流鏈上，會透過電容互相拉扯，電流沒有限制地跳動。
- 請讓電容一開始就有電：把 v0 設為直流鏈電壓除以 n。v0 為 0 時，橋臂要等直流鏈經橋臂電感把它充電後才會產生電壓。
- switched 最多 8 個子模組，子模組開關是理想開關，沒有切換損耗，也沒有閉鎖狀態。更長的橋臂請用 averaged。
- 同一相腳的兩個橋臂分擔直流電流，並帶有二次諧波環流。沒有環流控制器時，這個電流會讓電容漣波與損耗變大；請見 mmcInverter 範例。

## 規格書與來源

c 是單一子模組電容組的電容，v0 是它的初始電壓，來自你自己的設計（通常的操作點是直流鏈電壓除以 n）。ron 是單一子模組開關在工作電流下的導通電阻；IGBT 模組則取飽和電壓除以該電流。

## 範例

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

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