August 22, 2012

Anyone who has read a few of my blogs has seen that I simulate circuits in SPICE. You may know that Bob Pease was pretty opinionated about SPICE and once wrote, “SPICE takes away your ability to get good insights on what is happening. Spice actually HURTS your understanding of how circuits function.” In honor of Bob’s birthday today, let’s consider some merits and pitfalls of SPICE.

Bob was a colorful character and often resorted to hyperbole to make a point. I understand his concern. Half-baked hacking around in SPICE can be counterproductive and may stunt your analog growth. I’m sure he witnessed this on occasion.

The fact is we may not be as skilled or experienced as Bob. We may not have the analog mentors to guide and teach us as he once did. Our design world moves at a quick pace and we may need help.

I believe that SPICE, when used judiciously, can improve your understanding of circuits and make you a better analog designer. It requires discipline. What does that mean?

When you perform a circuit simulation, have clear expectations. Think carefully first. From knowledge, experience and calculations, anticipate the result. If you get what you expected, great. If not, you have an opportunity to learn. Don’t immediately try something different. First, do your best to answer the question of why the results didn’t match your expectation.

Maybe it is due to a simple oversight and you can quickly move ahead. But if not, it may be an indication of some faulty thinking or a miscalculation on your part. Better to learn from it and gain new insight. Or maybe your models are not perfect (Bob would remind us that they never are). Could this account for the difference? Or maybe you have misused SPICE and gotten some quirky result (it happens). Whatever the reason, ignoring it and moving on is analog-hacking.

Figure 1.  A small-signal transient simulation in SPICE can reveal potential instability. It’s used here to step through three values of CF to check compensation for input capacitance. Bob would remind us that the tiny capacitance values of CF would demand verification and optimization on actual circuit board layout!

Now I won’t say I always follow my own advice. Sometimes, I will suspect a cause and try something different. I will circle back later to resolve the discrepancy. There are plenty of ways to use or misuse SPICE but I think this is a basic philosophy that can guide your simulation efforts.

I would love to have a friendly discussion with Bob about SPICE. I bet there could be some “give” in his seeming never-use-SPICE position. In fact, here is another side of the story indicating that he indeed had some flex on the issue:  Bob Pease didn’t hate SPICE.

In future posts I’ll provide some tricks and suggestions on how to get the most from SPICE simulations. And if you’re not already using SPICE, I recommend TI’s free SPICE program, TINA-TI. It’s very capable and quite user-friendly.

Bruce        thesignal@list.ti.com

 

A Pedantic fact:   SPICE = Simulation Program (with) Integrated Circuit Emphasis

 

          Index to all The Signal blogs.

 

Anonymous
  • Myron, this may have been meant ironically. A tool that sells well, makes you rich, even though the people are buying it for the wrong reasons and tasks.

  • I also remember one of the Bob’s interview where a reporter asked Bob “ What he would like to do if he start his life again?” and Bob said: “ I would like to create Pspice”

  • A circuit drawn on a piece of paper works always, immediately, upon our wishes.

    Real circuit functions, if properly designed and also built.

    Simulated circuits are something between the above two.

    For me, as a designer, who builds his designed circuits by himself; is any simulation just a wasting of time.

  • PSpice is a useful tool.  However, as with any tool, it is a case of choosing the right tool for the job. I agree with most correspondents that it should only be used for verifying properly worked out designs and trying "what ifs?".  Some of the provided models are in error.  For example if you construct a simple circuit with a LM158 operational amplifier and you drive the inverting input with a positive signal such that the output would be taken below the negative supply, if that would be possible, which it isn't, you will find that the simulation does take the output below the negative supply by about 166mV. BEWARE!  Also a lot of discipline is needed.  If you are forever making changes, then you need a careful log of th ePSpice simulation versus the actual circuit.  You can also spend a great amount of time just tinkering and in some instances trying to overcome convergence errors.

  • I really like Excel. I used it 15 years ago to draw room (dungeon) layouts for P&P roleplaying games.

    And for printing the bills for my business (including a small product database to pick the prices and names by product number)

    And as a notbook for todo-lists etc.

    Nothing of it being the 'intended use' of a spreadsheet. :)

    Well, it's a nice tool to visualize things. However, you need to get the formula right first. If you just play on a formula until the drawn chart looks right...that's definitely the wrong way. But I know that it is often used this way.

    (I must admit, I also used it this way to optimize the resistors on an NTC sensor - but I got the formula right first, just the values had to be adjusted for the intended range of interest)