Difference between revisions of "LTSpice"

From Steak Wiki
Jump to navigationJump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
LTSpice is a popular simulation package.
+
LTSpice is a popular simulation package. The successor to LTSpice is qspice, also programmed by the same developer. https://hackaday.com/2023/08/25/qspice-picks-up-where-ltspice-left-us/
 
==Getting Started==
 
==Getting Started==
 
* https://learn.sparkfun.com/tutorials/getting-started-with-ltspice/all - some videos here, and they also  link to the LT youtube playlist. The forum is DOA, don't bother clicking that. Some high frequency noise on the sprakfun videos. they cover most of what the LT videos cover but in a different interpretation. Both worth watching.
 
* https://learn.sparkfun.com/tutorials/getting-started-with-ltspice/all - some videos here, and they also  link to the LT youtube playlist. The forum is DOA, don't bother clicking that. Some high frequency noise on the sprakfun videos. they cover most of what the LT videos cover but in a different interpretation. Both worth watching.
 +
* http://web.archive.org/web/20020909153731/http://www.macs.ee.mcgill.ca/~roberts/SPICE/Welcome1.html - I have come across this book in my used book store browsing, and own a copy of the 2nd edition.
 +
 +
==General Notes==
 +
0 is a gnd in the netlist. That means you can go to: view - spice netlist, and the path items will be 0 V001 or some variation thereof. The netlists are text files, and easily readable. Spice (LTSpice) overall, seems to be a program that one person can understand, which is a benefit, since time is limited.
 +
 +
AoE uses ICAP/4 Spice. It runs about $3,500 for the base software. There is a free demo for schematics under 20 parts. The X chapters, has a section of spice, but it's not in the 3rd edition. They also list, MicroCap 9, MMICAD, and PSpice. There are some Spice book recommendations in the spice section, and in other sections (e.g. the Power, Regulation, and Control, or Amplifiers). This is all in the appendix.
 +
 +
Spice is only a partially useful tool. It's not to be trusted. Actual systems in the world are more complex than our models, so we can't truly simulate a circuit. But that doesn't mean there isn't some value in the models.
  
 
==Tips/Techniques==
 
==Tips/Techniques==
===Amp Hour===
+
===Amp Hour Podcast Interview with the Programmer===
 
https://theamphour.com/196-an-interview-with-mike-engelhardt-spice-simulator-synteresis/
 
https://theamphour.com/196-an-interview-with-mike-engelhardt-spice-simulator-synteresis/
 
===Simulating a delay===
 
===Simulating a delay===
Line 11: Line 19:
 
===Guaranteed to Work on Linux (TM)===
 
===Guaranteed to Work on Linux (TM)===
 
* https://github.com/joaocarvalhoopen/LTSpice_on_Linux_Ubuntu__How_to_install_and_use
 
* https://github.com/joaocarvalhoopen/LTSpice_on_Linux_Ubuntu__How_to_install_and_use
For 32 bit linux, use LTSpice XVII.  
+
For 32 bit linux, use LTSpice XVII (which I have running on Devuan/Debian 12).
 
===Stepping Parameters===
 
===Stepping Parameters===
 
beginning, end, interval. E.g. test a capacitor from 2nf to 10nf in 2nf steps.  
 
beginning, end, interval. E.g. test a capacitor from 2nf to 10nf in 2nf steps.  
 
* https://www.youtube.com/watch?v=hH74uZvEm6I
 
* https://www.youtube.com/watch?v=hH74uZvEm6I
 +
===Exporting Data for a Spreadsheet Graph===
 +
[[File:LTSpice Export to graph example.png|300px|thumb|right|Sine Wave Example Graph. An expert in graphs will be able to predict how data will render in a given form of graph. I'm still working on guessing Logarithmic data from Linear data.]]
 +
<pre>
 +
how to export waveform data, as in traditional spice? - right click on the graph and
 +
choose file - export data as text.
 +
 +
the data requires a step of processing. you can use sed if you need to automate it
 +
but i used mousepad, and a search and replace, copying the empty (some unicode type space)
 +
character so it's easy to import into libreoffice calc (slow) or gnumeric (better).
 +
you might want to either A) limit the amount of data by zooming into an area or
 +
B) use head -n 1000 to limit the lines of output. I had 24,000 lies which was a bit
 +
much (graphing that much data is slow). See the image example.
 +
of course, this allows you to change the visualization used with the data. in this day
 +
and age, you have to be good with graphs as well. there is no reason not to be.
 +
</pre>
 +
 +
=== The .op Function ===
 +
LTSpice is its own spice. Given that each spice program is slightly different, there
 +
are some quirks with trying to get functionality from one to translate to another.
 +
 +
 +
If you add .op, it will output a .op.raw file, which will tell you the voltages of everything.
 +
it opens in LTSpice. I'm not sure what encoding it is, (haven't checked yet) as emacs or mousepad has trouble with it.
 +
(I'm following the spice textbook i listed above). the .raw is a waveform file for LTSpice.
 +
This is different from PSpice, where the .op command will be output into the 'overall' spice output file (according to
 +
the textbook).
 +
 +
==See Also==
 +
* [[External_Wikis#Electronics]] - LTSpice Wiki
 +
* http://www.intusoft.com/icap.htm
 +
  
 
[[Category:online_notes]]
 
[[Category:online_notes]]

Latest revision as of 01:00, 30 October 2025

LTSpice is a popular simulation package. The successor to LTSpice is qspice, also programmed by the same developer. https://hackaday.com/2023/08/25/qspice-picks-up-where-ltspice-left-us/

Getting Started

General Notes

0 is a gnd in the netlist. That means you can go to: view - spice netlist, and the path items will be 0 V001 or some variation thereof. The netlists are text files, and easily readable. Spice (LTSpice) overall, seems to be a program that one person can understand, which is a benefit, since time is limited.

AoE uses ICAP/4 Spice. It runs about $3,500 for the base software. There is a free demo for schematics under 20 parts. The X chapters, has a section of spice, but it's not in the 3rd edition. They also list, MicroCap 9, MMICAD, and PSpice. There are some Spice book recommendations in the spice section, and in other sections (e.g. the Power, Regulation, and Control, or Amplifiers). This is all in the appendix.

Spice is only a partially useful tool. It's not to be trusted. Actual systems in the world are more complex than our models, so we can't truly simulate a circuit. But that doesn't mean there isn't some value in the models.

Tips/Techniques

Amp Hour Podcast Interview with the Programmer

https://theamphour.com/196-an-interview-with-mike-engelhardt-spice-simulator-synteresis/

Simulating a delay

https://www.youtube.com/watch?v=-aQ77YI7inI A competent user of LTSpice. A good video to show usage and a reasonable circuit as well (the circuit is essentially simulating a 555 timer from discrete (well op amps) components).

Guaranteed to Work on Linux (TM)

For 32 bit linux, use LTSpice XVII (which I have running on Devuan/Debian 12).

Stepping Parameters

beginning, end, interval. E.g. test a capacitor from 2nf to 10nf in 2nf steps.

Exporting Data for a Spreadsheet Graph

Sine Wave Example Graph. An expert in graphs will be able to predict how data will render in a given form of graph. I'm still working on guessing Logarithmic data from Linear data.
how to export waveform data, as in traditional spice? - right click on the graph and
choose file - export data as text.

the data requires a step of processing. you can use sed if you need to automate it
but i used mousepad, and a search and replace, copying the empty (some unicode type space)
character so it's easy to import into libreoffice calc (slow) or gnumeric (better).
you might want to either A) limit the amount of data by zooming into an area or
B) use head -n 1000 to limit the lines of output. I had 24,000 lies which was a bit
much (graphing that much data is slow). See the image example.
of course, this allows you to change the visualization used with the data. in this day
and age, you have to be good with graphs as well. there is no reason not to be.

The .op Function

LTSpice is its own spice. Given that each spice program is slightly different, there are some quirks with trying to get functionality from one to translate to another.


If you add .op, it will output a .op.raw file, which will tell you the voltages of everything. it opens in LTSpice. I'm not sure what encoding it is, (haven't checked yet) as emacs or mousepad has trouble with it. (I'm following the spice textbook i listed above). the .raw is a waveform file for LTSpice. This is different from PSpice, where the .op command will be output into the 'overall' spice output file (according to the textbook).

See Also