ee_convertedMosfetValidation
Generate standard MOSFET characteristics for Simscape and validate conversion results against SPICE simulation tool
Since R2020b
Description
[
takes a Simscape™
outputData
] = ee_convertedMosfetValidation(fileName
,Name,Value
)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
Generate and plot simulation results for Simscape
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, plot, and compare simulation results against LTspice
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, plot, and compare simulation results against SIMetrix
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
fileName
— File name
character vector
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'
SPICEFile
— SPICE netlist file
character vector
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.
Subcircuit
— SPICE subcircuit
character vector
Name of the subcircuit from a SPICE netlist file, specified as the
comma-separated pair consisting of 'Subcircuit'
and a
character vector.
SPICEPath
— Path of the SPICE simulation engine executable file
character vector
Path of the SPICE simulation engine executable file, specified as the
comma-separated pair consisting of 'SPICEPath'
and a
character vector.
SPICETool
— Name of the SPICE simulation engine
character vector
Name of the SPICE simulation engine executable file, specified as the
comma-separated pair consisting of 'SPICETool'
and
either LTSpice
or
SIMetrix
.
Vt
— Threshold voltage
1.4
(default) | positive scalar
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.
Vds
— Maximum drain-to-source voltage
20
(default) | positive scalar
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.
CheckIdVgs
— Id versus Vgs test flag
1
(default) | 0
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
.
CheckIdVds
— Id versus Vds test flag
1
(default) | 0
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
.
CheckQiss
— Gate charge test flag
0
(default) | 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
.
CheckQoss
— Output charge test
0
(default) | 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
.
CheckBreakdown
— Breakdown test
0
(default) | 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
.
Ciss
— Input capacitance
440e-12
(default) | scalar
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.
Coss
— Output capacitance
30e-12
(default) | 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.
RelTol
— Relative tolerance
1e-4
(default) | scalar
Relative tolerance parameter used in SPICE simulations, specified as
the comma-separated pair consisting of 'RelTol'
and a
scalar.
AbsTol
— Absolute tolerance
1e-4
(default) | scalar
Absolute current tolerance parameter used in SPICE simulations,
specified as the comma-separated pair consisting of
'AbsTol'
and a scalar.
VnTol
— Absolute voltage tolerance
1e-4
(default) | scalar
Absolute voltage tolerance parameter used in SPICE simulations,
specified as the comma-separated pair consisting of
'VnTol'
and a scalar.
BreakdownScalingForVds
— Breakdown test
2
(default) | 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
.
GeneratePlots
— Plot generation
0
(default) | 1
Whether to plot the results of the simulations, specified as the
comma-separated pair consisting of 'GeneratePlots'
and either 0
or 1
.
AbsErrTol
— Absolute error tolerance
1e-3
(default) | scalar
Value of the absolute error tolerated between the SPICE and Simscape
results, specified as the comma-separated pair consisting of
'AbsErrTol'
and a scalar.
RelErrTol
— Relative error tolerance
1e-2
(default) | 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
outputData
— Simulation results
structure
Simulation results, returned as a structure with these fields:
plots_Simscape/plots_SPICEToolvsSimscape
— Simulation plot results
structure
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)
SPICE_library_file
— SPICE library file name
character vector
Name of the SPICE library file, returned as a character vector.
SPICE_library_file_timestamp
— Timestamp of SPICE library file
character vector
Timestamp of the SPICE library file, returned as a character vector.
Simscape_file
— Simscape file name
character vector
Name of the Simscape file, returned as a character vector.
Simscape_file_timestamp
— Timestamp of Simscape file
character vector
Timestamp of the Simscape file, returned as a character vector
Version History
Introduced in R2020b
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)