Matlab implementation of a Battery Management System.
Explore the docs »
View Demo UI
·
Report Bug
·
Request Feature
The purpose of the project is to build from scratch a Battery Management System (BMS) by using a Model Based Design approach. Starting from the plant definition (customizable), we proceeded with the design of the control strategies both for the cell balancing as well as for the pre-charge, post-discharge resistors and contactors management. A complete simulation enviroment has been developed in order to test and appreciate all the functionalities.
The complete documentation of the project is reported in Final_Report.pdf
file under:
battery-management\Docs\
To get a local copy up and running just follow these simple steps:
- Matlab v2021a
- Simulink v10.3
- optimization_toolbox
- power_system_blocks
- simscape
- simulink_control_design
- simulink_design_optim
- stateflow
N.B: In order to get the list of in-use toolbox in a project use the following command (after run) :
license('inuse')
- Clone the repo
git clone https://github.com/meltinglab/battery-management.git
- Open the
simulationUI.slx
file under:battery-management\workspace\Simulation\MIL\
In order to test the whole system (plant+controller), just follow these steps:
- Compile & Run by clicking on the "Play" button
- Adjust the control parameters and evaluate the behavoiur at run-time
For more examples or a detailed description of all the blocks, please refer to the Documentation
In order to be used in an embedded device, the controller code has been ported to an STM32F4-Discovery board.
The whole porting process has been carried out by using the Embedded Coder and, in particular, the support package for STMicroelectronics Discovery board.
- STM32F4-Discovery board
Any other compatible board with the embedded coder can be used but some additional work may be needed.
- embedded_coder
- stm32_discovery_support_package
- Open the
testF4.slx
file under:battery-management\workspace\Simulation\SIL-PIL\
- Double-click on the
bms_f4
model - Click on the
apps
pane - Under
Get Add-Ons
click onManage Add-Ons
- Click on the the "Setup Gear" on the right of the "Embedded Coder support package for STMicroelectronics Discovery boards"
- Follow the setup instructions and make sure to specify the right firmware package folder:
battery-management\workspace\STM32F4-Discovery_FW_V1.1.0\
- Assuming that you have already opened the
testF4.slx
file - Click on the
Hardware
pane - Click on
Hardware settings
, then open the hardware implementation pane - Under
Target hardware resources
>PIL
make sure to selectSerial (USART2)
and then insert the right COM port of your USB-Serial converter
N.B. A detailed description on how to setup the communication interface for PIL execution can be found here
- Open the
testF4.slx
file under:battery-management\workspace\Simulation\SIL-PIL\
- By clicking on the "Play" button the system will Compile & Deploy two controller models: the first will run on the discovery board, the other directly on your PC.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Anna Delli Noci - @Danidotwav - [email protected]
Michele Gazzarri - @dinamitemic - [email protected]
Carlo Edoardo Malaspina - @CarloEdoardoMalaspina - [email protected]
Mirko Shtylla - @mirkoshtylla - [email protected]
Project Link: https://github.com/meltinglab/battery-management