I need help getting started with LTspice IV (Very basic stuff I expect)

Discussion in 'General Electronics Chat' started by Dyslexicbloke, Sep 17, 2010.

  1. Dyslexicbloke

    Thread Starter Active Member

    Sep 4, 2010
    420
    19
    I am well aware that most , if not, all my issues are likely to arise due to my lack of basic electronic knowledge rather than being Spice specific problems.

    The up side is that I will be forced to learn how to understand, and thus do, things properly but I am struggling to get started and think I may be missing something.

    For example:-

    I decided to look at simple RC networks, something I think I understand on a basic conceptual level but wouldn't know how to calculate or specify.

    I tried to start simple with just 3 components 1 voltage source, 1 resistor, 1 cap, and a couple of grounds …..
    I expected to be able to pick a 'standard' cap from the database but there don't appear to be any.

    To specify a cap my self I need loads of info I don't know or fully understand and I assume that if Spice is expecting it, the info that is, simply ignoring it isn't going to be much use.

    Assume I have a disc ceramic marked 473, no info RE manufacturer and no way to accurately measure any of its parameters.
    All I 'think' I know is that its 47000pF, how do I decide what else to include in it Spice definition?

    Are there accepted standard values for deferent types of cap?

    If I am just being dense somewhere please feel free to tell me, looking silly doesn't worry me whilst staying ignorant isn't much use at all.

    Thanks, Al
     
  2. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,795
    951
    I'm trying to learn it too, so we can limp along together on this

    I just right click on the cap and then I get a cross hair type symbol, so I right click again and get a pop up with some data entry blocks

    For the value I type in ".001u" and get a 1000 pF cap.

    Seems you can leave the other entry places blank.
     
  3. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Capacitors have a spec called Effective Series Resistance (ESR) that spice doesn't know about and doesn't care about. They also have series inductance which causes some to work poorly at high frequencies.
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Hi there Mr. Pessimistic,

    You can specify series/parallel capacitance, series/parallel inductance, and series/parallel resistance where appropriate, or simply choose an existing model. from the library. The existing models already have all of those parameters entered.

    For you folks who are feeling like they landed in an alien world;
    Have you tried looking at the examples provided with LTSpice? Open them up, and run the simulations on each one. You don't have to do a thing other than load and run them - and then click on various wires and components to see
    what's going on with them.

    TIP:
    Hold down the ALT key while clicking on a component to see the power dissipation of the component.

    Once the simulation is complete, hold down the CTRL key, and click the signal name to see the average and RMS figures.

    You can do the first part at any time once the simulation has started, but wait until it's completed to get an accurate result at the end.
     
  5. Ghar

    Active Member

    Mar 8, 2010
    655
    72
    This is called knowing how to model a circuit correctly. SPICE is a great tool, it's not its fault if you don't know what you're doing with it.
    The situation is no different from doing your own calculations.
     
  6. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,795
    951
    I've been reading this http://denethor.wlu.ca/ltspice/


    It has helped alot. At the bottom of the page are more links to even more tutorials. Guess I'll be reading alot this weekend.
     
  7. Dyslexicbloke

    Thread Starter Active Member

    Sep 4, 2010
    420
    19
    Yes that was sort of the point ..... See my origional post.

    I definatly dont know what I am doing and never said otherwise.
    Chucking componants at a braedboard based on some circuit fond on the web is not the same as trying to get a handle on Spice, when using a cap, for example, I would have no concept of ESR or anything else, just how big it was.

    If, as a relative beginner, you look at circuit examples, includung the ones on this site, you will regulaly find componant values or associated calculations that yeald componant values, none of which suggest or even hint at the other less obvious stuff that Spice is going to want in order to be accurate.

    Hay I get that ESR must exist and may play a part in how a circuit works, I also expect that it is likly to be a small value in most cases but I dont know and have no idea how to find out, again see my origional question.

    This thread exists BECAUSE I dont understand many of the questions Spice is asking and I apriciate that I need to laern.

    My guess is that a huge proportion of people posting here are in the same boat.

    SgtWookie's tips, Audioguru's comments and links to pertanant resources are very helpful and give me/us a basis on which to start searching for the knolidge we need to progress.

    I; and I expect many people like me, would be happy to be proven ignorant by a 'constructive' comment .... isn't that what this forum is all about?

    Al
     
  8. Ghar

    Active Member

    Mar 8, 2010
    655
    72
    I understand your problem and I was a bit harsh but it wasn't to you, it was to Audioguru.
    My problem was with the comment that "spice doesn't know or care about" when that really isn't the issue. You don't put ESR on a schematic but you need to think about it.

    It's also wrong, because if you select a capactior model in LTSpice it does include ESR. Right click the cap and go to "Select capacitor"
    You will see ESR values, ESL is usually set to zero. ESL is determined more by your layout than the cap itself so it doesn't make a lot of sense to include some arbitrary value.

    Another thing that Spice won't help you with if you don't know about it is that capacitance can vary drastically with applied voltage and temperature.

    Learning about these things is strictly learning about electronics. Spice is just a tool that helps you simulate models you create. First you need to learn about the actual ideas. You can't learn to model something you don't know about.
     
  9. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,019
    1,542
    As I'm in the same boat as Dyslexsicbloke and Kermit2, I'm going to pay close attention to this thread.

    Maybe it would be a good idea for someone with knowledge on LTspice to write a new chapter for the E-book on this. Any takers?

    May be something in everyday language that someone like me ,who rides the "shortbus" can figure out.
     
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    It's important to note that a given component will have it's primary function noted and specified (eg: resistor, capacitor, inductor), but there are also multiple parasitic properties. In a very low-speed circuit, the parasitics will be of little consequence. However, as rise/fall times decrease (increased speeds), the parasitics will become more apparent. As you get into the hundreds of MHz range, the parasitic effects are quite large. Keep in mind that when you are dealing with square waves, you require a great deal of bandwidth, as an ideal square wave is composed of ALL of the odd harmonics of the fundamental frequency. This implies that unlimited bandwidth is required!

    Just one item that will cause you grief going from a Spice model to a prototype is the inductance of wiring. If you haven't planned for it, and you have fast rise/fall times, you will get "bitten".

    Here is an online calculator that will help you determine the inductance of straight pieces of wire: http://www.consultrsr.com/resources/eis/induct5.htm

    Note that a 1" long piece of AWG 24 wire will have ~23.2nH of inductance! This adds up very quickly in a breadboard situation.
     
  11. Ghar

    Active Member

    Mar 8, 2010
    655
    72
    It should also be noted that it's more complicated than just your length of wire, the entire geometry matters.
    A piece of wire can have a 'per length' inductance of that value but as soon as you use it you will be changing that significantly.

    There's several good calculators here:
    http://emclab.mst.edu/inductance/index.html
     
  12. Dyslexicbloke

    Thread Starter Active Member

    Sep 4, 2010
    420
    19
    OK Folks I am now totally confused .......

    I decided that the best way forward was to bite the bullet, so to speak, and go do some research.

    Working from the permise that I perhaps shouldnt have bought selection pack of general purpose ceramic caps for which I have no data other than value I decided to examine some data sheets.

    Well ......

    I have looked at loads, from multiple manufaturers.
    I investigated multy layer ceramics and various film caps as well, taking Farnell stock as a starting point.

    Some datasheets offered impedance verses freequency curves, all provided data on temperature compensation and most gave details of effective capacitance with a given voltage.

    All interesting stuff which I had little concept of to start with, BUT not one sheet mentioned ESR ...... !

    What am I missing?

    Should I just ignore this and just give Spice the basic value?
    Where do these values come from in the existing Spice models if the data sheets dont provide the info?

    Why dosnt LTSpice contain freequently used decoupling / bypass caps.

    This confusion has to be my lack of understanding, Spice is too complex and clever for me to assume that 'it' is in any way lacking .....

    Please help, I am flowndering here.
    Al
     
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Don't make it overly complex at first, you'll get lost in a hurry.

    A typical value for a poly metal film or ceramic bypass capacitor is 0.1uF (100nF). These are required on virtually any IC imaginable; 4000-series CMOS, 74xx series TTL, opamps, comparators, you name it.

    Some IC's require more than one bypass cap, such as the 555 timer (one 1uF aluminum electrolytic and one 100nF ceramic or metal poly in parallel), certain opamps, and various other devices like MOSFET gate drivers.

    The idea here is to keep the capacitors' leads as short as possible, as even a straight piece of wire has inductance. The shorter the leads, the less parasitic inductance you will wind up with.
     
  14. Dyslexicbloke

    Thread Starter Active Member

    Sep 4, 2010
    420
    19
    Your not kidding ... I could do lost for a small plannet right now.

    I take your point RE IC's and it seems just reasonable to look at the datasheets and add bypass caps as directed but If I was to model that in Spice I would still have the same issue ... I think.

    Am I just being dense somewhere?

    I get that, just ... What I dont get is how signifiacnt it is in:-
    a. Reality.
    b. LTSpice simulation.

    Obviously on breadboard / stripboard if I get it wrong then it just wont work and If knew what I was doing then I should be able to predict this with Spice .... Right?

    It was so much esaser when I was completly ignorent, not much worked and I had no idea why !!!.

    Al
     
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Or a TV show, perhaps? ;)

    You should ALWAYS look at the datasheets; the most current that are available from the manufacturer of the device that you are using. Some are pretty difficult to decipher, and have a LOT of parameters to consider. Bypass capacitor requirements on families of IC's may be specified in a generic document that applies to all of those in the family with possible exceptions; Philips/NXP does that for their 4000 series CMOS logic, just as an example.

    Some low-dropout regulators are very particular about the size of their output capacitance. You can't just slap any old value in there and expect it to work. You have to read the datasheets.

    SPICE models are most frequently a compromise between simulation performance and real-world conditions. In order to build a really accurate simulation, you would have FAR more parameters to enter than you would really care to spend the time on, and it would take even a very fast computer a long time to execute the simulation.

    Compromises are made to obtain a simulation that will complete in a reasonable amount of time.

    No. It's a lot to take in, and makes starting off just that much harder. It can be difficult to decide what's really important.

    In a SPICE simulation, you can usually omit the bypass caps, as the wiring from the perfect power supply (capable of nearly unlimited current at whatever voltage you specify, or nearly unlimited voltage at whatever current you specify) has zero resistance and inductance. Therefore, your supply pins on your modeled IC's will always have power as perfect as you specified.

    However, when you start adding in things (like voltage/current source resistance, parasitic inductance/resistance/capacitance in the connecting wires, etc) then you will start to see the need for things like bypass capacitors.

    A member by the login moniker of RobbJohnson was building a large-scale model tank, and was having problems with noise on the MOSFET controller. I went through a lengthy process of building a SPICE model for his system, and then started adding in the resistance and inductance of his long interconnecting cables; after a good bit of work the results from the SPICE simulation helped a great deal in showing him where the problems were with his system, and what approaches to take to fix the problems.


    It depends on what kind of bandwidth your circuit actually needs, and how well you've modeled it. For example, if you have a square wave output that travels on a long wire to another stage, it will work fine in SPICE, but look just awful on a breadboard prototype.

    Yep.

    Well, there's a lot to take in.

    Start modeling simple circuits in SPICE, and then try building them on a breadboard/protoboard - and see how closely the real thing compares to the SPICE model.

    Then figure out why they are different.
     
  16. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,795
    951
    http://www.ecircuitcenter.com/index.htm


    All about spice. beginner and advanced also lots of explainations and a whole bunch of demo circuits that you can download and play with.

    Look it over. I'm still struggling through the 'commands' section, but getting the hang of it.

    :)
     
  17. Dyslexicbloke

    Thread Starter Active Member

    Sep 4, 2010
    420
    19
    Good stuff guys thanks .....
    It all go's to show just how poor my understanding is right now, but it also makes it clear that I need to aproach learning this stuff in a far more structured way.

    The stuff I am learning here is hilighting what I should look out for.
    I still dont understand where I would find ESR data but perhaps that well become clearer as I move forward.

    I like the whole idea of comparing simple circuit performance in Spice and as a physical build, I expect that will show up all sorts of things I currently dont know about or expect.

    Whatever else it is the process will definatly be interesting.

    Thanks for all the input.

    Al
     
Loading...