# DIAC 雙向觸發二極體 (`diac`)

> 觸發二極體：任一方向電壓超過 vbo 時轉折導通，之後以較低的電壓導通，直到電流消失。

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

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

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

## 何時使用

用於由 R-C 移相網路觸發 TRIAC（例如調光器），以及弛張振盪器。功率路徑本身請用 TRIAC 或閘流體。

## 接腳

| 接腳 | 訊號域 | 意義 |
|---|---|---|
| `a1` | 電氣 | 端子 1；正電流由 a1 流向 a2 |
| `a2` | 電氣 | 端子 2；元件對稱，兩端可互換 |

## 常用參數

- `vbo`: Breakover voltage: above it the part conducts, either way (預設值: 32)
- `vf`: Voltage lost while it conducts (預設值: 27)
- `ih`: Current below which it stops conducting (預設值: 50u)

## 參數

| 鍵 | 單位 | 預設值 | 典型範圍 | 說明 |
|---|---|---|---|---|
| `ron` | Ω | 1 |  | Resistance when it is on |
| `roff` | Ω | 1.8meg |  | Resistance when it is off |
| `vf` | V | 27 |  | 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 |
| `vbo` | V | 32 |  | Breakover voltage: above it the part conducts, either way |
| `ih` | A | 50u |  | Current below which it stops conducting |

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

**適用於:** TRIAC 觸發 · 調光器 · 弛張振盪器

**不適用於:** 切換負載電流 → [`triac`](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/switches/triac/)

## 公式

| 公式 | 方程式 | 出處 |
|---|---|---|
| 充電時間常數 | τ = Rt·Ct | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 8 (basic RC circuits) |
| 由直流電源充電到轉折的時間 | t = τ·ln(Vdc/(Vdc − vbo)) | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 8 (driven RC circuits) |
| 觸發脈衝的電荷 | Q = Ct·(vbo − vf) | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 7 (capacitors) |

## 快速驗算

輸入:

- `vdc`: 為電容充電的電源 = 100 V
- `rt`: 充電電阻 = 100k Ω
- `ct`: 觸發電容 = 100n F
- `vbo`: 轉折電壓 = 32 V, `vbo`
- `vf`: 導通電壓 = 27 V, `vf`

輸出:

- `tau`: 充電時間常數 = `rt*ct` s
- `tfire`: 到轉折的時間 = `tau*ln(vdc/(vdc - vbo))` s
- `qpulse`: 脈衝電荷 = `ct*(vbo - vf)` C

## 模型邏輯

- 在 abs(v(a1) - v(a2)) 超過 vbo 之前經 roff 阻斷，之後朝該方向導通；沒有閘極。
- 導通時順向為 i = (v - vf)/ron、反向為 i = (v + vf)/ron，所以由 vbo 降到 vf 是一次跳變，而不是負電阻曲線。
- 導通方向的電流低於 ih 時關斷，之後再度阻斷，直到下一次轉折。
- 不模擬它的電容、轉折電流與 vbo 的溫度漂移。

## 模型

DIAC 經 roff 阻擋，直到 |v(a1) - v(a2)| 超過 vbo。之後順向遵循 i = (v - vf) / ron、反向遵循 i = (v + vf) / ron，其中 vf 是轉折電壓減去回折量。|i| 低於 ih 時停止導通。兩者之間的負電阻區以跳變表示，而不是曲線。

## 常見錯誤

- 沒有電容、只經大電阻由緩慢上升的電源供電時，DIAC 轉折後無法維持 ih 的電流，模型會在同一步內反覆導通與關斷，求解器可能無法收斂。請像實際觸發電路一樣，由電容觸發它。
- vbo 必須高於 vf，否則一觸發就會關斷，編譯器會拒絕這樣的元件。

## 規格書與來源

預設值取自 STMicroelectronics DB3（規格書 DS2125 Rev 3，2018 年 12 月，Table 2）。vbo 是 VBO 典型值 32 V。vf 是 VBO 典型值減去動態轉折電壓，32 - 5 V（dV 最小值，於 10 mA）。roff 是 0.5 x VBO 最大值 / IR 最大值 = 18 V / 10 uA。規格書沒有給維持電流，而導通支路從轉折電流開始，所以 ih 取 IBO 最大值 50 uA。規格書沒有給導通斜率，ron = 1 Ohm 是建模用的值，比它所驅動的閘極電阻小得多。

## 範例

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

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