Generate standard MOSFET characteristics for Simscape and validate conversion results against LTspice
[
takes a SimscapeTM
outputData] = 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 you also provide the SPICE netlist files as an input, outputData also includes the plots from both Simscape and LTspice. When the signals are below the tolerance values, you can observe the differences between the Simscape and LTspice results.
This function supports LTspice XVII.
ee_convertedMosfetValidation function to generate, plot, and compare simulation resultsGenerate the MOSFET standard characteristics and plot the results to compare them with the results obtained in LTspice.
[outputData] = ee_convertedMosfetValidation('ee_BSC019N02KS.ssc',... 'SPICEFile','ee_SPICEOptiMOS20V.lib','Subcircuit','BSC019N02KS',... 'SPICEPath','C:\Program Files\LTC\LTspiceXVII\XVIIx64.exe',... '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)
filename — File nameName of the Simscape ssc file you want to generate the
characteristics from, specified as a character vector.
Specify optional
comma-separated pairs of Name,Value arguments. Name is
the argument name and Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN.
'SPICEFile','ee_SPICEOptiMOS20V.lib','Subcircuit','BSC019N02KS''SPICEFile' — SPICE netlist fileName 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 subcircuitName 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 LTspice executable filePath of the LTspice executable file, specified as the comma-separated
pair consisting of 'SPICEPath' and a character
vector.
'Vt' — Threshold voltage1.4 (default) | positive scalarApproximate 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 voltage20 (default) | positive scalarApproximate 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 flag1 (default) | 0Id 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 flag1 (default) | 0Id 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 flag0 (default) | 1Gate 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 test0 (default) | 1Output 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 test0 (default) | 1Breakdown 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 capacitance440e-12 (default) | scalarApproximate 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 capacitance30e-12 (default) | scalarApproximate 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 tolerance1e-4 (default) | scalarRelative tolerance parameter used in SPICE simulations, specified as
the comma-separated pair consisting of 'RelTol' and a
scalar.
'AbsTol' — Absolute tolerance1e-4 (default) | scalarAbsolute current tolerance parameter used in SPICE simulations,
specified as the comma-separated pair consisting of
'AbsTol' and a scalar.
'VnTol' — Absolute voltage tolerance1e-4 (default) | scalarAbsolute voltage tolerance parameter used in SPICE simulations,
specified as the comma-separated pair consisting of
'VnTol' and a scalar.
'BreakdownScalingForVds' — Breakdown test2 (default) | scalarCoefficient 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 generation0 (default) | 1Whether to plot the results of the simulations, specified as the
comma-separated pair consisting of 'GeneratePlots'
and either 0 or 1.
'AbsErrTol' — Absolute error tolerance1e-3 (default) | scalarValue 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 tolerance1e-2 (default) | scalarValue 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.
outputData — Simulation resultsSimulation results, returned as a structure with these fields:
plots — Simulation plot resultsTable with the plot results, returned as a structure, that contains:
The voltage and current values for SPICE and Simscape 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
The simulation time values and the voltage values for SPICE and Simscape for SPICE and Simscape 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
SPICE_netlist_file — SPICE netlist file nameName of the SPICE netlist file, returned as a character vector.
SPICE_netlist_file_timestamp — Timestamp of SPICE netlist fileTimestamp of the SPICE netlist file, returned as a character vector.
Simscape_file — Simscape file nameName of the Simscape file, returned as a character vector.
Simscape_file_timestamp — Timestamp of Simscape fileTimestamp of the Simscape file, returned as a character vector