Fitting the OCV-SOC relationship of a battery lithium-ion using genetic algorithm method

. In response to the need of reducing fossil fuel dependence and environmental impacts for ground transportation, electric vehicles (EVs) powered by lithium-ion batteries (LIBs) are being intensively researched and they have placed on the forefront as alternative vehicles. The state of charge (SOC) is one of the most important states of LIBs that is monitored online. However, the model-based method state of charge estimation requires an accurate Open circuit voltage (OCV), which is an important characteristic parameter of lithium-ion batteries, that is used to estimate battery state of charge (SOC). Therefore, accurate OCV modeling is a great significance for lithium-ion battery management. The polynomial OCV model uses the polynomial function to establish the relationship between OCV and SOC mapping. In this paper,8th degree polynomial fitting curve is considered and the genetic algorithm optimization method is proposed for estimating the parameters. The results show that the root mean square error can be decreased to 0.002. However, the best fitting OCV-SOC curve can increase the accuracy of the model and improve the accuracy of battery state estimation.


Introduction
Due to the global energy crisis and environmental deterioration in recent years, high-efficiency electric vehicles (EVs) have become a hot spot in the automotive industry. Lithium-ion batteries have become the popular choice for EVs because of their advantages of lightweight, fast charging, small size, high energy density, and low self-discharge, and long lifespan. The battery management system (BMS) is the core device of EV, robust battery management system is needed to enhance the lifetime, efficiency, and reliability of lithium-ion batteries. the main function of BMS is to monitor and measure the state of health (SOH), state of power, and specifically, the state of charge (SOC), which is an important parameter reflecting the state of the battery residual capacity. The battery SOC not only immeasurable directly using the available suite of vehicle sensors, because it's depended essentially on many factors, such as current-voltage and temperature and age but also exhibit coupling effect during their evolutionary process. This necessitates the development of a viable state estimation algorithm.
A large number of SOC estimation approaches have been proposed [1]. In general, they can be divided into four categories: -characteristic parameter (CP)-based methods, they estimate the SOC by characteristic parameters such as open-circuit voltage (OCV), internal resistance, and impedance.
-Coulomb counting methods, is one of the simplest methods of SOC estimation. It is used to find a direct relationship between the SOC and battery charging/discharging current.
However, it is highly limited by accumulated errors caused by inaccurate initial SOC values and current measurement errors. -Open-circuit voltage method: In this method, the SOC-OCV relationship is derived from the stepwise measurement of OCV for different values of SOC. OCVM has a high precision and easily implemented for SOC estimation. -Machine learning method: ML-based approaches treat the battery as a black box and directly learn its internal dynamics through large amounts of charge-discharge data to establish the nonlinear relationship between the SOC and measured variables, such as voltage, current and temperature [2]. They have attracted extensive attention in recent years.
Some machine learning tools, such as artificial neural network, fuzzy logic, support vector mechanism, support vector regression, and genetic algorithms (GA), are used for SOC estimation. However accurate SOC estimation requires enormous hardware (GPU and memory) to handle a large data set.
-Model-based method: the main principal of the modelbased SOC estimation method is to relate the measured battery signals (voltage, current and temperature) with the battery model. Three types of battery models, namely ECM (electrochemical model), EECM (electrical equivalent circuit model), and electrochemical ICIES'2020 impedance model (ECIM), are mainly employed in this method, among these models, the EECMs are most popular for estimating the SOC. The Thevenin-based model is used most commonly because of its simplicity, low computational complexity, and reasonable accuracy [3] [4]. For precise estimations of any state of a battery, the accuracy of the parameters identifications is important.
An important characteristic parameter of lithium-ion batteries is Open circuit voltage (OCV), it is used to analyze the changes of electronic energy in electrode materials, and to estimate battery state of charge (SOC), and manage the battery pack.
Therefore, accurate OCV modeling is a great significance for lithium-ion battery management. In order to obtain the OCV value of the corresponding SOC between two adjacent measuring points, the OCV is described as a function of SOC [5]. The most common function used to describe this relationship is the power function polynomial. Where ( 0 , 1 , … ) are the parameters that must be estimated.
To achieve a more accurate and robust estimation of battery SOC, various fitting methods are proposed, the most used method is the least square method.
In this paper, a model based on a Genetic Algorithm (GA) method is developed to estimate the parameters of the polynomial function. A key contribution of this study is the estimation of the OCV fitting parameters of the 8th polynomial function using the genetic algorithm optimization method. The purpose of improving the fitting accuracy by estimating OCV is achieved.
The remaining sections of this paper are as follows: Section 2 explains how we obtain the ocv-soc relationship experimentally. The proposed method of fitting this relationship is introduced in Section 3. In this section, we create a model based on a genetic algorithm to estimate the best parameters that lead to an accurate fitting. Section 4 shows the results of the proposed approach compared with real data. Finally, Section 5 concludes the paper.

OCV-SOC relationship
This relationship is extremally important is the first step in modelling any battery [6], it depends on the battery chemist [5]ry.

Open Circuit Voltage (OCV) Definition:
The OCV of a battery cell denotes the potential difference between the positive electrode and the negative electrode when no current flows and the electrode potentials are at equilibrium.

State of Charge (SOC) Definition:
The soc represents the ratio of the remaining capacity of the battery after a period of use or long-term suspension to its nominal capacity, it is nominal stated as the following equation: Where ( 0 ) and ( ) denote the initial and current value of SOC, respectively.
is the nominal capacity of the battery, represents the current, > 0 stands for discharge.
indicate charge and discharge efficiency of the battery. Eq. (1) can be converted to discrete format as follows: In order to obtain the ocv-soc relationship experimentally, first if you begin with a fully discharged battery and start charging it with very low c-rate, we obtain the open circuit voltage , then ones we reach a fully charge state at 100% we start discharge the cell with the same low C-rate, we will see that the discharge curve is different from the charge curve, which mean that, for the same SOC level, the value OCVs cannot be the same during charging and discharging because of the hysteresis characteristic. In some LIB chemistries, the hysteresis effect can be ignored, due to that we average the two curves together then we come up with a single relationship between the battery SOC and OCV. This particular curve Fig. 1. is obtained from an A123 LiFePO4 battery [7], it indicates the charge and the discharge of a battery at a low C-rate and the average between them. Since the OCV has a close relationship with SOC, the reflection of this relationship not only affects the SOC estimation, but also directly affects the identification of other parameters.

The Relationship between and SOC:
For the purpose of this study, the following key data were extracted from SAMSUNG 30Q INR18650 power lithium cell [8].

ICIES'2020
The OCV curve/map as function of SOC can be found in the form of a look-up table, using laboratory experiments [9]. Note that cells may follow different OCV-SOC curves during charging and discharging i.e., hysteresis, but the model here considers only the averaged OCV curve. Additionally, the long-term aging of OCV is also neglected.   The relationship between the OCV and SOC was developed to find the values of OCV between two data points, using n th order polynomial function. Since the fitted OCV should be as close to experimental OCV as possible, and the fitting performance is better with higher order polynomial function [10] [11], the 8 th order polynomial function was used: ( ) = 0 + 1 * + 2 * 2 + 3 * 3 + 4 * 4 + 5 * 5 + 6 * 6 + 7 * 7 + 8 * 8 (4) Where ( 0, 1 … 8) are the parameters that must be estimated using genetic algorithm method.

Genetic algorithm optimization method:
Genetic algorithms (GAs) are a heuristic search and optimization technique inspired by natural evolution that can be used to find the global minimum for highly nonlinear problems and they are based on an evolutionary model. They have been successfully applied to a wide range of real-world problems of significant complexity [12]. The algorithm of this method is shown in Fig. 3. First, the model begins with the creation of an initial population, second, the calculation of the fitness function of each individual, evaluate each individual and see which one has the best fit of the function, third select the parents based on their fitness, which means the points that have the best fitness will continue to the next generation or the next iteration, finally create a new population and repeating that intel we reach the best optimized state or the maximum number of iterations.

Result and Discussion
This section outlines the results of the polynomial fitting study of the OCV-SOC relationship using the genetic algorithm optimization method. The fitting performance will be evaluated by the indicator Root Mean Square Error (RMSE) between the experiment and the fitted data. Both ocv-soc relationship and polynomial function fitting curve in different population and generation has been recorded and presented in Fig. 5. The measured data are fitted well using the proposed method.    The input and the output of an experimental data of this relationship is a state of charge (SOC) and an opencircuit voltage (OCV) is used to feed the (GA) genetic algorithm optimized method that is based on the polynomial function in order to estimate the best parameters.
An 8 th order polynomial function is employed and parametrized to quantitively describe the nonlinear ocvsoc relationship using the genetic algorithm method. The polynomial coefficient in different generation and population are listed in the table. 4., and the RMSE between the measured data and the fitted curve are also presented in the table. 3. The Root Mean Square Error (RMSE) in 1000 generation and 10 population is 0.1 V and in 8000 generation and 50 population is 0.002 V, this indicates that the accuracy of the model can be improved by increasing the number of generation and the number of population. The importance of a good fitting ocv-soc relationship is to increase the accuracy of the state of charge (soc) estimation of a lithium-ion battery.

Conclusion
The state of charge (soc) of a lithium-ion battery is an important evaluation index for energy storage systems in electric vehicles. This paper focuses on improving the accuracy of soc estimation by improving the accuracy of the fitting curve of an ocv-soc relationship. The genetic algorithm optimization method has been proposed to tune the parameters of the 8th order polynomial function, that is used to fit the ocv-soc relationship. The accuracy of the proposed method has been simulated using different population and generation. The results indicate that the Root Mean Square Error (RMSE) between the measured data and the curve fitting can be reduced to 0.2%, provided that using a high population and generation. Since the genetic algorithm method has an excellent performance in fitting the ocv-soc relationship, it will be useful for reducing the error of a soc estimation of a lithium-ion battery in the future to ensure better results.