# Led driver op amp with stability problems

Discussion in 'Analog & Mixed-Signal Design' started by bareil76, Aug 4, 2016.

1. ### bareil76 Thread Starter New Member

Aug 4, 2016
4
0
Hi All,

I have a problem with an unstable design that I have tried. See the attacehd file for the schematic. The part number of the op-amp is ADA4691.

Now, I want to have stable current going through the R17 resistor. The current value is adjusted using C3 input of the op-amp between 0 and 3.3V which gives between 0mA and ~160mA.

Now, the problem is that this circuit is unstable.

In my understanding, it is unstable because the Vsense amplifier is 45times slower than the op-amp driving the NPN transistor. Am I correct?

The other question, is what would be the best way to make such a circuit stable?

File size:
15 KB
Views:
46
2. ### crutschow Expert

Mar 14, 2008
19,830
5,547
The instability is not because of the op amp speed, it's because you can't have two op amps in series in the same feedback loop without additional compensation.

But the gain of the circuit shown is wildly higher than the value of 160mA /3V or 53.3mA/V you state.
How did you get that gain value?
The gain of U9-B is (1 + 27k/604) = 45.7.
Thus the circuit current gain is 45.7/0.5 = 91.4A/V.
You thus don't need U9-B.

Without U9-B (connecting Vsense directly ot B3), the feedback loop adjusts the current through R17 so that its voltage drop equals the input voltage.
This gives a gain of 1V/0.5Ω = 2A/V or 2000mA/V, still higher than your stated value.

If you want a 53.3mA/V gain than add a resistive attenuator with an attenuation of 53.3 / 2000 = .02625 at the C3 input.

3. ### OBW0549 Distinguished Member

Mar 2, 2015
2,538
2,136
Sort of. The problem is that with a feedback loop containing several opamps in tandem, you have an enormous amount of loop gain that doesn't drop below unity until well past the frequency at which the feedback becomes positive instead of negative.

You will have to either speed up your current sense amplifier until it is a lot faster than the control opamp (such as by using an extremely fast amplifier in place of U9B), or slow down the control amplifier (U9A) using capacitive feedback so that it is a lot slower than the current sense amplifier. Application notes AN47- High Speed Amplifier Techniques, AN21- Composite Amplifiers, and AN18 - Power Gain Stages for Monolithic Amplifiers at Linear Tech have some good material for dealing with this type of problem.

I think the correct answer is 1 / (0.5Ω * 45.7) = 0.0438 A/V. (The gain of the U9B stage increases the effective resistance of the current sense resistor by a factor of 45.7).

bareil76 likes this.
4. ### crutschow Expert

Mar 14, 2008
19,830
5,547
You are correct of course.
I was standing on my head when I did the calculation.
The amp increases the apparent value of the sense resistor which reduces the current gain of the circuit.

But I think just getting rid of the second amp and adding an attenuator to the input for the gain you want, as I noted, is the simplest way to make the circuit stable.
The second amp adds nothing to the circuit accuracy or performance.
For example, any offset effects are just transferred from the first op amp to the second with no net improvement.

OBW0549 likes this.
5. ### bareil76 Thread Starter New Member

Aug 4, 2016
4
0

As crutschow says the easiest way is to remove U9B. However, I will get very low values on the input of U9A and I cannot have that because of other part of the circuit.

Now, I think the easiest way for now would be to slow down U9A. I will read your document... thanks.

6. ### crutschow Expert

Mar 14, 2008
19,830
5,547
Not if you add an attenuator to the input of U9A as I suggested.
For example 365kΩ in series with C3 and 10kΩ from C3 to ground will give an attenuation of .0266, for an overall circuit gain of 53.2mA/V.
If you need a higher input impedance than 375kΩ you can use the second op amp as an non-inverting buffer to the attenuator input.

OBW0549 likes this.
7. ### bareil76 Thread Starter New Member

Aug 4, 2016
4
0
@crutschow it is what I am going to do for the next version of the PCB, however, right now, I cannot implement this solution.

What king of capacitive feedback would you suggest to slow down U9A?

8. ### crutschow Expert

Mar 14, 2008
19,830
5,547
What op amp and transistor are you using?
You might try a large capacitor (say 10μF, + side to A1) across R18 and see if that helps.

Last edited: Aug 4, 2016
9. ### OBW0549 Distinguished Member

Mar 2, 2015
2,538
2,136
Break the line between J30 and B3 and insert a 10 kΩ resistor. Then connect a 0.01 μF capacitor from A3 to B3. This will insert a loop gain rolloff starting at about 1.6 kHz, which should (I think) be enough to calm things down. If it isn't, try a larger capacitor.

10. ### bareil76 Thread Starter New Member

Aug 4, 2016
4
0
@OBW0549 ... your solution work. Thanks very much!

11. ### OBW0549 Distinguished Member

Mar 2, 2015
2,538
2,136
Excellent! You're welcome!

12. ### hp1729 Well-Known Member

Nov 23, 2015
2,306
283
Could using an op amp as a voltage comparator cause instability?
Maybe put a little hysteresis in the voltage comparator?

13. ### ramancini8 Active Member

Jul 18, 2012
473
145
hp1729 the answer is NO! Using an op amp as a comparator may cause multiple switching or poor response time, but I have never seen it cause oscillations.

Nov 23, 2015
2,306
283
Thanks.