Op-amp Constant Current Source - Page 1
Forum section: electronics / projects

author: David
author_rank: Frequent Contributor
timestamp: March 15, 2013, 12:43:36 pm
content: Hi Guys (and girls),Can anyone see anything inherently wrong with the attached circuit?The idea is simple, an op-amp based current source that is controlled via a reference voltage (which will be PWM through RC) so that the voltage across the sense resistor is kept low but allowing a usable PWM voltage range (0-2V = 0-20mA) with a high resolution. Does this sort of design require any loop compensation?I might change the FET for an NPN transistor (depending on cost). The op-amps will probably be something like LMV324's so that I've got rail-to-rail Inputs/outputs.Cheers,Dave

author: Rerouter
author_rank: Super Contributor
timestamp: March 15, 2013, 12:48:58 pm
content: a moderate one that people encounter when they first play with mosfets, add a buffer resistor e.g. 100 ohms between the op amp output and the mosfet gate, this helps the op amp as its not fond of driving purely capacitive loads, and to better stabalise it, add something like a 1n capacitor between the output and inverting input of the regulating op amp, this will slow it down and help make it more stable,

author: David
author_rank: Frequent Contributor
timestamp: March 15, 2013, 12:55:09 pm
content: Good spot with the resistor, thank you!

author: David
author_rank: Frequent Contributor
timestamp: March 15, 2013, 01:00:10 pm
content: Hmm...If I tick the "Skip initial loading point" in LTSPICE then the circuit looks like it doesn't operate at all and produces a big oscillating mess!...

author: amspire
author_rank: Super Contributor
timestamp: March 15, 2013, 01:18:30 pm
content: I would replace the mosfet with a high gain transistor. It is easier to drive for an opamp running at low voltages - and a 20mA transistor is much cheaper then a100A mosfet. Also if you can put a voltage divider on the 1V to reduce the voltage down, you can get rid of the x20 opamp with little loss. Something like BC549C or 2N3904A. The costs are about 20c for one or 3c in quantity.You will probably need some frequency compensation - probably in the form of a capacitor from the regulator IC output to inverting input, and a resistor added from the inverting input to the sense resistor. I probably would see if I could use a cheaper opamp instead of the LT1006 - particularly if you get one that can operate lower then the LT1006's 2.7V minimum.

author: David
author_rank: Frequent Contributor
timestamp: March 15, 2013, 02:10:21 pm
content: Quote from: amspire on March 15, 2013, 01:18:30 pmThank you for your feedback. I should of mentioned that the components used were for simulation purposes only.I had thought about removing the second op-amp..might look into it again.

author: muvideo
author_rank: Frequent Contributor
timestamp: March 15, 2013, 02:39:12 pm
content: Hello, I would do like amspire said: divide down your reference, you will have only oneopamp to take care of. Also beware that LMV324 is not a Rail to Rail input opamp, it'sinput common mode range is up to about (V+)-1V, but if you divide down you referencethe inputs will stay in range. Also the opamp input offset could be as high as 9mV overtemperature range (probably way lower in the real circuit, but not guaranteed), at 100mOhmthis translates in an offset error of +-90mA maximum. Probably better search for a lowoffset input opamp.Fabio.

author: David
author_rank: Frequent Contributor
timestamp: March 17, 2013, 08:52:14 pm
content: Thank you for the feedback guys.As this circuit is designed to drive a single LED and LEDs are better dimmed with PWM than current, could I use a fixed voltage reference (for the opamp) and then use a P-channel FET to PWM the supply rail for the circuit? (at say ~100Hz). Would this cause me more problems with the setup time of the opamps as well as the overshoot/settling time for the control loop?Dave

author: muvideo
author_rank: Frequent Contributor
timestamp: March 17, 2013, 09:55:45 pm
content: You could PWM the reference input, using for example a 2N7002 to short the inputreference (non inverting input of the opamp) to groud.100Hz is 10ms cycle, if you want to have linear response from1% PWM you are aiming to less than 100uS transistion time, that should be possible,but better use a NPN transistor as power switch for the led. You will avoid the capacitiveloading problem of the mosfet gate. Check the voltage on the shunt with an oscilloscopeand add compensation capacitor high enough to cut overshoots, but low enough to havefast transients. All this if the PWM and reference inputs you are talking about are twodifferent things. If you have only one input that is a 100Hz PWM, just use it to drivedirectly the power switch.Just for curiosity, what is the goal of this design?Fabio.

author: David
author_rank: Frequent Contributor
timestamp: March 18, 2013, 08:46:02 am
content: Hi Fabio,The idea is for a very low power linear constant current source to drive an LED (well actually 4 LEDs but each with an individual CC channel) from a 3V rail with a dimming capability.Dave

author: David
author_rank: Frequent Contributor
timestamp: March 18, 2013, 08:50:30 am
content: Quote from: amspire on March 15, 2013, 01:18:30 pmIs this for a feed-forward element?

author: muvideo
author_rank: Frequent Contributor
timestamp: March 18, 2013, 11:02:49 am
content: Quote from: David on March 18, 2013, 08:46:02 amWow, I missed the 3V input of the circuitIf I understand correctly, you have very small headroom between the forwardvoltage of the led and power supply, this is why you want to use an opampcurrent source. Very small headroom, lowest white leds I've used (rebels ES)are around 2.7V at 100mA and raising with higher currents.Fabio.

author: Rerouter
author_rank: Super Contributor
timestamp: March 18, 2013, 11:17:23 am
content: if its only for a 3V supply, then you really need to chop away at that sense resistor, 5V * 100mA = 0.5V, there goes your 2.7V turn on, though in truth, even a npn transistor will struggle a bit, you can possibly get as low at 50-100mV across the C-E junction with off the shelf transistors, leaving only another 100mV for the sense, so a 1 ohm or less resistor is ideal,

author: David
author_rank: Frequent Contributor
timestamp: March 18, 2013, 12:49:57 pm
content: The LEDs will only be driven at a maximum of 20mA (100mV drop across sense resistor @ 20mA). They also have a nominal VF of ~2.6V at this current.