Page 217 - Troubleshooting Analog Circuits
P. 217

204                                                  G. More on Spice


                         boards, but I like them because they often offer a greater 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 ‘73. 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 is no
                         continuity. There are some people who claim to “support” SPICE, but I don’t always
                         agree 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 mod-
                         erate-sized circuit with about 33 bipolar transistors, and it didn’t converge well. Then
                         all of a sudden, one day it started to converge beautifully and quickly. I was so im-
                         pressed, I backed up to find the “scene of the crime.” I tried to duplicate all the
                         changes I had made since I last had problems. It finally turned out that I had an un-
                         used resistor and an un-used capacitor each tied from one point to ground. Nothing
                         else was connected to that point. Originally they were “commented out” by an as-
                         terisk. But, at one point, I deleted the asterisk, and the useless R and C were dropped
                         into the circuit-and  they just happened to make the convergence a lot better. When I
                         removed the R and C, things got worse again.
                           This lead 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 could 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 resistors into the circuit and see if that helps-a  kind of
                         “autoconverge” scheme. At present we are still working on this, but it may be a
                         useful approach. This concept is not too surprising if you have 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?
                          Another serious problem I had with SPICE was when I ran some simple transient
                         tests-mangle  waves-on the collector of a transistor. I ramped the V,  up and down
                        from +5 V to + 15 V, back and forth, and ran several tests. Then I added some compli-
                        cating factors, so I wanted to look at the circuit for the first 202 ps of a 10-kHz mangle
                         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 ps. I got my answer
                        printed and plotted, and it did not make any sense. I studied the whole circuit, and I
                         used every troubleshooting technique I could think of, and it did not make any sense.
                        The current through the 1 pF of C,  was not 0.2 PA, but 5 FA. How could that be?
                          After several hours, I finally decided to look at the incoming waveform. I had
                        commanded it to go back and forth from 5 V to 15 V, at the rate of 50 ps per each
                        ramp, so I knew what it had to be doing. But when I looked at t = 201 ps, the dV/dt
                        had suddenly increased from 0.2 V/ps to 5 V/ps. It turned out that because I had
                        commanded the PLOT mode to stop at 202 ps, the transient generator had decided to
                        go from 15 V to 5 V, not in the time from 200 to 250 ps, but in the span from 200 to
                        202 ps. The dV/dt speeded up by a factor of 25, without being asked to, for a com-
                        pletely unexpected reason. Nothing in anything I had ever seen about SPICE, nothing
                        my friends had ever heard, would lead you to expect this. In fact, SPICE sort of en-
                        courages  you to look at the waveforms any time you want-it  offers a sort of “in-
   212   213   214   215   216   217   218   219   220   221   222