High-accuracy current measurement with low-cost shunts by means of dynamic error correction

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 resistors 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 measurement 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 microcontrollers 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.


Introduction
Measurement of electrical current is important for many scientific and industrial applications.One example is the growing number of hybrid and electrical vehicles, which require precise on-board measurement of current in the range of several hundreds of ampere for tracking the state of charge (SoC) of the battery.In addition, preliminary testing of the automotive battery cells is necessary to determine the electrical behavior as a function of aging.
Suitable laboratory equipment for this task has even higher demands on the accuracy, bandwidth and noise of the current measurement.Frequencies of interest range from DC up to several tens of kilohertz.Sensor concepts for these applications include shunt resistors and current transducers based on the Hall effect or on the fluxgate measurement principle (Table 1).Although current transducers offer electrical isolation and negligible power losses, they are susceptible to magnetic stray fields and temperature-dependent offsets, require large operation currents, add additional noise from the control electronics and have limited measurement bandwidth, depending on the sensor type.Their complexity also significantly increases the total system cost (Ziegler et al., 2009a;Ripka, 2010).
Shunt resistors therefore represent a low-cost alternative, especially if electrical isolation is not required and isolation amplifiers can be avoided.This is the case for single-cell battery test equipment (Lohmann et al., 2015;Weßkamp et al., 2016).
The value of the shunt resistor has to be chosen with regard to signal dynamic range and power dissipation: the desired voltage drop across the shunt for applications with high measurement accuracy is typically in the range of several hundred mV in order to reduce influence of amplifier noise, to increase the effective resolution and to limit the thermoelectric effect.On the downside, the high currents used for automotive battery testing lead to significant power dissipation and self-heating of the shunt, resulting in a change in resistance described by the temperature coefficient α TK .Without compensation, this leads to increased measurement errors.
Straightforward solutions encompass application of resistances with very low temperature coefficients, better cooling concepts or oversizing in terms of maximum power ratings, all of which might reduce the thermal effects below an acceptable threshold.In any case, these methods typically lead to increased material and space requirements as well as higher cost.Direct compensation methods are an alternative approach and are known to improve the measurement accuracy: a temperature sensor measures the temperature of the shunt material and corrects the current measurement based on the known material characteristics (Ziegler et al., 2009b).
However, this direct approach is limited if there is a thermal resistance between the shunt material and the location of the temperature sensor, for example, if the resistance is enclosed in a package and the shunt material is not directly accessible.This is the case for nearly all available shunt resistors intended for heat-sink mounting.In this situation, the inner shunt temperature cannot be measured directly and is typically higher than the temperature at the heat-sink surface.For the thermal steady state, the inner temperature can still be calculated if the thermal resistance is known (Ziegler et al., 2009b).
Unfortunately, these static methods do not take into account the thermal capacitances of the materials along the path of the heat flow.As shown in the following sections, they lead to different dynamic behavior of shunt and sensor temperature and therefore induce time-dependent measurement errors.
In this paper a method is presented to overcome these challenges and to provide a dynamic error correction procedure.With this method it is possible to calculate the inner shunt temperature also during arbitrary thermal transients and to dynamically compensate for the temperature drift of a shunt resistor.The proposed algorithm has been optimized for real-time applications with low-cost microcontrollers and can also be used to increase the accuracy of existing current measurement systems.
This paper is an extended version of the previously published conference paper (Weßkamp and Melbert, 2016a) and includes an in-depth discussion of the practical implementation in an embedded system, including the derivation of the digital filter structure, a method to determine the correction parameters by an automated calibration sequence and statistical results obtained during operation of 100 distinct measurement systems.
2 Theory and principle of operation 2.1 Current measurement for test equipment for automotive lithium-ion cells For aging studies on automotive lithium-ion cells, specialized test equipment is necessary to cycle the cells with realistic currents and to measure small variations in the electrical behavior with high precision.Currents of up to 600 A with frequencies from DC up to the kilohertz range are typical (Weßkamp et al., 2016).Due to the low voltage range of a single battery cell, electrical isolation is not required and shunt resistors can be used for current measurement.Their low cost compared to other solutions is advantageous for building a large number of test systems; additionally, their wide bandwidth and inherent accuracy for low currents are also favorable (see Table 1).
The cell tester developed by our research group uses 12 10 m thick-film shunt resistors (TO-247 package) in parallel connection, mounted on a heat sink with water cooling.Electrical connection is accomplished by copper busbars.The overall resistance is approximately 1 m , taking the resistance of the interconnection into account.A temperature sensor allows the measurement of the surface temperature of the heat sink (Fig. 1).
For this application, the measurement error of the electrical current should be about 0.1 % for a wide current range up to 600 A in order to determine the capacity of lithium-ion cells by integration of the current flowing into the cell.

Shunt resistor: temperature coefficient
For low currents this maximum error can easily be accomplished by periodic linear calibration and measurement of the actual shunt resistance, which eliminates any static errors due to resistance tolerances and slow drift effects over time.
However, a linear calibration technique cannot compensate for the effect of the temperature coefficient of the shunt, which is determined to α TK = 422 ppm K −1 from the measurement in Fig. 2. For the maximum current of 600 A the power dissipation is 25 W per resistor.Although this is sufficiently below the respective absolute maximum rating of 100 W, the thermal resistance of the shunt and the heat sink lead to an inner temperature rise of 30 • C, equivalent to a resistance variation of 1.5 %.Without further compensation, the relative current measurement error has the same value and is an order of magnitude higher than desired.
In the shown configuration, the copper busbars and other interconnections also contribute a small part to the total shunt resistance (< 10 %) and to the overall temperature coeffi- cient.Because the temperature coefficient of copper is quite high (≈ 3900 ppm K −1 ), the additional resistance increases the total temperature coefficient to α TK ≈ 600 ppm K −1 .Temperature variation of the cooling water (or more generally of the ambient temperature) will also lead to a drift of the shunt resistance value, and has to be taken into account.

Nonlinear calibration for thermal steady state
The temperature dependence of the shunt resistance used in this work can be approximated with good concordance by a linear function, as demonstrated in Fig. 2, and is given by the equation Here, R 0 depicts the resistance value at the (arbitrary) temperature T 0 .Typically, R 0 is measured during calibration and T 0 is set by the temperature during this procedure.Two effects can lead to a temperature variation during operation: self-heating and ambient temperature change.
The ambient temperature rise is given by the difference between the present ambient temperature T amb and the calibration temperature T 0 : T amb = T amb − T 0 . (3) The self-heating is caused by the power dissipation P loss in the resistance material due to the electrical current I .The associated temperature rise for the thermal steady state is calculated using the total thermal resistance R th,total between the resistor and the environment: (5) The approximation R(T ) ≈ R 0 made in the last step of Eq. (5) simplifies the following calculation.It can be shown that the overall calibration error associated with this assumption is below 0.04 % and therefore can be disregarded.
The shunt is used for current sensing by measuring the voltage drop over the resistor: As demonstrated in Eq. ( 7), the relationship between voltage and current is expressed by a polynomial function of third degree, with a clear separation between effects due to selfheating (∝ I 3 ) and ambient temperature change (∝ I ).
During calibration, a reference current measurement is available and the parameters a 1 and a 3 are obtained by polynomial curve fitting of the measured voltage U shunt as a function of varying reference currents I ref in thermal steady state, as explained in Sect.3.2, and are used to calculate the model parameters α TK , R 0 and R th,total .
For the final application, solving Eq. ( 7) for the current I therefore allows nonlinear calibration of the current measurement in thermal steady state.

Heat flow and thermal modeling
The nonlinear calibration technique discussed in the previous section is only valid for the thermal steady state, i.e., when the inner shunt temperature is constant and does not change anymore.Obviously, this also implies a constant electrical current I and sufficient settling time after a current step, typically in the range of several minutes.However, realistic testing procedures for lithium-ion cells require much faster current transients.The static calibration approach therefore has to be extended by a dynamic thermal model for this application.
For the thermal analysis, a simplified shunt resistor setup with the following assumptions is used.
1.The 12 distributed shunt resistors are combined into 1 equivalent lumped shunt resistor.This is feasible if the electrical and thermal conditions are similar for all individual resistors, which holds true for this application.
2. The lumped shunt resistor is mounted on the surface of a metal heat sink with an internal water cooling pipe (cf.Fig. 1).The temperature sensor is also mounted on the heat-sink surface with some clearance to the lumped resistor.
3. The cooling water is considered to be an ideal heat sink with the invariant temperature T amb .
The simplified structure is a sufficiently accurate approximation of the actual shunt resistor setup.Unfortunately, exact (three-dimensional) thermal modeling is still complicated and requires the use of simulation and the finite element method.The resulting thermal model is of high complexity and cannot be analyzed in real time on an embedded system.More suitable for this application is a one-dimensional T sensor Thermal model for internal shunt temperature T shunt (optional) Thermal model for sensor temperature T sensor R th, 0 Thermal model used for calculation of the internal shunt temperature and the variation of the sensor temperature due to selfheating.
lumped element approach, consisting of a small number of thermal resistances and thermal capacitances.
The corresponding thermal model is given in Fig. 3 and was optimized empirically.The characteristics of the heat conduction are represented by an equivalent electrical circuit diagram, substituting temperature with voltage and heat flow with current (März and Nance, 2000).Therefore, well-known methods for electrical circuit analysis can also be applied for thermal analysis.
The upper half of Fig. 3 describes the inner shunt temperature T shunt .The total thermal resistance from Eq. ( 7) is split into four separate terms, so that R th,total = R th,0 +R th,1 + R th,2 + R th,3 , and thermal capacitances are added.They represent the dynamic behavior of the heat transfer through different materials between the inner shunt resistance and the heat sink.
The lower half of Fig. 3 describes the influence of the power dissipation P loss on the optional temperature sensor.Ideally, the sensor would directly measure the ambient temperature T amb , but usually some part of the heat generated by the shunt resistor is also coupled to the sensor, increasing T sensor .This impacts the measurement of the true ambient temperature and needs to be taken into account.
The chosen model structure (Foster network) simplifies the following calculations, but at the disadvantage of no direct physical equivalent of the lumped circuit elements, as explained in Bagnoli et al. (1998).The analysis of the circuit is best done in the frequency domain, using the complex-valued thermal impedance Z th (j ω) and the Fourier transform of the signals, e.g., T shunt (t) c s T shunt (j ω).For the upper circuit, the resulting equation is J. Sens. Sens. Syst., 5, 389-400, 2016 www.j-sens-sens-syst.net/5/389/2016/T shunt (j ω) = T amb (j ω) + P loss (j ω) R th,0 The dynamic effects of self-heating therefore are given by the sum of three independent low-pass filters with time constants τ i = R th,i C th,i and a time-invariant part due to R th,0 .Likewise, the transfer function for the sensor temperature is obtained as By using the approximation 8) is rewritten as The term inside the brackets describes the normalized dynamic behavior of the system and is denoted by whereas the term I 2 R 0 R th,total = T self−heating describes the steady-state temperature rise due to self-heating and has already been discussed in the previous section.The dynamic increase in the shunt temperature due to self-heating is therefore given by Similarly, the sensor temperature is described by

Dynamic error correction procedure
The static and dynamic knowledge of the system is used to develop a dynamic error correction procedure for the current measurement.First, Eq. ( 12) is transformed to the time domain using the impulse response h 1 (t) c s H 1 (j ω) of the dynamic system: Here the output of the dynamic thermal system is mathematically described by the convolution I 2 (t) * h 1 (t).Applying the results of Eq. ( 15) to the derivation of the static calibration approach (Eq.1-7) yields = a 1 I (t) + a 3 I 2 (t) * h 1 (t) I (t).( 16) Equation ( 16) is then solved for the unknown current I : On the right-hand side of Eq. ( 18) there are still two unknown quantities: the change in ambient temperature T amb and the current I 2 (t) itself, used as the input to the dynamic thermal model.The latter circular reference is resolved by approximating the current with the last known value, i.e., I 2 (t) ≈ I 2 (t − t).The error introduced by this approximation is small, because the thermal model consists of several low-pass filters whose time constants are significantly higher than the discrete time step (τ i t) and therefore smooth the behavior of I 2 (t) in any case.Additionally, an implementation using digital filter structures can be constructed to eliminate the need for the most recent value of the electrical current at all (see Sect. 2.6).
The change in the ambient temperature is given by Eq. (3), where T 0 denotes the temperature at which the calibration measurement was performed.Ideally, the ambient temperature could be measured directly by a temperature sensor yielding T amb = T sensor , but in our application the selfheating of the shunt resistor dynamically influences the sensor temperature, as shown in Fig. 3 and Eq. ( 9).Applying the same methodology as before, substituting Eq. ( 13) in Eq. (3) and transforming to the time domain yields where h 2 (t) c s H 2 (j ω).In this formula, the measured sensor temperature T sensor is corrected by the predicted temperature rise due to the power dissipated in the shunt resistor and is used as an estimation of the true ambient temperature.
A graphical illustration of the overall algorithm is given in Fig. 4.

Digital filter implementation
The correction algorithm is implemented on a digital processor for real-time application in an embedded system.The equations therefore are converted to discrete time steps with www.j-sens-sens-syst.net/5/389/2016/J. Sens. Sens. Syst., 5, 389-400, 2016 interval t, such that t = k t with k = 0, 1, 2, . ... In the following discussion, the short-form notation will be used for all time-varying quantities.
The dynamic system behavior given by the continuoustime convolutions h 1 (t) * I 2 (t) and h 2 (t) * I 2 (t) is transformed into a digital filter structure.This is accomplished by substituting the corresponding differential equations of the system by discrete-time difference equations using the forward difference (Rabiner and Gold, 1975): This is equivalent to the substitution j ω = (z − 1)/ t in the frequency domain, replacing the Fourier transform with the z transform.Equations ( 11) and ( 14) therefore become where y k c s Y (z) denotes the output of the respective digital filter.Due to linearity, the individual low-pass filters can be implemented independently of each other.Therefore it is sufficient to synthesize a digital filter for the underlying funda-mental transfer function Rewriting this equation and transforming to the time domain yields where the relationship y k−1 c s z −1 Y (z) was used.The difference equation (Eq.26) realizes the desired low-pass filter characteristic as a first-order IIR (infinite impulse response) filter and can easily be implemented on a microcontroller.It is stable if 0 < t < τ i , i.e., if the discrete time step is sufficiently small.The use of the forward difference (Eq.21) instead of the backward difference or the bilinear transform (Proakis and Manolakis, 2007) reduces the computation cost and ensures that at time k the value I 2 k is not needed in the filter calculation.
The fundamental filter structure is implemented four times in parallel (one for each RC element) and the weighted results are summed according to Eqs. ( 22) and ( 23) to implement the dynamic thermal behavior.

Discrete-time dynamic error correction procedure
The complete dynamic error correction procedure is defined by the algorithm in Table 2.It consists of five steps, which have to be executed for each time step k.
In the first step, the new states of the four digital low-pass filters are determined.They are used in the second step to calculate the dynamic self-heating effect I 2 filtered,k .This value is the discrete-time equivalent of the convolution h 1 (t) * I 2 (t).In step three, the fourth low-pass filter (R th,4 , τ 4 ) is used to eliminate the influence of heat generated by the shunt resistor on the temperature sensor and yields the true change in ambient temperature T amb .
Using these values, the calibration factor K and the calibrated current measurement I k are calculated from a measurement of the shunt-resistor voltage U shunt,k .Steps four and five have been separated, because the sampling frequency f s for the current measurement (I , U shunt ) may be chosen higher than the frequency for the thermal compensation algorithm f c = 1/ t.In this scenario, it is sufficient to update the correction factor K with the lower frequency f c .
The overall dynamic correction approach has been optimized for fast computation speed allowing real-time operation in a low-cost embedded system.
1.An efficient first-order low-pass filter bank with IIR (infinite impulse response) structure instead of higherorder FIR (finite impulse response) filters is used and Repeat for each time step k.
3. Calculate the ambient temperature change.
models the dynamic thermal behavior with sufficient accuracy.
2. An iterative approach to solve the nonlinear voltagecurrent relationship avoids complex and expensive math functions (like square roots), except a single division.
3. For each time step k, the algorithm requires only 11 additions, 16 multiplications and 1 division, as well as storage for 5 numeric values.By setting f s > f c , the computational impact of the correction algorithm can be reduced further.

Application and measurement results
In this section, the derived algorithm will be applied to the laboratory test equipment for automotive lithium-ion cells (see Sect. 2.1).First, an automated calibration sequence is discussed for obtaining the static and dynamic calibration parameters.The accuracy of the algorithm is evaluated for real-life testing profiles.A comparison of parameter variance between different test systems and a discussion of long-term parameter drift conclude the paper.

Automated calibration sequence
The parameters required by the static part of the error correction procedure are R 0 , T 0 , R th,total and α TK , whereas the dynamic behavior is described by R th,i /R th,total and τ i (i = 1, 2, 3).For the ambient temperature correction, additionally, R th,4 and τ 4 are needed.
The current profile given in Fig. 5 is used as the calibration excitation.It consists of rectangular current pulses with varying amplitudes at two different ambient temperatures T amb .
First, small-current amplitudes of up to 150 A are investigated with alternating directions of current.For these amplitudes, the self-heating effect is negligibly small and thermal steady state (with respect to the measurement resolution) is reached almost instantaneously.Additionally, the use of alternating current directions allows compensation for any offset errors in the measurement of the shunt voltage.
The nonlinear self-heating effect is evaluated by longer current pulses with amplitudes in the range 250 A . . .600 A. The pulse width is chosen sufficiently high to allow for settling of thermal effects.This investigation is repeated at two fixed ambient temperatures to determine the temperature coefficient of the shunt.
The sequence in Fig. 5 is applied to every test system by an automated calibration test bench and the voltage over the shunt resistor is measured.A reference value for the current is obtained using an external high-power precision shunt resistor with a temperature coefficient of only 1 ppm K −1 and a measurement uncertainty of 0.026 %, which is assumed not to be affected by thermal drift.The measured signals are evaluated using Matlab on a PC.

Static parameter estimation
The current-voltage relationship of the shunt resistor in thermal steady state is described by Eq. ( 7): For each calibration current pulse at T amb = 20 • C (Fig. 5), in Fig. 6 the shunt voltage at the end of the pulse is plotted in relation to the reference current.Using polynomial curve fitting tools on the resulting data set, the parameters a 1 and a 3 at T amb = 20 • C are determined.
The error between the polynomial fit and the measurement is depicted in the lower part of the figure.It is less than 20 mA over the full current range.The hypothetical error, if the effects due to self-heating were not included and a purely linear model was used, is also shown and exceeds 10 A. The same evaluation is also performed for T amb = 30 • C, yielding a second set of the coefficients a 1 and a 3 .
In Table 3 the determined coefficients from the polynomial curve fitting are given for the two ambient temperatures.As predicted by the theoretical approach in Eq. ( 7), the values of a 3 are nearly independent of the ambient temperature rise and describe only effects due to self-heating.From the varying values of a 1 the resistance R 0 = 0.8868 m (T 0 = 20.4• C) and the temperature coefficient α TK = 594 ppm K −1 can be determined.The overall thermal resistance is obtained from a 3 and equals R th,total = 0.10 K W −1 .
A similar approach is used to determine the thermal resistance R th,4 for the temperature sensor: at the end of each current pulse, thermal steady state is assumed and the rise in www.j-sens-sens-syst.net/5/389/2016/J. Sens. Sens. Syst., 5, 389-400, 2016 Table 3. Extracted parameters a 1 and a 3 using polynomial curve fitting for different ambient temperatures.the sensor temperature is derived from Eq. ( 13) as The measured temperature differences and a quadratic fit as a function of the current I are presented in Fig. 7. From the fit, the thermal resistance equals R th,4 = 0.021 K W −1 .

Dynamic parameter estimation
As discussed in Sect.2.4, the dynamic thermal behavior is fully characterized by the functions H 1 (j ω) and H 2 (j ω).
Both functions are a linear superposition of the fundamental first-order low-pass filter H (j ω).Its step response h step (t) in the time domain is given by   effects is therefore given by if the current as well as the ambient temperature are held constant during the pulse.This is the case for the current pulses in the calibration sequence in Fig. 5.The resulting voltage during one of the pulses is given in Fig. 8, where the voltage change due to the shunt resistance itself (= R 0 I ) is already subtracted and the values are normalized to the range 0. ..1.
The unknown parameters R th,i /R th,total and τ i are determined by nonlinear least-square curve fitting with the function given in Eq. ( 30).Note that U shunt (t → ∞) = a 3 I 3 .Because the factor a 3 is already known from the static calibration, it is sufficient to analyze the normalized behavior of U shunt , which is independent of the magnitude or starting point of the current step I .
The fit presented in Fig. 8 accurately models the dynamic effects.The resulting model parameters are given in Table 4, with time constants in the range of 0.5 to 120 s.
For the thermal model of the temperature sensor, a similar technique is used for parameter identification with the equation yielding the value for τ 4 = 48.6 s.

Measurement results
The performance of the proposed algorithm is demonstrated in Fig. 9 for a 600 A constant-current pulse.The new dy- Table 5. Arithmetic mean of the absolute value of the relative current measurement error calculated for the complete testing profile given in Fig. 10.

Statistical analysis of the calibration parameters and long-term drift
The dynamic error correction procedure discussed in this paper is currently in use for 100 test systems in a test center for aging analysis on automotive lithium-ion cells (Weßkamp et al., 2016).Each of the test systems has been calibrated with the sequence shown in Fig. 5; calibration parameters have been obtained individually and are used for optimal results.The maximum current deviation after calibration in thermal steady state for all test systems is shown in Fig. 11.It is well below 0.1 %, proving the accuracy of the proposed method.
The statistical distribution of the calibration parameters themselves is also evaluated and given in Fig. 12.Each parameter is approximated by a normal distribution, whose mean and variance are given in Table 6.
On the one hand, the nearly Gaussian distribution proves that there are no outliers due to errors during manufacturing, that all test systems behave similarly, and that the parameter estimation procedure works robustly.On the other hand, it allows one to determine whether a calibration on an individual basis is actually necessary, or whether it is sufficient to only measure a small number of shunt resistors and use the arithmetic mean of the parameters for error correction in all test systems.The maximum resulting current error for this case is given in the last column of Table 6.These values have been obtained through simulation with a rectangular current pulse of 600 A at an ambient temperature of 30 • C, using the respective arithmetic mean of the parameter instead of the true value.
The variation of the resistance R 0 has a large effect on the calibration accuracy and implies that (for this application) the resistance value has to be measured individually for each system, but for the other parameters the effect on the resulting current error is smaller.If an error of approximately 0.5 % was acceptable, the thermal calibration does not need to be executed for every test system, eliminating the long current pulses in Fig. 5 and reducing the calibration time from 85 to 14 min.
Other important aspects are the long-term parameter drift and the resulting current measurement error.The drift is caused by the aging of the shunt resistors and the thermal stress during normal operation and is corrected by repeated calibration.The parameter drift and the resulting current measurement error (at I = 600 A) for one tester between successive calibrations are given in Table 7. Between the two calibrations, the tester has been used for 1 year in an aging study on lithium-ion cells with a total charge throughput of 185 000 Ah.The overall steady-state current measurement error after 1 year is 0.165 %, which is acceptable for this application.In comparison, the drift of the shunt resistance R 0 is about 0.1 %, which is equal to the current measurement error for low currents.At higher currents, the error is dominated by the drift of the thermal resistance R th,total and the temperature coefficient α TK , although these effects cancel each other out in parts.In contrast, the drift of the dynamic behavior has a negligible impact.

Summary and conclusions
In this paper, a dynamic error compensation procedure is presented, which is able to correct the current measurement errors of shunt resistors due to self-heating and ambient temperature change.The method is based on a theoretical analysis of the shunt resistance variation due to temperature for thermal steady state.It is supplemented by a dynamic model describing transient thermal effects due to self-heating and heat transfer over a heat sink.A temperature sensor is used to measure the ambient temperature.The effect of the power dissipation in the shunt resistor on the measured ambient temperature is compensated for by a correction algorithm.
The proposed algorithm is used for current measurement in test equipment for automotive lithium-ion cells employing low-cost shunt resistors.It is able to reduce the current measurement error from over 2 % to less than 0.1 % for a 600 A current pulse.For a real-life, dynamic testing profile the mean current measurement error is reduced by 60 %.
The presented dynamic error correction procedure therefore enables precise current measurement with low-cost shunt resistors.The implementation as a discrete-time filter structure on a microcontroller with low demands on computation power is discussed in detail.An automated calibration sequence composed of rectangular current pulses is presented, by which all required parameters are determined individually for each shunt resistor.
A statistical analysis of the calibration parameters of 100 shunt resistors is performed, proving the robustness and accuracy of this approach.Drift effects over time have also been evaluated; the current measurement error after 1 year is still less than 0.2 %.
Due to low computational requirements the proposed algorithm can also be used to increase the accuracy of existing systems.Particularly, this is the case if the ambient temperature does not change or is already known, allowing the omission of the optional temperature sensor used in this application.

Data availability
The dataset used in this article is available at doi:10.5281/zenodo.164820(Weßkamp and Melbert, 2016b).

Figure 1 .Figure 2 .
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.

Figure 4 .
Figure 4. Overall dynamic correction algorithm, taking into account effects due to self-heating and ambient temperature change.

Figure 5 .Figure 6 .
Figure 5. Automated calibration sequence consisting of rectangular current pulses with varying amplitude at two ambient temperatures.

a 1 (Figure 7 .
Figure 7. Rise of the heat-sink temperature T sensor due to the power dissipated in the shunt resistor and fit to the quadratic model.

)Figure 8 .
Figure 8. Normalized change in shunt voltage due to self-heating after a current step.

Figure 9 .
Figure9.Relative current measurement error after a current step at t = 0 s from 0 to 600 A for different temperature compensation schemes.

Figure 10 .Figure 11 .
Figure 10.Realistic testing profile for lithium-ion cells (top: full profile; middle: excerpt) and associated relative current measurement errors (bottom).

Table 1 .
Comparison of current measurement techniques suitable from DC up to several tens of kilohertz.

Table 2 .
Algorithm: discrete-time dynamic error correction procedure.

Table 4 .
Extracted parameters for the dynamic thermal model due to self-heating by nonlinear least-square curve fitting.

Table 6 .
Arithmetic mean and variance of the calibration parameters for 100 test systems.The last column lists the maximum current error if the mean value instead of the actual value of the respective parameter was used for error correction.

Table 7 .
Parameter drift of a single shunt after operation for 1 year.