• 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.

Struggling with LTspice - How to use .inc to get a tube to appear

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I'm a newbie losing sleep flailing in LTspice...

I found a spice model for a 6AU6 that I'd like to use in LTspice. Found it here: http://www.diyaudio.com/forums/tubes-valves/59480-pspice-ltspice-model-6au6-ef94.html#post670881

I've been reading up on how to get a model to appear using the .inc directive, but I can't seem to get it to work.

I found this: http://www.diyaudio.com/forums/tubes-valves/148630-need-help-tube-models-ltspice.html#post1897305 -- but that uses an .inc callout to a generic triode model and then another .inc callout to the specific triode to send data to the generic triode model. OK, so I'm trying that with a generic pentode model, but it's not working.

I think I might have a bad generic pentode model. Every time I try to use a 6AU6 .subckt I get errors that this or that parameter isn't lining up with pins or various lines in the generic pentode model.

Is there a particular generic pentode model that people here are having success with? Maybe I could replace the one I'm using with that, and it could work.

Better yet, if anybody has a working 6AU6.asy file for LTspice, that would be great. I found one, but it generates errors.

I have several pentodes that I'm able to use, mostly obtained from kevinkr in the Vacuum Spice Models thread (sticky) -- http://www.diyaudio.com/forums/tubes-valves/243950-vacuum-tube-spice-models.html -- Those work great, but I don't think there's a 6AU6 in there.

Thanks for any guidance. I'm really stuck here.
 
Here is the pentode.asy file I'm using:

Code:
Version 4
SymbolType CELL
LINE Normal -48 -16 -48 16
LINE Normal 48 -16 48 16
LINE Normal 0 -64 0 -32
LINE Normal -20 -32 20 -32
LINE Normal -20 -28 20 -28
LINE Normal -20 -32 -20 -28
LINE Normal 20 -32 20 -28
LINE Normal 20 -16 12 -16
LINE Normal 4 -16 -4 -16
LINE Normal -12 -16 -20 -16
LINE Normal -28 -16 -48 -16
LINE Normal 48 0 28 0
LINE Normal 20 0 12 0
LINE Normal 4 0 -4 0
LINE Normal -12 0 -20 0
LINE Normal -48 16 -28 16
LINE Normal -20 16 -12 16
LINE Normal -4 16 4 16
LINE Normal 12 16 20 16
LINE Normal -24 28 24 28
LINE Normal -32 64 -32 36
LINE Normal -24 28 -32 36
LINE Normal 24 28 32 36
LINE Normal -28 32 28 32
ARC Normal -48 -64 48 32 48 -16 -48 -16
ARC Normal -48 -32 48 64 -48 16 48 16
WINDOW 0 8 -80 Left 0
WINDOW 3 -24 80 Left 0
SYMATTR Value Pentode
SYMATTR Prefix X
SYMATTR Description This symbol is for use with a subcircuit macromodel that you supply.
PIN -32 64 NONE 0
PINATTR PinName Cathode
PINATTR SpiceOrder 1
PIN -48 16 NONE 0
PINATTR PinName G1
PINATTR SpiceOrder 2
PIN 48 0 NONE 0
PINATTR PinName G2
PINATTR SpiceOrder 3
PIN -48 -16 NONE 0
PINATTR PinName G3
PINATTR SpiceOrder 4
PIN 0 -64 NONE 0
PINATTR PinName Anode
PINATTR SpiceOrder 5


and here's the 6AU6_AN.inc file I'm calling from a .lib statement:

Code:
*
* Generic pentode model: 6AU6
* Copyright 2003--2008 by Ayumi Nakabayashi, All rights reserved.
* Version 3.10, Generated on Sat Mar  8 22:39:10 2008
*            Plate
*            | Screen Grid
*            | | Control Grid
*            | | | Cathode
*            | | | |
.SUBCKT 6AU6_AN A G2 G1 K
BGG   GG   0 V=V(G1,K)+0.24107953
BM1   M1   0 V=(0.014176045*(URAMP(V(G2,K))+1e-10))**-0.93570358
BM2   M2   0 V=(0.61583848*(URAMP(V(GG)+URAMP(V(G2,K))/27.099343)))**2.4357036
BP    P    0 V=0.0032162308*(URAMP(V(GG)+URAMP(V(G2,K))/44.003978))**1.5
BIK   IK   0 V=U(V(GG))*V(P)+(1-U(V(GG)))*0.0020681021*V(M1)*V(M2)
BIG   IG   0 V=0.0016081154*URAMP(V(G1,K))**1.5*(URAMP(V(G1,K))/(URAMP(V(A,K))+URAMP(V(G1,K)))*1.2+0.4)
BIK2  IK2  0 V=V(IK,IG)*(1-0.4*(EXP(-URAMP(V(A,K))/URAMP(V(G2,K))*15)-EXP(-15)))
BIG2T IG2T 0 V=V(IK2)*(0.71681629*(1-URAMP(V(A,K))/(URAMP(V(A,K))+10))**1.5+0.28318371)
BIK3  IK3  0 V=V(IK2)*(URAMP(V(A,K))+15750)/(URAMP(V(G2,K))+15750)
BIK4  IK4  0 V=V(IK3)-URAMP(V(IK3)-(0.0017183702*(URAMP(V(A,K))+URAMP(URAMP(V(G2,K))-URAMP(V(A,K))))**1.5))
BIP   IP   0 V=URAMP(V(IK4,IG2T)-URAMP(V(IK4,IG2T)-(0.0017183702*URAMP(V(A,K))**1.5)))
BIAK  A    K I=V(IP)+1e-10*V(A,K)
BIG2  G2   K I=URAMP(V(IK4,IP))
BIGK  G1   K I=V(IG)
* CAPS
CGA   G1  A  0.0035p
CGK   G1  K  3.3p
C12   G1  G2 2.2p
CAK   A   K  5p
.ENDS


The spice directive I'm using is .lib <location of>6AU6_AN.inc

I get an error [Missing model name in CPL statement: "pu1 n004 n010 n005 n004 n001 6au6_an"]

Those are nodes on the 6AU6_AN model. I think my pentode.asy is messed up. Is my mistake that I should not be calling that up as the 'template' (generic pentode) to use with the 6AU6 .subckt text I'm using?

Oh, my head hurts... :h_ache:
 
if you open the misc>pentode symbol in LTSpice you can inspect pin definitions by right clicking the pins :
K G1 G2 G3 A

the order is backwards relative to the .subcircuit model definition you are using

and your sub only declares 4 pins despite calling itself a pentode model - it is missing a (the suppressor?) grid declaration

parsing the equations is beyond my tube interest level

the tetrode symbol may work - it does the pins backwards to the pentode symbol - maybe an issue should be raised with Mike or the LTSpice Yahoo group
 
Last edited:
Thanks for the tips, jcx. Using the tetrode model got things going, then I found this page -- Adding Spice Models to LTspice | Adam Siembida Personal Web Page -- which somehow got things to click.

I'm not sure if it mattered, but the .subckt had the pins named A, G1, G2, K, while the tetrode model (tetrode.asy) had them labeled "Anode", "Control Grid", "Screen" and "Cathode". I matched them up and it suddenly worked!

Now I need some sleep.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.