• WARNING: Tube/Valve amplifiers use potentially LETHAL HIGH VOLTAGES.
    Building, troubleshooting and testing of these amplifiers should only be
    performed by someone who is thoroughly familiar with
    the safety precautions around high voltages.

Vacuum Tube SPICE Models

The 864 is a directly-heated triode and this SPICE model includes both of the filament leads instead of treating the entire filament as the "cathode." You need a different symbol which includes both of the filament pins. Attached is a symbol that is compatible with the SPICE model; rename it to TriodeDHT.asy before using it.
 

Attachments

  • TriodeDHT.asy.txt
    832 bytes · Views: 21
  • Thank You
Reactions: 1 user
Member
Joined 2008
Paid Member
Ah, you're too quick for my edit !

I was running in an earlier rev of LTspice . When put into the newer version it spelled out the problem with more detail.

Missing closing brace '}' in “{\rft1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf610”

A search of the model doesn't find that line so maybe it's in the code for the symbol? Just asking. No idea myself.
 
Last edited:
That line doesn't appear anywhere in Ale's model, and the symbol doesn't have any code at all. As long at the symbol's pin count and pin order matches the .SUBCKT definition (which it does) the symbol can be ruled out as the problem.

Without the schematic file that you are simulating, I'm just shooting in the dark. Post your schematic file and someone can probably help sort this out.
 
Member
Joined 2008
Paid Member
I found the error in the model file as spice saved it , adding a bunch of text to the top of the model. I'll have to sort out how to add it without that happening. It's on a mac so much of the suggestions online doesn't apply. Thanks .

Edit, Got it to work by copying the file to the schematic. Good enough for now.

One question about the DHT symbol's having both ends of the filament available. How do you work with that ? Tie both together with cathode bias resistor connected to the pair?
 
Last edited:
The .asc schematic file is just a text file so the Windows version of LTspice should open it without any problems. The same is true of symbol files -- they are just text files with a special file extension. So chances are that a Windows user is going to see the same behavior that you are seeing on your Mac as long as the source and symbol files are the same.

Good luck sorting this out.
 
One question about the DHT symbol's having both ends of the filament available. How do you work with that ? Tie both together with cathode bias resistor connected to the pair?
Ale's "composite" model includes the DC resistance of the filament itself so it was probably used to simulate the filament circuit as well as the audio circuit. I suppose that you can just use one of the two filament leads as the cathode and leave the other unconnected, but below is a link to a circuit in which Ale used his composite model for a similar tube.

https://www.bartola.co.uk/valves/2022/01/16/aa-dht-spice-model/

Note that the circuit powers the filament with a current source, like in an actual circuit. I would have to examine the model to see if the tube's behavior is actually dependent on the filament current, but I'm not really inclined to go to that trouble. There isn't much point in using a composite model like this if you don't intend to model the filament circuit. A conventional triode model for the 864 will work just as well in that case. A Google search turned up this one. DISCLAIMER: I have not tested this model.

Code:
.subckt 864 1 6 3
+ params: mu=8.2 ex=1.372 kg1=9540 kp=165 kvb=2.84 rgi=6000 vct=.195
+ ccg=3.3p cgp=5.3p ccp=2.1p
e1 7 0 value=
+{v(1,3)/kp*log(1+exp(kp*(1/mu+v(2,3)/sqrt(kvb+v(1,3)*v(1,3)))))}
re1 7 0 1g
g1 1 3 value= {(pwr(v(7),ex)+pwrs(v(7),ex))/kg1}
rcp 1 3 1g
c1 2 3 {ccg}
c2 1 2 {cgp}
c3 1 3 {ccp}
r1 2 5 {rgi}
v1 5 6 {vct}
d3 6 3 dx
.model dx d(is=1n rs=1 cjo=1pf tt=1n)
.ends
 
Last edited:
Well, even though I said that I wouldn't, I did examine Ale's 864 composite SPICE model and the model does include the effects of current through the filament. Here are the two lines of code that account for that.

Code:
E11 32 0 VALUE={V(1,31)/KP*LOG(1+EXP(KP*(1/MU+V(2,31)/SQRT(KVB+V(1,31)*V(1,31)))))}
E12 42 0 VALUE={V(1,41)/KP*LOG(1+EXP(KP*(1/MU+V(2,41)/SQRT(KVB+V(1,41)*V(1,41)))))}

So this model isn't going to give accurate results unless you include a realistic filament circuit in your schematic. As I said earlier, if you don't intend to do that (or don't have a good reason to) then you are better off using a conventional 3-pin model for the 864 triode.
 
Last edited:
Hi, I am looking for a model for the E83F. It is mentioned in this thread, saying it was in the Ayumi lib. But I cannot find it there.
Can someone please post it or point to it?
Thanks a lot.

EDIT: Of course... I had searched for it a while in this thread and now after posting, I searched again, this time for all "zip" in the thread and find it immediately in Ayumi's ZIP here: https://www.diyaudio.com/community/threads/vacuum-tube-spice-models.243950/post-7112532 (I likely had an earlier version before)

😝
 
Last edited:
Hi all
The last half year, I worked on updating my pentode model to i6 level, means that:
  • it is equal to my i6 triode model when g2 and plate is connected together
  • it has an enhanced convergence performance compared to earlier pentode versions of mine
  • the plate emission limit is now finetuned for both modes, triode-connected as well as pentode-connected

The first tube I fitted to this new generic model is the Siemens 6U8A pentode.

Enjoy!
BR Adrian

Code:
*Siemens 6U8A #pentode LTspice model based on the generic tetrode / g3-grounded pentode model from Adrian Immler, version i6
*A version log is at the end of this file
*Params fitted to datasheet graphs by Adrian Immler, May 2024
*This model is accurate for Vg up to 1.5V (up to 3V when "triode connected")
*The fit quality is presented at adrianimmler.simplesite.com
*This model is an enhancement of Adrians generic triode model to achieve tetrode/pentode behaviour.
*Hence, it is also suitable when the tetrode/pentode is "triode connected".
*Convenient for tetrodes, power beam tetrodes and g3-grounded pentodes.
*Copes secondary emission effect!
*            Pentode section of the tube
*            | SI=Siemens construction. Be aware of a very different 6U8A constr. with large plate window!
*            | | i6 version is identical to the i5, but measurements done with HOT anode for highest accuracy
*            | | |  plate. Note: For backward-compatibility, the anode A means P connected to G2
*            | | |  | grid2 (screen)
*            | | |  | |  grid
*            | | |  | |  | cathode
*            | | |  | |  | |
.subckt 6U8A#P.SIi6 P G2 G K
+ params:
*Parameters for space charge current Is (100% assigned to Ia @ Vg < 0)
+ mu   = 43    ;Determines the voltage gain @ constant Ia
+ rad  = 3k77   ;Differential anode resistance, set @ Iad and Vg=0V
+ Vct  = 0.58  ;Offsets the Ia-traces on the Va axis. Electrode material's contact potential
+ kp   = 178   ;Mimics the island effect
+ xs   = 1.5   ;Determines the curve of the Ia traces. Typically between 1.2 and 1.8
+ kIsr = 16m   ;Va-indepedent part of the Is reduction when gridcurrent occurs
+ kvdg  = 65   ;Va-depedent part of the Is reduction when gridcurrent occurs
*
*Parameters for assigning the space charge current to Ia and Ig @ Vg > 0
+ kB   = 0.15  ;Describes how fast Ia drops to zero when Va approaches zero.
+ radl = 100   ;Differential resistance for the Ia emission limit @ very small Va and Vg > 0
+ tsh  = 8     ;Ia transmission sharpness from 1th to 2nd Ia area. Keep between 3 and 20. Start with 20.
+ xl   = 1.3   ;Exponent for the emission limit
*
*Parameters of the grid-cathode vacuum diode
+ kg = 440     ;Inverse scaling factor for the Va independent part of Ig (caution - interacts with xg!)
+ Vctg = -0.1  ;Offsets the log Ig-traces on the Vg axis. Electrode material's contact potential
+ xg   = 1.0   ;Determines the curve of the Ig slope versus (positive) Vg and Va >> 0
+ VT   = 0.088 ;Log(Ig) slope @ Vg<0. VT=k/q*Tk (cathodes absolute temp, typically 1150K)
+ rTr  = 0.95  ;ratio of VT for Igr. Typically 0.8
+ kVT  = 0     ;Va dependant koeff. of VT
+ gft1 = 0     ;reduces the steering voltage around Vg=-Vg0, for finetuning purposes
+ gft1a= 0     ;reduces the steering voltage around Vg=-Vg0. Effect decreases with 1/(1+kB*Va)
+ gft2 = 2     ;finetunes the Igr drop @ incrasing Va and around Vg=-Vg0
*
*Parameters for the caps
+ cpg  = 0p01  ;From datasheet
+ Cg2g = 4p2   ;measured at the golden sample, filament not heated
+ cpk  = 2p6   ;From datasheet
+ cgk  = 5p0   ;From datasheet
*
*parameters needed to enhance the triode model to a tetrode model
+ mu2 = 80     ;1/mu2 is the fraction of Vp which together with Vg2i builds the virtual Triode-Anode Voltage
+ kB2 = 0.3    ;Describes how fast Ip drops to zero when Vp approaches zero.
+ fr2 = 0.20   ;determines the residual ig2 fraction @ high Va values
+ radl2 = 2k9  ;Differential resistance for the Ip emission limit @ very small Vp and Vg > 0
+ tsh2  = 6    ;Ip transmission sharpness from 1th to 2nd Ip area. Keep between 3 and 20. Start with 20.
+ xl2   = 0.8  ;Exponent for the Ip emission limit
*
*special purpose parameters
+ os = 1       ;Overall scaling factor, if a user wishes to simulate manufacturing tolerances
+ murc = 10    ;Mu of the remote cutoff triode
+ ksrc = 10G   ;Inverse Iarc gain factor for the remote cuttoff triode
+ kprc = 1k    ;Mimics the island effect for the remote cotoff triode
+ Vbatt = 0    ;heater battery voltage for direct heated battery triodes
+ Vdrmax = 100 ;max voltage of internal Vg drop, for convergence improvements
*
*Calculated parameters
+ Iad = {100/rad} ;Ia where the anode a.c. resistance is set according to rad.
+ ks = {pow(mu/(rad*xs*Iad**(1-1/xs)),-xs)} ;Reduces the unwished xs influence to the Ia slope
+ ksnom = {pow(mu/(rad*1.5*Iad**(1-1/1.5)),-1.5)} ;Sub-equation for calculating Vg0
+ Vg0 = {Vct + (Iad*ks)**(1/xs) - (Iad*ksnom)**(2/3)} ;Reduces the xs influence to Vct.
+ kl = {pow(1/(radl*xl*Ild**(1-1/xl)),-xl)} ;Reduces the xl influence to the Ia slope @ small Va
+ kl2 = {pow(1/(radl2*xl2*Ild2**(1-1/xl2)),-xl2)}
+ Ild = {sqrt(radl)*1m} ;Current where the Il a.c. resistance is set according to radl.
+ Ild2 = {sqrt(radl2)*1m}
*
*enhancement to derive a tetrode / g3-grounded pentode from a triode model
Bpa P A V=v(P,Ki) - (v(P,Ki)/mu2 + v(G2,Ki));voltage source to set Va, and to "measure" Ia
Bg2 G2 A I=i(Ra)*((1-fr2)/(1+kB2*max(0,v(P,Ki)))+fr2)
Bg2l G2 P I=uramp(i(Bpa)-smin(1/kl2*pow(v(Phc),xl2),i(Bpa),tsh2)) ;Ia emission limit
Bphc Phc 0 V=uramp(v(P,Ki)) ;Anode voltage, hard cut to zero @ neg. value
*
*Space charge current model
Rak A K 100G ;avoids "floating net" errors
Bft   ft 0 V=1/(1+pow(2*abs(v(G,Ki)+Vg0),3)) ;an auxiliary voltage to finetune the triode around Vg=-Vg0
Bggi GGi 0 V=(v(Gi,Ki)+Vg0)*(1/(1+kIsr*max(0, v(G,Ki)+Vg0))) - gft1*v(ft) - gft1a*v(ft)/(1+kB*v(Ahc)) ;Effective internal grid voltage.
Bahc Ahc 0 V=uramp(v(A,Ki)) ;Anode voltage, hard cut to zero @ neg. value
Bst   St 0 V=uramp(max(v(GGi)+v(A,Ki)/(mu), v(A,Ki)/kp*ln(1+exp(kp*(1/mu+v(GGi)/(1+v(Ahc)))))));Steering volt.
Bs    Ai Ki I=os/ks*pow(v(St),xs) ;Langmuir-Childs law for the space charge current Is
*Bstrc Strc 0 V=uramp(max(v(GGi)+v(Ahc)/(murc), v(Ahc)/kprc*ln(1+exp(kprc*(1/murc+v(GGi)/(1+v(Ahc)))))));FOR REMOTE CUTOFF TUBES ONLY
*Bsrc   Ai Ki I=os/ksrc*pow(v(Strc),xs) ;FOR REMOTE CUTOFF TUBES ONLY
*
*Anode current limit @ small Va
.func smin(z,y,k) {pow(pow(z+1f, -k)+pow(y+1f, -k), -1/k)} ;Min-function with smooth trans.
.func ssmin(z,y,k) {min(min(z,y), smin(z*1.003,y*1.003,k))};smin-function which suppresses small residual differencies
Ra  A Ai 1
Bgl Gi A I=uramp(i(Ra)-ssmin(1/kl*pow(v(Ahc),xl),i(Ra),tsh)) ;Ia emission limit
*
*Grid model
Rgk G K 10G ;avoids "floating net" errors
Bvdg G Gi I=1/kvdg*pow(v(G,Gi),1.5) ;Reduces the internal effective grid voltage when Ig rises
Bcoh G Gi I=pow(uramp(v(G,Gi)-Vdrmax),2) ;A convergence help which softly limits the internal Vg voltage drop.
Rgip G Gi 1G ;avoids some warnings
.func fVT() {VT*exp(-kVT*sqrt(v(A,Ki)))}
.func Ivd(Vvd, kvd, xvd, VTvd)  {if(Vvd < 3, 1/kvd*pow(VTvd*xvd*ln(1+exp(Vvd/VTvd/xvd)),xvd), 1/kvd*pow(Vvd, xvd))} ;Vacuum diode function
Bgvd G Ki I=Ivd(v(G,Ki) + Vctg + min(0,v(A,Ki)/mu), kg/os, xg, fVT()) ;limits the internal Vg for convergence reasons
Bstn Stn 0 V=v(GGi)+min(0,v(A,Ki))/mu ;special steering voltage, sensitive to negative Anodevoltages only
Bgr Gi Ai I= ivd(v(Stn),ks/os, xs, rTr*fVT())/(1+(kB+v(ft)*gft2)*v(Ahc));Is reflection to grid when Va approaches zero
*Bgr Gi Ai I=(ivd(v(Stn),ks/os, xs, rTr*fVT())+os/ksrc*pow(v(GGi),xs))/(1+(kB+v(ft)*gft2)*v(Ahc));FOR REMOTE CUTOFF TUBES ONLY
Bs0 Ai Ki  I=uramp(ivd(v(Stn),ks/os, xs, rTr*fVT()) - os/ks*pow(v(Stn),xs))
Bbatt Ki K V=Vbatt/2 ;for battery heated triodes; Offsets the average cathode potential to the half heater battery voltage
*
*Caps
C1 P  G {cpg}
C2 P  K {cpk}
C3 G  K {cgk}
C4 G2 G {cg2g}
.ends
*
*Version log
*i1 :Initial version
*i2 :Pin order changed to the more common order A G K (Thanks to Markus Gyger for his tip)
*i3 :bugfix of the Ivd-function: now also usable for larger Vvd
*i4: Rgi replaced by a virtual vacuum diode (better convergence). ft1 deleted (no longer needed)
;2 new prarams for Ig finetuning @ Va and Vg near zero. New overall skaling factor os for aging etc.
*i5: improved convergence performance. PosVg/NegVa area now correct. Also accurate now for remote cutoff triodes!
*i6: identical to the i5, but tubes measured with hot anode (Pa=0.7*Pmax) for highest accuracy
 

Attachments

  • fit_Siemens_6U8A#1_Pentode_logIg.png
    fit_Siemens_6U8A#1_Pentode_logIg.png
    221.8 KB · Views: 9
  • fit_Siemens_6U8A#1_Pentode_Ia.png
    fit_Siemens_6U8A#1_Pentode_Ia.png
    248.7 KB · Views: 7
  • fit_Siemens_6U8A#1_PentodeAsTriode_logIg.png
    fit_Siemens_6U8A#1_PentodeAsTriode_logIg.png
    241.9 KB · Views: 8
  • fit_Siemens_6U8A#1_PentodeAsTriode_Ia.png
    fit_Siemens_6U8A#1_PentodeAsTriode_Ia.png
    292.8 KB · Views: 9
  • Like
Reactions: 2 users
Not that you'll ever need it, but,here's a model for the 7586 Nuvistor. Curiousity aroused from looking at the HP3400's "Impedance Converter":

.subckt 7586 1 2 3
+Params: MU=51.4 KP=110.9 KVB=283.4 EX=1.32 KG1=119.8
E1 7 0 Value = {(V(1,3)/KP)LN((1+ EXP((KP/MU) + ((KP(V(2,3)+.5))/(SQRT(KVB+V(1,3)*V(1,3)))))))}
RE1 7 0 1e12
G1 1 3 VALUE = {(((V(7))^EX)/KG1)*(1+SGN(V(7)))}
RCP 1 3 2.3e12
C1 2 3 4.2e-12
C2 1 2 2.2e-12
C3 1 3 1.6e-12
R1 2 5 2000
D3 5 3 dx
.model dx d(is=1e-09 rs=1 cjo=10e-12)
.ends
 
  • Like
Reactions: 1 user