What all does SPICE do?

Thread Starter

hp1729

Joined Nov 23, 2015
2,304
LED are usually modelled the same way other diodes are, so there is logarithmic dependance between voltage and current. Same goes for transistors and other things, all the basic components are modelled quite accurately. Trouble comes with other parts like general ICs, those are modeled using those primitive devices and can often be quite far from reality, or can cause extremely slow or not at all working simulations, but that is a problem in the model and not the simlator.

Look at what parameters can be definded for a simple NPN transistor for example here http://www.ece.uci.edu/docs/hspice/hspice_2001_2-102.html
Lots of components don´t have all the parameters entered, so the simulator just assumes some default. Opamps usually have fixed offset an input currents, but you should be able to modify those and try different values, also there are different classes of models of for example opamps, which differ in realism and computation complexity, some will even run happily without any power supply connected.
Thanks for the example of the transistor and the words.
 

Thread Starter

hp1729

Joined Nov 23, 2015
2,304
LTspice is a simulator and like all simulators depends on the component models. Those in turn depend on the human that created them. Shinola in, shinola out. That's why you'll sometimes see multiple models available for a single component. A simple model may be fine for most applications, while a detailed elaborate model might be required for another.

I would never assume that a simulation will catch any errors. They'll let you put 100mA into that 20mA LED and not make a peep.

I've done a little programming in an unrelated area and I can tell you that error trapping user input is usually the last and most difficult thing to add. My dad used to say, "If you think it's foolproof, you just haven't met the right fool yet".
Thanks.
 

Thread Starter

hp1729

Joined Nov 23, 2015
2,304
I Google it for you.
http://www.ece.tufts.edu/~srout01/ee12-2008/pspice/Q2N3904.lib
That model used 416.4; which seems a bit high to me...
Thanks for the example. That is pretty specific. If I grab a dozen 2N3904s I doubt if any two of them will be identical in characteristics. Gain will differ. E-C saturation voltages at a certain current will differ. I guess within a single batch they may be similar, but from one batch and manufacturer to another? Not too similar.
 

Thread Starter

hp1729

Joined Nov 23, 2015
2,304
No tool is an appropriate substitute for good judgement. I remember when making 512 x 8 Mask ROMS were a $3000.00 mask charge and a six week lead time for first silicon. There was a premium on solid debugging.
Wow! I remember those days.
 

Thread Starter

hp1729

Joined Nov 23, 2015
2,304
Huh?

But OrCAD uses PSpice as its simulation engine. That's why they bought MicroSim. (unless things have changed in the last decade or so).



You are actually talking about a couple of different things. Connecting two outputs together that shouldn't comes under the heading of Electrical Design Rule Check (DRC). This requires information that the SPICE engine simply doesn't have access to. So these kinds of checks are primarily the purview of the schematic capture software and how you set up its DRC rules deck.

As for the quality of the simulation itself, that depends on the quality of the model and the quality of the simulation setup. The models historically have been all over the place. One time I used a TI model for an opamp (TL074, I think) and the simulation matched my actual circuit performance quite nicely. Then I started looking at total current draw and it showed the opamp was drawing a bit over a thousand amps! After playing around I called TI and they told me that their model developers only cared about the I/O pin characteristics and the power supply current was what ever the various dependent sources in the model happened to use. Remember that SPICE was originally developed for designing integrated circuits -- ICE stands for Integrated Circuit Emphasis -- so everything was at a pretty basic level as far as components went. As people wanted to simulate circuit boards that had ICs on them, device manufacturers started making simple models available and, at first, they focused on the signal processing chain and not anything else. Since then IC models have gotten a LOT better -- because people are demanding better sim results that cover more and more items of interest.

As design rules for transistors got into the deep-submicron, the transistor and other basic component models had to get better and better to give reasonable simulation results. Given that a mask set today can cost millions of dollars, you want a simulation that is nuts on. So companies were willing to pay fab houses to develop models that were nuts on (well, actually they just refused to use fab houses that didn't supply models that were nuts on -- i.e., they were willing to pay significantly higher fab costs compared to fabs that didn't provide high quality models.)

When I was working with the IBM 130 nm process (a decade or so back) I looked at their model for their basic NFET. It consisted of a subcircuit that had over three hundred components! For ONE transistor. But it pays off. Even back in the mid 90's when I started doing IC design, when I would get the chips back from fab and I would measure the bias voltages that where generated on-chip they seldom different from the sim results by more than a few millivolts.



Most of the models have statistical parameters that describe the distribution of various other parameters, such as gain and voltage drop and temperature coefficients and you name it. You can set up the simulation to do what is called a Monte Carlo simulation where individual device parameters are randomized according to that distribution. You then run many (ranging from half a dozen to thousands) of simulations and collate the results. This can take a lot of time, so your first step is usually to do what are known as "corner simulations" in which you put the key parameters, usually including temperature, at their extreme values. You then get it working as best you can over those variations before running a full Monte Carlo set.



When spinning a circuit costs a couple hours and some bread boarding or even a couple weeks and a few hundred bucks, this can be a perfectly reasonable approach. When spinning a circuit costs six months and a hundred thousand bucks, that's a very different thing.
Thanks again for the insight.
 

Thread Starter

hp1729

Joined Nov 23, 2015
2,304
As noted, there is absolutely no rule checking in Spice. It will allow 10k amps through a 1mA part without a whimper. So all checks have to be done by looking at the simulation results and deciding if the voltages and currents are reasonable for the circuit design.
LTspice has an option (and other versions may also) that displays the power dissipated in a device to verify that it's not operating outside it's limits (or how large a heat sink it might require for power devices). That's especially useful for devices like power transistors in switch-mode circuits where it's rather difficult to calculate the power dissipation due to the switching losses.

Spice generally uses nominal values for the various parameters so if you want a worst-case test you will need to go into the models and change the value. One technique is to copy the model and generate your worst-case model with a slightly different name (such as adding "_WC" as an extension).

I think learning to use Spice is worth the effort. Not only does it often catch errors in your design but it allows you to easily modify the circuit to optimize the design or try alternate design approaches.
As MikeML noted I also never build a design without first simulating it.
Thanks.
 

Thread Starter

hp1729

Joined Nov 23, 2015
2,304
As noted, there is absolutely no rule checking in Spice. It will allow 10k amps through a 1mA part without a whimper. So all checks have to be done by looking at the simulation results and deciding if the voltages and currents are reasonable for the circuit design.
LTspice has an option (and other versions may also) that displays the power dissipated in a device to verify that it's not operating outside it's limits (or how large a heat sink it might require for power devices). That's especially useful for devices like power transistors in switch-mode circuits where it's rather difficult to calculate the power dissipation due to the switching losses.

Spice generally uses nominal values for the various parameters so if you want a worst-case test you will need to go into the models and change the value. One technique is to copy the model and generate your worst-case model with a slightly different name (such as adding "_WC" as an extension).

I think learning to use Spice is worth the effort. Not only does it often catch errors in your design but it allows you to easily modify the circuit to optimize the design or try alternate design approaches.
As MikeML noted I also never build a design without first simulating it.
Some of the parts in the PSPICE library have "AA Enabled" mentioned. I can't find in the tutorial what that means. Any insight?
What is the difference between an LM741 and an LM741 that is AA Enabled?
 
Top