Mail Archives: geda-user/2013/03/02/05:30:36
Hi all.
I try to model a tube ampllifier using ngspice.
Here is my netlist. Some how I get high voltage on the second grid (node
5).
Whos mistake is it, ngspice or mine?
Thanks
-------------------------------------------
* Spice netlister for gnetlist
* Cph 7 4 4.7n
* Ra2 9 4 2k
Ra2 7 4 20k
Cc2 0 8 10u
Rc2 8 0 10
* La 7 9 2H
X2 7 5 8 TRIODE_6S51N
V1 6 0 SIN(0 0.01 1kHz)
V2 4 0 DC 50
Cgi 3 6 150n
Cout 5 1 150n
Rgi 3 0 1M
Rout 5 0 1M
Ra 4 1 10k
Rc 2 0 180
Cc 0 2 10u
X1 1 3 2 TRIODE_6S51N2
* Subcircuits
*------------------------------------------------------------
.func PWR(x,a) {abs(x) ** a}
.func PWRS(x,a) {sgn(x) * PWR(x,a)}
*____________________________________________________________
* triode P G C
.SUBCKT TRIODE_6S51N 1 2 3 CCG=4.2P CGP=2.2P CCP=1.6P RGI=2000 MU=51.8522 EX=1.3719 KG1=118.77 KP=110.41 KVB=383.7899
*--------------------------------------------------
E1 7 0 VALUE={V(1,3)/KP*LN(1+EXP(KP*(1/MU+(V(2,3))/SQRT(KVB+V(1,3)*V(1,3)))))}
RE1 7 0 1G ; TO AVOID FLOATING NODES
G1 1 3 VALUE={(PWR(V(7),EX)+PWRS(V(7),EX))/KG1}
RCP 1 3 1G ; TO AVOID FLOATING NODES
C1 2 3 {CCG} ; CATHODE-GRID
C2 2 1 {CGP} ; GRID=PLATE
C3 1 3 {CCP} ; CATHODE-PLATE
D3 5 3 DX ; POSITIVE GRID CURRENT
R1 2 5 {RGI} ; POSITIVE GRID CURRENT
.MODEL DX D(IS=1N RS=1 CJO=10PF TT=1N)
.ENDS
.SUBCKT TRIODE_6S51N2 1 2 3 CCG=4.2P CGP=2.2P CCP=1.6P RGI=2000 MU=51.8522 EX=1.3719 KG1=118.77 KP=110.41 KVB=383.7899
*--------------------------------------------------
E1 7 0 VALUE={V(1,3)/KP*LN(1+EXP(KP*(1/MU+(V(2,3))/SQRT(KVB+V(1,3)*V(1,3)))))}
RE1 7 0 1G ; TO AVOID FLOATING NODES
G1 1 3 VALUE={(PWR(V(7),EX)+PWRS(V(7),EX))/KG1}
RCP 1 3 1G ; TO AVOID FLOATING NODES
C1 2 3 {CCG} ; CATHODE-GRID
C2 2 1 {CGP} ; GRID=PLATE
C3 1 3 {CCP} ; CATHODE-PLATE
D3 5 3 DX ; POSITIVE GRID CURRENT
R1 2 5 {RGI} ; POSITIVE GRID CURRENT
.MODEL DX D(IS=1N RS=1 CJO=10PF TT=1N)
.ENDS
*____________________________________________________________
* .DC Vp 0 100 .1 Vg 0.0 5.0 0.5
.TRAN 0.01ms 5ms
*.op
.control
run
plot V(5) V(1)
.END
- Raw text -