*****************************************************************************
* EPC Space GaN Power Device Library
* (C) Copyright EPC Space, LLC. All rights reserved.
* ***************************************************************************
* Version History:
*        Initial:            EPC7007B LTSPICE Model -- 07/08/24
**********************************
*****************************************************************************
.subckt EPC7007B drain gate source sourcesense
XU1 drain gate sourcesense EPC7007
R2 sourcesense P001 2.0000e-03
L1 P001 source 1.0000e-20
.ends epc7007B

.subckt EPC7007 drainin gatein sourcein 
.param aWG      = 539.0
+A1             = {7.0819e-02*aWg}
+Voff           = 2.3106e+00
+rpara          = 1.9103e-02
+Vdsat          = 3.5404e-01
+ua             = 2.0713e-7
+Vgshape        = 5.5426e+00
+k3             = 9.0000e-02
+rpara_s_factor = 1.0057e-01
+A1_TC          = 2.6671e-03
+Voff_TC        = 6.3105e-04
+rpara_TC       = -7.7458e-03
+Vdsat_TC       = 1.0000e-03
+Vgshape_TC     = 1.0000e-03
+pack_indd      = 1.0000e-9
+pack_inds      = 1.0000e-9
+pack_indg      = 1.0000e-9
+pack_rd        = 1.2500e-03
+pack_rs        = 2.000e-03
+pack_rg        = 0.0000e+00
+cgs0           = {8.8392e-13*aWg}
+cgs_a          = {1.0421e-12*aWg}
+cgs_av         = 1.8631e+00
+cgs_aw         = 2.1269e-01
+cgs_b          = 0.0000e+00
+cgs_bv         = 7.4800e+01
+cgs_bw         = 1.0550e+01
+cgd0           = {2.4553e-15*aWg}
+cgd_a          = {1.0295e-13*aWg}
+cgd_av         = -1.0066e+01
+cgd_aw         = 4.3140e+00
+cgd_b          = {1.7640e-14*aWg}
+cgd_bv         = -2.9175e+01
+cgd_bw         = 1.5290e+01
+cgd_c          = 0.0000e+00
+cgd_cv         = -3.2480e-02
+cgd_cw         = 8.9000e-01
+csd0           = {3.8132e-13*aWg}
+csd_a          = {3.4182e-13*aWg}
+csd_av         = -1.6850e+01
+csd_aw         = 1.3545e+00
+csd_b          = {5.2768e-13*aWg}
+csd_bv         = -3.0140e+01
+csd_bw         = 4.7388e+01
+csd_c          = 1.6250e-13
+csd_cv         = -2.3333e+01
+csd_cw         = 1.9916e+00
+rg_value       = 0.4
+dgs1           = 4.300e-07
+dgs2           = 2.600e-13
+dgs3           = 8.0000e-01
+dgs4           = 2.3000e-01





*Define commonly used functions
.func Voff_T(Temp)={Voff*(1-Voff_TC*(Temp-25))}
.func Vdsat_T(Temp)={smthpos(Vdsat*(1+Vdsat_TC*(Temp-25)),0.1)}
.func f_cust(Vab,loc,wid)={wid*log(1+exp((Vab-loc)/wid))}
.func smthpos(y,d)={0.5*(sqrt(y*y + d*d) + y)}

rd drainin dmid {(pack_rd+((1-rpara_s_factor)*rpara))*(1-rpara_TC*(Temp-25))}
rs sourcein source {(rpara_s_factor*rpara*(1-rpara_TC*(Temp-25)))}
rg gatein gmid {pack_rg+rg_value}

Ld dmid drain {pack_indd} rser = 0
Lg gmid gate {pack_indg} rser = 0

Rcsdconv drain source {100000Meg/aWg}
Rcgsconv gate source {100000Meg/aWg}
Rcgdconv gate drain {100000Meg/aWg}


bswitch drain source I=if(v(drain,source)>0,
+   (A1*(1-A1_TC*(Temp-25))*
+   f_cust(v(gate,source),Voff_T(Temp),k3)* 
+   v(drain,source)/
+   (v(drain,source)+
+   Vdsat_T(Temp)*
+   smthpos((1 - (v(gate,source)-Voff_T(Temp))/
+   (Vgshape*(1+Vgshape_TC*(Temp-25)))),0.1))*
+   1.0/(1.0 + ua*smthpos((v(gate,source)-Voff_T(Temp)),0.1))),
+   (-A1*(1-A1_TC*(Temp-25))*
+   f_cust(v(gate,drain),Voff_T(Temp),k3)* 
+   v(source,drain)/
+   (v(source,drain)+
+   Vdsat_T(Temp)*
+   smthpos((1 - (v(gate,drain)-Voff_T(Temp))/
+   (Vgshape*(1+Vgshape_TC*(Temp-25)))),0.1))*
+   1.0/(1.0 + ua*smthpos((v(gate,drain)-Voff_T(Temp)),0.1)))
+   )

bgsdiode gate source I=if( v(gate,source)>10,
+   (0.125*aWg/1077*(dgs1*(exp((10.0)/dgs3)-1)+dgs2*(exp((10.0)/dgs4)-1))),
+   (0.125*aWg/1077*(dgs1*(exp((v(gate,source))/dgs3)-1)+dgs2*(exp((v(gate,source))/dgs4)-1))))

bgddiode gate drain I=if( v(gate,drain)>10,
+   (0.125*aWg/1077*(dgs1*(exp((10.0)/dgs3)-1)+dgs2*(exp((10.0)/dgs4)-1))),
+   (0.125*aWg/1077*(dgs1*(exp((v(gate,drain))/dgs3)-1)+dgs2*(exp((v(gate,drain))/dgs4)-1))) )

C_GS       	gate source {cgs0}
C_CGS1    	gate source Q=(0.5*cgs_a*cgs_aw*log(1+exp((v(gate,source)-cgs_av)/cgs_aw))+
+           cgs_b*cgs_bw*log(1+exp((v(source,drain)-cgs_bv)/cgs_bw)) )

C_GD      	gate drain {cgd0}
C_CGD1    	gate drain Q=(0.5*cgs_a*cgs_aw*log(1+exp((v(gate,drain)-cgs_av)/cgs_aw))+
+           cgd_a*cgd_aw*log(1+exp((v(gate,drain)-cgd_av)/cgd_aw))+
+           cgd_b*cgd_bw*log(1+exp((v(gate,drain)-cgd_bv)/cgd_bw))+ 
+           cgd_c*cgd_cw*log(1+exp((v(gate,drain)-cgd_cv)/cgd_cw)))

C_SD       	source drain {csd0}
C_CSD1	    source drain Q=(csd_a*csd_aw*log(1+exp((v(source,drain)-csd_av)/csd_aw))+
+           csd_b*csd_bw*log(1+exp((v(source,drain)-csd_bv)/csd_bw))+
+           csd_c*csd_cw*log(1+exp((v(source,drain)-csd_cv)/csd_cw)))

.ends
