A New State of Charge Estimation Method for LiFePO4 Battery Packs Used in Robots

The accurate state of charge (SOC) estimation of the LiFePO4 battery packs used in robot applications is required for better battery life cycle, performance, reliability, and economic issues. In this paper, a new SOC estimation method, “Modified ECE + EKF”, is proposed. The method is the combination of the modified Equivalent Coulombic Efficiency (ECE) method and the Extended Kalman Filter (EKF) method. It is based on the zero-state hysteresis battery model, and adopts the EKF method to correct the initial value used in the Ah counting method. Experimental results show that the proposed technique is superior to the traditional techniques, such as ECE + EKF and ECE + Unscented Kalman Filter (UKF), and the accuracy of estimation is within 1%.


Introduction
In recent years, interest has increased significantly in the use of lithium ion (Li-ion) batteries for some applications, such as hybrid electric vehicles (HEVs), battery electric vehicles (BEVs), plug-in hybrid electric vehicles (PHEVs), and robotic systems.The features of light weight, high energy density, high galvanic potential, and long life cycle of Li-Ion are superior to either lead-acid or OPEN ACCESS nickel-metal hydride batteries, as their energy and power have been remarkably extended to achieve the high traction power and long lifetime required in these applications.In real-world use, accurate information of the state of charge (SOC) of a robot's battery packs is required for a good battery management system.
SOC is generally defined as the ratio of standard remaining capacity to the nominal capacity: ( ) ( ) ( ) where SOC(t) is the SOC at time instant t; SOC(t 0 ) is the initial value; C is the nominal capacity; and I(t) is the current at time t.The current is positive during the discharging process and negative during the charging process.In general, η = 1 for discharge and η < 1 for charge under standard conditions with a constant C/3 rate.As the current rate is usually quite variable in real situations, ECE (introduced in Section 2) has been developed to measure the energy loss.
According to the choice of battery model, the SOC estimation methods can be approximately categorized into three major types [9].The first type is the non-model-based coulomb counting method applied to many BEV/HEV BMSs and battery storage simulations.This online sampling approach is the straightforward application of Equation (1).The battery packs' current is measured constantly and used to update the SOC.If the current is measured accurately, implementation is inexpensive and reliable, though the method has several drawbacks [1].Firstly, it cannot determine the initial SOC.Secondly, it is difficult to measure coulombic efficiency correctly.Thirdly, the error is larger when the battery works at low or high temperatures.Finally, in practice, the open-loop algorithm often results in the accumulation of measurement errors due to uncertain disturbances.This means that regular recalibration is required, a difficult procedure to be implemented in the highly dynamic operations of the electrical system.To solve these problems, the Ah counting approach is combined with the Peukert equation [35] to calculate the coulombic efficiency.This quantity, however, is not only a function of current but is also affected by SOC and temperature.Therefore, the combination of the two approaches has not yielded a reliable result.
The second category of SOC estimation methods uses black-box battery models that describe the nonlinear relationship between the SOC and its influencing factors.Based on principles like ANN, fuzzy logic optimization, and SVM, these models are often established by computational intelligence-based approaches.Given an appropriate training data set, they can provide good SOC estimation through their abilities to approximate nonlinear function surfaces.However, there are two drawbacks.One is that the learning process imposes a heavy computational load, so most SOC estimation models of this type are used offline.The other is that good performance is achievable only if sufficient and reliable training data are available.Both these problems can lead to poor robustness under certain battery operating conditions.
The third category is based on Kalman filtering techniques using state-space battery models and is favored because it is closed loop (self-corrected), online, and offers a dynamic SOC estimation error range.This category is most suitable for real-time battery management and electrical system control.
In this paper, a new and highly precise SOC estimation method, called "Modified ECE + EKF" method, is proposed.It combines a modified ECE method, which considers self-discharge and the influence of temperature and SOC on the coulombic efficiency, with an EKF-based method that makes the approximate initial SOC value converge to its real value.In addition, a battery model suitable for real-time implementation is also proposed.It consists of two parts.The first is an adaptation of the "combined model," describing the relationship between OCV and SOC, that performs better than any one of the Shepherd, Unnewehr, or Nernst models [36].The second part is a zero-state hysteresis correction term.Based on a linear discrete-time model form, a least-square algorithm is used to estimate the parameters of the model.The proposed SOC estimation method will be demonstrated using two experimental tests.A comparison of algorithms among Modified ECE + EKF, ECE + EKF, and ECE + UKF show that the proposed SOC estimation method has better accuracy.
The remainder of this paper is organized as follows: the measurement and modification of the ECE method are introduced in Section 2, and a description of the structure and parameterization of the zero-state hysteresis battery model is given in Section 3. Section 4 presents the EKF-based SOC estimation algorithm, and Section 5 discusses two experiments to validate the proposed method and compare the method with the ECE + EKF and ECE + UKF estimation approaches.Section 6 shows an application in robots to justify the accuracy and robustness of the proposed algorithm.Finally, our conclusions are summarized in Section 7.

Equivalent Coulombic Efficiency (ECE)
The coulombic efficiency of battery packs is defined as the ratio of the discharged capacity to the capacity needed to be charged to the initial state before discharge and it can be calculated as: where I d is the discharging current; t d is the discharging time; I c is the charging current; and t c is the charging time.
The coulombic efficiency, shown in Equation (2), is the ratio of the discharging capacity to the charging capacity.It varies according to current rate, and hence an accurate SOC estimation depends on accurate calculation of both charge and discharge coulombic efficiency.

Calculation of the Equivalent Coulombic Efficiency
To calculate the charge and discharge coulombic efficiency of a robot's battery packs, the ECE measurement method [37] is adopted in this paper, and we use "2S8P × 4" LiFePO 4 battery packs as a test sample to calculate the ECE, as shown in Figure 1.Here, "2S8P × 4" indicates that each pack has four "2S8P" battery packs in series, each with a nominal capacity of 8.4 Ah.As the coulombic efficiency is different at different currents, the C/3 rate is used as the base current to define the base coulombic efficiency and the ECE when batteries are charged or discharged.The base coulombic efficiency can be calculated by Equation (3) after completing the following procedure: (1) Discharge at the C/3 rate until the terminal voltage limit is reached; (2) Charge at the C/3 rate until SOC = 1 and the charging capacity is Q CB ; (3) Rest the battery pack for 5 min until it is in the balanced state; (4) Discharge at the C/3 rate until the terminal voltage limit is reached.The discharging capacity is Q DB .
The base coulombic efficiency of LiFePO 4 battery packs can then be calculated as: However, in this paper, the equivalent charge coulombic efficiency of LiFePO 4 battery packs is calculated by Equation (4) after completing the following procedure: (1) Discharge at the C/3 rate until terminal voltage limit is reached; (2) Charge at several different currents The equivalent charge coulombic efficiency of LiFePO 4 battery packs can then be calculated as: ( ) In addition, the equivalent discharge coulombic efficiency of LiFePO 4 battery packs is calculated by Equation (5) after completing the following procedure: (1) Discharge at a specific current until the terminal voltage limit is reached; (2) Charge at the C/3 rate until SOC = 1.The discharging capacity is The equivalent discharge coulombic efficiency of LiFePO 4 battery packs can then be calculated as: Figure 2 shows the calculated equivalent charge and discharge coulombic efficiency of LiFePO 4 battery packs, and the base coulombic efficiency η C/3 = 0.9982.To calculate these results conveniently, a linear fitting method is used to fit the equivalent coulombic efficiency.

Current Rate Equivalent Coulombic Efficiency
Equivalent Charge Efficiency Linear Fitted Charge Efficiency Equivalent Discharge Efficiency Linear Fitted Discharge Efficiency

Modified ECE Method
The charging and discharging processes for different current rates can be converted into a single process for constant current.Let Q 0 be the initial capacity.Q CN is the charging capacity at current I CN ; where Q CN = I CN • t CN ; and t CN is the charging time; Q DN is the discharging capacity at current I DN ; where Q DN = I DN • t DN ; and t DN is the discharging time.The equivalent charging capacity Q C and its discharging capacity Q D are calculated by Equations ( 6) and ( 7), respectively: In the entire operating process of the battery packs, the practical consumed capacity Q T at room temperature under the actual discharge/charge rate is calculated by Equation (8).The baselines of each term in Equation ( 8) are all with C/3 rate: The coulombic efficiency in the low (capacity <12 Ah) and high (capacity >76 Ah) SOC ranges is smaller than that in the normal SOC range (SOC = 0.2-0.8).For electrical systems, the designed coulombic efficiency is usually between 0.94 and 0.98 in the normal SOC range [1].In this paper, the coefficient K S is defined to modify the influence of the SOC on the coulombic efficiency.In the normal SOC range, base coulombic efficiency does not vary significantly, so the value of K S is set to 0.98 in this paper.
Figure 3 shows the influence of temperature on coulombic efficiency.The battery pack is charged and discharged at the C/3 rate under different temperatures (45, 25, 0, and −10 °C), respectively [14].The test indicates that temperature influences the coulombic efficiency, and that the relationship between efficiency and temperature is non-linear, as shown in Table 1.In this paper, the coefficient K T is defined to modify the influence of temperature on coulombic efficiency.Any battery will lose energy through self-discharge, a phenomenon in which internal chemical reactions continuously reduce the stored charge, even when the battery is disconnected.When it is connected, its internal resistance also consumes energy.Both of these unavoidable losses of available energy must be taken into account when considering the charging-discharging process.Self-discharge decreases the shelf life of battery packs so that they are not fully charged on first use.The higher the environmental temperature is, the larger the self-discharge will be.It also affects the SOC estimation accuracy significantly.Self-discharge of LiFePO 4 battery packs is typically less than 3% per month, so the effect is very small for periods of a day or so.It becomes more significant for longer periods between charging, and can be the source of accumulating errors unless the battery monitoring circuit is regularly reset or calibrated.The self-discharge coefficient K SD is therefore set to 2 × 10 -8 in this paper.
If a battery is left to relax after charging or discharging, it takes some time for the terminal voltage to reach the new steady state value.This is called relaxation effect, and for low discharge/charge rates it can be mitigated to a certain extent through battery relaxation.Although the relaxation model's behavior is similar to the behavior of commercial batteries, there is considerable difficulty in its implementation, since the relaxation effect involves many physical and electrochemical properties of the battery [8].
To overcome these problems, a modified ECE method that considers self-discharge, influence of temperature and SOC on the coulombic efficiency (but not the relaxation effect) is proposed as follows: where Q SD is the self-discharge quantity of battery packs and Δt is the sample interval whose value is 1 second.The modified SOC is now defined as:

Battery Modeling
In this paper, the zero-state hysteresis [24,32,34] battery model is used as the battery packs model, which is often applied to the Kalman filter-based SOC estimation.Equations (11,12) represent the zero-state hysteresis model: where s is the SOC to be determined; i is the battery packs' current and is indicated positive under discharge and negative under charge; y is the battery packs' terminal voltage; Δt is the sample interval; and k is the time step index; R is the battery packs' internal resistance; The parameters w and v are independent and zero-mean Gaussian noises for the process and measurement, and their covariance values are Q w and R v , respectively; H is the hysteresis value; and h is a function of the sign of the current: where ε is a small positive value.In Equation ( 13), the first case is in the discharging process, the second case is in the charging process, and the final situation is in the rest mode.
The function OCV(s k ), the open-circuit voltage as a function of the SOC, can be calculated as: ( ) ( ) ( ) where K 0 , K 1 , K 2 , K 3 , and K 4 are the fitting coefficients chosen to make the model fit the data well.They are used to describe the battery packs' OCV.

EKF Algorithm Based on the Battery Model
For the non-linear battery packs model considered in this paper, the extended Kalman filter is combined with the modified ECE method to estimate the SOC of LiFePO 4 battery packs.The EKF is widely used in estimation problems, as it often works very well although it is not necessarily optimal.To apply the EKF, the non-linear battery packs model in Equations (11,12) are made linear by a first-order Taylor-series expansion, assuming that ( ) , f ⋅ ⋅ and ( ) , g ⋅ ⋅ are differentiable at all operating points (s k , i k ).The linear models are then obtained as Equations (15,16): ( ) where A k and C k are defined as: ( ) ( ) The discrete-time state function is given by applying Equations (9,10) into Equation ( 11): The combined discrete-time model based measurement function can be obtained by substituting Equation ( 14) into Equation ( 12): ( ) ( ) Based on the nonlinear discrete-time state-space battery packs model in Equations ( 19) and ( 20), the prediction and correction processes of the EKF combined with modified ECE method are described as follows: (1) Given an initial SOC estimate 0 ŝ , initial covariance matrix Cov 0 and noise parameters; (2) After sampling the terminal voltage y k and current i k of the battery packs for sampling time k = 1, 2, 3…, the calculation processes are iterated as follows: State (SOC) estimate update: Error covariance update: Kalman gain matrix calculation: where ˆk C is defined as: SOC estimate measurement update: ( ) Error covariance measurement update: ( ) (3) The prediction and correction processes repeat for every time step until the initial SOC estimation has converged to its real value.
The modified ECE + EKF algorithm realized with the prediction and correction processes is clearly shown in Figure 4 [2,32].

Time Update (Prediction)
Measurement Update (Correction) ( ) ( ) Compute the Kalman Gain : Correct the SOC with measurement : s s L y g s i Correct the error covariance with measurement : ˆ initial estimates for s and Cov  The MCF-60L2030A test equipment, supplied by Chen Tech Technology (CTT, New Taipei, Taiwan), provides flexibility for loading the battery, designed for 60 V maximum voltage, 20 A maximum charging current, and 30 A maximum discharging current.The recorded data include time, load current, terminal voltage, temperature, and accumulative Amp-hours (Ah), and Watt-hours (Wh).The sampling time and safety start/stop criteria can be defined separately.The CNB-1004A is a RS-232 to RS-485 conversion box.The measured voltage, current, and temperature are transmitted through the CNB-1004A to the LabVIEW-based virtual measurement unit.The errors of the voltage and current sensors are less than 0.02% and 0.03%, respectively.The ES-100A can collect the voltage of each cell in the battery and transmit it to the LabVIEW-based virtual measurement unit through the CNB-1004A, driven by the LabVIEW program.The experimental results of two case studies given below are used to verify the proposed method.The average temperatures of two experiments are listed in Table 2.

Experiment I: Under Fixed Constant-Current Pulse Conditions
We set up Experiment I to estimate the SOC of LiFePO 4 battery packs when the SOC state is correctly initialized to 100%.The experiments include seven discharges and six charges under fixed constant-current pulse conditions.The current and voltage profiles for Experiment I are shown in Figure 6a,b, respectively.The SOC value is an Ah counting method calculated by the LabVIEW-based virtual measurement unit, where accurate initial SOC is given and the coulombic efficiency is considered, as shown in Figure 6c.First, the battery pack is discharged at about 2.5C current (20 A in this case) for 6 minutes and data recorded at 1 second per point.The battery pack is then charged at about 2.5C current (−20 A in this case-in this paper, discharging current is taken as positive, charging current as negative) for 3 min and data recorded at 1 s per point.The cycle is repeated for 1 h.
In this paper, discharging current is taken as positive, charging current as negative, so Experiment I covers both discharging and charging processes.The general descending trend of battery voltage indicates that the test mainly discharges the battery.

Experiment II: Under Different Constant-current Pulse Test
In Experiment II, we set up two different current profiles to estimate the SOC of LiFePO 4 battery packs when the initial SOC is set to 0.5, as shown in Figure 7a,b, respectively.For each type of current profile, the battery pack is discharged or charged based on the constant-current pulse and rest sequences.The battery pack is discharged and charged from 20 A down to 2 A. The battery packs' terminal voltages decreased with the discharging, and increased with the charging current profiles.The terminal voltage profiles for Experiment II are shown in Figure 8a,b, respectively.The SOC profiles, calculated by the LabVIEW-based virtual measurement unit and based on the discharging and charging current profiles, are shown in Figure 9a,b, respectively.

Model Parameter Identification
Given a set of samples, including the current, the terminal voltage and experimental SOC values of the battery packs, the modeling parameters of the battery packs can be determined by using the least square method.The output equation of the battery model is represented by a regression model, as expressed by: ( ) ( ) ( ) ( ) where k i + and k i − denote the discharging and charging currents, respectively.During the discharging process (i k > 0), k i + is equal to i k and k i − is equal to 0. During the charging process (i k < 0), k i + is equal to 0 and k i − is equal to i k .Similarly; R + and R -are used to represent the internal resistance value under discharge and charge, respectively.For N number of observations, the output terminal voltage sequence, Y = [y 1 , y 2 ,…, y N ] T , can be written as: = Y Mθ (28) where M = [m 1 , m 2 ,…, m N ] T is repressor matrix.As a result, the parameters can be obtained from θ = (M T M) -1 M T Y for a nonsingular (M T M).To determine parameters, each observation in which the current is not zero is considered, because the zero-state hysteresis model cannot represent the slow variation of the time constant effect when the battery current is zero.The identified model parameters of the two experiments are given in Table 3.Four different estimation methods including the Equip method, the "ECE + EKF" method, the "ECE + UKF" method, and the "Modified ECE + EKF" method are used on the same battery packs for comparisons.The Equip method is measured by the MCF-60L2030A.The "ECE + EKF" method is the ECE method combined with the EKF method.The "ECE + UKF" method is the ECE method combined with the UKF method.The "Modified ECE + ECE" method is a modified ECE method combined with the EKF method.
The initial values of the EKF algorithm used for the state, the state error covariance, the process noise covariance, and the measurement noise covariance for both EKF and UKF algorithms are the same, as shown in Table 4. influence of the SOC on the coulombic efficiency 0.98 - In Experiment I, the comparison results for the terminal voltage estimation are shown in Figure 10a.Figure 10b, an enlargement of Part A of Figure 10a, shows that the proposed method accurately tracks the real terminal voltage value with an estimation error of less than ±0.1 V in comparison with the other algorithms.
In Experiment II, the results comparing the models of the discharge and charge of the battery pack voltage estimation with the true voltage for the pulsed-current test using those parameters are shown in Figure 11a,b, respectively.From the enlarged view of Figure 11a,b, we can see that the proposed method produces better results than those of other two methods.The results also show that the battery model can represent the battery packs' terminal voltages with respect to discharging and charging currents (with the exception of the relaxation effect in all methods).

SOC Estimation Results
The battery pack SOC is estimated from experimental data and from four estimation methods.In Experiment I, the estimation error starts at zero, since the model is correctly initialized in all estimation methods.The comparison results for the SOC estimation are shown in Figure 12a.In Figure 12b, the associated SOC estimation errors are shown to converge to a ±1% error band.The figure also shows that the SOC error of the proposed algorithm can converge closely to zero during discharging.We can adjust the self-discharge coefficient so that the SOC errors converge closely to zero in all intervals, as shown in Figure 13.In Figure 13, the divergence of SOC estimation error is mainly caused by the LabVIEW-based virtual measurement unit.It has 3 second delay when the state makes transitions (Discharge-to-Charge or Charge-to-Discharge).The mean absolute error (MAE) of the SOC estimation is calculated using the following equation: where s MAE,N is the MAE for the SOC estimates up to and including time step N and s j is the experimental SOC at time step j.

Time (hr) SOC Error (%) ECE + EKF Method ECE + UKF Method Modified ECE + EKF Method
To make them more readable, the results for the MAE of SOC are shown in Figure 12c.It is clear that the proposed algorithm can estimate the battery pack SOC more accurately, compared to the other two algorithms.The advantages of UKF over EKF are that it captures the true mean and covariance more accurately and no need to calculate the Jacobian.It can be shown that the UKF algorithm can give better performance than the EKF algorithm.
In Experiment II, the initial SOC value is set to 0.5 in all estimation methods, so the estimation error starts at ±50% under charge/discharge.This explains why the SOC estimation error is not initially zero in the discharging/charging process of Experiment II.
The comparison results for the SOC estimation under discharge in Experiment II are shown in Figure 14.The associated estimation errors under discharge are shown in Figure 15.It is obvious that the estimation errors of the proposed method under discharge are much smaller than those of other two algorithms.The SOC error of the proposed method converges to 0.16%, while those of other methods are greater than 1%.    Figure 16 shows a comparison of SOC estimations under charge; the SOC error of the proposed method converges to 0.24%, while those of other methods can reach 1%, as shown in Figure 17.Clearly, the proposed SOC estimator has better performance.Figure 18a,b shows the MAE results under discharge and charge in Experiment II, respectively.The figures show that the proposed method gives a smaller MAE than either of other two methods does.

Application in Robots
This section demonstrates that a humanoid robot, called Nino, which is being developed by our laboratory performs the model identification and the SOC estimation by considering the proposed algorithm discussed in Section 2 and Section 3. A photograph of the humanoid robot is shown in Figure 19.The humanoid robot has DOFs in its head and hands to achieve facial expressions and grasping motions.In this experiment, we test the proposed algorithm performance while the humanoid robot is set to wave the right and left arms and repeat to run two processes.The current and voltage profiles for this experiment are shown in Figure 20a,b, respectively.The motors of the humanoid robot are turned on at 46 s.The regions squared in blue dotted line and green solid line in Figure 20b show that the humanoid robot is waving the right and left arms in round 1 and round 2, respectively.The comparison results for the terminal voltage and voltage error are shown in Figure 21a,b, respectively.From these figures, we can see that the proposed algorithm accurately tracks the real terminal voltage value with an estimation error of less than ±0.05 V except impulses in comparison with the other algorithms.The initial SOC state is set to 0.8.The comparison results for SOC estimation in this experiment are shown in Figure 22a.In Figure 22b, the associated SOC estimation errors in this experiment are shown to converge to a ±0.015% error band.The experimental results show that the SOC estimation results of the proposed algorithm are more accurate and robust than those of other two methods.In addition, we can see that the SOC error graph is similar in shape to the current graph shown in Figure 20a.In this experiment, the average temperature is 25.26 °C when the test begins and 25.23 °C when the test ends.Table 5 summarizes the experimental results of the proposed SOC estimation method in comparison with other SOC estimation algorithms reported in [1,5,10,24,31,32,34,36].The SOC estimation algorithms in [5,10,32] are off-line results.The SOC estimation error of the proposed method is comparable to [31] but smaller than the remaining methods already presented in the literature.Moreover, from Table 5, it can be noted that the proposed method has the smallest voltage estimation error.Furthermore, the proposed method also considers the hysteresis effect, temperature effect, and self-discharge effect.

Figure 2 .
Figure 2. Equivalent charge and discharge coulombic efficiency of LiFePO 4 battery packs.

Figure 3 .
Figure 3.The influence of temperature on coulombic efficiency.
Battery pack tests are performed to identify the model parameters.As shown in Figure 5, the experimental setup consists of a power battery production equipment set (MCF-60L2030A), a scanner box (ES-100A), two communication conversion boxes (CNB-1004A) and a LabVIEW-based virtual measurement unit.

Figure 5 .
Figure 5. Schematic diagram of the battery pack test bench.

Figure 10 .
Figure 10.Modeling results in Experiment I. (a) Terminal voltage; (b) The enlarged Part A of Figure 10a. 0

Figure 13 .
Figure13.SOC estimation error in Experiment I when the K SD, charge and K SD, discharge are set to 1.97 × 10 -7 and 6.09 × 10 -8 , respectively.

Figure 14 .
Figure 14.SOC estimation under discharge in Experiment II.

Figure 15 .
Figure 15.SOC estimation error under discharge in Experiment II.

Figure 21 .Figure 22 .
Figure 21.Modeling results in the humanoid robot test (a) Voltage profile; (b) Voltage error profile.

Table 1 .
The relationship between efficiency and temperature.

Table 2 .
The average temperature of the two experiments.

Table 3 .
Modeling result of battery parameters.

Table 4 .
Initial values of SOC estimation.

Table 5 .
Comparison with SOC Estimation Algorithm in the literature.