MOSFET (Ideal, Switching)
Ideal N-channel MOSFET for switching applications
Libraries:
Simscape /
Electrical /
Semiconductors & Converters
Description
The MOSFET (Ideal, Switching) block models the ideal switching behavior of an n-channel metal-oxide-semiconductor field-effect transistor (MOSFET).
The switching characteristic of an n-channel MOSFET is such that if the gate-source voltage exceeds the specified threshold voltage, the MOSFET is in the on state. Otherwise, the device is in the off state. This figure shows a typical i-v characteristic:
To define the I-V characteristic of the MOSFET, set the On-state behavior and
switching losses parameter to either Specify constant
values
or Tabulate
. The
Tabulate
option is available only if you expose the thermal port
of the block.
In the on state, the drain-source path behaves like a linear resistor with resistance, Rds_on. However, if you expose the thermal port of the block and parameterize the device using tabulated I-V data, the tabulated resistance is a function of the temperature and current.
In the off state, the drain-source path behaves like a linear resistor with low off-state conductance, Goff.
Then, the defining Simscape™ equations for the block are:
if G > Vth v == i*Rds_on; else v == i/Goff; end
where:
G depends on the value of the Gate-control port parameter.
If you set the Gate-control port parameter to
PS
, you control the gate terminal through a physical signal. G is the value at the input port G.If you set the Gate-control port parameter to
Electrical
, you control the gate terminal through an electrical signal. G is equal to:if v >= 0 G = G.v - S.v; else G = G.v - D.v; end
where G.v is the gate voltage, S.v is the source voltage, and D.v is the drain voltage.
Vth is the threshold voltage.
v is the drain-source voltage.
i is the drain-source current.
Rds_on is the on-state resistance.
Goff is the off-state conductance.
Using the Integral Diode settings, you can include the body diode or an integral protection diode. The integral diode provides a conduction path for reverse current and allows for an increased numerical stability in your model. For example, to provide a path for a high reverse-voltage spike that is generated when a semiconductor device suddenly switches off the voltage supply to an inductive load.
Set the Integral protection diode parameter based on your goal.
Goals | Value to Select | Integral Protection Diode | |
---|---|---|---|
Do not include protection. | External diode | None | |
Include protection. | Prioritize simulation speed. | Diode with no dynamics | The Diode block |
Prioritize model fidelity by precisely specifying reverse-mode charge dynamics. | Diode with charge dynamics | The dynamic model of the Diode block |
Model Gate Port and Thermal Effects
You can choose between physical or electrical ports to control the gate terminal and expose
the thermal port to model the heat that switching events and conduction losses
generate. To choose the gate-control port, set the Gate-control
port parameter to PS
or
Electrical
. To expose the thermal port, set the
Modeling option parameter to No thermal
port
or Show thermal port
.
You can also expose the thermal port HDiode of the integral protection diode by selecting the Separate thermal port for integral diode parameter. If you do not expose the diode thermal port, both the device and the diode share the common thermal port, H. (since R2024b)
For more information about using thermal ports, see Simulating Thermal Effects in Semiconductors.
Thermal Losses
The figure shows an idealized representation of the output voltage, Vout, and the output current, Iout, of the semiconductor device. The interval in this figure includes the entire nth switching cycle, during which the block turns off and then on.
Switching losses are major sources of thermal loss in semiconductors. During each on-off switching transition, the MOSFET parasitics store and then dissipate energy.
Switching losses depend on the off-state voltage and the on-state current. When a switching device turns on, the power losses depend on the initial off-state voltage across the device and the final on-state current when the device is in its fully on state. Similarly, when a switching device turns off, the power losses depend on the initial on-state current through the device and the final off-state voltage across the device in the fully off state.
You can choose when to measure the current and voltage that the block uses to calculate the switch-on and switch-off losses. For most circuits, you can make the measurements during the turn-on or turn-off event:
The switch-on loss is Eon(ITurnOn(n),VTurnOn(n))
The switch-off loss is Eoff(ITurnOff(n),VTurnOff(n))
However, you cannot always use these measurements, for example, in these situations:
You are modeling a capacitance across the switching device. For example, you are modeling the protection diode with capacitance or you are using the Lauritzen charge model. The capacitance causes an overshoot transient in the current at device turn-on, which means that you cannot use the measurement ITurnOn(n) to calculate the switch-on loss. The block requires the value following the transient. Do not model capacitance across the switching device, because this model mixes an abstracted behavior for the semiconductor switching device with detailed physics for the diode. If you must model capacitance across the switching device, you can use the current measurement at the end of the last on-period, ITurnOff(n-1). To enable this option, select the Use last on-state current from previous cycle for turn-on loss parameter.
You are modeling switching device lead inductance. The inductance causes an overshoot transient in the voltage at device turn-off, which means that you cannot use the measurement VTurnOff(n) to calculate the switch-off loss. The block requires the value following the transient. Do not model switching device lead inductance, because the time constant associated with lead inductance is typically much smaller than the pulse-width modulation (PWM) period. This smaller time constant means that the simulation requires smaller simulation time steps, slowing down the simulation. If you must model switching device lead inductance, use the voltage measurement at the end of the last off-period, VTurnOn(n). To enable this option, select the Use last off-state voltage from previous cycle for turn-off loss parameter.
Examine the simulation results to check that the losses behave as you expect. To learn how to log and plot simulation data, see the Log and Plot Simulation Data example. This table defines the names of variables in the logged simulation data that are relevant to switching loss calculations.
Voltages and Currents Used to Calculate Switching Losses
Quantity | Variable Name in Logged Simulation Data |
---|---|
VTurnOn | zvOn |
ITurnOn | ziOn |
VTurnOff | zvOff |
ITurnOff | ziOff |
This block applies switching losses by stepping up the junction temperature with a value equal to the switching loss divided by the total thermal mass at the junction. You must specify the energy dissipated during a single switch-on and switch-off event. You must also specify the corresponding values of the off-state voltage and on-state current at which you quote the losses. You can parameterize the switching losses, depending on the data you have. Use tabulated data if they are available.
To specify a scalar value for the switching losses, set the On-state behavior and switching losses parameter to
Specify constant values
. The Switch-on loss and Switch-off loss parameter values set the sizes of the switching losses. The block scales the losses by the off-state voltage and the on-state current.To specify the losses as a function of the junction temperature and on-state current at a fixed off-state voltage, set the On-state behavior and switching losses parameter to
Tabulate
and clear the Include switching loss tabulation with off-state Vds voltage parameter. The Switch-on loss, Eon(Tj,Ids) and Switch-off, Eoff(Tj,Ids) parameters set the size of the losses. The block scales the losses by the off-state voltage.To specify the losses as a function of the junction temperature, on-state current, and off-state voltage, set the On-state behavior and switching losses parameter to
Tabulate
and select the Include switching loss tabulation with off-state Vds voltage parameter.
Reverse recovery loss can be a significant source of thermal loss in diodes. The diode dissipates energy every time it turns off, from its conducting state to the open-circuit state. To model reverse recovery loss:
Set Modeling option to
Show thermal port
.Set Integral protection diode to
Diode with no dynamics
.
If you set the Reverse recovery loss model parameter to
Tabulated loss
, the value of the Reverse recovery
loss table, Erec(Tj, If) parameter specifies the dissipated energy as a
function of the junction temperature and the forward current just before the switching
event. The off-state voltage linearly scales the losses relative to the Turn-off
voltage when measuring recovery loss, Vrec parameter value. The table uses
delayed values for the current and voltage. To use a value in the lookup table that is close
to the instantaneous value, set the Filter time constant for voltage
and current values parameter to a value that is lower than the fastest
switching period.
If you set the Reverse recovery loss model parameter to
Fixed loss
, the value of the Reverse recovery
loss parameter specifies the energy dissipated during each turn-off event. If
you select the Scale reverse recovery loss with current and voltage
parameter, then the block scales this loss value linearly by the on-state current and the
off-state voltage. To use scaling values that are close to the instantaneous values, set
Filter time constant for voltage and current values to
a value that is lower than the fastest switching period.
As an alternative method to model reverse recovery, you can set the Integral
protection diode parameter to Diode with charge
dynamics
. However, this approach requires smaller simulation time steps
than using the first approach.
Note
For all ideal switching devices, the logged simulation data reports the thermal losses
as lastTurnOffLoss
, lastTurnOnLoss
, and
lastReverseRecoveryLoss
. These variables record losses as a pulse
with an amplitude equal to the energy loss. If you use a script to sum the total losses
over a defined simulation period, you must sum the pulse values at each pulse rising edge.
Alternatively, you can extract conduction and switching losses from logged data using the
ee_getPowerLossSummary
and ee_getPowerLossTimeSeries
functions.
You can also access the total accumulated switching losses from the
accumulatedSwitchingLosses
variable in the logged simulation data.
This variable sums all switching losses to date, including reverse recovery losses for the
diode.
The power_dissipated
variable in the logged simulation data does
not include switching losses or reverse recovery losses because the block models these
losses as instantaneous events. The power_dissipated
variable reports
ohmic on-state losses.
If you are using a fixed-step solver, the shortest pulse on or pulse off that supports capture of the switching losses is three time steps long. If the pulse is shorter than three steps, the block does not report switching losses.
If you are operating the MOSFET in the reverse region (negative drain-source
currents), the logged simulation data does not report any switch-on or switch-off losses
because the parallel diode provides continuous parallel conduction. In the logged
simulation data, ziOn
reports zero current to implement the zero losses
even if the current steps to a negative value.
If you use tabulated data to model the switching losses or reverse recovery losses, check that the temperature, current, and voltage are in the range you specify. If you do not define a realistic thermal model, for example, if the junction mass or the conductance from the junction to the case is too small, the temperature can exceed the range you specify, causing the block to extrapolate the losses to nonphysical values.
Parameterization
The MOSFET (Ideal, Switching) block supports multiple predefined parameterizations.
Use this parameterization data to represent components by specific suppliers. The parameterizations of these MOSFETs match the manufacturer data sheets. To load a predefined parameterization, double-click the MOSFET (Ideal, Switching) block, click the <click to select> hyperlink of the Selected part parameter, and, in the Block Parameterization Manager window, select the part you want to use from the list of available components.
Note
The predefined parameterizations of Simscape components use available data sources for the parameter values. Engineering judgement and simplifying assumptions are used to fill in for missing data. As a result, expect deviations between simulated and actual physical behavior. To ensure accuracy, validate the simulated behavior against experimental data and refine component models as necessary.
For more information about predefined parameterization and a list of the available components, see List of Pre-Parameterized Components.
You can also use the ee_importDeviceParameters
function to extract the device parameters from an
XML file and import them into the block. The XML file must be on the MATLAB® path and must use a parameterization format supported by Hitachi.
Variables
To set the priority and initial target values for the block variables before simulation, use the Initial Targets section in the block dialog box or Property Inspector. For more information, see Set Priority and Initial Target for Block Variables.
Use nominal values to specify the expected magnitude of a variable in a model. Using system scaling based on nominal values increases the simulation robustness. Nominal values can come from different sources. One of these sources is the Nominal Values section in the block dialog box or Property Inspector. For more information, see System Scaling by Nominal Values.
Plot Basic I-V Characteristics
Since R2023b
You can plot the basic I-V characteristics of the MOSFET (Ideal, Switching) block without building a complete model. Use the plots to explore the impact of your parameter choices on device characteristics. If you parameterize the block from a datasheet, you can compare your plots to the datasheet to check that you parameterized the block correctly. If you have a complete working model but do not know which manufactured part to use, you can compare your plots to datasheets to help you decide.
To plot the basic characteristics, right-click the block and select Electrical > Basic characteristics from the context menu.
The Basic characteristics option generates different plots depending on the values you specify for the Modeling option, On-state behavior and losses, and Integral protection diode parameters of the MOSFET (Ideal, Switching) block. If you model the switching device with an integral protection diode, the Basic characteristics option plots the I-V characteristics for both the switching device and the diode. If you enable the thermal port of the block, the Basic characteristics option also generates surface plots of the turn-on energy loss and turn-off energy loss as functions of the on-state current and off-state voltage. For more information about this option, see Plot Basic I-V Characteristics of Semiconductor Blocks.
Examples
Ports
The figure shows the block port names.