Modeling and Simulation Safe Batteries for E-Mobility

A guest post by Robert ter Waarbeek, Principal Automotive Industry Manager at MathWorks | Translated by AI 4 min Reading Time

Related Vendors

Digital modeling and simulation of batteries in the development of battery management systems enable faster development cycles, lower costs, and the realization of safe, efficient electric vehicles.

Thermal runaway is the dreaded exothermic reaction where the battery becomes nearly impossible to extinguish. BMS prevent this reaction.(Image: MathWorks)
Thermal runaway is the dreaded exothermic reaction where the battery becomes nearly impossible to extinguish. BMS prevent this reaction.
(Image: MathWorks)

In electric vehicles (EV), safety is the top priority. Due to the high energy density of lithium-ion batteries, which are typically used in electric vehicles, there is a risk of failure if the operating conditions differ from those for which the battery is designed. A battery management system (BMS) is therefore essential to avoid critical incidents. These include thermal runaway—an uncontrolled exothermic reaction that can lead to the destruction of the battery.

The main functions of a BMS include

  • the monitoring of current, voltage, and temperature,

  • the prevention of overcharging and overdischarging,

  • the charge balancing between battery cells,

  • the estimation of the state of charge (SOC) and state of health (SOH) of the battery, as well as

  • the control of the battery pack's temperature.

These functions are of crucial importance as they affect the performance, safety, battery lifespan, and user experience of the electric vehicle. By preventing overcharging and discharging beyond the voltage limits, the BMS prevents premature aging of the battery. This ensures the vehicle remains efficient throughout its operational life.

Advantages of Simulation in BMS Development

The developers simulate the battery system model, the environment, and the BMS algorithms on a desktop computer using behavioral models. They use these desktop simulations to explore new design ideas and test different system architectures before deciding on a hardware prototype. Additionally, the developers use the desktop simulation to verify functional aspects of the BMS design.

For example, they can test different balancing configurations to evaluate their suitability as well as their advantages and disadvantages. Such a simulation also proves to be a valuable tool for requirements testing. For instance, developers can verify the correct behavior of a contactor in the event of an insulation fault. Analyzing system behavior in fault scenarios is another illustrative example of how simulations can effectively replace hardware tests.

Once the design of the BMS has been validated using the desktop simulation, C or HDL code is automatically generated for rapid prototyping (RP) or hardware-in-the-loop (HIL) tests to further validate the BMS algorithms executed as code in real-time. With RP, code is generated from the BMS algorithm model and executed on a real-time computer that simulates the functions of the final production microcontroller.

Thanks to automatic code generation, algorithm changes made in the model can be verified on real-time hardware within a few hours instead of several days. In HIL testing, the code is generated from the battery system models and not from the BMS algorithm models. This creates a virtual real-time environment that represents the battery pack, active and passive circuit elements, loads, the charger, and other system components. This virtual environment allows developers to validate the functionality of the BMS controller in real-time before developing a hardware prototype.

Simulation can significantly shorten the time from design to code generation and allows technical applications to be tested faster and more efficiently. For example, experts at Altigreen Propulsion Labs used a simulation-based approach to model and iteratively test various methods for SOC estimation, such as Kalman filtering and Coulomb counting. According to Prathamesh Patki, Principal Engineer and Control Systems Head at Altigreen, the MathWorks Embedded Coder halved the development time. "Whatever we design, we can get it running on the real hardware in the shortest possible time."

Use Cases for Modeling and Simulation in BMS Development

Cell characterization refers to the adaptation of a battery model to experimental data. Precise cell characterization is important because the BMS algorithm uses the battery model to set control parameters, such as Kalman filter values for SOC estimation or power limits depending on SOC and temperature, to avoid under- or over-voltage conditions. Later in the BMS development phase, the same battery model is used for closed-loop desktop and real-time simulations at the system level. Tools like Simscape Battery offer various approaches to battery modeling, including equivalent circuit, electrochemical modeling, and reduced-order modeling using neural networks.

Charging speed is also an important performance indicator in the development and deployment of electric vehicles. The high energy amounts during fast charging strain the battery materials and shorten their lifespan. Therefore, it is important to optimize the performance profile during fast charging to ensure a maximum charging rate and minimal stress on the battery. Simulation and optimization are combined for this purpose. This minimizes the charging time while keeping stress factors within an acceptable range.

Subscribe to the newsletter now

Don't Miss out on Our Best Content

By clicking on „Subscribe to Newsletter“ I agree to the processing and use of my data according to the consent form (please expand for details) and accept the Terms of Use. For more information, please see our Privacy Policy. The consent declaration relates, among other things, to the sending of editorial newsletters by email and to data matching for marketing purposes with selected advertising partners (e.g., LinkedIn, Google, Meta)

Unfold for details of your consent

The generation of production code complements BMS design workflows that comply with the formal certification standards of the automotive industry. For example, when LG Chem (now LG Energy Solution) developed the BMS for the plug-in hybrid Volvo XC90, AUTOSAR was a required standard. LG Chem chose to model and simulate the BMS algorithms and behaviors as an integral part of its design workflow.

The number of software issues identified in each software version reduced from around 22 to less than 9, significantly below the project's target value. The AUTOSAR-developed BMS for Volvo by LG Chem subsequently received ISO 26262 certification for functional safety according to Automotive Safety Integrity Level C (ASIL C).

Modeling and simulation in BMS design enable faster development cycles, lower costs, and the realization of safer, more efficient electric vehicles. By testing BMS algorithms under all possible operating and fault conditions, developers can rely on the BMS software to handle these situations in the real system. This reduces the need for costly testing. The approach ensures that the final product not only meets industry standards but also exceeds consumer expectations. (st)