Installing and using LTspice IV (now including LTXVII), From beginner to advanced

I am also reading these last posts where to place extra components for LTSpice so that they are automatically detected.

More than a year ago, Mooly gave me a text file with discrete models for LTSpice. The file name is discrete models.txt. Can I place this file in the place you mention to get automatic detection? Till now, I have always been bypassing LTSpice's failure to automatically include the models by using the .include directive.
 
Administrator
Joined 2007
Paid Member
At least, I saw the magic word "Tubes" in the component selector, and successfully added one to the schematic.

So I think you are seeing it in the component selector because you pasted it into the Program Files rather than the folders installed in the user Documents folder.

If you have actually got copies there then I would probably suggest deleting them.
 
Administrator
Joined 2007
Paid Member
I am also reading these last posts where to place extra components for LTSpice so that they are automatically detected.

More than a year ago, Mooly gave me a text file with discrete models for LTSpice. The file name is discrete models.txt. Can I place this file in the place you mention to get automatic detection? Till now, I have always been bypassing LTSpice's failure to automatically include the models by using the .include directive.

There are so many ways to do all this. I tend to avoid writing to the program files directly because doing so means your installation becomes ever more specific and if for example you reinstall Windows then all that customisation goes... literally out of the Window ;)

I think you can also copy the models to the appropriate program file directly.

For example if you look at the standard.bjt file located in the program files and copy it and change the extension to .txt them you will see it is very similar to my model file. So any models you add to that program file should become available just the same as the default models.

The trouble is keeping track of them all and also the possibility that an update to LT could alter or change the file.
 
There are so many ways to do all this. I tend to avoid writing to the program files directly because doing so means your installation becomes ever more specific and if for example you reinstall Windows then all that customisation goes... literally out of the Window ;)

I think you can also copy the models to the appropriate program file directly.

For example if you look at the standard.bjt file located in the program files and copy it and change the extension to .txt them you will see it is very similar to my model file. So any models you add to that program file should become available just the same as the default models.

The trouble is keeping track of them all and also the possibility that an update to LT could alter or change the file.
I will do a fresh install of LTSpice into Windows 7, and that should clear up all the mess, hopefully. I'm doing very well, BTW. I'm about to perform an analysis of the 6SN7 driver stage for my beloved 300B SET. I've come a long way in a few days, with copious amounts of help from all concerned, mostly your good self. As I said before, quoting another member "diyAudio is one of the internet's greatest resources", and I'm proud to be part of it.
 
Administrator
Joined 2007
Paid Member
You've come a very long way in a very short space of time :up:

(Do you use disk imaging? you should do really, then you can play around all you want and just recover back to where you began if needs be)

I've not used LTXVII on W7 but I would have thought it should behave the same as on W10. As with so many things, you really need to be sat in front of it though.
 
In my experience the easiest way to make sure LTSpice finds your model files is to put them in the same folder as the simulation you're running. The downside is that you end up with many copies of the model file and keeping them all updated is cumbersome.

This was particularly tricky trying to help engineers working in corporate environments where all the models had to reside on a remote server.
 
Administrator
Joined 2007
Paid Member
Yes, I used to do just that with my model file and ended up with dozens and dozens of copies all over the place.

The trouble even now is that there are so many models in the single file that you don't know if a device is there or not... so I usually just enter it anyway and wait for the program to throw a warning up when I run it. Also the default models are hard to navigate and to know what is there or not.

I could really do with a 'my common models' file :D
 
Yes, I used to do just that with my model file and ended up with dozens and dozens of copies all over the place.
Have you used a shortcut pointing to the actual file containing the data? I do not use Windows but shortcuts seem to be the equivalent of symbolic links in Linux. With symbolic links there is no need to update anything apart from the actual file. To make maintenance easier between updates of LTSpice, place the real files containing the data in a fixed location like C:\ltspice_data.

I am assuming shortcuts can do what symbolic links do and I may be wrong.
 
Administrator
Joined 2007
Paid Member
I used to have a copy of the file in each folder that had simulations in it. So dozens and dozens. Each sim had the .include xyz.txt line.

Now I just have one file pasted into the root of the C drive and a line on each sim saying saying .include C:\discrete models.txt

I find it works really well for what I want.
 

Attachments

  • Untitled.png
    Untitled.png
    123.1 KB · Views: 139
I've been looking into this. Using the attached VersionA.asc, in which both capacitors have been changed to a value of 1, the glitches certainly appear at 12kHz, see Fig1.png. At first sight the glitches do not appear at 10kHz or 15kHz, but in fact if you zoom in it is possible to see that the waveforms are pretty rough, see Fig2.png, (15kHz zoomed in).

I've seen this before many times when using super large capacitance values. Decrease the capacitors and it goes away. At high frequencies the impedance of these caps probably reaches the bit depth limit and I suspect it starts to amplify computational errors. That's why I try to avoid the use of 1F capacitors like you see here a lot.

EDIT: As evidence of this, adding 1m internal series resistance to C2 fixes it whereas adding a discrete 1m series resistor does not. The matrix solver takes advantage of the ESR to improve the robustness of the matrix, as the capacitor and ESR are a single component rather than two components with their own voltages that need to be solved independently.

BTW, that 2N2222 model is garbage. Cje=25pF? That will ruin your day in LTspice, if not your dreams. Start with Cordell's models and use ONLY those, if you are new to LTspice and/or don't know how transistors should behave.
 
Last edited:
Regarding Post 1955:
Parameter declarions with the .param directive seemingly do not support what I wanted in the above mentioned post.

To workaround the limitation I changed the duty cycle from 48% to 10%. This simulates active pulse width modulation to achieve a voltage that is lower than what the secondary is supplying. Please, note I added an output inductor and a flyback recirculation diode.

The circuit shown is a forward converter power stage and output stage.

V(n001) is the junction connecting D1's and D2's cathodes.
V(n006) output voltage of L2.
 

Attachments

  • 2020-04-07-162325_1366x717_scrot.png
    2020-04-07-162325_1366x717_scrot.png
    84.8 KB · Views: 127
  • 2020-04-07-163907_1366x717_scrot.png
    2020-04-07-163907_1366x717_scrot.png
    90.2 KB · Views: 125
Last edited:
I think I've got the hang of the application now. I did a week of intense study, which stretched the grey matter to the limit, but that's the kind of challenge I relish. Anyway, I did my own simulation of the paralleled 6SN7 driver stage of the 300B SET. An interesting observation is that the three methods which I employed for FFT and distortion gave the same results with a convergence of better than 0.1%. The longhand calculation became second nature after a while with lots of practice.

I did all this study just to be able to finally perfect my 300B design. but now I can use it for other tube projects. I hope the few screen-grabs make sense. Thanks to all who helped me, especially Mooly. I'm at the beginning of course, and no doubt will need help again.
 

Attachments

  • FFT 6SN7 4V.png
    FFT 6SN7 4V.png
    26.3 KB · Views: 100
  • Frequency Response.png
    Frequency Response.png
    29.2 KB · Views: 99
  • Simulation.png
    Simulation.png
    71.3 KB · Views: 69
Administrator
Joined 2007
Paid Member
:) I know how much I went through with LT in the early days. It took me several weeks to figure out how to use different models for things... and the worst thing for me is that I don't use it all often enough to remember all the details.

So a good tip is to put everything into notes you can refer back to ;)