0
\$\begingroup\$

I'm trying to simulate a linear voltage controlled current source with ngspice and Kicad. This is the minimal circuit I've redrawn for the purposes of simulation.

enter image description here

I do want to be able to simulate transient behavior for a step change in the input voltage, ,but otherwise I'm not too concerned about the frequency response of the circuit. IN is essentially a DC level being adjusted very slowly by a DAC, let's say at most once per 0.1s.

This question is only related to the DC operating point simulation, in the image above set to 2V. I expect the inverting input of U1 to also reach around 2V, but instead the simulation reports 2.32V. At IN=0.7V, 1V, and 1.5V this difference does not arise.

I expect it has something to do with limitations in the Gain of U1. Below are the Gain vs Frequency graphs in the datasheet of the ADA4522. The opamp itself claims a GBW of 3MHz. The actual gain simulated at this DC operating point, however, is only 62.5x.

ADA4522 Gain Characteristics

I've used the following models :

I haven't yet figured out how to export a portable netlist from a Kicad schematic. I could upload the Kicad .sch file and the models in a zip file, made with Kicad v8.0.4, if it helps. For the moment, this is the netlist for the above circuit without the models included:

.title KiCad schematic
.include "ADA4522.cir"
.include "OPAx388.LIB"
.include "TIP142.LIB"
R1 Net-_R1-Pad1_ Net-_Q2-B_ 100
XU1 IN MONITOR_I VPP 0 Net-_R1-Pad1_ ADA4522
RHTR1 Net-_Q2-E_ VSHUNT 32
XQ2 VPP Net-_Q2-B_ Net-_Q2-E_ tip142
C1 VSHUNT 0 470p
RSHUNT1 VSHUNT 0 0.1
XU2 VSHUNT Net-_U2--_ +5V 0 MONITOR_I OPAx388
R2 Net-_U2--_ MONITOR_I 39k
R3 Net-_U2--_ 0 1k
V3 IN 0 DC 2 SIN( 2 3 10 0 0 0 ) AC 3  
V2 +5V 0 DC 5 
V1 VPP 0 DC 48 
.end
 
  • Why is the inverting input at 2.32V and not 2.00V?
  • Is this a simulation issue or a circuit issue?
  • Is there any way in which this difference can be reduced?

Edit :

Transient Analysis Results

I've run transient analysis by changing VSIN to VPULSE with y1=0 y2=2 td=100m tr=1u tf=1u tw=1 per=2. This is the result I get :

Transient Analysis for 2V step

I'd want to do something about the overshoot and ringing, but in principle it seems to be working fine. Does this mean the DC operating point simulation is not doing what I assumed it would do?

I've also done the same with y1=1, and the shape of the curve looks about the same. The DC operating point simulation at 1V does return the correct 1.00V volt result, though, with the same transient simulation shape, unlike 2.32V for 2V.

Transient simulation with VSIN also provides some other unusual results:

Transient Analysis with sin input, 0-4V

I don't expect there to be any clipping here, yet transient analysis of a sinusuoidal input is creating it. The fact that it's clipping at 3.5V suggests to me it might be a problem with the ADA4522 model, which has a maximum input level of 3.5V when powered by 0/5V.

Transient simulation with sinusoidal input showing base current

A DC Sweep with the same configuration also produces a strange artifact at ~1.2V input. Though I must say the DC sweep results have been a little strange for some time, and these artifacts seem to occasionally disappear when I restart kicad. Note, however, that the DC sweep does suggest more than 1A (42W across 32 ohm) is indeed accessible to this circuit.

DC Sweep 0-5V

Interestingly enough, DC Operating Point simulation at 4.00V works perfectly with 4.00V at MONITOR_I, while transient simulation with a 0-4V step saturates at about 3.3V at MONITOR_I.

Transient Simulation Step to 4.0V

\$\endgroup\$
2
  • \$\begingroup\$ Use a transient analysis and look at what the feedback voltage settles down to. \$\endgroup\$
    – Andy aka
    Commented Jul 30 at 14:48
  • \$\begingroup\$ @Andyaka It seems to settle down to the correct value in the transient analysis (added edit to the question) \$\endgroup\$ Commented Jul 30 at 15:05

1 Answer 1

1
\$\begingroup\$

Use a transient analysis and look at what the feedback voltage settles down to. – Andy aka

The above is a recommendation I gave in a comment under the question. It was followed up with this comment from the OP: -

@Andyaka It seems to settle down to the correct value in the transient analysis

That's what I would expect looking at your circuit.

Does this mean the DC operating point simulation is not doing what I assumed it would do?

DC operating point analysis can be fooled into giving inaccurate results. I mean, it's a one-number fits-all approximation and, calculated quickly without a lot of finesse.

Good luck with sorting the other problem and stick with the transient analysis. It looks like the TIP142 may not be getting enough base current. Try lowering R1 a tad to see if it improves.

\$\endgroup\$
4
  • \$\begingroup\$ Changing R1 to 47 and then to 0 seems to have no effect. Thanks, though \$\endgroup\$ Commented Jul 30 at 16:02
  • \$\begingroup\$ It's a simulator and you can just try anything you want without burning your fingers LOL. \$\endgroup\$
    – Andy aka
    Commented Jul 30 at 17:25
  • \$\begingroup\$ Maybe add an emitter follower to the output of the ADA4522. I'm thinking that you may have hit the maximum current output of the op-amp. \$\endgroup\$
    – Andy aka
    Commented Jul 30 at 17:51
  • 1
    \$\begingroup\$ I'll try that, though the simulation only shows 1.5mA, while the datasheet suggests it should be able to do 15mA \$\endgroup\$ Commented Jul 30 at 18:09

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.