Microcomputer Energy Saving Control System for Electric Vehicles Under Artificial Intelligence

Faced with the problem of dwindling oil resources and increasingly strict automobile exhaust emission standards, the advantages of pure electric vehicles in energy saving and emission reduction have become more and more prominent compared with traditional fuel vehicles. However, in view of the current development scale of the pure electric vehicle market, there are still many deficiencies in the aspects of power density, cycle service life and replacement cost. This paper mainly studies the microcomputer energy saving control system of electric vehicle under the background of artificial intelligence. In this paper, the STM32F103 series chip is used as the main control chip of the battery energy management system. Then according to the requirements of the subject of each module circuit design, forming a complete battery energy management system circuit design. In this paper, the designed electric vehicle energy management system has been tested. The test results show that the electric vehicle battery energy management system has perfect function, sTable operation, and can realize the energy management of electric vehicle battery pack. It can accurately predict the state of charge of electric vehicle lithium battery, and effectively improve the battery performance of electric vehicle lithium battery, and achieve the effect of energy saving.


Introduction
With the acceleration of urbanization and the rapid development of transportation industry, oil and other limited oil and gas resources are increasingly strained. The development and research of new energy with renewable energy as the main energy has become an important content of energy enterprises and a new direction of the development of various industries. With the progress of modern science and technology, new energy not only plays a huge positive role in environmental improvement, but also has a broad space for improvement in production and operation cost saving and conversion efficiency. But the cost of electric vehicles, battery life, battery safety a series of problems such as the electric vehicle is restricted by the popularity of the key factors, the study of electric vehicle is mainly on the research of the electric vehicle battery pack, the study of electric vehicle battery pack is mainly on the research of the battery energy management system, namely the study of the working state of the 2 battery pack testing. It mainly includes real-time display of some parameters of the battery pack in the working process (current parameters, voltage parameters, temperature parameters, etc.), estimation of the remaining capacity of the battery pack, estimation of the health degree of the battery pack, and equilibrium degree of the battery pack [1].
The energy management strategies of pure electric vehicles mainly include energy feedback strategy, battery management strategy, energy transfer efficiency, energy consumption of high-voltage accessories, energy consumption of low-voltage accessories, etc. The energy management strategy of electric vehicle is the key technology that affects the economy and comfort of electric vehicle. The quality of the energy management strategy directly affects the driving range of the vehicle. Soumeur composite power system by establishing the mathematical model, in order to reduce the battery to lose power and improve the system energy utilization efficiency as the goal, respectively, using the dynamic programming algorithm and model predictive control, optimize the composite power energy management strategy, in order to realize the energy distribution for more effective control of the complex power, the results reached the expected goal [2]. Junquera analyzed the energy management optimization problem of pure electric vehicles in the composite power supply system composed of battery and ultracapacitor, determined the distribution factor by using fuzzy control algorithm, and then distributed the power, and proposed a new fuzzy control strategy for energy management of electric vehicles with dual energy sources based on particle swarm optimization algorithm [3].
This paper takes the energy management system of electric vehicle as the research background, chooses the lithium battery as the research object, chooses the STM32F103 series chip as the main control chip, and carries on the software design, mainly including the cell voltage detection, cell temperature detection, cell current detection, estimation of SOC and so on.

Hardware Design
2.1.1. Main Control Chip. The system in this paper is built on the basis of electric vehicle, so the following points should be considered when choosing the main control chip: powerful computing power and the ability to process data; Need to be able to work over a wide range of temperatures; can bus communication is required; There are enough I/O ports; there should be more storage space inside the chip; to be able to adapt to a variety of complex road conditions; low cost, high-cost performance.
Considering the above requirements, this topic can choose STM32F103ZET6 as the main controller chip, it is an economical and suiTable, and powerful single chip microcomputer, is produced by STMicroelectronics based on the ARM-based 32-bit processor, the capacity of flash memory can reach 512KB, its working frequency up to 72MHz [4]. The chip also has serial communication interface (SCI), serial peripheral interface (SPI), CAN bus communication interface and 112 general I/O interfaces. It has many advantages such as perfect function, low power consumption, high working frequency, large storage capacity and high integration [5]. The chip is economical and applicable, and fully meets the selection requirements of the main control chip of this topic. Therefore, considering comprehensively, this topic chooses STM32F103ZET6 MCU as the main controller chip of the hardware.

Power Circuit Design.
In this paper, STM32F103ZET6 is used as the master controller control chip, and the power supply of the master control is the precondition of the normal operation of the whole hardware, so the design of the power supply circuit of the master control chip is essential. Because this topic is for electric vehicles, and electric vehicles usually on the power supply is generally 12V, 24V, 48V. The power supply voltage of this battery energy management system is 24V, while the working voltage of STM32F103ZET6 is 2V-3.6V. The battery energy management system in this paper needs to use 3.3V DC power supply, so it is necessary to convert the power supply voltage. 24V can be first converted to 5V DC power supply, and then 5V to 3.3V DC power supply. In the 24V conversion to 5V circuit, we can choose 7805 step-down chips, the chip can be converted from 24V input voltage to 5V output. In the conversion process, the voltage drop amplitude is too large, and impurities may appear, so it is necessary to add capacitors in the design process to filter. Since there will be bands of different frequencies in the impurity wave, capacitors of different sizes should be added to filter these bands. At the same time, a diode can be added at the input end to prevent the positive and negative poles of the power supply from being connected in the input voltage, which will cause the whole circuit to burn out.
To convert 24 V to 5 V voltage, also need to the next conversion, converted into 3.3 V to 5 V voltage, because the voltage conversion is a small voltage transformation, so that we may choose AMS1117-3.3 step-down chip, the chip is a low dropout voltage regulator, the output voltage can be adjusted within the range of 1.25 V to 13.8 V, wide temperature range, the accuracy can reach 1%. The chip is an integrated chip, internal thermal protection function, can prevent the influence of high temperature on the conversion circuit, damage. At the same time, impurity waves of different frequencies will appear in the process of circuit conversion, so it is necessary to add filter capacitors of different sizes to filter out the redundant bands, so as to ensure the safety and stability of the circuit in the process of conversion.

Software Design
The voltage acquisition chip controls the operation through the master control chip, the master control chip sends instructions, the voltage acquisition chip accepts the instructions, executes the response action and gives the information feedback, the master control chip analyzes the data according to the returned data, calculates the monolithic voltage and the temperature channel temperature value.
In the program, Sm is set as the sampling flag bit, Sm =0 does not sample, and Sm =I enter the voltage sampling. The initial configuration of LTC6803-2 is carried out first, and then the voltage collection is carried out.
After the voltage acquisition chip is initialized, the master control chip accepts the requirement to query the single voltage data, and processes the received data, verifies the data through CRC verification, and filters the received data through average filtering algorithm to reduce the data error.

2.2.2.
Temperature Acquisition Program. Acquisition marks a SM = 2 enter the temperature sampling, initialized on voltage acquisition chip configuration first, then the temperature acquisition, master control chip by send LTC6803-2 temperature conversion commands can be entered into the phase of temperature conversion, master control chip, and then send the temperature read command, when the temperature of the main control chip receives the data, through the CRC check for calibration, data by average value filtering algorithm for receiving data filtering processing, reduce data error.

Current Collection
Program. The acquisition flag bit SM=3 enters the current collection. The current collection mainly reads the output current value of the Hall sensor and collects the signal value through the AD interface. The received data is filtered through the average filtering algorithm, and then the current value is calculated.

SOC Estimation.
The electric master control chip first conducts self-test, reads the storage SOC value, and determines the battery state by judging the current size and direction. If it is the discharge state, calculate the time difference between the current on and the last off power t. If t meets the standing time t, the OCV-SOC lookup Table is conducted to obtain the initial SOC0 value. If not, the SOC-OCV Table lookup is also performed to determine that the difference between the SOC0 value of the lookup Table and

SOC Estimates
SOC is the state of charge of the battery, reflecting the remaining capacity of the battery, which can be defined as follows: Where, Qloss is the discharge capacity of the battery; QR is the rated battery capacity. It is difficult to estimate the battery SOC due to the constant changes of the parameters of lithium batteries due to the complex operating conditions of automobiles. In order to solve this problem, researchers at home and abroad have done a lot of research. Due to the complex chemical reaction of batteries, SOC cannot be calculated directly. At present, most of the SOC is estimated indirectly according to the external characteristic parameters of the battery (open-circuit voltage, internal resistance, etc.) [6][7].
Kalman filter is an algorithm that utilizes linear system equation of state to estimate system state optimally through system input and output observation data. It is widely used in radar tracking, petroleum exploration, tracking and navigation and wireless communication [8][9].
Data filtering is a data processing method by filtering the noise in the real data to get the pure data. Kalman filter can be used to estimate the dynamic system state in the data containing measurement noise with known measurement variance. Kalman can be realized by computer programming with low programming difficulty and can process real-time collected data, which occupies less computer memory and is suiTable for application in automobiles [10].
The calculation formula of Kalman filter algorithm is mainly composed of two parts: state equations and measurement equations. The specific formula is as follows:

Experimental Equipment
The main instruments required for the test in this paper are: 20 lithium ion batteries with discharge cut-off voltage of 2.7V, working voltage of 3.7V and charging cut-off voltage of 4.2V; the designed main controller module and the sub-modules; a PC upper computer; 1 charging equipment; anumber of loads (the same load parameters); digital multimeter; acomputer;one oscilloscope.

Test Content
The system designed in this paper mainly includes voltage module acquisition, current module acquisition, temperature signal acquisition, communication module, display module and battery SOC estimation module. Therefore, the main test of this topic is also the collection function, communication function and display function of the system. At the same time, it also monitors whether the current current and voltage value can be displayed in real time, so as to determine the current SoC value according to the algorithm, and compare the SoC value at that time with the actual SoC value to see whether the error is within a reasonable range.

Experimental Process
(1) First connect the serial lithium battery pack to the designed main controller chip to supply power to the battery management system; (2) Carry out charging and discharging experiments on the battery, and record the voltage change and corresponding time at this time; (3) The designed main control system and each sub-module are used for data acquisition, mainly to collect real-time voltage, real-time current, temperature and other data of the battery. At the same time, the algorithm is burned into the main control chip to estimate the real-time SOC value of the battery.
(4) Connect the main control system with the upper computer and computer, and read the experimental data from the computer.

Current Voltage Monitoring
At the same time, the voltage, current and temperature data are collected in real time and the SOC is calculated. The calculated SOC value is sent to the PC through the communication circuit, and the real-time data is read on the PC.   Table 1, the discharge experiments, voltage, electric current change constantly with the change of time, the longer, lower voltage, discharge and at the same point in time, the measured value and true value is very close to, the terminal voltage error was 1.37%, the minimum error is 0.08%, so you can think is conform to the requirements of the design of the system.

Figure 2. Comparison diagram of SOC and time in discharge experiment
As shown in Figure 2, SOC is gradually decreases with the increase of discharge time, discharge time, the smaller the value of the SOC, at the same time, the discharge experiments, SOC are very close to the real value and predicted values, existing error within 5%, which again, this topic design of electric vehicle battery power management system is reasonable, and states that discharge experiment method is one of the most reliable method of detection of SOC.
As can be seen from the above experimental data and the obtained images and charts, the SOC value of the system is not only related to the terminal voltage at both ends of the load, but also related to the discharge time. The smaller the terminal voltage, the smaller the SOC value of the system. The longer the discharge time is, the smaller the value of SOC is. The more times of charging and discharging, the smaller the percentage of battery remaining capacity; at the same time in the discharge process, due to the use of the acquisition circuit, the use of the main control chip, will make the system SOC decreases, will also cause the increase of temperature, so in the actual system also need temperature control, but because the workload is huge, it omitted the design of temperature control.

Conclusions
With the concept of environmental protection becoming increasingly popular, it is of great significance to actively promote the healthy development of pure electric vehicles to improve the environment and relieve the pressure on the supply of fossil energy resources. In this paper, the lithium battery pack as the core of the research, for the electric vehicle for the systematic and modular research, and made a test test, to judge the accuracy of the designed system. The hardware and software of the battery management system are designed and analyzed. The distributed design scheme is adopted, and the master control unit is responsible for data calculation and strategy operation to ensure the efficient operation of each module. In this paper, the designed system discharge test, the voltage, current, temperature obtained by the discharge experiment and the system to collect the voltage, current, temperature signals for comparison, at the same time to calculate the experimental value and the percentage of the error value, within a certain error range, we can think that the designed system is reasonable.