Author Topic: Op-amp Constant Current Source  (Read 10152 times)

0 Members and 1 Guest are viewing this topic.

Offline DavidTopic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: gb
Op-amp Constant Current Source
« on: March 15, 2013, 12:43:36 pm »
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

« Last Edit: March 15, 2013, 12:45:23 pm by David »
David
(United Kingdom)
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: Op-amp Constant Current Source
« Reply #1 on: March 15, 2013, 12:48:58 pm »
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,
 

Offline DavidTopic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: gb
Re: Op-amp Constant Current Source
« Reply #2 on: March 15, 2013, 12:55:09 pm »
Good spot with the resistor, thank you!
David
(United Kingdom)
 

Offline DavidTopic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: gb
Re: Op-amp Constant Current Source
« Reply #3 on: March 15, 2013, 01:00:10 pm »
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!...
David
(United Kingdom)
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: Op-amp Constant Current Source
« Reply #4 on: March 15, 2013, 01:18:30 pm »
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.
 

Offline DavidTopic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: gb
Re: Op-amp Constant Current Source
« Reply #5 on: March 15, 2013, 02:10:21 pm »
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.

Thank 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.
David
(United Kingdom)
 

Offline muvideo

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: it
Re: Op-amp Constant Current Source
« Reply #6 on: March 15, 2013, 02:39:12 pm »
Hello, I would do like amspire said: divide down your reference, you will have only one
opamp to take care of. Also beware that LMV324 is not a Rail to Rail input opamp, it's
input common mode range is up to about (V+)-1V, but if you divide down you reference
the inputs will stay in range. Also the opamp input offset could be as high as 9mV over
temperature range (probably way lower in the real circuit, but not guaranteed), at 100mOhm
this translates in an offset error of +-90mA maximum. Probably better search for a low
offset input opamp.

Fabio.
Fabio Eboli.
 

Offline DavidTopic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: gb
Re: Op-amp Constant Current Source
« Reply #7 on: March 17, 2013, 08:52:14 pm »
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
David
(United Kingdom)
 

Offline muvideo

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: it
Re: Op-amp Constant Current Source
« Reply #8 on: March 17, 2013, 09:55:45 pm »
You could PWM the reference input, using for example a 2N7002 to short the input
reference (non inverting input of the opamp) to groud.
100Hz is 10ms cycle, if you want to have linear response from
1% 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 capacitive
loading problem of the mosfet gate. Check the voltage on the shunt with an oscilloscope
and add compensation capacitor high enough to cut overshoots, but low enough to have
fast transients. All this if the PWM and reference inputs you are talking about are two
different things. If you have only one input that is a 100Hz PWM, just use it to drive
directly the power switch.

Just for curiosity, what is the goal of this design?

Fabio.
« Last Edit: March 17, 2013, 09:59:56 pm by muvideo »
Fabio Eboli.
 

Offline DavidTopic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: gb
Re: Op-amp Constant Current Source
« Reply #9 on: March 18, 2013, 08:46:02 am »
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
David
(United Kingdom)
 

Offline DavidTopic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: gb
Re: Op-amp Constant Current Source
« Reply #10 on: March 18, 2013, 08:50:30 am »
and a resistor added from the inverting input to the sense resistor.

Is this for a feed-forward element?
David
(United Kingdom)
 

Offline muvideo

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: it
Re: Op-amp Constant Current Source
« Reply #11 on: March 18, 2013, 11:02:49 am »
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

Wow, I missed the 3V input of the circuit  ;D
If I understand correctly, you have very small headroom between the forward
voltage of the led and power supply, this is why you want to use an opamp
current source. Very small headroom, lowest white leds I've used  (rebels ES)
are around 2.7V at 100mA and raising with higher currents.

Fabio.
Fabio Eboli.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: Op-amp Constant Current Source
« Reply #12 on: March 18, 2013, 11:17:23 am »
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,
 

Offline DavidTopic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: gb
Re: Op-amp Constant Current Source
« Reply #13 on: March 18, 2013, 12:49:57 pm »
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.
David
(United Kingdom)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf