Main Content

ee_convertedMosfetValidation

Generate standard MOSFET characteristics for Simscape and validate conversion results against SPICE simulation tool

Since R2020b

Description

example

[outputData] = ee_convertedMosfetValidation(fileName,Name,Value) takes a Simscape™ ssc file name and a set of name-value pairs and returns these characteristics:

  • Id versus Vgs

  • Id versus Vds

  • Gate charge (Qiss)

  • Output charge (Qoss)

  • Breakdown voltage

If the subcircuit contains the junction terminal, the function generates the Id versus Vgs characteristics for two different combinations of junction and case temperatures.

If you also provide the SPICE netlist files as an input, outputData also includes the plots from both Simscape and the specified SPICE simulation tool. When the signals are below the tolerance values, you can observe the differences between the Simscape and SPICE simulation tool results.

This function supports LTspice XVII and SIMetrix.

Examples

collapse all

Generate the MOSFET Id versus Vgs characteristics and Id versus Vds characteristics and plot the results.

simscapeFile = fullfile(matlabroot,'toolbox','physmod','elec','supporting_files','ee_BSC019N02KS.ssc');
[outputData] = ee_convertedMosfetValidation(simscapeFile,...
"CheckIdVgs",1, "GeneratePlots",1)

Generate the MOSFET standard characteristics and plot the results to compare them with the results obtained in LTspice.

simscapeFile = fullfile(matlabroot,'toolbox','physmod','elec','supporting_files','ee_BSC019N02KS.ssc');
[outputData] = ee_convertedMosfetValidation(simscapeFile,...
"SPICEFile","ee_SPICEOptiMOS20V.lib","Subcircuit","BSC019N02KS",...
"SPICEPath","C:\Program Files\LTC\LTspiceXVII\XVIIx64.exe",...
"SPICETool","LTspice","CheckIdVgs",1,"CheckIdVds",1,"CheckQiss",1,...
"CheckQoss",1,"CheckBreakdown",1,"Vt",1.5,"Vds",15,"RelTol",1e-5,...
"AbsTol",1e-5,"VnTol",1e-5,"Ciss",23e-9,"Coss",3e-9,"AbsErrTol",1e-2,...
"RelErrTol",0.1,"BreakdownScalingForVds",3,"GeneratePlots",1)

Generate the MOSFET standard characteristics and plot the results to compare them with the results obtained in SIMetrix.

simscapeFile = fullfile(matlabroot,'toolbox','physmod','elec','supporting_files','ee_BSC019N02KS.ssc');
[outputData] = ee_convertedMosfetValidation(simscapeFile,...
"SPICEFile","ee_SPICEOptiMOS20V.lib","Subcircuit","BSC019N02KS",...
"SPICETool","SIMetrix","SPICEPath",...
"C:\Program Files\SIMetrix830\bin64\Sim.exe","CheckQiss",1,...
"CheckQoss",1,"CheckBreakdown",1,"Vt",1.5,"Vds",15,"Ciss",23e-9,...
"Coss",3e-9,"BreakdownScalingForVds",3,"GeneratePlots",1)

Input Arguments

collapse all

Name of the Simscape ssc file you want to generate the characteristics from, specified as a character vector.

Name-Value Arguments

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'SPICEFile','ee_SPICEOptiMOS20V.lib','Subcircuit','BSC019N02KS'

Name of the SPICE netlist file you want to generate the characteristics from, specified as the comma-separated pair consisting of 'SPICEFile' and a character vector.

Name of the subcircuit from a SPICE netlist file, specified as the comma-separated pair consisting of 'Subcircuit' and a character vector.

Path of the SPICE simulation engine executable file, specified as the comma-separated pair consisting of 'SPICEPath' and a character vector.

Name of the SPICE simulation engine executable file, specified as the comma-separated pair consisting of 'SPICETool' and either LTSpice or SIMetrix.

Approximate value of the threshold voltage of a MOSFET, in volts, specified as the comma-separated pair consisting of 'Vt' and a positive scalar. This variable is used to determine the range of the gate-source voltage for plotting. The gate-source voltage sweeps from 0 to 3 * Vt for Id versus Vgs characteristics.

Approximate value of the maximum drain-to-source voltage for a MOSFET, in volts, specified as the comma-separated pair consisting of 'Vds' and a positive scalar. This variable is used to determine the range of the drain-source voltage for plotting. The drain-source voltage sweeps from 0 to Vds for Id versus Vds characteristics.

Id versus Vgs test flag, specified as the comma-separated pair consisting of 'CheckIdVgs' and either 0 or 1. To run the Id versus Vgs test, set this value to 1.

Id versus Vds test flag, specified as the comma-separated pair consisting of 'CheckIdVds' and either 0 or 1. To run the Id versus Vds test, set this value to 1.

Gate charge test flag, specified as the comma-separated pair consisting of 'CheckQiss' and either 0 or 1. To run the gate charge test, set this value to 1.

Output charge test flag, specified as the comma-separated pair consisting of 'CheckQoss' and either 0 or 1. To run the output charge test, set this value to 1.

Breakdown test flag, specified as the comma-separated pair consisting of 'CheckBreakdown' and either 0 or 1. To run the breakdown test, set this value to 1.

Approximate value of the input capacitance, in farad, used to determine the driving current for a Qiss characteristic, specified as the comma-separated pair consisting of 'Ciss' and a scalar.

Approximate value of the output capacitance used to determine the driving current for a Qoss characteristic, in farad, specified as the comma-separated pair consisting of 'Coss' and a scalar.

Relative tolerance parameter used in SPICE simulations, specified as the comma-separated pair consisting of 'RelTol' and a scalar.

Absolute current tolerance parameter used in SPICE simulations, specified as the comma-separated pair consisting of 'AbsTol' and a scalar.

Absolute voltage tolerance parameter used in SPICE simulations, specified as the comma-separated pair consisting of 'VnTol' and a scalar.

Coefficient of Vds for breakdown test, specified as the comma-separated pair consisting of 'BreakdownScalingForVds' and a scalar. The drain voltage increases up to BreakdownScalingForVds * Vds.

Whether to plot the results of the simulations, specified as the comma-separated pair consisting of 'GeneratePlots' and either 0 or 1.

Value of the absolute error tolerated between the SPICE and Simscape results, specified as the comma-separated pair consisting of 'AbsErrTol' and a scalar.

Value of the relative error tolerated between the SPICE and Simscape results compared to SPICE, specified as the comma-separated pair consisting of 'RelErrTol' and a scalar. The indices for the differences beyond the error tolerances are stored in the output argument, outputData, when the absolute and relative errors between the SPICE and Simscape results are greater than 'AbsErrTol' and 'RelErrTol', respectively.

Output Arguments

collapse all

Simulation results, returned as a structure with these fields:

Table with the plot results, returned as a structure, that contains:

  • The voltage and current values for Simscape (and SPICETool if you provide the SPICE library file) for the Id versus Vgs, Id versus Vds, and Breakdown tests

  • The voltage indices for the differences beyond the error tolerances for Id versus Vgs, Id versus Vds, and Breakdown tests (if you provide the SPICE library file)

  • The simulation time values and the voltage values for Simscape (and SPICETool if you provide the SPICE library file) for gate charge and output charge tests

  • The simulation time indices for the differences beyond the error tolerances for gate charge and output charge tests (if you provide the SPICE library file)

Name of the SPICE library file, returned as a character vector.

Timestamp of the SPICE library file, returned as a character vector.

Name of the Simscape file, returned as a character vector.

Timestamp of the Simscape file, returned as a character vector

Version History

Introduced in R2020b