Abstract
This thesis focuses on the design of a power battery management system (BMS) for a pure electric bus. The major functions are monitoring the lithium iron phosphate (LiFePO4) power module battery and estimating the state of charge (SOC) of the battery pack. According to the vehicle technical specifications, experiments on individual cells and module batteries were carried out to determine the structure of the electric power system, as well as the hardware and software architecture of the BMS. The network node identities are assigned following the SAE J1939 protocol, and the message formats are designed according to the time-triggered CAN (TTCAN) protocol. A graphical interface software was developed with the aid of Kvaser libraries to analyze the reasons for bus error frames and frame losses. A fuzzy logic algorithm using voltage and temperature as membership functions was designed, and the Mamdani method was applied for defuzzification to generate the SOC output. The functions and anti-interference performance of the BMS were tested through full vehicle road tests. The accuracy of the SOC estimation was verified by two independent approaches. This work belongs to applied research, achieving low hardware cost and a short development cycle. The road test data demonstrate that the system has high reliability, high accuracy, and simple maintenance, and it can satisfy the application requirements of pure electric buses.
Keywords: electric vehicle battery; battery management system; SOC; CAN; fuzzy logic
1 Introduction
1.1 Current Research Status
The pure electric bus in China is at the stage just before industrialization. Public transit demonstration lines already exist in several first-tier cities such as Beijing, Hefei, and Shanghai. The industrialization process of pure electric buses has brought vigorous development to the lithium iron phosphate power battery industry, but it also introduces many challenges. Among these, the consistency of individual cells in a module and the accurate SOC estimation are the most difficult issues. In this context, my research designs a battery management system to monitor the battery states, uses a fuzzy algorithm to estimate the SOC, and verifies the SOC estimation error with two methods, thereby contributing to the promotion of pure electric buses and the reduction of energy and environmental pressure.
1.1.1 Development of Pure Electric Buses
In 2009, the national policies supporting new energy vehicles were very strong. The Ministry of Finance, the National Development and Reform Commission, the Ministry of Science and Technology, and the Ministry of Industry and Information Technology were formulating supporting policies for the development of electric vehicles. Many pure electric vehicles have been produced and are being tested in trial operation, for instance in Beijing and Hefei. According to the “Automobile Adjustment and Revitalization Plan”, the market share of new energy vehicles was initially set at 5% of passenger cars. In 2008, the production and sales of buses were about 160,000 units, so the minimum number of new energy buses in 2009 was at least 10,000 units. If an average annual growth of 10% is assumed, by 2012 the number of new energy buses would reach at least 13,000 units. Adding the “Ten Cities, Thousand Vehicles” plan in 2009, and the fact that provinces and cities were competing to demonstrate pure electric bus routes in order to improve urban environmental conditions and public transport strength, the number of new energy buses by 2012 is expected to be at least 25,000. It is predicted that in 2012 the market demand for new energy buses will be 25,000 units, of which pure electric buses will be more than 12,000 units, accounting for over 40% of new energy vehicles. By 2020, the market demand for new energy buses will reach 45,000 units, of which pure electric buses will exceed 30,000 units, accounting for over 60%. The bus industry will take pure electric vehicles as the mainstream.
1.1.2 Application Status of Lithium Iron Phosphate Power Batteries
Lithium iron phosphate power batteries solve the safety hazards of lithium cobalt oxide and lithium manganese oxide batteries. LiFePO4 batteries are currently the only absolutely safe lithium-ion power batteries in the world. Their stability at high temperatures can reach 400–500 °C, which ensures high safety of the power battery module. They do not explode or burn due to overcharge, overdischarge, high temperature, short circuit, or impact. Because of these characteristics, LiFePO4 batteries are produced in various capacities and sizes and are widely used. Main application fields include large electric vehicles, light electric vehicles, solar and wind energy storage equipment, UPS, electric tools, and portable instruments. Table 1 lists the performance comparison among several rechargeable batteries.
| Parameter | LiCoO2 | LiMn2O4 | LiFePO4 |
|---|---|---|---|
| Tap density (g/cm3) | 2.8–3.0 | 2.2–2.4 | 1.0–1.4 |
| Specific surface area (m2/g) | 0.4–0.6 | 0.4–0.8 | 12–20 |
| Specific capacity (mAh/g) | 135–140 | 100–115 | 130–140 |
| Voltage plateau (V) | 3.6 | 3.7 | 3.2 |
| Cycle performance | ≥300 times | ≥500 times | ≥2000 times |
| Transition metal | Poor | Rich | Very rich |
| Raw material cost | High | Low | Low |
| Environmental protection | Contains cobalt | Non-toxic | Non-toxic |
| Safety performance | Poor | Good | Excellent |
| Applicable fields | Small batteries (mobile phones) | Power batteries (bicycles) | Power batteries / large capacity power sources |
1.1.3 Technical Status of Battery Management Systems
In the application of power batteries for pure electric buses, the cycle life of a single cell can no longer represent the life of the entire battery pack. Long life is one of the main obstacles to the promotion of LiFePO4 batteries. In China, when ten or even more than one hundred cells are connected in series, even if a single cell achieves 2000 cycles, the practical pack life will not reach 1000 cycles. The requirements of a pure electric bus for a battery management system include a wide operating temperature range, high-rate charging and discharging, and concentrated placement. High-temperature charging/discharging performance, low-temperature performance, and heat dissipation conditions are critical. The capacity of the battery pack must be fully utilized. The consistency of the module cells leads to overvoltage during charging and discharging, which is a serious problem. In practice, it is necessary to use the capacity of the battery pack as much as possible. A single cell can be discharged to 100% DOD and charged to 100% SOC; however, after assembly, charging to 95% SOC is already a very good result. During actual charging and discharging, safety must be maintained, and overcharge or overdischarge of individual cells must be avoided to improve utilization. Long life is another issue: the module capacity decreases and internal resistance increases during use. The basic responsibilities of a BMS are to effectively monitor the battery state, optimize energy usage, extend battery life, and communicate with external equipment, chargers, and ECUs. The current BMS often measures external parameters, estimates state, evaluates consistency, provides alarms, and supports external communication. However, its performance is not powerful enough due to the complexity of battery behavior, the nonlinear relationships of electrochemical, electrical, and electronic parameters, and consistency issues during manufacturing and use. Battery manufacturers, BMS developers, charger manufacturers, and motor controller developers are relatively independent and do not cooperate deeply. A BMS developer can only measure external parameters; it is very difficult to deeply investigate the internal characteristics of a battery.
1.1.4 Research Status of SOC for Pure Electric Buses
Currently, the SOC definition used in commercial battery management systems is based on the SOC of a single cell. This approach has problems during module use. The concept of capacity is ambiguous. Since August 2008, I have been working on SOC research. The differences among cells in a module arise not only from production but also from the SOC differences during operation. Without considering cell differences, the original SOC definition is not suitable for a module battery. The SOC meaning becomes vague and cannot be used effectively. For a module battery, the module capacity is closely related to the capacity and SOC of each individual cell. If any cell is fully charged or discharged first, the module capacity will be even smaller than the capacity of the weakest cell. Common SOC estimation methods include the ampere-hour counting method based on current integration, the open-circuit voltage method based on terminal voltage measurement, the electromotive force method, the neural network method based on large data samples, the Kalman filter method based on a state-space model and recursive equations, and the electrochemical impedance spectroscopy method. The ampere-hour method is an open-loop prediction and is the benchmark of all SOC estimators. The open-circuit voltage method requires long rest time and cannot be used to estimate SOC changes in a running pure electric bus, so it is generally only used for initial SOC estimation. The neural network method requires a correct network structure and a huge number of training samples. Kalman filtering is suitable for SOC estimation of power battery modules with rapidly changing current, but it demands high hardware performance and CPU speed. For electrochemical impedance spectroscopy, establishing a proper mathematical model and estimating the model parameters are complex tasks.
1.2 Purpose and Significance of the Research
During the 2008 Beijing Olympic Games, the successful operation of electric buses laid a solid foundation for the development of electric buses. With the supportive policies issued by the Ministry of Science and Technology in early 2009, pure electric buses entered an explosive growth period. The purpose of this research is to analyze the working principle of lithium iron phosphate single cells and the internal structure of a power battery module, and then design a battery management system. Based on the experimental data of cells and modules, engineering experience, and fuzzy algorithm, the SOC is estimated. Two verification methods, namely the residual capacity detection of the battery module and the relationship curve between vehicle operating parameters and SOC, are used to verify the accuracy. According to the verification results, the relevant parameters in the fuzzy algorithm are corrected and optimized to meet practical application requirements. This study belongs to the category of applying theory to practical engineering and has both theoretical and reference significance. First, the fuzzy method is introduced into the field of LiFePO4 battery monitoring and SOC estimation, which is a multidisciplinary endeavor. Second, accurate SOC estimation can reduce operating costs and promote the development of pure electric buses. The popularization of pure electric buses can reduce environmental pollution, achieve sustainable development, and create considerable economic and social benefits.
1.3 Source and Main Research Work
This research is a sub-project of the National 973 Program: “New Principles of Secondary Battery Detection and Energy Saving Technology” (2009CB220107). The work was actually applied to a 12m pure electric bus developed by Saines Energy Technology Co., Ltd. This project arises from the rapidly developing electric bus industry and the ever-increasing technical requirements for BMS. The work involves electrochemistry, power electronics, micro-systems, and automatic control. The main research contents are as follows:
- Through analysis of the internal structure, operating characteristics, and performance parameters of the power battery module, and through massive experiments, the relationship between module SOC and various related parameters is analyzed. A SOC reference data table is generated to provide a reference for SOC estimation and to serve as the basis for verifying the accuracy of test results.
- According to the internal structure of the module battery and the vehicle functional requirements for the BMS, the hardware and embedded software of the BMS are designed. For debugging convenience, a host computer software is designed to display relevant parameters and perform interactive operations. The network node identities are allocated according to the SAE J1939 protocol, message structures are written according to the TTCAN protocol, and CAN network robustness analysis and design are carried out.
- Based on the commonly accepted definition of SOC for a single battery cell, the SOC of a power battery module is defined. On the basis of the BMS hardware and software, a fuzzy logic scheme is determined, a fuzzy algorithm is designed, and Mamdani defuzzification is used to output the module SOC value.
- Vehicle road tests are performed. Vbox and a Kvaser graphical user software developed in VC++ are used to record relevant data. Two test methods verify the accuracy of SOC estimation, error analysis is performed on the verification methods, and the fuzzy algorithm parameters are corrected until the estimation meets practical application requirements.
2 Performance Analysis of Lithium Iron Phosphate Power Battery
Lithium iron phosphate power batteries are very suitable for pure electric buses because of their safety, non-pollution, abundant raw materials, and industrialization. The SOC estimation of the power battery pack is closely related to the performance, consistency, and structure of the module battery. This chapter introduces the charging and discharging experiments of single cells and module batteries, laying the foundation for the hardware structure design of the BMS and for SOC estimation and verification.
2.1 Working Principle and Performance Parameters
2.1.1 Working Principle
The charging and discharging process of a lithium iron phosphate battery is realized by the extraction and insertion of lithium ions between the positive and negative electrodes. The reaction equations are:
Charging:
$$ \mathrm{LiFePO_4} – x\mathrm{Li^+} – x e^- \rightarrow x\mathrm{FePO_4} + (1-x)\mathrm{LiFePO_4} $$
Discharging:
$$ \mathrm{FePO_4} + x\mathrm{Li^+} + x e^- \rightarrow x\mathrm{LiFePO_4} + (1-x)\mathrm{FePO_4} $$
The internal structure of a LiFePO4 cell consists of an olivine-structured LiFePO4 positive electrode connected to an aluminum foil, a polymer separator that allows lithium ions to pass but not electrons, a carbon (graphite) negative electrode connected to a copper foil, and an electrolyte sealed in a metal case. During charging, lithium ions migrate from the positive electrode through the separator to the negative electrode; during discharging, they migrate back. The battery is named because of this back-and-forth migration of lithium ions.
2.1.2 Main Battery Performance
LiFePO4 batteries have the following characteristics: they do not explode or burn when damaged, they have good safety; at an ambient temperature of 65 °C, the internal temperature can rise to 95 °C, and at the end of charging/discharging it can reach 160 °C while keeping the internal structure intact; they can be discharged to zero volts without damage; they are environmentally friendly; the standard discharge is 2–5C, continuous high current discharge can be 10C, and instantaneous pulse discharge (10 s) can reach 20C; they have excellent fast charging capability; considering lifetime cost, LiFePO4 batteries are the cheapest; self-discharge is small and there is no memory effect; after 2000 cycles at 1C, the capacity is still greater than 95%.
2.2 Cell Charging and Discharging Experiments
2.2.1 Test Method
The experimental equipment includes an Arbin cell test device, an HIOKI internal resistance tester, a high/low temperature chamber, and 26650E cells. The steps are: (1) randomly extract several 26650E cells from a batch; (2) charge at 1C constant current to the cutoff voltage of 3.7 V, then constant-voltage charge until the current drops to 100 mA; (3) record the constant-current charge capacity, constant-voltage charge capacity, and total charge capacity; (4) discharge at 1C constant current to the cutoff voltage of 2.0 V; (5) record the total discharge capacity. External characteristic tests include charge curves at 0.5C and 1C at room temperature, discharge curves at 0.2C, 1C, and 3C at room temperature, discharge curves at different temperatures (discharge rate 0.2C), and cycle life tests (0.5C charge to 3.70 V CC-CV; 1C discharge to 2.0 V).
2.2.2 Test Results
At room temperature, the charge curves at 0.5C and 1C show a typical voltage plateau around 3.2–3.3 V. The discharge curves at different temperatures indicate that lower temperatures reduce the available capacity. The discharge curves at different rates show that higher rates reduce the terminal voltage for the same discharged capacity. Figure 1 displays a typical battery module used in the experiments; the image below illustrates the module configuration.

The cycle life test shows that after 2000 cycles, the capacity retention remains above 95%, which is excellent for electric vehicle battery applications.
2.3 Module Battery Structure and Charge/Discharge Experiments
A module battery is composed of several cells connected in series through elastic pieces and parallel layers through copper plate laser spot welding. Different nominal voltages and capacities can thus be obtained by different series and parallel configurations. Although a module is made of single cells, the evaluation criteria for single cells cannot be directly applied to modules. The experimental analysis in this section is an important basis for accurately estimating the module SOC.
2.3.1 Internal Structure of the Battery Module
For a pure electric bus, the driving range is an important indicator of industrialization. Therefore, high-capacity 26650E cells were used to form the module. Table 2 gives the specifications of the CBE24300 module battery used in this research.
| Parameter | Value |
|---|---|
| Nominal voltage | 25.6 V |
| Nominal capacity | 300 Ah |
| Dimensions (L*W*M) | 700 mm * 242 mm * 330 mm |
| Weight | 75 kg |
| Specific energy | 100 W/kg |
| Specific power | 250 W/kg |
| Charge cutoff voltage | 28.8 V |
| Nominal charge current (20 °C) | 300 A |
| Continuous discharge current | 300 A |
| Peak current (10 s) | 900 A |
| Discharge cutoff voltage | 20.0 V |
| Charge temperature range | 0–40 °C |
| Discharge temperature range | -20–60 °C |
| Storage temperature | -40–70 °C |
| Dynamic self-balancing | Embedded |
| Internal cooling heat pipes | Embedded |
| Cell voltage acquisition | 8 series cells |
| Embedded BMU | Yes |
| Temperature sampling points | 8 (DS18B20) |
The structural features of the battery module are: 8 cells are connected in series to form a branch, 25 branches are connected in parallel to form one layer; 4 layers are then connected in parallel to form a 300 Ah module, with copper sheets joined by laser welding; the BMS is embedded inside. The module contains four silver-plated heat conduction pipes.
2.3.2 Module Battery Charge/Discharge Test
The experimental equipment includes a ZM8960 power battery test device, a Fluke infrared thermometer, multimeters, and the CBE24300 module. The steps are: (1) randomly select several modules from a batch; (2) charge at 1C constant current to the cutoff voltage of 28.8 V, then constant-voltage charge until the current drops to 3 A, with the individual cell upper cutoff voltage also as a stopping condition; (3) record constant-current charge capacity, constant-voltage charge capacity, and total charge capacity; (4) discharge at 1C constant current to the cutoff voltage of 20 V, with the individual cell lower cutoff voltage as a stopping condition; (5) record total discharge capacity. External characteristic tests include 1C charge and discharge curves at room temperature, 8-point temperature curves under 1C operation, discharge curves at 0.2C, 1C, and 3C at room temperature, and pulse cycle tests.
2.3.3 Test Results
At room temperature and 1C, the charge and discharge curves show a flat voltage plateau, typical of LiFePO4. In the simulated driving cycle, the internal 8 temperature points rise gradually but remain within acceptable limits, as shown in Figure 2-10 of the original document. The discharge curves at different rates show that higher discharge currents reduce the available capacity. The 1C pulse cycle test demonstrates the dynamic response of the module under current steps.
2.4 Analysis of SOC-Related Parameters
The experimental curves reveal the platform characteristic of LiFePO4 batteries. While it is an advantage, it also makes SOC estimation difficult because the voltage changes very little over a wide SOC range. Accurate SOC estimation of LiFePO4 batteries is a recognized challenge.
2.4.1 Consistency Evaluation of Power Battery Cells
The differences between individual cells appear under the following conditions: at high SOC, at low SOC, and especially at SOC around 9–10%. The SOC differences are reflected in voltage differences. The external voltage differences are mainly caused by DC internal resistance, polarization voltage, capacity, and SOC. Differences in DC internal resistance, polarization voltage, and capacity cannot be improved through equalization; only the SOC state can be changed. Because each cell has a different SOC, it is possible to change the SOC state. In a typical voltage-based system, the nonlinear relationship between voltage and SOC leads to unstable consistency judgment. Therefore, a comprehensive evaluation based on current, DC internal resistance, polarization voltage, capacity, and SOC is required. Through experimental analysis, it is proposed that the equalization should be applied to the specific cell that needs charging or discharging. This is the basis for module research. The main problems of equalization are that consistency varies with operating conditions and SOC, showing instability. The equalization of existing BMSs has no obvious effect on increasing module capacity, and the cycle life of assembled batteries is still lower than that of a single cell.
2.4.2 Correlation Analysis between Battery External Characteristics and SOC
After 100 cycles, several LiFePO4 cells were analyzed by eliminating the DC internal resistance and polarization voltage. The difference between the two most different cells remains large. After correcting the capacity and initial SOC, the two characteristics become basically the same. For low-voltage charging techniques, a completely wrong result would be obtained otherwise. Therefore, once the capacity and SOC of each cell in the module are known, an evaluation system can be built, and the BMS can balance the cells continuously.
Table 3 lists the simulated data of 20 module batteries on the vehicle, obtained from ground simulation. The table shows the module voltage under different discharge or charge currents and SOC levels.
| Module No. | Module voltage / V | Module voltage / V | Module voltage / V | Module voltage / V | Module voltage / V | Module voltage / V | Module voltage / V | Module voltage / V |
|---|---|---|---|---|---|---|---|---|
| 1–20 | 26.26 | 26.82 | 26.70 | 26.72 | 26.08 | 25.98 | 25.88 | 25.62 |
| Total voltage / V | 538 | 521 | 534 | 524 | 527 | 512 | 518 | 506 |
| Discharge current / A | 0 | 99 | 0 | 50 | 0 | 150 | 0 | 167 |
| Charge current / A | 150 | 0 | 93 | 0 | 83 | 0 | 62 | 0 |
| SOC / 100% | 40 | 40 | 30 | 30 | 20 | 20 | 10 | 10 |
The relationship between open-circuit voltage and SOC under 1C discharge at room temperature is given in Table 4.
| SOC / 100% | Vcell / V | Vmodule / V |
|---|---|---|
| 100 | 3.414 | 27.312 |
| 90 | 3.394 | 27.152 |
| 80 | 3.342 | 26.736 |
| 70 | 3.329 | 26.632 |
| 60 | 3.306 | 26.448 |
| 50 | 3.303 | 26.416 |
| 40 | 3.302 | 26.410 |
| 30 | 3.301 | 26.408 |
| 20 | 3.285 | 26.281 |
| 10 | 3.253 | 26.024 |
| 5 | 3.102 | 24.816 |
| 0 | 2.621 | 20.968 |
3 Design of the Battery Management System
The factors that limit the promotion of pure electric buses include the cost and safety of lithium iron phosphate batteries. Extending the life of the power battery module and fully utilizing its capacity are effective ways to reduce cost. To ensure the performance, extend the life, and fully utilize the capacity of the power battery module, proper control and management are necessary. This chapter designs the BMS based on the experimental analysis of the previous chapter.
3.1 System Hardware Design and Function Description
The working process of the BMS is as follows: the battery management unit (BMU) uses data acquisition circuits to collect the state information of the cells and the temperature information inside the module battery. It communicates with the battery electronic control unit (BECU) through the internal CAN bus of the pure electric bus power battery system. The BECU processes and analyzes the shared data, then issues commands to actuators related to the power battery system, and communicates with other vehicle nodes via the external CAN.
3.1.1 Overall System Structure
A DSP is encapsulated inside the module battery together with peripheral circuits and power circuits, sealed by polymer plastic. Multiple battery modules are interconnected through power cables and shielded twisted pair wires. The BMU hardware structure is illustrated in the block diagram of the original design. The BMU functions include:
- Cell voltage and total module voltage acquisition. A three-stage filter circuit is designed based on frequency spectrum analysis, with a maximum frequency of 20 Hz. TVS diodes, differential-mode capacitors, and common-mode chokes are used to suppress common-mode and series-mode interference.
- Eight temperature points inside the module. The temperature sensor is a Dallas DS18B20. The temperature is obtained through the GPIO port of the DSP and a temperature offset table stored in flash memory.
- Non-volatile memory (NVRAM) is extended via the GPIO port in an I2C format to store the module battery ID.
- The eCAN communication module of the LF2407 supports the Bosch CAN 2.0B protocol. A PCA82C250 CAN transceiver provides the physical link between the DSP eCAN module and the shielded twisted pair CAN bus, enabling communication between BMU and BECU.
- An equalizer (EQU) continuously balances the cells based on the SOC of each cell.
The BECU is installed at the rear of the vehicle. Its functions include:
- Current acquisition. Because the driving current of the pure electric bus has a large alternating amplitude (1C–3C) and rapid frequency change, a dual-range LEM current sensor is selected: ranges are -20 A to 20 A and -500 A to 500 A, to meet the acquisition requirements. The ADC is communicated via SPI.
- CAN1 communicates with all BMUs; CAN2 communicates with other vehicle nodes in real time and sends alarm information.
- Communication with mobile charging vehicles and charging station chargers.
- Thermal management control of the module battery: keeps the battery within an appropriate temperature range and reduces temperature differences among modules.
- Contactor control to avoid harm to passengers from voltage and current; prevents overcurrent and overvoltage during charging/discharging; prevents excessive internal temperature; disconnects the power line in case of an accident to avoid combustion or explosion.
- Non-volatile memory is extended on the GPIO port of the MPC5510 to store each module ID, ADC calibration coefficients, and fuzzy algorithm consequent weights.
- The SCI module on the MPC5510 is extended for communication with a host PC.
The overall BMS structure is shown in Figure 3-3 of the original document. It includes additional functional modules: thermal management (air compressor control), circuit breaker actuator (safety device), charger system, and CAN/SCI communication with a PC. It also adds real-time communication with the vehicle controller, motor controller, and ABS to achieve energy feedback braking and maximum power control, data acquisition, SOC estimation, electrical control (charge/discharge control, equalization), thermal management, safety management, and data communication.
3.1.2 Signal Acquisition System Design
In the BMS, real-time data collected by hardware circuits are the basis for correct control and management. Therefore, the processing precision, sampling frequency, and spectrum analysis of the relevant data are crucial. Given the dynamic characteristics of the total voltage, total current, and maximum temperature in the module, the ADC sampling rate should be no less than once per second. Since pure electric buses have high safety requirements for LiFePO4 batteries, the voltage of each cell in the module must be collected, and eight temperature points in each module must be monitored.
The cell voltage acquisition circuit is designed according to the battery module structural features introduced in Chapter 2. The circuit uses differential amplifiers and filters to reduce common-mode noise. Only two layers are shown for simplicity; other layers are similar. The total voltage and current acquisition use a voltage-type sampling circuit with high precision, low drift, and high linearity. Because the current through the module is one of the important parameters for estimating battery capacity, the sampling circuit precision directly determines the SOC precision.
Temperature measurement is an important part of the BMS. The ambient temperature of the battery varies from -20 °C to 70 °C. The DS18B20 digital temperature sensor is chosen because it requires simple wiring, has strong anti-interference capability, and can be connected in a multi-point configuration with a single pin. Eight sensors are placed at selected locations inside the module.
3.2 System Software Design
The software design is divided into two parts: BMU software and BECU software.
3.2.1 BMU Software Design
The BMU software includes system software and application software. The system software design mainly realizes the porting of μC/OS-II to the TMS320LF2407 DSP. μC/OS-II is a priority-based, preemptive, real-time operating system written mostly in ANSI C. The porting requires: (1) defining constants, macros, and data types related to TMS320LF2407 in OS_CPU.H; (2) configuring OS_CFG.H to tailor the system services and reduce power consumption; (3) writing the assembly language file OS_CPU.ASM; (4) writing the C file OS_CPU.C.
The application software design defines tasks and interrupts. According to the BMU functions, the system is divided into eight tasks and five interrupts. The tasks are listed in Table 5.
| Priority | Task name | Function description |
|---|---|---|
| 2 | BMUIDTask() | Perform vehicle networking task |
| 3 | BMUADCTask() | Perform A/D sample digital filtering and data exchange |
| 4 | BMUECANRXDTask() | Receive CAN bus data |
| 5 | BMUECANTXDTask() | Transmit CAN bus data |
| 7 | BMUTEMPTask() | Acquire 8 temperature points inside the module |
| 9 | BMUEQUTask() | Perform battery SOC equalization |
| 13 | BMUSCIRXDTask() | Receive data via serial port |
| 14 | BMUSCITXDTask() | Transmit data via serial port |
The interrupt service routines are: BMUADCISR(), BMUT1fISR(), BMUOSTickISR(), BMUCANISR(), and BMUSCIISR(). According to the vehicle control strategy, the refresh period of the cell data on the vehicle CAN bus is 10 ms, which is five times the system clock period; therefore the operating system tick is set to 2 ms. The BMUADCTask and BMUECANTXDTask execution periods are 10 ms. Because the internal 8 temperature points change slowly and the DS18B20 conversion and table lookup take time, the BMUTEMPTask period is set to 50 ms. The BMUECANRXDTask and BMUSCIRXDTask are triggered by interrupts. The backup BMUSCITXDTask is controlled by the graphical user program with a period of 20 ms.
For task communication, μC/OS-II provides mailboxes, semaphores, message queues, event flags, and mutexes. In the BMU application, only mailboxes are used to reduce system overhead. The BMUADCTask is the core. After the ADC interrupt posts to mailbox 1, the ADCTask executes data acquisition and exchange, then posts to mailbox 2, and other tasks run according to priority. The temperature acquisition and EQU tasks run independently. The CAN receive and SCI tasks are activated by mailboxes when messages are received.
3.2.2 BECU Software Design
The BECU software design also includes system software and application software. The system software task is to port μC/OS-II to the MPC5510 microcontroller. The application software defines 11 tasks and 6 interrupts. Table 6 lists the BECU tasks.
| Priority | Task name | Function description |
|---|---|---|
| 2 | BECUIDTask() | Perform vehicle networking task |
| 3 | BECUADCTask() | Perform A/D sample digital filtering and data exchange |
| 4 | BECUCAN1RXDTask() | Receive data from internal CAN1 bus |
| 5 | BECUCAN1TXDTask() | Transmit data on internal CAN1 bus |
| 6 | BECUCAN2RXDTask() | Receive data from external CAN2 bus |
| 7 | BECUCAN2TXDTask() | Transmit data on external CAN2 bus |
| 8 | BECUTempManageTask() | Control air compressor for thermal management |
| 9 | BECUSafeManageTask() | Control circuit breaker for safety management |
| 10 | BECUSOCTask() | Estimate module battery SOC |
| 11 | BECUMoniTask() | Monitor BMS status |
| 13 | BECUSCIRXDTask() | Receive data via serial port |
| 14 | BECUSCITXDTask() | Transmit data via serial port |
3.3 Vehicle Communication Network Design
The coordinated operation of the subsystems of an electric vehicle and the sharing of detected parameters between subsystems are key to manufacturing high-performance electric buses. The communication network must meet high real-time and information-sharing requirements. The CAN bus following the SAE J1939 protocol is widely used in current domestic electric buses.
3.3.1 Node Address Allocation of the EV Bus
The system consists of eight nodes: the vehicle controller, motor controller, AMT, ABS, EPS, battery management system (BMS), and instrument cluster. The bus rate is 250 kbit/s. The identifier structure follows the J1939 format, with priority bits, reserved bits, data page, PDU format, PDU specific, and source address. Table 7 lists the source addresses of the nodes.
| Node | Source address (SA) |
|---|---|
| Vehicle controller | 208 |
| Motor controller | 239 |
| AMT | 3 |
| ABS | 11 |
| EPS | 228 |
| BMS | 243 |
| Instrument cluster | 40 |
For the BMS, the BECU node uses source address 145 for the power source system (DPS), while the instrument uses address 23. The BMU modules use addresses 1 through 20 on the internal network.
3.3.2 BMS Message Design
Several periodic messages are defined between the BECU and the instrument. Table 8 shows an example message containing battery total voltage, current, SOC, SOH, remaining energy, and battery status.
| Byte | Data name | Resolution, offset, range |
|---|---|---|
| 1-2 | Battery total voltage (low/high byte) | 1 V/bit, offset 0, 0–650 V |
| 3-4 | Battery total current (low/high byte) | 1 A/bit, offset -400, -400–400 A |
| 5 | SOC | 0.4%/bit, 0=0%, 250=100%, 0–100% |
| 6 | SOH health | 0.4%/bit, 0=0%, 250=100%, 0–100% |
| 7 | Remaining energy | 1 kWh bit, 0–250 kWh |
| 8 | Battery status flags | bits indicate equalization fault, SOC too low, temperature high, overcurrent, etc. |
Another message provides maximum and minimum cell voltages and module temperatures. Additional messages broadcast the eight temperatures of each module and the individual cell voltages for all 20 modules (messages 6–25). The internal BMU-BECU communication frames use the same CAN 2.0B format.
3.3.3 Network Robustness Design
Pure electric buses require a real-time control system. Traditional event-triggered CAN protocol cannot fully meet the control requirements; thus a time-triggered CAN (TTCAN) protocol is adopted. In TTCAN, message transmission and reception are based on a time schedule. A master node sends a reference frame containing global time, and all other nodes synchronize to this global time. The frames and their sending times are defined in a system matrix, which reduces message response time and meets real-time requirements.
The communication delay in TTCAN can be divided into four parts: generation delay, queuing delay, transmission delay, and reception delay. The transmission delay depends only on the frame length and bus parameters. The queuing delay for time-triggered messages is deterministic. For event-triggered messages, the expected delay due to exclusive time windows can be calculated. Let \(Q\) be the number of basic cycles in the system matrix and \(T\) be the basic cycle period. The probability density of an event message generated at any time is \(\rho = 1/(QT)\). If an event message is generated within an exclusive window \(i\), it must wait until an arbitration window, giving an expected delay \(g_i = \int_0^{W_i} (W_i – t)\rho dt = \rho W_i^2/2\). By substituting \(\rho\), we obtain \(g_i = W_i^2/(2QT)\). Summing over all exclusive and free windows yields the total expected delay \(G_m = \sum_{i=1}^{Z} W_i^2/(2QT)\), where \(W_i\) is the length of window \(i\). Therefore, the total queuing delay is \(t_{queue} = t_{arb} + t_{nonarb} + G_m\).
To improve hardware anti-interference, the following measures are taken: (1) suppressing interference sources by connecting bypass capacitors between the motor controller, drive motor, and chassis; (2) using isolated DC/DC converters for each BMU power supply to eliminate common-mode interference; (3) using optocouplers such as 6N137 to isolate the eCAN, RS232, and SPI communication interfaces from the internal CPU circuits.
3.4 Host Computer Software Design
The host computer software is developed using structured programming techniques to realize debugging functions. It must be real-time, easy to operate, and reliable. Visual C++ with GUI programming is adopted. For serial communication, the MSComm ActiveX control is used because it simplifies programming and provides event-driven communication. The software can graphically display driving current, voltage, battery temperature, and cell temperature, and can set the IDs of the BECU and BMU.
For CAN bus analysis, the Kvaser USBcan II interface is used. It supports both 11-bit and 29-bit identifiers, a “listen-only” mode, and a CANLIB SDK for development in C, C++, Delphi, Visual Basic, and C#. The developed software is used to analyze error frames and count lost frames. Common causes of CAN errors include local faults of error-passive nodes, misjudgment during the EOF field, and synchronization failures. The Kvaser tool helps engineers identify these issues. Figure 3-8 of the original shows the Kvaser development environment; the actual monitoring interface is shown in Figure 3-9.
4 Fuzzy Algorithm for SOC Estimation of the Power Battery Module
The lithium iron phosphate battery is the energy source of a pure electric bus, and SOC is an indicator of the remaining energy. Accurate SOC estimation is directly related to the full utilization of the battery module capacity and the extension of its service life. Estimating the SOC accurately and reliably from measurable battery parameters has always been a major research topic.
4.1 Definition of SOC
4.1.1 SOC of a Single Cell
The state of charge is defined as the ratio of the remaining capacity to the rated capacity:
$$ SOC_{cell} = \frac{Q_c}{C_i} $$
where \(Q_c\) is the remaining capacity, and \(C_i\) is the capacity discharged at a constant current \(i\) (usually 1C). This definition has some inconsistency under varying discharge currents because the capacity depends on current and temperature.
4.1.2 SOC of a Module Battery
The SOC of a module battery is defined similarly:
$$ SOC_{module} = \frac{Q_c}{C_i} $$
where \(Q_c\) is the remaining capacity of the module, and \(C_i\) is the capacity of the module at a constant current \(i\). For safety, the SOC of the weakest cell should be used as the lower limit for constant-current discharge. This definition is the basis of this research.
4.2 Fuzzy Logic Algorithm Design
Fuzzy logic reasoning is close to human thinking and is good at qualitative analysis. In engineering practice, experienced engineers can estimate SOC fairly accurately after appropriate experiments. The basic idea is to simulate human fuzzy reasoning based on the experimental curves from Chapter 2 and the driver’s experience. The algorithm corrects the module terminal voltage. In practice, the average driving current of the electric bus is about 60 A. The terminal voltage measured at any current \(I\) is converted to the equivalent terminal voltage \(U_{60}\) that would appear at a 60 A discharge. A simplified physical model of the LiFePO4 module is shown in Figure 4-2 of the original. The model includes an ideal voltage source \(E_0\), an ohmic resistance \(R_\Omega\), and an RC network representing polarization.
For a steady-state discharge current \(I\), the terminal voltage \(U_I\) is:
$$ U_I = E_0 – I(R_\Omega + R_{r,I}) $$
For \(I = 60\) A:
$$ U_{60} = E_0 – 60(R_\Omega + R_{r,60}) $$
Subtracting the two equations:
$$ U_{60} – U_I = (I – 60)R_\Omega + I R_{r,I} – 60 R_{r,60} $$
This can be written as:
$$ U_{60} = U_I + (60 – I) r $$
where \(r\) is an integrated internal resistance that can be determined experimentally. Thus, the measured terminal voltage can be corrected to the standard 60 A condition, making it more suitable for SOC inference.
4.2.1 Membership Functions
The input variables are the corrected terminal voltage \(U_{60}\) and the module internal temperature \(\theta\). The output variable is SOC. The voltage range is [20 V, 28 V]. It is fuzzified into seven fuzzy subsets: {VVH, VH, H, M, S, VS, VVS}. The membership functions are asymmetric because the sensitivity of voltage to SOC differs in different SOC regions. The temperature range is [-20 °C, 40 °C]. It is fuzzified into four subsets: {Vcold, Cold, Warm, Hot}. The SOC range is [0, 100%], fuzzified into seven subsets: {VLow, Low, ML, Medium, MH, High, VHigh}. Figure 4-3 to 4-5 of the original show the membership functions.
4.2.2 Fuzzy Rules
Based on the discharge curves and experimental data, a set of fuzzy rules is defined. Table 9 summarizes the rule table.
| Voltage \ Temperature | Vcold | Cold | Warm | Hot |
|---|---|---|---|---|
| VVS | VLow | VLow | VLow | Low |
| VS | VLow | Low | Low | ML |
| S | Low | Low | ML | Medium |
| M | Low | ML | Medium | MH |
| H | ML | ML | MH | High |
| VH | ML | Medium | High | High |
| VVH | Medium | MH | VHigh | VHigh |
Examples of rules are: If voltage is VVS then SOC is VLow; If voltage is VH and temperature is Hot then SOC is High; If voltage is VVH and temperature is Warm then SOC is VHigh.
4.3 Defuzzification with Mamdani Inference
For a two-input single-output fuzzy system, the Mamdani inference uses the Min-Max operation. For two rules:
Rule 1: If \(x_1\) is \(A_1\) and \(x_2\) is \(B_1\) then \(y\) is \(C_1\)
Rule 2: If \(x_1\) is \(A_2\) and \(x_2\) is \(B_2\) then \(y\) is \(C_2\)
The membership functions of the output fuzzy sets are:
$$ \mu_{C_1}(y) = \min[\mu_{A_1}(x_1), \mu_{B_1}(x_2), \mu_{C_1}(y)] $$
$$ \mu_{C_2}(y) = \min[\mu_{A_2}(x_1), \mu_{B_2}(x_2), \mu_{C_2}(y)] $$
The overall output membership is the maximum:
$$ \mu_C(y) = \max[\mu_{C_1}(y), \mu_{C_2}(y)] $$
The crisp output is obtained by the center of gravity (COG) method:
$$ y^* = \frac{\sum_{i=1}^{n} \mu_C(y_i) \cdot y_i}{\sum_{i=1}^{n} \mu_C(y_i)} $$
In the BMS, the corrected voltage and temperature are fuzzified according to the membership functions, the rule table is applied, and the COG defuzzification produces the estimated SOC. For example, at a voltage of 26 V and a temperature of 20 °C, the fuzzy inference and defuzzification yield a SOC value in the expected range.
5 Vehicle Road Test and SOC Estimation Verification
5.1 Pure Electric Bus Road Test
The pure electric bus includes the vehicle controller, motor controller, AMT, ABS, EPS, BMS, and instrument cluster. Each subsystem must be tuned through vehicle integration. The BMS designed in this research requires road testing to verify SOC estimation accuracy, communication anti-interference, and the stability of switching values. Table 10 lists the vehicle technical test items and targets.
| Item | Target |
|---|---|
| Maximum speed (full load) | ≥80 km/h |
| 0–50 km/h acceleration time | ≤15 s |
| 0–30 km/h acceleration time | ≤8 s |
| Maximum gradability | ≥25% |
| Braking distance at 30 km/h | ≤10 m |
| Emergency braking deviation | not beyond 3 m |
| Maximum parking grade | ≥20% |
| Coast-down distance from 50 km/h | ≥800 m |
| Interior noise at 50 km/h | ≤78 dB(A) |
| Exterior noise at acceleration | ≤82 dB(A) |
| Driver ear noise | ≤90 dB(A) |
| Ride comfort | time TCD ≥1.0 h |
| Rain sealing | ≥90 |
| Dust sealing | ≥94% |
| Traction battery insulation resistance | positive >33.6, negative >33.6 |
The BMS functional test items are listed in Table 11.
| Item | Value/Standard |
|---|---|
| BMU power consumption | max 1.5 W, min 0.012 W |
| BECU power consumption | max 2 W, min 0.02 W |
| Equalization current | 500 mA |
| Thermal protection | 65 °C |
| Overvoltage protection | max 3.7 V, min 2.5 V |
| Overcurrent protection | max 900 A |
| EMI/EMC | GB/T15708-1995, GB 743-87 |
| Hardware production standard | TS16949 |
5.2 SOC Estimation Accuracy Analysis and Verification
5.2.1 Module Residual Capacity Detection
The first verification method is direct capacity measurement. Two modules are randomly selected from the 20 modules on the bus. They are discharged at 300 A and 20 °C to a cutoff voltage of 20 V. The discharged capacity is recorded, and then a 1C cycle is performed at 20 °C. The experimental results show that the residual capacity after three months of operation is 158 Ah, while the capacity after one full cycle is 290 Ah. This indicates that the module has lost some capacity due to operation, and the SOC algorithm must account for capacity degradation.
5.2.2 Vehicle Operating Parameters and SOC Trend Curve
The second verification method uses the trend curves of vehicle operating parameters versus SOC. The parameters include vehicle speed, load, motor output power, accelerator pedal signal, and trip distance. During a full vehicle test, the SOC, vehicle speed, and trip distance are recorded. Another test records the ratio of motor output power to the absolute value of the accelerator pedal signal, together with SOC. The shapes of these curves are compared with the estimated SOC. If the trend is consistent and the final SOC value matches the actual remaining capacity within 5%, the algorithm is considered accurate.
5.2.3 Analysis of the Two Methods
The direct capacity measurement method has the advantage of accurately determining the remaining capacity under a fixed condition, but it cannot cover all complex operating conditions. The trend curve method has the advantage of considering the effects of multiple parameters on SOC and capturing the trend, but experience can sometimes lead to incorrect judgment. Therefore, using both methods together provides a robust verification.
5.3 Fuzzy Algorithm Parameter Correction
Based on the verification results, the parameters of the fuzzy logic algorithm are corrected. Since the SOC changes with usage environment and battery aging, a permanent empirical formula cannot be established. Therefore, an adaptive correction of the related parameters is carried out. The final accuracy reaches 5% SOC error, which satisfies the practical application requirements of the electric vehicle battery management system.
Conclusion
Facing the opportunities and challenges brought by the new energy policy, this research selected lithium iron phosphate batteries as the cell type for a pure electric bus. The monitoring of the LiFePO4 power battery and the SOC estimation of the power battery module were studied. The battery module structure was designed according to the vehicle requirements. A battery management system was designed based on the module structure. Through vehicle road tests, the BMS functions and SOC estimation accuracy were verified.
The main conclusions are as follows:
- The designed power battery module experiments satisfy the testing parameter requirements for the pure electric bus power battery, providing a basis for verifying SOC estimation accuracy.
- The BMS provides a software and hardware platform for module SOC estimation. The stable operation of the BMS during vehicle road tests verifies the rationality of its design.
- The fuzzy logic algorithm can estimate the module SOC with an accuracy of 5%, which meets practical application requirements.
Future work can focus on: (1) the universality of BMS for different battery types; (2) further improvement of SOC estimation algorithms; (3) the use of optical fiber for vehicle CAN networking.
References
[1] Electric vehicle forum, http://www.ddqcw.com
[2] Beijing McQianqiao Information Co., Ltd. Lithium iron phosphate is becoming the mainstream of lithium-ion battery material development. New Materials Industry, 2008(10): 70-72.
[3] Mehrdad Ehsani, Yimin Gao. Modern Electric, Hybrid Electric, and Fuel Cell Vehicles: Fundamentals, Theory, and Design. Mechanical Industry Press, 2008.
[4] Hideo Takeshita. Worldwide market update on Ni-MH, Li-ion and Polymer batteries for portable applications and HEVs. The 23rd International Battery Seminar, 2006.
[5] Xia Chaoying, Zhang Shu. SOC estimation strategy based on extended Kalman filter. Power Technology, 2007(5): 414-417.
[6] Tao Xinghua et al. Battery capacity prediction using fuzzy logic and neural networks. Power Technology, 2004(9): 578-582.
[7] Gregory L. Plett. Extended Kalman filtering for battery management systems of LiPB-based HEV battery packs. Journal of Power Sources, 134 (2004): 252-261.
[8] Gu Yanlei. Research on impedance model of lithium-ion battery. Harbin University of Science and Technology, 2008.
[9] Bloom I, Cole B W, Sohn J J et al. An accelerated calendar and cycle life study of Li-ion cells. J. Power Sources, 2001, 101: 238-247.
[10] Fang Peimin. New lithium iron phosphate power battery. Today’s Electronics, 2007(9): 95-97.
[11] Broussely M, Herreyre S, Biensan P et al. Aging mechanism in Li ion cell and calendar life predictions. J. Power Source, 2001, 97-98: 3-21.
[12] Li Bin. Research on power system parameter selection and battery characteristics in hybrid electric vehicles. Tsinghua University, 1998.
[13] Ramadass P, Haran B et al. Mathematical modeling of the capacity fade of Li-ion cells. J. Power Source, 2003, 123: 230-240.
[14] Detlef Heinemann, Dietrich Naunin. A battery management system for optimized control and diagnosis of traction batteries in EVs and HEVs. EVS16, Beijing, 1999.
[15] Xiao Yuping. Hybrid electric vehicle battery management system. Beijing University of Technology, 2005.
[16] Liu Yongzhe. Design of electric vehicle battery management system based on μC/OS-II. Microcontrollers & Embedded Systems, 2006(12): 35-37.
[17] Zhao Huiyong. Research on hybrid city bus test and on-board Ni-MH battery management system. Wuhan University of Science and Technology, 2005.
[18] Heinemann D, Naunin D. A new design of a battery management system including a range forecast. IEEE Trans Energy Conversion, 1992, 7(1): 93-97.
[19] Gao Peng. Application of embedded system in electrochemical workstation. Harbin University of Science and Technology, 2008.
[20] Texas Instruments, http://www.ti.com.cn/
[21] Chen Hongtu, Wang Weili. Design of electric vehicle battery management system based on μCOS-II. Power Technology, 2009, 33(6): 509-511.
[22] Ren Zhe. Principles and Applications of Embedded Real-Time Operating System μC/OS-II. Beihang University Press, 2005.
[23] Wang Anmin, Cheng Yu. Typical Cases of DSP Embedded System Development. Posts & Telecom Press, 2007.
[24] Freescale, http://www.freescale.com.cn
[25] Jean J. Labrosse. MicroC/OS-II: The Real-Time Kernel. Beihang University Press, 2003.
[26] Chen Xiankui. Application of CAN bus in large and medium buses. Electronic Technology, 2003(13): 55-57.
[27] Liu Qiao, Jiang Liangzhong. Distributed control system and fieldbus control system. Modern Electronic Technology, 2003(13): 89-93.
[28] SAE J1939 Revised JAN2005.
[29] Chen Quanshi. Advanced Electric Vehicle Technology. Beijing Industry Press, 2007.
[30] Li Jia. Analysis of communication delay between CAN and TTCAN. Journal of Tsinghua University, Computer Engineering, 2006(2): 261-264.
[31] Guo Fangrui. Fieldbus and considerations in application. Measurement and Control Technology, 2003(10): 33-35.
[32] Ivor Horton. Beginning Visual C++ 2008. 2009.
[33] Jiang Haifeng. Design and development of lithium iron phosphate battery detection system. Harbin University of Science and Technology, 2008.
[34] Yang Shuo, He Liping, Zhong Zhihua. Battery management system for electric vehicles based on CAN bus. Journal of Guizhou University of Technology, 2004, 33(2): 29-31.
[35] Hu Minghui. Evaluation of SOC in hybrid electric vehicle battery management system. Journal of Chongqing University, 2003(4): 20-23.
[36] Ma Youliang, Chen Quanshi. Definition and detection method of SOC for electric vehicle batteries. Journal of Tsinghua University, 2001, 41(11): 95-97.
[37] Zhu Yuan, Han Xiaodong. Research on SOC prediction technology for electric vehicle power batteries. Power Technology, 2000, 24(3): 153-156.
[38] Liu Qian. Research on Ni-MH battery management system and SOC prediction method. Wuhan University of Technology, 2004.
[39] Wang Jia. Fuzzy SOC estimation of automotive power battery and its implementation on DSP. Jilin University, 2004.
[40] Sun Li, Tan Xinde, Xie Fuchun. The battery management system for electric vehicle based on estimating battery’s states. IEEE Trans Energy Conversion, 2001, 7(3): 99-104.
[41] Singh Pritpal, Fennie Craig. A fuzzy logic approach to state of charge determination of high performance batteries with applications to electric vehicles. Proc of EVS 15, Belgium, 1998.
[42] GB/T 19596-2004. Electric vehicle terminology.
[43] Maggetto Caston. Proc of EVS 15. Belgium, 1998.
[44] Fuji Electric Co., Ltd. FRENC 5000VG7S Series Instruction Manual, 2008.
Acknowledgements
I would like to express my sincere gratitude to my supervisor for his careful guidance and support throughout the research. I also thank all colleagues and engineers who participated in the experiments and vehicle testing. Their help was invaluable to this work.
