Author Topic: Low voltage, low current sense design advice  (Read 1711 times)

0 Members and 1 Guest are viewing this topic.

Offline STMartinTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Low voltage, low current sense design advice
« on: December 16, 2021, 02:38:40 am »
I have a work project to design a circuit that discharges batteries. During this process, I need to measure the current.

My first thought was to use a current shunt and current sense amplifier. The resulting output will be fed into a DAQ. However after adding up all the error sources, I'm struggling to get anything better than 3%-ish.

Design constraints
  • Common-mode voltage: 1 - 10V
  • Current: 300 uA - 200 mA
  • Output: <=10 V
  • Current shunt: 5Ω or less
  • Desired accuracy: 1% or better
  • I'd like to be able to measure any current at any voltage
  • High-side / low-side doesn't matter. The rest of the circuit is just resistance for discharging
  • 25 C° pretty well guaranteed

Work so far
  • Learned how to calculate the error budget using these videos from TI: https://training.ti.com/ti-precision-labs-current-sense-amplifiers-current-sensing-different-types-amplifiers
  • And used the formulas from this spreadsheet: https://www.ti.com/lit/zip/sbor020 to make my own Excel calculator
  • Calculated the error for a bunch of current sense amplifiers from TI, Maxim, Analog Devices/Linear Technology, Renesas, given the above constraints
  • Too high a gain, and the output exceeds 10V on higher currents. Too low, and voltage offset becomes an issue
  • CMRR contributes significantly on the lower voltages as well
  • Had a look at instrumentation amplifiers, but haven't really chewed through the specs yet
  • Checked out the schematic for the uCurrent. It seems Dave just uses a (pretty schmick) op-amp? Maybe I should re-watch those design videos.

Am I going about this the wrong way?
Should I look to dial in a really good op-amp with some trim pots instead?
Instrumentation amps maybe? Amps with programmable gain?

I feel like I'm missing an obvious solution.
 

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1327
  • Country: ca
Re: Low voltage, low current sense design advice
« Reply #1 on: December 16, 2021, 05:33:46 am »
Why not use a calibrated benchtop multimeter with GPIB/USB interface instead of trying to build one?
 

Offline STMartinTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: Low voltage, low current sense design advice
« Reply #2 on: December 16, 2021, 06:37:04 am »
We'll be doing 24 batteries at a time, over a four month period.

Eventually, we'll probably be doing hundreds.

It was my first suggestion too, but the equipment expense is prohibitive.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4957
  • Country: si
Re: Low voltage, low current sense design advice
« Reply #3 on: December 16, 2021, 07:00:31 am »
You can buy a bench multimeter with a slot for a multiplexer card. A lot of Keithley ones have it. This lets you use a single precise bench DMM to grab readings from 8 to 24 inputs. Larger systems can use dedicated multiplexer mainframes that can hold 5 or more of these cards, giving you literally 100s of inputs to switch between. This is how measuring a large number of nodes is done in a typical manufacturing environment.

If you are in a tight budget or too much in a hurry to gather up cheap used gear off ebay then you can definitely still build your own. For reading shunt resistors you would typically use a purpose built current sense amplifier chip such as TIs INA series. They contain the whole diff amp with lots of gain to grab your tiny shunt voltage and amplify it up to something usable in a ADC all in one chip with next to no external components (especially no precision resistors). You can get a good high resolution measurement ADC chip for about 5 to 10$ and then you can use some cheep analog switches to feed say 10 shunt amplifiers into one ADC, making it one 10 channel current measurement card. Then stack these cards together for as many as you need. If you use SPI to control the ADC and switches you can put it all on one SPI bus and just use chip select lines to select between a large number of cards, easily allowing you to hook up 10 of these cards together for 100 inputs.

On the end of it all you can stick a raspberry pi or something similar run the whole show while easily being able to log all of the data, copy it over a network, remote admin over network etc...
 

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1327
  • Country: ca
Re: Low voltage, low current sense design advice
« Reply #4 on: December 16, 2021, 05:12:17 pm »
If you're going to build your own, then adding a calibration table to your software could help reduce some of the errors.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16620
  • Country: us
  • DavidH
Re: Low voltage, low current sense design advice
« Reply #5 on: December 16, 2021, 09:27:09 pm »
However after adding up all the error sources, I'm struggling to get anything better than 3%-ish.

Common-mode voltage: 1 - 10V

Why is the common mode voltage range so high if you can measure at the low or high side?  It should hardly change for at least one of them.

Quote
Current: 300 uA - 200 mA[/li][/list]
Output: <=10 V

200 milliamps at 10 volts would be 300 microamps at 15 millivolts.  1% accuracy then requires an *output* offset below 150 microvolts which is not particularly demanding, but it will require precision parts.  This will be a good application for chopper stabilized amplifiers but the instrumentation amplifier could be tricky.  The best precision analog amplifiers could do it also but would require offset null trimming to get below 3 microvolts; see below.

Quote
Current shunt: 5Ω or less

Lower resistance increases noise and other errors, but also lowers the error from the current shunt heating up.  Use as large (in watts) a current shunt as feasible to minimize temperature rise.

Quote
Desired accuracy: 1% or better

I would work backwards to find the absolute minimum shunt resistance.  Assuming 3 microvolts of input error to make the math easy (3 into 15 is 5) and because it is not far off from the expected noise, which is greater than the offset of a chopper stabilized amplifier, so a 300 microvolt input (1% error is 3 microvolts) produces 15 millivolts at a gain of 50.  That yields a minimum shunt resistance of 1 ohm.  It cannot be lower because input errors will reduce accuracy below 1%.  Also, it cannot be higher or the output will go above 10 volts.  So the range you want is just barely possible but care will be needed on the error budget and noise.

1 ohm at 200 milliamps is 0.04 watts so power is not a problem, but as I said above, use a larger current shunt resistor than necessary to keep self heating low.

If a 2 watt Caddock SR20 current sense resistor was used, then at 200 milliamps, the temperature rise would be 1.6C (I estimated the thermal resistance from the power derating graph) so with a 100 ppm/C temperature coefficient, the maximum self heating error would be 160 ppm or 0.016%.  Ambient temperature variation will create more error but still well within 1%.

Because of the 1% tolerance of this current shunt resistor, trimming will be necessary for gain.

Quote
High-side / low-side doesn't matter. The rest of the circuit is just resistance for discharging

So you have a load resistor and current shunt in series across the battery?

Quote
Calculated the error for a bunch of current sense amplifiers from TI, Maxim, Analog Devices/Linear Technology, Renesas, given the above constraints

I did not even consider a dedicated current sense amplifier.  Are any good enough?

Quote
Should I look to dial in a really good op-amp with some trim pots instead?
Instrumentation amps maybe? Amps with programmable gain?

I feel like I'm missing an obvious solution.

I do not understand why there is a significant common mode voltage to handle at all if either low or high side sensing can be used.  Aren't the batteries all floating?
 

Offline STMartinTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: Low voltage, low current sense design advice
« Reply #6 on: December 17, 2021, 07:13:37 am »
David,

Really appreciate the reply.

Quote
Why is the common mode voltage range so high if you can measure at the low or high side?
Good point. I went back and watched Dave's video on the uCurrent (more on this below), and noticed he ran it low-side. He didn't really talk about it, but this eliminates CMRR error altogether, and he doesn't have to worry about a subtraction stage in his amp or any of that mess.

Quote
Use as large (in watts) a current shunt as feasible to minimize temperature rise
This is a great idea. I hadn't given much thought to temp co stuff since it'll be sitting in a lab, and the error doesn't add much anyway. Either way, I like it.

Quote
I would work backwards to find the absolute minimum shunt resistance
This is an approach I didn't consider. Let me make sure I got this straight.

Given my range of inputs (300 uA - 200 mA) and my range of desired output (0 - 10V), it necessitates a gain of 50 to make full use of my output range. That gain will ultimately be a multiplicative product of shunt resistance and amplifier gain. We haven't determined those values yet, so put it aside for now. Gain of 50.

Considering my lowest output (300 uA input, gain of 50, means 15 mV output), the sum total output error must be 150 uV or less to meet my 1% accuracy spec. Given the gain of 50, that means my sum total input error must be 3 uV or less. That in turn demands my lowest shunt voltage must be at least 300 uV.

Therefore, if my lowest input is 300 uA, and my minimum output is 300 uV (to stay ahead of the 1% error spec), a 1Ω ­shunt is the minimum resistance. As you said, any lower resistance and the drop across it will be too low to stay ahead of the error. However, I don't understand why it couldn't be higher, say 2Ω, and reduce the amplifier gain to 25. Our overall gain is still 50, and we're still within the 10V output limit.

Quote
So you have a load resistor and current shunt in series across the battery?
Yes. The discharge current is based on the battery capacity. The device needs to support a range of capacities (hence the current requirements), so the actual load resistance will vary from battery to battery.

Quote
I did not even consider a dedicated current sense amplifier.  Are any good enough?
Maybe? After your post, I'm beginning to realize I'm not analyzing this problem properly; although I'm still digesting your advice. Quite possibly they're good enough. So far, though, given a few other wrinkles in the design requirements I haven't brought up here, the error is still too large at lower currents. At least, if TI's error calculation tutorial is to be believed (and if I'm doing it right).

Quote
I do not understand why there is a significant common mode voltage to handle at all if either low or high side sensing can be used.
There isn't. I'm mistaken.



All that said, after watching Dave's uCurrent video again from way back when he was still in his garage, I've found a better approach that sidesteps all the amplifier error issues altogether.

I don't need one.

First, I was mistaken in my current range requirement; it's actually 3 mA to 200 mA. Oops. Second, instead of a single shunt, use multiple and switch them in or out with a FET or something. I have plenty of DIOs on the DAQ. This way I can keep the gain for a given range well above the error floor for the DAQ. I'm thinking this:

1 mA - 10 mA @ 100Ω
10 mA - 100 mA @ 10Ω
100 mA - 1000 mA @ 1Ω

This scales everything to sit nicely within the 1V range on the DAQ. If the resistance on the FET is a significant portion of the 1Ω shunt, I may be able to eliminate that one and just step up to the 5V range on the DAQ if the error isn't too bad. I didn't have time to run the numbers today, but I think the error should be acceptable. There's a few other design requirements that may spoil this, but we'll see.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16620
  • Country: us
  • DavidH
Re: Low voltage, low current sense design advice
« Reply #7 on: December 18, 2021, 02:43:55 am »
Quote
Why is the common mode voltage range so high if you can measure at the low or high side?

Good point. I went back and watched Dave's video on the uCurrent (more on this below), and noticed he ran it low-side. He didn't really talk about it, but this eliminates CMRR error altogether, and he doesn't have to worry about a subtraction stage in his amp or any of that mess.

There is a still a common mode voltage where the connection to the current sense resistor is made, but it is tiny.  If a 4 wire connection is made, then the connection to the shunt resistor can form a single point ground for the rest of the circuit and no subtraction is necessary.  More complex circuit will still need a subtraction to preserve the performance of the current shunt resistor.

Figure 83 here shows this.  The "common" point is the junction of the current shunt and 10 ohm resistor.  If the common point is moved elsewhere, then the non-inverting amplifier needs to be replaced with a difference or instrumentation amplifier but the common mode voltage is tiny.

Quote
Therefore, if my lowest input is 300 uA, and my minimum output is 300 uV (to stay ahead of the 1% error spec), a 1Ω ­shunt is the minimum resistance. As you said, any lower resistance and the drop across it will be too low to stay ahead of the error. However, I don't understand why it couldn't be higher, say 2Ω, and reduce the amplifier gain to 25. Our overall gain is still 50, and we're still within the 10V output limit.

That is right.  I got lost somewhere in my thinking but a larger shunt resistance can be used with lower gain to get the same results but with more self heating error from the shunt and less demanding precision in the rest of the circuit.  A 10 ohm shunt would increase the self heating error to 0.16% for that particular part which gives some idea of what is feasible, although that particular shunt is not made in a resistance that high.

If the shunt resistance is high enough, then a 4-wire current shunt is not required although a 4-wire connection still needs to be made to the 2-wire resistor for accuracy.

Quote
First, I was mistaken in my current range requirement; it's actually 3 mA to 200 mA. Oops. Second, instead of a single shunt, use multiple and switch them in or out with a FET or something. I have plenty of DIOs on the DAQ. This way I can keep the gain for a given range well above the error floor for the DAQ. I'm thinking this:

1 mA - 10 mA @ 100Ω
10 mA - 100 mA @ 10Ω
100 mA - 1000 mA @ 1Ω

This scales everything to sit nicely within the 1V range on the DAQ. If the resistance on the FET is a significant portion of the 1Ω shunt, I may be able to eliminate that one and just step up to the 5V range on the DAQ if the error isn't too bad. I didn't have time to run the numbers today, but I think the error should be acceptable. There's a few other design requirements that may spoil this, but we'll see.

Real precision current shunt measurements with multiple ranges do not place the switch in series with the current shunt resistance where it will affect the measurement.  Instead, the current sense resistors are placed in series and the amplifier input is fixed at one end.  The switches direct the current to be measured into a selected point of the series connected resistors, and the higher value current shunt resistors which are not being used end up in series with the amplifier input where the additional resistance adds no error.

For decade ranges in a multimeter, the resistor series is something like 1, 9, 90, and 900 so the 4 switches select 1 ohm, 10 ohms, 100 ohms, and 1000 ohms, and the amplifier input is fixed at the top of the 900 ohm resistor.  The switch resistance becomes irrelevant to accuracy although it does affect the burden voltage.

Study one of the old Tektronix multimeter schematics like the DM501, DM501A, DM502, or DM502A to see an example of this.
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: Low voltage, low current sense design advice
« Reply #8 on: December 18, 2021, 06:41:04 pm »
To get wide dynamic range and resolution I'd use a precison voltage to frequency converter and count the pulses with a uP. see LTC6990.
You can mux a large number of current sense reistors. The input impedance of the VCF is very high compared to the sense resistors and mux on reistance.
 

Offline STMartinTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: Low voltage, low current sense design advice
« Reply #9 on: December 19, 2021, 09:35:58 am »
Terry,
That is quite an interesting suggestion. I wouldn't have thought of that in a million years. Perhaps if my more traditional approach doesn't work out, I'll have a look. Although, right off the hop, the LTC6990 has a frequency accuracy of ±1.5%, plus whatever the DAQ adds. I haven't run the numbers though, so I don't know if it's significant enough to matter. Either way, something I'll probably prototype up. Work's added a few more battery current measuring projects my way and this seems worth exploring.

David,
Once again I can't thank you enough for the reply. Specifically the ranging.

I had a look at the DM502A schematic's current shunt section, and prototyped a simpler version. It worked well swapping leads around to switch the range. However, in the actual design I'll need the DAQ to do the ranging. So I tried using BJTs as the switches, and got far higher shunt voltages than I should have. I don't fully understand how transistors work, so I suspect I've done something wrong.

I looked around for auto-ranging schematics, and came across this: https://lowpowerlab.com/guide/currentranger/specs-architecture/

Ironically, it appears to be an auto-ranging clone of the uCurrent.

He appears to do what I had thought earlier: shunts in parallel, switched by MOSFETs. I've got some MOSFETs around here somewhere, so I'll have a play with those instead of BJTs and try both shunt topologies.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4957
  • Country: si
Re: Low voltage, low current sense design advice
« Reply #10 on: December 19, 2021, 02:37:52 pm »
Absolute accuracy % is the wrong thing to look for if you are after high levels of precision.

When handling quantities like volts, amps, ohms it is difficult to cheaply mass manufacture components with the precision of  <1%. However absolute precision can be solved using calibration. As long as you have a known accurate instrument (Such as a calibrated bench DMM) you can "transfer" a large potion of that accuracy onto other instruments by tweaking them to match that. This is how most precision instruments are created in factories and you can do it yourself too. As long as you have a way to tune the response (be it trim pots, software math, laser cutting passives, or even just putting a notch in a shunt with wire cutters...) then you can make it respond like something much more accurate. However this only works as long as your "tweaked value" stays constant over the lifetime. So the actual practical limit to accuracy is how stable with time you can make it. The more stable it is with age, temperature, humidity etc... the more closely it will resemble whatever it was 'calibrated' to. So it doesn't matter how accurate your components are, it matters how stable they are.

For the example of current shuts, it is really easy to do a calibration by simply connecting all of them in series along with a bench DMM you trust then use a power supply to push various currents trough it. Grab the data points for offset and slope and as long as your circuit is stable the readings you get out of it are suddenly in the realm of being 0.01% accurate.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16620
  • Country: us
  • DavidH
Re: Low voltage, low current sense design advice
« Reply #11 on: December 19, 2021, 04:54:29 pm »
That is quite an interesting suggestion. I wouldn't have thought of that in a million years. Perhaps if my more traditional approach doesn't work out, I'll have a look. Although, right off the hop, the LTC6990 has a frequency accuracy of ±1.5%, plus whatever the DAQ adds. I haven't run the numbers though, so I don't know if it's significant enough to matter. Either way, something I'll probably prototype up. Work's added a few more battery current measuring projects my way and this seems worth exploring.

Voltage-to-frequency converters are one of the better ways to achieve high dynamic range (1), but today we have integrated analog-to-digital converters which are almost as good for much lower cost and complexity.  A more realistic voltage-to-frequency converter design is shown in figure 10 of the same application note which achieves 20 bits of dynamic range and 17 bits of accuracy, comparable to a 5.5 or 6 digit multimeter.  Even the trivial design shown in figure 12b on page 11 of Linear Technology application note 3 achieves 14.9 bits of dynamic range and 14.3 bits of accuracy.

I was going to give some examples here of inexpensive integrated modern high resolution analog-to-digital converters, but Analog Devices' online selection guides are completely screwed up.

Based on my analysis earlier, with a good precision design, I do not think you need any range switching.

(1) Jim William's "King Kong" voltage-to-frequency converter achieves 160 dB or 26.5 bits!
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4957
  • Country: si
Re: Low voltage, low current sense design advice
« Reply #12 on: December 19, 2021, 05:27:38 pm »
You can already get a lot of resolution and accuracy from even a more run of the mill measurement ADC. Something like a Microchip MCP3424 that gets you 4 differential input channels on 18bits with a built in Vref, PGA..etc going into I2C (with address select so quite a lot can be put on a single bus). Not the most fancy impressive chip out there, but its reasonably priced and performant enough for most jobs while being a easy single chip solution. For more performance there are also things like a MCP3564 that gets you 24bit (Not all bits usable of course, but still a lot). This is just measuring a battery anyway, those things are all over the place with tolerance and environmental factors anyway.

Yes if you want the ultimate in ADC precision the way to go is various voltage to time conversion methods that real bench DMMs use, but that is a ton of work for precision that you most likely don't even need in the first place. And if you are going for ultimate precision then you probably also have the budget for a 8.5 digit DMM.
 

Offline STMartinTopic starter

  • Contributor
  • Posts: 36
  • Country: us
Re: Low voltage, low current sense design advice
« Reply #13 on: December 19, 2021, 08:39:35 pm »
Everyone,
I appreciate all the replies. I've some new understanding, and some new avenues to explore. I'll spend the next couple of days doing some math and seeing how each one shakes out. I'll post the results here for some critiques. Essentially it'll just be an (attempted) error analysis for each technique.

I'll explore the following:
1) A single shunt sent directly into the DAQ.
2) A single shunt with a current sense amplifier
3) A single shunt with a precision op-amp
4) Multiple shunts sent directly to the DAQ
5) Multiple shunts with whichever amplifier turned out better in (2) and (3)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf