Author Topic: Troubleshooting a constant current sink  (Read 2342 times)

0 Members and 1 Guest are viewing this topic.

Offline OM222OTopic starter

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Troubleshooting a constant current sink
« on: February 27, 2019, 10:07:01 pm »
Hello
A 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/#msg2201538

I 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 mosfets  :o also 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 it  :-// once 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/xSEYPP5Xsi0

How 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
« Last Edit: February 28, 2019, 01:02:49 am by OM222O »
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7453
  • Country: pl
Re: Troubleshooting a constant current sink
« Reply #1 on: February 27, 2019, 11:12:31 pm »
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?).
 

Offline OM222OTopic starter

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Troubleshooting a constant current sink
« Reply #2 on: February 27, 2019, 11:44:39 pm »
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 combination  ??? please 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.
 

Offline OM222OTopic starter

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Troubleshooting a constant current sink
« Reply #3 on: February 28, 2019, 01:06:41 am »
Update:
I removed the op amp first, still had 5V on the Shunt+ and Force-  |O the only other connection was to the ADC input:


After removing the resistor to the ADC input it's just fine now  :o I 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.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7453
  • Country: pl
Re: Troubleshooting a constant current sink
« Reply #4 on: February 28, 2019, 07:35:45 am »
Would it even be necessary if I find out what's wrong with the shunt+ and why it's getting current through it?
Exactly.

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.
« Last Edit: February 28, 2019, 08:06:38 am by magic »
 

Offline dfault

  • Newbie
  • Posts: 2
Re: Troubleshooting a constant current sink
« Reply #5 on: February 28, 2019, 07:40:19 am »
Google passthrough caps. You are using one cap as two separate caps across your ADC inputs. The colored cap terminals are connected.
 

Offline OM222OTopic starter

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Troubleshooting a constant current sink
« Reply #6 on: February 28, 2019, 10:12:03 am »
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.

The 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.

Google passthrough caps. You are using one cap as two separate caps across your ADC inputs. The colored cap terminals are connected.
I'm not quite sure what you mean ... these are X2Y caps, intended for differential input filtering which is exactly what I'm using them for  :D
You can go to their website and under EMI filtering you will find this:
https://www.johansondielectrics.com/x2y-filter-decoupling-capacitors
« Last Edit: February 28, 2019, 10:24:31 am by OM222O »
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Troubleshooting a constant current sink
« Reply #7 on: February 28, 2019, 03:08:18 pm »
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, or
the DVM will probably be outputting a higher voltage while measuring the higher resistance, if you still see the effect try on the 2M range.
.  That took much longer than I thought it would.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7453
  • Country: pl
Re: Troubleshooting a constant current sink
« Reply #8 on: February 28, 2019, 04:45:28 pm »
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.
 

Offline OM222OTopic starter

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Troubleshooting a constant current sink
« Reply #9 on: February 28, 2019, 09:36:30 pm »
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 pot  :palm:
Basically 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/ru0d5

The 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 either  :-//

https://streamable.com/ipzsb

please 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
« Last Edit: February 28, 2019, 09:38:56 pm by OM222O »
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Troubleshooting a constant current sink
« Reply #10 on: March 01, 2019, 12:00:03 am »
"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.
.  That took much longer than I thought it would.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7453
  • Country: pl
Re: Troubleshooting a constant current sink
« Reply #11 on: March 01, 2019, 08:46:25 am »
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.
 

Offline OM222OTopic starter

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Troubleshooting a constant current sink
« Reply #12 on: March 02, 2019, 10:34:13 pm »
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 well :D need 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf