Maker Pro
Maker Pro

Evaluating total energy usage from just DC voltage and current

I'm trying to calculate the total energy usage of a dynamic system that is powered by a bank of lead-acid batteries.

My method is simple - log current (using current clamp) and voltage across the battery then post process the logged data -

a) For each sample point, Instantaneous Power = V*I
b) Energy used by that sample point is Power * Time Period
c) Total Energy Used in log period is the sum of all energies calculated in (b)

This works OK, but is subject to quite a bit of error if there is any offset in the current clamp at 0A. If there is any noise on the current clamp and 0A is, say, measured as 0.1A, then this creates a false Power reading from V*I and this error accumulates across the entire measurement cycle, eventually creating quite a big error.

Is there a more clever way to calculate power usage that nullifies this current-offset error? I was thinking to try and measure the drop in charge of the battery box, but for most trials we do this drop is negligible and almost unmeasureable (at least, that is, based on my understanding of LA batteries)
 
most current monitoring I do uses a small value series resistor. We measure and log the voltage drop across the resistor. It is reliable and with all traces on board the readings are pretty clean.

However it sounds like you may be pushing quite a bit of current so be sure you go with the smallest value resistor that makes sense(perhaps in the neighborhood of 10mOhm). You also need to be sure you have enough headroom on the power rating. Next when you connect the wires for measuring twist them together for some CMR.

If you tell me the current range you are dealing with I could recommend the resistor I would use.
 
most current monitoring I do uses a small value series resistor. We measure and log the voltage drop across the resistor. It is reliable and with all traces on board the readings are pretty clean.

However it sounds like you may be pushing quite a bit of current so be sure you go with the smallest value resistor that makes sense(perhaps in the neighborhood of 10mOhm). You also need to be sure you have enough headroom on the power rating. Next when you connect the wires for measuring twist them together for some CMR.

If you tell me the current range you are dealing with I could recommend the resistor I would use.

Hi NickS. Thanks for the reply.

The current range is 50A - 100A
 
That is a lot of juice. So you need a current sense resistor value as low as possible to keep the dissipated power down. I also do not like the wire wound resistors since they have significant inductance which can be a nasty problem it the power draw changes rapidly.

Here are a couple example parts
Resistor1 0.002 Ohms 30W max (you would be dissapating between 5-20W)

Resistor2 0.001 Ohm 100W max (you would be dissapating between 2.5-10W)

Both are non-inductive and both would still require some sort of heat sinking.
 
That is a lot of juice. So you need a current sense resistor value as low as possible to keep the dissipated power down. I also do not like the wire wound resistors since they have significant inductance which can be a nasty problem it the power draw changes rapidly.

Here are a couple example parts
Resistor1 0.002 Ohms 30W max (you would be dissapating between 5-20W)

Resistor2 0.001 Ohm 100W max (you would be dissapating between 2.5-10W)

Both are non-inductive and both would still require some sort of heat sinking.

Thanks very much for the feedback. Think I might order a couple of the 2nd resistor.
 
What about logging the current through two shunts - wired in series. One shunt targetting higher resolution - say 0-5A. To stop the shunt from overheating with >5A, you could either use a relay or FET to short the shunt (short based on signal from other shunt). A bit of simple electronics, and practical if the current is not too jittery through the 5A region.

Ciao, Tim
 
One of the problems with switching resistors in and out would be that you also need to account for when it happens so you can adjust the scale for your calculations

What are you measuring the current with? even with 100A through that 1mOhm resistor you will only see a 100mV drop.

I had anticipated(though I should have said it) that you would gain up the results or even use a log detector to buy you the measurable range you need.

If you gain up the Vdrop by 50(~16dB) Then you could see a span of 100mA - 100A at a voltage range of 5mV-5V which is pretty reasonable for logging with no switching required.

If you were to employ a log detector you could easily reach a range of 50dB but remember that the granularity near the top of the scale is pretty course.(ie the difference between -10dBm and -9dBm is 25uW but the difference between +30dBm and 31dBm is 250mW )
 
It's pretty difficult to get good resolution and low noise with current shunts with say 50-100mV FS at low % FS input. Having two shunts in series, say a 5A and a 100A, and then shorting out the 'high resistance' 5A shunt when current gets above 5A, keeps the shunt voltage drop to circa 100mV max for all conditions. But you need two logging channels at 100mV FS input, and a technique to short out a shunt (ie.an over-current relay) and a signal that doesn't lead to relay chatter or substantial relay operations, and you need to set Excel for post-processing.

Automatic gain changing on the preamp for the logger is another way to go, but noise and ADC performance will cause you major concerns at say a FS of 5mV = 5A for a 100A 100mV shunt.

I would imagine a log detector will have significant absolute accuracy or resolution concerns - but I've never done the assessment for such a beast.

Ciao, Tim
 
Good points Tim. But why can't the noise be filtered?

I have never had noise problems at lower current ratings but I do always add filtering to my gain/sampling stages. Is the noise you refer to just resistor thermal noise or are you accounting for something else?

Tim with your method do you do any filtering at the sampling point?

thanks
 
Really interesting points guys, thanks alot.

Particularly like the 2x shunt resistor idea and relay-based short. I will be giving that some more thought.

FYI, I'm simply using the Tektronix TDO3034 scope as a data logger right now - it outputs to a convenient CSV format allowing for Excel post-processing.
 
If the ADC was running 12bit plus sign or more then the resolution and LSBs are getting down in the uV level. A good level of analog plus digital filtering would be needed to try and use the lowest LSBs. It's always fun (not) to go through all the errors accruing in an analog measurement system.

Of course it all depends on what accuracy and resolution and data refresh rate are finally needed, but trying to get accurate cumulative Ah results at low current levels (relative to FS shunt level) is tough. Equivalent issue is trying to accurately measure the float current of VRLA with a FS shunt that is rated for C or higher discharge rates.

But then again stube40 may want to reconsider accuracy requirements given inherent battery self-discharge rate and what that means wrt his use of the measurements.

Ciao, Tim
 
Hey Stube40 are we talking AC or DC?

----EDIT----

Right your power source is LA Battery right? So that means its DC, no mains noise to worry about but you should filter it hard anyway.

OK so as this discussion progresses there is more to the story of course.
Your sampling input and recording device is an oscilloscope so unless you have a differential probe for that scope you are using a single ended probe and you must have some analog circiuitry to convert the differential reading from the resistor to the single ended output you require.

here is the route I would go
Stage 1) A differential op-amp to take the diff across the sense resistor and convert it to a single ended value(converter/buffer).
Stage 2) 2 pole salen key filter with 15dB gain cutt-off frequency set as close to 0Hz as is reasonable for part values.
Stage 3) Oscilloscope Logger (8Bit res for all oscilloscopes I have seen)

Now whether or not you do a single or dual sensing resistor the diff-to-single ended converter is a must(you cannot connect the ground lead of your scope to the resistor or you will be pushing current through the ground lead and may ruin your scope). So with a dual resistor setup I guess you would just build the diff-single ended converter twice(once for each resistor). And since you are doing that there is no reason to avoid following it up with a simple active filter. Software filters are nice but they have not yet negated the need for analog filtering in your gain stage. I have used these(2 pole salen key filters) all over in medical electrosurgical devices(I have never seen a noisier environment) and they work fantastic.
 
Last edited:
I had to be pretty carefull with one setup - had LSB of 20mA for a 100A 50mV shunt, and used quality inst amp to get typ error for a 1A level of 2% plus 2% due to temp once trimmed. The digital filtering needs to account for mains frequency, and the measurement equipment needed to have suitable isolated powering, as the battery was on-line and the shunt was not in a lab environment. We got little noise jitter, but not all battery chargers or loads are clean, and unless special care is taken, a noise contribution can be a major concern.

It is likely that stube40 is at the start of that measurement improvement process.

The main noise sources I recall are mains signal seeping through, any electronic noise on the battery (load or charger induced), initial gain stage inst amp noise (esp if running 100x gain levels), and half LSB jitter.

Ciao, Tim
 
But then again stube40 may want to reconsider accuracy requirements given inherent battery self-discharge rate and what that means wrt his use of the measurements.

Ciao, Tim

Hi Tim,

I'm not sure I get what the relevant the self discharge rate of the batteries has. We are only doing a 10 second run at a time - surely self discharge is negligible in this time?

Cheers,
Stuart.
 
Hey Stube40 are we talking AC or DC?

----EDIT----

Right your power source is LA Battery right? So that means its DC, no mains noise to worry about but you should filter it hard anyway.

OK so as this discussion progresses there is more to the story of course.
Your sampling input and recording device is an oscilloscope so unless you have a differential probe for that scope you are using a single ended probe and you must have some analog circiuitry to convert the differential reading from the resistor to the single ended output you require.

here is the route I would go
Stage 1) A differential op-amp to take the diff across the sense resistor and convert it to a single ended value(converter/buffer).
Stage 2) 2 pole salen key filter with 15dB gain cutt-off frequency set as close to 0Hz as is reasonable for part values.
Stage 3) Oscilloscope Logger (8Bit res for all oscilloscopes I have seen)

Now whether or not you do a single or dual sensing resistor the diff-to-single ended converter is a must(you cannot connect the ground lead of your scope to the resistor or you will be pushing current through the ground lead and may ruin your scope). So with a dual resistor setup I guess you would just build the diff-single ended converter twice(once for each resistor). And since you are doing that there is no reason to avoid following it up with a simple active filter. Software filters are nice but they have not yet negated the need for analog filtering in your gain stage. I have used these(2 pole salen key filters) all over in medical electrosurgical devices(I have never seen a noisier environment) and they work fantastic.

I could use two voltage probes in differential mode - we have to do this anyway as part of our system is floating and we get problems if we ground it to the scope.
 
The main noise sources I recall are mains signal seeping through, any electronic noise on the battery (load or charger induced), initial gain stage inst amp noise (esp if running 100x gain levels), and half LSB jitter.

Ciao, Tim

The battery array is completely isolated from mains - we charge it up with mains chargers then disconnect them. The noise is mostly electronic I think
 
Apologies all round - crossed posts from my end.

Taking one step back - you were using a 'current probe' into a CRO for a 10 second measurement. I guess the probe was a DC + AC unit? and the probe FS was large compared to the current measured? Maybe best to indicate your max dynamic level, and the fastest rate of change (or freq response) of signal which you want to account for.

Using a shunt with good amp that gets you close to CRO FS input will give best use of 8-bit resolution (I agree - I have only come across 8-bit too). Stube40, is 8 bit resolution acceptable - have you done some estimation of what that means? No point adding complexity elsewhere if that is your limiter.

Ciao, Tim
 
I could use two voltage probes in differential mode - we have to do this anyway as part of our system is floating and we get problems if we ground it to the scope.

From Tektronics
"Pseudo-Differential Techniques. The most popular solution to the need for a "floating" measurement is the "A minus B" pseudo-differential technique. Most general-purpose dual-trace oscilloscopes have an ADD Mode where the two channels can be electrically subtracted (invert CH 2), giving a display of the difference signal. Higher voltage probes such as the P5100 (2,500 V, 100X - see Figure 4) are used, but they limit minimum sensitivities. This can be a problem when attempting to examine low-level control signals in the presence of high common-mode voltages. Also, the common-mode dynamic range is severely limited (+1 division beyond screen height) and common-mode rejection ratio (CMRR) is low - approximately 20 to 1."

If you are ok with the performance hit then sure.
 
From Tektronics
"Pseudo-Differential Techniques. The most popular solution to the need for a "floating" measurement is the "A minus B" pseudo-differential technique. Most general-purpose dual-trace oscilloscopes have an ADD Mode where the two channels can be electrically subtracted (invert CH 2), giving a display of the difference signal. Higher voltage probes such as the P5100 (2,500 V, 100X - see Figure 4) are used, but they limit minimum sensitivities. This can be a problem when attempting to examine low-level control signals in the presence of high common-mode voltages. Also, the common-mode dynamic range is severely limited (+1 division beyond screen height) and common-mode rejection ratio (CMRR) is low - approximately 20 to 1."

If you are ok with the performance hit then sure.

Thanks for the heads up on that - I never realised. Might have to have a rethink............
 
Top