Home.


Learning LT Spice.
Lesson 4

Table of Contents.

Lesson 1: Creating a net list and a Simple Simulation.
Lesson 2: Introduction to and applications of frequency analysis.
Lesson 3: Introduction to and applications of transient analysis.
Lesson 4: Locating, modifying, and installing vacuum tube models. This page.
Lesson 5: Operating point of vacuum tube circuits. Introduction to stepping and plate curves.
Lesson 6: Using stepping to do frequency response of a tone control.
Lesson 7: Transient analysis of unregulated power supplies.
Lesson 8: Transient analysis of power supply regulators.
Lesson 9: Transient and frequency analysis of amplifiers with feedback.
Lesson 10: Lossless transformers.


Lesson 4
Locating, modifying, and installing vacuum tube models..

What you will learn in Lesson four.

  1. Sources of tube models.
  2. The Names of The Two Most Important Developers of Vacuum Tube Models.
  3. How to Modify the Models so they will Work with LT Spice.
  4. Where to Put the Models so LT Spice Will Recognize Them.
  5. How to Place a tube Model in a Netlist.

Sources of Tube Models.

After several hours of research on the web I have concluded that these three sources plus one that I was emailed are the best.

Duncan's Amps Spice Models. There aren't many tube types available but they are the basic audio set.

Models by Norman Koren. Use your browser's search feature to find "download the tube models".

I was sent a link to the tube models made by Ayumi Nakabayashi. They are the only ones that need to be edited to work with LT Spice.

Vacuum tube models from github. When you click on the link a page comes up that contains all the tube models. Eventually you will have to separate them and put each tube type in a separate file. For now dump them into a single file

I can't post the files but I can post a link to them and you can download them for your personal use and everything is legal. At the end of this process you will wind up with two or three versions of each tube type. To avoid writing over one with another, append a couple of letters to the tube number. For example da for the files from Duncan's Amps, nk for files from Norman Koren, an for those from Ayumi Nakabayashi, and gh for those from github. I'll give you detailed instructions below on how to make them usable as LT Spice tube models.

VERY IMPORTANT.

If you change the name on the file you MUST also change the name inside the file. For example if the file name was 6SN7.inc and you changed it to 6SN7nk.sub you must also change the tube number inside the file from 6SN7 to 6SN7nk. Failure to do this will result in the tube model not working.

The big names in model development.

The name that has been bouncing around the LT Spice community for about the last 30 years is Norman Koren. He has since moved on to another hobby but his legacy remains on the web. On this website there is a wealth of information, more than I have time to read.

Another big name in tube models is Ayumi Nakabayashi. After doing a search on the name alone I have concluded that it must be the Japanese equivalent of John Smith. There are lots of identical and similar names some of them apparently actors or singers. However, someone sent me a link to a zip file that contains his models. You have already seen the link above.

Modifying the models so they will work with LT Spice.

The models from Ayumi Nakabayashi require the most work.
Open windows explorer and navigate to the "LTspiceXVII" folder then to the "lib" folder.
Create a sub folder of lib named "Raw tube models".
Create a subfolder of "Raw tube models" named "Ayumi Nakabayashi".
Now locate the zip file from the Ayumi Nakabayashi site.
It is named tubemodel_3.20_win.zip and is probably in your downloads folder.
Double click it and it will open.
Click on the extract button.
The copy to box will contain the path to the downloads folder
Look to the right and you will see a small button with 3 dots on it. Click it.
Navigate to the "Ayumi Nakabayashi" folder you recently created and click OK.
Close the zip program but don't delete the zip file.

Each file must be edited as follows. Ayumi Nakabayashi used a spice program that recognizes the caret for raising a number to a power, as in A^B. LTspice does not recognize this. It needs A**B instead. The quickest way is to use find and replace. Of course you must do this for each file. I suggest modifying the file and then saving it with the letters an appended to the tube number and a file extension of ".sub". That way you keep the original file in its original form for safety. Later you can move all of the ".sub" files to the "lib" folder. That is where they need to be to be recognized by LTspice.

VERY IMPORTANT.

If you change the name on the file you MUST also change the name inside the file. For example if the file name was 6SN7.inc and you changed it to 6SN7nk.sub you must also change the tube number inside the file from 6SN7 to 6SN7nk. Failure to do this will result in the tube model not working.

For the others there is actually very little to be done.
For the files from Duncan Amps, after you click on the link and the model text comes up just press ctrl-A to select all then ctrl-C to copy it to the clipboard.
Then open Notepad and press ctrl-V for paste.
Now locate the line that begins ".SUBCKT". It may be in either upper or lower case.
Append the letters da to the tube number without any spaces. For example 12AX7Ada. In Notepad select Save as and navigate to the LTspiceXVII folder that was created when the program was installed.
This is not the folder in C:\Program Files. It is most likely in the Documents folder.
From there navigate to lib folder and from there to the sub folder.
Save the text under the name tubenoda.sub. For example 12AX7Ada.sub
Do this for all the models you want from the Duncan's amps site.

If you haven't already done so download the zip file from the Norman Koren site.
Norman Koren files are a collection of Pspice circuit files but with a files containing models.
Open windows explorer and navigate to the LTspiceXVII folder then to the lib folder.
Create a sub folder of lib named Raw tube models.
Create a subfolder of Raw tube models named Norman Koren.
Now locate the zip file from the Koren site.
It's named Tubemodels.zip and is probably in your downloads folder.
Double click it and it will open.
Click on the extract button.
The copy to box will contain the path to the downloads folder
Look to the right and you will see a small button with 3 dots on it. Click it.
Navigate to the Norman Koren folder you recently created and click OK.
Close the zip program but don't delete the zip file. Windows explorer should now be on top.
Move to the Norman Koren folder and examine its contents. There are lots of files you can't use. The .sch files are equivalent to the .asc files in LT Spice but they can't be used, delete them.
It's easier to say what to keep than what to delete. You want to keep .lib and .txt files.
Don't worry that someone may, or may have, come up with a conversion program to convert Pspice files to LT Spice files. You still have the original zip file and can re extract the files anytime you want them.
The txt files might make interesting reading and the .lib files contain tube models.
All three of the .lib files seem to have the same contents. Whether the models are all the same or different will have to be determined by someone with better eyesight and more time than I have. I will show an example using the 6AN8T which is the triode section of the 6AN8 triode-pentode.

Open one of the .lib files and in Notepad and scroll down to the line that begins ".subckt 6AN8T".
Select the lines from ".subckt" through ".ends". Press ctrl-C to copy to clipboard.
Open another instance of Notepad and paste. You will now have the 6AN8 triode section model alone.
Move the cursor to the tube number in the ".subckt" line and append the letters nk after the T with no spaces.
Select Save as and be sure you are in the path LTspiceXVII\lib\sub\.
Save the file as 6AN8Tnk.sub.

Look at the filename with Windows explorer to be sure that Notepad did not append .txt to the end of the filename. You now have the triode section of the 6AN8 in your tube library. In exactly the same way add as many of the Koren models as you want to your library.

Vacuum tube models from github. When you click on the link a page comes up that contains all the text of the tube models. It's not a page with a download link, it's the text of the file right out there in front of God and everybody. Make of it what you will. At least that's what happens in Firefox. You get them by copy and paste. I suggest at this point you save everything in a single file. You can go back later and separate out the models for each tube type. I'll explain below what you need to do to make them usable as LT Spice tube models.

After you click the link there may be a period during which your computer will be unresponsive. This is a very large page and it will take a while to load.
Press ctrl-A to select everything on the page. There may be another delay. The text should show up as highlighted when it is finished thinking about it.
Press ctrl-C to copy to the clipboard.
Open notepad and press ctrl-V to paste.
Now save the file in the folder "Raw Tube Models" you created a while ago.
Now that you have it saved you can begin working with the file. Pick out a tube you want and select it from ".subckt" to "ends".
Press ctrl-c to copy it to the clipboard.
Open another instance of notepad and paste.
Now go to the line that begins with ".subckt" and append the letters gh to the tube number with no spaces.
Now go to Save as and make sure you are in the "sub" folder. Save it under the tube type number including the added letters with the extension ".sub"
Transfer as many tubes as you want. You probably won't get this done in one sitting.

Adding a Tube Symbol and Model to a Circuit Diagram.

Placing the tube symbol on the schematic drawing board is not enough. LT Spice needs a model for the tube to go with it. One way is to place the entire text of the model on the schematic. Another way is to place the model text in the netlist. But the easiest way was shown to me by an experienced LT Spice user on our email list. Just include the single line of text ".lib modelname.sub" on the schematic. In this specific case you see ".lib 12AX7gh.sub". The label on the tube symbol must be exactly the same as that part of the line between "lib " and ".sub". The "gh informs us that this is a model that came from the file downloaded from Github. This will not work on your computer until you have downloaded this file and pulled out the 12AX7 model from the file and placed it in a file of its own with the .sub extension. LT Spice checks the file name and the subckt (sub circuit) name. If they are not the same it issues an error message. The name within the file, the file name, and the label on the tube symbol must all be exactly the same or it won't work.

I'm not going to show you the results. You'll have to draw the schematic on your computer and run the simulation to see them. As shown you will get a text display of the voltages and currents in the circuit. To see the frequency response, right click on the line that begins ";.ac" and remove the semicolon ; You don't have to disable the .op command by putting a semicolon in front of it but maybe you should form the habit of disabling unused commands.

Placing a Tube Model in the Netlist.

To place a tube in your netlist the first step is to locate it in the diagram. The syntax is,
"XU# PlateNode GridNode CathodeNode TubeType".
A line for a tube always begins with the letters XU. The number following the U is the reference number, 1 for the first tube, 2 for the second etc. A directive tells LTspice where to find the model. The syntax is,
".lib TubeType.sub". The two appearances of "TubeType" must be exactly character for character identical.

You only have one more big thing to learn which is stepping parameters. But you do have in hand a set of pretty powerful tools. If you feel inclined to go off on your own, go right ahead. If you aren't too shy about it you might want to report what you are doing on the email list. Or if you would rather not have your name used you could report directly to me off list and let me post it on my daily activities page. If you go that route I promise to keep your name in confidence.

If you can honestly checkoff each item on the list under the heading "What you will learn in lesson 4", you can go on to lesson 5, assuming I have written it by then.


This page last updated Wednesday, March 04, 2020.

Home.