Design of battery management system based on DSP and OZ890
Abstract: Based on the design requirements and functions, this paper designs a battery management system for hybrid vehicles. Among them, the hardware system includes: power module, OZ890-based single voltage acquisition circuit and I2C communication circuit, DSP-based RS232
The design of hardware systems such as serial communication and CAN communication; the software system includes: the use of periodic interrupts and underflow interrupts to achieve data collection processing, SOC estimation and various communication programs.
Keywords: battery management system; OZ890; I2C bidirectional isolation; underflow interrupt
Design of battery management system based on DSP and OZ890 WANG Tao, QI Bo-jin, WU Hong-jie, LI Wei (School of Mechanical Engineering & AutomaTIon, Beihang University, Beijing 100191, China) Abstract: A battery management system for Hybrid Electrical Vehicle is designed according to its design requirements and funcTIons. The design of BMS contains two parts: hardware system and software system. The hardware system includes power module, data acquisiTIon and communicaTIon circuit, I2C bus circuit, CAN bus circuit, RS232 circuit and so on. The software includes data acquisition and processing program based on periodic interrupt and underflow interrupt, evaluation of SOC and communication programs.
Key words: battery management system; OZ890; Dual I2C Isolator; underflow interrupt
The battery management system (BMS, Battery Management System) is one of the key components of electric vehicles. The high-performance and high-reliability battery management system can make the battery obtain the best performance under various working conditions. The battery management system can monitor the battery status in real time, such as battery voltage, charge and discharge current, use temperature, etc .; predict the battery state of charge (SOC,
State of Charge), to prevent the battery from overcharging and discharging, so as to achieve the purpose of improving battery performance and life, and improving the reliability and safety of hybrid vehicles.
This design mainly implements functions such as data collection, battery state calculation, balance control, thermal management, various communications, and fault diagnosis.
1 Battery management system hardware composition The battery management system circuit consists of a power module, a DSP chip TMS320LF2407A [1] (referred to as "LF2407"), a data acquisition module based on multiple OZ890 [2], an I2C [3] communication module, and an SCI communication module , CAN communication module. The system hardware block diagram is shown in Figure 1.
1.1 The power supply of the power module is + 12V. The voltage required by the management system includes: + 3.3V (for DSP, isolation circuit), + 5V (for bus driver chip), ± 15V (Current Sensor), which can be passed through -DC conversion, not only can meet the power supply requirements of each chip but also play a role in isolation and anti-interference.
1.2 The data acquisition module completes the collection of total voltage, current and temperature by the DSP. The collection and equalization of the battery cell voltage are completed by the OZ890 chip and sent to the DSP using the I2C bus. This module circuit mainly includes front-end acquisition processing and equalization circuits.
1.3 I2C communication module
The OZ890 sampling module sends the collected data to the LF2407 through the I2C bus. Since the LF2407 itself does not have an I2C interface, this design uses PCA9564 [4] to expand its I2C interface. In order to prevent electromagnetic interference from affecting the transmission of data on the I2C bus, the bus signals must be isolated. Considering that the I2C bus is bidirectionally transmitted, use ADuM1250 [5]
Two-way isolation chip for isolation. PCA9564 and bidirectional isolation circuit are shown in Figure 2.
Figure 2 PCA9564 and bidirectional isolation circuit
PCA9564 is an I2C bus expander, connected to the GPIO port of LF2407, it supports data transmission in master-slave mode,
In the BMS, set LF2407 as the master device and OZ890 bit slave device. LF2407 communicates with OZ890 by reading and writing the contents of four registers in PCA9564.
The ADuM1250 is a hot-swappable digital isolator that includes a non-latching, bidirectional communication channel compatible with I2C interfaces. In this way, there is no need to separate the I2C signal into a transmission signal and a reception signal for use by a separate photocoupler.
1.4 Serial communication module The battery management system sends the collected and processed data to the PC interface through the serial port to realize human-computer interaction. Through the serial port interface, you can observe the battery's total voltage, cell voltage, current, SOC, fault status, charge and discharge power and other parameters. You can also send the serial port to achieve online calibration of the management system. Its hardware circuit is mainly based on the MAX232 chip, as shown in Figure 3a).
Figure 3 Serial communication interface circuit
MAX232 is a transceiver of + 5V power supply, which is connected to the serial port of the computer to realize the level conversion of the RS-232 interface signal and TTL signal, so that the BMS and PC can perform asynchronous serial communication.
In order to prevent electromagnetic interference from affecting the data transmission on the serial port, the bus signals must be isolated. The serial port is a one-way transmission,
Therefore, it is more convenient to use 6N137 photoelectric coupling. Figure 3b) shows the 232TXD signal optocoupler isolation circuit.
1.5 CAN communication module
CAN communication is an information bridge between the battery management system (BMS) and the HCU of the whole vehicle. The BMS sends the battery status parameters to the HCU through the CAN bus. The HCU makes decisions by judging the current battery status and assigns the motor and engine. Between the power, control the battery charge and discharge. At the same time, the BMS can also receive relevant commands from the HCU and make corresponding processing. In terms of hardware, the PCA82C250 universal CAN transceiver is used to provide differential transmission capability for bus data and differential reception capability for communication bus data. Through the optocoupler isolation circuit similar to Figure 3b) to enhance the anti-interference ability on the CAN bus. The hardware circuit is shown in Figure 4.
Figure 4 CAN communication interface circuit In the circuit, according to the requirements of the vehicle, whether to connect 120Ω terminal resistance, when the JP201 jumper is connected to pin 1 and pin 2,
The resistor is not connected. When pin 2 and pin 3 are connected, the resistor is connected.
2 Software design of battery management system The battery management system software [6] system includes 6 tasks and 5 interrupts. The six tasks include: AD conversion processing tasks (including reading the data in OZ890), CAN receiving tasks, CAN sending tasks, SOC calculation tasks, system monitoring fault diagnosis tasks, and serial port sending tasks. 5 interrupts include: AD collection interrupt service subroutine, Timer1 underflow interrupt service subroutine, periodic interrupt subroutine, CAN bus receive interrupt service subroutine and serial port receive interrupt service subroutine,
As shown in the following interrupt vector table:
.ref _c_int0
.ref _ADC, _INT2, _INT5
.sect ".vectors"
rset: B _c_int0; 00h reset
int1: B ADC; 02h ADC
int2: B _INT2; 04h period, underflow interrupt
int3: B int3; 06h INT3
int4: B int4; 08h INT4
int5: B _INT5; 0Ah CAN, SCI
int6: B int6; 0Ch INT6
According to the vehicle control strategy, the refresh cycle of the battery status data on CAN is 10ms per frame, so the clock cycle of the periodic interrupt is set to 10ms; the execution cycle of the above tasks is set to 10ms accordingly.
Figure 5 Cycle clock beat diagram As can be seen from Figure 5, after the system initialization is completed, Time1 starts timing. When it reaches 5ms, a periodic interrupt occurs at point A, and then enters the periodic interrupt subroutine, starts AD conversion, and reads through the I2C bus Take the data in OZ890. After the AD conversion is completed, the software triggers the ADC interrupt to save data and perform corresponding processing to clear the periodic interrupt flag. When it reaches 10ms, an underflow interrupt occurs, enters the underflow interrupt service subroutine, executes the CAN transmission task, SOC
Calculation task, system monitoring fault diagnosis task, serial port sending task. In addition, the interrupt trigger mode is adopted for CAN reception and serial port reception. The use of periodic interrupts and underflow interrupts to divide the task execution time area can not only meet the vehicle's 10ms
The CAN transmission requirements of each frame of data, and each task time can also calculate the execution time of the task through the status of the counter and the flag bit, so as to better allocate the execution time period of the task.
3 Conclusion The battery management system adopts the structure of DSP + OZ890, together with the corresponding anti-interference measures, has the characteristics of high performance and low cost. Due to the use of a special battery sampling chip OZ890, the sampling accuracy is improved, and the overcharge problem caused by the battery cell voltage imbalance is solved. At the same time, the development cycle of the hardware is greatly shortened, the reliability and maintainability of the system are enhanced, and good results have been achieved in practical applications.
The author's innovation: use OZ890 battery sampling chip to measure battery data, and use PCA9564 to expand
The I2C interface of LF2407 realizes the communication between LF2407 and OZ890.
references
[1] Texas Instrument TMS320LF2407A DSP Controller data sheet [Z] .2001.
[2] O2Micro technology company OZ890 datasheet [Z]. 2007.
[3] Liu Bin, Jiang Guangxin, Yang Zhanlu. Virtual implementation of I2C serial bus technology in DSP system [J].
[4] Philips Semiconductors PCA9564 Parallel bus to I2C-bus controller data sheet [Z]. 2003.
[5] Analog Devices Hot Swappable Dual I2C Isolators ADuM1250 / ADuM1251 data sheet [Z]. 2006.
[6] Liu Heping, Wang Weijun, Jiang Yu, Deng Li, etc. TMS320LF2407x DSP C language development and application [M]. Beijing University of Aeronautics and Astronautics Press, 2003.
Usb Common Mode Choke,Magnetic Ring Inductor,Ferrite Core Inductor,Coilcraft Inductor
IHUA INDUSTRIES CO.,LTD. , https://www.ihua-coil.com