> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/power-converters/switches/mosfet.md).

# MOSFET

## Description

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-c0c69e091cbc6c39a7bd5d44c8e634abe04e2353%2FMOSFET_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **MOSFET** bloc&#x6B;**,** located in the **OPAL-RT SPS Software/Power Electronics** library, represents the metal-oxide semiconductor field-effect transistor (MOSFET), a semiconductor device controllable by the gate signal (g > 0). The MOSFET device is connected in parallel with an internal diode that turns on when the MOSFET device is reverse biased (Vds < 0) and no gate signal is applied (g = 0). The model is simulated by an ideal switch controlled by a logical signal (g > 0 or g = 0), with a diode connected in parallel.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-6ac6e8d8ecf493f20c0c680738de76df11e89bdd%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

The MOSFET device turns on when a positive signal is applied at the gate input (g > 0) whether the drain-source voltage is positive or negative. If no signal is applied at the gate input (g = 0), only the internal diode conducts when voltage exceeds its forward voltage Vf.

With a positive or negative current flowing through the device, the MOSFET turns off when the gate input becomes 0. If the current I is negative and flowing in the internal diode (no gate signal or g = 0), the switch turns off when the current I becomes 0.

The on state voltage Vds varies:

* Vds = Ron \* I when a positive signal is applied at the gate input.
* Vds = Rd \* I - Vf + Lon \* dI/dt when the antiparallel diode is conducting (no gate signal). The Lon diode inductance is available only with the continuous model. For most applications, Lon should be set to zero for both continuous and discrete models.

The MOSFET block also contains a series Rs-Cs snubber circuit that can be connected in parallel with the MOSFET (between nodes d and s).

## Assumptions and Limitations

* The MOSFET block implements a macro model of the real MOSFET device. It does not take into account either the geometry of the device or the complex physical processes \[1].
* Depending on the value of the inductance Lon, the MOSFET is modeled either as a current source (Lon > 0) or as a variable topology circuit (Lon = 0).
* The MOSFET block cannot be connected in series with an inductor, a current source, or an open circuit, unless its snubber circuit is in use.
* The inductance Lon is forced to 0 if you choose to discretize your circuit.

## Ports

### Input

<table data-header-hidden><thead><tr><th width="244.39996337890625">Port</th><th>Description</th></tr></thead><tbody><tr><td><strong>g</strong> — Control signal (Simulink signal)</td><td>Simulink signal to control the opening and closing of the MOSFET.</td></tr></tbody></table>

### Output

<table data-header-hidden><thead><tr><th width="248">Port</th><th>Description</th></tr></thead><tbody><tr><td><strong>m</strong> — Measurement vector (Simulink signal)</td><td>The Simulink output of the block is a vector containing 2 signals. You can demultiplex these signals by using the Bus Selector block provided in the Simulink library.<br>1- MOSFET current (A)<br>2- MOSFET voltage (V)</td></tr></tbody></table>

### Conserving

<table data-header-hidden><thead><tr><th width="262">Port</th><th>Description</th></tr></thead><tbody><tr><td><strong>D</strong> — Drain (SPS electrical)</td><td>SPS electrical conserving port associated with the drain.</td></tr><tr><td><strong>S</strong> — Source (SPS electrical)</td><td>SPS electrical conserving port associated with the source.</td></tr></tbody></table>

## Parameters

<table data-header-hidden><thead><tr><th width="262">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>FET resistance Ron (Ohms)</strong> — Internal resistance<br>0.1 (default)</td><td>The internal resistance Ron, in ohms (Ω). Default is 0.1. The <strong>Resistance Ron</strong> parameter cannot be set to 0 when the <strong>Inductance Lon</strong> parameter is set to 0.</td></tr><tr><td><strong>Internal diode inductance Lon (H)</strong> — Internal inductance<br>0 (default)</td><td>The internal inductance Lon, in henries (H). Default is 0. The <strong>Inductance Lon</strong> parameter is normally set to 0 except when the <strong>Resistance Ron</strong> parameter is set to 0.</td></tr><tr><td><strong>Internal diode resistance Rd (Ohms)</strong> — Internal resistance of internal diode<br>0.01 (default)</td><td>The internal resistance of the internal diode, in ohms (Ω). Default is 0.01.</td></tr><tr><td><strong>Internal diode forward voltage Vf (V)</strong> — Forward voltage of internal diode<br>0 (default)</td><td>The forward voltage of the internal diode, in volts (V). Default is 0.</td></tr><tr><td><strong>Initial current Ic (A)</strong> — MOSFET initial current<br>0 (default)</td><td>You can specify an initial current flowing in the MOSFET device. It is usually set to 0 in order to start the simulation with the device blocked. Default is 0.<br>If the <strong>Initial current Ic</strong> parameter is set to a value greater than 0, the steady-state calculation considers the initial status of the MOSFET as closed. Initializing all states of a power electronic converter is a complex task. Therefore, this option is useful only with simple circuits.</td></tr><tr><td><strong>Snubber resistance Rs (Ohms)</strong> — Snubber resistance<br>1e5 (default)</td><td>The snubber resistance, in ohms (Ω). Default is 1e5. Set the <strong>Snubber resistance Rs</strong> parameter to inf to eliminate the snubber from the model.</td></tr><tr><td><strong>Snubber capacitance Cs (F)</strong> — Snubber capacitance<br>inf (default)</td><td>The snubber capacitance, in farads (F). Default is inf. Set the <strong>Snubber capacitance Cs</strong> parameter to 0 to eliminate the snubber, or to inf to get a resistive snubber.</td></tr><tr><td><strong>Show measurement port</strong> — Measurement port visibility<br>on (default) | off</td><td>If selected, add a Simulink output to the block returning the MOSFET current and voltage. Default is selected.</td></tr></tbody></table>

## References <a href="#references" id="references"></a>

\[1] Mohan, N., T.M. Undeland, and W\.P. Robbins, *Power Electronics: Converters, Applications, and Design*, John Wiley & Sons, Inc., New York, 1995.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/power-converters/switches/mosfet.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
