Abstract
Battery management system (BMS) is an important part of electric vehicle that can improve the efficiency of battery and ensure the safety during operating process. State of charge (SOC) estimation is one of kernel technology of BMS. High precision of SOC estimation can not only increase service life of battery, but also enhance energy utilization efficiency and cut down the operational cost. Based on fully understand working principle of battery, three-order RC equivalent circuit is chose to simulate the external characteristics. Introduce the working theory of that combination of extended Kalman filter (EKF) and open circuit voltage (OCV), and the whole recursive algorithm of estimation SOC, using the OCV-SOC look-up table to solve the problem of initial value of SOC to a certain degree. The hardware circuit and software of BMS are designed. Hardware circuit consists of current measurement circuit, voltage measurement circuit, temperature measurement circuit and equalization circuit. The software is designed by C as the development language, the Microsoft Visual Studio 2008 as development environment and SQL Server 2008 as database management system. The experiments are carried out after the experimental platform of system hardware and software is constructed. The system realizes the real-time online monitoring of BMS, SOC estimation and etc. The result verifies the reliability and feasibility. The precision requirement of SOC estimation by using EKF algorithm and OCV-SOC look-up table meets the national standard for electric vehicle.
Keywords
Introduction
Nowadays the problem of energy and environment getting worse, the automobile industry is changing from internal combustion engine to motor. New energy automobile is the developing direction of automobile industry, because of the mature technology and economy. Electric vehicle is the most promising one in new energy vehicle [1]. Electric vehicle is mainly driven by electric power, which not only combines the advantage of no emission, no noise and high energy conversion efficiency, but also has the advantage of simple structure and low operating cost.
BMS as a key component of electric vehicle is the intelligent core of and important component of whole vehicle energy system. BMS could monitor the status in real time, and can also optimize using battery energy, prolong the lifetime of battery and ensure the safety during operation [2]. Accurate estimation of SOC can reduce the production cost and improve the performance of BMS. Because of single cell working as packs in actual operation, they are easily restricted by many factors, such as the changing of temperature, the times of charging or discharging and the degree of aging, so it is not easy to get accurate estimation of SOC.
Scholars at home and abroad have studied the method of SOC estimation relatively early, and the research methods are also more extensive. There are many methods, such as the current integration method [1], open circuit voltage method, discharge experiment method, AC impedance method, Kalman filter method, artificial neural network method, fuzzy inference method, and etc [3–7]. Each method has some drawbacks. Now, scholars always will combine the advantage of some methods to improve the accuracy of SOC estimation [8]. This paper proposes a smart data algorithm for BMS.
Methodology
System main program
The software of the system principally includes three parts: the state information collection, SOC estimation and data communication. Based on module theory, it is mutually independent between each module; it does not interfere with each other, run their own programs [9–11].
In the aspect of software design, under the Visual studio 2008 development environment, the code of each program is compiled, and the correctness of the code is verified by software simulation. After the software design is completed, the function of the system is tested to check whether the designed system can meet the needs in practical application.
EKF algorithm
If using Kalman filter, what can’t be avoided is initial value of SOC. We need set initial value for state variable at the beginning of recursive operation [12]. We will update the initial value of SOC by corresponding relation between OCV and SOC of cell in steady state (working current is 0A), but getting the corresponding relation between OCV and SOC need let the cell stand for hours. It is impossible in the practical use of electric vehicle. The weak current system is still in working state even though the electric vehicle is stopped.
So we need set a threshold value of working current I and a judgment value of the length of parking time T. the concrete process is presented here: when the working current is less than I and the length of parking time is greater than T, update the initial value of SOC by corresponding relation between OCV and SOC. If not, update the initial value of SOC with the latest estimated value of SOC according to saved historical information in BMS [13]. The algorithm flowchart is shown in Fig. 2.

Software flow chart of the main program.

EKF and OCV algorithm flow chart.
Kalman filter utilizes the input and output data to seek the optimal estimation of the internal state. We use the working current as the system incentive; It affects the change of the other parameters of battery, including remaining capacity, electro-motive force and working voltage of the battery [14]. Use working voltage as the observation variable, use the voltages of Ohmic internal resistance and RC order network as state parameters. According to selected equivalent circuit model, the state space model of SOC estimation can be built, where C cap is the capacity of the battery, W
k
represents stochastic noise that affects system input and output.
Rewrite the upper expressions to matrix as follows:
We can get the state equation:
Software design of data acquisition program
All communication of LTC 6803 is realized with SPI bus. Data transmission is in one unit for every eight bits of data in working condition. During the process of writing data, data of SDI latch in device when the rising edge of the SCKI. In the same way, during the process of reading data, SDO output is valid at the rising edge of the signal of SCKI. Complete the data conversion at the falling edge of the signal of SCKI.
CSBI is a selection pin of the chip. It is low level effective. I changes into high level after completing the data conversion. Packet Error Code (PEC) byte is cyclic redundancy check value. The function of STCVAD instruction is realizing the measurement of voltage [15, 16].
LTC 6803 can acquire the voltage and temperature of single cell. The operation of LTC 6803 is mainly to configure register for reading and writing [17–19]. LTC 6803 consists of configuration register, voltage register, temperature register, flag register, packet error code and diagnostic register. It needs to have the initialization operation to LTC 6803 before reading data.
After completing the initialization configuration, start the operation of single cell voltage conversion. The controller send the start conversion command (STCVAD) and its PEC to LTC 6803, then send the reading cell voltage command (RDCV), reading the data when the cell voltage conversion is completed, calculate and check the data with moving average filtering to eliminate the interference and error.
In order to improve accuracy, the incoming signal of the Hall sensor need to be converted to a voltage in the 0–5 V range after the conditioning circuit, then carrying out AD transformation. The initialization work is mainly of configuring the conversion and sampling precision, determine whether the conversion is complete or not according to the AD conversion completion mark, then reading and calculating the value of voltage. Even though there is no current in the wire, the AD conversion also will get a smaller fixed value called offset. So it need to subtract the offset form the value of collected voltage for getting the value of real voltage, the accuracy of current acquisition is improved to a certain extent. In the final step, it uses moving average filtering to the final value of voltage.
After the main program finished collecting the data of battery, enter the equalization element program. First of all, carry out the digital filtering and upper and lower elimination to the collected voltage of cell, find out the highest and lowest voltage of cell, transfer energy form the highest cell to the lowest cell by closure and disconnection the switch element. Figure 4 is the equalization program flow chart.

The current acquisition program flow chart.

Software flow chart of the main program.
This system adopts Visual Studio 2008 integrated development environment (IDE) design software, using the C as the development language, and the SQL server 2008 as the database management system. C is a new, simple, object-oriented programming language developed by Microsoft for the application of.NET. Project builder can define domain-specific attribute and apply them to class, interface and etc. The function of C language is to call components object model (COM) and application programming interface (API).
The part of software involves the communication between the upper computer and lower computer, the data processing from lower computer to the upper computer, and the design of human computer interface. Based on the voltage, current and temperature of the battery that the lower computer send to the upper computer, upper computer make the judgment and then display the data in upper computer interface. The software screenshot is shown in Fig. 5.

Software screenshot.
The battery management system structure of the electric vehicle is shown in Fig. 6. The LTC6803 is a complete battery monitoring IC that includes a 12-bit ADC and a precision voltage reference. Each LTC6803 can measure up to 12 series connected battery cells or super capacitors. Many LTC6803 devices can be stacked to measure the voltage of each cell in a long battery string.

The voltage measurement circuit.
The voltage measurement circuit is shown in Fig. 6, each LTC6803 has an individually addressable serial interface, allowing up to 16 LTC6803 devices to interface to one control processor and operate simultaneously. Each cell input has an associated MOSFET switch for discharging overcharged cell. The LTC6803 provides a standby mode to reduce supply current to 12μA. Furthermore, the LTC6803 can be powered from an isolated supply, providing a technique to reduce battery stack current to zero.
The equalization circuit we used is active balancing, energy storage element (capacitance) and a series of switch elements are used to transfer energy of the single cell with higher state of charge to the single cell with lower state of charge in the battery pack, so as to achieve the purpose of equalization. Figure 7 shows a topological structure of equalization circuit, all the single cells in battery pack equalized with the same capacitance, and switch element operated by electronic control unit (ECU).

Topological structure of equalization circuit.
In order to compare the experimental data, the experimental data acquisition area was selected with SOC less than 25%. The experimental platform is built according to the software of the chapter 2 and the hardware of the chapter 3. Measure the SOC value of BMS for a period of time. According to the measured value, draw the picture in Fig. 8.

Measurement result.
The result of the test is that the Fig. 8 reflects the corresponding relationship between the different open circuit voltage and the SOC. From the diagram, it can be seen that the OCV cancellation slope is shaking. The measurement process is the charging process. When the measurement time is less than 5 minutes, the measurement results of smart EFK algorithm and OCV algorithm are not very different. With the increase of measurement time, the difference between the results of smart EFK algorithm and OCV algorithm is getting larger. The result of the smart EFK algorithm is accurate, which shows that the SOC of the battery pack increases linearly. The results of OCV algorithm show a nonlinear increase. When the measured time is long enough (greater than 25 minutes), the measurement results of the two algorithms are basically the same. Therefore, compared with OCV algorithm, intelligent EFK algorithm can measure the SOC value of battery pack more quickly and accurately.
The hardware and software designed in this paper can realize collecting real time parameters such as voltage, current and temperature. The active balancing equalization circuit carried out can solve the problem of inconsistency in battery pack effectively. The system realizes the real-time online monitoring of BMS, SOC estimation and etc. The result verifies the reliability and feasibility. The system can monitor the running process of battery according to the data collected; suggest the fault related to battery system. Based on the three-order RC equivalent circuit, estimate SOC of battery by using the method of EKF and OCV, the accuracy request meets the national standard.
Footnotes
Acknowledgments
This work was supported by Natural Science Foundation Project of CQ CSTC(Grant No. cstc2018jcyjAX0812, CSTC2018JCYJA1571), Supported by Youth project of science and technology research program of Chongqing Education Commission of China. (No. KJQN201801212, Program of Chongqing Municipal Key Laboratory of Institutions of Higher Education (Grant No. 2017[3]), Program of Chongqing Development and Reform Commission (Grant No. 2017[1007]), Program of Innovation Team Building at Institutions of Higher Education in Chongqing (Grant No. CXTDX201601034).
