Dual Nonlinear Kalman Filter-Based SoC and Remaining Capacity Estimation for an Electric Scooter Li-NMC Battery Pack

: Accurate, real-time estimation of battery state-of-charge (SoC) and state-of-health represents a crucial task of modern battery management systems. Due to nonlinear and battery degradation-dependent behavior of output voltage, the design of these estimation algorithms should be based on nonlinear parameter-varying models. The paper ﬁrst describes the experimental setup that consists of commercially available electric scooter equipped with telemetry measurement equipment. Next, dual extended Kalman ﬁlter-based (DEKF) estimator of battery SoC, internal resistances, and parameters of open-circuit voltage (OCV) vs. SoC characteristic is presented under the assumption of ﬁxed polarization time constant vs. SoC characteristic. The DEKF is upgraded with an adaptation mechanism to capture the battery OCV hysteresis without explicitly modelling it. Parameterization of an explicit hysteresis model and its inclusion in the DEKF is also considered. Finally, a slow time scale, sigma-point Kalman ﬁlter-based capacity estimator is designed and inter-coupled with the DEKF. A convergence detection algorithm is proposed to ensure that the two estimators are coupled automatically only after the capacity estimate has converged. The overall estimator performance is experimentally validated for real electric scooter driving cycles.


Introduction
Modern battery management systems (BMSs), among other functionalities, include a number of algorithms for estimating key battery state variables such as state-of-charge (SoC) and remaining available charge capacity, and model parameters such as internal resistance [1]. The SoC estimate can be used for predicting the current vehicle range, as well as for identification of current battery operating point which is important from the standpoint of ensuring battery safety. On the other hand, the internal resistance and capacity estimates are the main indicators used for tracking the battery degradation level, i.e., estimation of battery state-of-health (SoH) [2]. Furthermore, almost every battery model parameter is changing with battery degradation, so that for robust SoC and SoH estimation, those changes should be accurately tracked, as well.
Battery state and parameter estimation algorithms are often based on Kalman filters (KF), which in its basic linear version represent an optimal recursive solution for estimating hidden states of a linear, time-varying Gaussian system (i.e., probabilistic inference) [3]. While the Gaussian assumption holds in many cases based on the central limit theorem, the battery model is inherently nonlinear, which calls for application of nonlinear KF forms. Two of the most widely used nonlinear KFs are extended 2 of 16 Kalman filter (EKF) and sigma-point Kalman filter (SPKF) [3]. The EKF relies on analytical linearization of the model around a time-varying operating point (i.e., an expected value of the estimated random state), while SPKF statistically linearizes the model around several operating points (depending on the number of states that are estimated).
Topic of state and parameter estimation of Li-ion battery cells has been addressed by many previous studies. One of the first implementations of dual extended Kalman filter-based (DEKF) estimator of SoC and resistance parameters can be found in [4]. Researchers have been upgrading the estimators ever since, e.g., using an adaptation mechanism for process noise variance recalculation [5], or applying more advanced filters such as SPKF [6] or particle filter (PF) [7]. These approaches are based on the assumption of constant model parameters/characteristics such as the SoC-dependent open-circuit voltage (OCV) characteristic U oc (SoC) or battery remaining capacity. Since those parameters are in fact dependent on SoH [8] and temperature [9], they should be estimated as well, for accurate and robust overall estimation.
There are several studies that account for U oc (SoC) variation with SoH by implementing the offline identified response surface model of U oc with respect to SoC and remaining capacity [10][11][12]. Authors in [13] use the model migration method to adapt an offline trained model. An obvious disadvantage of this approach is related to the need of having a large data set from previously conducted aging experiments on the same cell type, as well as lack of temperature dependency in the response surface model. This disadvantage is tackled in this paper by describing the characteristic U oc (SoC) with a model whose parameters are estimated along the rest of model states and parameters within the DEKF structure. Moreover, this approach includes an adaptation mechanism of U oc (SoC) which allows for identification of U oc (SoC) hysteresis profile.
Remaining capacity estimators based on EKF and PF can be found in [14], while a recursive approximate least-squares approach is proposed in [15]. In both cases the characteristic U oc (SoC) is again considered as a constant-parameter dependence. Dual estimation of SoC and capacity can be found in [16], where authors use multiscale estimation with the online identified model, which can be regarded as a next step towards complete estimator. Certain weaknesses of that approach include: (i) Still an offline identified U oc (SoC) map is used, (ii) capacity estimate shows considerable variations in steady state, and (iii) the capacity estimator needs to be turned on manually after 25 min in order to ensure overall estimator stability. The multiscale estimator presented in this paper improves the capacity estimation accuracy and flexibility by using a more accurate SPKF and automated turning on the capacity estimator by means of applying a convergence detection algorithm.
Finally, a fully-electric scooter-based experimental verification of the proposed battery estimators is conducted, including consideration of different temperature operating points.

Experimental Setup
The experimental setup includes the fully-electric scooter Govecs S2.6+, powered by the 3.3 kW BLDC electric motor and the battery pack of 400 Li-Ni 0.33 Mn 0.33 Co 0.33 O 2 (Li-NMC) cells, connected in the 20 × 20 matrix [17], with the total nominal voltage of 72 V, and the total energy capacity of 4.1 kWh. Battery pack is equipped with BMS which provides basic battery measurements and estimates accessible through the scooter CAN bus.
Electric scooters became an attractive transportation solution in urban areas with mild climate conditions, thus contributing to the current transport electrification effort aimed at reducing traffic congestion, and air and noise pollution. There are already several strong electric scooter manufacturers in the EU (and worldwide), e.g., Govecs, Ujet, Hrowin, Torrot, etc. NMC-type Li-ion batteries represent a preferred energy storage solution in scooter applications [17], because they offer favorable energy density, while not experiencing high loads (in terms of battery C-rate) and not operating in extreme, particularly low temperature conditions, in those applications.
For the research purposes, the scooter has been equipped with the measurement and telemetry system illustrated in Figure 1. The system is built around the Artronic SkyTrack telemetry module, Energies 2020, 13, 540 3 of 16 custom-programmed for the acquisition and storage of measurement data, as well as for communication with the server through GPRS connection in real time. The measurement system consists of voltage and current measurement on battery output nodes, and acquisition of data available from the scooter CAN bus. The battery current is measured by using a precise, low-offset current transducer (LEM CAB 300, [18]), while the battery voltage is measured through a 12-bit analogue input of the telemetry module. Those two measurement values are sampled every 0.1 s and stored in the module. Selected values from the scooter internal CAN bus, such as battery voltage, current and temperature, vehicle's distance travelled, motor on/off flag, as well as the vehicle's current GPS coordinates and longitudinal velocity are stored with the sample rate of 1 s. GPRS connection is used to send data relevant for real-time tracking of scooter, such as its GPS coordinates, battery SoC, and other diagnostic parameters. The whole measurement dataset, including the fast current and voltage measurements, is stored in the telemetry module memory card and can be occasionally downloaded through USB connection to a local PC.

Battery Pack Model
This section first presents a battery mathematical model used as a basis for SoC estimator design. Next, models employed for estimation of battery internal parameters used by the SoC estimator are presented. Finally, two offline identification experiments are described, which have been conducted to determine battery model parameters that are considered as constant or used in estimator verification.

Mathematical Model
The battery model used in this research is based on the equivalent-circuit model (ECM) showed in Figure 2, which consists of (i) a voltage source dependent on the battery SoC, i.e. the OCV characteristic ( ), (ii) an ohmic resistance ℎ which models voltage drops in the electrolyte and electrical contacts, and (iii) a single polarization RC term ( and ) which models the slow battery dynamics, i.e. diffusion process. It should be noted that the diffusion process is more accurately modelled with the Warburg element [19] which is here avoided due to the complexity, but it can be approximated by a single or more RC elements connected in series (a single RC element is usually used as a good trade-off between simplicity and accuracy [20]). Moreover, note that the polarization resistance in Figure 2 models all voltage drops that are not related to the ohmic one, including that related to charge transfer.

Battery Pack Model
This section first presents a battery mathematical model used as a basis for SoC estimator design. Next, models employed for estimation of battery internal parameters used by the SoC estimator are presented. Finally, two offline identification experiments are described, which have been conducted to determine battery model parameters that are considered as constant or used in estimator verification.

Mathematical Model
The battery model used in this research is based on the equivalent-circuit model (ECM) showed in Figure 2, which consists of (i) a voltage source dependent on the battery SoC, i.e., the OCV characteristic U oc (SoC), (ii) an ohmic resistance R ohm which models voltage drops in the electrolyte and electrical contacts, and (iii) a single polarization RC term (R p and C p ) which models the slow battery dynamics, i.e., diffusion process. It should be noted that the diffusion process is more accurately modelled with the Warburg element [19] which is here avoided due to the complexity, but it can be approximated by a single or more RC elements connected in series (a single RC element is usually used as a good trade-off between simplicity and accuracy [20]). Moreover, note that the polarization resistance R p in Figure 2 models all voltage drops that are not related to the ohmic one, including that related to charge transfer. The above ECM can be described by the following discrete-time time-varying state-space mathematical model [4]: where is the filter sampling time, is the battery capacity, = is the polarization term time constant, and is discrete sample step.

OCV Model
Since the battery OCV is a nonlinear function of SoC, and to a lower extent temperature [9] and SoH [8], it is desirable to describe it using a parametric model such as the one used in [4]: where vector contains -model parameters that need to be estimated.

Model of Internal Resistance Parameters
The presented ECM has two resistance parameters in its model. Both of those resistances are known to depend on SoH and temperature [21]. So, it is important to have them estimated along with the model states. Since there is no resistance model feasible for online estimator implementation, resistances are modelled as random-walk variables: where is the identity matrix, and is the vector containing variances of both resistances. Other variable model parameters, such as those from Equation (3), can be modelled using this approach, as well.

Identification Experiments
The battery model parameters that are assumed to be constant or used in estimator verification should be determined by means of specific (targeted) offline identification tests. The above ECM can be described by the following discrete-time time-varying state-space mathematical model [4]: where T u is the filter sampling time, C n is the battery capacity, τ p = R p C p is the polarization term time constant, and k is discrete sample step.

OCV Model
Since the battery OCV is a nonlinear function of SoC, and to a lower extent temperature [9] and SoH [8], it is desirable to describe it using a parametric model such as the one used in [4]: where vector k oc contains U oc -model parameters that need to be estimated.

Model of Internal Resistance Parameters
The presented ECM has two resistance parameters in its model. Both of those resistances are known to depend on SoH and temperature [21]. So, it is important to have them estimated along with the model states. Since there is no resistance model feasible for online estimator implementation, resistances are modelled as random-walk variables: where I is the identity matrix, and r is the vector containing variances of both resistances. Other variable model parameters, such as those from Equation (3), can be modelled using this approach, as well.

Identification Experiments
The battery model parameters that are assumed to be constant or used in estimator verification should be determined by means of specific (targeted) offline identification tests.

Battery OCV Curve
The curve U oc (SoC) has been identified during low-and constant-load experiments (during which the vehicle was in rest, while only considerable battery load was scooter headlight), in which case any voltage drop in the battery can be neglected due to the low current (~C/50), so that the Energies 2020, 13, 540 5 of 16 measured voltage U b can be taken as the OCV U oc . The SoC was estimated by Coulomb counting, i.e., by integrating the measured current. The battery capacity was also identified in this experiment by integration of measured current during the process of full battery discharge, which gave C n = 49.57 Ah. Graphical illustration of the identification experiment and related results are shown in Figure 3. The identified curve U oc (SoC) has been used in validation of U oc estimation results (see next sections). The curve ( ) has been identified during low-and constant-load experiments (during which the vehicle was in rest, while only considerable battery load was scooter headlight), in which case any voltage drop in the battery can be neglected due to the low current (~/50), so that the measured voltage can be taken as the OCV . The SoC was estimated by Coulomb counting, i.e. by integrating the measured current. The battery capacity was also identified in this experiment by integration of measured current during the process of full battery discharge, which gave = 49.57 Ah. Graphical illustration of the identification experiment and related results are shown in Figure 3. The identified curve ( ) has been used in validation of estimation results (see next sections).

Polarization Time Constant
This parameter can be identified during the battery relaxation periods, i.e. parts of driving cycle where current has dropped to zero and remained equal to zero for at least 15 min. The relaxation transients to be identified were extracted from the voltage response (see Figure 4a,b) and approximated with the ECM model shown in Figure 4c.
The identified values of relaxation time constant ( ) are shown in Figure 4d. These values were then approximated with a 3 rd -order polynomial in dependence on SoC, and that polynomial was later used for calculation of at every estimator step based on the current, slowly changing SoC working point.
It is important to note that the polarization time constant can also vary with battery temperature and aging [22,23]. These effects are neglected in the estimator problem formulation in this paper, i.e. parameters of the characteristic ( ) are not estimated online. This is motivated by the following main reasons: i) is not directly involved in the ECM voltage equation (see Equation (2)), thus making it weakly observable in the proposed estimator design; ii) error in will cause an error in voltage modelling during the transient periods (i.e., before voltage has relaxed), so that the polarization dynamics may influence estimator accuracy only in transient conditions. As needed, the

Polarization Time Constant
This parameter can be identified during the battery relaxation periods, i.e., parts of driving cycle where current has dropped to zero and remained equal to zero for at least 15 min. The relaxation transients to be identified were extracted from the voltage response (see Figure 4a,b) and approximated with the ECM model shown in Figure 4c.
The identified values of relaxation time constant τ p (SoC) are shown in Figure 4d. These values were then approximated with a 3rd-order polynomial in dependence on SoC, and that polynomial was later used for calculation of τ p at every estimator step based on the current, slowly changing SoC working point.
It is important to note that the polarization time constant can also vary with battery temperature and aging [22,23]. These effects are neglected in the estimator problem formulation in this paper, i.e., parameters of the characteristic τ p (SoC) are not estimated online. This is motivated by the following main reasons: (i) τ p is not directly involved in the ECM voltage equation (see Equation (2)), thus making it weakly observable in the proposed estimator design; ii) error in τ p will cause an error in voltage modelling during the transient periods (i.e., before voltage has relaxed), so that the polarization dynamics may influence estimator accuracy only in transient conditions. As needed, the slow temperature-and aging-influenced polarization dynamics can be accounted for in the estimator design either by extending the τ p characteristic with the temperature and SOH inputs or by considering τ p as an additional parameter to be estimated, which is a subject of future work. slow temperature-and aging-influenced polarization dynamics can be accounted for in the estimator design either by extending the characteristic with the temperature and SOH inputs or by considering as an additional parameter to be estimated, which is a subject of future work.

State and Parameter Estimator
This section deals with design, parametrization, and verification of the SoC estimator. It is designed as a dual state and parameter estimator, thus allowing for accompanying estimation of selected ECM parameters (i.e., the battery internal resistances and OCV parameters). A special attention is devoted to estimation of battery OCV hysteresis based on two complementary approaches (adapting the OCV parameters to current sign change or using an explicit hysteresis model).

DEKF-Based State and Parameter Estimator
States and parameters of the ECM are estimated with the DEKF, as a well-known approach in the model-based estimation problems where model states and slowly varying model parameters are to be estimated simultaneously [1]. The DEKF equations are not listed here due to paper size constraints, and they can be found in [24]. DEKF consists of two filters operating in parallel based on the state and parameter models: State estimator state-space model: Parameter estimator state-space model:

State and Parameter Estimator
This section deals with design, parametrization, and verification of the SoC estimator. It is designed as a dual state and parameter estimator, thus allowing for accompanying estimation of selected ECM parameters (i.e., the battery internal resistances and OCV parameters). A special attention is devoted to estimation of battery OCV hysteresis based on two complementary approaches (adapting the OCV parameters to current sign change or using an explicit hysteresis model).

DEKF-Based State and Parameter Estimator
States and parameters of the ECM are estimated with the DEKF, as a well-known approach in the model-based estimation problems where model states and slowly varying model parameters are to be estimated simultaneously [1].
The DEKF equations are not listed here due to paper size constraints, and they can be found in [24]. DEKF consists of two filters operating in parallel based on the state and parameter models: State estimator state-space model: Parameter estimator state-space model: where x and u are the vectors of model states and inputs, respectively, w is the vector of state variances (with the corresponding covariance matrix Q x ), θ is the vector of model parameters with their variances contained in vector r (with the corresponding covariance matrix Q θ ), h is the model output function (the same output function is used in both state and parameter models), y is the measured model output vector with measurement noise and corresponding covariance matrix denoted by v and R, respectively. The complete, discrete-time state-space model for simultaneous state and parameter estimation then reads (cf. Equations (1)- (4)): Energies 2020, 13, 540 The state estimator model, given by Equations (6) and (8), is considered linear in state equation under the assumption that the nonlinearity of function τ p (SoC) can be neglected. The only nonlinearity resides in the output equation of the state estimator, related to the x oc term (see Equation (3)), so that an EKF is finally used as a model state estimator. On the other hand, the parameter estimator model, given by Equations (7) and (8), is linear, so that the estimator reduces to KF.

Estimator Parametrization
The DEKF needs to be properly parametrized. For instance, appropriate statistic parameters such as process and output noise covariances Q and R should be determined offline. Polarization time-constant τ p was assumed to be degradation-invariant and used as the identified SoC-dependent profile (see previous section), while battery capacity was in this case taken as a constant value that was measured as described in the previous section. This section also describes an estimator adaptation mechanism that indirectly compensates for the influence of unmodelled hysteresis of curve U oc (SoC).

DEKF Covariance Matrices Parametrization
The measurement variable in the DEKF model is the battery output voltage U b (see Equation (8)). Its measurement noise has been estimated by approximating the voltage measurement error histogram with normal distribution, as shown in Figure 5a. The parameter µ identified in Figure 5a is the voltage noise mean value (expectation), while σ is the standard deviation which, after being squared, yields the measurement covariance R = 53·10 −3 2 mV 2 . The parameter L stat in Figure 5a is the result of Lilliefors normality test. Further in this paper, we calculate L stat for estimator voltage residuals and compare it to the calculated L stat = 0.0436 of voltage sensor noise (see Figure 5a) to check how similar they are, i.e., how accurate is the estimator. state and parameter estimation then reads (cf. Equations (1)-(4)): The state estimator model, given by Equations (6) and (8), is considered linear in state equation under the assumption that the nonlinearity of function ( ) can be neglected. The only nonlinearity resides in the output equation of the state estimator, related to the term (see Equation (3)), so that an EKF is finally used as a model state estimator. On the other hand, the parameter estimator model, given by Equations (7) and (8), is linear, so that the estimator reduces to KF.

Estimator Parametrization
The DEKF needs to be properly parametrized. For instance, appropriate statistic parameters such as process and output noise covariances and should be determined offline. Polarization time-constant was assumed to be degradation-invariant and used as the identified SoCdependent profile (see previous section), while battery capacity was in this case taken as a constant value that was measured as described in the previous section. This section also describes an estimator adaptation mechanism that indirectly compensates for the influence of unmodelled hysteresis of curve ( ).

DEKF Covariance Matrices Parametrization
The measurement variable in the DEKF model is the battery output voltage (see Equation (8)). Its measurement noise has been estimated by approximating the voltage measurement error histogram with normal distribution, as shown in Figure 5a. The parameter identified in Figure 5a is the voltage noise mean value (expectation), while is the standard deviation which, after being squared, yields the measurement covariance = (53 • 10 −3 ) 2 mV 2 . The parameter in Figure 5a is the result of Lilliefors normality test. Further in this paper, we calculate for estimator voltage residuals and compare it to the calculated = 0.0436 of voltage sensor noise (see Figure 5a) to check how similar they are, i.e. how accurate is the estimator.  The process noise relates to the current sensor noise, as can be seen from Equation (6). The current is in this case measured with LEM CAB 300 sensor, whose datasheet specifies a linear relation between measured current and magnitude of its measurement error (see Figure 5b). The standard deviation of current sensor noise can be estimated as a value three times lower than the noise magnitude, and covariance matrix is then the diagonal matrix of current sensor noise variances: Energies 2020, 13, 540 8 of 16

Adaptation Mechanism
The relatively simple battery model given by Equations (1) and (2) does not take into account some secondary, but generally influential effect such as the hysteresis of OCV curve U oc (SoC) [25]. Since the hysteresis cannot be directly measured in this case, an adaptation mechanism is introduced in the form of single-step increase of the elements of parameter covariance submatrix Q θ [3, 7; 3, 7] when the start or end of charging is detected. This approach allows faster convergence of the U oc parameters (written in k oc ), which abruptly change when the sign of battery current (or SoC derivative) occurs due to the existence of hysteresis of U oc (SoC) curve. Note that the battery current for the given scooter changes its sign only when the scooter is exposed to change from normal driving to charging or vice versa, because it does not incorporate regenerative braking.

Estimation Results
The presented DEKF was validated based on the recorded scooter real city driving cycle data consisting of seven load cycles (i.e., charge/discharge cycles) lasting for 150 h in total. The obtained estimation results are shown in Figure 6. Since the battery SoC cannot be measured, and there is no fully reliable SoC estimate available, the DEKF accuracy is evaluated by analyzing a posteriori voltage residual, i.e., difference between the recorded voltage U b and the voltage calculated from output Equation (8) Figure 6a shows the voltage residuals histogram including the corresponding normal distribution fit and its parameters. Residual mean value is low, while standard deviation and L stat are larger than those of the voltage sensor noise. The estimated values of resistances R ohm and R p are shown in Figure 6b,d, respectively, vs. SoC and color-mapped with respect to battery temperature. These results point out that both resistances show negative correlation with respect to temperature (note: ρ X,Y stands Energies 2020, 13, 540 9 of 16 for correlation coefficient between vectors X and Y, and are obtained by using the MATLAB function corrcoef), which is expected for the Li-ion cell resistances [21]. As of the correlation with respect to SoC (based on visual inspection of Figure 6b,d), both R ohm and R p do not seem to be correlated with SoC, which is an expected result for the particular SoC range, based on the estimator results from the available literature [16,21,26] in which resistances more significantly depend on SoC only at the very low and very large SoC bands. The estimated U oc curves during charging and discharging intervals are shown in Figure 6c, along with the "measured" one adopted from Figure 3c. Evidently, the estimated and "measured" curves are in good agreement, and a relatively small hysteresis is apparent (i.e., the charging and discharging curves do not overlap).
The two sets of estimated U oc (SoC) curves from Figure 6c have been averaged and shown as dotted lines in Figure 7a. Half of the difference between those two curves yields the estimate of battery hysteresis voltage which is shown in Figure 7b. The estimated hysteresis voltage trend is in line with the results from the literature (e.g., [25]), except in the low-SoC region (SoC < 20%), where the estimated hysteresis is larger than what would be expected based on the literature.  Now, when the hysteresis voltage is known, the adaptation mechanism may be omitted, and the hysteresis can be accounted for directly through a proper ( ) model extension. A complex, dynamic hysteresis model [27] is not necessary in this case, because the particular scooter does not support regenerative breaking (i.e., its battery is not exposed to often changes of current sign). A simple, instantaneous hysteresis model can be described by introducing an auxiliary variable described as [4]: (where 3√ is the current sensor noise amplitude calculated using the current sensor variance from Equation (9)) and using it to modify the output equation (cf. Equation (8)): Now, when the hysteresis voltage is known, the adaptation mechanism may be omitted, and the hysteresis can be accounted for directly through a proper U oc (SoC) model extension. A complex, dynamic hysteresis model [27] is not necessary in this case, because the particular scooter does not support regenerative breaking (i.e., its battery is not exposed to often changes of current sign). A simple, instantaneous hysteresis model can be described by introducing an auxiliary variable s described as [4]: √ Q x is the current sensor noise amplitude calculated using the current sensor variance from Equation (9)) and using it to modify the output equation (cf. Equation (8)): where M 0 is the hysteresis voltage value obtained from data shown in Figure 7b by means of 10th-order approximation polynomial. Described hysteresis is used instead of the adaptation mechanism in the rest of the paper.

Battery Capacity Estimation
This section presents the battery remaining charge capacity estimator, and its integration into the overall SoC and capacity estimation algorithm. The capacity estimator is supplemented with a convergence detection algorithm to perform automatic coupling of the capacity estimator with the SoC estimator after the capacity estimate has converged. Finally, the complete estimation algorithm is verified for real driving battery load cycles.

Capacity Estimation Model
Since the battery capacity parameter is not directly involved in the model output equation (i.e., Equation (8)), it is not convenient to estimate it as another random-walk parameter in the DEKF [15]. Instead, the model for capacity estimation could be defined as [15]: where C(k) is capacity, r C is random walk noise for capacity parameter model with the corresponding covariance Q C , L is the number of basic (DEKF) sampling steps between two capacity estimates, and v SoC is measurement noise of SoC signal difference with the corresponding covariance R SoC . The model output is the SoC difference between two capacity estimates, while its input is the cumulative sum of battery current between those time instances. The SoC, as an output term, cannot be measured, but can be estimated by using the previously designed DEKF (both, estimates of SoC mean value and its variance are available). By looking at Equation (13) it can be seen that capacity estimate cannot be updated at the same rate as DEKF, because the signal-to-noise ratio of SoC estimate would be too low for the SoC dynamics being much slower than the current dynamics. The capacity estimator is therefore executed every L time steps, where L is in the range of 600-6000, i.e., 1 to 10 min. The overall estimator, i.e., the previously discussed DEKF extended with the capacity estimator, is shown in Figure 8.
where 0 is the hysteresis voltage value obtained from data shown in Figure 7b by means of 10 thorder approximation polynomial. Described hysteresis is used instead of the adaptation mechanism in the rest of the paper.

Battery Capacity Estimation
This section presents the battery remaining charge capacity estimator, and its integration into the overall SoC and capacity estimation algorithm. The capacity estimator is supplemented with a convergence detection algorithm to perform automatic coupling of the capacity estimator with the SoC estimator after the capacity estimate has converged. Finally, the complete estimation algorithm is verified for real driving battery load cycles.

Capacity Estimation Model
Since the battery capacity parameter is not directly involved in the model output equation (i.e., Equation (8)), it is not convenient to estimate it as another random-walk parameter in the DEKF [15]. Instead, the model for capacity estimation could be defined as [15]: where ( ) is capacity, is random walk noise for capacity parameter model with the corresponding covariance , is the number of basic (DEKF) sampling steps between two capacity estimates, and is measurement noise of SoC signal difference with the corresponding covariance . The model output is the SoC difference between two capacity estimates, while its input is the cumulative sum of battery current between those time instances. The SoC, as an output term, cannot be measured, but can be estimated by using the previously designed DEKF (both, estimates of SoC mean value and its variance are available). By looking at Equation (13) it can be seen that capacity estimate cannot be updated at the same rate as DEKF, because the signal-to-noise ratio of SoC estimate would be too low for the SoC dynamics being much slower than the current dynamics. The capacity estimator is therefore executed every time steps, where is in the range of 600-6000, i.e. 1 to 10 min. The overall estimator, i.e. the previously discussed DEKF extended with the capacity estimator, is shown in Figure 8.

SPKF-Based Capacity Estimator
Since the battery capacity model output equation is distinctively nonlinear, the EKF-based estimator application has been found to give too noisy estimates with slow convergence rate. This is an expected result since EKF uses analytic linearization through Taylor series expansion around the

SPKF-Based Capacity Estimator
Since the battery capacity model output equation is distinctively nonlinear, the EKF-based estimator application has been found to give too noisy estimates with slow convergence rate. This is an expected result since EKF uses analytic linearization through Taylor series expansion around the current operating point, i.e., around the state variable (in this case capacity C) mean value. Another, more coherent approach to this problem is statistical linearization which linearizes the model at multiple points drawn from prior distribution of C. The estimator derived using this approach is called SPKF [3]. There is a couple of SPKF versions which differ in calculation of sigma-points for Energies 2020, 13, 540 11 of 16 linearization; in this paper, the method called central-difference Kalman filter (CDKF) is used because it provides simple parametrization without compromising accuracy [3]. Comparison between EKFand SPKF-based capacity estimation, shown in Figure 9, clearly illustrates the benefits of using SPKF when compared to EKF.
Energies 2020, 13, 540 11 of 16 current operating point, i.e. around the state variable (in this case capacity ) mean value. Another, more coherent approach to this problem is statistical linearization which linearizes the model at multiple points drawn from prior distribution of . The estimator derived using this approach is called SPKF [3]. There is a couple of SPKF versions which differ in calculation of sigma-points for linearization; in this paper, the method called central-difference Kalman filter (CDKF) is used because it provides simple parametrization without compromising accuracy [3]. Comparison between EKFand SPKF-based capacity estimation, shown in Figure 9, clearly illustrates the benefits of using SPKF when compared to EKF. It is important to note that in the case shown in Figure 9 the capacity estimates were not fed back into the state model of the DEKF, i.e. into Equation (6). If this were the case, i.e. if the state model of DEKF was updated with capacity estimates every time stamps, the estimator would not converge to correct estimates, as shown in Figure 10a-c. This is because every model parameter is estimated in a coupled manner, so there are multiple parameter combinations where output voltage residual would be minimized. For instance, Figure 10d shows an estimate of ( ) which is narrower than the actual curve, because the capacity is estimated higher than the actual one. The capacity estimate feedback to the DEKF should be, therefore, turned on with some delay, i.e. until capacity estimate convergence is detected. For that purpose, capacity convergence detection algorithm has been designed, as presented in the next subsection. It is important to note that in the case shown in Figure 9 the capacity estimates were not fed back into the state model of the DEKF, i.e., into Equation (6). If this were the case, i.e., if the state model of DEKF was updated with capacity estimates every L time stamps, the estimator would not converge to correct estimates, as shown in Figure 10a-c. This is because every model parameter is estimated in a coupled manner, so there are multiple parameter combinations where output voltage residual would be minimized. For instance, Figure 10d shows an estimate of U oc (SoC) which is narrower than the actual curve, because the capacity is estimated higher than the actual one.
Energies 2020, 13, 540 11 of 16 current operating point, i.e. around the state variable (in this case capacity ) mean value. Another, more coherent approach to this problem is statistical linearization which linearizes the model at multiple points drawn from prior distribution of . The estimator derived using this approach is called SPKF [3]. There is a couple of SPKF versions which differ in calculation of sigma-points for linearization; in this paper, the method called central-difference Kalman filter (CDKF) is used because it provides simple parametrization without compromising accuracy [3]. Comparison between EKFand SPKF-based capacity estimation, shown in Figure 9, clearly illustrates the benefits of using SPKF when compared to EKF. It is important to note that in the case shown in Figure 9 the capacity estimates were not fed back into the state model of the DEKF, i.e. into Equation (6). If this were the case, i.e. if the state model of DEKF was updated with capacity estimates every time stamps, the estimator would not converge to correct estimates, as shown in Figure 10a-c. This is because every model parameter is estimated in a coupled manner, so there are multiple parameter combinations where output voltage residual would be minimized. For instance, Figure 10d shows an estimate of ( ) which is narrower than the actual curve, because the capacity is estimated higher than the actual one. The capacity estimate feedback to the DEKF should be, therefore, turned on with some delay, i.e. until capacity estimate convergence is detected. For that purpose, capacity convergence detection algorithm has been designed, as presented in the next subsection. The capacity estimate feedback to the DEKF should be, therefore, turned on with some delay, i.e., until capacity estimate convergence is detected. For that purpose, capacity convergence detection algorithm has been designed, as presented in the next subsection.

Capacity Convergence Detection Algorithm
The capacity convergence detection algorithm is based on monitoring of the normalized estimation error (NEE) [28]: where y(k) is the SoC estimate generated by the DEKF,ŷ(k) is the SoC calculated from the SPKF model output, and P y is the SPKF innovation matrix (which is regularly calculated as a part of SPKF; note that it is a scalar in the particular case of single estimated parameter-the capacity). The convergence algorithm monitors the NEE, and when it is lower than some predefined value during some predefined number of consecutive time steps, the convergence is claimed.

Capacity Estimation Results
Results of SPKF-based capacity estimation algorithm with delayed and automatically calculated (through capacity convergence detection algorithm) start of capacity update (i.e., t start ) within the DEKF state model (version with hysteresis model included was used) are shown in Figure 11. The capacity estimates plotted versus time are shown in Figure 11a along with the "measured" capacity (see Figure 3b for details about capacity identification). Capacity convergence has automatically been detected after 2.9 h and from that point on, SPKF has been coupled to the DEKF. Figure 11b shows capacity estimates during the discharge periods plotted versus SoC and color-mapped with respect to temperature. Capacity shows expected (based on the [29]) positive correlation with the temperature.

Capacity Convergence Detection Algorithm
The capacity convergence detection algorithm is based on monitoring of the normalized estimation error (NEE) [28]: where ( ) is the SoC estimate generated by the DEKF, ̂( ) is the SoC calculated from the SPKF model output, and is the SPKF innovation matrix (which is regularly calculated as a part of SPKF; note that it is a scalar in the particular case of single estimated parameter-the capacity). The convergence algorithm monitors the NEE, and when it is lower than some predefined value during some predefined number of consecutive time steps, the convergence is claimed.

Capacity Estimation Results
Results of SPKF-based capacity estimation algorithm with delayed and automatically calculated (through capacity convergence detection algorithm) start of capacity update (i.e., ) within the DEKF state model (version with hysteresis model included was used) are shown in Figure 11. The capacity estimates plotted versus time are shown in Figure 11a along with the "measured" capacity (see Figure 3b for details about capacity identification). Capacity convergence has automatically been detected after 2.9 h and from that point on, SPKF has been coupled to the DEKF. Figure 11b shows capacity estimates during the discharge periods plotted versus SoC and color-mapped with respect to temperature. Capacity shows expected (based on the [29]) positive correlation with the temperature.  Figure 12 shows the same plots as in the case of Figure 6, but instead of using the adaptation mechanism the estimator relies on the explicit hysteresis model and has the capacity estimation included. The voltage residual is shown in Figure 12a together with the usual statistics. This residual has higher Lstat value than the one from Figure 6a, which may be explained by the influence of added capacity estimation. The estimates of ℎ and , plotted in Figure 12b,d with respect to SoC and temperature, respectively, are similar to those from Figure 6b,d, but with slightly higher correlation with temperature for both resistances. Finally, it should be noted that there are no distinguishable sets of estimated curves in Figure 12c (unlike in Figure 6c), because estimated ( ) now describes the central curve while the hysteresis is accounted for in the model (see Figure 7 and  Figure 12 shows the same plots as in the case of Figure 6, but instead of using the adaptation mechanism the estimator relies on the explicit hysteresis model and has the capacity estimation included. The voltage residual is shown in Figure 12a together with the usual statistics. This residual has higher L stat value than the one from Figure 6a, which may be explained by the influence of added capacity estimation. The estimates of R ohm and R p , plotted in Figure 12b,d with respect to SoC and temperature, respectively, are similar to those from Figure 6b,d, but with slightly higher correlation with temperature for both resistances. Finally, it should be noted that there are no distinguishable sets of estimated U oc curves in Figure 12c (unlike in Figure 6c), because estimated U oc (SoC) now describes the central curve while the hysteresis is accounted for in the model (see Figure 7 and Equations (10) Energies 2020, 13, 540 13 of 16 and (11)). Estimated U oc (SoC) is slightly larger than the recorded one (see Figure 3c for details about U oc (SoC) identification) because the latter is discharge U oc (SoC) curve while we estimate the average U oc (SoC) since hysteresis is explicitly modelled in this case. The overall estimation algorithm is parametrized as given in Appendix A.
Energies 2020, 13, 540 13 of 16 Equations (10) and (11)). Estimated ( ) is slightly larger than the recorded one (see Figure 3c for details about ( ) identification) because the latter is discharge ( ) curve while we estimate the average ( ) since hysteresis is explicitly modelled in this case. The overall estimation algorithm is parametrized as given in Appendix A.

Conclusion
An algorithm for dual estimation of battery state-of-charge (SoC) and remaining charge capacity has been proposed, which is aimed to be accurate over the whole battery lifetime and real-driving conditions including varying ambient temperatures. This was achieved by simultaneous estimation of relevant battery degradation-dependent parameters such as internal resistances and parameters of open-circuit voltage vs. SoC characteristic, ( ). To this end, the dual extended Kalman filter-based SoC estimation algorithm has been extended to estimate parameters of the characteristic ( ) along with the resistance parameters. This extension allows the DEKF to adapt for ( ) variations and capture its hysteresis without explicitly modelling it. The latter can be useful in cases when the exact hysteresis profile is not known in advance or when it needs to be updated at the given state-of-health level without a specific identification experiment.
Next, a battery capacity estimator has been designed as a separate estimator, as it is based on a different model than the one that has been used in the DEKF design. Moreover, capacity estimation is meant to be executed on a significantly slower time scale than the DEKF. It has been shown that the EKF-based capacity estimator gives rather inconsistent estimates with a slow convergence rate, which is explained by a distinctively nonlinear capacity model. Capacity estimator has, therefore, been designed by using a sigma-point Kalman filter (SPKF). Furthermore, it has been demonstrated that SoC and capacity estimators (i.e., DEKF and SPKF, respectively) cannot be started in a coupled manner, unless it is ensured that both estimators have converged. A capacity convergence detection algorithm has, therefore, been designed to automatically couple the two estimators.

Conclusions
An algorithm for dual estimation of battery state-of-charge (SoC) and remaining charge capacity has been proposed, which is aimed to be accurate over the whole battery lifetime and real-driving conditions including varying ambient temperatures. This was achieved by simultaneous estimation of relevant battery degradation-dependent parameters such as internal resistances and parameters of open-circuit voltage vs. SoC characteristic, U oc (SoC).
To this end, the dual extended Kalman filter-based SoC estimation algorithm has been extended to estimate parameters of the characteristic U oc (SoC) along with the resistance parameters. This extension allows the DEKF to adapt for U oc (SoC) variations and capture its hysteresis without explicitly modelling it. The latter can be useful in cases when the exact hysteresis profile is not known in advance or when it needs to be updated at the given state-of-health level without a specific identification experiment.
Next, a battery capacity estimator has been designed as a separate estimator, as it is based on a different model than the one that has been used in the DEKF design. Moreover, capacity estimation is meant to be executed on a significantly slower time scale than the DEKF. It has been shown that the EKF-based capacity estimator gives rather inconsistent estimates with a slow convergence rate, which is explained by a distinctively nonlinear capacity model. Capacity estimator has, therefore, been designed by using a sigma-point Kalman filter (SPKF). Furthermore, it has been demonstrated that SoC and capacity estimators (i.e., DEKF and SPKF, respectively) cannot be started in a coupled manner, unless it is ensured that both estimators have converged. A capacity convergence detection algorithm has, therefore, been designed to automatically couple the two estimators.
Finally, the overall estimator has been successfully verified based on real driving cycle data acquired by using a fully electric scooter equipped with a telemetry measurement system. The DEKF output voltage estimation residual distribution was confirmed to be close to the voltage measurement noise, while resistance estimates showed expected correlations with temperature. The estimated capacity was shown to be close to the measured one and expectedly correlated with temperature, as well.
Future work will be directed towards further extensions and verifications of the proposed estimator to account for temperature-and aging-dependent variations of the polarization time constant τ p and further analyze the sensitivity of estimator for broader operating conditions (e.g., wider temperature range), respectively. The emphasis will be on using the estimator to track battery degradation features in support of modelling the battery degradation process. Funding: It is gratefully acknowledged that this work has been supported through a small-scale grant program of the University of Zagreb, related to the project entitled "Experimental Characterization of Electric Scooter Battery Pack Aging", as well as through project "Advanced Methods and Technologies in Data Science and Cooperative Systems" (DATACROSS) of the Centre of Research Excellence within the University of Zagreb.

Conflicts of Interest:
The authors declare no conflict of interest.