Measuring multiple shunt resistors with Pos or Neg voltages

Thread Starter

guitardenver

Joined Jan 24, 2009
31
I have an application where I need to measure the current through multiple devices. There is a shunt resistor for measuring the current.

Vin = +- 24V
Load resistor of 20 ohms
shunt resistor of 0.1 ohms.

I have 4 of these.

upload_2016-11-2_22-48-12.png

The MCU i'm using has 4 differential ADC inputs that will put out a positive or negative number based on the differential input.
MCU = MK22FN512FN12

Here is the ADC datasheet spec:

Questions:
1) Vadin = 31/32* V Does this mean that I can put 24 volts on either pin? Lets say the differential is 2.5V but a pin is 24V with respect to the MCU ground or Vreglow.

2) Any suggestions on a good way to measure 4 shunt resistors with the schematic above with minimal components? Differential Mux maybe? Can't seem to find one that is available.

upload_2016-11-2_22-36-44.png
 

crutschow

Joined Mar 14, 2008
38,325
1} No. The maximum input voltage is 31/32 times VREFH and the maximum VREFH is the positive ADC supply voltage so you most definitely cannot measure a voltage that is at a common-mode value of 24V.

One way to measure this differential voltage with a common-mode value of 24V is to use a difference amplifier with a high common-mode voltage range such as one of these.
Linear Technology and Analog Devices also build such devices.
The simplest would likely be to use one diff amp for each shunt.
For that you just need a single ended input for the ADC from each diff amp.
 

MrAl

Joined Jun 17, 2014
13,667
Hi there,

Do all of the shunts have a common ground or are they all in completely different circuits, and do you have to measure them all at the same time or can you measure them one by one?
 

ErnieM

Joined Apr 24, 2011
8,415
Do you realize for a single metering device to measure four different voltages these four voltages MUST have some common point?

Does your system have such?

WHAT are you doing? Can we see the big picture and not some little detail?
 

hp1729

Joined Nov 23, 2015
2,304
I have an application where I need to measure the current through multiple devices. There is a shunt resistor for measuring the current.

Vin = +- 24V
Load resistor of 20 ohms
shunt resistor of 0.1 ohms.

I have 4 of these.

View attachment 114679


The MCU i'm using has 4 differential ADC inputs that will put out a positive or negative number based on the differential input.
MCU = MK22FN512FN12

Here is the ADC datasheet spec:

Questions:
1) Vadin = 31/32* V Does this mean that I can put 24 volts on either pin? Lets say the differential is 2.5V but a pin is 24V with respect to the MCU ground or Vreglow.

2) Any suggestions on a good way to measure 4 shunt resistors with the schematic above with minimal components? Differential Mux maybe? Can't seem to find one that is available.

View attachment 114677

Maximum input voltage on the analog input depends on VDD. Well 31/32 x VDD.
Since your schematic shows the possibility of +24 V going in to that point I would say, no, don't do it.
The voltage across the shunt resistor may only be 0.119 V, but at a +24 V level.
So maybe a differential op amp that can go all the way down to 0V and up to a common mode 24 V level?
 

ErnieM

Joined Apr 24, 2011
8,415
Just using a differential amp is not a total solution here. First you have four sources to monitor with an unspecified connection, meaning you can have a very high common mode voltage on that differential amp's inputs.

Worse could be the output of the amps. Since the source can be of either polarity then half the time the current being measured will be negative along with the amp output, and any negative voltage is out of spec for that A2D or any micro pin.
 

hp1729

Joined Nov 23, 2015
2,304
Just using a differential amp is not a total solution here. First you have four sources to monitor with an unspecified connection, meaning you can have a very high common mode voltage on that differential amp's inputs.

Worse could be the output of the amps. Since the source can be of either polarity then half the time the current being measured will be negative along with the amp output, and any negative voltage is out of spec for that A2D or any micro pin.
Can anybody find an LM343 any more? High voltage op amp. Is there a modern equivalent?
 

Thread Starter

guitardenver

Joined Jan 24, 2009
31
There are 4 of the circuits shown on the original post. Each is loading/Testing a full H bridge in both +- and -+ outputs. The output of the H-Bridge is current regulated to the value I set it at. It's an output of a motor driver.

No they do not have to be measured at the same time.

I was thinking about putting a difference amp on each shunt. The difference amp will have Power rails of +9 and 0. And the reference will be 3 V. That way the voltage across the shunt can go positive or negative about the 3v reference giving a full swing of +-3 V (0-9V).

Then each difference amp will go into an analog mux, and the output of the analog mux will go to a non-inverting level shifter to convert 0-9V max to 0-3.3 V on the MCU single ended ADC.

Each shunt will only be tested with a current of 500mA to 1.2A.
For example. This does not show the mux or level shifter, but the difference amp with a 3 V offset. The simulation works in TINA-TI. Not the op amp I chose or anything, just the first on in TINA I saw.

I've been having trouble getting the level shifter from 0-9 to 0-3.3 working correctly so i'm still working on that one.


upload_2016-11-6_17-47-53.png
 

Thread Starter

guitardenver

Joined Jan 24, 2009
31
Or maybe I will bias it at 1.6V and since the largest current that can go through the circuit is 1.2A the output will never go above 3.3Vand I can get rid of the level shifter on the output of the mux. But i'll probably want some kind of protection on the output just in case it goes above 3.3V. Maybe a diode or a buffer amp with a +rail of 3.3V so it can't go above 3.3.

upload_2016-11-6_17-54-19.png
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,415
Shifting 0-9 down to 0-3.3 isn't a lever shift, it's a straight divider.

Is it possible to sketch the system you are actually measuring, meaning at least two of the 4 bridges, drawn as bridges, and showing how you power them?
 

Thread Starter

guitardenver

Joined Jan 24, 2009
31
The circuit in my last post is working great. I think I will continue with that design. Biasing at 1.6v makes it easy to interface with the MCU ADC. I can make 3.3 max either with a buffer or using the mux. I used 9V on the amp because I already have a 9V rail. I could use 24 as well.

ErnieM,
For completeness, here is the H-Bridge. Drawing two of them is redundant because there is just multiple of these circuits that test each H-Bridge by loading them.

upload_2016-11-6_19-14-27.png
 

ErnieM

Joined Apr 24, 2011
8,415
For completeness you would have included two stages so no one has to guess how they connect.

Your INA will emit magic smoke as you are still ignoring my advice on input common mode voltage.

Is there some compelling reason you don't place the sense resistor between the junction of T1 and T2 to ground and eliminate all these problems?
 

Thread Starter

guitardenver

Joined Jan 24, 2009
31
That INA amp is just for the schematic it's not the amp I would use. It just for simulation. Same with the H-Bridge it's just a quick drawing. The concept was what I was looking for not exact part numbers. And I have found it now with the options I put in above posts or there are chips that do this exact thing I found such as the INA282. It has a gain of 50 V/V so I would have to change my shunt value to about .01 but that could be ok.

INA28x-Q1 –14-V to +80-V, Bidirectional, High Accuracy,
Low- or High-Side, Voltage Output, Current Shunt Monitor.


The "Two Stages" you are referring to do not connect they are completely separate other than the same +24V power supply. If I drew it I would just copy and past that exact picture twice. Separate bridges, separate shunt and load resistor, separate op amp. Same circuit, just many of them.

I don't put the shunt on the ground because I don't have access to put a resistor in series there. This is a board test fixture and this part of the circuit is just to load the driver output to make sure everything works. I only have test points on the output of the H-Bridge.

Thank you all for the suggestions! It helped me find the answer.
 
Top