Author Topic: Auto-ranging current sensing  (Read 2553 times)

0 Members and 1 Guest are viewing this topic.

Offline HwAoRrDkTopic starter

  • Super Contributor
  • ***
  • Posts: 1477
  • Country: gb
Auto-ranging current sensing
« on: June 25, 2021, 10:06:36 pm »
I have been thinking about how to automatically switch ranges on a current sensing application, to choose between different shunt resistors. The requirement would be to sense current on a +5V rail from below 100mA (not sure what exactly, but not really single-digits mA) to somewhere in the region of 4.5A. Initially, I was hoping to do this with a single 22mR shunt resistor, but I've realised that the accuracy would be garbage at the lower current levels. So I have been attempting to come up with a way of having 2 current shunts - one for 'low' range and another for 'high' range - and to switch between them automatically depending on load.

What I've come up with is the following:



I've chosen 220mR and 22mR shunt resistors. The former is for 'low' range which should handle 0-0.45A, and the latter for 'high' range, 0.45-4.5A. The current sense amplifier has a gain of 50V/V, giving an output in the range of 0-5V. The switching of current flow between the shunts is done by P-channel MOSFETs. The gates of the P-FETs are driven from a 12V rail, which should give them at least 5Vgs, yielding a decent on-resistance (will choose something with Vgs@-4.5V of <20mR) and fairly low power dissipation (<0.5W at full current). The negative input to the current sense amplifier is switched between the shunts by an analogue SPDT mux, which is a break-before-make type. The range switching input signal will be controlled by a microcontroller, which is also reading the current level with ADC.

There are some uncertainties or areas of concern I have:

- I'm using a 74-series inverter to drive one FET to the opposite state of the other. I'm aware that such inverters have propagation delay. Will this be an issue?
- Does the on-resistance of the analogue mux have any effect on the current-sense amplifier? I'm assuming the inputs to that are very high impedance, just like an op-amp, and it won't. I chose a mux that seems to be common, a TI TS5A3159A with 1R on-resistance, but others have 5R, 15R, etc.
- Are there any special tricks to implementing range-switching logic? I do plan to put some hysteresis in the change-over thresholds.

Any other comments welcome. :-+
 

Offline viperidae

  • Frequent Contributor
  • **
  • Posts: 306
  • Country: nz
Re: Auto-ranging current sensing
« Reply #1 on: June 25, 2021, 10:23:58 pm »
You could put the shunts in series. Use both for low range, short the big one with a MOSFET for high range.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5871
  • Country: de
Re: Auto-ranging current sensing
« Reply #2 on: June 25, 2021, 10:41:16 pm »
Jsut drive the MOSFETs directly from two 74AHC1G14/17 inverters/buffers (5 V supplied). Plenty of drive current, and you can eliminate the bipolars and resistors completely.
« Last Edit: June 25, 2021, 10:47:06 pm by Benta »
 

Offline HwAoRrDkTopic starter

  • Super Contributor
  • ***
  • Posts: 1477
  • Country: gb
Re: Auto-ranging current sensing
« Reply #3 on: June 26, 2021, 01:56:08 am »
You could put the shunts in series. Use both for low range, short the big one with a MOSFET for high range.

Hey, that's a good idea! :-+

I have revised my design:



Gets rid of one MOSFET and accompanying NPN, as well as the inverter, but adds a second analogue mux.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3036
  • Country: us
Re: Auto-ranging current sensing
« Reply #4 on: June 26, 2021, 02:38:24 am »
You might look at the CurrentRanger for ideas:

https://lowpowerlab.com/guide/currentranger/specs-architecture/

 

Offline WattsThat

  • Frequent Contributor
  • **
  • Posts: 766
  • Country: us
Re: Auto-ranging current sensing
« Reply #5 on: June 26, 2021, 03:01:39 am »
IMO, the CurrentRanger appears to be unnecessarily complex with its shunt switching.

Dave did a good presentation on improving multimeter burden voltage with auto current ranging. IIRC, the area of interest is in episode 2.


 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Auto-ranging current sensing
« Reply #6 on: June 26, 2021, 07:25:02 am »
A design similar to µCurrent may give 0.1mA accuracy at low currents with 22mΩ shunt.

Noise may be a problem, perhaps. Dunno what's the state of the art in chopper-stabilized opamps.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14197
  • Country: de
Re: Auto-ranging current sensing
« Reply #7 on: June 26, 2021, 11:17:05 am »
The INA197 is not really high performance. The noise and dift are relatively large. So chances are a really good amplifier at the high side could give 5-10 times better performance and thus get a similar performance with only a 22 mOhms shunt, as the INA197 with a 220 mOhms shunt. It may take a low noise AZ OP (e.g. OPA189) instead of a ready made current sense amplifier. 

In principle the series connection is OK. One can likely get away with switching only 1 side for the amplifier part. The integrated switches are usually not good for 4.5 A - so it would likely still need a MOSFET in parallel to the higher values shunt. Without a more positive supply it would need a P Channel fet. For the low resistance it may be worth to generate a auxiliary voltage of some 10 V so one can use a N channel FET.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Auto-ranging current sensing
« Reply #8 on: June 26, 2021, 11:43:11 am »
If you are only going to have two ranges and there is only a 10x difference between ranges - I don't think the juice is worth the squeeze, you might as well just use the smaller shunt and add a x10 gain stage, or increase the resolution of the ADC.

https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline HwAoRrDkTopic starter

  • Super Contributor
  • ***
  • Posts: 1477
  • Country: gb
Re: Auto-ranging current sensing
« Reply #9 on: June 26, 2021, 10:23:26 pm »
The INA197 is not really high performance. The noise and dift are relatively large. So chances are a really good amplifier at the high side could give 5-10 times better performance and thus get a similar performance with only a 22 mOhms shunt, as the INA197 with a 220 mOhms shunt. It may take a low noise AZ OP (e.g. OPA189) instead of a ready made current sense amplifier. 

Yes, I know, but I also want to measure current on a -12V rail, and the INA197 is one of the few current sense amps I found that handles such a negative common mode voltage. I would prefer not to use different parts for different voltage rails.

In principle the series connection is OK. One can likely get away with switching only 1 side for the amplifier part.

Ah, you're right! I should have realised that the 220 and 22 shunts can be measured in series (totalling 242mR) for the low range. That means I can ditch one of the analogue muxes. :-+

The integrated switches are usually not good for 4.5 A - so it would likely still need a MOSFET in parallel to the higher values shunt. Without a more positive supply it would need a P Channel fet. For the low resistance it may be worth to generate a auxiliary voltage of some 10 V so one can use a N channel FET.

Not sure what you mean - integrated switches of what?

I do have a +12V supply available (for some reason in the schematics already shown I put the gate P-FET pulled up to that - I meant to put 5V), so yes, I guess I could use an N-channel FET. All I have to do is find one that gives a satisfactory on-resistance at a Vgs of about 7V.
 

Offline viperidae

  • Frequent Contributor
  • **
  • Posts: 306
  • Country: nz
Re: Auto-ranging current sensing
« Reply #10 on: June 26, 2021, 11:07:35 pm »
You don't need the extra mux if you use the 22m for high range and 22m+220m for low range. Just a different calibration factor in the ADC code.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14197
  • Country: de
Re: Auto-ranging current sensing
« Reply #11 on: June 27, 2021, 06:34:10 am »
There are plenty of small. low voltage (e.g. 20-30 V DS) n channel MOSFETs with low resistance (e.g. 10 mOhms range) for switching the high current. P Channel FETs are also possible but often higher resistance and not as much choice.


One still needs a second switch: either a 2nd MOSFET to switch the path of the lower current or a SPDT swtich to switch the sense line. Both ways work, with no big difference in performance.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf