Optimizing EV Battery System Performance with Model-Based Design
By Matteo Geraci, Marco Giuffredi, and Mattia Ambrosini, Politecnico di Milano
“Our simulation-based approach enabled us to push the vehicle closer to its safe operating limits while giving our race engineers a better insight into system behavior. Ultimately, it played a key role in improving our vehicle’s performance and helped us finish as the top-ranked student team in Italy in last year’s competition.”
Each year, student teams from universities across the globe compete in Formula SAE Electric, an international engineering competition that challenges teams to design, build, and race high-performance electric vehicles. While the competition provides a structured environment for learning and innovation, the technical challenges are anything but academic. From maximizing energy efficiency to ensuring driver safety, the engineering problems students face mirror those found in professional automotive development.
For Dynamis PRC, our Formula SAE team at Politecnico di Milano, battery performance plays a pivotal role in the overall performance of the vehicle (Figure 1). Like many engineers in the electric vehicle industry, we must optimize energy usage, manage thermal loads, and stay within strict safety and performance limits. A critical competition constraint, for example, limits battery system power output to 80 kW. This limitation, combined with the demands of high-speed racing and prolonged thermal stress, particularly in summer months, requires an advanced battery management system (BMS) that can manage both instantaneous and long-term power output. Developing BMS algorithms presents significant challenges, particularly for teams that lack an accurate model of the battery system itself.
We addressed these challenges using a workflow based on Model-Based Design with MATLAB®, Simulink®, and Simscape Battery™. By developing a detailed electrical and thermal model of our battery system, we were able to gain a deeper understanding of its operating characteristics and improve the power limiting algorithm deployed as part of the BMS on the vehicle. The algorithm not only estimates the necessary power one step ahead to stay within regulatory limits but also accounts for thermal conditions during endurance races. Our simulation-based approach enabled us to push the vehicle closer to its safe operating limits while giving our race engineers a better insight into system behavior. Ultimately, it played a key role in improving our vehicle’s performance and helped us finish as the top-ranked student team in Italy in last year’s competition.
Motivation and Methodology
Our goals in developing the Dynamis PRC BMS are focused on maximizing the performance of the vehicle’s battery system, or its “accumulator,” as it is commonly referred to in Formula SAE. A principal objective is to monitor and manage the accumulator’s state, including state of charge (SOC), which directly impacts the vehicle’s power output and energy efficiency. Two core elements of the BMS—both developed using Model-Based Design—are an adaptive extended Kalman filter (AEKF) for battery system state estimation and a power limiter that operates in real time, enabling the vehicle to operate within safe, rule-prescribed limits without sacrificing performance (Figure 2).
We follow a structured, micro-to-macro approach: starting with the development of accurate cell models, then progressing to modeling the entire battery system and its thermal characteristics. The modeling process involves gathering data through physical testing, followed by model parameterization and validation. Development of the AEKF and power limiting algorithm in Simulink is informed by the modeling and simulation that we perform.
Creating, Parameterizing, and Validating the Cell Model
To develop a representative cell model, we began with data gathered through hardware tests, including an open circuit voltage test and a hybrid pulse power characterization (HPPC) test, conducted across a range of temperatures (Figure 3). Following the tests, we cleaned, analyzed, and visualized the measured data in MATLAB. These tests and the scatterplots we generated from the results of those tests provide insight into how instantaneous series resistance R₀ varied with temperature and SOC (Figure 4).
Next, we explored two circuit modeling approaches: a simpler one-pole model and a more expressive two-pole model. The latter, which includes two resistor-capacitor (RC) pairs, offered significantly better dynamic fidelity. Using Optimization Toolbox™, we fit time-domain data to exponential decay functions to extract R₁, R₂, τ₁, and τ₂—where τ = RC—for the two-pole configuration. The results from the exponential fitting clearly showed that the two-pole model was more accurate, so we selected it as the basis for further simulation. We then used Curve Fitting Toolbox™ to create a smoothed 3D surface fit of R₀ as a function of temperature and SOC, and similar surfaces for R₁, R₂, τ₁, and τ₂ (Figure 5). We later used these smoothed surfaces as lookup tables (LUTs) in our Simscape™ model and AEKF, enabling efficient real-time estimation of model parameters across a range of operating conditions.
We performed validation in Simulink with model parameters drawn from the lookup tables generated in the fitting stage. For our open-loop simulations, current was used as the sole input and simulated outputs for voltage were compared directly against HPPC test data. The model was accurate, with a mean voltage error of just 4.5 mV (0.1%). Most of this error occurred near the end of the simulation, likely because the model slightly underestimated the cell’s capacity, causing small voltage drifts at low SOC (Figure 6).
Modeling the Battery System with Simscape and Simscape Battery
To extend the cell-level characterization into a full battery system model, we used Simscape and Simscape Battery to model both electrical and thermal behavior across all 720 cells in the battery pack, which are arranged as 144 cells in series across five parallel branches.
Simulating all 720 cells individually would be computationally prohibitive, so we focused on a single series branch—one of the five in parallel—while incorporating key nonidealities arising from asymmetric current distribution. This nonideal behavior stems from resistance in the busbars and interconnections, which causes uneven current sharing among the five branches. In particular, the first branch, physically closest to the battery system’s terminal connector, experiences higher voltage drops due to its position and the resistance of the busbar. We identified this branch as the most critical to simulate, because in the power-limiting algorithm, it is important to predict the voltage of the cell as a function of current to avoid exceeding the voltage safety limits (2–4.25V) of the cell. Essentially, the SOC estimation for the power-limiting algorithm is based on this branch, which, due to its voltage drops, represents the worst-case performance of the five.
Working in Simscape, we developed a model that enables us to simultaneously simulate the electrical and thermal characteristics of the battery pack. We first created a CellModel_battery block that represents an entire series branch of 144 cells, incorporating the lookup tables derived from earlier fitting work for temperature- and SOC-dependent values (Figure 7). We then combined five of these branch-level blocks to represent the full parallel configuration (Figure 8).
This modeling approach enabled us to better understand the uneven current distribution in the battery system and observe how it affects voltage dynamics—especially in the most stressed series branch. The model proved to be quite accurate when we compared its simulation output to measured output captured from the vehicle on track during an autocross event (Figure 9). In addition, it provided critical insight into cooling requirements and thermal coupling between branches.
Implementing and Deploying the AEKF and Power Limiter
The high-fidelity Simscape model played a crucial role in helping us to understand and characterize the battery system’s dynamic behavior and enabling us to gain deep insights during early design and validation phases. To deploy our power limiter algorithm on the vehicle’s STM32 microcontroller, we needed a more computationally efficient solution for estimating SOC, a critical input for managing power usage. Working in Simulink, we developed a reduced-order state-space model based on the Simscape model and implemented it as an AEKF for embedded deployment. To validate this reduced model, we compared its SOC estimates against SOC estimates from the more complex Simscape model and found that the differences were within acceptable bounds.
Continuing in Simulink, we developed the power limiting algorithm, which constrains the maximum allowable power based on the SOC estimate, thermal limits (a maximum of 60 °C), and competition rules (Figure 10).
Previously, we had used more rudimentary approaches, including one based on a model reference adaptive system (MRAS) algorithm, which had proved problematic during recent endurance races. The AEKF provided smoother SOC estimates without the significant error spikes we had seen with the MRAS algorithm (Figure 11). We ran closed-loop simulations of the AEKF and power limiter to verify the functionality and integration of both models.
Once we validated the models, we used Embedded Coder® to generate C code for deployment on the STM32 microcontroller. The initial implementation consumed around 75% of the microcontroller’s RAM and 20% of its ROM. After applying a few optimization techniques, such as changing data types from double (64-bit) to single (32-bit), simplifying lookup tables, and adjusting code-generation options in Simulink, we reduced memory usage to less than 2% for RAM and 3% for ROM. With the optimized code deployed on the vehicle’s microcontroller, we were ready to begin extensive on-track testing, where the system was evaluated in real-world driving conditions.
Driving Toward the Future with Model-Based Design
Model-Based Design with MATLAB and Simulink was central to every phase of our battery system development—from analyzing experimental cell data to creating accurate models of individual cells in Simscape, simulating the thermal and electrical behavior of the full pack, and ultimately implementing and deploying a robust power limiting algorithm.
In previous years, the limitations of less accurate SOC estimation techniques forced our race engineers to adopt a more conservative driving strategy, leading to reduced performance on the track. This year, with a validated battery model and a reliable, optimized power-limiting algorithm, we were able to push the vehicle nearer to its performance limits with greater confidence. The improvements in modeling and estimation not only led to better race results, but they also gave us a much more in-depth understanding of how the battery system behaves under real-world conditions.
As some Dynamis PRC team members graduate, others remain to build on this foundation—refining the models, enhancing the algorithms, and continuing to unlock more performance from the vehicle year after year.
Published 2025