LTspice... what can you say?  - Page 1
Forum section: electronics / general

author: gnuarm
author_rank: Super Contributor
timestamp: March 11, 2021, 09:15:07 pm
content: 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...

author: StillTrying
author_rank: Super Contributor
timestamp: March 11, 2021, 09:29:36 pm
content: 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.

author: KE5FX
author_rank: Super Contributor
timestamp: March 11, 2021, 09:40:10 pm
content: 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.

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: March 11, 2021, 09:42:27 pm
content: Quote from: gnuarm on March 11, 2021, 09:15:07 pmDon't look a gift horse in the mouth...

author: KE5FX
author_rank: Super Contributor
timestamp: March 11, 2021, 09:46:00 pm
content: Beware of geeks bearing gifts.

author: pigrew
author_rank: Frequent Contributor
timestamp: March 11, 2021, 10:39:14 pm
content: 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.

author: Cerebus
author_rank: Super Contributor
timestamp: March 11, 2021, 11:50:22 pm
content: 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 editorwithsome 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 inandthe 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.asyCode:Version 4SymbolType CELLLINE Normal -32 32 32 64LINE Normal -32 96 32 64LINE Normal -32 32 -32 96LINE Normal -28 48 -20 48LINE Normal -28 80 -20 80LINE Normal -24 84 -24 76LINE Normal 0 32 0 48LINE Normal 0 96 0 80LINE Normal 4 44 12 44LINE Normal 8 40 8 48LINE Normal 4 84 12 84WINDOW 0 16 32 Left 2WINDOW 3 16 96 Left 2SYMATTR Value TL071SYMATTR Prefix XSYMATTR SpiceModel TL071.subSYMATTR Value2 TL071SYMATTR Description JFET Input Operational AmplifierPIN -32 80 NONE 0PINATTR PinName In+PINATTR SpiceOrder 1PIN -32 48 NONE 0PINATTR PinName In-PINATTR SpiceOrder 2PIN 0 32 NONE 0PINATTR PinName V+PINATTR SpiceOrder 3PIN 0 96 NONE 0PINATTR PinName V-PINATTR SpiceOrder 4PIN 32 64 NONE 0PINATTR PinName OUTPINATTR SpiceOrder 5TL071.subCode:* 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-12C2 6 7 15.00E-12DC 5 53 DXDE 54 5 DXDLP 90 91 DXDLN 92 90 DXDP 4 3 DXEGND 99 0 POLY(2) (3,0) (4,0) 0 .5 .5FB 7 99 POLY(5) VB VC VE VLP VLN 0 4.715E6 -5E6 5E6 5E6 -5E6GA 6 0 11 12 282.8E-6GCM 0 6 10 99 8.942E-9ISS 3 10 DC 195.0E-6HLIM 90 0 VLIM 1KJ1 11 2 10 JXJ2 12 1 10 JXR2 6 9 100.0E3RD1 4 11 3.536E3RD2 4 12 3.536E3RO1 8 5 150RO2 7 99 150RP 3 4 2.143E3RSS 10 99 1.026E6VB 9 0 DC 0VC 3 53 DC 2.200VE 54 4 DC 2.200VLIM 7 8 DC 0VLP 91 0 DC 25VLN 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

author: gnuarm
author_rank: Super Contributor
timestamp: March 12, 2021, 01:37:32 am
content: Quote from: Cerebus on March 11, 2021, 11:50:22 pm

author: gnuarm
author_rank: Super Contributor
timestamp: March 12, 2021, 01:48:31 am
content: Quote from: pigrew on March 11, 2021, 10:39:14 pmI 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.

author: Bassman59
author_rank: Super Contributor
timestamp: March 12, 2021, 05:14:11 pm
content: Quote from: JohnnyMalaria on March 11, 2021, 09:42:27 pmIt's the truth.

author: nctnico
author_rank: Super Contributor
timestamp: March 12, 2021, 05:22:26 pm
content: Quote from: gnuarm on March 11, 2021, 09:15:07 pmI'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).

author: Bassman59
author_rank: Super Contributor
timestamp: March 12, 2021, 05:30:26 pm
content: Quote from: Cerebus on March 11, 2021, 11:50:22 pmFor 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.

author: Cerebus
author_rank: Super Contributor
timestamp: March 12, 2021, 06:04:24 pm
content: Quote from: Bassman59 on March 12, 2021, 05:30:26 pmOr 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.

author: gnuarm
author_rank: Super Contributor
timestamp: March 12, 2021, 11:40:32 pm
content: Quote from: nctnico on March 12, 2021, 05:22:26 pmI 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!

author: rfclown
author_rank: Frequent Contributor
timestamp: March 13, 2021, 12:28:20 am
content: 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.

author: julian1
author_rank: Frequent Contributor
timestamp: March 13, 2021, 12:37:13 am
content: 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.

author: schmitt trigger
author_rank: Super Contributor
timestamp: March 13, 2021, 12:37:50 am
content: 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

author: gnuarm
author_rank: Super Contributor
timestamp: March 13, 2021, 01:36:50 am
content: Quote from: julian1 on March 13, 2021, 12:37:13 amThe 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

author: SilverSolder
author_rank: Super Contributor
timestamp: March 13, 2021, 03:06:14 am
content: LTspice is like Photoshop: extremely deep, and extremely hard to learn to drive - but once you're there, it is pure awesomeness!

author: Bassman59
author_rank: Super Contributor
timestamp: March 15, 2021, 06:27:10 pm
content: Quote from: julian1 on March 13, 2021, 12:37:13 amThe 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.

author: nctnico
author_rank: Super Contributor
timestamp: March 15, 2021, 10:02:32 pm
content: Quote from: gnuarm on March 12, 2021, 11:40:32 pmIMHO 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.

author: gnuarm
author_rank: Super Contributor
timestamp: March 15, 2021, 11:06:51 pm
content: Quote from: Bassman59 on March 15, 2021, 06:27:10 pmThe 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.