# A Virtual Sensor for Electric Vehicles’ State of Charge Estimation

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

- Starting from experimental data on vehicle speed, accelerator pedal position and battery bank voltage from an electric vehicle (EV) in a real driving environment, a virtual sensor for the battery current measurement was derived using support vector regression algorithms.
- The proposed virtual sensor is independent of the battery’s chemical operation and can be applied to different battery types. The proposed methodology takes into account only experimental measurements of the dynamics of the vehicle.
- A comparative study of the performance between the proposed methods and traditional techniques that use original data as input for GK-SVR and PK-SVR (for second and sixth order polynomials) is presented.

## 2. Current Virtual Sensor

## 3. Battery Model and SOC Estimation

- An ideal voltage source representing the open circuit voltage of the battery ${V}_{oc}$; this voltage has a non linear relation with the state of charge of the battery. This relation depends on the type of battery, but also on its temperature and age.
- Internal resistors, specifically the “ohmic” resistance represented by R and the polarization resistances ${R}_{1}$ and ${R}_{2}$.
- Capacitors that, in combination with the polarization resistances, are used to characterize the transient response during the transfer of power, represented by ${C}_{1}$ and ${C}_{2}$.

#### Parameter Estimation

## 4. Analysis Of Results and Discussion

## 5. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Tannahill, V.R.; Sutanto, D.; Muttaqi, K.M.; Masrur, M.A. Future vision for reduction of range anxiety by using an improved state of charge estimation algorithm for electric vehicle batteries implemented with low-cost microcontrollers. IET Electr. Syst. Transp.
**2015**, 5, 24–32. [Google Scholar] [CrossRef] - Sautermeister, S.; Falk, M.; Bäker, B.; Gauterin, F.; Vaillant, M. Influence of Measurement and Prediction Uncertainties on Range Estimation for Electric Vehicles. IEEE Trans. Intell. Transp. Syst.
**2018**, 19, 2615–2626. [Google Scholar] [CrossRef] - Scheubner, S.; Thorgeirsson, A.T.; Vaillant, M.; Gauterin, F. A Stochastic Range Estimation Algorithm for Electric Vehicles Using Traffic Phase Classification. IEEE Trans. Veh. Technol.
**2019**, 68, 6414–6428. [Google Scholar] [CrossRef] - Kontou, E.; Yin, Y.; Lin, Z. Socially optimal electric driving range of plug-in hybrid electric vehicles. Transp. Res. Part D Transp. Environ.
**2015**, 39, 114–125. [Google Scholar] [CrossRef][Green Version] - Srinivasa Raghavan, S.; Tal, G. Influence of User Preferences on the Revealed Utility Factor of Plug-In Hybrid Electric Vehicles. World Electr. Veh. J.
**2019**, 11, 6. [Google Scholar] [CrossRef][Green Version] - Hannan, M.A.; Hoque, M.M.; Hussain, A.; Yusof, Y.; Ker, P.J. State-of-the-Art and Energy Management System of Lithium-Ion Batteries in Electric Vehicle Applications: Issues and Recommendations. IEEE Access
**2018**, 6, 19362–19378. [Google Scholar] [CrossRef] - Xiong, R.; Cao, J.; Yu, Q.; He, H.; Sun, F. Critical Review on the Battery State of Charge Estimation Methods for Electric Vehicles. IEEE Access
**2018**, 6, 1832–1843. [Google Scholar] [CrossRef] - Fotouhi, A.; Auger, D.J.; Propp, K.; Longo, S.; Wild, M. A review on electric vehicle battery modelling: From Lithium-ion toward Lithium–Sulphur. Renew. Sustain. Energy Rev.
**2016**, 56, 1008–1021. [Google Scholar] [CrossRef][Green Version] - Liu, Z.; He, H. Model-based Sensor Fault Diagnosis of a Lithium-ion Battery in Electric Vehicles. Energies
**2015**, 8, 6509–6527. [Google Scholar] [CrossRef] - Barcellona, S.; Ciccarelli, F.; Iannuzzi, D.; Piegari, L. Modeling and Parameter Identification of Lithium-Ion Capacitor Modules. IEEE Trans. Sustain. Energy
**2014**, 5, 785–794. [Google Scholar] [CrossRef] - Hongwen, H.; Xiong, R.; Jinxin, F. Evaluation of Lithium-Ion Battery Equivalent Circuit Models for State of Charge Estimation by an Experimental Approach. Energies
**2011**, 4, 582–598. [Google Scholar] [CrossRef] - Li, Z.; Jiang, S.; Dong, J.; Wang, S.; Ming, Z.; Li, L. Battery capacity design for electric vehicles considering the diversity of daily vehicles miles traveled. Transp. Res. Part C Emerg. Technol.
**2016**, 72, 272–282. [Google Scholar] [CrossRef][Green Version] - Bascetta, L.; Gruosso, G.; Gajani, G. Analysis of Electrical Vehicle behavior from real world data: A V2I Architecture. In Proceedings of the 2018 International Conference of Electrical and Electronic Technologies for Automotive, AUTOMOTIVE 2018, Milan, Italy, 9–11 July 2018. [Google Scholar] [CrossRef]
- Storti Gajani, G.; Gruosso, G.; Valladolid, J.D. Electric Vehicle speed, pedal, accel, voltage and current data over four different roads. IEEE Dataport
**2019**. [Google Scholar] [CrossRef] - Archanah, T.; Deshmukh, S. Dimensionality Reduction and Classification through PCA and LDA. Int. J. Comput. Appl.
**2015**, 122, 4–8. [Google Scholar] [CrossRef] - Vapnik, V.N. Statistical Learning Theory; Wiley-Interscience: Hoboken, NJ, USA, 1998. [Google Scholar]
- Salcedo-Sanz, S.; Rojo-Álvarez, J.L.; Martinez-Ramon, M.; Camps-Valls, G. Support vector machines in engineering: An overview. Wiley Interdiscip. Rev. Data Min. Knowl. Discov.
**2014**, 4. [Google Scholar] [CrossRef] - Drucker, H.; Burges, C.J.C.; Kaufman, L.; Smola, A.J.; Vapnik, V. Support Vector Regression Machines. In Advances in Neural Information Processing Systems 9; Mozer, M.C., Jordan, M.I., Petsche, T., Eds.; MIT Press: Cambridge, MA, USA, 1997; pp. 155–161. [Google Scholar]
- Schölkopf, B.; Smola, A. Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond; Adaptive Computation and Machine Learning, Parts of this book, including an introduction to kernel methods, can be downloaded; MIT Press: Cambridge, MA, USA, 2002; p. 644. [Google Scholar]
- Ding, Y.; Cheng, L.; Pedrycz, W.; Hao, K. Global Nonlinear Kernel Prediction for Large Data Set With a Particle Swarm-Optimized Interval Support Vector Regression. IEEE Trans. Neural Netw. Learn. Syst.
**2015**, 26, 2521–2534. [Google Scholar] [CrossRef][Green Version] - Rojo-Álvarez, J.L.; Martínez-Ramón, M.; Muñoz-Marí, J.; Camps-Valls, G. Advances in Kernel Regression and Function Approximation. In Digital Signal Processing with Kernel Methods; John Wiley and Sons, Ltd.: Hoboken, NJ, USA, 2018; Chapter 8; pp. 333–385. Available online: http://xxx.lanl.gov/abs/https://onlinelibrary.wiley.com/doi/pdf/10.1002/9781118705810.ch8 (accessed on 4 February 2020).
- Noori, R.; Khakpour, A.; Omidvar, B.; Farokhnia, A. Comparison of ANN and principal component analysis-multivariate linear regression models for predicting the river flow based on developed discrepancy ratio statistic. Expert Syst. Appl.
**2010**, 37, 5856–5862. [Google Scholar] [CrossRef] - Haghiabi, A.H.; Parsaie, A.; Ememgholizadeh, S. Prediction of discharge coefficient of triangular labyrinth weirs using Adaptive Neuro Fuzzy Inference System. Alex. Eng. J.
**2018**, 57, 1773–1782. [Google Scholar] [CrossRef] - Hooshyaripor, F.; Tahershamsi, A.; Behzadian, K. Estimation of peak outflow in dam failure using neural network approach under uncertainty analysis. Water Resour.
**2015**, 42, 721–734. [Google Scholar] [CrossRef][Green Version] - Huang, Y.; Clerckx, B. Relaying Strategies for Wireless-Powered MIMO Relay Networks. IEEE Trans. Wirel. Commun.
**2016**. [Google Scholar] [CrossRef][Green Version] - Sidhu, A.; Izadian, A.; Anwar, S. Adaptive Nonlinear Model-Based Fault Diagnosis of Li-Ion Batteries. IEEE Trans. Ind. Electron.
**2015**, 62, 1002–1011. [Google Scholar] [CrossRef][Green Version] - Bellavia, S.; Gratton, S.; Riccietti, E. A Levenberg–Marquardt method for large nonlinear least-squares problems with dynamic accuracy in functions and gradients. Numerische Mathematik
**2018**. [Google Scholar] [CrossRef][Green Version] - Mohammad, H.; Waziri, M.Y. On Broyden-like update via some quadratures for solving nonlinear systems of equations. Turk. J. Math.
**2015**, 39, 335–345. [Google Scholar] [CrossRef] - Transtrum, M.K.; Sethna, J.P. Improvements to the Levenberg-Marquardt algorithm for nonlinear least-squares minimization. arXiv
**2012**, arXiv:physics.data-an/1201.5885. [Google Scholar] - Qiao, J.; Wang, L.; Yang, C.; Gu, K. Adaptive Levenberg-Marquardt Algorithm Based Echo State Network for Chaotic Time Series Prediction. IEEE Access
**2018**, 6, 10720–10732. [Google Scholar] [CrossRef]

**Figure 1.**General description of the architecture used for state of charge estimation (SOC) estimation.

**Figure 3.**A sample of predicted current on the same route used for training—in this case Route 1. The PCA + PK6 model is not shown.

**Figure 4.**Normalized histogram of the developed discrepancy ratio (DDR) values for the four methods in the training stage. (

**a**) PCA + GK-SVM, (

**b**) PCA + PK2-SVM, (

**c**) GK-SVM and (

**d**) PK2-SVM.

**Figure 5.**Current prediction: Training using a 15’ sample of Route 1 and Testing on a small portion of Route 2.

**Figure 6.**Current prediction: Training using a 15’ sample of Route 1 and Testing on a small portion of Route 3.

**Figure 7.**Current prediction: Training using a 15’ sample of Route 1 and Testing on a small portion of Route 4.

Routes | |||||
---|---|---|---|---|---|

Type | Duration (s) | Init SOC | Max Speed | Activity % | |

1 | urban (lt) | 2000 | 89 | 60 | 74.5 |

2 | urban (ht) | 1100 | 81 | 55 | 49.6 |

3 | mixed | 1630 | 72 | 60 | 84.2 |

4 | urban (lt) | 1830 | 99 | 60 | 53.5 |

**Table 2.**RMSE (root mean square error) of SVR training for GK, PK2, PCA + GK, PCA + PK2 and PCA + PK6 models.

SVR Training RMSE (A) | |||||
---|---|---|---|---|---|

Route | GK | PK2 | PCA + GK | PCA + PK2 | PCA + PK6 |

1 | 11.6 | 46.1 | 3.58 | 10.6 | 4.16 |

2 | 29.6 | 49.0 | 6.16 | 14.1 | 6.73 |

3 | 32.9 | 35.3 | 10.3 | 18.2 | 13.3 |

4 | 17.9 | 123 | 8.15 | 17.1 | 11.2 |

**Table 3.**Mean absolute error (MAE) of SVR training for GK, PK2, PCA + GK, PCA + PK2 and PCA + PK6 models.

SVR Training MAE | |||||
---|---|---|---|---|---|

Route | GK | PK2 | PCA + GK | PCA + PK2 | PCA + PK6 |

1 | 2.60 | 38.2 | 1.43 | 4.78 | 1.91 |

2 | 9.50 | 42.2 | 2.31 | 6.54 | 2.89 |

3 | 11.9 | 29.8 | 4.10 | 10.3 | 6.53 |

4 | 6.46 | 99.1 | 2.98 | 7.37 | 3.50 |

**Table 4.**RMSEs of SVR PCA + GK, PCA + PK2 and PCA + PK6 models trained using four routes tested against the other routes.

Training | Test Route | |||||
---|---|---|---|---|---|---|

Model-Route | 1 | 2 | 3 | 4 | Score | |

PCA + GK | 1 | 3.98 | 14.44 | 14.77 | 16.91 | 12.53 |

2 | 9.16 | 8.03 | 17.38 | 19.83 | 13.6 | |

3 | 16.93 | 19.71 | 12.21 | 16.18 | 16.26 | |

4 | 17.04 | 39.08 | 13.13 | 9.26 | 19.63 | |

PCA + PK2 | 1 | 12.75 | 17.80 | 19.77 | 31.84 | 20.54 |

2 | 19.49 | 15.30 | 19.85 | 18.88 | 18.38 | |

3 | 26.39 | 29.02 | 21.07 | 26.52 | 25.75 | |

4 | 22.26 | 24.32 | 21.32 | 19.43 | 21.83 | |

PCA + PK6 | 1 | 4.99 | 15.80 | 14.26 | 27.33 | 15.60 |

2 | 11.13 | 9.55 | 17.55 | 12.47 | 12.68 | |

3 | 20.97 | 20.13 | 15.01 | 16.58 | 18.17 | |

4 | 18.36 | 25.75 | 16.37 | 12.33 | 18.20 |

**Table 5.**MAEs of SVR PCA + GK, PCA + PK2 and PCA + PK6 models trained using four routes tested against the other routes.

Training | Test Route | |||||
---|---|---|---|---|---|---|

Model-Route | 1 | 2 | 3 | 4 | Score | |

PCA + GK | 1 | 1.74 | 6.89 | 7.17 | 7.12 | 5.73 |

2 | 5.21 | 3.01 | 10.18 | 11.22 | 7.40 | |

3 | 8.38 | 10.01 | 7.13 | 7.83 | 8.34 | |

4 | 8.90 | 13.23 | 7.75 | 4.59 | 8.62 | |

PCA + PK2 | 1 | 5.88 | 17.80 | 19.77 | 16.19 | 14.91 |

2 | 9.22 | 8.13 | 11.00 | 9.99 | 9.59 | |

3 | 13.45 | 16.01 | 10.76 | 12.15 | 13.09 | |

4 | 10.07 | 13.11 | 10.13 | 9.93 | 10.81 | |

PCA + PK6 | 1 | 2.01 | 7.98 | 7.15 | 14.98 | 8.03 |

2 | 6.84 | 4.96 | 8.25 | 6.64 | 6.67 | |

3 | 11.09 | 10.33 | 7.56 | 8.28 | 9.32 | |

4 | 8.88 | 14.00 | 8.22 | 6.17 | 9.32 |

Identified Item | Value |
---|---|

R | 0.0056 $\Omega $ |

R1 | 0.040858 $\Omega $ |

R2 | 0.025259 $\Omega $ |

C1 | 9484 F |

C2 | 71.049 F |

PCA + GK-SVR | PCA + PK2-SVR | |
---|---|---|

FIT | 91.80% | 85.423% |

RMSE | 0.007 | 0.014 |

MAE | 0.005 | 0.011 |

PCA + GK-SVR | PCA + PK2-SVR | |
---|---|---|

FIT | 87.49% | 71.76% |

RMSE | 0.058 | 0.127 |

MAE | 0.053 | 0.114 |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Gruosso, G.; Storti Gajani, G.; Ruiz, F.; Valladolid, J.D.; Patino, D. A Virtual Sensor for Electric Vehicles’ State of Charge Estimation. *Electronics* **2020**, *9*, 278.
https://doi.org/10.3390/electronics9020278

**AMA Style**

Gruosso G, Storti Gajani G, Ruiz F, Valladolid JD, Patino D. A Virtual Sensor for Electric Vehicles’ State of Charge Estimation. *Electronics*. 2020; 9(2):278.
https://doi.org/10.3390/electronics9020278

**Chicago/Turabian Style**

Gruosso, Giambattista, Giancarlo Storti Gajani, Fredy Ruiz, Juan Diego Valladolid, and Diego Patino. 2020. "A Virtual Sensor for Electric Vehicles’ State of Charge Estimation" *Electronics* 9, no. 2: 278.
https://doi.org/10.3390/electronics9020278