Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

60%
+1 −0
Q&A Constant Current Load Circuit with Op Amp

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

posted 4y ago by Olin Lathrop‭  ·  edited 4y ago by Olin Lathrop‭

Answer
#2: Post edited by user avatar Olin Lathrop‭ · 2020-08-18T11:50:57Z (about 4 years ago)
  • 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&Omega; 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&Omega; 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 by user avatar Olin Lathrop‭ · 2020-08-17T12:06:30Z (about 4 years ago)
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&Omega; 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.