High-Accuracy Current Measurement With Low-Cost Shunts by Means of Dynamic Error Correction
High-Accuracy Current Measurement With Low-Cost Shunts by Means of Dynamic Error Correction
High-Accuracy Current Measurement With Low-Cost Shunts by Means of Dynamic Error Correction
, 5, 389400, 2016
www.j-sens-sens-syst.net/5/389/2016/
doi:10.5194/jsss-5-389-2016
Author(s) 2016. CC Attribution 3.0 License.
Abstract. Measurement of electrical current is often performed by using shunt resistors. Thermal effects due to
self-heating and ambient temperature variation limit the achievable accuracy, especially if low-cost shunt resis-
tors with increased temperature coefficients are utilized. In this work, a compensation method is presented which
takes static and dynamic temperature drift effects into account and provides a significant reduction of measure-
ment error. A thermal model of the shunt resistor setup is derived for this purpose and a suitable calibration
method is developed. The correction algorithm is based upon a digital filter bank and is optimized for micro-
controllers with low computational complexity. It is implemented in laboratory test equipment for long-term
studies on automotive lithium-ion cells. For a 600 A current pulse, it reduces the measurement error from 2 % to
less than 0.1 %. Measurements with a real-life testing profile show a reduction of remaining measurement error
by 60 %. Statistical results for 100 test systems and long-term drift measurements prove the reliability of the
method. The proposed dynamic error correction algorithm therefore allows high measurement accuracy despite
the use of low-cost shunt resistors.
Published by Copernicus Publications on behalf of the AMA Association for Sensor Technology.
390 P. Wekamp and J. Melbert: High-accuracy current measurement with low-cost shunts
Table 1. Comparison of current measurement techniques suitable digital filter structure, a method to determine the correction
from DC up to several tens of kilohertz. parameters by an automated calibration sequence and statis-
tical results obtained during operation of 100 distinct mea-
Pro Contra surement systems.
Shunt Low complexity, Power dissipation, no
low cost, wide isolation, self-heating 2 Theory and principle of operation
bandwidth
Hall effect Isolation, no power Temperature-dependent 2.1 Current measurement for test equipment for
losses offset, limited accuracy
automotive lithium-ion cells
Fluxgate Isolation, no power Disturbance due to
losses, good accu- excitation frequency, For aging studies on automotive lithium-ion cells, special-
racy large operation current, ized test equipment is necessary to cycle the cells with re-
limited bandwidth alistic currents and to measure small variations in the elec-
w/o additional
trical behavior with high precision. Currents of up to 600 A
transformer, cost
with frequencies from DC up to the kilohertz range are typi-
cal (Wekamp et al., 2016). Due to the low voltage range of
a single battery cell, electrical isolation is not required and
acceptable threshold. In any case, these methods typically shunt resistors can be used for current measurement. Their
lead to increased material and space requirements as well as low cost compared to other solutions is advantageous for
higher cost. building a large number of test systems; additionally, their
Direct compensation methods are an alternative approach wide bandwidth and inherent accuracy for low currents are
and are known to improve the measurement accuracy: a tem- also favorable (see Table 1).
perature sensor measures the temperature of the shunt ma- The cell tester developed by our research group uses 12
terial and corrects the current measurement based on the 10 m thick-film shunt resistors (TO-247 package) in par-
known material characteristics (Ziegler et al., 2009b). allel connection, mounted on a heat sink with water cool-
However, this direct approach is limited if there is a ther- ing. Electrical connection is accomplished by copper bus-
mal resistance between the shunt material and the location bars. The overall resistance is approximately 1 m, taking
of the temperature sensor, for example, if the resistance is the resistance of the interconnection into account. A temper-
enclosed in a package and the shunt material is not directly ature sensor allows the measurement of the surface tempera-
accessible. This is the case for nearly all available shunt re- ture of the heat sink (Fig. 1).
sistors intended for heat-sink mounting. In this situation, the For this application, the measurement error of the electri-
inner shunt temperature cannot be measured directly and is cal current should be about 0.1 % for a wide current range
typically higher than the temperature at the heat-sink surface. up to 600 A in order to determine the capacity of lithium-ion
For the thermal steady state, the inner temperature can still be cells by integration of the current flowing into the cell.
calculated if the thermal resistance is known (Ziegler et al.,
2009b). 2.2 Shunt resistor: temperature coefficient
Unfortunately, these static methods do not take into ac-
count the thermal capacitances of the materials along the path For low currents this maximum error can easily be accom-
of the heat flow. As shown in the following sections, they plished by periodic linear calibration and measurement of the
lead to different dynamic behavior of shunt and sensor tem- actual shunt resistance, which eliminates any static errors due
perature and therefore induce time-dependent measurement to resistance tolerances and slow drift effects over time.
errors. However, a linear calibration technique cannot compen-
In this paper a method is presented to overcome these sate for the effect of the temperature coefficient of the shunt,
challenges and to provide a dynamic error correction pro- which is determined to TK = 422 ppm K1 from the mea-
cedure. With this method it is possible to calculate the in- surement in Fig. 2. For the maximum current of 600 A the
ner shunt temperature also during arbitrary thermal transients power dissipation is 25 W per resistor. Although this is suf-
and to dynamically compensate for the temperature drift of ficiently below the respective absolute maximum rating of
a shunt resistor. The proposed algorithm has been optimized 100 W, the thermal resistance of the shunt and the heat sink
for real-time applications with low-cost microcontrollers and lead to an inner temperature rise of 30 C, equivalent to a
can also be used to increase the accuracy of existing current resistance variation of 1.5 %. Without further compensation,
measurement systems. the relative current measurement error has the same value
This paper is an extended version of the previously pub- and is an order of magnitude higher than desired.
lished conference paper (Wekamp and Melbert, 2016a) and In the shown configuration, the copper busbars and other
includes an in-depth discussion of the practical implementa- interconnections also contribute a small part to the total shunt
tion in an embedded system, including the derivation of the resistance (< 10 %) and to the overall temperature coeffi-
Figure 1. The 1 m shunt resistor for lithium-ion cell test equipment, consisting of 12 10 m shunt resistances in a TO-247 package
mounted on a heat sink with water cooling. Left: photograph with annotations. Right: cross section.
cient. Because the temperature coefficient of copper is quite Ploss = R(T )I 2 (4)
high ( 3900 ppm K1 ), the additional resistance increases 1Tselfheating = Rth,total Ploss
the total temperature coefficient to TK 600 ppm K1 . = Rth,total R(T )I 2 ,
Temperature variation of the cooling water (or more gen-
erally of the ambient temperature) will also lead to a drift of Rth,total R0 I 2 . (5)
the shunt resistance value, and has to be taken into account.
The approximation R(T ) R0 made in the last step of
Eq. (5) simplifies the following calculation. It can be shown
2.3 Nonlinear calibration for thermal steady state that the overall calibration error associated with this assump-
The temperature dependence of the shunt resistance used in tion is below 0.04 % and therefore can be disregarded.
this work can be approximated with good concordance by a Substituting Eqs. (2)(5) in Eq. (1) yields
linear function, as demonstrated in Fig. 2, and is given by the
equation R(I, 1Tamb ) = R0 1 + TK 1Tamb + TK Rth,total R0 I 2 . (6)
R(T ) = R0 (1 + TK (T T0 )) (1) This equation describes the resistance variation due to self-
= R0 (1 + TK 1T ) . heating and ambient temperature change.
Tshunt (j ) = Tamb (j ) + Ploss (j ) Rth,0 results of Eq. (15) to the derivation of the static calibration
3 approach (Eq. 17) yields
X 1
+ Ploss (j ) Rth,i . (8)
i=1
1 + j i Ushunt (t) = R0 (1 + TK 1Tamb (t)) I (t)
+ R0 TK Rth,total R0 (I 2 (t)h1 (t))I (t)
The dynamic effects of self-heating therefore are given by
the sum of three independent low-pass filters with time con- = a1 I (t) + a3 I 2 (t)h1 (t) I (t). (16)
stants i = Rth,i Cth,i and a time-invariant part due to Rth,0 .
Likewise, the transfer function for the sensor temperature is Equation (16) is then solved for the unknown current I :
obtained as
Ushunt (t)
1 I (t) = (17)
Tsensor (j ) = Tamb (j ) + Ploss (j )Rth,4 . (9) a1 + a3 I 2 (t)h1 (t)
1 + j 4
Ushunt (t)
= . (18)
By using the approximation Ploss = R(T )I 2 R0 I 2 , R0 (1 + TK 1Tamb (t)) + a3 I 2 (t)h1 (t)
Eq. (8) is rewritten as
On the right-hand side of Eq. (18) there are still two un-
known quantities: the change in ambient temperature 1Tamb
Rth,0
Tshunt (j ) = Tamb (j ) + I 2 (j )R0 Rth,total and the current I 2 (t) itself, used as the input to the dynamic
Rth,total
3
# thermal model. The latter circular reference is resolved by
X Rth,i 1 approximating the current with the last known value, i.e.,
+
R
i=1 th,total
1 + j i I 2 (t) I 2 (t 1t). The error introduced by this approxima-
tion is small, because the thermal model consists of several
= Tamb (j ) + I 2 (j )R0 Rth,total H1 (j ). (10)
low-pass filters whose time constants are significantly higher
The term inside the brackets describes the normalized dy- than the discrete time step (i 1t) and therefore smooth
namic behavior of the system and is denoted by H1 (j ), the behavior of I 2 (t) in any case. Additionally, an imple-
mentation using digital filter structures can be constructed to
Rth,0 3
X Rth,i 1 eliminate the need for the most recent value of the electrical
H1 (j ) = + , (11) current at all (see Sect. 2.6).
Rth,total i=1 Rth,total 1 + j i
The change in the ambient temperature is given by Eq. (3),
TKR0 R0 TKRth,totalR02 Rewriting this equation and transforming to the time domain
yields
Tamb h(t) * I 2(t)
- T0 1t 1 1t 1 2
+ Y (z) = (1 )z Y (z) + z I (z) (25)
- i i
1t 1t 2
yk = (1 )yk1 + I , (26)
i i k1
where the relationship yk1 c s z1 Y (z) was used. The
difference equation (Eq. 26) realizes the desired low-pass
Ambient
filter characteristic as a first-order IIR (infinite impulse re-
temperature Self-heating sponse) filter and can easily be implemented on a microcon-
troller. It is stable if 0 < 1t < i , i.e., if the discrete time step
Tsensor 2 is sufficiently small.
Ishunt (t-t)
The use of the forward difference (Eq. 21) instead of the
Figure 4. Overall dynamic correction algorithm, taking into ac- backward difference or the bilinear transform (Proakis and
count effects due to self-heating and ambient temperature change. Manolakis, 2007) reduces the computation cost and ensures
that at time k the value Ik2 is not needed in the filter calcula-
tion.
interval 1t, such that t = k 1t with k = 0, 1, 2, . . .. In the fol- The fundamental filter structure is implemented four times
lowing discussion, the short-form notation in parallel (one for each RC element) and the weighted re-
sults are summed according to Eqs. (22) and (23) to imple-
I (t)|t=k 1t = I (k 1t) = Ik (20) ment the dynamic thermal behavior.
Table 2. Algorithm: discrete-time dynamic error correction proce- First, small-current amplitudes of up to 150 A are investi-
dure. gated with alternating directions of current. For these ampli-
tudes, the self-heating effect is negligibly small and thermal
Repeat for each time step k. steady state (with respect to the measurement resolution) is
1. Thermal reached almost instantaneously. Additionally, the use of al-
filtercalculation
1t 1t 2 ternating current directions allows compensation for any off-
yi,k = 1 yi,k1 + I , for i = 1, 2, 3, 4
i i k1 set errors in the measurement of the shunt voltage.
2. Calculate the self-heating effect.
The nonlinear self-heating effect is evaluated by longer
3 current pulses with amplitudes in the range 250 A . . . 600 A.
2 Rth,0 2 X Rth,i
Ifiltered,k = Ik1 + yi,k The pulse width is chosen sufficiently high to allow for set-
Rth,total R
i=1 th,total tling of thermal effects. This investigation is repeated at two
3. Calculate the ambient temperature change. fixed ambient temperatures to determine the temperature co-
1Tamb,k = Tsensor,k R0 Rth,4 y4,k T0 efficient of the shunt.
The sequence in Fig. 5 is applied to every test system by
4. Calculate the calibration factor.
an automated calibration test bench and the voltage over the
K = 1/ R0 + TK R0 1Tamb,k
shunt resistor is measured. A reference value for the current
+TK R02 Rth,total Ifiltered,k
2
is obtained using an external high-power precision shunt re-
sistor with a temperature coefficient of only 1 ppm K1 and
5. Calculate the shunt-resistor current.
a measurement uncertainty of 0.026 %, which is assumed not
Ik = K Ushunt,k
to be affected by thermal drift. The measured signals are eval-
uated using Matlab on a PC.
Figure 5. Automated calibration sequence consisting of rectangular current pulses with varying amplitude at two ambient temperatures.
8
600 Measurement
T Sensor [C]
Measurement Quadratic fit
Fit 6
500
4
Ushunt [mV]
400
300 2
200 0
0 100 200 300 400 500 600
100 Current I [A]
0 Figure 7. Rise of the heat-sink temperature 1Tsensor due to the
0 100 200 300 400 500 600
power dissipated in the shunt resistor and fit to the quadratic model.
Reference current [A]
12
a 1 I + a 3 I 3 (full model)
10
Calibration errorI [A]
a1 I (linear fit only) the sensor temperature is derived from Eq. (13) as
8
6
1Tsensor = Tsensor Tamb = I 2 R0 Rth,4 . (27)
4
Figure 6. Calibration measurement and resulting error for Tamb = 3.3 Dynamic parameter estimation
20 C and thermal steady state. The error of the proposed nonlinear
model is below 20 mA, whereas the error for the linear fit (without As discussed in Sect. 2.4, the dynamic thermal behavior is
self-heating effects) exceeds 10 A. fully characterized by the functions H1 (j ) and H2 (j ).
Both functions are a linear superposition of the fundamental
first-order low-pass filter H (j ). Its step response hstep (t) in
Table 3. Extracted parameters a1 and a3 using polynomial curve the time domain is given by
fitting for different ambient temperatures.
Current [A]
shunt 1
610
600
Normalized U
590
0.5
0 50 100 150 200
Relative current
2
0
0 50 100 150 200 250 300 1
Time [s]
0
Figure 8. Normalized change in shunt voltage due to self-heating -1 No compensation
after a current step. Steady-state compensation
-2 New dynamic compensation
-3
Table 4. Extracted parameters for the dynamic thermal model due 0 50 100 150 200
to self-heating by nonlinear least-square curve fitting. Time [s]
1.5
Relative current
1
0.5 the sequence shown in Fig. 5; calibration parameters have
0 been obtained individually and are used for optimal results.
-0.5 No compensation The maximum current deviation after calibration in thermal
-1
Steady-state compensation steady state for all test systems is shown in Fig. 11. It is well
New dynamic compensation
-1.5
below 0.1 %, proving the accuracy of the proposed method.
113 114 115 116 117 118 119 120 The statistical distribution of the calibration parameters
Time t [s] themselves is also evaluated and given in Fig. 12. Each pa-
rameter is approximated by a normal distribution, whose
Figure 10. Realistic testing profile for lithium-ion cells (top: full
mean and variance are given in Table 6.
profile; middle: excerpt) and associated relative current measure-
On the one hand, the nearly Gaussian distribution proves
ment errors (bottom).
that there are no outliers due to errors during manufacturing,
that all test systems behave similarly, and that the parameter
35 estimation procedure works robustly. On the other hand, it
30 allows one to determine whether a calibration on an individ-
No. of test systems
30 30 60 30
No. of test systems
10 10 20 10
0 0 0 0
870 880 890 900 40 45 50 55 570 600 630 660 12 14 16 18 20 22
a1 [V/A] 3 TK [ppm/K] 2 [s]
a3 [pV/A ]
Figure 12. Statistical distribution of selected calibration parameters for 100 distinct test systems.
Table 7. Parameter drift of a single shunt after operation for 1 year. thermal steady state. It is supplemented by a dynamic model
The total charge throughput during this time was approximately describing transient thermal effects due to self-heating and
185 000 Ah. heat transfer over a heat sink. A temperature sensor is used
to measure the ambient temperature. The effect of the power
Parameter Value Drift (1 year) Current dissipation in the shunt resistor on the measured ambient
error
temperature is compensated for by a correction algorithm.
due to
drift effect The proposed algorithm is used for current measurement
(I = 600 A) in test equipment for automotive lithium-ion cells employ-
ing low-cost shunt resistors. It is able to reduce the current
R0 884.5V A1 +0.09 % +0.06 % measurement error from over 2 % to less than 0.1 % for a
Rth,total 0.094 K W1 +15.7 % +0.26 % 600 A current pulse. For a real-life, dynamic testing profile
TK 635 ppm K1 6.43 % 0.17 %
the mean current measurement error is reduced by 60 %.
1 0.655 s +2.44 % +0.04 % The presented dynamic error correction procedure there-
2 14.7 s +4.01 % (all dynamic fore enables precise current measurement with low-cost
3 101 s +5.29 % parameters shunt resistors. The implementation as a discrete-time filter
Rth,1 /Rth,total 0.482 3.60 % are jointly structure on a microcontroller with low demands on com-
Rth,2 /Rth,total 0.227 +1.25 % evaluated)
putation power is discussed in detail. An automated calibra-
Rth,3 /Rth,total 0.191 +7.57 %
tion sequence composed of rectangular current pulses is pre-
sented, by which all required parameters are determined in-
dividually for each shunt resistor.
calibration. The parameter drift and the resulting current A statistical analysis of the calibration parameters of
measurement error (at I = 600 A) for one tester between suc- 100 shunt resistors is performed, proving the robustness and
cessive calibrations are given in Table 7. Between the two accuracy of this approach. Drift effects over time have also
calibrations, the tester has been used for 1 year in an aging been evaluated; the current measurement error after 1 year is
study on lithium-ion cells with a total charge throughput of still less than 0.2 %.
185 000 Ah. Due to low computational requirements the proposed al-
The overall steady-state current measurement error after gorithm can also be used to increase the accuracy of existing
1 year is 0.165 %, which is acceptable for this application. systems. Particularly, this is the case if the ambient tempera-
In comparison, the drift of the shunt resistance R0 is about ture does not change or is already known, allowing the omis-
0.1 %, which is equal to the current measurement error for sion of the optional temperature sensor used in this applica-
low currents. At higher currents, the error is dominated by tion.
the drift of the thermal resistance Rth,total and the temperature
coefficient TK , although these effects cancel each other out
5 Data availability
in parts. In contrast, the drift of the dynamic behavior has a
negligible impact.
The dataset used in this article is available at
doi:10.5281/zenodo.164820 (Wekamp and Melbert,
4 Summary and conclusions 2016b).
In this paper, a dynamic error compensation procedure is pre- Edited by: K.-D. Sommer
sented, which is able to correct the current measurement er- Reviewed by: two anonymous referees
rors of shunt resistors due to self-heating and ambient tem-
perature change. The method is based on a theoretical anal-
ysis of the shunt resistance variation due to temperature for
References Rabiner, L. R. and Gold, B.: Theory and application of digital signal
processing, Prentice-Hall, Englewood Cliffs, NJ, 762 pp., ISBN-
Bagnoli, P. E., Casarosa, C., Ciampi, M., and Dallago, E.: Ther- 10: 0-13-914101-4, 1975.
mal resistance analysis by induced transient (TRAIT) method Ripka, P.: Electric current sensors: a review, Meas. Sci. Technol.,
for power electronic devices thermal characterization. I. Fun- 21, 112001, doi:10.1088/0957-0233/21/11/112001, 2010.
damentals and theory, IEEE T. Power Electr., 13, 12081219, Wekamp, P. and Melbert, J.: 3.4.4 High Performance Cur-
doi:10.1109/63.728348, 1998. rent Measurement with Low-Cost Shunts by means of Dynamic
Grundktter, E.: Untersuchung des transienten thermischen Ver- Error Correction, in: 18. GMA/ITG Fachtagung Sensoren und
haltens von Shuntwiderstnden zur Strommessung und Op- Messsysteme 2016, 224230, doi:10.5162/sensoren2016/3.4.4,
timierung von Fehlerkorrekturverfahren, Masterarbeit, Ruhr- 2016a.
Universitt Bochum, Bochum, 2016. Wekamp, P. and Melbert, J.: Supplementary dataset for Journal Ar-
Lohmann, N., Wekamp, P., Haumann, P., Melbert, J., and Musch, ticle High-accuracy current measurement with low-cost shunts
T.: Electrochemical impedance spectroscopy for lithium-ion by means of dynamic error correction [Data set], Zenodo, avail-
cells: Test equipment and procedures for aging and fast charac- able at: doi:10.5281/zenodo.164820, 2016b.
terization in time and frequency domain, J. Power Sources, 273, Wekamp, P., Haumann, P., and Melbert, J.: 600-A Test System
613623, doi:10.1016/j.jpowsour.2014.09.132, 2015. for Aging Analysis of Automotive Li-Ion Cells With High Reso-
Mrz, M. and Nance, P.: Thermal Modeling of Power- lution and Wide Bandwidth, IEEE T. Instrum. Meas., 65, 1651
electronic Systems, available at: http://www.iisb.fraunhofer.de/ 1660, doi:10.1109/TIM.2016.2534379, 2016.
content/dam/iisb2014/en/Documents/Research-Areas/Energy_ Ziegler, S., Woodward, R. C., Iu, H. H.-C., and Borle, L. J.: Cur-
Electronics/publications_patents_downloads/Publications/ rent Sensing Techniques: A Review, IEEE Sens. J., 9, 354376,
Therm_Modelling_2000_IISB.pdf (last access: 2 Novem- doi:10.1109/JSEN.2009.2013914, 2009a.
ber 2016), 2000. Ziegler, S., Woodward, R. C., Iu, H. H.-C., and Borle, L. J.: In-
Proakis, J. G. and Manolakis, D. G.: Digital signal processing, Pear- vestigation Into Static and Dynamic Performance of the Cop-
son Education, Upper Saddle River, NJ, 4th ed., 1084 pp., ISBN- per Trace Current Sense Method, IEEE Sens. J., 9, 782792,
10: 0-13-187374-1, 2007. doi:10.1109/JSEN.2009.2021803, 2009b.