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.
A Pedantic fact: SPICE = Simulation Program (with) Integrated Circuit Emphasis
Index to all The Signal blogs.
Some 25 years ago I had to do lots of Fourier analysis at the university. I had a small programmable pocket calculator with graphical display. Of course it was no laptop that could have done the analysis, bu tI programmed it to draw a waveform based on _my_ analysis results. If the waveform matched the original, I knew my analysis was correct. If not, I knew had to repeat it.
25 years later, I still use the same technique: I design a circuit, and when I think it's correct, I run a simulation and check whether the result matches my expectations.
However, and this is IMHO what Bob Pease was 'accusing', many people design their circuit with SPICE. Adding parts here and there until the simulation result fits their required result. They don't know then why it works and cannot be sure whether it works for all conditions. And if they later discover any problems, they have no idea how to fix them but to poke around in SPICE again. And - as you wrote in a different blog post, SPICE models usually don't cover all details, including layout-related problems.
So I agree to Bob: SPICE is a nice tool to verify a design, but shouldn't be used to _do_ a design.
I too agree. It became apparent to me as these modeling tools became prevalent (not just spice) that they were great tools for understanding, but not so much for design. If you get used to jumping to the answers in the back of the book, you short circuit your learning process. These simulation tools are great for verification as you mentioned, and to some degree to do "what ifs", but as a general design tool they lead to some pretty suboptimal designs.
So true. I do the same with i simulate. Simulation is solely because you dont have the parts. If you try to silmulate and try to figure the correct reading of capacitors and resistors and stuff, you're going to end up failing all your exams and being probably a very bad electronics engineer who knows nothing!
Spice actually lets you measure things that are difficult to measure in real life, such as the current transient through a capacitor. It is just another tool in the box. I think even Bob would agree. And I agree that you can't make a good design just using Spice.
Bob P. also did not like spreadsheet programs like Excel. and regularly degraded them. It is true that these programs can be easily misused, just like SPIICE, but most people will agree that for certain things, Excel sure improves productivity. Like anything else, you just have to be careful....
I use spice for exploring circuit concepts so I start with fundamental building blocks of E, and G sources and then add the chosen models. Like Larry Martin1 you can make measurements that are difficult to on the bench. It is also useful in understanding why a real, breaded board circuit fail. For university students they can explore circuits without burning components. Although the latter is extreme useful for developing caution in experimentation.
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)
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.
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.
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”
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.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.