# MOSFET 開關 (`mosfet`)

> 由閘極控制的開關，附體二極體。可加入寄生參數與損耗。

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

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

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

## 何時使用

用於轉換器與換流器的橋臂和同步整流。高壓單向切換用 IGBT 開關，不要體二極體時用理想開關。

## 接腳

| 接腳 | 訊號域 | 意義 |
|---|---|---|
| `d` | 電氣 | 汲極；順向電流由 d 流向 s |
| `s` | 電氣 | 源極；體二極體由 s 導通到 d |
| `gate` | 訊號 | 訊號輸入；大於 0.5 時導通 |

## 常用參數

- `ron`: Resistance when it is on (預設值: 10m)
- `vf`: Voltage lost while it conducts (預設值: 0)
- `coss`: Capacitance across the device (預設值: 0)
- `eon`: Energy lost each time it turns on (預設值: 0)
- `eoff`: Energy lost each time it turns off (預設值: 0)

## 參數

| 鍵 | 單位 | 預設值 | 典型範圍 | 說明 |
|---|---|---|---|---|
| `ron` | Ω | 10m |  | Resistance when it is on |
| `roff` | Ω | 1meg |  | Resistance when it is off |
| `vf` | V | 0 |  | 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 |
| `level` | — | ideal |  | Switching model: `ideal` switches at once; `dynamic` follows the gate drive, the gate charge and the device capacitances |
| `tech` | — | si |  | Device technology: `si` and `sic` have a body diode; `gan` is a GaN HEMT with no body diode, conducting in reverse at vth − voff without recovery; `ganCascode` has the body diode of its silicon MOSFET |
| `dvdt` | V/s | 選填（預設關閉） |  | Turn-on slew rate set by a driver in the package, such as an integrated GaN FET's drive-strength pin: the drain-source voltage falls at this rate instead of at once; the device's default setting when unset; ideal level only, with steps shorter than the ramp |
| `rdsDyn` | — | 1 |  | Dynamic on-resistance of a GaN device: the factor on ron after blocking a high voltage, from the datasheet's dynamic RDS(on) figure; 1 is off |
| `vgsMax` | V | 選填（預設關閉） |  | Largest gate-source voltage of the datasheet's maximum ratings; a drive above it is an error |
| `vgsMin` | V | 選填（預設關閉） |  | Most negative gate-source voltage of the datasheet's maximum ratings; a drive below it is an error |
| `von` | V | 15 |  | Gate drive voltage while on; dynamic level, and the gate-charge loss estimate (10 V when unset) |
| `voff` | V | 0 |  | Gate drive voltage while off; dynamic level, the gate-charge loss estimate and the reverse drop of a GaN HEMT |
| `rgon` | Ω | 10 |  | Gate resistance while turning on; driver and external resistor; dynamic level, and the gate-charge loss estimate (2 Ω when unset) |
| `rgoff` | Ω | 選填（預設關閉） |  | Gate resistance while turning off; same as rgon when unset |
| `rgint` | Ω | 選填（預設關閉） |  | Gate resistance inside the device; from the device data when unset, else 0 |
| `vth` | V | 選填（預設關閉） |  | Gate voltage where the channel starts to conduct; dynamic level, and the reverse drop vth − voff of a GaN HEMT |
| `gfs` | S | 選填（預設關閉） |  | Drain current gained per volt of gate drive; dynamic level only |
| `vplateau` | V | 選填（預設關閉） |  | Miller plateau voltage; the gate voltage held while the drain voltage swings |
| `iplateau` | A | 選填（預設關閉） |  | Drain current at which vplateau was measured |
| `ciss` | F | 選填（預設關閉） |  | Input capacitance; gate to source with the drain shorted to the source, dynamic level only |
| `crss` | F | 選填（預設關閉） |  | Reverse transfer capacitance; gate to drain, dynamic level only |
| `cissTable` | — | 選填（預設關閉） |  | Input capacitance over drain voltage; voltage and capacitance pairs, dynamic level only |
| `cossTable` | — | 選填（預設關閉） |  | Output capacitance over drain voltage; voltage and capacitance pairs, dynamic level only |
| `crssTable` | — | 選填（預設關閉） |  | Reverse transfer capacitance over drain voltage; voltage and capacitance pairs, dynamic level only |
| `qgd` | C | 選填（預設關閉） |  | Gate to drain charge from the datasheet; scales the gate to drain capacitance to carry it |
| `vdsq` | V | 選填（預設關閉） |  | Drain voltage of the test that gave qgd |
| `lcs` | H | 0 |  | Source inductance shared by gate and power loops; dynamic level only |
| `lg` | H | 0 |  | Gate loop inductance of the driver, gate trace and return, less lcs; dynamic level only |

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

**適用於:** 轉換器橋臂 · 同步整流 · 變頻器橋臂

**不適用於:** 高壓大電流橋臂 → [`igbt`](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/switches/igbt/) · 不需要體二極體的開關 → [`idealSwitch`](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/switches/idealSwitch/)

## 公式

| 公式 | 方程式 | 出處 |
|---|---|---|
| 導通損失 | P = ron·Irms² | Mohan, Undeland & Robbins, Power Electronics, 3rd ed. (2003), ch. 2 (on-state power loss) |
| 切換損失 | P = ½·V·I·(tr + tf)·fs | Mohan, Undeland & Robbins, Power Electronics, 3rd ed. (2003), ch. 2 (switching power loss with linearized transitions) |
| 總損失 | P = Pcond + Psw | Mohan, Undeland & Robbins, Power Electronics, 3rd ed. (2003), ch. 2 |

## 快速驗算

輸入:

- `id`: 汲極電流（切換值與均方根值） = 10 A
- `ron`: 導通電阻 = 10m Ω, `ron`
- `vds`: 阻斷電壓 = 48 V
- `tsw`: 上升加下降時間 = 40n s
- `fs`: 切換頻率 = 100k Hz

輸出:

- `pcond`: 導通損失 = `ron*id^2` W
- `psw`: 切換損失 = `0.5*vds*id*tsw*fs` W
- `ptot`: 總損失 = `pcond + psw` W

## 模型邏輯

- 在預設的 ideal 層級，閘極大於 0.5 時通道是雙向且無壓降的電阻 ron；切換瞬間完成。
- 閘極為低時以 roff 阻斷，但 v(s) - v(d) 超過 vf 時體二極體導通，串聯同一個 ron。
- qrr 與 trr 讓體二極體有儲存電荷的逆向恢復；eon 與 eoff 只計入損失報告，不改變切換邊緣。
- dynamic 層級經 rgon 與 rgoff 對閘極充電，並依 vth、元件電容與米勒平台切換；tech 設為 gan 時沒有體二極體。

## 模型

閘極大於 0.5 時，通道是電阻 ron，兩個方向相同，沒有壓降。閘極為低時，元件經 roff 阻擋，但 v(s) - v(d) 超過 vf 後，體二極體由 s 導通到 d。qrr 與 trr 給出體二極體的逆向恢復，coss 與 cj 在元件兩端加電容，ls 加入串聯電感。預設的 ideal 模型中，閘極是邏輯準位，所以不模擬臨界電壓、閘極電荷與線性區。把 level 設為 dynamic 可得到真實的切換過程：閘極驅動（von、voff、rgon、rgoff）對閘極充電，閘極超過 vth 後通道開始導通，元件電容（ciss、crss、coss 或它們的表格，或有閘極資料的元件庫元件）決定米勒平台、dv/dt 與切換損耗。這個模型要用可變步長，或遠小於閘極時間常數的固定步長。GaN HEMT 請把 tech 設為 gan：它沒有體二極體，也沒有逆向恢復；閘極截止時，v(s) - v(d) 超過 vth - voff 後由通道本身從 s 導通到 d，所以負的截止電壓會提高反向壓降與死區損耗。tech 設為 ganCascode 時保留疊接結構中矽 MOSFET 的體二極體與逆向恢復。

## 常見錯誤

- 橋臂的兩個 MOSFET 同時導通會使電源短路。請在閘極訊號之間加死區時間，並預期死區期間體二極體會導通。
- 閘極沒接時通道一直截止，但體二極體仍會導通，此時元件等同整流器。模擬器會對沒接的閘極發出警告。
- ron 預設為 10 mohm，只是示意值。請取規格書在你的閘極電壓與高溫接面下的數值。
- GaN 閘極只能承受幾伏特，dynamic 模型預設的 15 V 驅動會把它燒毀。請由規格書的最大額定值填入 vgsMax 與 vgsMin；汲極電壓上升很快、可能經米勒電容把閘極拉過 vth 時，請以低於 0 V 的電壓截止。

Problems 規則: `shoot-through`, `param.out_of_range`, `device.rating`, `gate.overvoltage`, `gate.false_turn_on`

## 規格書與來源

ron 取自你的閘極電壓與溫度下的 RDS(on)，tc 取自它隨溫度上升的比例。vf 是體二極體壓降，coss 是輸出電容，qrr 是體二極體恢復電荷，eon 與 eoff 取自切換能量表，並以其測試電壓 vref 與電流 iref 填入。vgsMax 與 vgsMin 是閘源極最大額定值；GaN HEMT 的 vth 取自 VGS(th)，其反向壓降可對照你的截止閘極電壓下的源汲極電壓曲線。

## 範例

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

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