# TRIAC 雙向閘流體 (`triac`)

> 雙向閘流體：閘極電流可讓它往任一方向導通，並一直導通到電流低於維持電流。

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

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

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

## 何時使用

用於交流相位控制（調光器、軟啟動器、風扇調速）與以整週為單位開關交流負載（加熱器）。只需單一方向時用閘流體，大電流時用兩顆反並聯的閘流體。

## 接腳

| 接腳 | 訊號域 | 意義 |
|---|---|---|
| `mt2` | 電氣 | 主端子 2；正電流由 mt2 流向 mt1 |
| `mt1` | 電氣 | 主端子 1；閘極以它為參考 |
| `gate` | 訊號 | 訊號輸入，視為流入閘極的電流（安培），正負號即電流方向 |

## 常用參數

- `igt`: Gate signal that fires it; read as the gate current, so a logic 1 fires it too (預設值: 50m)
- `ih`: Holding current: below it the part turns off (預設值: 50m)
- `quadrants`: Gate quadrants that fire it: 1234 for a standard part, 123 for a three-quadrant one (預設值: 1234)
- `vf`: Voltage lost while it conducts (預設值: 0.85)
- `ron`: Resistance when it is on (預設值: 25m)

## 參數

| 鍵 | 單位 | 預設值 | 典型範圍 | 說明 |
|---|---|---|---|---|
| `ron` | Ω | 25m |  | Resistance when it is on |
| `roff` | Ω | 120meg |  | Resistance when it is off |
| `vf` | V | 0.85 |  | Voltage lost while it conducts |
| `device` | — | 選填（預設關閉） |  | Device name used to look up losses |
| `thermal` | — | 選填（預設關閉） |  | Where the lost heat goes |
| `eon` | J | 0 |  | Energy lost each time it turns on |
| `eoff` | J | 0 |  | Energy lost each time it turns off |
| `err` | J | 0 |  | Energy lost when the diode recovers |
| `vref` | V | 0 |  | Voltage used to measure those energies |
| `iref` | A | 0 |  | Current used to measure those energies |
| `tc` | 1/K | 0 |  | How on-resistance changes with heat |
| `tj` | °C | 25 |  | Junction temperature for the loss tables |
| `nParallel` | — | 1 |  | Identical devices this one switch stands for: the current is shared, the losses add up, each device keeps its own junction |
| `tjMax` | °C | 選填（預設關閉） |  | Highest junction temperature allowed; overrides the device's rating |
| `ls` | H | 0 | 500p – 50n H | Unwanted inductance in series with it |
| `coss` | F | 0 | 10p – 5n F | Capacitance across the device |
| `cj` | F | 0 | 5p – 2n F | Extra capacitance across the junction |
| `tdon` | s | 0 | 1n – 500n s | Delay before it turns on |
| `tdoff` | s | 0 | 1n – 500n s | Delay before it turns off |
| `qrr` | C | 0 | 1n – 5u C | Charge released as the diode recovers |
| `trr` | s | 100n | 10n – 1u s | How long the diode takes to recover |
| `qrrTemp` | — | 選填（預設關閉） |  | Junction temperature (°C) and factor pairs that scale qrr, from the datasheet's curve |
| `part` | — | 選填（預設關閉） |  | Part number; the catalogue part number, such as BSC070N10NS5, written on the schematic; information only, not simulated |
| `vRating` | V | 選填（預設關閉） |  | Voltage rating; the largest blocking voltage of the data sheet's maximum ratings (VDS, VCES, VRRM), written on the schematic; information only, not simulated |
| `iRating` | A | 選填（預設關閉） |  | Current rating; the continuous current of the data sheet's maximum ratings (ID, IC, IF), written on the schematic; information only, not simulated |
| `igt` | A | 50m |  | Gate signal that fires it; read as the gate current, so a logic 1 fires it too |
| `ih` | A | 50m |  | Holding current: below it the part turns off |
| `quadrants` | — | 1234 |  | Gate quadrants that fire it: 1234 for a standard part, 123 for a three-quadrant one |

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

**適用於:** 調光器 · 軟啟動器 · 風扇調速 · 加熱器開關

**不適用於:** 單向相位控制 → [`thyristor`](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/switches/thyristor/) · 轉折觸發元件 → [`diac`](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/switches/diac/)

## 公式

| 公式 | 方程式 | 出處 |
|---|---|---|
| 負載均方根電壓 | Vo = Vs·√((π − α + sin(2α)/2)/π) | Rashid, Power Electronics, 4th ed. (2014), ch. 11 (AC voltage controllers, single-phase full-wave) |
| 負載均方根電流 | Io = Vo/R | Rashid, Power Electronics, 4th ed. (2014), ch. 11 |
| 導通損失 | P = vf·(√2·Vs/(π·R))·(1 + cos α) + ron·Io² | IEC 60747-6:2016 (threshold voltage and on-state slope resistance) |

## 快速驗算

輸入:

- `vs`: 供電均方根電壓 = 230 V
- `alpha`: 觸發角（度） = 90 —
- `rload`: 負載電阻 = 100 Ω
- `vf`: 臨界電壓 = 850m V, `vf`
- `ron`: 斜率電阻 = 25m Ω, `ron`

輸出:

- `vrms`: 負載均方根電壓 = `vs*sqrt((pi - alpha*pi/180 + sin(alpha*pi/90)/2)/pi)` V
- `irms`: 負載均方根電流 = `vrms/rload` A
- `ploss`: 導通損失 = `vf*sqrt(2)*vs/(pi*rload)*(1 + cos(alpha*pi/180)) + ron*irms^2` W

## 模型邏輯

- 閘極訊號視為電流：abs(gate) 超過 igt、象限被允許，且 abs(v(mt2) - v(mt1)) 超過 vf 時觸發。
- 象限由 v(mt2) - v(mt1) 與閘極的正負號決定；quadrants 設為 123 時，mt2 為負時正閘極不會觸發。
- 之後 i = (v - vf)/ron 或 i = (v + vf)/ron，直到 abs(i) 低於 ih 才關斷；閘極仍在觸發時低於 ih 也維持導通。
- 關斷時是 roff，預設 120 Mohm；沒有模擬閂鎖電流、導通時間、dv/dt 誤觸發與換相 dv/dt。

## 模型

當 |gate| 超過 igt 且所在象限允許時 TRIAC 觸發：象限 I 為 mt2 為正且閘極為正，II 為 mt2 為正且閘極為負，III 為 mt2 為負且閘極為負，IV 為 mt2 為負且閘極為正。同時 |v(mt2) - v(mt1)| 必須超過 vf。之後順向遵循 i = (v - vf) / ron、反向遵循 i = (v + vf) / ron，無論閘極如何都保持導通，直到 |i| 低於 ih。閘極仍在觸發時，低於 ih 也保持導通。阻擋時經 roff。不模擬閂鎖電流、導通時間與 dv/dt 誤觸發。

## 常見錯誤

- 三象限元件（quadrants = 123，即 Snubberless 與邏輯準位型）在 mt2 為負時不會被正閘極觸發，只有正的閘極脈衝時只會在正半週導通。請用負的閘極驅動，或讓閘極跟著電源電壓的正負號。
- 閘極以安培讀取。邏輯訊號 1 能觸發 igt 小於 1 的元件，但來自電流計的閘極訊號必須超過 igt，所以請把電流計放在觸發電路的閘極支路上。BTA16-600B 在象限 IV 需要兩倍的觸發電流（100 mA），請依你使用的象限設定 igt。
- 電感性負載的電流落後，TRIAC 在電壓過零之後才關斷，跨在它上面的電壓會立刻跳起。規格書的換相極限（BTA16-600B 在 (dI/dt)c = 7 A/ms 時 (dV/dt)c = 10 V/us）與靜態 dV/dt 400 V/us 不會被檢查：模型正常的地方，實際元件可能誤觸發或關不掉。請檢查關斷後的 v(mt2) - v(mt1)，上升得更快時加上 RC 緩衝電路。

## 規格書與來源

預設值取自 STMicroelectronics BTA16-600B（規格書 DS2114 Rev 11，2018 年 5 月）。vf 是 VT0 = 0.85 V，ron 是 RD = 25 mOhm（Table 2，125 C 最大值）。roff 是 VDRM / IDRM = 600 V / 5 uA（Table 2，25 C）。igt 是象限 I 到 III 的 IGT = 50 mA，ih 是 IH = 50 mA（Table 3，B 版最大值）。quadrants 為 1234，因為 B 與 C 版是四象限元件（Table 3），BW、CW、SW 則是三象限元件（Table 4）。換成你的元件時，取導通狀態表的 VT0 與 RD、你所用象限的 IGT，以及 IH。

## 範例

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

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