MOSFET SPICE models .lib file into Simulink using subcircuit2ssc

41 次查看(过去 30 天)
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.

采纳的回答

David John
David John 2021-12-16
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 个评论
Fan Yingpeng
Fan Yingpeng 2023-10-7
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
David John 2023-10-9
编辑:David John 2023-10-9
.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).

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simscape Electrical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by