LTSpice Triode "Unknown subcircuit"

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I am trying to model a triode in a circuit, and at present I am receiving the error message "Unknown subcircuit called in: xu1 n003 n009 n011 triode".

It is probably something simple that I am unaware of, since I am newer to this program and unfamiliar with writing in code. I would love to be brought up to speed in the modelling of tubes in LT Spice, and your help is appreciated. Thank you in advance.
 
The generic model is located in C:\Program Files\LTC\LTspicelV\lib\sym\Misc\triode.asy, where the program creators have placed it. The name is also the one given by the creators. I am not trained in editing Netlist-based files, so this is a learning exercise. The semiconductors work fine, but the generic tubes models will not run as-is.
 
Last edited:
Member
Joined 2004
Paid Member
"triode.asy" is the symbol file in the "sym\Misc" sub directory.

The "C:\Program Files\LTC\LTspicelV\lib\" directory contains "cmp", "sub", and "sym" sub directories.

"sub" contains (example) 'triode.txt' file (or dmtriode.inc or another file), which contains (example) 6SN7 model:

'.SUBCKT 6SN7_GTB A G K H1 H2
XV1 A G K H1 H2 TRIODE
+PARAMS: RCO= 3.2 RHO= 21 HTV= 6.3 HWU= 10.5
+ LIP= 1 LIF= 0.0037 RAF= 0.02 RAS= 2 CDO= 0
+ RAP= 0.002 ERP= 1.4
+ MU0= 19.2642 MUR= 0.006167 EMC= 0.0000189
+ GCO= 0 GCF= 0.000213
+ CGA=3.90E-12 CGK=2.40E-12 CAK=7.00E-13
.ENDS'

and this file contains general triode model (example):

'.SUBCKT TRIODE A G K H1 H2
+PARAMS: RCO=1.6 RHO=10.5 HTV=6.3 HWU=10.5
+ LIP=1 LIF=3.7E-3 RAF=18E-3 RAS=1 CDO=0 RAP=4E-3
+ ERP=1.5
+ MU0=17.3 MUR=19E-3 EMC=9.6E-6 GCO=0 GCF=213E-6
+ CGA=3.9p CGK=2.4p CAK=0.7p

Rcool H1 HA {RCO}
Rload HA HB 1M
Esens HD 0 VALUE {V(HA,HB)*1000}
Epwr HE 0 VALUE {V(H1,H2)*V(HD)/(PWR({HTV},2)/{RHO})}
RH1 HE HF 91k
CH1 HF 0 {HWU/1E6}
EH2 HG 0 VALUE {V(HF)}
RH2 HG HH 270k
CH2 HH 0 {HWU/1E6}
EH3 HJ 0 VALUE {LIMIT(V(HH)-0.75,0,1E6)*4}
RH3 HJ HK 91k
CH3 HK 0 {HWU/1E6}
Ghot HB H2 VALUE {(1/(V(HG)+0.001))/({RHO}-{RCO})*V(HB,H2)}
Elim LI 0 VALUE {PWR(LIMIT(V(A,K),0,1E6),{LIP})*{LIF}}
Egg GG 0 VALUE {V(G,K)-{CDO}}
Erpf RP 0 VALUE {1-PWR(LIMIT(-V(GG)*{RAF},0,0.999),{RAS})+LIMIT(V(GG),0,1E6)*{RAP}}
Egr GR 0 VALUE {LIMIT(V(GG),0,1E6)+LIMIT((V(GG))*(1+V(GG)*{MUR}),0,-1E6)}
Eem EM 0 VALUE {LIMIT(V(A,K)+V(GR)*{MU0},0,1E6)}
Eep EP 0 VALUE {PWR(V(EM),ERP)*{EMC}*V(RP)}
Eel EL 0 VALUE {LIMIT(V(EP),0,V(LI))}
Eld LD 0 VALUE {LIMIT(V(EP)-V(LI),0,1E6)}
Ga A K VALUE {V(HK)*V(EL)}
Egf GF 0 VALUE {PWR(LIMIT(V(G,K)-{GCO},0,1E6),1.5)*{GCF}}
Gg G K VALUE {(V(GF)+V(LD))*V(HK)}
CM1 G K {CGK}
CM2 A G {CGA}
CM3 A K {CAK}
RF1 A 0 1000MEG
RF2 G 0 1000MEG
RF3 K 0 1000MEG
.ENDS'


'6SN7_GTB' is the name of given triode.


Read this sites for information:
Spice Models
:: View Forum - Sim City
 
Thank you for the links, but I am unfortunately unable to understand code or how to use that. The salient issue is that I don't know what to do with the data. What I need is a library of up to date tube models with easy instructions to explain where to put them and how I get those actual files working.
 
AX tech editor
Joined 2002
Paid Member
Thank you for the links, but I am unfortunately unable to understand code or how to use that. The salient issue is that I don't know what to do with the data. What I need is a library of up to date tube models with easy instructions to explain where to put them and how I get those actual files working.

Your models are there, that's not the problem.
You just need to tell LTspice where to find them.
Usually you use an .include statement on the circuit page that contains the path to the model.
Maybe read that part of the manual.

Jan
 
Administrator
Joined 2004
Paid Member
Linear Technology makes integrated circuits, not tubes... It is rather kind of them to provide free of charge a tool that will work with just about all spice models out there including tubes, and to provide the symbols as well.

I've written extensively on the subject of how to add tube spice models to the LTspice library, please do a search here for those older threads - you should turn up something fairly quickly. Did you have a look at the thread I referenced?
 
  • Like
Reactions: 1 user
I did read through a good portion of it, but I could not find any clarification on how to get the models included with LTSpice to work. The writers in the posts are skipping the "in between" details of where to find these files and directories, what to name the files, where to include the .inc notations. It's the computer language, I don't know what they are talking about. I am not an information technology technician, nor a programmer, so the computer talk has me a bit lost.
 
Member
Joined 2004
Paid Member
LTSpice is the superb program for everybody, who want to modelling schematic functions... but if you need using another device than built in the program, minimal computer knowledge (files, directories) and knowing relationship of LTSpice own tools is neccesary.
 
I did read through a good portion of it, but I could not find any clarification on how to get the models included with LTSpice to work. The writers in the posts are skipping the "in between" details of where to find these files and directories, what to name the files, where to include the .inc notations. It's the computer language, I don't know what they are talking about. I am not an information technology technician, nor a programmer, so the computer talk has me a bit lost.

You might try the LTspiceIV Yahoo Group, which has many excellent basic tutorials. ;)
 
Administrator
Joined 2004
Paid Member
I did read through a good portion of it, but I could not find any clarification on how to get the models included with LTSpice to work. <snip>

There are no tube models included with LTspice!! :D This is what I was trying to tell you. Only the symbols are included..

I am going to post some instructions and give you the files you need to install a large tube library in LTSpice. Apparently all of the older threads where I provided the files and instructions have evaporated - I was trying to find those.
 
Administrator
Joined 2004
Paid Member
OK so you want to install a collection of tube models and their supporting symbols. Note both are provided with no warranty implied or otherwise.

There are two directories you need to locate. LTspice is a 32 bit program and will be installed in program files in xp or Program Files (X86) in Win 7. Locate the LTC folder..

Path to tube symbols is \LTC\LTspiceIV\lib\sym - unzip the tube_sym zip and paste the folder here.

Next step:

Path to tube library is \LTC\LTspiceIV\lib\sub - unzip the tube_lib zip file and paste the file here.

Start LTspice and under the component folder (AND gate on the menu) you will see a folder called 'Tubes' click on this and you will find diode, triode, tetrode, and pentode folders. Click on the folder of your choice and you will get a number of choices. I have lots of triode models and fewer pentodes, tetrodes and diodes. A few models may be funky, but most work ok.
 

Attachments

  • symbols.PNG
    symbols.PNG
    139.6 KB · Views: 559
  • lib path.PNG
    lib path.PNG
    156.6 KB · Views: 511
  • Tubes_sym.zip
    31.6 KB · Views: 342
  • tube_lib.zip
    16.7 KB · Views: 360
Thank you for your clear instructions, and tubes now work. One exception that was that I left "tube.lib" as just "tube". If I added ".lib" to the name, LT Spice did not recognize the file. Anyhow, below, I put together this simple headphone amplifier schematic exactly as per an online design. Green is the input, and Blue is the line out. I'm getting some undesirable clipped lower-half waveform behavior when I feed a signal on the input. At lower frequencies, the distortion is even worse. Is this the circuit design's fault, or am I abusing LTSpice? Thank you.

An externally hosted image should be here but it was not working when we last tested it.
 
Last edited:
Administrator
Joined 2004
Paid Member
Strange that you had to remove the .lib from tube library, I have 3 installations of LTSpice on different machines currently and this worked fine on all of them.. Hmm..

In terms of the circuit I suspect one or more of the stages is overloading. Bear in mind there is a supply decoupling time constant in your first stage that is over 100msec, and will take roughly 5 time constants to reach full supply voltage - so this is one stage that is causing a problem. For purposes of simulation you could remove it or use a voltage generator in series (in place of the cap and resistor) to buck the voltage to the first stage by a few volts. I don't think the cathode follower as implemented can handle more than a few volts. Try increasing R11 to 10K. Change that output capacitor to 4.7uF, 470uF is far too large and adds a huge time constant that slows down circuit settling time, and hence simulation. (Real world as well as simulation)

FWIW this is not the pre-amp circuit I would build, I designed and built something quite similar about 25yrs ago, it measured great, and sounded pretty mediocre. This is a variant of the circuit found in the Marantz 7, at least three McIntosh tube pre-amps, and several models from ARC. Too much gain, too much feedback, too many stages.. You can do this in one or two stages with limited to no global feedback required.
 
kevinkr,
Thank you for your reply. The design was not mine and belongs to someone else, and it was unknown if it would work. I came across it on the web to use as a quick mock up to test the associated tube model for that circuit, but it turned out to have so many errors that I am left wondering if the designer has ever actually ran a sim of it, himself. In retrospect, when I review it now, I see so many things wrong that I am left more confused about why I tried to model such an inexcusably bad design. I moved on to try some other proven designs, they all modeled perfectly as expected. Best wishes, and thank you for your help in answering a common question that rarely sees a layman's answer. As to the ".lib", I truly can't account for why it works without it and not with it in my case, other than it may be the software version or an associated component to the program.
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.