mirror of
https://github.com/ra3xdh/qucs_s
synced 2025-03-28 21:13:26 +00:00
Added new XSPICE Code Model library called AnalogueCM plus Tunnel Diode example.
This commit is contained in:
parent
7cc025773d
commit
c92ba82100
@ -826,6 +826,7 @@ AC_CONFIG_FILES([Makefile
|
||||
qucs-transcalc/examples/Makefile
|
||||
qucs-lib/Makefile
|
||||
qucs-lib/library/Makefile
|
||||
qucs-lib/library/AnalogueCM/Makefile
|
||||
qucs-attenuator/Makefile
|
||||
qucs-rescodes/Makefile
|
||||
qucs/Makefile
|
||||
|
66
qucs-lib/library/AnalogueCM.lib
Normal file
66
qucs-lib/library/AnalogueCM.lib
Normal file
@ -0,0 +1,66 @@
|
||||
<Qucs Library 0.0.19 "AnalogueCM">
|
||||
|
||||
<Component Esakitd>
|
||||
<Description>
|
||||
Esaki tunnel diode model:
|
||||
|
||||
4 April 2016 Mike Brinson mbrin72043@yahoo.co.uk
|
||||
|
||||
Parameters; Description; Default value
|
||||
is; Saturation current (A); 1e-12
|
||||
ip; Peak current (A); 5e-3
|
||||
iv; Valley current (A); 370e-6
|
||||
vp; Peak voltage (V); 50e-3
|
||||
vv; Valley current (V); 0.37
|
||||
a2; Excess current exponential factor (1/V); 5
|
||||
ctd; Diode capacitance at zero volts bias (F); 0.5e-12
|
||||
temp; Diode temperature (Celsius); 26.58
|
||||
|
||||
Test examples: (1) Test_EsakiTD_DC.sch, (2) TD_oscillator.sch
|
||||
|
||||
References
|
||||
[1] S.M. Sze and Kwok K. Ng,"Physics of semiconductor devices,
|
||||
Third Edition, 2007, John Wiley & Sons, New York, ISBN-13: 978-0-471,
|
||||
ISBN-10: 0-471-1423-5.
|
||||
[2] Messaadi Lotfi and Dibi Zohir, "A SPICE behavioural model of
|
||||
tunnel diode: simulation and application" International Conference
|
||||
on Automation, Control Engineering and Computer Science (ACECS'14),
|
||||
Proceedings - IPCO-2014, pp 186-191, ISSN 2356-5608.
|
||||
[3] M. Nikhil, S. Bowyer, J. Huckaby and M.B Steer, "Modelling of an
|
||||
Esaki tunnel diode in a circuit simulator", Active and Passive
|
||||
Electronic Components, Vol. 2011, Article ID 830182, 8 pages,
|
||||
doi:10.1155/2011/830182.
|
||||
</Description>
|
||||
|
||||
<Spice>
|
||||
.SUBCKT AnalogueCM_Esakitd gnd A C is=1e-12 ip=5e-3
|
||||
+ iv=370e-6 vp=0.05 vv=0.37 a2=5 ctd=0.5e-12 temp=26.85
|
||||
C1 A C {ctd}
|
||||
A1 %gd(A C) modtd
|
||||
Rp C A 1e9
|
||||
.MODEL modtd etd ( is ={is} ip = {ip}
|
||||
+ iv = {iv} vp = {vp} vv = {vv} a2 = {a2} temp= {temp} )
|
||||
.ENDS
|
||||
</Spice>
|
||||
<SpiceAttach "etd.mod" "etd.ifs">
|
||||
<Model>
|
||||
.Def: AnalogueCM_Esakitd _net0 _net1
|
||||
.DefEnd
|
||||
</Model>
|
||||
<Symbol>
|
||||
<Line -20 -20 0 40 #000080 2 1>
|
||||
<Line -60 0 40 0 #000080 2 1>
|
||||
<Line -20 20 30 -20 #000080 2 1>
|
||||
<Line -20 -20 30 20 #000080 2 1>
|
||||
<Line 10 0 30 0 #000080 2 1>
|
||||
<Line 10 -20 0 40 #00007f 4 1>
|
||||
<Line 0 -20 10 0 #00007f 4 1>
|
||||
<Line 0 20 10 0 #00007f 4 1>
|
||||
<.ID -40 54 Esakitd "1=is=1e-12==" "1=ip=5e-3==" "1=iv=370e-6==" "1=vp=0.05==" "1=vv=0.37==" "1=a2=5==" "1=ctd=0.5e-12==" "1=temp=26.85==">
|
||||
<Ellipse -35 -30 60 60 #ff00ff 3 1 #c0c0c0 1 0>
|
||||
<.PortSym 40 0 2 180>
|
||||
<.PortSym -60 0 1 0>
|
||||
<Text -30 -60 12 #ff00ff 0 "XSPICE">
|
||||
</Symbol>
|
||||
</Component>
|
||||
|
35
qucs-lib/library/AnalogueCM/Makefile.am
Normal file
35
qucs-lib/library/AnalogueCM/Makefile.am
Normal file
@ -0,0 +1,35 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
#
|
||||
# qucs-lib/library/AnalogueCM/Makefile.am
|
||||
#
|
||||
# Automake input file.
|
||||
#
|
||||
# Copyright (C) 2016 Mike Brinson mbrin72043@yahoo.co.uk
|
||||
#
|
||||
# This is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This software is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this package; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
|
||||
|
||||
CMLIBS = etd.mod etd.ifs
|
||||
|
||||
EXTRA_DIST = $(CMLIBS)
|
||||
|
||||
# installation of component libraries
|
||||
librarydir = ${prefix}/share/qucs/library/AnalogueCM
|
||||
library_DATA = $(CMLIBS)
|
||||
|
||||
CLEANFILES = *~
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
97
qucs-lib/library/AnalogueCM/etd.ifs
Normal file
97
qucs-lib/library/AnalogueCM/etd.ifs
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
etd cm model.
|
||||
|
||||
2 April 2016 Mike Brinson
|
||||
|
||||
This is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
*/
|
||||
|
||||
NAME_TABLE:
|
||||
C_Function_Name: cm_etd
|
||||
Spice_Model_Name: etd
|
||||
Description: "A non-linear tunnel diode model."
|
||||
|
||||
|
||||
PORT_TABLE:
|
||||
Port_Name: ntd
|
||||
Description: "Tunnel diode terminals"
|
||||
Direction: inout
|
||||
Default_Type: gd
|
||||
Allowed_Types: [gd]
|
||||
Vector: no
|
||||
Vector_Bounds: -
|
||||
Null_Allowed: no
|
||||
|
||||
PARAMETER_TABLE:
|
||||
Parameter_Name: vp
|
||||
Description: "Peak voltage in volts."
|
||||
Data_Type: real
|
||||
Default_Value: 0.1
|
||||
Limits: -
|
||||
Vector: no
|
||||
Vector_Bounds: -
|
||||
Null_Allowed: no
|
||||
|
||||
|
||||
PARAMETER_TABLE:
|
||||
Parameter_Name: ip
|
||||
Description: "Peak current in amps."
|
||||
Data_Type: real
|
||||
Default_Value: 1e-5
|
||||
Limits: -
|
||||
Vector: no
|
||||
Vector_Bounds: -
|
||||
Null_Allowed: no
|
||||
|
||||
PARAMETER_TABLE:
|
||||
Parameter_Name: vv
|
||||
Description: "Valley voltage in volts."
|
||||
Data_Type: real
|
||||
Default_Value: 0.4
|
||||
Limits: -
|
||||
Vector: no
|
||||
Vector_Bounds: -
|
||||
Null_Allowed: no
|
||||
|
||||
PARAMETER_TABLE:
|
||||
Parameter_Name: iv
|
||||
Description: "Valley current in amps."
|
||||
Data_Type: real
|
||||
Default_Value: 1e-6
|
||||
Limits: -
|
||||
Vector: no
|
||||
Vector_Bounds: -
|
||||
Null_Allowed: no
|
||||
|
||||
PARAMETER_TABLE:
|
||||
Parameter_Name: a2
|
||||
Description: "Excess current exponential factor in 1/volts."
|
||||
Data_Type: real
|
||||
Default_Value: 5
|
||||
Limits: -
|
||||
Vector: no
|
||||
Vector_Bounds: -
|
||||
Null_Allowed: no
|
||||
PARAMETER_TABLE:
|
||||
Parameter_Name: temp
|
||||
Description: "Device temperature in Celsius."
|
||||
Data_Type: real
|
||||
Default_Value: 26.85
|
||||
Limits: -
|
||||
Vector: no
|
||||
Vector_Bounds: -
|
||||
Null_Allowed: no
|
||||
|
||||
|
||||
PARAMETER_TABLE:
|
||||
Parameter_Name: is
|
||||
Description: "Diode saturation current in amps."
|
||||
Data_Type: real
|
||||
Default_Value: 1e-12
|
||||
Limits: -
|
||||
Vector: no
|
||||
Vector_Bounds: -
|
||||
Null_Allowed: no
|
70
qucs-lib/library/AnalogueCM/etd.mod
Normal file
70
qucs-lib/library/AnalogueCM/etd.mod
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
etd cm model.
|
||||
|
||||
2 April 2016 Mike Brinson
|
||||
|
||||
|
||||
This is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
*/
|
||||
|
||||
|
||||
#include <math.h>
|
||||
|
||||
void cm_etd(ARGS)
|
||||
{
|
||||
Complex_t ac_gain1;
|
||||
static double PVP, PIP, PVV, PIV, PA2;
|
||||
static double PIS, T2, con1, con2, con3, VT;
|
||||
double ith, ix, it, dith, dix, ditu;
|
||||
static double vtd, itd, diff;
|
||||
double P_K, P_Q;
|
||||
|
||||
if (INIT) {
|
||||
PVP = PARAM(vp);
|
||||
PIP = PARAM(ip);
|
||||
PVV = PARAM(vv);
|
||||
PIV = PARAM(iv);
|
||||
PA2 = PARAM(a2);
|
||||
PIS = PARAM(is);
|
||||
|
||||
/* Constants */
|
||||
|
||||
P_K = 1.3806503e-23 ; /* Boltzmann's constant in J/K */
|
||||
P_Q = 1.602176462e-19; /* Charge of an electron in C */
|
||||
T2 = PARAM(temp)+237.15;
|
||||
VT = P_K*T2/P_Q; /* Thermal voltage at Temp in volts */
|
||||
con1 = PIV*PA2;
|
||||
con2 = PIS/VT;
|
||||
con3 = PIP/PVP;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (ANALYSIS != AC) {
|
||||
vtd = INPUT(ntd);
|
||||
ith = PIS*(exp( vtd/VT) -1.0);
|
||||
ix = PIV*exp(PA2*(vtd-PVV));
|
||||
it = PIP*(vtd/PVP)*exp(1-vtd/PVP);
|
||||
itd = ith+ix+it;
|
||||
dith = con2*exp(vtd/VT);
|
||||
dix = con1*exp(PA2*(vtd-PVV));
|
||||
ditu = con3*(1-vtd/PVP)*exp(1-vtd/PVP);
|
||||
diff = dith+dix+ditu;
|
||||
|
||||
OUTPUT(ntd) = itd;
|
||||
PARTIAL(ntd, ntd) = diff;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
ac_gain1.real = diff;
|
||||
ac_gain1.imag = 0.0;
|
||||
AC_GAIN(ntd, ntd) = ac_gain1;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -22,11 +22,18 @@
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
|
||||
SUBDIRS = AnalogueCM
|
||||
|
||||
|
||||
COMPLIBS = Transistors.lib Substrates.lib Diodes.lib MOSFETs.lib OpAmps.lib \
|
||||
Bridges.lib LEDs.lib JFETs.lib Z-Diodes.lib NMOSFETs.lib \
|
||||
PMOSFETs.lib Ideal.lib Regulators.lib Varistors.lib Cores.lib Transformers.lib
|
||||
PMOSFETs.lib Ideal.lib Regulators.lib Varistors.lib Cores.lib Transformers.lib \
|
||||
AnalogueCM.lib
|
||||
|
||||
|
||||
|
||||
EXTRA_DIST = $(COMPLIBS)
|
||||
|
||||
EXTRA_DIST = $(COMPLIBS)
|
||||
|
||||
# installation of component libraries
|
||||
librarydir = ${prefix}/share/qucs/library
|
||||
|
Loading…
x
Reference in New Issue
Block a user