Electronic – Why isn’t this opamp working correctly

current-sourceoperational-amplifiersingle-supply-op-amp

I am working on an adjustable current source. In a thread awhile back, various circuits were discussed:

simple adjustable current source for LED string

… but as I have settled on one option, and it's not working correctly, I'm starting a new thread to focus on my conundrum.

Here is the circuit:

enter image description here

The resistor divider (30K resistor and potentiometer) provide a reference voltage on 'set' (the DC sweep of v1 just rotates the pot shaft). The opamp should servo 'gate' so that 'sense' equals 'set', and thus the current (in milliamps) pulled through the load 'Rload' equals the voltage of 'set' (in millivolts). Simple as that.

The 12v supply which powers the 'set' circuit and the opamp is a 7812 powered off the 24v supply. And the mosfet is actually a FQP10N20C (a fairly vanilla power nfet).

I've simulated with LTspice and it behaves as I'd expect. But on the breadboard, as 'set' is increased from 0 to about 400mV, 'sense' tracks 'set' less and less well. At one point I'm seeing 257mV on 'set' but only 226mV on 'sense'; so only 226mA is flowing through Rload and R1. 'Gate' is at 3.53V and 'down' is at 11.7V. If one just examines the opamp in isolation, it seems that 'gate' should be driven higher (until, presumably, at some point enough current flows that 'sense' equals 257mV).

The opamp is meant to be used with a single-ended supply, and should easily be able to drive its output above 3.53V (with a 12V supply voltage). The gate of the FET should not be sinking any current (verified with meter).

I'm stumped.

Datasheet for the opamp (LT1006)

Best Answer

The problem is evidently that there is some sort of oscillation on the output of the opamp. Putting a 10uF capacitor on the 'gate' node more or less fixed the problem, but putting a 1K resistor between the opamp output and the fet gate doesn't help much. I'm now seeing no more than about 7mv discrepancy between 'sense' and 'set', over the whole current adjustment range (now 0 to 300ma) and a voltage (required to drive that current through the load) between about 3 and 23v.