Bug Report: Series Switches

There is a problem putting two or more switches in series - when both switches are open, the intermediate node is "floating" and the simulation fails. I was using voltage controlled switches, have not verified with time-dependent switches. I fixed this by placing a high value (10^14) R from the floating node to ground. I think such a finite conductance needs to be added to the switch element when "off" to eliminate this problem.

See my circuit eliminating the 100T resistor causes the circuit to fail.

[Problem seems browser independent (Safari, Chrome tried)]

by CarlSawtell
March 07, 2012

Hi @CarlSawtell, thanks for reporting this. We've just deployed an update that does use a high value resistance to make series switches "just work". R2 should no longer be needed.

by mrobbins
March 11, 2012

Thanks, I verified that it does work on my various test circuits. Although I had not yet updated my bug report, I had found that among the various momentary switches, time-dependent switches, relays, voltage controlled switches etc., some showed this problem and some (e.g. momentary switches) did not. I had test circuits for various switch types, and now they all will simulate!

by CarlSawtell
March 11, 2012

Great! I just took a look at your "Debouncing switches" demo: and if you change the time step from "1u" to "10u", it simulates much faster. Additionally, if you switch M1 and M2 to be part number 2N7000s (a much smaller MOSFET with much smaller capacitances), you won't see the voltage spikes associated with pushing those charges around.

by mrobbins
March 11, 2012

Yep, I've seen a similar problem if you put two or more diodes in series. The diodes are effectively open-circuits when reverse biased and that confuses the simulator. Putting a 10M resistor in parallel with each diode helps a lot.

by arduinohacker
March 19, 2012

For this reason, many SPICE diode models have a 1G resistor in parallel with the basic diode model to improve convergence.

Connecting current sources in series will also produce the same problem plus silly voltages because an ideal current source has an infinite impedance.

The converse of this problem is that Inductors and/or voltage sources in parallel must have some series resistance to avoid infinite currents causing convergence failures (I think this has already been pointed out w.r.t. voltage sources elsewhere by Mike?)

by signality
March 20, 2012

Would it be possible to have a "SANITY" checkbox somewhere in this wonderful app?

Said box would automatically hang 1G-ohm resistors on all nodes, and 1 milliohm resistance in series with each inductor and capacitor.

That would help a lot of common situations where a node can float or go hog-wild.

Even better, there are some simulators, if they blow up, they automatically re-run the sim with these kinds of crutches in place.

Just sayin'.

by arduinohacker
March 20, 2012

Post a Reply

Please sign in or create an account to comment.