Robust and Efficient Capacity Estimation Using Data-Driven Metamodel Applicable to Battery Management System of Electric Vehicles

For safe and reliable use of the battery for electric vehicles, diagnosis of its state-of-health (SOH) is essential. This is achieved by battery management systems (BMSs) that can monitor changes in the present capacity of the battery. Considering their limited computational resources, an efficient scheme is necessary. The data-driven metamodel is therefore used instead of complex battery models, which can simply capture changes in the shape of the charge curve as a battery ages. In consequence of the model reformulation, the charge curve refers to the time elapsed for charging against voltage. Under constant current charging, using time instead of capacity is favorable for computationally inexpensive BMSs. The aging-relevant parameter in the metamodel is estimated in the least-squares sense. In practice, this is often difficult as the shape of the charge curve, mostly its early part, is distorted by varying battery conditions before charging. For tolerating this distortion, a robust scheme is also required. The weighted least-squares is thus used such that the early part is given less weights whereas the later part is given more weights. The BMS-integrated metamodel and its parameter estimator are validated by using batteries with different SOH, which concludes an estimation error less than 3%. © The Author(s) 2016. Published by ECS. This is an open access article distributed under the terms of the Creative Commons Attribution 4.0 License (CC BY, http://creativecommons.org/licenses/by/4.0/), which permits unrestricted reuse of the work in any medium, provided the original work is properly cited. [DOI: 10.1149/2.0841606jes] All rights reserved.

The California zero-emission vehicle (ZEV) regulation 1 was first adopted as part of the 1990 low-emission vehicle (LEV) program in the U.S., which has the aim of lowering greenhouse gas emissions and reducing petroleum consumption. The regulation is based on a credit scheme that provides automakers with credits for each ZEV they sell in California. The latest revision 1 was made to the regulation in 2012 and it will come into effect in 2018 and be in effect through 2025. According to the revised regulation, the credits earned per ZEV type will change. The credits for hybrid electric vehicles (HEVs) will become less and less and finally disappear by 2018. In contrast, the credits for battery electric vehicles (BEVs) will grow gradually. In addition, the longer range the BEVs can offer, the more credits they will receive. The revised regulation will apply to all automakers who annually sell more than 20,000 vehicles in California. If they fail to comply with the revised regulation, a $5,000 penalty per credit will be imposed. In this background, automakers that come under the revised regulation are expected to roll out ZEVs that can compete with internal combustion engine vehicles in the market. Here, ZEVs specifically involve BEVs and fuel cell electric vehicles (FCEVs). However, only the long-range BEVs are currently considered realistic and achievable in light of technology readiness and marketability.
The long-range BEVs require batteries with high energy density. To use light-duty electric vehicles as an example, a range of more than 100 miles on a single charge could be realized with the battery pack energy density exceeding about 100 Wh/kg, which entails the battery cell energy density over 250 Wh/kg. As of now, a lithiumion battery (LIB) is the most applicable battery type that can cater for such a high energy density. Basically, LIBs have greater energy and/or power densities. In return for that, LIBs are relatively more expensive and less safe. The higher energy density the LIB pack has, the less safe it could potentially be. Therefore, battery management systems (BMSs) are of greater importance to such energy-dense batteries in ensuring the safe and reliable operation of the LIB pack.
A BMS is an electronic device that consists of hardware and software for battery management, primarily including algorithms for identifying battery states. Battery states of interest to the BMS are, for example, state-of-charge (SOC), state-of-health (SOH) and resistance. The SOC generally denotes the residual capacity with respect to the present capacity. In the beginning of battery life, the present capacity is very close to the nominal capacity. However, over battery life, the present capacity is subject to decay due to battery aging such that the z E-mail: wookslee@kau.ac.kr SOC could not retain accuracy. Inaccurate SOC will quickly result in the battery abuse and/or underuse. The abuse could undermine the safety and also durability of a battery. The underuse could rob a BEV of its performance, specifically, the range on a single charge. This would cause or worsen range anxiety that BEV drivers usually have. This pitfall can be avoided by another battery state called SOH. Although it can be defined differently, at least for BEVs, the SOH refers to the present capacity with respect to the nominal capacity. By estimating and updating the present capacity (i.e. SOH), the SOC could maintain reliability over battery life. In addition, the SOH estimation enables onboard monitoring of replacement time of a battery. In this regard, the SOC meter, as a replacement for a fuel gauge, goes along with the SOH meter. To use Nissan Leaf as an example, 2 its dashboard has these two meters next to each other, as depicted in Figure 1. The SOC meter is specifically called as the battery's available charge gauge while the SOH meter is referred to as the battery's available capacity gauge. The level of the SOC meter rises by charging while dropping by discharging. However, the level of the SOH meter always falls since battery aging is basically irreversible, regardless of its mechanism in detail. The BMS for BEVs is required to responsibly estimate both SOC and SOH.
Although there are various methods for capacity estimation, most of them can be grouped into one of the two broad categories: openloop [3][4][5][6] and closed-loop 7-15 methods. Systems in which the output has no effect upon the input are used for open-loop methods. In contrast, systems in which the output has effects upon the input in such a way as to maintain a desired output are used for closed-loop methods. It is noted that open-loop methods only use their system model to generate the output. Therefore, the quality of open-loop methods depends entirely upon the accuracy of their system model, which is SOC meter SOH meter distance to empty   Figure 2b). The closed-loop battery model is usually electrical or electrochemical, whose input is the aging-relevant parameter. This parameter is fed back from the parameter estimator. The parameter estimator minimizes the sum of squared errors between the measured and estimated voltages. By adjusting the value of the parameter, the parameter estimator reduces the sum of squared errors until they are no longer significantly reduced. In sum, by using the measured voltage as a desired output, the closed-loop battery model is capable of predicting the present capacity, irrespective of real-world conditions that a battery undergoes. As a downside, closed-loop methods require much more computational resources than open-loop methods do. This mainly arises from the electrical or electrochemical battery models employed with their parameter estimator. This is considered a challenge of closed-loop methods, particularly considering their implementation into a computationally inexpensive BMS. Accordingly, this paper proposes an efficient and robust closedloop capacity estimation scheme (see Figure 3). Considering its implementation into computationally light BMSs, the data-driven metamodel 16 is applied as a battery model. The metamodel built in this work is a simple mathematical function representing changes in the shape of the charge curve in relation to the capacity loss. The datadriven model might not be reliable because it does not include various operational factors as a model input. Here, they can be, for example, the SOC and temperature before battery charging, which could affect the capacity estimation. To overcome this difficulty, the influence of such operational factors is first investigated by the cell tests. Based on the test results, the metamodel and its parameter estimator are developed. The proposed capacity estimation scheme is expected to be efficient enough for computationally light BMSs and also robust enough to tolerate various real-world conditions that a battery undergoes.
Specifically, the proposed scheme estimates the capacity by comparing the model and the data which is the time elapsed for charging.  As shown in Figure 3, the shape of the charge curve changes as a battery ages, which can be used as the SOH indicator. Here, the capacity estimation is designed to perform during constant current charging that is a typical way when BEVs are refueled. Besides, by using constant current charging, one major operational factor (i.e. current) that affects the shape of the charge curve can be ruled out. In the usual charge curve, the x-axis is capacity which requires current integration over time. The current integration using a computationally light BMS might cause a significant error in the shape of the charge curve primarily due to an inaccurate current measurement. For this, the xaxis of the charge curve is modified as the time elapsed for charging. This reformulation is available taking advantage of constant current charging in a vehicle-to-grid scenario. The metamodel 16 is built in the cell-level. The metamodel, in the form of a third-degree polynomial, efficiently represents changes in the shape of the charge curve in relation to the capacity loss. It is noted again that the output of the metamodel is the time required for crossing the predetermined fixed voltage range while the input is the aging-related parameter, that is, the normalized capacity, as can be seen in Figure 3. The shape of the charge curve of the battery for BEVs will be distorted by operational factors such as the duty cycle during discharging, rest time, the SOC prior to charging, and temperature. To investigate the effect of these distorting factors, the cell tests that mimic the real-world conditions are performed using the design of experiment. 17 For the parameter estimation robust enough to tolerate the distorted charge curve, the weighted least-squares (WLS) method is proposed as a parameter estimator. The WLS enables us to apply different weights onto each of the data points on the charge curve, which are not equally reliable for the capacity estimation. In this work, the early part of the charge curve is given less weights whereas the later part is given more weights. The effectiveness of the WLS is validated by comparing with the estimation results from the ordinary least-squares method. As the final step, the proposed capacity estimation scheme is implemented into the BMS and then validated in the pack-level.

Cell-Level Proof-of-Concept
As mentioned, in order to estimate the present capacity, we make use of changes in the shape of the charge curve as a battery ages. This scheme is suitable for a computationally light BMS in that it does not require a complex battery model. Also, this scheme is adequate to the BMS for BEVs in that it uses constant current charging in a vehicle-to-grid scenario. With this regard, this chapter first provides an overview of BEV charging. Based on that, cell tests are carried out Charging options.-Today, charging BEVs takes several forms in terms of the power level (up to 90 kW), current type (AC/DC), and plug type (the Japanese CHAdeMO, U.S./European CCS, etc.). In fact, the power level mostly determines all others. The power level of chargers ranges widely, from 3.3 kW (normal charging) to 90 kW (quick charging). Lower power levels are typically in service with an AC-to-DC converter equipped with BEVs, called an on-board charger. Lower power levels take several hours to fully charge a battery. For instance, chargers of 3.6 kW and 6.6 kW can charge Kia Soul EV (27 kWh battery size) in about 8 and 4 hours respectively. At the other end of the power level, chargers of 50 kW and even 90 kW are available which is not common, though. Higher power levels can shorten charging time significantly. Chargers of 50 kW can charge Kia Soul EV in less than 30 minutes, which should depend on the in-situ conditions related to the battery, though. According to current status of BEV charging, we determine the power level and thus the current ratings to be applied to the following cell tests. This helps the charging data obtained from the cell tests simulate the actual charging behavior of BEV owners. Following the initial formation cycles, the cells are cycled at 45 • C. In each cycle, the cells are charged at a 2C-rate until the voltage reaches an end-of-charge voltage of 4.08 V. The cells are immediately discharged at the same rate down to a cut-off voltage of 2.5 V. During cycling, such a high current is applied across a broad SOC range and at a high temperature, leading to the significant acceleration of battery degradation.
For a periodic assessment of battery degradation, at the end of every 500 cycles, the cells are tested in the way described below. To begin with, the cells are stored at 25 • C. Then, the cells are charged at a 1C-rate until the voltage reaches an end-of-charge voltage of 4.2 V followed by constant voltage charging at 4.2 V until the current tapers down to 1 A. After resting for an hour, the cells are discharged at the same rate down to a cut-off voltage of 2.5 V.
Based on the present capacity measured as above, the cells are charged at different current ratings, which ranges from 0.2C (normal charging) to 2C (quick charging), in order to obtain variations in the shape of the charge curve with respect to the power level of chargers. This test is repeated seven times over a total of 3000 cycles, resulting in a 29% loss in capacity that is 1% shy of the end-of-life capacity of the battery for BEVs (see Figure 4a). As the cycle number increases, it is observed that the charge curve monotonically shifts toward the upper left, which is an indicative of the capacity loss (see Figure 4b).
Validation.-The test results obtained as above can be referred to as training data in that they are used to find a relationship. Based on a relationship discovered by the cell training data, the pack data are used for evaluating whether the discovered relationship generally holds. In order to compare with the cell training data, two different pack tests are performed; one is done under specific conditions (pack training data), which are technically identical to the prior cell tests; the other is done under real-world conditions (pack test data). The used pack consists of 12 modules and each module contains eight cells, a total of 96 cells so that the total energy is about 28 kWh.  For this comparison, the cell is fresh and the pack is made up of the fresh cell. Thus, it is expected that the shapes of their charge curves does not significantly differ. As can be seen in Figure 5, the charge curves of the cell training data and the pack training data are almost matched. This indicates that the inherent charging characteristics of the cell does not change even after it forms the pack. However, the charge curve of the pack test data is quite different with that of the cell or pack training data although their present capacity is almost identical. This is presumably because of contributing factors other than the present capacity, which undesirably affects the shape of the 3  charge curve. This assumption is backed by the fact that the pack test data is acquired while operational factors during or before charging are not under control. With this problem in mind, in the next chapter, it is worth thinking about a robust scheme that can tolerate this unwanted changes in the shape of the charge curve.

Pack-Level Implementation
To restate, in order to estimate the present capacity, we exploit changes in the shape of the charge curve as a battery ages. For this, the present capacity is desired to be the only contributing factor to consider. However, the prior comparison implies that factors other than the present capacity also affect the shape of the charge curve. In this regard, we first clarify all other contributing factors to the shape of the charge curve. Now, it is expected that in real-world conditions the shape of the charge curve is subject to deform. Nevertheless, the deformed charge curve should be treated well such that the present capacity could be responsibly estimated. To this end, we reformulate the metamodel. As its parameter estimator, we employ the WLS. The reformulated metamodel is then validated against the pack test data.
Design of experiments.-Considering the charging behavior of BEV owners, we select possible contributing factors to the shape of the charge curve, which includes the duty cycle, rest time, SOC and temperature (see Figure 6).
The duty cycle is related to charge/discharge rates. The duty cycle performed before charging could influence the shape of the charge curve. This is mainly because the charge/discharge rates during the duty cycle affect the overpotential. The overpotential is the degree of polarization which refers to the deviation of the terminal voltage from the open circuit potential (OCP) with the passage of current. Considering the driving behavior of BEV users, two different duty cycles are employed here. The FTP-75 represents the stop-and-go city driving while the US06 reflects the aggressive highway driving. While cycling, the latter would thus lead to larger negative overpotential than the former. Quite the opposite, as charging starts after cycling, the latter would generate smaller positive overpotential compared to the former (see Figure 7c). It is noted that a negative overpotential indicates the terminal voltage below the OCP. A positive overpotential goes the opposite way around. In this fashion, the duty cycle performed before charging has an impact upon the shape of the charge curve.
The rest time denotes relaxation periods. In addition to the duty cycle, the shape of the charge curve could be also affected by the relaxation periods in-between the duty cycle and charging. The relaxation periods, the duration of zero current condition, provide a battery with time to relax the gradients of lithium(-ion) concentration and electric potential which are built up with the passage of current. Due to relaxation, lithium(-ion) diffuses from higher to lower concentration regions inside a battery. Considering the charging behavior of BEV users, a variety of the relaxation periods after the duty cycle are applied, from ten seconds to 30 minutes. As charging begins after the rest time, the longer the relaxation periods is provided, the larger the positive overpotential would arise (see Figure 7b). This is primarily because the negative overpotential built up during the duty cycle is relaxed within the rest time. The rest time spent prior to charging exerts an influence on the shape of the charge curve in this way.
Also, the SOC before charging should affect the shape of the charge curve. To restate, the SOC denotes the residual capacity with respect to the present capacity. Here, the charge curve is displayed in the form of voltage (y-axis) against capacity (x-axis). The shape of the charge curve varies in relation to the SOC prior to charging. That is, the start point of the charge curve is set by the residual capacity (x-axis) and start-of-charge voltage (y-axis). Meanwhile, the end point of the charge curve is not determined by the residual capacity. Rather, the end point of the charge curve is determined by the present capacity (x-axis) and end-of-charge voltage (y-axis). This can be seen in Figure 7a. In this connection, the SOC before charging acts upon the shape of the charge curve.
The temperature before charging should affect the shape of the charge curve. To put it simply, low temperatures induce high internal resistance, which leads the voltage to collapse while discharging. In the opposite way around, low temperatures cause the voltage to rise while charging (see Figure 7d). The greater the voltage developed at low temperatures, the earlier it reaches the end-of-charge voltage, which leads to a decrease in capacity. Unlike other factors depicted as above, in fact, the temperature is not totally independent. Only the ambient temperature is controllable; however, the battery temperature before charging is influenced by other factors such as the duty cycle and rest time. For example, the duty cycle with the high charge/discharge rates would result in the high battery temperature. The rest time followed by the duty cycle allows a battery to dissipate heat built up with the passage of current, as it relaxes the gradients of lithium(-ion) concentration and electric potential. Therefore, the long rest time would result in the low battery temperature, if the ambient temperature is cooler than the battery temperature.
Using design of experiments, it is turned out that all four factors under suspicion are contributing to changes in the shape of the charge curve. Among them, the SOC prior to charging is seen to be the most influential. However, it is comforting that, except the temperature, only the early part of the charge curve is deformed by changes in the duty cycle, rest time and SOC prior to charging. That is, their influence is diminished by time. With this in mind, the metamodel and its parameter estimator are built.
Metamodeling.-Very often, it is too difficult to build a model in full knowledge of the system's internal principle. As a typical electrochemical system, batteries come under this. It is agreeable that a model that could best describe the internal principle of a battery is an electrochemical model. However, in practice, an electrochemical model cannot capture all of the behaviors of a battery, which is susceptible to its operational factors such as the current, temperature, SOC and SOH. As an alternative, we simply capture battery behavior by means of a data-driven model. A data-driven model is built based on a relationship between the input and output data without knowing the system's internal principle.
In this work, in order to estimate the present capacity, we exploit changes in the shape of the charge curve with respect to the capacity loss. For the mathematical characterization, the response surface method (RSM) is employed, which results in a metamodel. The RSM can help approximate this complex relationship with simplified and explicit functions. The main idea of RSM is to use a sequence of designed experiments to obtain an optimal response surface. The general procedure of RSM is as follows.  variables, the form of the approximated function is defined. Finally, the coefficients of the approximated function are determined in the least-squares sense. More detailed explanation about RSM can be found in Ref. 17.
Here, the charge curve is in the form of voltage against capacity. It is noted that capacity is proportional to the time required for charging with a constant current. In this connection, the voltage is determined to be the output function whereas the normalized capacity is set as the only input variable of the metamodel. The present capacity is normalized to a nominal capacity of 42 Ah; for instance, the input variable is valued at 0.7 when the present capacity is 29.4 Ah. The original response data are obtained from cell testing, which is the voltage V ki in response to the normalized capacity c i (i = 1 ∼ m) and time t k (k = 1 ∼ n). The interval of t k is approximately 41.86 seconds that is equivalent to the time elapsed for charging 1 Ah at a 2C-rate (n = 29). The number of c i is 7, with the lower and upper bounds, c 1 and c 7 , being 1 and 0.7 respectively, considering the end-of-life capacity of the battery for BEVs (m = 7). In Figure 8 monotonically with respect to the normalized capacity. Therefore, a simple polynomial can be introduced as the output function that is able to approximate the output voltage in response to the normalized capacity at each time. By trial and error, the order of polynomial is determined to be third-degree. In conclusion, the shape of the charge curve at time t k can be parameterized in the approximated form as: a kp c p = a k0 + a k1 c + a k2 c 2 + a k3 c 3 [1] In the above equation, the coefficients a kp at time t k are calculated to match with the original response data, using the least-squares method. Because the polynomial function is linear with respect to the coefficients a kp , a typical linear regression algorithm can be used, in which the m-by-4 matrix X is defined as: Then, the 4-by-n matrix a can be obtained as: a 10 a 20 · · · a n0 a 11 a 21 · · · a n1 a 12 a 22 · · · a n2 a 13 a 23 · · · a n3 ⎤ ⎥ ⎥ ⎥ ⎦ = X T X −1 X T y [3] where y denotes the m-by-n matrix made up of the voltage V ki with respect to the normalized capacity c i (i = 1∼m) and time t k (k = 1∼n): The constructed metamodel is validated against the cell training data. The training data refer to the cell-level battery charging at a 1.45C-rate that is equivalent to 50 kW quick-charging. The validation results are shown in Figure 9, which demonstrate that the metamodel based on a third-degree polynomial is good enough to capture variations in the shape of the charge curve with respect to the capacity loss up to nearly 30%. To evaluate the accuracy of the metamodel, the estimation error is calculated. At each cycle i, the relative error e i is defined as: where V ki * and V ki are the estimated and measured voltages at time t k (k = 1 ∼ n) and i th cycle number respectively. The relative error is calculated at cycles 500, 1000, 1500, 2000, 2500 and 3000 for each time, resulting in the average less than 0.05% with the maximum about 0.15%.
Model reformulation.-The metamodel built as above represents changes in the shape of the charge curve with respect to the present capacity, which is denoted by voltage (y-axis) as a function of capacity (x-axis). Along with x-axis, the start point of the charge curve is evaluated as: the residual capacity before charging = SOC × SOH × nominal capacity. This can be simply understood in that the SOH denotes the normalized capacity and by multiplying with the nominal capacity, it refers to the present capacity. The SOC and SOH are estimated and updated by a BMS while the nameplate capacity is predetermined by a cell manufacturer. Provided that the SOC before charging is 15%, the SOH estimated from the previous charging is 85%, and the nameplate capacity is 42 Ah then the start point of the charge curve is set at 5.36 Ah. Based on this, changes in the shape of the charge curve are plotted again (see Figure 10). In this plot, the SOC before charging ranges from 10% to 40%. For computational efficiency, the metamodel is built with one single input variable: the normalized capacity. Thus, the SOC before charging is not allowed to be another input variable; instead, it is fixed to be 40%. This is backed by the internal surveys about the actual charging behavior of BEV owners, which conclude that they start to feel range anxiety and search for nearby charging stations when the SOC gauge drops to 40%. However, this does not mean that the metamodel cannot serve when the SOC before charging is other than 40%. In fact, all partial charging data are applicable to the metamodel, only if battery charging begins at less than 40% SOC. This is because the charging data that start at greater than 40% SOC might be insufficient to display changes in the shape of the charge curve as a battery ages.
Again, the charge curve for building the metamodel is in the form of voltage (y-axis) with respect to capacity (x-axis). This means that in order to describe the shape of the charge curve, the BMS is required for current integration over time.  Figure 10. Changes in the shape of the charge curve with respect to the SOH and the SOC before charging. The start point of the charge curve is determined by multiplying the SOH, the SOC before charging and the nominal capacity together. Among contributing factors to the shape of the charge curve, SOC is found the most influential. It is noted that the cells are charged at a 1.45C-rate which is equivalent to 50 kW quick charging.
which could be fairly low at intermediate and low currents, in particular. Regardless of current transducer types, this is mainly due to inaccurate zero-current offset. In case of hall effect sensing, correct zero-current detection is typically hampered by the temperature, hysteresis, and sensitivity to interference from external magnetic field. It is believed that this is more detrimental to the capacity estimation than any other applications. Because the capacity estimation requires measuring small but steady currents while integrating them for a long time, resulting in a growing cumulative error. In order to help resolve this perennial problem, we substitute capacity with the time elapsed for charging. This is possible due to the fact that in a vehicle-to-grid scenario battery charging proceeds with a constant current. Although capacity is replaced with time, the manner to define the start point of the charge curve is essentially the same as before. Assuming that the residual capacity before charging is calculated to be 13.23 Ah, it is equivalent to approximately 781 seconds, in case of quick charging at 50 kW. This conversion is derived from the fact that the time necessary for reaching 13.23 Ah at a constant current of about 61 A takes 781 seconds. For now, the charge curve for building the metamodel is reformulated to voltage (y-axis) against time (x-axis). Considering the special quality of the metamodel, it is finally reformulated to time (y-axis) with respect to voltage (x-axis). In short, the axes are swapped as voltage is more appropriate as an abscissa than time. Due the axes swap, the output function of the metamodel becomes the time t k at the discrete values of the voltage V k . The input of the metamodel is still the normalized capacity c. (Please compare Figures 8 and 11b). Thus, the metamodel in Equation 1 is reformulated as: In the above equation, the coefficients b kp at discrete voltage V k (k = 1∼n) are calculated using the least-squares method following the same process previously explained with Equations 2-4. The reason of axes swap and the reformulation of the metamodel is as follows. The voltage is specific, which spans from 3600 to 4040 mV at intervals of 20 mV. This means that regardless of the capacity loss, the charge curve is supposed to sweep this voltage range, if battery charging once starts at less than 40% SOC. Of course, the voltage range is an application-specific. Meanwhile, time is rather unspecific. That is not to say that time can never be an abscissa; yet, it can hardly be. While charging at a constant current, time is proportional to capacity. Thus, the time required for crossing this voltage range varies in relation to the present capacity, which could be reduced by  Figure 8). (c) Cell-level validation results showing good agreements between measured and estimated times required for charging. It is noted that the cells are charged at a 1.45C-rate which is equivalent to 50 kW quick charging (compare with Figure 9).
30%, considering the end-of-life capacity of the battery for BEVs. Besides, as the present capacity is a consequence of the metamodel, time as an ordinate is considered more logical and intuitive. As above, the metamodel is duly reformulated for the sake of its pack-level implementation which should involve the BMS (see Figure 11). For the capacity estimation, we build a metamodel that can efficiently capture changes in the shape of the charge curve as a battery ages. Along with the metamodel, the parameter estimator is basically required to extract the aging-related parameter from the charge curve. Plus, particularly in this application, the parameter estimator is expected to cope with the undesired changes in the shape of the charge curve.

Weighted least square (WLS) method.-
The WLS finds the parameters that minimize the weighted sum of squared residual. This method applies the different weights to the residual when the given data points are not equally reliable. In this work, the metamodel is in the form of t k,meta = f (V k , c) (k = 1 ∼ n) (see Equation 6). As the measured data, time t i (i = 1 ∼ n) at the corresponding voltage V i are provided. Then the parameter c (i.e. normalized capacity) is estimated such that the model f fits best the given data in the least-squares sense.
Because the metamodel function f is nonlinear with respect to the parameter c, the nonlinear least square method is applied here. In the nonlinear least square method, the initial value c 1 of the estimated parameter need to be given. Then, the parameters are updated iteratively, which means that the parameter c can be obtained by successive approximation: where q is an iteration number. The c can be obtained by solving the normal equation of the WLS: Here, the component of the Jacobian matrix J is defined as: Because the estimated parameter c j is a single value (i.e. j = 1), the Jacobian matrix J becomes the single column vector. The function f of metamodel (see Equation 6) is represented as the analytical function of the parameter c, the vector J can be analytically derived as: Next, the components of residual vector t is calculated as: Here the t i is the measured time at the voltage V i , and c q is the normalized capacity at qth iteration. From the Equation 6, the Equation 11 can be represented as: The n-by-n matrix W is a diagonal matrix where its diagonal element W ii is determined as the reciprocal of the error variance. This matrix apply the weight of each data point for the estimation when the given data points are not equally reliable. For the cell training data, the OLS serves well. Much of this is thanks to the fact that all data points on the charging curve have equal uncertainties. However, the OLS is questionable whether it is also applicable to the pack test data. Here, the shape of the charge curve, mostly its early part, is distorted by real-world conditions such as the duty cycle, rest time, SOC and temperature prior to charging. This can be interpreted that different data points on the charging curve have different uncertainties. Thus, when fitting the metamodel to the charging data, it makes sense to force a regression curve to be closer to the more certain points at the later part than to the less certain points at the early part. In this work, this is realized by using the WLS such that more certain points at the later part are given greater weights. A weight can thus determine how much each point on the charge curve influences the final parameter estimates, namely, the normalized capacity. Using weights that are inversely proportional to the error variance yields the most precise parameter estimates possible. The error variance is the relative difference between the measured and estimated values, which are the time required for charging, according to the reformulated metamodel. This is demonstrated in Figure 12. parameter estimation (see Figure 13). Prior to the data measurement, some initialization is required. For instance, the present capacity identified from the previous charging is retrieved from the non-volatile memory of the BMS. Also, the residual capacity before charging is calculated and then converted to time equivalent. By doing this, the start point of the charge curve is determined, as explained before. The first step, the data measurement, proceeds with battery charging. Here, data denote a set of points on the charging curve. According to the reformulated metamodel, they are in the form of the time elapsed for charging with respect to voltage. As noted, the voltage range is predetermined as 3600 to 4040 mV at intervals of 20 mV, thereby producing a total of 23 points. Within this voltage range, the time elapsed for charging is measured at every 20 mV and then stored in the vector y of measurements. An interval of the data measurement is carefully selected. A dense interval, which means, numerous data points would be favorable to capture the shape of the charge curve. In return for that, it would be unfavorable for saving memory footprint. The vector y of measurements consumes nearly 100 bytes of memory (4 bytes × 23 integer numbers); thus, other associated vectors come to the same, which involve the vector x of estimates, the vector b of residuals, the vector w of weights, and the vector J of Jacobian. Despite such a small memory footprint, this cannot be ignored, considering the limited computational resources of the BMS.
Following the data measurement, the second step, the parameter estimation, begins after all data points on the charging curve are collected. With the initial value of the parameter, the time elapsed for charging is first predicted from the metamodel and then stored in the vector x of estimates. Then, the vector b of residuals is provided by subtracting the vector y of measurements from the vector x of estimates. Here, the residuals can be viewed as the error variance between these two, which is used to generate the vector w of weights. Next, the Jacobian, a first-order partial derivative of the vector b of residuals, is analytically calculated. With the vector J of Jacobian, the parameter estimate is updated iteratively until the sum of squared errors does not reduce from one iteration to the next. As another stopping criterion, the number of iterations is also limited. This is related to the fact that the parameter estimation is required to complete before battery charging ends. In case of quick charging, battery charging usually ends when the SOC reaches 80%. With a fresh cell, the corresponding end-of-charge voltage is about 4080 mV; yet, it tends to vary in relation to the capacity loss. Therefore, the time allowed for the parameter estimation will reduce as a battery ages, which leads to the need for the limited number of iterations.
The computational resources of the used BMS only include an 80 MHz 16-bit processor with an on-chip 50 kB run-time memory and an 832 Kb flash memory and without the floating-point unit (FPU) especially designed to carry out the computations of floating-point numbers. As mentioned, for ensuring safe and reliable operation of a battery, a BMS is required to fulfill multiple tasks at once. The capacity estimation is one of the BMS tasks. Since the processor in the BMS is already consumed by the existing BMS tasks, the devised scheme, specifically, the parameter estimation, is reorganized such that it can be run together with the existing BMS tasks within the common timeframe. To process multiple tasks using a single-core processor, the BMS requires a scheduler which decides the task to be run next. The scheduler assigns a timeslot to each BMS task in equal portion and in circular order, thus handling different BMS tasks without priority, which is often called a round-robin scheduler. The current BMS has 10 ms and 100 ms timeslots to be assigned to 10 ms and 100 ms tasks respectively. Unfortunately, these timeslots are too short to be assigned to the iterative task of the parameter estimation. As explained, the parameter estimation here is made up of five substeps: modeling estimates, evaluating residuals, calculating weights, defining the Jacobian and updating a parameter.  Figure 14. Pack test data plotted in the form of the time elapsed for charging against voltage. the stopping criterion is met. Although it is inevitable for a nonlinear system, the iterative task could suspend other time-critical tasks. To resolve this challenge, the successive task of the parameter estimation is split into many yet small tasks such that they can accommodate into the 10 ms timeslot. Currently, there exists ten BMS tasks in a queue including the capacity estimation. Each of them is assigned to 10 ms timeslot. Thus, each BMS task performs at 100 ms intervals. Since one of the five substeps is allowed to perform within the 10 ms timeslot, it will take 0.5 seconds to finish off. Suppose that the number of iterations is four, a total of two seconds is required to bring a parameter estimate to a conclusion. As mentioned, the pack is composed of 96 cells. However, every cell within the pack is not taken into account. Among them, cells of interest are chosen in terms of the charge curves with the highest, the lowest and the average voltages, thus, for a total of three. Typically, the charge curve with the highest voltage is indicative of the cell with the lowest present capacity.
Validation.-The BMS-integrated metamodel and its parameter estimator are validated against the pack-test data. In general, test data are used to assess whether the discovered relationship generally holds. Here, the test data refer to the pack-level battery charging at a 1.45C-rate which is equivalent to 50 kW quick-charging. As shown in Figure 14, the batteries with different SOH are tested. The packs are charged under real-world conditions such that operational factors during or before charging are somewhat arbitrary. Approximately, the SOC ranges from 15 to 40%; The rest time spans from 10 seconds to 1 hour; the temperature varies from 15 to 35 • C; in real-world conditions the duty cycle performed is hardly defined as the FTP-75 or US06. Table I summarizes the test data and their results. In the similar way as Equation 5, the estimation error is calculated in terms of the parameter estimate, that is, the normalized capacity. From this result, it is found that the BMS-integrated metamodel and its parameter estimator can estimate the present capacity within 3% error despite such variations in operational factors which deform the shape of the charge curve.

Conclusions
Through this work, we devise a robust and efficient scheme for real-time capacity estimation, which is readily applicable to the BMS for BEVs. Taking advantage of constant current charging in a vehicleto-grid scenario, the present capacity is estimated during battery charging. The devised scheme exploits changes in the shape of the charge curve with respect to the capacity loss. By virtue of the metamodel, this complex relationship is simply described. A series of reformulation on the charge curve concludes the metamodel in the form of the time elapsed for charging as a function of voltage. Under constant current charging, using time in lieu of capacity is favorable for computationally light BMSs to evaluate the amount of charging. The reformulated charge curve is parameterized with the normalized capacity. For its simplicity and validity, the present capacity is normalized to the nominal capacity. The normalized capacity in the metamodel is estimated in the least-squares sense. However, the OLS is found inadequate to extract the normalized capacity from the charge curve distorted due to operational factors, for instance, the duty cycle, rest time, SOC and temperature before charging. The OLS is thus replaced with the WLS such that their adverse influence onto the parameter estimates is minimized. Specifically the early part of the charge curve is prone to change, which implies that the early part is less reliable than the later part. Therefore, the WLS gives more weights onto the later part such that an estimation error less than 3% is attained throughout battery life.
The devised scheme includes the real-time parameter estimation using the BMS for BEVs. Added to such a high degree of accuracy, the aging-related parameter in the metamodel should be estimated in a timely fashion. The devised scheme is divided into two steps: the data measurement followed by the parameter estimation. The second step is again split into five substeps and each substep is done in order, one after the other. Each substep is assigned to 10 ms timeslot. With nine other BMS tasks, each substep goes at 100 ms intervals, thereby spending 500 ms per iteration. The maximum number of iterations is found six. Thus, it consumes nearly three seconds per cell. It is noted that cells of interest within the pack are three which are chosen in terms of the charge curves with the highest, the lowest and the average voltages. Thus, it takes the devised scheme about nine seconds to estimate the present capacity of the pack in service. As shown, while charging the data measurement is performed between 3600 and 4040 mV; subsequently, the parameter estimation is carried out from 4040 to 4080 mV. In the worst-case scenario, the minimum time elapsed for crossing this voltage range is found 32 seconds which is much longer than the maximum time required for the parameter estimation.