Mathworks Romain Lachaux Developing Bms With Simulink
Mathworks Romain Lachaux Developing Bms With Simulink
2
… with some risks to keep under control
3
CHALLENGE: Design and verify battery management functions
4
Estimate
State-of-charge
(SoC)
BMS
Battery Management System
Isolate battery
Control the
pack from
charging profile
source and load
Balance Battery
Cell
5
SOLUTION: Perform system-level simulations with Simulink
6
BMS Development Workflow with Simulink and MBD
RAPID PROTOTYPING
Code Generation
Real-time Communication
7
Agenda
❑ Deployment on Hardware
▪ Code Generation
▪ Real-Time Testing
8
BMS Model Overview
▪ System Model
– Controller: BMS Algorithms
– Plant : Physical Modeling
▪ Advantages of System-Level
Simulation:
– Quick design iterations
– Early results in the
development workflow
– Possible to test each part alone
or together in the same model
(Closed-loop testing) CONTROLLER PLANT
9
Simulation Results Overview
▪ Example:
– Temperature differences
– Potential impact on cells ageing
10
PLANT: Battery Physical Modeling with Simulink and Simscape
11
Battery Cell Modeling
𝑅1
𝑅0
Custom Component
12
Battery Cell Modeling
Multidomain
13
Battery Pack
1 Module of 6 cells
OR
16 Module of 6 cells
15
Estimating Parameters Using Measured Data
1. Import measurement
datas
2. Identify parameters
and set range
3. Perform estimation
16
Advantages of Physical Modeling
17
CONTROLLER: BMS Algorithms with Simulink and Stateflow
18
Battery Management System Functions
▪ Battery State
▪ Fault Management
▪ Derating Calculations
▪ State-of-Charge Estimation
19
Fault Management
20
State-Of-Charge Estimation
▪ Two methods:
– Coulomb Counting
: Simple to implement / low computational needs
: Accuracy and robustness
– Kalman Filtering*
: High accuracy by including a nonlinear battery
model which uses current and voltage measurement
: Slightly higher computational effort
* : ready to use block available in Control System Toolbox or System Identification Toolbox
21
Agenda
❑ Deployment on Hardware
▪ Code Generation
▪ Real-Time Testing
22
Generate C/C++ Code From BMS Models
23
Real-Time Testing of Battery Management System
Main Controller
Measurement &
Battery Pack
Diagnostics 24
Hardware-In-Loop Testing of Battery Management System
Measurement &
Battery Emulation
Diagnostics 25
BMS Development with Simulink