Extremely weird issue with op amps! - Page 1
Forum section: electronics / projects

author: OM222O
author_rank: Frequent Contributor
timestamp: December 23, 2018, 02:54:26 am
content: HelloI designed a board for a project which was a switchable constant current source and it could select between 1A and 100mA using a divide by 10 voltage divider. after assembling the PCB I found that it wasn't working. I tried everything I could before giving up and mounting the components on DIP adapters in order to isolate the issue to one component on a breadboard. Everything worked fine, except the op amp! I was using a TLV9002. I didn't have all the right components as through hole so hacked together a divide by 10 circuit by putting 3 1k resistors in parallel and 3 1k resistors in series and instead of the intended 1V referance to the op amp, I used a 3.3V (easily available on an MCU) and a 10ohm resistor instead of the intended 1ohm as the breadboard nor the dupont connectors would not be able to maintain 3.3A going through them. Here is the schematic of the breadboard setup:after checking the voltage across the 10ohm shunt, it was 2.68 instead of the expected 0.33V!I searched around and found an MCP6002 which is a direct replacement (pin to pin) for the TLV9002 and after literally just removing the adapter board, I inserted the MCP6002 without moving a single wire on the breadboard and bam! it works just fine! (ignore the fact that it's showing 0.37 ... it's a really cheap multimeter and the ball park is good enough here)I checked the datasheets again and confirmed that I'm not crazy and the pin outs are the same and that TLV9002 is better in every single aspect compared to the MCP6002I've been scratching my head as to why it might not be working properlyI thought maybe it's a weird thing with the base current, but then again the current going through the 10ohm resistor is being monitored and limited to 33mA which is base current + emitter current and emitter current is base current * beta which in a darlington pair should be > 1000 so I have absolutely no clue as to what might be wrong here. Ironically enough the better op amp is the one that's acting weird and I have no idea why

author: duak
author_rank: Super Contributor
timestamp: December 23, 2018, 03:19:44 am
content: Do you have an oscilloscope handy? If not, can you set your DMM to check the output pins and +5V for an AC signal? I will bet it's oscillating for the following reasons:1.) I don't see a +5V bypass capacitor right beside the opamp - I would try a 100n in parallel with 10 uF.2.) these opamps are unity gain stable but when arranged like this with the sense voltage amplified X10 I'll bet it is not.Cheers,

author: David Hess
author_rank: Super Contributor
timestamp: December 23, 2018, 03:49:25 am
content: If it worked than it was an accident. Adding gain and delay like that within the feedback loop is almost always a problem.The added stage of amplification is not doing anything useful. Apply the feedback directly and attenuate the 3.3 volt signal instead.

author: OM222O
author_rank: Frequent Contributor
timestamp: December 23, 2018, 06:47:27 am
content: I had a pack of 10 MCP6002s and every single one of them worked fine without decoupling capacitor. This seems to be specific to the TLV9002 that I have. it might be fried for some reason but I don't think that's the case. I'll replace it tomorrow and share the results.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 23, 2018, 10:08:49 am
content: The OPs used are relatively slow (1 MHz GBW) so chances are it can work without decoupling. Still the TLV9002 might be a little more sensitive to missing decoupling. The breadboard adds quite some capacitance - this might be just enough to keep it stable by chance. The pinout of the OPs is in a way that capacitance between adjacent pins tends to help with stability.

author: Zero999
author_rank: Super Contributor
timestamp: December 23, 2018, 10:11:54 am
content: Quote from: OM222O on December 23, 2018, 06:47:27 amI doubt the lack of a decoupling capacitor is the issue here, although you should add one, as it's good design practise.It's most likely oscillating because of the additional gain and delay in the feedback loop and explains why it worked with one op-amp but failed with a different one. If the TLV9002 is the faster op-amp, then it makes perfect sense, as faster op-amps are more likely to oscilate. Another thing to note is that although it appeared to work with the MCP6002, it still might be oscillating or ringing, but you don't know, because you've not looked at it with an oscilloscope or done any AC or transient tests.

author: OM222O
author_rank: Frequent Contributor
timestamp: December 23, 2018, 12:28:20 pm
content: I can confirm there is no oscillation / ringing on the output. I tested with a cheap digital oscilloscope, but it's flat on all ranges downto 10us/div.I can also confirm there is no ringing on the MCP6002 either(forgot to take a picture).If this can cause issues, how can I get the /10 current switching without using another BJT + shunt? and why does this work with the worse OP amp? they both advertise 1MHz bandwidth so I'm not sure why someboody said TLV9002 is faster?

author: OM222O
author_rank: Frequent Contributor
timestamp: December 23, 2018, 01:05:48 pm
content: I used a 5k resistor and the 10ohm that I had in hand to make a voltage divider and make a 10mV reference and the same x10 resistor from series and parallel 1k resistors to make x10 non inverting amplifier to test it.The TLV9002 was showing 65mV which again seemed really odd. replacing it with the MCP6002 showed 97mV which is close enough to the expected 100. I finally decided to bite the bullet and replace the TLV9002 with another one and tested both channels and it was in 100mV ball park again. I'm guessing there was something seriously wrong with the original TLV9002 out of the box (I've checked my PCB and there aren't any errors that could have killed the op amp. soldering time was kept to a minimum as well so it couldn't have been a heat death).I try to re create the circuit with this new op amp and hopefully this time it works with the TLV. On one hand I'm a T.I fanboy as their products have always been working great in my designs and I've never had something like this happen (defective chip) and on the other hand I'm pretty sure nothing that I've done could have killed the op amp. any ideas as to why this might have happened?

author: David Hess
author_rank: Super Contributor
timestamp: December 23, 2018, 02:18:09 pm
content: Quote from: Zero999 on December 23, 2018, 10:11:54 amThe speed of the operational amplifier does not matter when it is simply a case of including the same operational amplifier within the undercompensated feedback loop of the other.In this specific case, the TLV9002 which oscillated has a phase margin of 78 degrees and the MCP6002 which did not has a phase margin of 90 degrees but I would not rely on this to make a stable circuit. Both have about the same gain margin which is rarely discussed and this is what pushes either operational amplifier into marginal stability in this circuit.Best would be to remove the amplifying stage because it is not doing anything useful but the other option is to add appropriate frequency compensation.

author: OM222O
author_rank: Frequent Contributor
timestamp: December 23, 2018, 02:41:34 pm
content: How can I increase the phase margin? the amplifying stage is what actually controls the switching and it also acts as a buffer so I can't remove it.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 23, 2018, 02:56:07 pm
content: To make that type of circuit stable one could add a resistor from the amplifiers output to current regulator feedback pin and than have a capacitor in direct feedback at the current regulating OP. This way only the low frequency signal goes through the amplifier, the high frequency AC part is directly trough the capacitor. This also avoids the possible delay from the transistor to cause trouble.

author: OM222O
author_rank: Frequent Contributor
timestamp: December 23, 2018, 03:12:44 pm
content: can you please provide an schematic? I'm not sure if the capacitor is directly on the output of the current controlling amplifier or if it's after the resistor?