netlist: Added B-E and B-C capacitance to EB model. [Couriersud]

Despite the overhead - two devices more per transistor - this addition
significantly reduces computing time on switching conditions by reducing
the needed Newton-Raphson loops dramatically.
This commit is contained in:
couriersud 2019-03-17 23:41:57 +01:00
parent e125b756e7
commit 46762510c9
4 changed files with 55 additions and 16 deletions

View File

@ -76,7 +76,7 @@ NETLIST_START(PUT_2N6027)
* FIXME: Needs to be removed when added to the
* transistor EB model.
*/
#if 1
#if 0
CAP(CJE1, CAP_N(1))
CAP(CJE2, CAP_N(1))

View File

@ -73,7 +73,7 @@ private:
* | | RBM | minimum base resistance at high currents | | RB | 10 | * |
* | | RE | emitter resistance | | 0 | 1 | * |
* | | RC | collector resistance | | 0 | 10 | * |
* | | CJE | B-E zero-bias depletion capacitance | F | 0 | 2pF | * |
* | Y | CJE | B-E zero-bias depletion capacitance | F | 0 | 2pF | * |
* | | VJE | B-E built-in potential | V | 0.75 | 0.6 | |
* | | MJE | B-E junction exponential factor | - | 0.33 | 0.33 | |
* | | TF | ideal forward transit time | sec | 0 | 0.1ns | |
@ -81,7 +81,7 @@ private:
* | | VTF | voltage describing VBC dependence of TF | V | infinite | | |
* | | ITF | high-current parameter for effect on TF | A | 0 | | * |
* | | PTF | excess phase at freq=1.0/(TF*2PI) Hz | deg | 0 | | |
* | | CJC | B-C zero-bias depletion capacitance | F | 0 | 2pF | * |
* | Y | CJC | B-C zero-bias depletion capacitance | F | 0 | 2pF | * |
* | | VJC | B-C built-in potential | V | 0.75 | 0.5 | |
* | | MJC | B-C junction exponential factor | - | 0.33 | 0.5 | |
* | | XCJC | fraction of B-C depletion capacitance connected to internal base node | - | 1 | | |
@ -95,25 +95,31 @@ private:
* | | KF | flicker-noise coefficient | - | 0 | | |
* | | AF | flicker-noise exponent | - | 1 | | |
* | | FC | coefficient for forward-bias depletion capacitance formula | - | 0.5 | | |
* | | TNOM | Parameter measurement temperature | C | 27 | 50 | | */
* | | TNOM | Parameter measurement temperature | C | 27 | 50 | |
* */
class bjt_model_t : public param_model_t
{
public:
bjt_model_t(device_t &device, const pstring &name, const pstring &val)
: param_model_t(device, name, val)
, m_IS(*this, "IS")
, m_BF(*this, "BF")
, m_NF(*this, "NF")
, m_BR(*this, "BR")
, m_NR(*this, "NR")
, m_IS (*this, "IS")
, m_BF (*this, "BF")
, m_NF (*this, "NF")
, m_BR (*this, "BR")
, m_NR (*this, "NR")
, m_CJE(*this, "CJE")
, m_CJC(*this, "CJC")
{}
value_t m_IS; //!< transport saturation current
value_t m_BF; //!< ideal maximum forward beta
value_t m_NF; //!< forward current emission coefficient
value_t m_BR; //!< ideal maximum reverse beta
value_t m_NR; //!< reverse current emission coefficient
value_t m_IS; //!< transport saturation current
value_t m_BF; //!< ideal maximum forward beta
value_t m_NF; //!< forward current emission coefficient
value_t m_BR; //!< ideal maximum reverse beta
value_t m_NR; //!< reverse current emission coefficient
value_t m_CJE; //!< B-E zero-bias depletion capacitance
value_t m_CJC; //!< B-C zero-bias depletion capacitance
};
// Have a common start for transistors
@ -250,6 +256,19 @@ public:
connect(m_D_EB.m_P, m_D_EC.m_P);
connect(m_D_EB.m_N, m_D_CB.m_N);
connect(m_D_CB.m_P, m_D_EC.m_N);
if (m_model.m_CJE > 0.0)
{
register_sub("m_CJE", m_CJE);
connect("B", "m_CJE.1");
connect("E", "m_CJE.2");
}
if (m_model.m_CJC > 0.0)
{
register_sub("m_CJC", m_CJC);
connect("B", "m_CJC.1");
connect("C", "m_CJC.2");
}
}
protected:
@ -270,6 +289,9 @@ private:
nl_double m_alpha_f;
nl_double m_alpha_r;
NETLIB_SUBXX(analog, C) m_CJE;
NETLIB_SUBXX(analog, C) m_CJC;
};
@ -376,6 +398,17 @@ NETLIB_UPDATE(QBJT_EB)
NETLIB_RESET(QBJT_EB)
{
NETLIB_NAME(Q)::reset();
if (m_CJE)
{
m_CJE->reset();
m_CJE->m_C.setTo(m_model.m_CJE);
}
if (m_CJC)
{
m_CJC->reset();
m_CJC->m_C.setTo(m_model.m_CJC);
}
}
NETLIB_UPDATE_TERMINALS(QBJT_EB)

View File

@ -32,8 +32,8 @@ NETLIST_END()
* ---------------------------------------------------------------------------*/
static NETLIST_START(bjt_models)
NET_MODEL("NPN _(IS=1e-15 BF=100 NF=1 BR=1 NR=1)")
NET_MODEL("PNP _(IS=1e-15 BF=100 NF=1 BR=1 NR=1)")
NET_MODEL("NPN _(IS=1e-15 BF=100 NF=1 BR=1 NR=1 CJE=0 CJC=0)")
NET_MODEL("PNP _(IS=1e-15 BF=100 NF=1 BR=1 NR=1 CJE=0 CJC=0)")
NET_MODEL("2SA1015 PNP(Is=295.1E-18 Xti=3 Eg=1.11 Vaf=100 Bf=110 Xtb=1.5 Br=10.45 Rc=15 Cjc=66.2p Mjc=1.054 Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n Tf=1.661n VCEO=45V ICrating=150M MFG=Toshiba)")
NET_MODEL("2SC1815 NPN(Is=2.04f Xti=3 Eg=1.11 Vaf=6 Bf=400 Ikf=20m Xtb=1.5 Br=3.377 Rc=1 Cjc=1p Mjc=.3333 Vjc=.75 Fc=.5 Cje=25p Mje=.3333 Vje=.75 Tr=450n Tf=20n Itf=0 Vtf=0 Xtf=0 VCEO=45V ICrating=150M MFG=Toshiba)")

View File

@ -147,6 +147,12 @@ namespace plib {
m_is_owned = false;
m_ptr = nullptr;
}
/**
* \brief Return @c true if the stored pointer is not null.
*/
explicit operator bool() const noexcept { return m_ptr != nullptr; }
pointer release()
{
pointer tmp = m_ptr;