Troubleshooting a constant current sink - Page 1
Forum section: electronics / projects

author: OM222O
author_rank: Frequent Contributor
timestamp: February 27, 2019, 10:07:01 pm
content: HelloA while ago I made a post asking for feedback on a milliohm meter which can be found here:https://www.eevblog.com/forum/projects/feedback-on-milliohm-meter-v2-0/msg2201538/#msg2201538I post the schematics and the PCB design again so you don't need to read that thread:I've been having a lot of weird issues (wrong voltage outputs and oscillations) with this design which I initially blamed on the op amp in the first version of the design as switching to a different op amp (MCP6002) seemed to solve the issue (or at least make them a lot smaller of an issue). I also redesigned the shunt network switching so the Rds(on) will not affect the measurement accuracy. Here I am again, after building the circuit and I have the exact same issues! As soon as I turn on the device (none of the mosfets turned on) the "Force-" net jumps to about 4 volts which seems odd as it's not really connected to anything except the drain of mosfetsalso the non inverting pin of the op amp is at some high voltage. I even inserted a shorting link between force+ and force-, as well as switching on D10 (highest resistance of the network in case there are some shorts which I have not yet found) and still got the same results!Voltage on Force-:Voltage on Shunt+:I'm really starting to think this issue is caused by using a Darlington pair instead of an N channel fet as very similar constant current sink circuits which I've built in the past have not had these weird issues. They didn't use a switched resistor network, but that should not be causing this much issue, especially with those voltage levels!I also probed the resistance values across the resistors in the network and got correct values except for the highest values: R1: 1, R4+R5: 9, R6+R7:90, R8+R9:900, R10+R11:9k but R12+R13 is a different value every time I measure itonce I got 45k,once it was 10, now it's 15k!Still not sure if there's something inherently wrong with my circuit that causes these issues, or it's a problem with the op amp and or the darlington pair. I bought replacement parts for both of them which hopefully arrive tomorrow, so I can swap them out to see if the results change.I got the switching shunts idea from daves video which can be found here:https://youtu.be/xSEYPP5Xsi0How would you recommend I go about troubleshooting this?Why am I getting voltages on the Force- net?Why is the Shunt+ at such high voltages?Also why the heck is the resistance across R12+R13 not 90k and also varies so much depending on when you measure it?Edit: I tested the circuit before ordering the parts and designing the PCB using this online simulator and it doesn't show any of the weird side effects, feel free to have a look (you can move the +5V between the mosfets to change the current output and it seems to work perfectly fine):http://tinyurl.com/yyooo9d2

author: magic
author_rank: Super Contributor
timestamp: February 27, 2019, 11:12:31 pm
content: Force- gets voltage through mosfet body diodes from shunt+.What dumps current on shunt+ is a mystery, nothing should. Probably something is damaged, wrong part, rotated 180° or your board doesn't match the schematic. Remove parts until you get 0V there.R12 measurement is nonsense because there are other paths from shunt+ to ground in parallel with it, through protection diodes in ICs.Darlington surely has nothing to do with any of that because it isn't connected to shunt+. As for oscillations, a resistor from the opamp to darlington base may help. Since speed isn't important, just use the largest value that will still pass enough base current to produce whatever emitter current you want (1A?).

author: OM222O
author_rank: Frequent Contributor
timestamp: February 27, 2019, 11:44:39 pm
content: Well how can I stop the current that flows through body diodes? a set of 6 schottky diodes (to minimize burden voltage)? or maybe there is a simpler method? Would it even be necessary if I find out what's wrong with the shunt+ and why it's getting current through it?As you can see the schematic and the PCB match perfectly and it also passes DRC:Also I checked the soldered PCB with a blank one for orientation of chips, they're all correct but something might be damaged during soldering/out of the box which is highly unusual although not impossible, I try to remove chips one by one to see what might be causing it.As for R2 measurement: then why does it work for every other pair of resistors and these 2 specifically have some other path? I'm taking the measurment right across the two ends of the parallel combinationplease correct me on that if I'm mistaken.Yes the largest current range is 1A and given beta is minimum of 1000 I guess something just under 1K would work although I have not had a single issue using fets before, I will replace it to see if there are any changes tomorrow.

author: OM222O
author_rank: Frequent Contributor
timestamp: February 28, 2019, 01:06:41 am
content: Update:I removed the op amp first, still had 5V on the Shunt+ and Force-the only other connection was to the ADC input:After removing the resistor to the ADC input it's just fine nowI have used this exact ADC (albeit with a different filter before) and was actually blown away with how decent it was, especially for the price! I think I have to sleep on it for tonight and troubleshoot it later. Thanks a lot for the help! I will try the different component options as I have already purchased them and see which ones will make the most sense for the final product. I'll try to update the thread when I found out the issue with the ADC as well as trying out the new components.

author: magic
author_rank: Super Contributor
timestamp: February 28, 2019, 07:35:45 am
content: Quote from: OM222O on February 27, 2019, 11:44:39 pmExactly.A certain amount of current may normally flow from ADC inputs but it should be nano or microamps at worst. This would produce less than 1V of erroneous voltage on R12/R13. Something is wrong with this ADC.And check the datasheet. If the ADC has significant input current which could produce measurable voltage on R12/R13 before even any current reaches that point from force-, you will need to buffer shunt+ with some low input leakage and low offset opamp or use a different ADC or give up on the 100k range because with only 10k resistors the voltage would be 10x less.

author: dfault
author_rank: Newbie
timestamp: February 28, 2019, 07:40:19 am
content: Google passthrough caps. You are using one cap as two separate caps across your ADC inputs. The colored cap terminals are connected.

author: OM222O
author_rank: Frequent Contributor
timestamp: February 28, 2019, 10:12:03 am
content: Quote from: magic on February 28, 2019, 07:35:45 amThe ADC input is rated for 5nA, so it would be 500uV on the 100k range ... I'm assuming this one is dead/damaged but don't have time to replace it just yet.Quote from: dfault on February 28, 2019, 07:40:19 amI'm not quite sure what you mean ... these are X2Y caps, intended for differential input filtering which is exactly what I'm using them forYou can go to their website and under EMI filtering you will find this:https://www.johansondielectrics.com/x2y-filter-decoupling-capacitors

author: StillTrying
author_rank: Super Contributor
timestamp: February 28, 2019, 03:08:18 pm
content: I'll bet it's a short around RN2, C3, C5 rather than the ADC itself."R12+R13 is a different value every time I measure it once I got 45k,once it was 10, now it's 15k!"In the pic it looks like you're measuring the resistance while it's powered up, orthe DVM will probably be outputting a higher voltage while measuring the higher resistance, if you still see the effect try on the 2M range.

author: magic
author_rank: Super Contributor
timestamp: February 28, 2019, 04:45:28 pm
content: Actually, yes, I have seen a partly shorted MLCC once (behaved like a resistor, don't remember the value).What's the point of this digital pot? It looks like you shouldn't need 1V to be precisely 1V as long as you can measure the exact voltage at shunt+ and use it in calculations.

author: OM222O
author_rank: Frequent Contributor
timestamp: February 28, 2019, 09:36:30 pm
content: Yes, some remaining flux/solder balls from them paste I used were shorting 5V to ADC input.Also I was really considering swapping out the pot and 2 resistors with a simple 1.024V voltage reference but didn't really find anything decent. You're right, I don't need precisely 1 volt but I just stuck to the specs I initially came up with.In the process of troubleshooting I think I've managed to kill the ADC, the MCU and the digital potBasically need to replace everything but before that I managed to record these videos:first one shows the switching of the ranges from 10uA up to 100mA (1A range was fine too but needed to swap the connections on the DMM):https://streamable.com/ru0d5The pot was not set very accurately so all the readings are multiplied by 0.98 (e.g: 98mA instead of 100, or 0.980mA instead of 1)Then I also had a look at the output of the op amp and there are some bizarre oscillations on 2 of the ranges: 10mA and 10uA. not sure why or how to fix them eitherhttps://streamable.com/ipzsbplease let me know if you have a way to stop the oscillations although after probing the shunt+ they don't seem to be anywhere nearly as bad. however I still don't like my op amp to be oscillating like crazy. I will try to replace the chips tomorrow and post another update. thanks

author: StillTrying
author_rank: Super Contributor
timestamp: March 01, 2019, 12:00:03 am
content: "In the process of troubleshooting I think I've managed to kill the ADC, the MCU and the digital pot"That must have been difficult with only 5V on the board, you must be an expert."Then I also had a look at the output of the op amp and there are some bizarre oscillations on 2 of the ranges:"You usually give just not enough info, I've found very low frequency oscillations are often on the supply lines, and much higher frequencies usually through the signal path.

author: magic
author_rank: Super Contributor
timestamp: March 01, 2019, 08:46:25 am
content: Oscillation is normal and expected in circuits involving opamps with gain devices in their feedback loop.The transistor adds both delay and gain, making it easier to hit the "unity gain and 180° delay" condition.A simple way to stabilize such BJT circuit is with a base resistor, which requires the opamp to swing a lot more before an appreciable change happens in BJT output current and therefore in the voltage across the shunt resistor which is fed back to the opa.

author: OM222O
author_rank: Frequent Contributor
timestamp: March 02, 2019, 10:34:13 pm
content: I'm happy to announce that it was only the micro controller (which was salvaged from another failed project, so maybe it had enough heat cycles to die XD ) and that everything works flawlessly now. I just need to finish up the code and create a small attachment which allows this device to act as a voltmeter and ammeter as wellneed to add a few buttons for those functionalities but the major part would be the programming of it. also bought different op amps and fets to see if they stop the oscillations or if I need to add a RC filter on the output of the op amp.