Design and Research on Energy Storage Battery Management System

In the context of the global “dual carbon” goal, accelerating the development of the new energy industry to achieve zero-carbon emission reduction has become a major trend. This has also accelerated the innovation of battery electronic control technology. The Battery Management System (BMS), as a health steward for batteries, is widely applied in various scenarios, from small batteries to large-scale energy storage batteries. Especially for power systems in critical fields, such as electric vehicles and power station energy storage systems, the BMS is indispensable to ensure stability and safety. The accuracy of battery data acquisition, the precision of State of Charge (SOC) estimation, and the rigor of charge/discharge control logic all play pivotal roles in battery safety. Therefore, this paper focuses on the safety monitoring and control of lithium batteries, carrying out the following work with the aim of designing a comprehensive energy storage battery management system and investigating advanced SOC estimation methods.

During my research, I first conducted a thorough analysis of the system requirements and determined the overall system architecture. I explored the relationship between battery open-circuit voltage and state of charge, and combined it with the selected second-order RC equivalent circuit model. The parameters were identified offline, and the results of the model parameter identification were verified using experimental data from a specific operating condition. Through analysis of the results, I proved the necessity of online parameter identification.

Subsequently, I conducted a joint study on online parameter identification and SOC estimation of the battery model. I introduced the principle of the recursive least squares method with a forgetting factor. To address the issue that an improperly selected forgetting factor can degrade the algorithm into a standard recursive least squares method, I introduced a data windowing theory, which allows the forgetting factor to change according to the actual model parameters. This method further improves the stability of the algorithm. In response to the fact that noise in practical applications cannot meet the assumptions of the traditional Extended Kalman Filter (EKF), I incorporated a noise covariance matching algorithm, which enables the noise statistical characteristics in the EKF algorithm to adaptively update with changes in the estimation results. Simulation results verified the accuracy of this joint estimation algorithm.

Then, based on the requirements of a specific project, I designed a set of hardware for the BMS. Using the main chip DSP28335 and the battery management chip MT9804, I designed a two-stage distributed system. This included the hardware design of various functional modules. The main control module mainly includes the CAN communication module, external memory module, electric metering module, and charge-discharge control module. The slave control module mainly includes voltage acquisition module, temperature acquisition module, and equalization module. This provided the necessary hardware platform for the algorithms and software.

Finally, based on the BMS hardware circuit board, I completed the design of the system’s embedded program and the upper computer monitoring program. For the embedded software, I used a state machine structure, built the program framework, and wrote the sub-module drivers and related interrupt service routines. For the upper computer monitoring software, I used CAN bus for data transmission, implementing the BMS status monitoring and control required by the system. To address the issue of operator fatigue caused by long-term manual operation during charge/discharge testing, I implemented an automatic charge/discharge cycle control for the battery pack. For scenarios where the BMS is sealed and it is inconvenient to open the case for program updates, I designed an IAP online upgrade method based on the CAN bus, which also has the function of preventing upgrade failures, avoiding situations where the system cannot restart due to factors such as sudden power failure.

This paper is organized into five chapters. Chapter 1 introduces the background and current research status of energy storage BMS, battery models, and SOC estimation. Chapter 2 covers the system requirements, overall architecture design, and battery modeling. Chapter 3 focuses on the joint algorithm for online parameter identification and SOC estimation. Chapter 4 details the hardware design of the system. Chapter 5 presents the software design, system integration, and tests.

1. System Overall Design and Battery Modeling

To ensure the safety, stability, and high performance of the energy storage battery system, I meticulously analyzed the system requirements before initiating the design process. The functional requirements were determined as follows: real-time monitoring of battery parameters (including total current, total voltage, individual cell voltages, and temperatures), online fault diagnosis, battery safety control (overcharge/overdischarge protection), charge/discharge indication, passive cell balancing, network communication via CAN bus with a response time of less than 100 ms, information management (including data storage and display), remote upgrade capability via CAN bus, and fully automatic charge/discharge control. The precision requirements were set as follows: cell voltage measurement accuracy of ±5 mV, cell temperature accuracy of ±5 ℃, total voltage accuracy of ±1%, total current accuracy of ±2%, program upgrade time less than 2 minutes, and SOC estimation accuracy within ±5%. These specifications guided the entire design process.

Based on the requirements, I established a two-level distributed system architecture. The BMS consists of one master control unit (BCU) and several slave control units (BMU). The slave units are responsible for cell voltage and temperature acquisition, and for executing the passive balancing strategy. They communicate with the master unit via a dedicated CAN bus. The master unit is responsible for processing the data received from the slave units, managing overall system state estimation (SOC, SOH), controlling the charging and discharging relays, communicating with the upper computer via a separate CAN interface, and managing data storage. This architecture provides high flexibility and scalability, allowing for easy expansion to manage more cells.

Comparison of BMS Architectures
Architecture Definition Advantages Disadvantages
Centralized A single control unit directly connected to the battery pack handles all measurements and control. Simple structure, lower cost. Long wiring, low reliability, limited battery count.
Distributed Master-slave structure; slave modules handle measurement & equalization; master handles data processing and control. Flexible connection, easy expansion. Higher cost, complex communication logic.
Semi-centralized A combination of centralized and distributed, used for irregular battery module layouts. High integration, simple structure. High cost, not universally applicable.

For the battery model, I selected the second-order RC equivalent circuit model. This model strikes an excellent balance between accuracy and computational complexity. It consists of a voltage source (U_OCV) representing the open-circuit voltage, a series ohmic resistance (R0), and two parallel RC networks. The first RC network (R1, C1) represents the electrochemical polarization effect, while the second RC network (R2, C2) represents the concentration polarization effect. This model effectively captures the transient voltage response of the battery, which is crucial for accurate SOC estimation. The electrical behavior of the model can be described by the following state-space equations:

$$
U_t(t) = U_{OCV}(t) – U_1(t) – U_2(t) – I(t) \cdot R_0
$$

$$
U_1(t) = I(t) \cdot R_1 – R_1 \cdot C_1 \frac{dU_1(t)}{dt}
$$

$$
U_2(t) = I(t) \cdot R_2 – R_2 \cdot C_2 \frac{dU_2(t)}{dt}
$$

where I is the charge/discharge current (positive for charging), and U_t is the terminal voltage. To use this model, I first needed to establish the relationship between the open-circuit voltage (OCV) and the SOC. This was done experimentally using the static voltage method. The battery was fully charged and then discharged in steps, allowing sufficient rest time after each step to reach equilibrium. The measured stable voltage was recorded as the OCV for that corresponding SOC. To improve accuracy in the regions where the OCV-SOC curve is steep (low SOC and high SOC), I used smaller discharge steps (2% SOC) in those areas and larger steps (5% SOC) elsewhere.

Measured OCV-SOC Relationship Data
SOC (%) U_OCV (V) SOC (%) U_OCV (V)
100 3.5044 45 3.2877
98 3.3299 40 3.2828
96 3.3296 35 3.2654
94 3.3299 30 3.2521
92 3.3299 25 3.2393
90 3.3299 20 3.2211
85 3.3286 15 3.2009
80 3.3271 10 3.1876
75 3.3032 8 3.1516
70 3.2955 6 3.0912
65 3.2917 4 3.0081
60 3.2899 2 2.8757
55 3.2886 0 2.5313
50 3.2880 – –

To represent this relationship mathematically, I used a curve-fitting toolbox in MATLAB to perform polynomial fitting. An 8th-degree polynomial was found to provide an excellent fit with an R-square value of 0.99. The resulting function is:

$$
f(x) = p_1 \cdot x^8 + p_2 \cdot x^7 + p_3 \cdot x^6 + p_4 \cdot x^5 + p_5 \cdot x^4 + p_6 \cdot x^3 + p_7 \cdot x^2 + p_8 \cdot x + p_9
$$

where the coefficients are p1=-118.1, p2=630.1, p3=-1382, p4=1617, p5=-1091, p6=430.5, p7=-95.98, p8=11.22, and p9=2.687. The high fitting accuracy is indicated by the low SSE value of 0.008684 and the RMSE of 0.02196.

Next, I performed offline parameter identification of the second-order RC model using data from a Hybrid Pulse Power Characteristic (HPPC) test. The HPPC test consists of applying a series of pulse charge and discharge currents at various SOC levels. By analyzing the voltage response curve to a pulse current, I can calculate the model parameters. When the pulse current is applied or removed, the instantaneous voltage drop or rise is attributed to the ohmic resistance R0. The slower voltage changes during the pulse are caused by the two RC networks. By fitting the voltage response over time with an exponential function, I can determine the values of R1, C1, R2, and C2 for each SOC point.

$$
U_L(t) = U_{OCV} – I \cdot R_0 – I \cdot R_1 \cdot (1 – e^{-t/\tau_1}) – I \cdot R_2 \cdot (1 – e^{-t/\tau_2})
$$

where the time constants are defined as τ1 = R1·C1 and τ2 = R2·C2. The identification results for a set of SOC points are summarized in the table below.

Offline Parameter Identification Results for the 2nd-Order RC Model
SOC OCV (V) R0 (mΩ) R1 (Ω) C1 (F) R2 (Ω) C2 (F)
1.00 3.5044 2.875 1.435e-3 3420.2 1.801e-5 877.84
0.90 3.3299 2.875 3.053e-6 58729 4.311e-6 3611.6
0.80 3.3271 2.950 2.265e-5 88495 6.751e-5 2774.8
0.70 3.2955 3.100 5.42e-5 38154 7.221e-6 2699.0
0.60 3.2899 3.175 2.499e-6 74589 5.818e-6 3035.4
0.50 3.2880 2.950 3.704e-6 47327 5.804e-6 2911.7
0.40 3.2828 2.725 5.32e-5 36033 5.692e-6 2812.7
0.30 3.2521 2.875 8.814e-6 19049 4.842e-6 2961.5
0.20 3.2211 2.875 3.969e-6 52859 7.071e-6 2431.1
0.10 3.1876 3.175 5.868e-6 37235 8.521e-6 1938.7
0 2.5313 3.425 1.358e-3 439.54 0.004038 1760.5

To verify the accuracy of the offline identified model, I simulated the HPPC test using the identified parameters and compared the model output voltage with the actual measured voltage. The model output voltage generally followed the trend of the actual voltage, but the maximum error was approximately 5.7%. This relatively large error indicates that the offline identified parameters, which are obtained at a specific temperature and SOH, do not fully reflect the dynamic changes in battery parameters under varying operating conditions. This result confirmed that online parameter identification is essential for improving the accuracy of the model and, consequently, the SOC estimation. The offline identification results, however, serve as a good initial guess for the online identification algorithm.

2. Online Parameter Identification and SOC Joint Estimation

To improve the accuracy of model-based SOC estimation under real-world dynamic conditions, I investigated online parameter identification methods. I developed a Variable Forgetting Factor Recursive Least Squares (VFFRLS) algorithm to track the changes in the model parameters in real time.

The Recursive Least Squares (RLS) method estimates parameters by minimizing the sum of squares of the model error. In a time-varying system, new data should have a greater influence on the estimate than old data. This is achieved by adding a forgetting factor λ to the RLS algorithm. The standard forgetting factor RLS (FFRLS) updates the parameters using the following recursive equations:

$$
P_{N+1} = \lambda^{-1} [P_N – \frac{P_N \cdot \varphi(n+N+1) \cdot \varphi^T(n+N+1) \cdot P_N}{\lambda + \varphi^T(n+N+1) \cdot P_N \cdot \varphi(n+N+1)}]
$$

$$
K_{N+1} = \frac{P_N \cdot \varphi(n+N+1)}{\lambda + \varphi^T(n+N+1) \cdot P_N \cdot \varphi(n+N+1)}
$$

$$
\hat{\theta}_{N+1} = \hat{\theta}_N + K_{N+1} \cdot [y(n+N+1) – \varphi^T(n+N+1) \cdot \hat{\theta}_N]
$$

In the FFRLS algorithm, a smaller value of λ gives more weight to recent data, allowing the algorithm to track parameter changes more quickly. However, a constant small λ can make the algorithm overly sensitive to noise. To overcome this limitation, I implemented a VFFRLS algorithm where the forgetting factor is not constant but is adjusted based on the current model error. The key is to use a data windowing theory to calculate the error. The forgetting factor is then calculated as:

$$
\lambda(k) = \lambda_{min} + (\lambda_{max} – \lambda_{min}) \cdot L(k)
$$

$$
L(k) = \frac{\frac{1}{M} \sum_{i=k-M}^{k} e_i^2}{\rho + A}
$$

where e_i is the system estimation error, M is the size of the moving window, ρ is a sensitivity factor, and A is a small positive number to avoid division by zero. This formulation ensures that when the error is large (indicating a rapid change or a poor initial estimate), the forgetting factor becomes smaller, allowing the algorithm to adapt quickly. Conversely, when the error is small (steady-state), the forgetting factor approaches λ_max (close to 1), maintaining filter stability.

To apply the VFFRLS to the second-order RC model, I first derived the transfer function of the model in the s-domain. Then, using the bilinear transform to convert to the z-domain, I obtained a discrete-time difference equation. This equation was then rearranged into a form suitable for the least-squares estimation:

$$
U(k) = \theta_1 \cdot U(k-1) + \theta_2 \cdot U(k-2) + \theta_3 \cdot I(k) + \theta_4 \cdot I(k-1) + \theta_5 \cdot I(k-2)
$$

In this equation, the vector θ = [θ1, θ2, θ3, θ4, θ5]^T contains the parameters to be identified. By using the VFFRLS algorithm to identify these coefficients, I can then reverse-calculate the values of the electrical model components (R0, R1, C1, R2, C2) using a set of transformation formulas. I validated this online identification method using the Urban Dynamometer Driving Schedule (UDDS) test data. The identified parameters showed expected trends. The ohmic resistance R0 remained stable throughout the discharge and increased significantly only near the end. The two time constants τ1 and τ2 clearly represented the different dynamic processes. The most crucial result was that the model voltage predicted using the online identified parameters closely matched the actual terminal voltage, with the maximum voltage error being reduced compared to the offline model, demonstrating the effectiveness of the online parameter identification.

For SOC estimation, I utilized the Extended Kalman Filter (EKF) algorithm, which is suitable for nonlinear systems like the battery. The EKF linearizes the system model around the current state estimate. However, the standard EKF assumes that the process noise and measurement noise are known and have zero-mean Gaussian distributions with constant covariances. In practice, these noise statistics are often unknown and time-varying. To address this, I developed an Adaptive Extended Kalman Filter (AEKF). The AEKF enhances the EKF by adding a noise covariance matching step. This step uses a moving window of innovation sequences to adaptively adjust the process noise covariance Q and the measurement noise covariance R at each time step, thereby making the filter more robust to changing noise conditions.

The state vector for the AEKF includes the SOC and the two polarization voltages. The state-space equations are as follows:

$$
\begin{bmatrix}
SOC_{k+1} \\
U_{1,k+1} \\
U_{2,k+1}
\end{bmatrix}
=
\begin{bmatrix}
1 & 0 & 0 \\
0 & e^{-\Delta t/\tau_1} & 0 \\
0 & 0 & e^{-\Delta t/\tau_2}
\end{bmatrix}
\cdot
\begin{bmatrix}
SOC_k \\
U_{1,k} \\
U_{2,k}
\end{bmatrix}
+
\begin{bmatrix}
-\frac{\eta \cdot \Delta t}{Q_N} \\
R_1(1 – e^{-\Delta t/\tau_1}) \\
R_2(1 – e^{-\Delta t/\tau_2})
\end{bmatrix}
\cdot I_k
$$

$$
U_{t,k} = U_{OCV}(SOC_k) – U_{1,k} – U_{2,k} – R_0 \cdot I_k
$$

where η is the coulombic efficiency, and Δt is the sampling time. To combine the strengths of both algorithms, I designed a joint estimation algorithm, VFFRLS-AEKF. The workflow is as follows:

VFFRLS-AEKF Joint Estimation Algorithm Procedure
Step Description
1 Initialize the system state (SOC, U1, U2) and the model parameters using offline identified values and the OCV-SOC table.
2 At time step k, use the VFFRLS algorithm with the current and previous current/voltage measurements to identify the model parameters (R0, R1, C1, R2, C2) for the current moment.
3 Use the newly identified model parameters in the AEKF for the prediction and update steps. The AEKF estimates the SOC and the polarization voltages, and also adaptively updates the noise covariances Q and R.
4 The estimated state and covariance matrix are used as the basis for the next time step. The process is repeated for each subsequent time step.

I tested the joint estimation algorithm under two different operating conditions. In the HPPC test with an initial SOC of 1.0, the estimated SOC tracked the true SOC very closely, with a maximum error of less than 2%. In a more complex UDDS test with a deliberately incorrect initial SOC of 0.8, the estimated SOC converged quickly to the true value, and the maximum error remained well below 5%. These results demonstrate that the VFFRLS-AEKF algorithm is robust to both model inaccuracies and incorrect initialization, making it highly suitable for practical SOC estimation applications. The convergence speed is rapid, and the accuracy is consistent across different load profiles.

3. Hardware Design of the BMS

Following the determination of the system architecture, I designed the detailed hardware circuits for both the master control unit (BCU) and the slave control units (BMU). The hardware was designed with the project requirements, safety, and reliability as the guiding principles.

The core processor for both the BCU and BMU is the TMS320F28335 digital signal processor (DSP) from Texas Instruments. This powerful 32-bit processor with a floating-point unit operates at 150 MHz and is well-suited for the complex real-time calculations required during parameter identification and SOC estimation. It also has plenty of on-chip resources, including a 256K×16-bit flash, 34K×16-bit SRAM, and two eCAN modules.

Key Parameters of the TMS320F28335 DSP
Feature Specification
CPU 32-bit fixed-point + single-precision floating point unit (FPU)
Main Frequency 150 MHz
On-chip Flash 256K x 16-bits
SRAM 34K x 16-bits
Timers 3 x 32-bit CPU timers
Communication Peripherals 2 x eCAN, 3 x SCI, 1 x SPI, 1 x I2C
ADC 16 channels, 12-bit

Main Control Unit (BCU) Design: The BCU is the central coordinating unit of the BMS. It is responsible for sampling the total current and total voltage of the battery pack, managing the charge/discharge relays, communicating with the host computer, and performing high-level state estimation and fault management. The BCU minimal system includes a clock circuit (using a 30 MHz crystal), a JTAG interface for programming and debugging, and a reset circuit. The power supply module steps down the external 24 V input to various voltage levels required by different components, using switching regulators like LM2596 to produce 12 V and 5 V, and linear regulators like AMS1117 to produce 3.3 V. For the DSP, a dedicated TPS767D301 power chip provides the 3.3 V I/O voltage and the 1.9 V core voltage.

The BCU’s communication is a critical part of the design. The DSP has two internal eCAN controllers, and the system actually needs four CAN bus lines: one for the BMUs, one for the host computer, one for the insulation detector, and one for the charger. For the two extra lines, I used a protocol converter chip, the CSM300A, which can convert a UART/SPI signal to CAN. For the CAN physical layer, I used the PCA82C250 transceiver. To protect the system from electrical interference, I used an isolated CAN communication module. The circuit includes a common-mode choke and TVS diodes to suppress electromagnetic radiation and protect against voltage surges. This design ensures reliable communication in the harsh electromagnetic environment of a battery pack.

I also designed an external memory module to meet the requirement for storing data. The chosen memory chip is the CY153D3, a ferroelectric random-access memory (F-RAM) that communicates via SPI. It supports 10^15 read/write cycles, making it ideal for recording historical data. This memory stores the lifecycle data of the battery, such as capacity, internal resistance, and SOH, as well as a history of fault codes, which is essential for diagnostic analysis. The WP pin is directly grounded to disable write protection and simplify the circuit.

The electric metering module is the core of state measurement. I selected the JKC391 hall sensor for current measurement, capable of measuring ±300 A with high accuracy. The sensor outputs a voltage proportional to the measured current, which is then conditioned by a signal processing circuit and fed to the DSP’s ADC. For total voltage detection, I used the HCV500 voltage sensor, which can measure up to 500 V. I also designed a circuit for measuring the temperature inside the battery box using an NTC thermistor. The circuit is fundamentally a voltage divider, and the DSP computes the temperature from the measured voltage.

For safety and system state monitoring, I included a secondary power supply monitoring module. This module uses the TPS3703 voltage monitor chip to constantly check the secondary power supply voltages. If a monitored voltage goes out of its normal range, the RESET pin of the TPS3703 falls to a low level. This signal is passed through a digital isolator (ISO7710) to the DSP. The DSP’s interrupt service routine detects this and generates a corresponding fault code, stores it in the non-volatile memory, and takes appropriate safety actions. This feature significantly enhances the overall system reliability.

Slave Control Unit (BMU) Design: The BMU is responsible for high-precision measurement of individual cell voltages and temperatures, and for executing the passive balancing algorithm. A key component in the BMU design is the MT9804 battery monitoring chip, a highly integrated analog front-end IC. This chip can measure 12 cell voltages with an accuracy of ±2.2 mV and has 5 general-purpose I/O (GPIO) pins that can be configured for temperature measurement. It has built-in diagnostics for wire disconnection and overvoltage/undervoltage detection.

For the BMU’s power supply, I utilized the unique power management feature of the MT9804. It can be powered directly from the battery stack under management, eliminating the need for a separate isolated power supply. The chip’s DRIVE pin provides a regulated 5.6 V output, which is used with an external NPN transistor to create a linear regulator from a higher voltage tap on the battery, ensuring the MT9804 is powered correctly.

The cell voltage acquisition circuit is based on the MT9804’s differential inputs. To reduce noise, I added a differential RC filter on each input, consisting of a 100 Ω series resistor and a 0.01 μF capacitor between adjacent cell inputs. The voltage measurement is performed by the internal 16-bit ADC of the MT9804. The measured value is directly proportional to the cell voltage.

For communication between the DSP and the MT9804, I used the isolated SPI (isoSPI) interface to create a robust communication link. The DSP’s standard SPI signals are converted by a dedicated MT9820 device into a differential signal. This allows for a daisy-chain configuration of multiple MT9804 chips, which is a scalable approach. In my design, I cascaded five MT9804 chips on a single BMU board to measure up to 56 cell voltages in a single module. The temperature measurement uses the GPIO pins of the MT9804. Each GPIO pin is configured with a \(10k\Omega\) pull-up to a precision reference (\(V_{REF2}\)), and a 100 Ω/0.1 μF RC low-pass filter. The NTC thermistor is connected between the GPIO pin and ground. Therefore, the voltage at the GPIO pin is determined by the voltage divider formed by R13 and the NTC. The ADC reads the voltage and calculates the temperature using the NTC’s resistance-temperature characteristic table. In this design, ten temperature sensors are distributed across the five MT9804 chips to monitor the cell temperatures.

The cell balancing module is a critical feature for maintaining battery pack consistency. I designed a passive balancing circuit using the integrated discharge switches of the MT9804. Each GPIO pin S1 to S12 can control an external PMOS transistor. When a cell is identified as having a higher voltage than its peers, the DSP writes a high level to the corresponding S pin. This turns on the external transistor, discharging the cell through a power resistor. The energy is dissipated as heat, lowering the voltage of that cell to match the others. This is a simple, cost-effective, and reliable balancing method. The balancing strategy is controlled by software to ensure only a maximum of 4 cells are balanced simultaneously at any given time to prevent the PCB from overheating.

Design Parameters and Components
Module Key Component / Design Aspect Description / Specification
Main Controller TMS320F28335 DSP 150 MHz, 32-bit, Floating-point
Cell Monitor MT9804 AFE 12-cell measurement, ±2.2mV accuracy
Current Sensor JKC391 Hall Sensor ±300A range, ±1%FS accuracy
Voltage Sensor HCV500 0-500VDC measurement
Memory CY153D3 F-RAM 8Mbit, 10^15 write cycles, SPI interface
Communication PCA82C250, CSM300A CAN transceiver, UART/SPI-to-CAN bridge
Power Monitor TPS3703 Overvoltage/Undervoltage monitor

4. Software Design and System Testing

The software for this system is composed of two main parts: the embedded software for the BMS controllers (BCU and BMU) and the upper-computer monitoring software for the host PC. I developed the DSP programs in the Code Composer Studio (CCS) 6.1.3 environment, and the host computer application in LabVIEW 18.0.

Embedded Software Design: The embedded software was designed with a layered architecture. The bottom layer is the device driver layer, which includes drivers for peripherals like SPI, CAN, ADC, and Flash. The top layer is the application layer, which includes functional modules such as SOC estimation, balancing control, fault diagnosis, and data storage.

One crucial aspect is the SPI communication driver for the MT9804. The DSP is the master. The communication protocol is based on broadcast commands. To initiate a measurement, the DSP sends a specific command word, such as the ADCV command for voltage conversion. A command is framed with a command code and a packet error code (PEC) for integrity checking. The timing sequence is critical: I pull down the chip select line, wait for a period, then send the command bytes. After the conversion, I send a read command to retrieve the data from the MT9804’s internal registers.

Broadcast Command Format for MT9804
Bit Range Field Description
8 bits CMD0/CMD1 Command code (e.g., 0x03, 0x60 for ADCV)
8 bits PEC0/PEC1 Packet Error Code (CRC-15 for command validation)
8 bits Data Bytes Data to be written/read from the AFE

The CAN communication driver is also fundamental. The initialization routine involves setting the baud rate, which was calculated to be 250 kbps. The data transmission and reception routines handle the eCAN mailbox operations. For the system’s communication protocol, I used extended frame format. The software is structured around an interrupt service routine that handles incoming CAN messages and a polling loop that processes outgoing data frames.

At the application layer, the control flow is managed by a main loop. The SOC estimation module, described in the previous chapter, combines the ampere-hour counting method with an OCV-based correction. The algorithm continuously integrates the measured current. When the system detects that the current is negligible for a sustained period (e.g., 5 minutes), it uses the OCV-SOC lookup table to correct the accumulated SOC, thereby eliminating the cumulative error inherent in pure current integration. The fault diagnosis module (CBIT) is designed to monitor various parameters, including cell overvoltage and undervoltage, temperature limits, and communication faults. I implemented a confirmation mechanism for this module, where a fault flag is set only after the condition persists for a certain number of consecutive checks, preventing false alarms due to transient noise.

In addition to the standard application code, I designed a bootloader program to support IAP. The address space of the DSP’s flash memory is partitioned into a reserved section for the bootloader, and the remainder is used for the application program. The bootloader, placed in Flash sector A, runs on reset and checks a specific memory flag. If the flag is set, it enters the update mode, receives program data via CAN, and writes it to the application sections using the Flash API. This design allows for seamless program updates without opening the BMS enclosure, significantly improving system maintainability.

Flash Memory Partitioning Strategy for IAP
Memory Region Content Size
Flash Sector A Bootloader Program 2K words
Flash Sectors B-G Application Program 254K words

Upper-Computer Monitoring Software: I designed the monitoring platform in LabVIEW, using a multi-threaded structure to handle different tasks concurrently. The “BMS Status Information” interface is the main window for monitoring and control. It includes a control command area, a key parameters display area, an alarm area, and a real-time data trend area. The application provides a one-click online upgrade interface, which is an automated state machine that simplifies the complex bootloader update process for the user. The “Discharge Test” management interface implements the fully automatic charge/discharge cycle experimental control. The background program for the automatic test is a state machine with multiple states: protecting the scene, charging the battery, discharging with pre-set cycles, and finally restoring the scene and saving the data. This automated system ensures safety and thoroughness during long-duration testing.

System Integration and Testing: After completing both hardware and software design, I built a comprehensive test platform. The system consisted of a PC with a USBCAN interface card, an energy storage battery module, a charger, a load, a temperature/humidity meter, and an insulation detector. All devices were connected via CAN bus. I then conducted a series of tests to verify the performance of the system against the original specification requirements.

Summary of BMS System Test Results
Test Item Test Result / Accuracy Requirement Status
Cell Voltage Measurement ±2 mV ±5 mV Pass
Cell Temperature Measurement ±2 ℃ ±5 ℃ Pass
Total Voltage Measurement 0.09% (max) ±1% Pass
Total Current Measurement 1.8% (max) ±2% Pass
SOC Estimation Error 3.9% (max) ±5% Pass
Balancing Function Reduced voltage mismatch to 14mV Functionality verified Pass

For the cell voltage testing, I compared the measured values from the BMS with a high-precision digital multimeter. After calibration, the maximum error observed was 2 mV, which is well within the ±5 mV requirement. The temperature measurements were also accurate, with an error of only 1-2 ℃. The total voltage sensor demonstrated very high accuracy, with errors under 0.1% across the entire working range. The current sensor accuracy was also verified, and the maximum error was found to be 1.8%, which meets the ±2% requirement.

The SOC estimation algorithm was rigorously tested in an actual system. The battery was charged to 100% and then discharged in steps of 10%. After each step and a rest period, the estimated SOC was compared to the actual discharged capacity. The results showed that the maximum SOC estimation error was 3.9%, which occurred at the very end of the discharge cycle. Over most of the discharge curve, the error was below 1%, demonstrating both the accuracy and robustness of the ampere-hour integration with OCV correction. The balancing function was also verified by creating a voltage mismatch and observing the equalization process. The system was able to reduce the voltage difference effectively, confirming the functionality of the passive balancing circuit and its control strategy.

Conclusion

In this paper, I presented a comprehensive design for an energy storage battery management system, encompassing both hardware and software. I focused intensively on the accuracy of SOC estimation and the reliability of the overall system. The research has led to the following achievements and conclusions:

First, I developed a battery model based on the second-order RC equivalent circuit. The OCV-SOC relationship was characterized experimentally and fitted with a high-order polynomial. I compared offline parameter identification with online identification using a Variable Forgetting Factor Recursive Least Squares (VFFRLS) algorithm. The results clearly showed that the online identification method provides a much more accurate model representation under dynamic operating conditions, reducing the terminal voltage error compared to the offline method.

Second, I successfully implemented a joint VFFRLS-AEKF algorithm for SOC estimation. The adaptive nature of both the forgetting factor and the noise covariance matrix ensures that the SOC estimate is both accurate and robust, even under complex test profiles (HPPC and UDDS) and with an incorrect initial SOC. The maximum error was shown to be well below the ±5% requirement, confirming the effectiveness of the algorithm.

Third, I completed a full hardware design for the BMS. This included the circuit designs for a DSP-based master controller and for several slave controllers using the highly integrated MT9804 analog front-end. The hardware design incorporates robust CAN communication, safety monitoring, non-volatile data storage, and a passive balancing function. The two-level distributed architecture proved to be both scalable and reliable.

Fourth, I developed the embedded software and an upper-computer monitoring platform. The software includes essential device drivers, application logic, a robust CAN-based bootloader for IAP, and an automated charge/discharge cycle test feature. This significantly improves the practical usability and safety of the energy storage battery system.

Finally, I validated the entire system on a test platform. The test results confirmed that all key performance indicators meet the industry-standard requirements. The cell voltage accuracy is within ±2 mV, current measurement within ±1.8%, and the SOC estimation error is capped at 3.9%. The system successfully passed various functional tests, including data collection, balancing, fault diagnosis, data storage, and online upgrade. The designed energy storage battery management system, with its accurate SOC estimation and comprehensive management functions, is well-suited for practical energy storage applications. However, I acknowledge that there are areas for future improvement, particularly in the battery SOC estimation algorithm itself. I currently use ampere-hour integration with OCV correction in the final implementation. In the future, I plan to integrate the VFFRLS-AEKF algorithm, validated in MATLAB, into the embedded program for real-world testing, which should further enhance the SOC estimation accuracy and adaptability.

Scroll to Top