Main Content

generateSemiconductorSubcircuitROM

Generate reduced-order model of SPICE subcircuit

Since R2025a

Description

The generateSemiconductorSwitchROM function converts a SPICE subcircuit into a MOSFET (Ideal, Switching) or IGBT (Ideal, Switching) block, which represents a reduced-order model (ROM). The SPICE subcircuit can describe any n-type semiconductor device with an integral diode. The function parameterizes the ROM with the on-state tabulated I-V curve and tabulated switching losses for the transistor, and with the on-state tabulated I-V curve and tabulated reverse recovery loss for the associated body diode.

Manufacturers often provide SPICE subcircuits that you can use to parameterize Simscape blocks. One option is to generate a lookup table to parameterize a high-fidelity N-Channel MOSFET or N-Channel IGBT block from a SPICE netlist using the ee.spice.semiconductorSubcircuit2lookup function. ROMs are easier to interpret and run faster than high-fidelity semiconductor switch subsystems. Use ROMs to quickly test and analyze system-level scenarios where the semiconductor switch interacts with other systems.

generateSemiconductorSubcircuitROM(libraryPath,subcircuitName) generates a ROM from the SPICE subcircuit named subcircuitName in the SPICE subcircuit library file on the path libraryPath.

generateSemiconductorSubcircuitROM(libraryPath,subcircuitName,Name=Value) specifies options using one or more name-value arguments in addition to the input arguments in the previous syntax. For example, generateSemiconductorSubcircuitROM(libraryPath,subcircuitName,OnStateGateSourceVoltage=20) generates a ROM with an on-state gate-source voltage equal to 20 V.

Some of the name-value arguments are the test-circuit conditions. You can set these values based on your detailed circuit conditions or a datasheet. These values are optional, but accurate test circuit conditions provide you with more accurate ROMs.

ROMParameters = generateSemiconductorSubcircuitROM(libraryPath,subcircuitName,Name=Value) returns a structure that contains the lookup table data for the I-V curve and loss of the semiconductor switch and the diode.

example

Examples

collapse all

This example shows how to generate a Simscape reduced-order model (ROM) of a SPICE-defined IGBT by using the generateSemiconductorSubcircuitROM function. The function runs the necessary simulations using LTspice or SIMetrix software.

In this example, you use the values in the manufacturer datasheet of the IGBT IKW15N120T2 [1] to define the input arguments of the generateSemiconductorSubcircuitROM function.

Define Input Arguments

Define the input arguments for the generateSemiconductorSubcircuitROM function based on the SPICE simulation tool and operating system.

Define the name of the library that contains the subcircuit to simulate.

filename = "IGBT_1200V_TRENCHSTOP2_L1.lib";

Define the name of the SPICE subcircuit inside the library file.

subcircuitName = "IKW15N120T2_L1";

Define the SPICE software used during the simulation. By default, the function uses SIMetrix.

SPICETool = "LTspice";

Define the path of the executable of the SPICE tool used during simulation. The default value is C:\Program Files\SIMetrix910\bin64\Sim.exe. If you are not using a Windows operating system, or if the path is not the default specified before, this argument is needed.

SPICEPath = "C:\Users\"+ getenv('USERNAME') + "\AppData\Local\Programs\ADI\LTspice\LTspice.exe";

Define the folder for the generated netlists and SPICE outputs.

netlistFolderPath = "SPICENetlists";

Define the vector of terminal orders. The values of this vector define the ports of the semiconductor device to which each node of the SPICE subcircuit connects. For example, observe the definition of the .SUBCKT IKW15N120T2_L1 C G E PARAMS: TJ= {TEMP} subcircuit in the library file. The subcircuit defines the nodes for the drain, gate, source, junction temperature, and case temperatures at the positions 1, 2, 3, 4, and 5, respectively. The generateSemiconductorSubcircuitROM function requires you to use the number 1 for the drain, 2 for the gate, 3 for the source, 4 for the base, 5 for the junction temperature, and 0 for no connection. To obtain a ROM, you do not need the case temperature and you cannot assign the junction temperature for this IGBT device. Use this vector of terminal orders for this IGBT.

terminals = [1 2 3];

Define the device type. In this example, the device is an IGBT.

deviceType = 'IGBT';

Define the on-state gate-source voltage. To decide the value of this argument, look at the manufacturer datasheet. The function assigns the value of this argument to the IGBT gate node. The value of this argument must be within the datasheet limits and greater than the threshold voltage. For an IGBT, the source is called emitter. The threshold voltage of an IKW15N120T2 IGBT is equal to 6.4 V and the maximum operational gate-source voltage is equal to 20 V. You can find the threshold voltage value in the Gate-emitter threshold voltage parameter in the Electrical Characteristic table, and the gate-source voltage value in the Gate-emitter voltage parameter of the Maximum Ratings table. Specify a value of 10 V for the on-state gate-source voltage.

VgeOn = 10;

Define the off-state gate-source voltage. This argument must be less than the threshold voltage and greater than the minimum allowed voltage. By default, this value is equal to 0.

Define the constant current for threshold voltage. The function uses this current value to obtain the switch threshold voltage by measuring the gate voltage at which a constant drain current is first observed. This current is typically very small. The datasheet specifies a value of 0.6 mA. You can find this information in the Conditions column of the Gate-emitter threshold voltage parameter in the Electrical Characteristic table.

Icc = 0.6e-3;

Define the on-state gate resistance. The datasheet specifies a value of 41.8 ohms. You can find this information in the conditions from Figure 1 of the datasheet.

RgOn = 41.8;

Define the off-state gate resistance. The manufacturer datasheet does not specify a value for this argument. Specify the same value as the on-state gate resistance.

RgOff = 41.8;

Define the temperature point at which the device is tabulated. You must specify the values of this argument within the manufacturer operating ranges. In this example, you cannot parameterize the device over the temperature because the input terminals do not include the junction temperature. Specify values close to 27 °C, which is the default value for LTspice.

TVec = [25 30];

Define the on-state current breakpoints for the tabulated I-V curve. This argument specifies the currents at which the function tabulates the device. The values of this argument must be less than the maximum datasheet values, which you can find in the DC collector current parameter of the Maximum Ratings table.

IVec = [5 15 30];

Define the on-state current breakpoints for switching losses. These breakpoints must be equal to the breakpoints for the tabulated I-V curve.

Define the off-state voltage breakpoints for switching losses. These values define the voltage breakpoints at which the function tabulates the device diode. The values of this argument must be less than the maximum values.

VVec = 10:200:610;

Define the leakage inductance and stray capacitance of test circuit. The datasheet specifies the leakage inductance of 315 nH and stray capacitance of 34 pF. You can find the information in the Conditions column of the IGBT Characteristic table.

Lleak = 315e-9;
Cstray = 34e-12;

Generate ROM

If you have a supported SPICE simulation tool installed, generate the ROM.

generateSemiconductorSubcircuitROM(filename,subcircuitName,...
    SPICETool=SPICETool,SPICEPath=SPICEPath,TestNetlistFolder=netlistFolderPath,...
    DeviceType=deviceType,Terminals=terminals,OnStateGateSourceVoltage=VgeOn,...
    ConstantCurrentForThresholdVoltage=Icc,OnStateGateResistance=RgOn,...
    OffStateGateResistance=RgOff,Temperatures=TVec,...
    OnStateCurrentsForIV=IVec,OnStateCurrentsForLoss=IVec,...
    OffStateVoltagesForLoss=VVec,TestCircuitLeakageInductance=Lleak,...
    TestCircuitStrayCapacitance=Cstray);
Using:
  DeviceType = IGBT
  Terminals = [1;2;3]
  OnStateGateSourceVoltage = 10
  OffStateGateSourceVoltage = 0
  ConstantCurrentForThresholdVoltage = 0.0006
  OnStateGateResistance = 41.8
  OffStateGateResistance = 41.8
  Temperatures = [25;30]
  OnStateCurrentsForIV = [5;15;30]
  OnStateCurrentsForLoss = [5;15;30]
  OffStateVoltagesForLoss = [10;210;410;610]
  MaximumSwitchingFrequency = 100000
  TestCircuitLeakageInductance = 3.15e-07
  TestCircuitStrayCapacitance = 3.4e-11
  Reltol = 0.001
  Abstol = 1e-12
  Vntol = 1e-06
  Gmin = 1e-12
  Cshunt = 0
Extracting switch IV curve ...
Using existing netlist SPICENetlists\IKW15N120T2_L1_Vth_I0A0006_T25.net to extract threshold voltage
Running netlist SPICENetlists\IKW15N120T2_L1_Vth_I0A0006_T25.net to extract threshold voltage in SPICE tool LTspice
Using existing netlist SPICENetlists\IKW15N120T2_L1_SwitchIV_Vg10_I30.net to extract switch current-voltage table
Running netlist SPICENetlists\IKW15N120T2_L1_SwitchIV_Vg10_I30.net to extract switch current-voltage table in SPICE tool LTspice
Using existing netlist SPICENetlists\IKW15N120T2_L1_Goff_T25.net to extract off-conductance
Running netlist SPICENetlists\IKW15N120T2_L1_Goff_T25.net to extract off-conductance in SPICE tool LTspice

Figure contains an axes object. The axes object with title Semiconductor Switch I-V Characteristics by Temperature, xlabel Drain-Source blank Voltage blank V indexOf DS baseline blank (V), ylabel Drain Current I indexOf D baseline blank (A) contains 2 objects of type line. These objects represent Tj = 25 degC, Tj = 30 degC.

Extracting diode IV curve ...
Using existing netlist SPICENetlists\IKW15N120T2_L1_DiodeIV.net to extract the diode current-voltage table.
Running netlist SPICENetlists\IKW15N120T2_L1_DiodeIV.net to extract diode current-voltage table in SPICE tool LTspice

Figure contains an axes object. The axes object with title Diode I-V Characteristics by Temperature, xlabel Diode forward voltage V indexOf f baseline [V], ylabel Diode forward current I indexOf f baseline [A] contains 2 objects of type line. These objects represent Tj = 25 degC, Tj = 30 degC.

Extracting switching loss lookup tables ...
Using existing netlist SPICENetlists\IKW15N120T2_L1_Loss_V10_T25.net to extract losses
Using existing netlist SPICENetlists\IKW15N120T2_L1_Loss_V210_T25.net to extract losses
Using existing netlist SPICENetlists\IKW15N120T2_L1_Loss_V410_T25.net to extract losses
Using existing netlist SPICENetlists\IKW15N120T2_L1_Loss_V610_T25.net to extract losses
Using existing netlist SPICENetlists\IKW15N120T2_L1_Loss_V10_T30.net to extract losses
Using existing netlist SPICENetlists\IKW15N120T2_L1_Loss_V210_T30.net to extract losses
Using existing netlist SPICENetlists\IKW15N120T2_L1_Loss_V410_T30.net to extract losses
Using existing netlist SPICENetlists\IKW15N120T2_L1_Loss_V610_T30.net to extract losses
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V10_T25.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V210_T25.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V410_T25.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V610_T25.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V10_T30.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V210_T30.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V410_T30.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V610_T30.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V10_T25.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V210_T25.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V410_T25.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V610_T25.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V10_T30.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V210_T30.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V410_T30.net to extract losses in SPICE tool LTspice.
Running netlist SPICENetlists\IKW15N120T2_L1_Loss_V610_T30.net to extract losses in SPICE tool LTspice.

Figure Eon contains 2 axes objects. Axes object 1 with title Turn-On Switching Loss (Eon) at Tj = 25 [degC], xlabel On-State Current [A], ylabel Energy Loss (Eon) [J] contains 5 objects of type line. These objects represent On-State Voltage = 0 [V], On-State Voltage = 10 [V], On-State Voltage = 210 [V], On-State Voltage = 410 [V], On-State Voltage = 610 [V]. Axes object 2 with title Turn-On Switching Loss (Eon) at Tj = 30 [degC], xlabel On-State Current [A], ylabel Energy Loss (Eon) [J] contains 5 objects of type line. These objects represent On-State Voltage = 0 [V], On-State Voltage = 10 [V], On-State Voltage = 210 [V], On-State Voltage = 410 [V], On-State Voltage = 610 [V].

Figure Eoff contains 2 axes objects. Axes object 1 with title Turn-Off Switching Loss (Eoff) at Tj = 25 [degC], xlabel Off-State Current [A], ylabel Energy Loss (Eoff) [J] contains 5 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 210 [V], Off-State Voltage = 410 [V], Off-State Voltage = 610 [V]. Axes object 2 with title Turn-Off Switching Loss (Eoff) at Tj = 30 [degC], xlabel Off-State Current [A], ylabel Energy Loss (Eoff) [J] contains 5 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 210 [V], Off-State Voltage = 410 [V], Off-State Voltage = 610 [V].

Figure Erec contains 2 axes objects. Axes object 1 with title Reverse Recovery Loss (Erec) at Tj = 25 [degC], xlabel Complementary Switch Initial Current [A], ylabel Energy Loss (Erec) [J] contains 5 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 210 [V], Off-State Voltage = 410 [V], Off-State Voltage = 610 [V]. Axes object 2 with title Reverse Recovery Loss (Erec) at Tj = 30 [degC], xlabel Complementary Switch Initial Current [A], ylabel Energy Loss (Erec) [J] contains 5 objects of type line. These objects represent Off-State Voltage = 0 [V], Off-State Voltage = 10 [V], Off-State Voltage = 210 [V], Off-State Voltage = 410 [V], Off-State Voltage = 610 [V].

References

[1] Infineon. “IKW15N120T2. TrenchStop® 2nd generation Series.” Accessed Jan 9, 2024. https://www.infineon.com/dgdl/Infineon-IKW15N120T2-DataSheet-v02_02-EN.pdf?fileId=db3a304412b407950112b426d2d43acd.

Input Arguments

collapse all

Path to the SPICE subcircuit library file that the function uses to generate the ROM, specified as a string or character vector. This library file can contain multiple subcircuits.

Name of the SPICE subcircuit model that the function uses to generate the ROM, specified as a string or character vector.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: generateSemiconductorSwitchROM(libraryPath,subcircuitName,DeviceType="MOSFET",OnStateGateSourceVoltage=10,OnStateGateResistance=2);

Name of the SPICE simulation engine, specified as 'SIMetrix' or 'LTspice'.

Path to the SPICE simulation engine executable file, specified as a string or character vector.

Vector of terminal orders in the SPICE subcircuit. The values of this vector define the ports of the semiconductor device that each node of the SPICE subcircuit connects to:

  • 0 — No connection

  • 1D for MOSFET or C for IGBT

  • 2G for MOSFET and IGBT

  • 3S for MOSFET or E for IGBT

  • 4B for MOSFET

  • 5Tj for MOSFET and IGBT

The size of this vector must match the number of nodes specified in the subcircuit.

For example, if your SPICE subcircuit is .SUBCKT IAUC100N04S6L014 drain gate source Tj Tcase, then define this vector as [1 2 3 5 0]. If your SPICE subcircuit is .SUBCKT IAUC100N04S6L014 drain gate source , then define this vector as [1 2 3].

Option to specify the semiconductor device type inside the semiconductor switch subsystem, specified as "MOSFET" or "IGBT".

On-state gate-source voltage, in volts, specified as a positive scalar.

Off-state gate-source voltage, in volts, specified as a positive scalar.

Constant current that the function uses to extract the threshold voltage, in amperes, specified as a positive scalar.

On-state gate resistance, in ohms, specified as a positive scalar. This value contributes to loss values. Estimate this value based on your circuit conditions.

Off-state gate resistance, in ohms, specified as a positive scalar. This value contributes to loss values. Estimate this value based on your circuit conditions.

Device simulation temperature, in Celsius, specified as a scalar or a vector of breakpoint values for the lookup tables.

On-state current breakpoints, in amperes, for the tabulated I-V curves, specified as a vector of nonnegative scalars.

On-state current breakpoints for switching losses, in amperes, specified as a vector of nonnegative scalars. The function uses this parameter value to calculate the turn-on switching loss, Eon, the turn-off switching loss, Eoff, and the reverse recovery loss, Erec.

Off-state voltage breakpoints for losses, in volts, specified as a vector of nonnegative scalars. The function uses this parameter value to calculate the turn-on switching loss, Eon, the turn-off switching loss, Eoff, and the reverse recovery loss, Erec.

Maximum switching frequency of your device in your circuit, in Hz, specified as a nonnegative scalar.

Leakage inductance of the test circuit, in henries, specified as a nonnegative scalar.

Stray capacitance of the test circuit, in farads, specified as a nonnegative scalar.

Relative tolerance parameter used in SPICE simulations, specified as a scalar.

Absolute current tolerance parameter used in SPICE simulations, specified as a scalar.

Absolute voltage tolerance parameter used in SPICE simulations, specified as a scalar.

Parallel conductance with all nonlinear devices used in SPICE simulations, in 1/Ohm, specified as a scalar.

Parasitic capacitance, in farads, between each node in the SPICE circuit and the ground, specified as a scalar.

Option to display the results, specified as either true or false.

Option to create a Simulink model that contains the ROM, specified as true or false.

Name of the folder that the generateSemiconductorSubcircuitROM function creates for generated netlists and SPICE outputs in your current folder, specified as a string or character vector.

If you set the value of this argument to "", the software writes the models in the temporary folder specified by the tempdir command.

If you already have a folder with this name in your current folder that contains generated netlists, the generateSemiconductorSubcircuitROM function extracts the parameters from the existing netlists. The function does not overwrite the existing netlists.

Output Arguments

collapse all

ROM parameters that the function generates from the SPICE subcircuit, returned as a structure with these fields.

Lookup table for the I-V curve and switching losses of the semiconductor switch, returned as a structure.

Lookup table for the I-V curve and reverse recovery loss of the diode, returned as a structure.

Version History

Introduced in R2025a