Author Topic: LTspice... what can you say?  (Read 5314 times)

0 Members and 1 Guest are viewing this topic.

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
LTspice... what can you say?
« on: March 11, 2021, 09:15:07 pm »
LTspice is a very popular simulation tool and even used for general schematic capture.  But it is a tool that I just can't abide.  It is so awkward and so poorly supported, if you are doing anything other than the most basic, simple things it is very hard to use. 

Today's problem is trying to use an external model.  This is a recurring theme with me.  The various instructions on trying to connect a model to a simulation are so arcane and cumbersome, often providing so much background that the issue being discussed is lost. 

So I have a .mod file for a ferrite bead.  Surprisingly, they use four resistors, three inductors and a capacitor for their model.  Ok, that's transparent to me.  I always stumble around trying to merge these things with some sort of a .asy file for a symbol, but I was missing some info and couldn't get the model to connect with the generic ferrite bead symbol.  This time I found instruction web page that talked about creating a symbol from scratch that automatically was linked to the model, great!  The symbol created is a rectangle. 

Ok, so let's copy the graphics of the library symbol to this special symbol.  No, not supported in the editor.  Ok, a web page says to copy the text between the files.  Ok, so which text?  I see a rectangle command, that needs to go, and a window command... what is that?  More web searching reveals nothing.  There is not much info on the web about LTspice file formats and adding "window" to the search does NOTHING to reduce the chaff. 

So let's just simulate with the rectangle and worry about making it pretty another day.  Where is it?  It's supposed to be in ...\LTspice\Lib\Sym\AutoGenerated and sure enough, file manager says it's there.  But LTspice can't find it.  More googling and it seems even though LTspice just created it, it doesn't know enough to see it, so I have to exit the program and restart!

At this point I've spent over an hour trying to do something simple.  I think no small part of the issue is that I tend to use LTspice infrequently so the little gems I learn are often lost by the time I use it again.  But this is no simple program to use.  I am pretty confident that the primary reason it is widely used is because it is free.  That and that reason only.

I'm going out to do some yard work...
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: LTspice... what can you say?
« Reply #1 on: March 11, 2021, 09:29:36 pm »
Yep. :)

I spent hours trying to add .asy and .sub to LT's program folder and it never found them, then I noticed it has made a copy of all the components in Users/Me/MyDocuments, adding them there it finds them, but I've only got the LM339 to work.
.  That took much longer than I thought it would.
 

Online KE5FX

  • Super Contributor
  • ***
  • Posts: 2014
  • Country: us
    • KE5FX.COM
Re: LTspice... what can you say?
« Reply #2 on: March 11, 2021, 09:40:10 pm »
It's awe-inspiring to think of how great LTSpice could be if they'd only open-source it.  Imagine if companies like TI, Analog, and .... well, OK, TI and Analog, could compete on delivering the best parts with the most accurate SPICE models, rather than competing on delivering the most annoying proprietary SPICE simulator.

At some point, I have to think that even ADI will come around to that perspective. 
 

Offline JohnnyMalaria

  • Super Contributor
  • ***
  • Posts: 1154
  • Country: us
    • Enlighten Scientific LLC
Re: LTspice... what can you say?
« Reply #3 on: March 11, 2021, 09:42:27 pm »
I am pretty confident that the primary reason it is widely used is because it is free.  That and that reason only.

Don't look a gift horse in the mouth...
 

Online KE5FX

  • Super Contributor
  • ***
  • Posts: 2014
  • Country: us
    • KE5FX.COM
Re: LTspice... what can you say?
« Reply #4 on: March 11, 2021, 09:46:00 pm »
Beware of geeks bearing gifts.
 
The following users thanked this post: SilverSolder

Offline pigrew

  • Frequent Contributor
  • **
  • Posts: 680
  • Country: us
Re: LTspice... what can you say?
« Reply #5 on: March 11, 2021, 10:39:14 pm »
Yes, many bits of LTSpice are not so convenient.

In this case of a ferrite bead, what I do is copy and paste the contents of the model file into the schematic (as a spice directive). Then I can CTRL-right-click the generic ferrite bead or whichever component, and set its "value" to be the subcircuit name or model name. For subcircuit models, the prefix must be modified to be X.

EDIT: Another advantage of this is that you can send your .asc files to others, with no need to also send external models & symbols.
« Last Edit: March 12, 2021, 01:22:38 am by pigrew »
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: LTspice... what can you say?
« Reply #6 on: March 11, 2021, 11:50:22 pm »
Nothing to it.  :)

I keep my self generated LTSpice symbols and models in their own directory. Makes it easier to avoid muddling them up with the native LTSpice ones.

So, how to do it. First off, find somewhere to keep your symbols and models - I keep mine in a directory called, imaginatively, "SpiceLib". I'm running the Windows version of LTSpice under CrossOver on a Mac so my home directory (where SpiceLib lives) appears as drive "Y:" in LTSpice.

Here's the contents of the "SpiceLib" directory:



Tell LTSpice where these files are:



Use the Draft/Component dialogue to place one of them. Note that top line - you MUST select YOUR component library. If you don't you'll just see the standard locations.



You'll have to create your own symbols. These are best done in LTSpice's symbol editor with some subsequent editing in a text editor. Watch out for pin naming/order both in the symbol and the subcircuit.

Here are the symbol and model files for the TL071. Note the SYMATTR lines that names the library file to find the component in and the component subcircuit name. You can put multiple components in one '.lib' file if you so choose but each component needs its own ".asy" file.
:-

TL071.asy
Code: [Select]
Version 4
SymbolType CELL
LINE Normal -32 32 32 64
LINE Normal -32 96 32 64
LINE Normal -32 32 -32 96
LINE Normal -28 48 -20 48
LINE Normal -28 80 -20 80
LINE Normal -24 84 -24 76
LINE Normal 0 32 0 48
LINE Normal 0 96 0 80
LINE Normal 4 44 12 44
LINE Normal 8 40 8 48
LINE Normal 4 84 12 84
WINDOW 0 16 32 Left 2
WINDOW 3 16 96 Left 2
SYMATTR Value TL071
SYMATTR Prefix X
SYMATTR SpiceModel TL071.sub
SYMATTR Value2 TL071
SYMATTR Description JFET Input Operational Amplifier
PIN -32 80 NONE 0
PINATTR PinName In+
PINATTR SpiceOrder 1
PIN -32 48 NONE 0
PINATTR PinName In-
PINATTR SpiceOrder 2
PIN 0 32 NONE 0
PINATTR PinName V+
PINATTR SpiceOrder 3
PIN 0 96 NONE 0
PINATTR PinName V-
PINATTR SpiceOrder 4
PIN 32 64 NONE 0
PINATTR PinName OUT
PINATTR SpiceOrder 5

TL071.sub
Code: [Select]
* TL071 OPERATIONAL AMPLIFIER "MACROMODEL" SUBCIRCUIT
* CREATED USING PARTS RELEASE 4.01 ON 06/16/89 AT 13:08
* (REV N/A)      SUPPLY VOLTAGE: +/-15V
* CONNECTIONS:   NON-INVERTING INPUT
*                | INVERTING INPUT
*                | | POSITIVE POWER SUPPLY
*                | | | NEGATIVE POWER SUPPLY
*                | | | | OUTPUT
*                | | | | |
.SUBCKT TL071    1 2 3 4 5
*
  C1   11 12 3.498E-12
  C2    6  7 15.00E-12
  DC    5 53 DX
  DE   54  5 DX
  DLP  90 91 DX
  DLN  92 90 DX
  DP    4  3 DX
  EGND 99  0 POLY(2) (3,0) (4,0) 0 .5 .5
  FB    7 99 POLY(5) VB VC VE VLP VLN 0 4.715E6 -5E6 5E6 5E6 -5E6
  GA    6  0 11 12 282.8E-6
  GCM   0  6 10 99 8.942E-9
  ISS   3 10 DC 195.0E-6
  HLIM 90  0 VLIM 1K
  J1   11  2 10 JX
  J2   12  1 10 JX
  R2    6  9 100.0E3
  RD1   4 11 3.536E3
  RD2   4 12 3.536E3
  RO1   8  5 150
  RO2   7 99 150
  RP    3  4 2.143E3
  RSS  10 99 1.026E6
  VB    9  0 DC 0
  VC    3 53 DC 2.200
  VE   54  4 DC 2.200
  VLIM  7  8 DC 0
  VLP  91  0 DC 25
  VLN   0 92 DC 25
.MODEL DX D(IS=800.0E-18)
.MODEL JX PJF(IS=15.00E-12 BETA=270.1E-6 VTO=-1)
.ENDS
« Last Edit: March 12, 2021, 12:13:49 am by Cerebus »
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 
The following users thanked this post: SilverSolder

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: LTspice... what can you say?
« Reply #7 on: March 12, 2021, 01:37:32 am »
Nothing to it.  :)

<<< snipped nothing >>>

I'm not sure if I should laugh or cry, but I don't think you were making a joke.

Thanks for the info.  I may find the time to wind my way through it, but in reality there is no shortage of info on how to add components to the libraries or create your own libraries or not use libraries at all and just put everything in your project directory or just put everything in the durn schematic.   No shortage at all.  It's just hard to make it work consistently because LTspice has so many "special" cases.  Kinda like how a net is a bunch of holes sewn together, LTspice is a bunch  of special cases with almost no standard way of doing much.  It is easy for the simplest stuff though.  So that's something good.

Then the chip I'm looking to use is only supported for MPS in house simulator.  lol 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: LTspice... what can you say?
« Reply #8 on: March 12, 2021, 01:48:31 am »
Yes, many bits of LTSpice are not so convenient.

In this case of a ferrite bead, what I do is copy and paste the contents of the model file into the schematic (as a spice directive). Then I can CTRL-right-click the generic ferrite bead or whichever component, and set its "value" to be the subcircuit name or model name. For subcircuit models, the prefix must be modified to be X.

EDIT: Another advantage of this is that you can send your .asc files to others, with no need to also send external models & symbols.

I think I'll try this.  Seems like the path of least resistance. 

I'm a bit frazzled from any number of things not going well for me the last few days so I want simple.  One of the biggies is I am trying to port my phone number from Google fi (bad provider, literally no human support) to ATT only to find that I just missed the deadline.  Seems they are cutting off 3G support and my smart phone won't be functional with them in 12 months, so I can't transfer it now.  For some reason 3G seems to include ATT 4G as well which my phone supports.  You have to have LTE capability to continue to work.  Grrrr...  I'm taking it out on LTspice.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: LTspice... what can you say?
« Reply #9 on: March 12, 2021, 05:14:11 pm »
I am pretty confident that the primary reason it is widely used is because it is free.  That and that reason only.

Don't look a gift horse in the mouth...

It's the truth.

 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28101
  • Country: nl
    • NCT Developments
Re: LTspice... what can you say?
« Reply #10 on: March 12, 2021, 05:22:26 pm »
I am pretty confident that the primary reason it is widely used is because it is free.
I'm very sure that is the reason. The UI of LTspice is archaic at best. A couple of days ago I have given Microcap 12 a try and that seems to be more easy to drive (but I must say I have some experience using the simulation part of Orcad).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: LTspice... what can you say?
« Reply #11 on: March 12, 2021, 05:30:26 pm »
So, how to do it. First off, find somewhere to keep your symbols and models - I keep mine in a directory called, imaginatively, "SpiceLib". I'm running the Windows version of LTSpice under CrossOver on a Mac so my home directory (where SpiceLib lives) appears as drive "Y:" in LTSpice.

Tell LTSpice where these files are:


For reasons known only to Mike Engelhardt, the macOS version of LTSpice doesn't have this nifty search path option. You have to embed the library reference directly in the schematic. Piffle.
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: LTspice... what can you say?
« Reply #12 on: March 12, 2021, 06:04:24 pm »
So, how to do it. First off, find somewhere to keep your symbols and models - I keep mine in a directory called, imaginatively, "SpiceLib". I'm running the Windows version of LTSpice under CrossOver on a Mac so my home directory (where SpiceLib lives) appears as drive "Y:" in LTSpice.

Tell LTSpice where these files are:


For reasons known only to Mike Engelhardt, the macOS version of LTSpice doesn't have this nifty search path option. You have to embed the library reference directly in the schematic. Piffle.

Or any of several other features (like "edit simulation command") which is why I run the PC version under WINE/CrossOver on a Mac. The only thing to be said in defence of the macOS version of LTSpice is that it produces smoother and cleaner looking graphics.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: LTspice... what can you say?
« Reply #13 on: March 12, 2021, 11:40:32 pm »
I am pretty confident that the primary reason it is widely used is because it is free.
I'm very sure that is the reason. The UI of LTspice is archaic at best. A couple of days ago I have given Microcap 12 a try and that seems to be more easy to drive (but I must say I have some experience using the simulation part of Orcad).

I used to be pretty bent out about the UI of the schematic editor and waveform viewer, but it doesn't bother me so much now.  I actually prefer the editor to KiCAD.  The big thing is the whole importing models thing more than anything else.  I really dread having to do that because it's always a struggle. 

Maybe I need to bite the bullet and take a day or two and do enough research to write my own tutorial.  Then it would stick I expect and if it didn't I could return to my notes and gripe about how poorly the author explained everything!
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline rfclown

  • Frequent Contributor
  • **
  • Posts: 416
  • Country: us
Re: LTspice... what can you say?
« Reply #14 on: March 13, 2021, 12:28:20 am »
I second pigrew's suggestion. Two big advantages are 1. you can share with other's with just the .asc file (like he said), and 2. when you open your file years later, you'll say, "Oh yeah, that's how you can do it". I've used libraries, but this method is self contained and avoids memory lapse problems.
« Last Edit: March 13, 2021, 12:30:30 am by rfclown »
 

Offline julian1

  • Frequent Contributor
  • **
  • Posts: 771
  • Country: au
Re: LTspice... what can you say?
« Reply #15 on: March 13, 2021, 12:37:13 am »
One thing I find odd with ltspice, is the apparent lack of community contributed ltspice models available on github/gitlab.
 
I needed and after a lot of searching found a 74hc.lib. This library was created by and accessible to members of a now defunct ltspice yahoo group. But it is quite difficult to find on the open web.

I was wondering if there was some license restriction or other reason that means it should not be posted to github/gitlab? It just seems like a waste, that useful community code is not shared more freely.

 

Offline schmitt trigger

  • Super Contributor
  • ***
  • Posts: 2358
  • Country: mx
Re: LTspice... what can you say?
« Reply #16 on: March 13, 2021, 12:37:50 am »
Remember that book series: “ xxxx for Dummies”?

Whoever writes first a “LTSpice for Dummies” book would make a killing. 

https://en.m.wikipedia.org/wiki/For_Dummies
« Last Edit: March 13, 2021, 12:40:25 am by schmitt trigger »
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: LTspice... what can you say?
« Reply #17 on: March 13, 2021, 01:36:50 am »
One thing I find odd with ltspice, is the apparent lack of community contributed ltspice models available on github/gitlab.
 
I needed and after a lot of searching found a 74hc.lib. This library was created by and accessible to members of a now defunct ltspice yahoo group. But it is quite difficult to find on the open web.

I was wondering if there was some license restriction or other reason that means it should not be posted to github/gitlab? It just seems like a waste, that useful community code is not shared more freely.

The group is not defunct, just moved to more hospitable hosting.  I would have hoped the group owner would have been thoughtful enough to have left a forwarding address on the Yahoo group main page. 

https://groups.io/g/LTspice
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: LTspice... what can you say?
« Reply #18 on: March 13, 2021, 03:06:14 am »

LTspice is like Photoshop:  extremely deep, and extremely hard to learn to drive - but once you're there, it is pure awesomeness!
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: LTspice... what can you say?
« Reply #19 on: March 15, 2021, 06:27:10 pm »
One thing I find odd with ltspice, is the apparent lack of community contributed ltspice models available on github/gitlab.
 
I needed and after a lot of searching found a 74hc.lib. This library was created by and accessible to members of a now defunct ltspice yahoo group. But it is quite difficult to find on the open web.

I was wondering if there was some license restriction or other reason that means it should not be posted to github/gitlab? It just seems like a waste, that useful community code is not shared more freely.

The guy who ran the old Yahoo! group is an analog circuit design engineer and my guess is that he either doesn't know about gitlab or github, or doesn't know how/the best way to put the contributed component models and symbols into a repository.

What he was doing with the old group worked well enough, I think.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28101
  • Country: nl
    • NCT Developments
Re: LTspice... what can you say?
« Reply #20 on: March 15, 2021, 10:02:32 pm »
I am pretty confident that the primary reason it is widely used is because it is free.
I'm very sure that is the reason. The UI of LTspice is archaic at best. A couple of days ago I have given Microcap 12 a try and that seems to be more easy to drive (but I must say I have some experience using the simulation part of Orcad).
I used to be pretty bent out about the UI of the schematic editor and waveform viewer, but it doesn't bother me so much now.
IMHO the way the schematic editor works has been copied / taken from a much older program to draw circuit diagrams. I just can't remember which one after 3 decades.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline gnuarmTopic starter

  • Super Contributor
  • ***
  • Posts: 2247
  • Country: pr
Re: LTspice... what can you say?
« Reply #21 on: March 15, 2021, 11:06:51 pm »
One thing I find odd with ltspice, is the apparent lack of community contributed ltspice models available on github/gitlab.
 
I needed and after a lot of searching found a 74hc.lib. This library was created by and accessible to members of a now defunct ltspice yahoo group. But it is quite difficult to find on the open web.

I was wondering if there was some license restriction or other reason that means it should not be posted to github/gitlab? It just seems like a waste, that useful community code is not shared more freely.

The guy who ran the old Yahoo! group is an analog circuit design engineer and my guess is that he either doesn't know about gitlab or github, or doesn't know how/the best way to put the contributed component models and symbols into a repository.

What he was doing with the old group worked well enough, I think.

The real problem with the files at the support forum was quality and organization.  It was a bit like touring the junk yard... I mean recycle center.  There are all sorts of nuggets, but not so easy to find.  Whatever you did find was of uncertain origin or even purpose.  There are a number of libraries for the 4000 series CMOS devices each intended for a particular purpose, but with pretty much universally no documentation.  So of questionable utility. 

Also like a junk yard... I mean recycle center, there is just an overwhelming quantity of files to deal with. 

There were actually two losses in that group recently.  Analogspiceman and Helmut Sennewald both passed away around a year ago.  I recall Helmut was always supportive and helpful.  A very good egg.  A lot like the folks here.
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf