My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bjtsub.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  bjtsub.cpp
3  ------------
4  begin : Sat Jul 17 2004
5  copyright : (C) 2004 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "bjtsub.h"
19 
20 
22 {
23  // this must be the first property in the list !!!
24  Props.append(new Property("Type", "npn", true,
25  QObject::tr("polarity")+" [npn, pnp]"));
26  Props.append(new Property("Is", "1e-16", true,
27  QObject::tr("saturation current")));
28  Props.append(new Property("Nf", "1", true,
29  QObject::tr("forward emission coefficient")));
30  Props.append(new Property("Nr", "1", false,
31  QObject::tr("reverse emission coefficient")));
32  Props.append(new Property("Ikf", "0", false,
33  QObject::tr("high current corner for forward beta")));
34  Props.append(new Property("Ikr", "0", false,
35  QObject::tr("high current corner for reverse beta")));
36  Props.append(new Property("Vaf", "0", true,
37  QObject::tr("forward early voltage")));
38  Props.append(new Property("Var", "0", false,
39  QObject::tr("reverse early voltage")));
40  Props.append(new Property("Ise", "0", false,
41  QObject::tr("base-emitter leakage saturation current")));
42  Props.append(new Property("Ne", "1.5", false,
43  QObject::tr("base-emitter leakage emission coefficient")));
44  Props.append(new Property("Isc", "0", false,
45  QObject::tr("base-collector leakage saturation current")));
46  Props.append(new Property("Nc", "2", false,
47  QObject::tr("base-collector leakage emission coefficient")));
48  Props.append(new Property("Bf", "100", true,
49  QObject::tr("forward beta")));
50  Props.append(new Property("Br", "1", false,
51  QObject::tr("reverse beta")));
52  Props.append(new Property("Rbm", "0", false,
53  QObject::tr("minimum base resistance for high currents")));
54  Props.append(new Property("Irb", "0", false,
55  QObject::tr("current for base resistance midpoint")));
56  Props.append(new Property("Rc", "0", false,
57  QObject::tr("collector ohmic resistance")));
58  Props.append(new Property("Re", "0", false,
59  QObject::tr("emitter ohmic resistance")));
60  Props.append(new Property("Rb", "0", false,
61  QObject::tr("zero-bias base resistance (may be high-current dependent)")));
62  Props.append(new Property("Cje", "0", false,
63  QObject::tr("base-emitter zero-bias depletion capacitance")));
64  Props.append(new Property("Vje", "0.75", false,
65  QObject::tr("base-emitter junction built-in potential")));
66  Props.append(new Property("Mje", "0.33", false,
67  QObject::tr("base-emitter junction exponential factor")));
68  Props.append(new Property("Cjc", "0", false,
69  QObject::tr("base-collector zero-bias depletion capacitance")));
70  Props.append(new Property("Vjc", "0.75", false,
71  QObject::tr("base-collector junction built-in potential")));
72  Props.append(new Property("Mjc", "0.33", false,
73  QObject::tr("base-collector junction exponential factor")));
74  Props.append(new Property("Xcjc", "1.0", false,
75  QObject::tr("fraction of Cjc that goes to internal base pin")));
76  Props.append(new Property("Cjs", "0", false,
77  QObject::tr("zero-bias collector-substrate capacitance")));
78  Props.append(new Property("Vjs", "0.75", false,
79  QObject::tr("substrate junction built-in potential")));
80  Props.append(new Property("Mjs", "0", false,
81  QObject::tr("substrate junction exponential factor")));
82  Props.append(new Property("Fc", "0.5", false,
83  QObject::tr("forward-bias depletion capacitance coefficient")));
84  Props.append(new Property("Tf", "0.0", false,
85  QObject::tr("ideal forward transit time")));
86  Props.append(new Property("Xtf", "0.0", false,
87  QObject::tr("coefficient of bias-dependence for Tf")));
88  Props.append(new Property("Vtf", "0.0", false,
89  QObject::tr("voltage dependence of Tf on base-collector voltage")));
90  Props.append(new Property("Itf", "0.0", false,
91  QObject::tr("high-current effect on Tf")));
92  Props.append(new Property("Tr", "0.0", false,
93  QObject::tr("ideal reverse transit time")));
94  Props.append(new Property("Temp", "26.85", false,
95  QObject::tr("simulation temperature in degree Celsius")));
96  Props.append(new Property("Kf", "0.0", false,
97  QObject::tr("flicker noise coefficient")));
98  Props.append(new Property("Af", "1.0", false,
99  QObject::tr("flicker noise exponent")));
100  Props.append(new Property("Ffe", "1.0", false,
101  QObject::tr("flicker noise frequency exponent")));
102  Props.append(new Property("Kb", "0.0", false,
103  QObject::tr("burst noise coefficient")));
104  Props.append(new Property("Ab", "1.0", false,
105  QObject::tr("burst noise exponent")));
106  Props.append(new Property("Fb", "1.0", false,
107  QObject::tr("burst noise corner frequency in Hertz")));
108  Props.append(new Property("Ptf", "0.0", false,
109  QObject::tr("excess phase in degrees")));
110  Props.append(new Property("Xtb", "0.0", false,
111  QObject::tr("temperature exponent for forward- and reverse beta")));
112  Props.append(new Property("Xti", "3.0", false,
113  QObject::tr("saturation current temperature exponent")));
114  Props.append(new Property("Eg", "1.11", false,
115  QObject::tr("energy bandgap in eV")));
116  Props.append(new Property("Tnom", "26.85", false,
117  QObject::tr("temperature at which parameters were extracted")));
118  Props.append(new Property("Area", "1.0", false,
119  QObject::tr("default area for bipolar transistor")));
120 
121  Name = "T";
122 }
123 
125 {
126  Description = QObject::tr("bipolar junction transistor with substrate");
127  createSymbol();
128  tx = x2+4;
129  ty = y1+4;
130  Model = "BJT";
131 }
132 
133 // -------------------------------------------------------
135 {
136  BJTsub* p = new BJTsub();
137  p->Props.getFirst()->Value = Props.getFirst()->Value;
138  p->recreate(0);
139  return p;
140 }
141 
142 // -------------------------------------------------------
143 Element* BJTsub::info(QString& Name, char* &BitmapFile, bool getNewOne)
144 {
145  Name = QObject::tr("npn transistor");
146  BitmapFile = (char *) "npnsub";
147 
148  if(getNewOne) return new BJTsub();
149  return 0;
150 }
151 
152 // -------------------------------------------------------
153 Element* BJTsub::info_pnp(QString& Name, char* &BitmapFile, bool getNewOne)
154 {
155  Name = QObject::tr("pnp transistor");
156  BitmapFile = (char *) "pnpsub";
157 
158  if(getNewOne) {
159  BJTsub* p = new BJTsub();
160  p->Props.getFirst()->Value = "pnp";
161  p->recreate(0);
162  return p;
163  }
164  return 0;
165 }
166 
167 // -------------------------------------------------------
169 {
170  Lines.append(new Line(-10,-15,-10, 15,QPen(QPen::darkBlue,3)));
171  Lines.append(new Line(-30, 0,-10, 0,QPen(QPen::darkBlue,2)));
172  Lines.append(new Line(-10, -5, 0,-15,QPen(QPen::darkBlue,2)));
173  Lines.append(new Line( 0,-15, 0,-30,QPen(QPen::darkBlue,2)));
174  Lines.append(new Line(-10, 5, 0, 15,QPen(QPen::darkBlue,2)));
175  Lines.append(new Line( 0, 15, 0, 30,QPen(QPen::darkBlue,2)));
176 
177  Lines.append(new Line( 9, 0, 30, 0,QPen(QPen::darkBlue,2)));
178  Lines.append(new Line( 9, -7, 9, 7,QPen(QPen::darkBlue,3)));
179 
180  if(Props.getFirst()->Value == "npn") {
181  Lines.append(new Line( -6, 15, 0, 15,QPen(QPen::darkBlue,2)));
182  Lines.append(new Line( 0, 9, 0, 15,QPen(QPen::darkBlue,2)));
183  }
184  else {
185  Lines.append(new Line( -5, 10, -5, 16,QPen(QPen::darkBlue,2)));
186  Lines.append(new Line( -5, 10, 1, 10,QPen(QPen::darkBlue,2)));
187  }
188 
189  Ports.append(new Port(-30, 0));
190  Ports.append(new Port( 0,-30));
191  Ports.append(new Port( 0, 30));
192  Ports.append(new Port( 30, 0));
193 
194  x1 = -30; y1 = -30;
195  x2 = 30; y2 = 30;
196 }