MOSFET SPICE models .lib file into Simulink using subcircuit2ssc
38 views (last 30 days)
Show older comments
Hello,
I am attempting to import the 1200 V Infineon device models into Matlab Simulink using 'subcircuit2ssc', however when I attempt to in Matlab I get the error:
"Subcircuit delimiters is not in expected format.
Error in spiceSubckt
Error in subcircuit2ssc"
I have changed the numbers such as MEGA to 1e9 etc and ** to ^ to match Matlab use but still get the same errors. Any suggestions on other sections of the .lib to change in order to make it work?
The original model code is attached.
0 Comments
Accepted Answer
David John
on 16 Dec 2021
Most likely this is because you have nested subcircuits. In particular, there is:
.ENDS TO263_7_11_HVM_1G75_1S500_100MHz_parlel
.ENDS TO263_7_11_HVM_1G75_1S500_100MHz
Please try getting rid of the nesting. This can be achieved by cutting the line:
.ENDS TO263_7_11_HVM_1G75_1S500_100MHz
and pasting it just above the line
.SUBCKT TO263_7_11_HVM_1G75_1S500_100MHz_half 1 2 3 4 5 6 7 8
4 Comments
Fan Yingpeng
on 7 Oct 2023
Dear hugo c,
I met the same problem as you, after modification of .lib file wih subcircuits nesting and DC 0, curly brackets troubles me and I don't konw why. Error in Matlab Command Window as below
"Error using spiceSubckt/getFunctionCalls
Functions must be enclosed in {}."
I have already examined the amount of curly brackets in .lib file and add {} at every equal sign such as PARAMS: N9 = {30}, but the error still exists
code of .lib file is attached and could you help me
thank you
David John
on 9 Oct 2023
Edited: David John
on 9 Oct 2023
.FUNC N168(N101, N102, N103) = IF( -N148(N101, N102, N103) - N149(N101,N103) > 0, -N148(N101, N102, N103) - N149(N101,N103) , 0)
should be
.FUNC N168(N101, N102, N103) = {IF( -N148(N101, N102, N103) - N149(N101,N103) > 0, -N148(N101, N102, N103) - N149(N101,N103) , 0)}
Also, please make sure that X$M2 references the appropriate subcircuit on the same line:
X$M2 N4 N4 GATE DRAIN SOURCE SOURCESENSE N5 N6 TO263_7_11_HVM_1G75_1S500_100MHz (some editors will wrap that line and insert a newline before the TO263*, and this should be avoided).
More Answers (0)
See Also
Categories
Find more on Simscape Electrical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!