Things you should know about LTSpice

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
models are only as accurate as you make them.....
i usually get a circuit simming like i want it, then begin playing with the resistor values adding or subtracting a few percent randomly, and i've made a few "less than ideal" transistor models (i don't use them in examples i post) with +/- 10% beta. so for an MJ15022, i have 3 models, the original with a beta of 45, and two "worst case" models, one with a beta of 35 (called MJ15022b35) and one with a beta of 75 (MJ15022b75), and i'll mix these in at random. they are saved in standard.bjt, so i can select them from the drop-down list. the same things can be done with caps and resistors, and with a little work, you can add stray capacitances and lead inductances to the op amp models. when you add the hum to the power supplies, make sure you keep the phase the same (which actually gives an inverted hum to the - supply as long as you ground the positive side of it). if you use a supply with the - side grounded and type in a negative DC voltage, then invert the hum. i've found that a circuit sims a little bit faster if you avoid all of the "double negatives" and use a supply with the + side grounded and a positive voltage set for it. add at least a few milliohms series resistance to the supply. i usually worst case it for a foot of wire and "fudge factor" an additional 50%. so the 3 most common wire guages used for power supply wiring are 18Ga (6.51mOhms/ft), 16Ga (4.04mOhms/ft), and 14Ga (2.575mOhms/ft). so if i plan to use 16Ga wire, i figure the resistance of 1.5ft of wire (that really is a lot, but after you route it across a 19" rack box around corners, that actually might come out about right), so my 16Ga wiring will add 6.15mOhm to each supply.

other more complicated effects that can be simmed, but it's not really easy, is the magnetic coupling between the supply rails and the input stage. it can be done, but getting the coupling coefficients anywhere near accurate takes careful measurements of a real working amplifier with magnetic oscope probes. output device current cross coupling back to the input is a real and measureable source of even harmonic distortion. the coupling sim would be done with a 1:1 transformer with very loose coupling (k=0.01 or less in most cases)
 
Thank you for your input, Godfrey. Thanks for looking at my work, maybe more people have seen the Allison thread than I've realized. Yes, nothing is ever perfect (though I like to think so).

I had hoped for a fully authored version, but while I'm not illiterate, I'm just not a writer. So I just put up a Wiki page.

Here it is:

LTSpice and What the New User Should Know - diyAudio

I don't think it's connected to the front page of the Wiki. I chopped in Godfrey's comments here and there, but there's more to be added... Maybe someone else can get to it before me?

- keantoken
 
keantoken,

thanks for taking the leap and creating the wiki page. I found the answer to something I had started looking at just today.

I think that the organization could benefit from some hierarchy, that way it would be easy to add topics and navigate as the list of topics grows. I'll take a whack at it if you don't mind.

Also I think this would be an interesting place to start building a library of ways to model and explore various audio topics in spice.
 
another thing i have seen that is quite interesting...

i've had a model for the TL072 op amp that i got from TI's web site a few years ago. it works well and apparently is a fairly good model of the real thing. if you ever try to draw it out, you will find it's quite complex. more recently i looked on TI's web site for a model for the TLE2072, which is a greatly improvrd version of the TL072. i didn't find a model, but saw a listing of the model text in the data sheet. this is where i got into a bit of trouble, i typed the model from the data sheet into a text file and tried it. it didn't work. then i looked at the model i had for the TL072 and saw that the basic model was identical. TI has a "standard" op amp model format and subcircuit, all that changes are some of the parameters. after making the parameter changes between the TL072 and TLE2072 models, and saving the new TLE2072 model, it worked
 
Onsemi and Fairchild have model links for most devices on the device pages.
For instance: Product Folder - MPSA18 - NPN General Purpose Amplifier

Look under the title "models" and click the link that says "electrical". Misleading, I know.

To use a transistor model, copy and paste it into /lib/cmp/standard.bjt

For diodes, it's standard.dio, etc.

- keantoken

Hello

I've goes on Fairchild and Onsemi web site.

They do not have LTspice models.

Fairchild do have those model;
HSPICE models, IBIS models, PSPICE models, PSpice models, Pspice_Bsim3.1 models, SABER models, Saber models, hspice models, ibis models. (Onsemi have somes of thoses moels)

Which one of those models work good with LTspice ?

Thank

Bye

Gaetan
 
Last edited:
I admit I'm a bit obsessive-compulsive and like things organized, so things are easy to find. Would you dump all your transistors and diodes in the same parts box? :)

I agree that this should not be a place to dump all the manufacturer models, it should be reserved for either user created/modified models (such as AndyC's) or hard to find / unusual models.
 
I appreciate your organization; I feel we're alike in this desire. But I think we could make it more compact without decreasing intuitivity and ease of navigation. In fact, it is more of a pain to have to click on several links just to get to what you want.

Also, this is DIY and people want it all in the open where they can get their hands on it easy. We want to encourage information from all sources; I feel organization can be sacrificed justly for a wealth of practical information.

- keantoken
 
Keantoken, you have some good points.

I offer these observations from having used wikis to coordinate and communicate between large teams working nearly 24/7 on prototype bringups - when the new chip or hardware comes back and hardware plus software plus test are all racing as fast as they can to check it out, debug, and bring it up.

1) it is important to establish a structure at the beginning so it is obvious where to find data, and add new data. The "flat file" or dump everything in one place approach doesn't work.

2) what's intuitive to me may not be intuitive to anyone else, so slight overkill on organization is usually a good thing. This also helps as the amount of information grows.

3) moving stuff around once it is in the wiki can be a little tricky, especially attachments so thinking ahead for growth is important.

4) This wiki tool doesn't seem to have a way to put pictures in-line with the text unless they come from a url, so they have to be attachments. Keeping each leaf node to a single topic simplifies the association of attachments to the text.

Anyway - it's a wiki! We all get to edit it to (hopefully) improve it, that includes content as well as organization. Don't worry about stepping on my toes if you think there's a better way, go ahead and improve it!

Collaboration and respect - it means understanding that my way (referring to myself only) is not necessarily the best way.
 
Last edited:
i have a tube model for a 6BF7 submini dual triode, it's not 100% accurate, more like 90%, but it's close enough for me to get "in the ballpark" with preamp stages. and it doesn't seem to suffer from the "impossible output voltage syndrome" when used as an active load (SRPP amp).

i have also made modified zener and LED models. the only changes being Vbr for the zeners and Vf for the LEDs to "fill in the blanks" in the plain vanilla diode model list that ships with LTSpice. with a little more work i could probably get the proper temperature coefficients for the zeners (since the tempco shifts in zeners are very well documented...)
 
This is the .asc file I use to make my BJT models (change .txt to .asc). I have my own method for hand-adjusting models, because I'm too lazy to do the math. :)

I want to share this method, if I can manage to write it out clearly. I have a .txt file full of my notes...

I'm not sure where to put this, anyways.

EDIT: I might start a specific "BJT modeling" directory and put some stuff there.

- keantoken
 

Attachments

  • Ib_Ic_Vce.txt
    1.7 KB · Views: 95
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.