Author Topic: Will this simple op-amp circuit work?  (Read 10144 times)

0 Members and 1 Guest are viewing this topic.

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Will this simple op-amp circuit work?
« on: January 14, 2016, 02:35:09 pm »
Hi everyone,


I'm trying to set up a string of high power LED's rated at 12V, 25W overall. In order to precisely control the current through the LED's, I thought the simplest option would be an op-amp constant current sink.

The RC circuit is used to reduce oscillation caused largely by the gate capacitance of the MOSFET. I've attempted to add some gain to the circuit so that I can use a lower value resistor at the MOSFET drain however I'm not too sure whether this circuit will accomplish that :-/O Are there any modifications which I can make to do this (the circuit is attached below)?

Thanks
« Last Edit: January 15, 2016, 02:58:51 pm by Thane of Cawdor »
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3233
  • Country: gb
Re: Will this simple op-amp circuit work?
« Reply #1 on: January 14, 2016, 04:27:19 pm »
At 25W/12v you will get roughly 2 amps through your 0.1Ohm sense resistor, giving you 0.2volts.  You are then dividing this down with R3/R4 giving you just 18mV on the inverting input at full load.

Fortunately this is within the input common mode range of the LM358, but you have wired the pot R5 to provide the full 12v range to the non-inverting input.  Even if you had a perfect 'ideal' potentiometer, your control range (i.e. min to max current) would be (0.018/12)*270 = 0.4 degrees of movement - unusable.  In practice all potentiometers have some end resistance, so it's entirely possible you may not be able to reduce the output below 18mV, in which case the load would always be set to maximum current.

To fix this:
1) Don't divide the sense resistor signal down.
2) Add a fixed resistor into the top arm of the potentiometer to reduce the output voltage range to a usable range.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2523
  • Country: us
Re: Will this simple op-amp circuit work?
« Reply #2 on: January 14, 2016, 04:34:34 pm »
Refer to this simple power supply circuit by Peter Oaks as an example:
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #3 on: January 14, 2016, 04:53:38 pm »
Thanks for the responses,


Quote
Don't divide the sense resistor signal down...

Could I just remove the resistive divider and possibly use a differential amplifier (with gain) to measure the voltage across the resistor and then feed this into the negative input?

 
Quote
Refer to this simple power supply circuit...

On a completely different tangent, I know  :-DMM, but what is the purpose of that 1N4148 diode in the current adjust loop? Would that be reverse-biased when IC2B is operating? 
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2523
  • Country: us
Re: Will this simple op-amp circuit work?
« Reply #4 on: January 14, 2016, 05:05:56 pm »
Quote
Refer to this simple power supply circuit...
On a completely different tangent, I know  :-DMM, but what is the purpose of that 1N4148 diode in the current adjust loop? Would that be reverse-biased when IC2B is operating?

The 'voltage' op-amp sets the output level while the 'current' op-amp can only turn the MOSFET off.  Without the diode, the 'current' op-amp could raise the output level. 

Watch Peters description of the entire circuit:
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Will this simple op-amp circuit work?
« Reply #5 on: January 14, 2016, 07:15:27 pm »
The current is regulated by reducing the output voltage until Ohm's Law is satisfied: Current= Voltage/resistance.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3233
  • Country: gb
Re: Will this simple op-amp circuit work?
« Reply #6 on: January 14, 2016, 09:45:56 pm »
Thanks for the responses,


Quote
Don't divide the sense resistor signal down...

Could I just remove the resistive divider and possibly use a differential amplifier (with gain) to measure the voltage across the resistor and then feed this into the negative input?

Just remove R4.  The values of R3 and C1 may need some fiddling to get a good compromise between stability and transient response.
 

Offline Seekonk

  • Super Contributor
  • ***
  • Posts: 1938
  • Country: us
Re: Will this simple op-amp circuit work?
« Reply #7 on: January 14, 2016, 10:47:31 pm »
I hate this analog solution.  If you must, why don't you make the sense resistor higher so at least some of the wasted heat can be dissipated in that.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Will this simple op-amp circuit work?
« Reply #8 on: January 14, 2016, 11:17:26 pm »
Refer to this simple power supply circuit by Peter Oaks as an example:
That circuit is a pefrect example of what not to do. ::)

He used a nice, expensive REF02, a 4-wire current sense resistor and completely messed up the circuit, throwing the qualities of both elements to waste.
The connection between the bottom two terminals of the sense resistor and the capacitors is going to carry a significant amount of current and therefore produce an additional voltage drop, which isn't going to have a nice stable resistance like you would get from a quality resistor, therefore the accuracy of the circuit is out the window.

On top of that, neither opamp is frequency compensated, those things will oscillate.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #9 on: January 15, 2016, 04:19:48 am »
Thanks again,


Quote
why don't you make the sense resistor higher...

I wanted to keep the resistor value as low as possible so that I could use a lower power resistor, additionally, the supply voltage is very close to the LED string rated voltage and so wouldn't a larger value resistor cause a voltage drop which would affect the LED supply voltage too greatly (e.g. 2A through 1R resistor giving a 2V drop)?

Quote
Just remove R4

I have removed that resistor and added a 10k in series with the potentiometer (10-turn) voltage divider section, would the feedback voltage still be too low to effectively change current from(~min-max) since the maximum voltage at the -ve op-amp pin would be around 0.2V?
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3233
  • Country: gb
Re: Will this simple op-amp circuit work?
« Reply #10 on: January 15, 2016, 02:22:41 pm »
I hate this analog solution.  If you must, why don't you make the sense resistor higher so at least some of the wasted heat can be dissipated in that.

Because then he won't be able to deliver full power to the load.

I have removed that resistor and added a 10k in series with the potentiometer (10-turn) voltage divider section, would the feedback voltage still be too low to effectively change current from(~min-max) since the maximum voltage at the -ve op-amp pin would be around 0.2V?

10k isn't really enough, you've reduced the potentiometer range from 0-12v to 0-6v, but you can still only use 0.2v of that range.  Better would be to derive your setpoint voltage from a reference instead of the supply.  At the moment, if the supply voltage dips as the LEDs start to draw current,  then your set point dips as well.  That reduces the current, and the 12v rail may then rise....you can see how this could potentially cause an oscillation.  Using a voltage reference for your set-point voltage means the load current will become independent of the supply voltage.

A cheap (but nasty) way to improve things a bit would be to connect a diode (e.g. 1N4148) across the potentiometer (with the 10k series resistor).  This means the reference is approximately 0.6v, but it will change a little with temperature and supply voltage changes will still have a small effect, though far less than before.

A proper voltage reference would give more stable performance e.g.a TL431 costs a few pennies and will give a stable 2.5v reference.  You'd want an extra resistor to divide the 2.5v down your required range though and a TL431 requires at least 1mA to regulate properly.  e.g. like this:



« Last Edit: January 15, 2016, 03:00:20 pm by mikerj »
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #11 on: January 15, 2016, 03:28:39 pm »
Thanks again for the responses,

I've edited the original schematic on the initial post :-/O


1. I just built up the circuit and works generally fine, however; the current that is set by the voltage on the non-inverting pin does not match that through a load resistor (by a scale factor of 10 due to 0.1 ohms as opposed to 1-ohm voltage drop for 1A).Although, the two are directly proportional in that as the voltage on the non-inverting pin decreases so does the current through the load (somewhat linearly) which is really the only thing I require for this application. Would this be an effect of the op-amp itself?

Quote
The values of R3 and C1 may need some fiddling to get a good compromise between stability and transient response

2. Also, I couldn't get the system to oscillate with or without R3 and C1. What would be the simplest method of doing this to test the stability/transient response of the RC network to ensure that the system remains stable over time? 

Quote
neither opamp is frequency compensated, those things will oscillate

3. Finally, I've attached a circuit which is the same as the initial one except for an added diff. amp with a gain of 10 (making use of both op-amps in the 358 package at least :-DMM ). Is this a possible solution to increasing the potentiometer degrees of motion or is it full of opportunities for loop instability/oscillation not to mention, over-complication?
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3233
  • Country: gb
Re: Will this simple op-amp circuit work?
« Reply #12 on: January 15, 2016, 06:13:57 pm »

1. I just built up the circuit and works generally fine, however; the current that is set by the voltage on the non-inverting pin does not match that through a load resistor (by a scale factor of 10 due to 0.1 ohms as opposed to 1-ohm voltage drop for 1A).Although, the two are directly proportional in that as the voltage on the non-inverting pin decreases so does the current through the load (somewhat linearly) which is really the only thing I require for this application. Would this be an effect of the op-amp itself?

If I understand what you are saying then it's purely the effect of your sense resistor value.  A 0.1ohm resistor gives a transfer function of 10 amps/volt.  Since you are controlling this with a potentiometer, this makes no difference provided you scale the potentiometer voltage accordingly.

Quote
The values of R3 and C1 may need some fiddling to get a good compromise between stability and transient response

2. Also, I couldn't get the system to oscillate with or without R3 and C1. What would be the simplest method of doing this to test the stability/transient response of the RC network to ensure that the system remains stable over time? 

If it's stable now it's likely to remain that way unless you change something.  Inductance in the load path is a good way to make current sources unstable, i.e. long wires that aren't twisted.  Test over temperature and expected supply voltage range.


3. Finally, I've attached a circuit which is the same as the initial one except for an added diff. amp with a gain of 10 (making use of both op-amps in the 358 package at least :-DMM ). Is this a possible solution to increasing the potentiometer degrees of motion or is it full of opportunities for loop instability/oscillation not to mention, over-complication?

Adding another amp into the feedback path is a good way to reduce stability, so C1/R3 will almost certainly be required to get that to work nicely.
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #13 on: January 16, 2016, 07:12:00 am »
Thanks,

Quote
adding another amp into the feedback path is a good way to reduce stability, so C1/R3 will almost certainly be required to get that to work nicely

Firstly, is a differential amplifier even necessary in this application (since the non-inverting input will always be at ground potential) and can I just use a simple non-inverting op-amp with a gain of 10?

Secondly, would I need to add another RC network to ensure the long-term stability of the other op-amp or only adjust the C1/R3 values since they are both in the feedback loop?
« Last Edit: February 04, 2016, 04:37:53 am by Thane of Cawdor »
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Will this simple op-amp circuit work?
« Reply #14 on: January 16, 2016, 05:30:26 pm »
The circuit like you have it now should work.  I've attached some simulation results. 

Note that the error between the input and the output is due to the fact that the LM358 simulation model has a 2mV input offset voltage.  This gets magnified to 20mV by the 10x gain.  This likely won't be a problem for your application.

The only change that I made to your circuit is that I made the compensation cap as small as possible while keeping the circuit stable with a decent phase margin.  If I did everything right--and the simulator's models can be trusted--you can expect about 83 KHz bandwidth.  Real life and the simulation may not agree entirely, of course.
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #15 on: January 16, 2016, 06:27:52 pm »
Thanks for that!

Quote
The circuit like you have it now should work.  I've attached some simulation results...

I understand the results from the first transient simulation but have a few questions for the  AC model (second image)  :-/O :

1. Why is L1 added? Is this to simulate inductance in the feedback path causing stability issues?

2. What is the reason for placing the biased voltage source (Vin) in series with the coupling capacitor in that configuration as opposed to the same as the first transient simulation?

3. Additionally, what is the practical effect of the bandwidth limitation and what is it limited by? Will this just effect the feedback loop rate of change (of LED current with respect to time) and is it just the combination of the non-ideal operational amplifier and the capacitor + parasitics?
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Will this simple op-amp circuit work?
« Reply #16 on: January 16, 2016, 07:14:56 pm »
There's a ZIP file with some PDFs by Tim Green on this web page that explains what I was trying to do in the AC model.  I'm no analog expert so I may not have done it right.

The giant inductor is to basically break the loop (for any AC signals) but allow the circuit's DC operating point to be determined.

The separate signal source in the AC model is to determine loop gain.  Putting the signal source on the non-inverting input of the left-hand op amp wouldn't be the same.  Those PDFs describe the method a lot better than I can.

The bandwidth is basically going to determine how fast the circuit reacts to changes in the control voltage as well as any disturbance in the loop.  So far as what determines the bandwidth, I'll leave that to the experts.  Those documents will discuss it.  It basically comes down to "poles" in the form of low-pass (RC, for example) filters.  These may be an intentional part of the circuit (the dominate pole of the LM358) or not (parasitics.)
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #17 on: January 17, 2016, 05:11:01 am »
Ah ok!  :-DMM

In terms of testing the circuit for its stability in the real world scenario, could I feed a fast rising/falling square wave (high dV/dt) into the +ve input terminal of the op-amp or would some sort of step voltage be better at inducing ringing/oscillations?  :-/O


Thanks again
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Will this simple op-amp circuit work?
« Reply #18 on: January 17, 2016, 05:32:46 am »
Yes, putting a fast-edged signal through the non-inverting terminal and watching the response will be a good way to determine stability.  The high-frequency content of the fast edge can uncover many frequency response problems.
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #19 on: January 17, 2016, 06:46:48 am »
Hi again,

Quote
Yes, putting a fast-edged signal through the non-inverting terminal and watching the response will be a good way to determine stability

Great! I'll set up a quick test to do this  :-DMM

 In terms of the maximum power dissipation of the MOSFET, would this just be determined by RDS(on) multiplied by the maximum LED current squared (I2R)?


Thanks
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21606
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Will this simple op-amp circuit work?
« Reply #20 on: January 17, 2016, 07:41:40 am »
No, the MOSFET won't be operating on the Rds(on) curve.  You have to measure Vds * Id.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #21 on: January 17, 2016, 07:54:51 am »
Quote
You have to measure Vds * Id

Ok, can I approximate this using the curves on the Id vs. VDS graph from the IRF540 datasheet or would I need to measure the actual VDS in-circuit?

Also, why wouldn't it be operating on the RDS(on) curve? Is it just due to the circuit topology?

Thanks  :-+
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21606
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Will this simple op-amp circuit work?
« Reply #22 on: January 17, 2016, 08:02:25 am »
If it were on the Rds(on) curve, it wouldn't be controlling, gate voltage would be maxed out! ;)

...Which will happen if Vds is allowed to drop to that level, after all.  The op-amp tries as hard as it can, saturating its output (Vgs will be around 10-11V, for an LM358 supplied with 12V), but is unable to cause more current to flow.

Applying Kirchoff's Loop Rule, we have +12V at the top of the LEDs, V(LEDs) from there to the drain, Vds to the shunt resistor, and a little bit of voltage back to ground (I'm going to ignore the shunt voltage drop, because it's pretty small).  If the LED is a three-in-series type array, then it should be expected to have 3-3.6V drop per die, or 9 to 10.8V drop total.  The remaining 3 to 1.2V is dropped across the transistor, as controlled by the op-amp feedback.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #23 on: January 17, 2016, 09:02:54 am »
Thanks!

I don't have the LED's with me at the moment but they are specified to run at 12V (~5W COB strip LED similar to thishttp://www.aliexpress.com/item/dollarkey-4-8W-COB-LED-SMD-Strip-Light-Bulb-Lamp-Bead-Chip-2900-3200K-Warm-White/1885092145.html?spm=2114.40010308.4.12.lJt0Hv) and I wanted to run 5 in parallel, giving the approximate 25W figure.

 I'm assuming that in order to run the LED's at their specified 12V rating I would need a higher supply voltage due to the somewhat variable voltage drop across the MOSFET and the negligible 0.1-Ohm resistor. So if I had a 13V supply, I would have approximately 1V across VDS which would lead to a power dissipation of about 2W, is this correct?  :-/O

 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21606
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Will this simple op-amp circuit work?
« Reply #24 on: January 17, 2016, 05:10:18 pm »
Hmm, "6-7V", those are only two dies in series.  So you'll be dropping about 5V across the transistor.  Better grab a heatsink!

Note that you need a resistor in series with each one, to make a safe parallel array.  Not much is necessary, maybe >= 0.47 ohm (with a maximum value of (5V)/(1A) = 5 ohms.  Which is a good idea: might as well offload some of that wasted power from the transistor.)  They'll still be mismatched at low currents... don't expect any miracles when it's dimmed down.

Also, 5W each at 6-7V is a hair under 1A each, so you need 5A total (and the current sink needs to have an adjustable range up to 5A), and you need a 12V * 5A = 60W power supply.

Tim
« Last Edit: January 17, 2016, 05:13:58 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Thane of CawdorTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Will this simple op-amp circuit work?
« Reply #25 on: January 18, 2016, 06:12:46 am »
Thanks for the response!

Quote
"6-7V", those are only two dies in series...

Isn't the LED a 12V version as stated in the description or is that the actual voltage per LED in the COB die?  :-/O

 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21606
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Will this simple op-amp circuit work?
« Reply #26 on: January 18, 2016, 09:58:03 am »
Well, who fuckin' knows, because there's no PDF for it, really...

At the description it says
Quote
LED Bulbs
Beam Angle(°): 60°
Color: White
Certification: CCC
Length: 0.71m
Voltage: 12V
Number of LED Chip: 1 pcs
Shape: Other
Base Type: Other

1 chip (die) is obviously false for anything other than 3-4V, so we know one of these is wrong.

The other description below this says...

Quote
Features:
 
Brand new and high quality.
 
High power super bright LED light
 
Type: COB LED
 
Power: 4.8W
 
Voltage: 6~7V
 
Current: 500mA
 
Luminous Flux: about 320~340LM
 
Color Temperature: 2900-3200K
 
Emitting Color: Warm white
 
Long service life LED
 
Great for making light sources for video camera, fish tank, decoration light
 
COB LED is less thermal resistance:
 
Among different LED components such as high power LED, SMD, dip etc, COB LED is best in less thermal resistance and cooling.
 
Size: 5cm x 0.7cm - 1.97inch x 0.28inch
Package Included:
 
1 x 4.8W COB LED Light Warm White

Which is all kinds of more inconsistent.  6-7V at 500mA is 3-3.5W, not 4.8W.

So, take your pick.

There's no sign of onboard resistors, so they aren't going to take 12V-as-in-constant-voltage-power-supply.

Probably you can run them at 700mA (which would give around 4.8W), and whatever voltage they actually operate at, burn them out quickly, and buy more replacements when needed.

If you actually want good quality spectrum / CRI, reliable data and long lifetime, buy some legitimate brand name Cree or etc. parts.  They'll be expensive, and you'll never have to replace them (assuming your thermal design is sufficient).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf