(first published in the November 22, 1990 issue)
Recently, I was down in New Orleans at one of the IEEE conferences—the International Symposium on Circuits And Systems. The keynote speaker, Professor Ron Rohrer from Carnegie-Mellon University, commented thoughtfully about many aspects of education for engineers. But what he said that really stunned me was his observation that “In the era of Spice, nobody designs on the back of envelopes anymore.” Ouch! Is it becoming more and more true that young (or lazy?) engineers can’t do much designing without some computers or high-powered calculators? They really cannot design things without a lot of assistance from computers. Spice just happens to be one of my pet peeves, and I will start gnawing on its ankles today.
Now, I’ve always been a friend of analogies, analogues, analogs, similes, models, and metaphors. When I worked at George A. Philbrick Researches, the company’s motto was, “The analog way is the model way.” In those days, we sold some analogue computers, even though part of the business was shrinking and the popularity of the op amp was on the rise. But we all tried to follow the party line: that analog computation was serious business. And it still is, although as a percentage of the electronics business, it has shrunk to a tiny fraction.
Still, there are many times where a little analog computation is exactly the right thing, and someday I will expound on that…. But, Spice (Simulation Program with Integrated Circuit Emphasis) is a rather popular and powerful tool these days, and almost everybody finds it useful to some extent. I remember when my old boss, Tim Isbell, showed me how to use it—and then we spent half a day horsing around because it said we had 72-V forward voltage across the diode. I will emphasize just a few of the basic problems with Spice today.
The main problem is that people tend to trust its answers, as they trust most computers, long after the reason to trust it should have evaporated. I have come very close to fist fights and screaming contests when a person claims that such-and-such an answer is obviously right because Spice gave it to him. Conversely, I normally try to avoid working with Spice unless I can first run a calibration program on it, so it gives me an answer that makes sense—a sanity check.
This is much like the old days of the slide rule: You couldn’t use the slide rule unless you already knew approximately what the answer was. It’s not like a calculator, where the decimal place is provided on a platter. You have to provide your own decimal place. In other words, you are forced to be a pretty good engineer before you even pick up your slide rule, or your analog computer. But people who use Spice are often buffaloed or fooled by any absurd kind of answer.
So, trusting your computer seems to be one of the new trends that I would like to see quashed. It’s too easy to find, weeks later, that the computer told you a lie, because the data you entered had a typo error or a monumental goof.
Now, never let it be said that Pease recommends you use analog computers or breadboards instead of Spice because analog computers don’t make errors. Spice lies, but analog computers do not? Oh, please, don’t say that: analog computers lie, too, and so do breadboards. But I prefer them because they often offer a great insight and understanding as to what’s really going on. So if you survive their problems, you are smart enough to keep out of other kinds of trouble. But that’s just a bunch of philosophical stuff.
The thing that makes me nervous about Spice is that it was largely designed by a group of grad students (Laurence Nagel and others at Berkeley) back in 1973. Now, when you find a problem, a discrepancy, a glitch, a flaw, an error that seems to be built into Spice, can you go back to the people who designed it? Hardly. There’s no continuity. There are some people who claim to “support” Spice, but I’m not usually impressed with their statements.
My biggest gripe with Spice is its lack of convergence. The ordinary Spice 2G6 has all sorts of problems, even if you don’t use FETs (we find that FETs usually make the convergence situation really unhappy). For example, one time I had a moderate-sized circuit with about 22 bipolar transistors, and it didn’t converge well then. Then, all of a sudden, one day it started to converge beautifully and quickly.
I was so impressed, I backed up to find the “scene of the crime.” I tried to duplicate all of the changes I had made since I last had problems.
It finally turned out that I had an unused resistor and an unused capacitor each tied from one node to ground. Nothing else was connected to that point. They were originally “commented out” by an asterisk. But, at one point, I deleted the asterisk and the useless R and C were dropped into the circuit—they just happened to make the convergence a lot better.
When I removed the R and C, things got worse again. This led me to appreciate two things: that the convergence is a lot more fragile than we suspect; and that we may be able to randomly throw useless resistors into a circuit, and sometimes they may help to improve the convergence.
In other words, if you have a circuit that shows bad convergence, the computer might have a subroutine to randomly sprinkle a few resisters into the circuit and see if that helps—a kind of “autoconverge” scheme. At present, we’re still working on this, and it may be a useful approach. But, this concept isn’t too surprising if you’ve ever heard that the convergence of a circuit may be improved or degraded depending on the names and numbers you call the nodes of the circuit.
If you swap a couple nodes’ numbers, and things get better (or worse), doesn’t that make you nervous? Or at least suspicious?
Some people claim that dynamic ramping up of the power supplies can help improve the convergence. Maybe. I agree, it’s worth a try, but I recall a lot of circuits where even ramping didn’t work. Another serious problem I had with Spice was when I ran some simple transient tests—triangle waves—on the collector of a transistor. I ramped the VC up and down from 5 V to 15 V, back and forth, and ran several tests. Then I added some complicating factors, and wanted to look at the circuit for the first 202 µs of a 10-kHz triangle wave.
Namely, after the first two cycles of the triangle wave, I decided to look at the collector current (I = C x dv/dt) of the transistor at t = 201 µs. I got my answer printed and plotted, and it didn’t make any sense. I studied the whole circuit, and I used every troubleshooting technique I could think of, and it didn’t make any sense. The current through the 1 pF of CBC was not 0.2 µA, but 5 µA. How could that be?
After several hours, I finally decided to look at the incoming waveform (which I knew would be a waste of time because I knew very well what I had told it to do…. I had commanded it to go back and forth from 5 V to 15 V, at the rate of 50 µs per each ramp). But when I looked at t = 201 µs, the dv/dt had suddenly increased from 0.2 V/µs to 5 V/µs. It turned out that because I had commanded the Plot mode to stop at 202 µs, the transient generator had decided to go from 15 V to 5 V—not in the time from 200 to 250 µs, but in the span from 200 to 202 µs. The dv/dt sped up by a factor of 25, without being asked to, for a completely unexpected reason.
Nothing I had ever seen about Spice, nothing my friends had ever heard, would lead you to expect this. In fact, Spice sort of encourages you to look at the waveforms any time you want—it offers a sort of “infinitely versatile, expanded-scale oscilloscope,” and if it has a dv/dt that suddenly changes, well that’s quite a surprise.
So I immediately wrote an open message to all of my friends at National, warning them about this potential problem; and now I’m writing to warn all of my friends everywhere. These are just some of the reasons I’m not enthusiastic about Spice. It’s goofed me up, me and my friends, too many times.
My boss points out, it’s not necessarily true that all kinds of Spice have such bad problems with convergence or bad computations or spurious signals. And that may be so. If somebody who knows about all different Spice products wants to write in and assure our readers that his Spice will never do that, well, that’s fine by me. But, meanwhile, just remember—I don’t hate these digital computers. They hate me; I despise them. Stay tuned for the next column, because I’m not finished with Spice yet.
All for now. / Comments invited! / RAP / Robert A. Pease / Engineer
via Rako Studios Youtube Channel