# Problem simulating current controlled current source in LTspice

I've been trying to simulate the following circuit in spice. (I'm plotting the voltage over R7)

Everything is okay, and works as expected until I change the gain of the current controlled current source to a value that's greater than 58. And I should simulate this with a value of 290. Any idea on how to fix this?

Here is another photo with the gain in 290

When I set the gain in 58. Spice trows the following error "spice analysis: Time step too small; initial timepoint: trouble with node n002" The node n002 is the node that connects R4 with R1. For greater values the error doesn't show up anymore but the result is the one from the picture.

Thank you for any help you can give me on this issue!

• At time = 0 the simulator tries to find a stable DC solution. When you set the CCCS to have a gain of 280 I suspect that positive feedback is introduced into the system in such a way that there is no stable DC solution. I am also suspect of the direction of the output current of the CCCS, I think the arrow should point to R3 (the emitter?). It is unclear what the direction of a positive current through R1 is, down or up? – Bimpelrekkie Dec 4 '19 at 12:12
• I've just changed the orientation of the CCCS as you said, you are right. The positive direction of the current through R1 is down. But the problem still arises. With a gain of 50 the voltage on is inverted with respect of the voltage on V1. So it's working as expected. But when I take the gain to higher values it continues to fail. Any idea on how to fix this? – Gaston Dec 4 '19 at 12:28
• If this is the small signal equivalent circuit of a BJT common emitter circuit and you want to make $\beta$ = 290, look at how the values of the small signal components vary when $\beta$ varies. Is R1 always 16 k ohm? Other option: try using a voltage controlled current source instead of the CCCS (using a VCCS is much more common). – Bimpelrekkie Dec 4 '19 at 12:38
• I think the problem lies at the points where V1 becomes zero and there is a recursive dependency: the current through R1 is (solely) determined by B1 (because V1=0), while the current B1 is determined by the current through R1. The simulator probably steps across the points where V1=0 for small gains, but fails to do so for big gains. – Huisman Dec 4 '19 at 12:42
• I've tried to add a 1V dc in the voltage generator. So te voltage never reaches 0V. But it does the same. The problem as you say is clearly the feedback, beacuse I shorted R3 and it worked perfectly. However that isn't what I need. – Gaston Dec 4 '19 at 13:18

Behavioural sources are very versatile, but sometimes can suffer. Using the VCCS (aka G-source) should eliminate the problem. In this case, since you are only taking a current and multiply it by a constant, you can replace B2 by a VCCS like this:
It takes the voltage across R3, divides it by its value (1/16k), and then multiplies it by some constant (290).
Alternately, you can either insert a zero-valued voltage source in series with R3 (let's presume it's called Vx), then use an F-source with the value Vx 290 (careful at the direction of the source, + ---> -), or replace R3 with the same zero-valued voltage source, but with Rser=16k added, same F-source.
• @Gaston If you look in the manual at LTspice > Circuit Elements > B. Behavioural ..., you'll see Expressions can contain the following: and then, at the 3rd bullet: it is assumed that the circuit element current is varying quasi-statically [...] (plus explanation). My advice would be to only use behavioural sources when the expressions cannot be replaced by elementary VCCS or CCCS (and their voltge counterparts), but that would be just that, advice, based on opinion. – a concerned citizen Dec 5 '19 at 18:00