Qucs-GUI
0.0.19
|
00001 /*************************************************************************** 00002 bjtsub.cpp 00003 ------------ 00004 begin : Sat Jul 17 2004 00005 copyright : (C) 2004 by Michael Margraf 00006 email : michael.margraf@alumni.tu-berlin.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include "bjtsub.h" 00019 00020 00021 Basic_BJT::Basic_BJT() 00022 { 00023 // this must be the first property in the list !!! 00024 Props.append(new Property("Type", "npn", true, 00025 QObject::tr("polarity")+" [npn, pnp]")); 00026 Props.append(new Property("Is", "1e-16", true, 00027 QObject::tr("saturation current"))); 00028 Props.append(new Property("Nf", "1", true, 00029 QObject::tr("forward emission coefficient"))); 00030 Props.append(new Property("Nr", "1", false, 00031 QObject::tr("reverse emission coefficient"))); 00032 Props.append(new Property("Ikf", "0", false, 00033 QObject::tr("high current corner for forward beta"))); 00034 Props.append(new Property("Ikr", "0", false, 00035 QObject::tr("high current corner for reverse beta"))); 00036 Props.append(new Property("Vaf", "0", true, 00037 QObject::tr("forward early voltage"))); 00038 Props.append(new Property("Var", "0", false, 00039 QObject::tr("reverse early voltage"))); 00040 Props.append(new Property("Ise", "0", false, 00041 QObject::tr("base-emitter leakage saturation current"))); 00042 Props.append(new Property("Ne", "1.5", false, 00043 QObject::tr("base-emitter leakage emission coefficient"))); 00044 Props.append(new Property("Isc", "0", false, 00045 QObject::tr("base-collector leakage saturation current"))); 00046 Props.append(new Property("Nc", "2", false, 00047 QObject::tr("base-collector leakage emission coefficient"))); 00048 Props.append(new Property("Bf", "100", true, 00049 QObject::tr("forward beta"))); 00050 Props.append(new Property("Br", "1", false, 00051 QObject::tr("reverse beta"))); 00052 Props.append(new Property("Rbm", "0", false, 00053 QObject::tr("minimum base resistance for high currents"))); 00054 Props.append(new Property("Irb", "0", false, 00055 QObject::tr("current for base resistance midpoint"))); 00056 Props.append(new Property("Rc", "0", false, 00057 QObject::tr("collector ohmic resistance"))); 00058 Props.append(new Property("Re", "0", false, 00059 QObject::tr("emitter ohmic resistance"))); 00060 Props.append(new Property("Rb", "0", false, 00061 QObject::tr("zero-bias base resistance (may be high-current dependent)"))); 00062 Props.append(new Property("Cje", "0", false, 00063 QObject::tr("base-emitter zero-bias depletion capacitance"))); 00064 Props.append(new Property("Vje", "0.75", false, 00065 QObject::tr("base-emitter junction built-in potential"))); 00066 Props.append(new Property("Mje", "0.33", false, 00067 QObject::tr("base-emitter junction exponential factor"))); 00068 Props.append(new Property("Cjc", "0", false, 00069 QObject::tr("base-collector zero-bias depletion capacitance"))); 00070 Props.append(new Property("Vjc", "0.75", false, 00071 QObject::tr("base-collector junction built-in potential"))); 00072 Props.append(new Property("Mjc", "0.33", false, 00073 QObject::tr("base-collector junction exponential factor"))); 00074 Props.append(new Property("Xcjc", "1.0", false, 00075 QObject::tr("fraction of Cjc that goes to internal base pin"))); 00076 Props.append(new Property("Cjs", "0", false, 00077 QObject::tr("zero-bias collector-substrate capacitance"))); 00078 Props.append(new Property("Vjs", "0.75", false, 00079 QObject::tr("substrate junction built-in potential"))); 00080 Props.append(new Property("Mjs", "0", false, 00081 QObject::tr("substrate junction exponential factor"))); 00082 Props.append(new Property("Fc", "0.5", false, 00083 QObject::tr("forward-bias depletion capacitance coefficient"))); 00084 Props.append(new Property("Tf", "0.0", false, 00085 QObject::tr("ideal forward transit time"))); 00086 Props.append(new Property("Xtf", "0.0", false, 00087 QObject::tr("coefficient of bias-dependence for Tf"))); 00088 Props.append(new Property("Vtf", "0.0", false, 00089 QObject::tr("voltage dependence of Tf on base-collector voltage"))); 00090 Props.append(new Property("Itf", "0.0", false, 00091 QObject::tr("high-current effect on Tf"))); 00092 Props.append(new Property("Tr", "0.0", false, 00093 QObject::tr("ideal reverse transit time"))); 00094 Props.append(new Property("Temp", "26.85", false, 00095 QObject::tr("simulation temperature in degree Celsius"))); 00096 Props.append(new Property("Kf", "0.0", false, 00097 QObject::tr("flicker noise coefficient"))); 00098 Props.append(new Property("Af", "1.0", false, 00099 QObject::tr("flicker noise exponent"))); 00100 Props.append(new Property("Ffe", "1.0", false, 00101 QObject::tr("flicker noise frequency exponent"))); 00102 Props.append(new Property("Kb", "0.0", false, 00103 QObject::tr("burst noise coefficient"))); 00104 Props.append(new Property("Ab", "1.0", false, 00105 QObject::tr("burst noise exponent"))); 00106 Props.append(new Property("Fb", "1.0", false, 00107 QObject::tr("burst noise corner frequency in Hertz"))); 00108 Props.append(new Property("Ptf", "0.0", false, 00109 QObject::tr("excess phase in degrees"))); 00110 Props.append(new Property("Xtb", "0.0", false, 00111 QObject::tr("temperature exponent for forward- and reverse beta"))); 00112 Props.append(new Property("Xti", "3.0", false, 00113 QObject::tr("saturation current temperature exponent"))); 00114 Props.append(new Property("Eg", "1.11", false, 00115 QObject::tr("energy bandgap in eV"))); 00116 Props.append(new Property("Tnom", "26.85", false, 00117 QObject::tr("temperature at which parameters were extracted"))); 00118 Props.append(new Property("Area", "1.0", false, 00119 QObject::tr("default area for bipolar transistor"))); 00120 00121 Name = "T"; 00122 } 00123 00124 BJTsub::BJTsub() 00125 { 00126 Description = QObject::tr("bipolar junction transistor with substrate"); 00127 createSymbol(); 00128 tx = x2+4; 00129 ty = y1+4; 00130 Model = "BJT"; 00131 } 00132 00133 // ------------------------------------------------------- 00134 Component* BJTsub::newOne() 00135 { 00136 BJTsub* p = new BJTsub(); 00137 p->Props.getFirst()->Value = Props.getFirst()->Value; 00138 p->recreate(0); 00139 return p; 00140 } 00141 00142 // ------------------------------------------------------- 00143 Element* BJTsub::info(QString& Name, char* &BitmapFile, bool getNewOne) 00144 { 00145 Name = QObject::tr("npn transistor"); 00146 BitmapFile = (char *) "npnsub"; 00147 00148 if(getNewOne) return new BJTsub(); 00149 return 0; 00150 } 00151 00152 // ------------------------------------------------------- 00153 Element* BJTsub::info_pnp(QString& Name, char* &BitmapFile, bool getNewOne) 00154 { 00155 Name = QObject::tr("pnp transistor"); 00156 BitmapFile = (char *) "pnpsub"; 00157 00158 if(getNewOne) { 00159 BJTsub* p = new BJTsub(); 00160 p->Props.getFirst()->Value = "pnp"; 00161 p->recreate(0); 00162 return p; 00163 } 00164 return 0; 00165 } 00166 00167 // ------------------------------------------------------- 00168 void BJTsub::createSymbol() 00169 { 00170 Lines.append(new Line(-10,-15,-10, 15,QPen(Qt::darkBlue,3))); 00171 Lines.append(new Line(-30, 0,-10, 0,QPen(Qt::darkBlue,2))); 00172 Lines.append(new Line(-10, -5, 0,-15,QPen(Qt::darkBlue,2))); 00173 Lines.append(new Line( 0,-15, 0,-30,QPen(Qt::darkBlue,2))); 00174 Lines.append(new Line(-10, 5, 0, 15,QPen(Qt::darkBlue,2))); 00175 Lines.append(new Line( 0, 15, 0, 30,QPen(Qt::darkBlue,2))); 00176 00177 Lines.append(new Line( 9, 0, 30, 0,QPen(Qt::darkBlue,2))); 00178 Lines.append(new Line( 9, -7, 9, 7,QPen(Qt::darkBlue,3))); 00179 00180 if(Props.getFirst()->Value == "npn") { 00181 Lines.append(new Line( -6, 15, 0, 15,QPen(Qt::darkBlue,2))); 00182 Lines.append(new Line( 0, 9, 0, 15,QPen(Qt::darkBlue,2))); 00183 } 00184 else { 00185 Lines.append(new Line( -5, 10, -5, 16,QPen(Qt::darkBlue,2))); 00186 Lines.append(new Line( -5, 10, 1, 10,QPen(Qt::darkBlue,2))); 00187 } 00188 00189 Ports.append(new Port(-30, 0)); 00190 Ports.append(new Port( 0,-30)); 00191 Ports.append(new Port( 0, 30)); 00192 Ports.append(new Port( 30, 0)); 00193 00194 x1 = -30; y1 = -30; 00195 x2 = 30; y2 = 30; 00196 }