Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

spice simulation usefull or not 7

Status
Not open for further replies.

2dye4

Military
Mar 3, 2004
494
0
0
US
I was just reading in previos thread about good tools
to have on the electronics bench and once again I hear
of the evils of Spice circuit simulation.
What problems do people really have with spice or what
situations can cause it to give incorrect results.
Please confine your answears to those cases where the
circuit is reasonable well modeled by the components.
We all know about Garbage in Garbage out.
I ask because I use it frequently and rarely has it lied
to me.
In those cases the integration time step was not correctly
reduced and the circuit solution was in error.
My standard procedure now is to force a small time step
simulate then force a 0.8 X timestep and simulate.
Then compare the results. If agreement call it done.
It has not lied to me since I began this procedure.

thnks
 
Replies continue below

Recommended for you

2dye4,

I have had the same problem (low power requirement). I solved it using a low power PIC and ran it with a clock crystal (32768 Hz). It can measure two temperatures, detect ring signals, answer the phone, produce tones that tell the user what the temperature is and also check if there is any mains voltage or not.

The mean power consumption is 15 uA and four AA batteries keep it going for many years. We had one guy calling us after five years. He wanted to buy a new unit because he thought lightning had killed the first one. He was very surprised when I asked him to change batteries first. He did - and it worked.

Gunnar Englund
 
SPICE

Engineer A: Expert Circuit Designer
Engineer B: Expert Circuit Designer plus Expert SPICE
Engineer C: Expert SPICE Designer

Engineer B's circuits will always:

1. Perform better - i.e. optimum design
2. Be lower cost - i.e. minimum toleranced components
3. Released to production quicker - minimum post PCB tweaks

I would never hire Engineer A if I can find Engineer B. And I would never hire Engineer C.

Anyone who admonishes SPICE simulation as having very little use either does not know how and when to use SPICE or never designs circuits with more than 20 components.

 
I agree, Spice is just a tool.

An experienced and thorough electronics designer will choose the best and most suitable approach which may or may not involve any analog simulation.

I only use it when there are clear and obvious advantages in doing so, which is very rare indeed.
 
I have take issue with you sanlog. Asside from IC design, education and complex linear circuits spice will tell you very little you dont know allready. Setting up an accurate simulation takes a lot more effort than the original design and is only any use if it has accurate models. Once you has done your simulation you then have to build it, test it and modify since your simulation missed something. So engineer B circuit will not allways perform better and will never reach production quicker. Of course if you have an example i'm all ears.
 
Cbarn

Suppose I sketch up a two transistor amplifier with a pair of 2n2222 transistors and give you the schematic for analysis, then I build one with solder and then I simulate one with spice.

Are you telling me that you can predict the output of the circuit with greater overall accuracy than a simulation using a 2n2222 model from the vendor in a spice simulation.

Note that I am not suggesting setting up an elaborate simulation. Just the parts in the library.

Takes maybe 20 minutes to enter, run, read results.

Do you think your figures will be closer to the measured results or will my spice simulaton??

 
2dye4, i'm not saying that at all. Firstly which model are you using? EM1, EM2, EM3? you probably dont know. If I build the circuit and measure the results I will know what it does. If you simulate it you won't, so you'll still have to built it and measure it. So what has spice saved you? Of course such a simple design would most likely come out fine with spice but change your transistors to ones with an ft of 5GHz and its a different story.
 
Barn

I think you are saying just build it and then tweak components until you satisfy your design requirements.

For my two transistor amp.

Bias current.
Distortion as func of frequency
Dissipation of transistor at bias and various drive levels.
input impedance as a function of frequency
output impedance as function of frequency

So you could start with a example design and measure these things and use your intuition to guide you as you hone in on the specs.

Note that many of these things are not trivial to measure with affordable equipment.

Will you allow that time could be spent with Spice to reduce the bench time by getting the starting design a little closer to the mark???

You must admit that some pre-build analysis is frequently beneficial. And if so how can you do it better than spice??
 
Additionally, a simulation is used to test conditions that are difficult to achieve or inaccessible.

Consider the example posited, how are you going to verify performance over temperature? Are you going to get a temperature controlled oven and spend a day or so running different temperatures and jotting down all the pertinent data by hand?

TTFN



 
Well no i'm not saying that either, that appears to be your design method. Simulate, tweek, simulate ect. Some things are dificult to measure like distortion but if its important to your design them you have to measure it somehow or just trust to luck. If your relying on some model that is approximate at best then your "accurate" spice measurements aren't going to accurate at all. The same applies to the temperature problem, if it matters then you will at some point have to verify it for real.
 
Sure, but wouldn't you rather temperature test something that you have some confidence will achieve temperature performance, instead of crossing your fingers and wasting hours temperature testing only to find that it doesn't quite meet its requirements?

Another area that simulation provides is margin testing. You can Monte Carlo or otherwise vary the device parameters to determine if your design is robust enough to survive process variations. This is something that can absurdly expensive to test, tweak, test, etc. Been there, done that. A single lot run of 25 wafers costs several tens of thousands of dollars, with no assurance, even with specific engineered variations, that you've covered all the bases in processing variation.

There's a funny story here. We, at a previous job, got to second source a Hitachi 6845 CRT controller. They shipped us the mask set and nothing else. Not only that, there weren't even test devices on the masks. Call up Hitachi, "What are the processing parameters and how do we verify them?" Hitachi responds, "Don't worry, just run masks on whatever standard process you have." Duh?

So, anyway, we run the first lot; it yields more die than any of our own products. Second lot is even better than the first. Third lot yield was about double the yield of any of our own products. Design for Manufacturing DOES work, when you WORK it. Unfortunately for us, we never bothered learning that lesson.

TTFN



 
i dont think its a question of crossing your fingers, more like designing properly in the first place. Monty Carlo, yes Ive seen that, snag is the very properties that vary the most are not varied, alot of them are not even modeled in the EM1 model, the most common model, you can of course do all those 1% resistors though.
 
Barn

I take another stab at it. Your design philosophy is not to build test modify, test modify etc...

You must be capable of refining the design by carefull analysis without a simulation and then build to verify. Correct??

You can work out the mathematics with a calculator or excell for my two transistor amp and select the components to meet the distortion,dissipation,input output impedance and any other pertinant qualifications to the point where you can build it with expectation of minor tweaking.

If so you are quite skilled indeed for it requires inverting most of the non-linear equations for the transistors and solving closed form equations for desired variables.

If you say you can do it I believe you. As for most of humanity some level of build- test- refine, iteration is required. And for this, spice is quicker than actually building-testing so we can use this to get closer to a design that is ready for actual build-test-refine iteration.
In the long run us mortals save ourselves a lot of time with spice.
 
It seems to me that a very great deal depends on what this amplifier is for, what does it do, what is the application ?

Perhaps it is something really crude like a photocell amplifier that only needs to distinguish between night and day and drive a relay. A sensitivity potentiometer can cover for a lot of component spread. Or is it something terribly sophisticated for high end professional equipment?

Another factor is prior knowledge and experience of similar circuitry. If you have been designing this type of application for the last ten years, it is going to be a lot simpler to design a slight variant than it would be for a complete novice new to the field starting completely from scratch.

Quite often it is only the very first input stage of what may be a very large and complex circuit that is really critical.

I cannot see any real advantage of simulating a power transformer, a pair of diodes, a filter capacitor, and three terminal regulator in Spice. That wold be a complete waste of time. The application notes for the regulator will caution you about instability problems, excessive lead lengths or any other traps. Spice most probably would not.

 
I remember a incident with my grandpa when I was just a punk. I found him doing long division with pencil and paper and I, with some pride informed him that the new solid state calculators would do long division for him with just a few key strokes. He replied he didn't have time for that, and that he knew for certain that if he did it himself with pencil and paper it would be right and he was not going to waste time placing trust in any electronic calculating device that could give him a wrong answear.
 
I use calculators as well, however I've seen many cases where someone uses one and gets a wrong answer. Why? They didn't notice that it was in radians, or grads, or degrees when they used a trig function, or thought "LOG" used base e, because they didn't see the "ln" key.

They are excellent tools, but if you don't have some idea as you work through the problem what kind of answer to expect, you can easily get burnt.

I was using a scientific calculator program on my PDA and was getting some bizarre results (or so it seemed to me) when I was doing some statistical analysis. The regression results didn't look right to me. Double checked everything, no mistakes. Ran the same data with another calculator, results were different, and looked good. Ran it on a spread sheet, same results as the second calculator.

Emailed the software company with my input data and showed them the results. They found a bug in their software in an intermediate step that no user would ever see. When you exceeded a range of values in the intermediate results, their routine went bonkers. (I was even able to tell them approximately what values to look for that would expose the bug.)

That was unintentional. One of the best practical jokes I remember from college was my lab partner had a fancy new HP45 scientific calculator, and everybody kept borrowing it.

So he took the top half of the case off and swapped the "sin" and "cos" chicklet keys. No one ever noticed that their results were wrong. Well, not until they got the graded homework back...

There's a reason all my old math teachers used to drill into us, "show your work!" If you don't have a very good idea what's going on and what to expect, and just trust the machine or the software that runs on it, watch out.
 
I work as an apps engineer for an IC mfg company. Many of our parts have a lot of complex features. There is no way that I could spend the time necessary to create a spice model for each of the parts that I am responsible for - that would end up being my job - no thank you. Even so, we are increasingly seeing requests from customers for spice models of these parts. For the life of me I can't figure out why someone would want to simulate the circuits. To me, it's a pointless exercise. The datasheets and app notes are written to give ample guidance to design the circuits that the ICs go into.

There was a push a while ago to join the herd and put sim tools on our website. IMO, none of the sim tools that we, or our competitors have, really do anything special that one could not do with the datasheet, a calculator and a piece of paper. I can tell you that I don't use them - nor do any of my collegues. It's been my experience that those who want these simulation tools don't really know what they're doing in the first place - it is painfully obvious when called upon to review their designs.

On the other hand, the designers do rely on sims to flush out the design prior to masking out the first rev of the part (or subsequent ones). The sim tools the designers use are scrutinized closely - each component is tested and verified to the process used prior to being released to the designers for design use. Many times, when reviewing problems, the designers are called on to sim out the problem while we look at it concurrently on the board. It is invaluable to find out just what is happening inside the IC.
 
I hate to burst your bubble, but datasheets are RARELY designed to help designers. Parameters are measured under some conditions, but not others. There's no information about interacts, i.e., what happens when one parameter is at its extreme and something else is at different extreme.

And why does, "It is invaluable to find out just what is happening inside the IC" not apply to the system designer?

TTFN



 
Status
Not open for further replies.
Back
Top