EEVblog #516 - LTSPICE Tutorial - DC Operating Point Analysis - Page 1
Forum section: electronics / general

author: EEVblog
author_rank: Unknown
timestamp: September 07, 2013, 07:56:27 am
content: Part 1 in a series of LTSPICE tutorial videos.In this introduction Dave explains what LTSPICE is and how to do the simplest of the SPICE analysis options - basic DC operating point analysis.Also how to draw basic schematics, display voltages and current on your schematic, and a beginner few traps to avoid.

author: jancumps
author_rank: Unknown
timestamp: September 07, 2013, 08:25:59 am
content: What do you use to make videos with screen capture and voice over?

author: EEVblog
author_rank: Unknown
timestamp: September 07, 2013, 08:31:11 am
content: Quote from: jancumps on September 07, 2013, 08:25:59 amCamstudioThe trick is setting a fixed screen of 1280x720 so you don't get re-sizing distortion. Full HD is too big and ends up with text too small.

author: floris
author_rank: Newbie
timestamp: September 07, 2013, 08:32:43 am
content: I am very curious what you think of TINAin the beginning of the 90's we used this in scool so this exits very long alreadyIt has very nice analysis functions

author: firewalker
author_rank: Super Contributor
timestamp: September 07, 2013, 09:15:47 am
content: And LTSpice is available for Windows, GNU/Linux and MacOS.Alexander.

author: Dagon
author_rank: Regular Contributor
timestamp: September 07, 2013, 09:42:06 am
content: Good stuff, I was just starting to use ltspice so this is good timing!There is indeed a lot of videos on ltspice out there already but a lot of them aren't very good.

author: cyteen
author_rank: Newbie
timestamp: September 07, 2013, 09:45:27 am
content: Any chance you could add the use of ASCO (A SPICE Circuit Optimizer)http://sourceforge.net/projects/asco/?source=pdlpwith LTSPICE to your series of tutorials?

author: firewalker
author_rank: Super Contributor
timestamp: September 07, 2013, 10:24:12 am
content: Quote from: cyteen on September 07, 2013, 09:45:27 amI compiled a Win32 (didn't saw a Windows binary) version for him in case he wants to try it.https://dl.dropboxusercontent.com/u/31742622/ASCO-0.4.9.rarAlexander.

author: EEVblog
author_rank: Unknown
timestamp: September 07, 2013, 11:31:13 am
content: Quote from: cyteen on September 07, 2013, 09:45:27 amI have not used that before, but most likely not. It would be wise to stick with the stock install of LTSPICE for tutorials.

author: Jebnor
author_rank: Regular Contributor
timestamp: September 07, 2013, 02:28:49 pm
content: Fantastic!At the end, you were looking at the sample Audio Amp. Any chance you could talk Doug into doing an Amplifer design tutorial series?

author: mrflibble
author_rank: Super Contributor
timestamp: September 07, 2013, 03:10:09 pm
content: Nice tutorial, I think you covered the basics for operating point pretty well.Including the ever popular M vs Meg. Have had fun with that one in the past, grrrrr.

author: wblackledg
author_rank: Regular Contributor
timestamp: September 07, 2013, 03:16:33 pm
content: excellent as usual dave!So maybe this is a newbie question ,but for simple circuits can't you use this as a design tool and export it to create a pcb?

author: nigel53
author_rank: Newbie
timestamp: September 07, 2013, 03:23:50 pm
content: Excellent stuff!As said before loads of video's on this but most are not very good. I would tend to agree that concentrating on LTSpice is the better option than trying to cover other products as well. Looking forward to importing other models into LTSpice.

author: Rigby
author_rank: Super Contributor
timestamp: September 07, 2013, 03:56:05 pm
content: Aah, thank you for this. Just as I was beginning to play with LTSpice, too. Excellent. (I was going to type "Bloody Ripper" there but it just isn't cool when an American says it.)Since you're going to teach us all how to use LTSpice, I think it would be extremely apropos if you (or someone) could start tossing up LTSpice schematics of the demo circuits you show us, such as the soft latch circuit and such, so that we can have a play as well. Though, I guess if you're going to teach folks to use the tool, the students should implement the circuits in LTSpice themselves, huh?Thanks again.

author: mrflibble
author_rank: Super Contributor
timestamp: September 07, 2013, 04:15:11 pm
content: Quote from: wblackledg on September 07, 2013, 03:16:33 pmNot sure if that's the easiest design flow around... In the past I have used gschem to do the schematic and then used that in ltspice. All in all, I don't think ltspice is the obvious choice for schematic capture (with the goal of producing a pcb from the schematic). Ltspice is however a very nice choice as simulation engine.

author: Zbig
author_rank: Frequent Contributor
timestamp: September 07, 2013, 07:00:22 pm
content: I admit I haven't installed it yet but is there any simple way of switching it to "European" schematic symbols (I don't know the proper name of the standard)? You know, rectangles for resistors instead of the springy-thingy, etc. It's not an "ideological" thing for me or anything, it's just easier for me to wrap my head around when seeing more familiar visual language (e.g. when I see "US" resistor symbol, I immediately think "inductor").

author: Bored@Work
author_rank: Super Contributor
timestamp: September 07, 2013, 07:19:31 pm
content: Quote from: Zbig on September 07, 2013, 07:00:22 pmYes and no. It comes with a few European symbols. But you would normally have to select them separately (from the component menu, not from the toolbar), which gets annoying pretty fast.Alternatively, what you can do is to replace the US symbols in the LTspice installation with the European ones. This is relatively simple, because LTspice uses one file per symbol. You will find that a few European symbol versions are missing, so you need to draw your own with LTspice's symbol editor. And be aware that an LTspice update "sync release" undoes your changes. It is important that you keep the relative position of all the pins of all the symbols you replace.I have a .bat script that I run as administrator which replaces a few symbols with my own ones, including European symbols. It just does a simple copy of the contents of my symbol directory hierarchy to the lib\sym directory hierarchy of the LTspice installation.

author: hikariuk
author_rank: Unknown
timestamp: September 07, 2013, 09:44:18 pm
content: Quote from: Zbig on September 07, 2013, 07:00:22 pmI believe the standard for European style symbols is IEC 60617.

author: wblackledg
author_rank: Regular Contributor
timestamp: September 08, 2013, 02:38:15 am
content: I was trying to emulate this with ltspice as a tutorial for myself. I have an interest in Crystal radios.I couldn't figure out the switch or the antenna? perhaps this is not a very good example of a first try?thanks.

author: c4757p
author_rank: Super Contributor
timestamp: September 08, 2013, 02:44:04 am
content: For the antenna, use a voltage source with the impedance of the antenna as series resistance. Obviously you'll need to know the signal strength. For the switch, just make a connection where you want the switch closed.Good luck finding a working model of a germanium diode.

author: wblackledg
author_rank: Regular Contributor
timestamp: September 08, 2013, 02:49:31 am
content: Quote from: c4757p on September 08, 2013, 02:44:04 amyeah, I think that diode is sort of the heart of any crystal set. that was why I was wondering if this was not the best place to start..

author: c4757p
author_rank: Super Contributor
timestamp: September 08, 2013, 04:29:32 am
content: Anyway, you haven't put your home country in your profile, so I don't know whether advising you on how to simulate a crystal radio in SPICE would be considered aiding and abetting criminal blasphemy.

author: Zbig
author_rank: Frequent Contributor
timestamp: September 08, 2013, 10:35:11 am
content: Quote from: Bored@Work on September 07, 2013, 07:19:31 pmThank you, that's a helpful hint and I'll definitely try it out.

author: alanb
author_rank: Frequent Contributor
timestamp: September 08, 2013, 11:02:01 am
content: I have recently started to use both Ltspice and Diptrace and have tried unsuccessfully to transfer net lists from Diptrace to LTSpice? When exporting from Diptrace I get the error 'Spice settings are not defined for the following parts......' followed by a list of all the components.Am I missing something or does this not work?

author: DutchGert
author_rank: Frequent Contributor
timestamp: September 08, 2013, 05:17:34 pm
content: Very nice one Dave, please keep it up!Perhaps U could link in the LTSpice schematics u made/use so we can play along at home?

author: c4757p
author_rank: Super Contributor
timestamp: September 08, 2013, 05:20:15 pm
content: Build the schematics yourself, it's good to get practice. If you just "play along" you'll only learn the parts you're interested in.

author: mmagin
author_rank: Frequent Contributor
timestamp: September 08, 2013, 05:25:52 pm
content: Has anyone tried the fairly new Mac OS X build of LTSpice found that it's as broken as I have? Wondering if it's just me.(Menu items missing, sometimes have to force quit it, schematic editing works, can't set up a simulation.)I may just give it up on it and use it on my Windows machine, but then I have to make the install work with UAC (as a long-time user of real multi-user operating systems, I think turning off UAC globally is a dumb thing to do.)

author: dr.diesel
author_rank: Super Contributor
timestamp: September 08, 2013, 05:30:04 pm
content: Quote from: firewalker on September 07, 2013, 09:15:47 amMmmmmmm, they didn't used to, gonna have to check that out!

author: c4757p
author_rank: Super Contributor
timestamp: September 08, 2013, 05:31:27 pm
content: LTspice works very well under Linux with WINE, I imagine it would work similarly well if you installed the Windows version under WINE on Mac.Quote from: firewalker on September 07, 2013, 09:15:47 amReally? I don't see it, I just see the Mac version. Or by "available" do you mean "under WINE"

author: jancumps
author_rank: Unknown
timestamp: September 08, 2013, 06:39:42 pm
content: Yes, it needs Wine. I just installed it under Ubuntu to follow alongg with this video.Initialy I had installed the linux version of Spice and tried to couple it with the Linux version of KiCad, but that didn't work out. The penguins didn't align.

author: rizzy
author_rank: Contributor
timestamp: September 08, 2013, 07:12:44 pm
content: Quote from: jancumps on September 08, 2013, 06:39:42 pmDo they on Windoze?

author: wblackledg
author_rank: Regular Contributor
timestamp: September 08, 2013, 08:31:37 pm
content: Quote from: c4757p on September 08, 2013, 04:29:32 amWell, I'm an American, if that's what you mean?

author: jancumps
author_rank: Unknown
timestamp: September 08, 2013, 10:48:30 pm
content: Quote from: rizzy on September 08, 2013, 07:12:44 pmDon't know. I never tried that.

author: Totoro
author_rank: Contributor
timestamp: September 09, 2013, 11:12:33 am
content: Thank you, Dave for the LTSPICE tutorial. Please continue! I look forward to them.I have LTSPICE with Wine on Mac OS X and want to learn more!

author: dentaku
author_rank: Frequent Contributor
timestamp: September 09, 2013, 11:44:34 am
content: I've never been happy with the interface of LTSPICE.I wish they would just let you pan around the screen while holding down the spacebar for one, more like Adobe Illustrator.ALSO: How was Dave getting an arrow pointer instead of the crosshair most of the time?It's difficult to select stuff in LTSPICE and it needs more shortcut keys.An interface that has a scissor tool is clumsy too. Just let me right-click on something OR draw a square around things then press the Delete key.It's nice software, it's just the interface that's annoying to try and figure out.Maybe I just haven't tried hard enough.

author: Rigby
author_rank: Super Contributor
timestamp: September 09, 2013, 11:50:25 am
content: LTSpice is software that considers perfect UI to be a secondary (or tertiary) concern. It seems that simulation functionality is the primary concern of the development team.I wouldn't worry about these things too much. Lots of application specific software has weird bugs and a general lack of polish. Often this is due to a near complete focus on the core functionality of the application. In my experience, the more specific the software, the less polish there is. This is certainly true in software that I write. I care much more for correct output than anything else, so that's what I spend my time on.

author: gotnoise
author_rank: Newbie
timestamp: September 09, 2013, 03:58:49 pm
content: Thanks a million, Dave! This series is already (and will be) very helpful!I do realize that many of your viewers are advanced and probably bored by the content. You mentioned this problem previously, and that you won't reach the same viewer count as compared to your other videos. But please keep producing LTSpice tutorials. I am sure you will be able to recruit more beginners to your vlog crowd, so on the long run you might get good viewer counts with this as well. And whoever does not like the content, nobody has to watch it. We can just pick whatever fits our bill anyway.

author: Bored@Work
author_rank: Super Contributor
timestamp: September 09, 2013, 04:50:54 pm
content: Quote from: Rigby on September 09, 2013, 11:50:25 amThere is no development team. There is one guy. And he seems to be stuck in the '70th when it comes to user interfaces.LTspice follows the old "select a tool and then manipulate the drawing with the tool" paradigm. This emerged in CAD as a 1:1 copy of the way draftsmen used to work. Select a pen of a particular size and draw as many lines as possible with that pen. Then change to another pen. Then to the compass (or is it compasses?), and do as many as possible with it before changing to yet another tool.While modern user interfaces use an object-oriented approach. First select the object to manipulate, then the operation to apply to the object.QuoteI would, if it would be my application. It is very typical for LTspice that users don't find functions. Often not even the much hated last resort - reading the manual - works for some things, because they aren't documented. LTspice's user interface is as bad as some open-source EDA software user interfaces.

author: hikariuk
author_rank: Unknown
timestamp: September 09, 2013, 05:02:42 pm
content: Quote from: Bored@Work on September 09, 2013, 04:50:54 pmI note its original name was "SwitcherCAD".

author: firewalker
author_rank: Super Contributor
timestamp: September 09, 2013, 05:46:21 pm
content: Persuade LT to open source LTSpice.After that we can make it accept python addons! Bored@Work?I believe no one in LT wants to take over and polish it. Maybe after the retirement of the solo developer there will be a major redesign. Probably polished, only for Windows and not free of charge.Alexander.

author: ales22
author_rank: Contributor
timestamp: September 09, 2013, 06:00:15 pm
content: Great little tool for beginners is Analog Circuit Simulator Applet herehttp://www.falstad.com/mathphysics.html.It's not for detailed analysis, but rather for demonstration of basic principles - it has many example circuits predefined and ready to try. It helped me many times in EE studies.

author: firewalker
author_rank: Super Contributor
timestamp: September 09, 2013, 06:02:15 pm
content: BTW. What language they use for LTspice?Alexander.

author: robrenz
author_rank: Super Contributor
timestamp: September 09, 2013, 06:08:50 pm
content: Great video Daveplease do more of the same.

author: Bored@Work
author_rank: Super Contributor
timestamp: September 09, 2013, 06:20:11 pm
content: Quote from: firewalker on September 09, 2013, 05:46:21 pmWon't happen. If they fear one thing than that someone reverse-engineers or otherwise learns about the inner working of LTspice when it comes to their proprietary, encrypted switcher models.Quote from: firewalker on September 09, 2013, 06:02:15 pmMicrosoft Visual C++.

author: firewalker
author_rank: Super Contributor
timestamp: September 09, 2013, 06:41:35 pm
content: They could keep the engine closed and split it from the gui. Although I don;t know if it worth the hassle.Alexander.

author: ondreji
author_rank: Contributor
timestamp: September 09, 2013, 10:42:58 pm
content: Quote from: mmagin on September 08, 2013, 05:25:52 pmIndeed, it's quirky. I wasn't able to rotate placed component. On the other hand I didn't try very hard. So far, it looks better to use Wine and win version of LT Spice. Anyway, I used it for lees than 5 minutes...

author: mmagin
author_rank: Frequent Contributor
timestamp: September 10, 2013, 12:27:43 am
content: Quote from: ondreji on September 09, 2013, 10:42:58 pmYep, I've gone and ran it under wine as well, and that way it seems to work flawlessly so far

author: Bored@Work
author_rank: Super Contributor
timestamp: September 10, 2013, 05:50:54 am
content: Quote from: hikariuk on September 09, 2013, 05:02:42 pmYes, LTspice/SwitcherCAD. The binary is still called scad3.exe. Because ...Quote from: firewalker on September 09, 2013, 06:41:35 pm... it was once split. Into the schematic capture part (SwitcherCAD), and the SPICE engine (LTspice). But they put that into one binary. And after some releases, they just renamed the combination LTspice IV.Makes you wounder if they still have their SPICE engine run separately in other inhouse tools. Because that is how LTspice/SwitcherCAD started, as an inhouse tool which they later opened up to customers.What I always find sad with all the manufacturer-specific SPICE versions is that all the manufacturers never cooperated to just settle on a single industry-wide standardized SPICE version. Manufacturers do cooperate in standard committees for some things, but they could never be bothered or didn't manage to do that to evolve SPICE.

author: Rigby
author_rank: Super Contributor
timestamp: September 10, 2013, 09:41:07 am
content: Quote from: Bored@Work on September 10, 2013, 05:50:54 amThere's always going to be a certain amount of pride that will impede this notion. I agree with you that this would be nice indeed, but Manufacturer A doesn't want to put a lot of effort into a tool that lets users see that Manufacturer B's part is exactly what they need.

author: dentaku
author_rank: Frequent Contributor
timestamp: September 10, 2013, 12:54:14 pm
content: So... I guess my question would beHow did Dave get that arrow pointer during his demo?I always end up with the crosshair tool, scissors, hand etc.. but I've never seen a regular old white arrow tool like you'd expect in any drawing tool (like Illustrator) that you can use for selecting things.Was that arrow pointer maybe something his screen capture software provides (it WAS extra big looking).Multisim might not have a nice interface either but from what I can see at least it seems to follow some of the regular UI conventions. Of course it's not a free application.

author: Ronald1962
author_rank: Contributor
timestamp: September 10, 2013, 01:16:23 pm
content: Hi folks,I do have some trouble in displaying the voltage values at the nodes of the circuit.It always shows three question marks, but not the values as Dave it did in the video. One time he alsogot the question marks and solved this problem, but I couldn't find out how.Could anybody help?Thanks a lot in advance!Ronald

author: Ronald1962
author_rank: Contributor
timestamp: September 10, 2013, 02:39:27 pm
content: Solved the problem by myself!You have to keep the mouse on the line while pressing the mouse button...

author: wblackledg
author_rank: Regular Contributor
timestamp: September 10, 2013, 08:19:56 pm
content: Quote from: wblackledg on September 08, 2013, 08:31:37 pmc4757p , seriously, I would love to see a crystal radio / germanium diode simulation using LTSPICE.thanks.

author: c4757p
author_rank: Super Contributor
timestamp: September 10, 2013, 08:34:48 pm
content: Looks like if you poke around on Google for "germanium diode spice model", you do get some results. I tried germaniumtransistorsa while ago and couldn't come up with anything resembling an accurate simulation. But try them and see if they work.Or, just build the circuit...

author: wblackledg
author_rank: Regular Contributor
timestamp: September 10, 2013, 09:11:50 pm
content: Quote from: c4757p on September 10, 2013, 08:34:48 pmok, thanks.

author: vk6zgo
author_rank: Super Contributor
timestamp: September 11, 2013, 02:38:00 am
content: As a "greybeard"(Old Fart) what freaks me out is that the source is always displayed using a DC generator symbol,so the audio signal source in Dave's amplifier is drawn the same way.Strangely,the negative supply has its negative side earthed,& a note underneath saying it is a negative voltage,(in other words you have to multiply it by-1).The base bias source in another part of the circuit is the right way around,however!I suppose it makes the programming easier,having only one type of source,but it is quite annoying to those of us who have read standard schematics on paper for many years.

author: c4757p
author_rank: Super Contributor
timestamp: September 11, 2013, 02:52:13 am
content: You don't have to do it that way, if you're concerned about the diagram's clarity. There's an alternative symbol for an AC source, and you can of course change V2 to a 10V source and flip it around. You can also draw your own symbols if you're really finicky; they'll work just as well as the built-ins.

author: Zepnat
author_rank: Regular Contributor
timestamp: September 14, 2013, 09:03:50 pm
content: Great stuff this, I actually downloaded spice after watching this video, I had heard of it before but didn't know what it was. Soon got a simple circuit going. The detail Dave put in these videos is incredible and is much appreciated.

author: AF6LJ
author_rank: Unknown
timestamp: October 07, 2013, 10:30:02 pm
content: Good Stuff, I am looking forward to the next in the series.

author: ohmineer
author_rank: Contributor
timestamp: October 14, 2013, 07:09:00 pm
content: Nice tutorial, thanks for it.I hope you continue with the rest of the series soon!

author: DutchGert
author_rank: Frequent Contributor
timestamp: October 17, 2013, 03:54:39 pm
content: Quote from: ohmineer on October 14, 2013, 07:09:00 pmYes, hoping for that as well!

author: ssassen
author_rank: Newbie
timestamp: December 25, 2017, 02:28:03 pm
content: Alright, can't seem to figure this one out, not helped by the fact my Google-Fu is not what it used to be due to excessive intake of sugary treats (it is Christmas afterall). This ties in what Dave posted in his DC Operating Point Analysis video, so please excuse me for bumping a >120 days old topic.I have a schematic drafted where I want to label a number of nodes with their DC voltages in a transient analysis.I do this by simply left clicking on the nodes in question, et voila, the DC voltage shows up. However, it shows up formatted with 5 decimal places, which is a little too much. I'd like to round that off to one or two decimal places.If I however right click the node and add the expression 'round(V(a1))' to round off the voltage at node 'a1' it rounds off to no decimal numbers, which in my case means that 1.38798V is rounded to 1V, that's not what I'm after, I'd like to see either 1.4V or 1.39V.Any of you fine gentlemen know how to accomplish this undoubtedly trivial feat? Thanks and Merry Christmas!

author: ssassen
author_rank: Newbie
timestamp: December 25, 2017, 02:55:38 pm
content: Alright, a bit cumbersome, but round(V(a2)*0.01k)/0.01k seems to work, change 0.01k/0.01k at your leisure, for example to display 925mV, this needs to read 1k/1k.

author: Ian.M
author_rank: Super Contributor
timestamp: December 25, 2017, 07:29:13 pm
content: Try adding:Code:* restrict precision for .op data labels.func sf(x,n) {round(x*10**(n-1-floor(log10(abs(x)))))/10**(n-1-floor(log10(abs(x))))}to yourplot.defsfile(in the same folder as the LTspice executable), then you can restrict the .op data label precision by using the expressionsf($,3)in place of the default$for the label. Of course you can replace the 3 with any other integer for the precision in the range 1 to 8, or replace the $ with any expression calculable fromONLYnode voltages and component currents.Unfortunately the .op data labels are provided by the DC initial operating point solution, which isn't available if you use the .tran uic option and is meaningless if you use the .tran startup option. Its regrettable that there is no way of setting them to display the results at an arbitrary time t or to display the result of .measure commands.N.B. The .op data labels and the waveform viewer can't 'see' any functions or parameters defined on (or included by) the schematic. If it isn't either built-in or in plot.defs you cant use it for data display.