developing battery management system using simulink · charging profile estimate state-of-charge...

26
1 © 2015 The MathWorks, Inc. Developing Battery Management System using Simulink Romain LACHAUX

Upload: others

Post on 02-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

1© 2015 The MathWorks, Inc.

Developing Battery Management

System using Simulink

Romain LACHAUX

Page 2: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

2

Battery: a good answer to energy storage across industries…

Page 3: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

3

… with some risks to keep under control

Page 4: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

4

CHALLENGE: Design and verify battery management functions

Page 5: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

5

Monitor Cell

Voltage and Temperature

Current and

Power Limits(Derating)

Isolate battery

pack fromsource and load

Control the

charging profile

Estimate

State-of-charge(SoC)

Balance Battery

Cell

BMSBattery Management System

Page 6: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

6

SOLUTION: Perform system-level simulations with Simulink

Page 7: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

7

BMS Development Workflow with Simulink and MBD

DESKTOP SIMULATION REAL-TIME SIMULATION HARDWARE IMPLEMENTATION

SIMULINK MODEL

ControllerAlgorithms for cell balancing,

State-of-Charge

PlantEnvironment, source, battery,

circuit, load

RAPID PROTOTYPING

Algorithms runing on a

real-time computer

HIL TESTING

Behavioral models

running on a real-time

computer

HARDWARE

PROTOTYPING

Battery packs, circuit,

source, load

PRODUCTION CODE

Algorithms running on

an embedded

microcontroller

Code Generation

Real-time Communication

Page 8: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

8

Agenda

❑ BMS Model Demo

▪ Physical Modeling

▪ BMS Algorithms

❑ Deployment on Hardware

▪ Code Generation

▪ Real-Time Testing

Page 9: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

9

▪ 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

BMS Model Overview

Page 10: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

10

▪ Early results during design

process

➔ Possible to refine or add missing

requirements

▪ Example:

– Temperature differences

– Potential impact on cells ageing

➔ Need of a cooling system?CONTROLLER PLANT

Simulation Results Overview

CELL TEMPERATURE

~15°C

CELL VOLTAGE

BATTERY PACK CURRENT SOC ESTIMATIONS

Page 11: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

11

PLANT: Battery Physical Modeling with Simulink and Simscape

Page 12: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

12

Battery Cell Modeling

▪ Thevenin Model (1st Order) to represent

electrical behavior of battery cell

▪ Model based on Simscape Foundation

Library components…

▪ ... with dependance upon SoC and

temperature by modifying source code

𝑅0𝑅1

𝐶1

𝑇ℎ𝑒𝑣𝑒𝑛𝑖𝑛 𝑀𝑜𝑑𝑒𝑙

𝐸𝑚

Custom Component

Page 13: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

13

▪ What about thermal behavior?

– Cell heat up under load

– Convection heat flux between cells

– Thermal exchange with environment

➔ Thermal component from Foundation

Library

Battery Cell Modeling

Multidomain

Page 14: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

14

Battery Pack

Variant Model Possible to model different architecture or

technological choice of a subsystem in the

same model

1 Module of 6 cells

OR

16 Module of 6 cells

Page 15: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

15

Tuning a Lithium Battery Model to Match Measured Data

Cell Physical Model:

𝑅0

𝑅1

𝐶1

𝑇ℎ𝑒𝑣𝑒𝑛𝑖𝑛 𝑀𝑜𝑑𝑒𝑙

𝐸𝑚

Lithium Cell Characteristic Measurement:

OBJECTIVE: Match model behavior to tests measurements

SOC

1

SOC

0.9

SOC

0.8…

SOC

0

5°C 4.20 V 4.12 V 4.05 V … 3.09 V

20°C 4.18 V 4.09 V 4.01 V … 3.05 V

40°C 4.15 V 4.02 V 3.97 V … 3.01 V

𝐸𝑚

Page 16: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

16

Estimating Parameters Using Measured Data

1. Import measurement

datas

2. Identify parameters

and set range

3. Perform estimation

Page 17: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

17

▪ With this physical model, you can

– Evaluate your architecture

– Optimize your design

– Refine and Validate your

requirements

+ Enable Closed-loop testing of your control algorithms to verify and validate it

Advantages of Physical Modeling

→ Facilitate parameters sweep and iterations

→ Limit oversizing of components

Page 18: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

18

CONTROLLER: BMS Algorithms with Simulink and Stateflow

Page 19: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

19

Battery Management System Functions

▪ Battery State

▪ Fault Management

▪ Battery isolation control

▪ Derating Calculations

▪ State-of-Charge Estimation

Page 20: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

20

Fault Management

▪ Monitoring three physical channels:

– Battery Pack Current

– Cell Voltage

– Cell Temperature

▪ Broadcasting Fault Presence to

other BMS subsystems

→ Contactor Opening (SAFETY)

→ BMS_State == FAULT

Page 21: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

21

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

Page 22: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

22

Agenda

❑ BMS Model Overview

▪ Physical Modeling

▪ BMS Algorithms

❑ Deployment on Hardware

▪ Code Generation

▪ Real-Time Testing

Page 23: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

23

Generate C/C++ Code From BMS Models

▪ Generate target optimized C/C++ code

▪ Fine-tune code optimizations, package

and build generated code

Page 24: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

24

Real-Time Testing of Battery Management System

Main Controller

Measurement &

DiagnosticsBattery Pack

▪ Testing BMS with Battery Cells

– Longer test cycles

– Difficult to test fault conditions

– Difficult to reproduce results

– Limited test automation

➔ Costs (Hardware prototype,

possible failure, several people to

perfom tests, etc)

Page 25: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

25

▪ Testing BMS with Emulated Battery Cells

– Reduce testing time

– Test fault conditions safely

– Automate testing

Hardware-In-Loop Testing of Battery Management System

Automatic

Code Generation

Main Controller

Measurement &

DiagnosticsBattery Emulation

Page 26: Developing Battery Management System using Simulink · charging profile Estimate State-of-charge (SoC) Balance Battery Cell BMS Battery Management System. 6 SOLUTION: Perform system-level

26

BMS Development with Simulink

Collaborate

Across Domains

Reduce Design

Iteration Time

Gain Confidence

in Design