diode: add alternative bangap calculation for tlev=2

This commit is contained in:
dwarning 2024-04-30 17:23:20 +02:00
parent 20a04fccdd
commit 342f1c926f
6 changed files with 39 additions and 4 deletions

View File

@ -84,6 +84,8 @@ IFparm DIOmPTable[] = { /* model parameters */
IOP( "tlev", DIO_MOD_TLEV, IF_INTEGER, "Diode temperature equation selector"),
IOP( "tlevc", DIO_MOD_TLEVC, IF_INTEGER, "Diode temperature equation selector"),
IOP( "eg", DIO_MOD_EG, IF_REAL, "Activation energy"),
IOP( "gap1", DIO_MOD_GAP1, IF_REAL, "First bandgap correction factor"),
IOP( "gap2", DIO_MOD_GAP2, IF_REAL, "Second bandgap correction factor"),
IOP( "xti", DIO_MOD_XTI, IF_REAL, "Saturation current temperature exp."),
IOP( "cta", DIO_MOD_CTA, IF_REAL, "Area junction temperature coefficient"),
IOPR( "ctc", DIO_MOD_CTA, IF_REAL, "Area junction capacitance temperature coefficient"),

View File

@ -262,6 +262,8 @@ typedef struct sDIOmodel { /* model structure for a diode */
unsigned DIOtlevGiven : 1;
unsigned DIOtlevcGiven : 1;
unsigned DIOactivationEnergyGiven : 1;
unsigned DIOfirstBGcorrFactorGiven : 1;
unsigned DIOsecndBGcorrFactorGiven : 1;
unsigned DIOsaturationCurrentExpGiven : 1;
unsigned DIOctaGiven : 1;
unsigned DIOctpGiven : 1;
@ -332,6 +334,8 @@ typedef struct sDIOmodel { /* model structure for a diode */
int DIOtlev; /* Diode temperature equation selector */
int DIOtlevc; /* Diode temperature equation selector */
double DIOactivationEnergy; /* activation energy (EG) */
double DIOfirstBGcorrFactor; /* First bandgap correction factor */
double DIOsecndBGcorrFactor; /* Second bandgap correction factor */
double DIOsaturationCurrentExp; /* Saturation current exponential (XTI) */
double DIOcta; /* Area junction temperature coefficient */
double DIOctp; /* Perimeter junction temperature coefficient */
@ -420,6 +424,8 @@ enum {
DIO_MOD_VJ,
DIO_MOD_M,
DIO_MOD_EG,
DIO_MOD_GAP1,
DIO_MOD_GAP2,
DIO_MOD_XTI,
DIO_MOD_FC,
DIO_MOD_BV,

View File

@ -106,6 +106,12 @@ DIOmAsk (CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value)
case DIO_MOD_EG:
value->rValue = model->DIOactivationEnergy;
return (OK);
case DIO_MOD_GAP1:
value->rValue = model->DIOfirstBGcorrFactor;
return (OK);
case DIO_MOD_GAP2:
value->rValue = model->DIOsecndBGcorrFactor;
return (OK);
case DIO_MOD_XTI:
value->rValue = model->DIOsaturationCurrentExp;
return(OK);

View File

@ -133,6 +133,14 @@ DIOmParam(int param, IFvalue *value, GENmodel *inModel)
model->DIOactivationEnergy = value->rValue;
model->DIOactivationEnergyGiven = TRUE;
break;
case DIO_MOD_GAP1:
model->DIOfirstBGcorrFactor = value->rValue;
model->DIOfirstBGcorrFactorGiven = TRUE;
break;
case DIO_MOD_GAP2:
model->DIOsecndBGcorrFactor = value->rValue;
model->DIOsecndBGcorrFactorGiven = TRUE;
break;
case DIO_MOD_XTI:
model->DIOsaturationCurrentExp = value->rValue;
model->DIOsaturationCurrentExpGiven = TRUE;

View File

@ -114,6 +114,12 @@ DIOsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
if(!model->DIOactivationEnergyGiven) {
model->DIOactivationEnergy = 1.11;
}
if(!model->DIOfirstBGcorrFactorGiven) {
model->DIOfirstBGcorrFactor = 7.02e-4;
}
if(!model->DIOsecndBGcorrFactorGiven) {
model->DIOsecndBGcorrFactor = 1108.0;
}
if(!model->DIOsaturationCurrentExpGiven) {
model->DIOsaturationCurrentExp = 3;
}

View File

@ -63,14 +63,21 @@ void DIOtempUpdate(DIOmodel *inModel, DIOinstance *here, double Temp, CKTcircuit
/* this part gets really ugly - I won't even try to
* explain these equations */
if ((model->DIOtlev == 0) || (model->DIOtlev == 1)) {
egfet = 1.16-(7.02e-4*Temp*Temp)/
(Temp+1108);
egfet1 = 1.16 - (7.02e-4*model->DIOnomTemp*model->DIOnomTemp)/
(model->DIOnomTemp+1108);
} else {
egfet = model->DIOactivationEnergy-(model->DIOfirstBGcorrFactor*Temp*Temp)/
(Temp+model->DIOsecndBGcorrFactor);
egfet1 = model->DIOactivationEnergy - (model->DIOfirstBGcorrFactor*model->DIOnomTemp*model->DIOnomTemp)/
(model->DIOnomTemp+model->DIOsecndBGcorrFactor);
}
fact2 = Temp/REFTEMP;
egfet = 1.16-(7.02e-4*Temp*Temp)/
(Temp+1108);
arg = -egfet/(2*CONSTboltz*Temp) +
1.1150877/(CONSTboltz*(REFTEMP+REFTEMP));
pbfact = -2*vt*(1.5*log(fact2)+CHARGE*arg);
egfet1 = 1.16 - (7.02e-4*model->DIOnomTemp*model->DIOnomTemp)/
(model->DIOnomTemp+1108);
arg1 = -egfet1/(CONSTboltz*2*model->DIOnomTemp) +
1.1150877/(2*CONSTboltz*REFTEMP);
fact1 = model->DIOnomTemp/REFTEMP;