Post History
Assuming nothing is broken or wired incorrectly, this is most likely the result of the opamp oscillating wildly. The average may still be about what it should be, so you might not notice with only...
Answer
#2: Post edited
- Assuming nothing is broken or wired incorrectly, this is most likely the result of the opamp oscillating wildly. The average may still be about what it should be, so you might not notice with only a meter. Put a scope on G and S of Q1.
- Oscillation should be no surprise, since it's quite possible that the opamp is running with a gain below 1 over some part of the range. The LM358 is only claimed to be stable down to a gain of 1. Small voltage changes on the gate of the FET could actually cause larger voltage changes on the source. This is just asking for instability.
- In general, it's good to lay out a circuit like this with a place for a compensation cap. Put a resistor in series with the negative input, then at least leave pads for a cap between the opamp output and its negative input.
Start with 1 kΩ between R1 and the negative opamp input, then 10 nF between the opamp output and negative input. That's probably overkill, but if you don't need particularly high bandwidth, then maybe it's fine. If you need higher bandwidth, try successively lower capacitors until you can see some oscillation, then at least double it.When looking for oscillation, you have to slowly sweep over the whole current range. Or, slowly adjust R2, then watch for the setting where the gate voltage changes the least. This is where the opamp is being run at the lowest gain. Still, you have to check at least a bit on either side of the set point looking for oscillations to make sure there aren't any.
- Assuming nothing is broken or wired incorrectly, this is most likely the result of the opamp oscillating wildly. The average may still be about what it should be, so you might not notice with only a meter. Put a scope on G and S of Q1.
- Oscillation should be no surprise, since it's quite possible that the opamp is running with a gain below 1 over some part of the range. The LM358 is only claimed to be stable down to a gain of 1. Small voltage changes on the gate of the FET could actually cause larger voltage changes on the source. This is just asking for instability.
- In general, it's good to lay out a circuit like this with a place for a compensation cap. Put a resistor in series with the negative input, then at least leave pads for a cap between the opamp output and its negative input.
- Start with 1 kΩ between R1 and the negative opamp input, then 10 nF between the opamp output and negative input. That's probably overkill, but if you don't need particularly high bandwidth, then maybe it's fine. If you need higher bandwidth, try successively lower capacitors until you can see some oscillation, then back up and at least double the cap.
- When looking for oscillation, you have to slowly sweep over the whole current range. Or, slowly adjust R2, then watch for the setting where the gate voltage changes the least. This is where the opamp is being run at the lowest gain. Still, you have to check at least a bit on either side of the set point looking for oscillations to make sure there aren't any.
- <blockquote> I need R1 to be low</blockquote>
- If that were all there is to it, then you could replace R1 with a short.
- It's a tradeoff, of course. Lower R1 uses up less voltage, increasing the compliance range. It also causes lower power dissipation. On the other hand, lower R1 lowers the accuracy, lowers the quality of the regulation, and makes the output more susceptible to other errors in the system.
- If you're OK with the current sink requiring a bit more than 5 V worst case, then set R1 so that you get the largest current you will ever need when R2 is set to maximum.
- <blockquote>the oscillation at the gate of the MOSFET makes the current constant</blockquote>
- <b>What!!?</b> The opamp shouldn't oscillate at all. As I said above, this may well be why it is dying. I also described how to fix is so that it doesn't oscillate.
#1: Initial revision
Assuming nothing is broken or wired incorrectly, this is most likely the result of the opamp oscillating wildly. The average may still be about what it should be, so you might not notice with only a meter. Put a scope on G and S of Q1. Oscillation should be no surprise, since it's quite possible that the opamp is running with a gain below 1 over some part of the range. The LM358 is only claimed to be stable down to a gain of 1. Small voltage changes on the gate of the FET could actually cause larger voltage changes on the source. This is just asking for instability. In general, it's good to lay out a circuit like this with a place for a compensation cap. Put a resistor in series with the negative input, then at least leave pads for a cap between the opamp output and its negative input. Start with 1 kΩ between R1 and the negative opamp input, then 10 nF between the opamp output and negative input. That's probably overkill, but if you don't need particularly high bandwidth, then maybe it's fine. If you need higher bandwidth, try successively lower capacitors until you can see some oscillation, then at least double it. When looking for oscillation, you have to slowly sweep over the whole current range. Or, slowly adjust R2, then watch for the setting where the gate voltage changes the least. This is where the opamp is being run at the lowest gain. Still, you have to check at least a bit on either side of the set point looking for oscillations to make sure there aren't any.