1
\$\begingroup\$

I am trying to simulate the circuit below where I have a behavioral current source whose job is to limit the current to 1m if the current in the circuit exceeds 1m. However, the circuit below doesn't work. What could be causing this problem?

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ When solving for an operating point, the solver encounters circular dependence of initial conditions: V(N1, N2) = R1(=1) times V(N1, N2): the matrix of coefficients is singular, LTspice informs you about this fact, and stops. By the way, your expression for B1 (I(amp) = V(volt)) looks quite awkward: you better add .param Rbi=1(Ohm) that would let you write I(amp) = V(volt)/Rbi \$\endgroup\$
    – V.V.T
    Sep 4, 2023 at 14:06
  • 3
    \$\begingroup\$ Please, for the love of all good things, don't use IF() statements in SPICE. \$\endgroup\$ Sep 4, 2023 at 15:17
  • \$\begingroup\$ @TimWilliams, what alternative do you propose? \$\endgroup\$ Sep 4, 2023 at 17:44
  • 2
    \$\begingroup\$ A continuous function with a small but finite transition band is a much better choice. Consider tanh(x) for example. These can even be built from primitives -- G-sources and diodes for example. (Diodes have a typical voltage drop of some 100s mV, but Vf can be canceled out with a complementary current source and diode against which to reference it; or the input and output voltages can be scaled so that diode Vf is effectively made very small.) \$\endgroup\$ Sep 4, 2023 at 17:48
  • 1
    \$\begingroup\$ Mind, I don't know what your intent was, because your description doesn't match the circuit. A standard way to construct a circuit of such description might be a diode behind an ideal gyrator: instead of clamping voltage at Vf, voltage and current are interchanged thus current is clamped at Vf*gm. \$\endgroup\$ Sep 4, 2023 at 17:50

2 Answers 2

1
\$\begingroup\$

I don't know why, but if you multiple the second occurrence of V(N1,N2) in the behavioral equation by 0.99999 or 1.0000001 it works (but not if you multiply it by exactly 1).

Added-- the equations look a bit circular. Try replacing the behavioral CS with a fixed CS and paralleling it with an ideal diode.

enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ this only fixes the simulation error, but the resulting current is not what is expected. \$\endgroup\$ Sep 4, 2023 at 13:52
  • \$\begingroup\$ @V.V.T It would be good if you could provide a complete answer. \$\endgroup\$ Sep 4, 2023 at 15:09
  • 1
    \$\begingroup\$ @V.V.T, please do. \$\endgroup\$ Sep 4, 2023 at 15:10
  • \$\begingroup\$ No combination of initial conditions makes the solution consistent for original poster's circuit. It can be seen by inspection. The answer to the question, What could be causing this problem? is my comment to the OP. How to implement the circuit whose job is to limit the current to 1m if the current in the circuit exceeds 1m, is never asked; only stated that the proposed circuit does not work. Seeing that OP and the answerer reached full agreement in their conversation, I deleted comments supposed to prompt OP to the conclusion that the initial circuit is inconsistent in principle. \$\endgroup\$
    – V.V.T
    Sep 4, 2023 at 16:29
1
\$\begingroup\$

I am back to apologize. Sorry, yesterday was not my best day, and I failed to appreciate the finest occupation joke you kindly shared to our community. All I needed to do was to stop being nerd and, instead, just relax, draw the circuit, run the analysis and enjoy!

curr_lim

Zoomed-in current plot:

zoomin

Thank you, I have a good laugh!

For the visitors arriving at this page via search engines: joking aside, pay attention to @TimWilliams' comments.

\$\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.