3
\$\begingroup\$

The following circuit, taken from this answer seems to give odd results when doing a parameter sweep simulation on CircuitLab. Is the problem with CircuitLab, or is there some problem with the circuit that I do not see.

schematic

simulate this circuit – Schematic created using CircuitLab

The intent of the circuit is to provide a constant current through R3 so that its value may be determined by measuring the voltage across it. When I ran a sweep which varied the value of R3 from 10 to 200 \$\Omega\$, a "notch" in the output voltage appears. enter image description here However, the \$V_{be}\$s and \$I_b\$s of the transistors look fine.

enter image description here enter image description here

Changing the transistors to BC327's gives an even more erratic sweep.

enter image description here

Removing either the ammeter or the voltmeter from the circuit makes the problem go away!

Also of interest, if the value of R3 is manually set between 140 and 166 \$\Omega\$, DC simulation gives the correct answer. The problem only seems to occur with DC sweep.

Does anyone know the cause of this, or the precise conditions under which it occurs?


Update: Checked on 19 April 2022, and problem persists.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Thanks for examining this. I verified your findings (after your comment to my answer in the linked question) but found that the meters read correctly when R3 was set at 150 and 160 ohms. I didn't try taking the meters out though so that's an interesting find. \$\endgroup\$
    – Transistor
    Sep 29, 2021 at 21:13
  • \$\begingroup\$ Tip: SE supports HTML entities &Omega;, &mu;, &deg;, &times;, &pm;, etc. as well as <sup>...</sup> and <sub>...</sub> in the posts (but they don't work in the comments). You don't need to use MathJAX just for a symbol. \$\endgroup\$
    – Transistor
    Sep 29, 2021 at 21:36
  • 1
    \$\begingroup\$ LTspice doesn't seem to have this problem. But it also doesn't have an ammeter. So, there, one simply uses a 0 V voltage source to get the equivalent device. I'm guessing that CircuitLab is more focused on being a circuit-sharing site and less focused on being a quality simulator. \$\endgroup\$
    – jonk
    Sep 29, 2021 at 22:45
  • 2
    \$\begingroup\$ LTspice gives this result. \$\endgroup\$
    – jonk
    Sep 29, 2021 at 22:52

1 Answer 1

2
\$\begingroup\$

DC sweep tries to save time and reuse results from the previous step as a "seed". Turns out this seed makes convergence worse sometimes. I've ran into this bug many times.

The problems are twofold:

  1. Loss of output voltage.

  2. Loss of collector current on Q1.

Output voltage plot with a chunk miscalculated Collector currents, with a chunk of Q1's current miscalculated

Workarounds:

  1. For the loss of output voltage: set shunt resistance of AM1 non-zero. 1u ohm is fine.

  2. Add a dummy parallel resistor to Q1, and switch it out of the circuit. The switch is optional for purists that worry about 1G ohm loading up the poor transistor :)

Yes, these problems are independent: fixing #1 still leaves #2 unfixed. It's a Schrodinger's transistor: if you observe the collector current, it goes into a superposition of working and non-working state, depending on which observer you ask. The pun potential mitigates some of the annoyance.

schematic

simulate this circuit – Schematic created using CircuitLab

It works with those workarounds:

Output voltage plot= Collector currents

It also works when transistors are changed to BC327 :)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.