Main Content

SPICE Conversion of a MOSFET Subcircuit and Validation

This example shows how to convert a metal-oxide-semiconductor field-effect transistor (MOSFET) subcircuit into an equivalent Simscape™ component and compare the Spice and Simscape plots for some standard MOSFET characteristics, namely Id versus Vgs, Id versus Vds, Qiss/ Gate charge, Qoss/ Output charge, and Breakdown voltage. The subcircuit2ssc function converts all the subcircuit components inside a SPICE netlist file into one or more equivalent Simscape files.

Open the MOSFET Subcircuit

In this example, you will convert this MOSFET subcircuit to a Simscape component. To open the SPICE netlist, in the MATLAB command window, enter edit IAUC100N04S6L014.cir.

* ------------------------------------------------------------------------------
* 
* DISCLAIMER
* 
* INFINEON'S MODEL TERMS OF USE
* 
* BY DOWNLOADING AND/OR USING THIS INFINEON MODEL ("MODEL"), THE USER
* (INCLUDING YOU) AGREES TO BE BOUND BY THE TERMS OF USE HERE STATED. IF USER
* DOES NOT AGREE TO ALL TERMS OF USE HERE STATED, USER SHALL NOT DOWNLOAD,
* USE OR COPY THE MODEL BUT IMMEDIATELY DELETE IT (TO THE EXTENT THAT IT
* WAS DOWNLOADED ALREADY).
* 
* 1. SCOPE OF USE
* 1.1 Any use of this Model provided by Infineon Technologies AG is subject
*     to these Terms of Use.
* 1.2 This Model, provided by Infineon, does not fully represent all of the
*     specifications and operating characteristics of the product to which
*     this Model relates.
* 1.3 This Model only describes the characteristics of a typical product.
*     In all cases, the current data sheet information for a given product
*     is the final design guideline and the only actual performance
*     specification. Although this Model can be a useful tool to evaluate
*     the product performance, it cannot simulate the exact product performance
*     under all conditions and it is also not intended to replace
*     bread-boarding for final verification.
* 
* 2. IMPORTANT NOTICE
* 2.1 Infineon Technologies AG ("Infineon") is not and cannot be aware of the
*     specific application of the Infineon's Model by User. However, Model may
*     from time to time be used by User in potentially harmful and/or life-
*     endangering applications such as traffic, logistic, medical, nuclear
*     or military applications or in other applications where failure of the
*     Model may predictably cause damage to persons' life or health or to
*     property (hereinafter "Critical Applications").
* 2.2 User acknowledges that Infineon has not specifically designed or
*     qualified the Model for Critical Applications that the Model may contain
*     errors and bugs and that User is required to qualify the Model for
*     Critical Applications pursuant to the applicable local quality, safety
*     and legal requirements before permitting or giving access to any such use.
* 
* 3. CONFIDENTIAL INFORMATION
*     User shall treat ideas, concepts and information incorporated in the
*     Model, the documentation and the content of this Terms of Use (together
*     hereinafter "Confidential Information") confidential, not disclose it to
*     any third party unless otherwise agreed in writing between User and
*     Infineon, not use it for any other purposes than using the Model for
*     simulation and testing purposes only.
* 
* 4. WARRANTY
* 4.1 User acknowledges that the Model is provided by Infineon under this Terms
*     of Use is provided free of charge and "AS IS" without any warranty or
*     liability of any kind and Infineon hereby expressly disclaims any
*     warranties or representations, whether express, implied, statutory or
*     otherwise, including but not limited to warranties of workmanship,
*     merchantability, fitness for a particular purpose, defects in the
*     Model, or non-infringement of third parties intellectual property rights.
* 4.2 Infineon reserves the right to make corrections, deletions, modifications,
*     enhancements, improvements and other changes to the Model at any time
*     or to move or discontinue any Model without notice.
* 
* 5. LIABILITY
* 5.1 Nothing in this Terms of Use shall limit or exclude Infineon's liability
*     under mandatory liability laws, for injuries to life, body or health,
*     for fraudulent concealment of defects in the software, or in cases
*     of Infineon's intentional misconduct or gross negligence.
* 5.2 Without prejudice to Sections 5.1, in cases of Infineon's slight
*     negligent breach of obligations that restrict essential rights or duties
*     arising from the nature of this Terms of Use in a way that there is a
*     risk of non-achievement of the purpose of this Terms of Use or of an
*     obligation whose observance User regularly may trust in and whereas
*     compliance with only makes proper execution of this Terms of Use
*     possible, Infineon's liability shall be limited to the typically,
*     foreseeable damage.
* 5.3 Without prejudice to Sections 8.1 and 8.2, Infineon's liability under
*     this Agreement shall be excluded in all other cases.
* 
* 6. EXPORT REGULATIONS
*     The User shall comply with all applicable national and international
*     laws and regulations, in particular the applicable export control
*     regulations and sanction programs. The User also agrees not to
*     export, re-export or transfer any software or technology developed
*     with or using information, software or technology offered by Infineon,
*     in violation of any applicable laws or regulations of the competent
*     authorities. Further, the User shall neither use any products,
*     information, software and technology offered by Infineon in or in
*     connection with nuclear technology or weapons of mass destruction
*     (nuclear, biological or chemical) and carriers thereof nor supply
*     military consignees.
* 
* 7. TERMINATION OF USE PERMIT
*     If the User violates these Terms of Use, such User's permit to use
*     this Model terminates automatically. In addition, Infineon may
*     terminate the User's permit to use this Model at its discretion and
*     at any time regardless of any violation of these Terms of Use. In
*     any of the foregoing events, the User is obliged to immediately destroy
*     any content that has been downloaded or printed from Infineon's website.
* 
* 8. MISCELLANEOUS
* 8.1 These Terms of Use are subject to the laws of the Federal Republic
*     of Germany with the exception of the United Nations on Purchase
*     Contracts on the International Sale of Goods dated April 11, 1980 (CISG).
*     The exclusive place of jurisdiction is Munich, Germany.
* 8.2 Should any provision in these Terms of Use be or become invalid, the
*     validity of all other provisions or agreements shall remain unaffected
*     thereby.
* 
* ------------------------------------------------------------------------------
* 
* Title:    INFINEON Power Transistors Simulation Models for PSpice
* Description: n-channel Transistors
*                 OptiMOS5 40V
* Authors:  Dr. Elmar Gondro, Tel: +49/89/234-29391
*           Günther Moyses,   Tel: +49/89/234-24811
*           Sebastian Koch,   Tel: +49/89/234-89858
* Email:    Elmar.Gondro@Infineon.com
*           Guenther.Moyses@Infineon.com
*           Sebastian.Koch@Infineon.com
* Support:  Simulate@Infineon.com
*
.SUBCKT IAUC100N04S6L014 drain gate source Tj Tcase PARAMS: dVth=0 dRdson=0 dgfs=0 dC=0 dZth=0 Ls=0.05n Ld=1n Lg=3n

.PARAM Rs=222u      Rg=2.2       Rd=5u        Rmet=45u
.PARAM Inn=50       Unn=10       Rmax=1.40m   gmin=69
.PARAM act=4.672    Rsp=2.4

X_1  d1 g s sp Tj A6_40_d_var PARAMS: a={act} Rsp={Rsp} dVth={dVth} dRdson={dRdson} dgfs={dgfs} Inn={Inn} Unn={Unn} 
+                                     Rmax={Rmax} gmin={gmin} Rs={Rs} Rp={Rd} dC={dC} Rmet={Rmet}
R_g    g1     g    {Rg}
L_g    gate   g1   {Lg*if(dgfs==99,0,1)}
G_s    s1     s    VALUE={V(s1,s)/(Rs*(1+(limit(V(Tj),-200,999)-25)*4m)-Rmet)}
R_sa   s1     s    1Meg
L_s    source s1   {Ls*if(dgfs==99,0,1)}
R_da   d1     d2   {Rd}
L_d    drain  d2   {Ld*if(dgfs==99,0,1)}
R_daux drain  d2    10
R_gaux gate   g1    10
R_saux source s1    10

R_th1  Tj      t1              {5.98m+limit(dZth,0,1)*2.22m}
R_th2  t1      t2              {73.91m+limit(dZth,0,1)*27.36m}
R_th3  t2      t3              {258.69m+limit(dZth,0,1)*10.72m}
R_th4  t3      t4              {305.94m+limit(dZth,0,1)*195.71m}
R_th5  t4      Tcase           {377.8m+limit(dZth,0,1)*241.67m}
C_th1  Tj      0               40.653u
C_th2  t1      0               180.521u
C_th3  t2      0               1.089m
C_th4  t3      0               823.295u
C_th5  t4      0               25.88m
C_th6  Tcase   0               30m

.ENDS


.SUBCKT A6_40_d_var dd g s0 sp Tj PARAMS: a=1 Rsp=1 dVth=0 dRdson=0 dgfs=0 Inn=1 
+ Unn=1 Rmax=0 gmin=1 Rs=1 Rp=1 dC=0 Rmet=1u

.PARAM  Fm=0.05    Fn=1        al=0.5
.PARAM  c=0.95     Vth0=2.479  auth=3.056m
.PARAM  UT=15.11m  ab=18.74m   lB=-23       UB=41.93

.PARAM  b0=244.4   p0=8.687    p1=-30.58m   p2=45.79u

.PARAM  Rd=3.508m  nmu=2.72    Tref=298     T0=273      lnIsj=-26.42
.PARAM  ndi=1.039  nisj=1.028  Rdi=4.29m    nmu2=0.0
.PARAM  td=20n     ta=2n
.PARAM  Rf=0.5949  nmu3=1.774

.PARAM  kbq=86.2u

* Cgs
.PARAM  f3=606.2p

* Cgfp
.PARAM  f3a=31.78p

* Cds
.PARAM q81=145.0p
.PARAM qs1=65.62p  qs2=345.4p  qs3=-87.45m
.PARAM qs4=85.58p  qs5=-16.63m
.PARAM x0=308.2m   x1=27.68    dx={x1-x0} 
.PARAM f2r=226.4m

* Cgd
.PARAM  ps0=14.83p ps1=9.092p ps2=-2.097 ps3=84.63p ps4=-160.7m ps5=6.584p ps6=8.636p
.PARAM  f5=35.38p
.PARAM  x2=6.361 x3=24.84      dx2={x3-x2}

* corner parameters
.PARAM  dVthmax=0.3   dCmax=0.3

.PARAM  Vth={Vth0+dVthmax*dVth}
.PARAM  q0={b0*((T0/Tref)**nmu3)*a}
.PARAM  q1={(Unn-Inn*Rs-Vth0)*q0}
.PARAM  q2={(Fm*sqrt(0.4)-c)*Inn*q0}
.PARAM  Rlim={(q1+2*q2*Rmax-sqrt(max(q1**2+4*q2,0)))/(2*q2)}
.PARAM  dRd={Rd/a+if(dVth==0,limit(dRdson,0,1)*max(Rlim-Rd/a-Rs-Rp,0),0)}
.PARAM  bm={c/((1/gmin-Rs)**2*Inn*a*(T0/Tref)**nmu3)}
.PARAM  bet={b0+(b0-bm)*if(dRdson==0,if(dVth==0,limit(dgfs,-1,0),0),0)}
.PARAM  dC1={1+dCmax*limit(dC,0,1)}
* .PARAM  dC2={1+1.5*dCmax*limit(dC,0,1)}

.PARAM  Cgs0={f3*a*dC1}
.PARAM  Cgs1={f3a*a*dC1}
.PARAM  dRdi={Rdi/a}

.PARAM  Cox1={(ps1*a+ps0*sqrt(a))*dC1}
.PARAM  Cox2={ps3*a*dC1}
.PARAM  Cox3={(ps5*a+ps6)*dC1}
.PARAM  Cox4={(f5*a+(ps5*a+ps6))*dC1}

.PARAM  Cds0={qs1*a*dC1}
.PARAM  Cds1={qs2*(1+f2r/sqrt(a))*a*dC1}
.PARAM  Cds2={qs4*a*dC1}
.PARAM  Cds3={(q81+qs1)*a*dC1}

* .FUNC  VBR(Usps)    {max(UB+min(Usps,dUmax)*s1+max(Usps-dUmax,0)*s2,Umin)}
.FUNC  VBR(Usps)    {UB}

.FUNC  I0(Uee,p,pp,z1)  {if(Uee>pp,(Uee-c*z1)*z1,p*(pp-p)/c*exp((Uee-pp)/p))}
.FUNC  Ig(Uds,T,p,Uee)  {bet*(T0/T)**nmu3*I0(Uee,p,min(2*p,p+c*Uds),min(Uds,Uee/(2*c)))}
.FUNC J(d,g,T,da,s,Usps) 
+ {a*(s*(Ig(da,T,(p0+(p1+p2*T)*T)*kbq*T,g-Vth+auth*(T-Tref)+Fm*da**Fn+1*limit(-d,0,1))+
+ exp(min(lB+(d-VBR(Usps)-ab*(T-Tref))/UT,25))))}

.FUNC  Idiode(Usd,Tj,Iss) {max(exp(min(log(Iss)+Usd/(ndi*kbq*Tj),7))-Iss,0)}
.FUNC  Idiod(Usd,Tj)      {a*Idiode(Usd,Tj,exp(min(lnIsj+(Tj/Tref-1)*1.12/(ndi*kbq*Tj),7))*(Tj/Tref)**nisj)}

.FUNC  Pr(Vss0,Vssp)  {Vss0*Vss0/max(Rmet,1u)+Vssp*Vssp/Rsp}

* .FUNC J1(d,g,T,da,s,Usps) {a*(s*(exp(min(lB+(d-VBR(Usps)-ab*(T-Tref))/UT,25))))}

.FUNC QCds(x) {Cds3*min(x,x1)+Cds0*max(x-x1,0)+(Cds3-Cds0)*((limit(x,x0,x1)-x0)**3/(dx*dx)*((limit(x,x0,x1)-x0)/(2*dx)-1))}
.FUNC QCdg(x) {Cox4*min(x,x3)+Cox3*max(x-x3,0)+(Cox4-Cox3)*((limit(x,x2,x3)-x2)**3/(dx2*dx2)*((limit(x,x2,x3)-x2)/(2*dx2)-1))}


E_Edg1     d   ox    VALUE {if(V(d,g)>0,V(d,g)-(exp(ps2*max(V(d,g),0))-1)/ps2,0)}
C_Cdg1    ox   g     {Cox1}
E_Edg2     d   ox1   VALUE {if(V(d,g)>0,V(d,g)-(exp(ps4*max(V(d,g),0))-1)/ps4,0)}
C_Cdg2   ox1   g     {Cox2}
E_Edg3     d   ox2   VALUE {V(d,g)-QCdg(V(d,g))/Cox4}
C_Cdg3   ox2   g     {Cox4} 

E_Eds      d   edep  VALUE {V(d,s)-QCds(V(d,s))/Cds3}
C_Cds  edep    s    {Cds3/2} 

E_Eds1     d   edep1 VALUE {V(d,sp)-QCds(V(d,sp))/Cds3}
C_Cds1 edep1   sp    {Cds3/2} 
E_Eds2     d   edep2 VALUE {if(V(d,sp)>0,V(d,sp)-(exp(qs5*max(V(d,sp),0))-1)/qs5,0)}
C_Cds2 edep2   sp    {Cds2}
E_Eds3     d   edep3 VALUE {if(V(d,sp)>0,V(d,sp)-(exp(qs3*max(V(d,sp),0))-1)/qs3,0)}
C_Cds3 edep3   sp    {Cds1}

C_Cgs     g    s      {Cgs0}
C_Cgs1    g    sp     {Cgs1}

R_fp      s    sp     {Rsp}

G_chan   d5a   s  VALUE={J(V(d5a,s),V(g,s),T0+limit(V(Tj),-200,300),(sqrt(1+4*al*abs(V(d5a,s)))-1)/2/al,sgn(V(d5a,s)),V(sp,s))}
R_d06    d5a  d5  1u
V_sm     d    d5  0
G_RMos   d1    d  VALUE={V(d1,d)/(Rf*dRd+(1-Rf)*dRd*((limit(V(Tj),-200,999)+T0)/Tref)**nmu)}
V_sense  dd   d1  0
G_diode   s   d3  VALUE={Idiod(V(s,d3),T0+limit(V(Tj),-200,499))}
G_Rdio   d2   d1  VALUE={V(d2,d1)/(dRdi*((limit(V(Tj),-200,999)+T0)/Tref)**nmu2)}
V_sense2 d2   d3  0

* includes RevRec, but has no Tj dependence...
* D_body s d3 dbody
* .model dbody D ( BV={UB*10} CJO={Cds0/100} TT={ta} IS={a*exp(lnIsj)} m=0.3 RS={dRdi*1m} n={ndi} XTI={nisj} )

R_1        g    s  1G
R_d01      d    s  500Meg
R_d02     d2    s  500Meg
R_d03     d1    d  1k
R_ssp     g    sp  100Meg

R_met      s    s0 {Rmet}

G_th      0   Tj  VALUE={(I(V_sense)-I(V_sense2))*V(d1,d)+I(V_sm)*V(d,s)+I(V_sense2)*V(d1,s)+Pr(V(s,s0),V(s,sp))}

.ENDS

Run this command to convert the SPICE subcircuit of the IAUC100N04S6L014.cir model to a Simscape component and place the generated files in the newly created directory called +myMOSFET:

Netlist converted. Review Simscape component files and make
manual edits for any unsupported items before building the
Simscape library located at:
+myMOSFET.

Open the Converted MOSFET Model

The iauc100n04s6l014.ssc file stored in the +myMOSFET directory is the converted Simscape component obtained by running the subcircuit2ssc function on the modified SPICE netlist. The subcircuit2ssc function also converted all the functions implemented in the SPICE subcircuit. To edit the generated simscape component, in the MATLAB command window, enter edit +myMOSFET/iauc100n04s6l014.ssc.

The subcircuit2ssc function fully imports this particular subcircuit, with no need for any further manual steps. However, in this example, to review the simulation results more easily, you can access the gate, drain, and source currents. To access the drain, gate, and source currents in simlog, add the corresponding through variables idrain, igate, and isource to a new Simscape componet named MOSFETFromSPICEWrapper.ssc and pass the file as an argument to the ee_convertedMosfetValidation MATLAB function. This file is the component file for the Simscape component block in the model MOSFETFromSPICE. To edit the generated simscape component, in the MATLAB command window, enter edit MOSFETFromSPICEWrapper.ssc.

Verify Simulation Results

The MOSFETFromSPICEResults script calls the ee_convertedMosfetValidation function to generate some standard characteristics such as Id versus Vgs, Id versus Vds, Qiss/ Gate charge, Qoss/ Output charge, and Breakdown voltage.

To plot these characteristics with different settings, double-click the block labeled Define Conditions and define the parameters. In the model, to run the simulations and plot the results, click check results.