Simulation of Battery Management System
Battery Management System
A battery management system (BMS) is an electronic system that manages a rechargeable battery (cell or battery pack), such as by protecting the battery from operating outside its safe operating area[clarification needed], monitoring its state, calculating secondary data, reporting that data, controlling its environment, authenticating it and balancing it.
Designing a BMS
In order to control battery performance and safety, it is necessary to understand what needs to be controlled and why it needs controlling. This requires an in-depth understanding of the fundamental cell chemistries, performance characteristics, and battery failure modes.
Objectives of Battery Management Systems
- Protect the cells or the battery from damage
- Prolong the life of the battery
- Maintain the battery in a state in which it can fulfill the functional requirements of the application for which it was specified.
Functions of a BMS
1. Cell Protection
Protecting the battery from out-of-tolerance operating conditions is fundamental to all BMS applications. In practice, the BMS must provide full cell protection to cover almost any eventuality. Operating a battery outside of its specified design limits will inevitably lead to failure of the battery. Apart from the inconvenience, the cost of replacing the battery can be prohibitive. This is particularly true for high voltage and high power automotive batteries which must operate in hostile environments and which at the same time are subject to abuse by the user.
2. Charge control
This is an essential feature of BMS. More batteries are damaged by inappropriate charging than by any other cause.
3. Demand Management
While not directly related to the operation of the battery itself, demand management refers to the application in which the battery is used. Its objective is to minimize the current drain on the battery by designing power-saving techniques into the application's circuitry and thus prolong the time between battery charges.
4. SOC Determination
Many applications require a knowledge of the State of Charge (SOC) of the battery or of the individual cells in the battery chain. This may simply be for providing the user with an indication of the capacity left in the battery, or it could be needed in a control circuit to ensure optimum control of the charging process.
5. SOH Determination
The State of Health (SOH) is a measure of a battery's capability to deliver its specified output. This is vital for assessing the readiness of emergency power equipment and is an indicator of whether maintenance actions are needed.
6. Cell Balancing
In multi-cell battery chains, small differences between cells due to production tolerances or operating conditions tend to be magnified with each charge/discharge cycle. Weaker cells become overstressed during charging causing them to become even weaker until they eventually fail to cause premature failure of the battery. Cell balancing is a way of compensating for weaker cells by equalizing the charge on all the cells in the chain and thus extending battery life.
7. History - (Log Book Function)
Monitoring and storing the battery's history is another possible function of the BMS. This is needed in order to estimate the State of Health of the battery, but also to determine whether it has been subject to abuse. Parameters such as a number of cycles, maximum and minimum voltages and temperatures and maximum charging and discharging currents can be recorded for subsequent evaluation. This can be an important tool in assessing warranty claims.
8. Authentication and Identification
The BMS also allows the possibility to record information about the cell such as the manufacturer's type designation and the cell chemistry which can facilitate automatic testing and the batch or serial number and the date of manufacture which enables traceability in case of cell failures.
9. Communications
Most BMS systems incorporate some form of communications between the battery and the charger or test equipment. Some have links to other systems interfacing with the battery for monitoring its condition or its history. Communications interfaces are also needed to allow the user access to the battery for modifying the BMS control parameters or for diagnostics and test.
BMS Scope and Failure Consequences
The diagram indicates the possible cell failure mechanisms, their consequences and the necessary actions to be taken by the Battery Management System
BMS Implementation
The BMS contains 3 main building blocks, the Battery Monitoring Unit (BMU), the Battery Control Unit (BCU) and the CAN bus vehicle communications network and how they interface with the rest of the vehicle energy management systems. Other configurations are possible with distributed BMS embedded in the battery cell to cell interconnections.
In practice, the BMS may also be coupled to other vehicle systems which communicate with the BMS via the CAN bus (see below) such as the Thermal Management System, or to anti-theft devices which disable the battery. There may also be requirements for system monitoring and programming, and data logging using a serial bus(RS232).

Matlab Model for Battery Management System and Algorithm Testing
DashBoard

Closed-loop Battery Management System

BMS ECU along with with various sensors perform the task carried out by a Battery Management System.
The above model consists of the following BMS Algorithms:-
1. State of Charge estimation using Extended Kalman Filter, Unscented Kalman Filter
Kalman filtering, also known as linear quadratic estimation (LQE), is an algorithm that uses a series of measurements observed over time, containing statistical noise and other inaccuracies, and produces estimates of unknown variables that tend to be more accurate than those based on a single measurement alone, by estimating a joint probability distribution over the variables for each timeframe.
In the above BMS model, the SOC is calculated by 3 different methods namely coulomb counting, extended Kalman filter and unscented Kalman filter.

2. Passive Battery Cell Balancing
A passive system potentially burns off excess energy from the high cells through a resistive element until the charge matches the lower energy cells in the pack. If you have cells packed in series and you notice that some of the cells have higher energy than the other lower energy cells, you can balance the cells in burning energy of the top cells simply by attaching a resistor to the cells which release the energy into heat thereby equalizing the cell energy of the battery pack.
Cell Balancing System
The cell balancing system continuously monitors and measures the voltage difference between battery cells and once the vehicle is not in driving and the difference between the cell voltages increases beyond a certain value the balancing starts to happen.

3. Pre-charging and Contactor Management
Pre-charge of the powerline voltages in a high voltage DC application is a preliminary mode that limits the inrush current during the power-up procedure.

A high-voltage system with a large capacitive load can be exposed to the high electric current during initial turn-on. This current, if not limited, can cause considerable stress or damage to the system components. In other systems such as vehicle applications, pre-charge will occur with each use of the system, multiple times per day. Precharging is implemented to increase the lifespan of electronic components and increase the reliability of the high voltage system.
The below state system represents the pre-charging check included in the fault monitoring system. The check is performed before charging when the charger is connected and when it is removed and in the same way for the power converter circuit when the load is connected and disconnected.

4. Fault Management - Over/Under Voltage, Over Current, Over Temperature, etc.
Battery Management System is to provide the necessary monitoring and control to protect the cells from out-of-tolerance ambient or operating conditions. This is of particular importance in automotive applications because of the harsh working environment. As well as individual cell protection the automotive system must be designed to respond to external fault conditions by isolating the battery as well as addressing the cause of the fault. For example, cooling fans can be turned on if the battery overheats. If the overheating becomes excessive then the battery can be disconnected.
The Fault Monitoring system continuously monitors the parameters such as temperature, voltage, and current.
The current monitoring system checks the current being drawn and put inside the battery whenever the time duration of the peak current increases or the time duration of peak requirement is more than fault is generated and the battery is sent into a fault state.
Similarly, cell voltage and temperature are continuously compared to the maximum and the minimum limits, and a fault is generated whenever the limits are crossed.

The complete state monitoring system also includes a pre-charging check for load and the charger

5. Charge and Discharge Current Limit Calculations
The charge and discharge calculation is also a part of the fault management and protection function performed by the Battery Management System to restrict the operation in safe working points within limits.
The voltage level of 6 cells is given as input from which the minimum voltage is used to find the max discharge current of the battery and similarly, the maximum voltage of the cell is used to find the max charging current for the battery.

Charging/Discharge Current Limit Subsystem
The minimum voltage is then fed to the discharge current subsystem where minimum the difference between cutoff voltage and cell minimum voltage is used to find the maximum instantaneous discharge current using the resistance of the cell. The minimum discharge current is then chosen by considering the cell instantaneous temperature, resistance, and voltage of the cell.
Similarly, the maximum charging current is found based on the maximum instantaneous voltage which is then compared to the max safe voltage of the cell. Also, the cell's instantaneous temperature, resistance, and voltage are taken into consideration.
Discharge Current Limit Subsystem

Charge Current Limit Subsystem

Plant

The Plant model consists of 3 main subsystems consisting of the following:-
1. Battery Pack
The battery pack consists of a module with 6 cells connected in series along with the cell balancing circuit. The voltmeter is connected in parallel to the battery pack and an ammeter is connected in series to the negative terminal of the battery.

Cell Module
It shows 6 cells connected in series along with the temperature sensor. The simulation is stopped when the SOC of the cell drops below 0.001.

Cell-Balancing Circuit
Here we only passive cell balancing technique as it is comparatively cheaper and less complex than the active cell balancing technique. In the cell balancing circuit, we use only a resistor in parallel to dissipate the charge stored in the form of heat. This is controlled using a voltage sensor which checks when to stop balancing to stop over-discharge.

2. Precharge Circuit
The precharge circuit is used in order to prevent the current rush while charging and discharging the battery and to prevent the spark generation, the wiring, and the components from the sudden flow of high current.
A resistor is connected in series to limit the current flow and a capacitor is connected to prevent the voltage ripple. At first, the negative of the battery is connected and then the capacitor is charged via a resistor, and at the end step positive terminal is connected.

3. Charging/Discharging Load
The charging or the load is applied using based on the user input given is state request given as input in the subsystem.

Charging
When the state input for charging is "1" then the battery is charged via a controlled current source and the amount is charge is mapped to a data stored under the variable "ChargeCurrentReq".

Discharging
Here the charge given by the battery is considered as positive and the charge given to the battery is considered as negative.
The state requirement is checked and the current profile for discharge is made as a repeating sequence from a remapped data in the variable "BattCrnt'. The battery is discharged using a controlled current source.

Results
Input Test Signal 1
The simulation is made to run for 20000 seconds in which the first 3000 seconds is the discharge or the driving mode then the next 1000 seconds are in balancing or standby mode then for 5000 seconds in charging and balancing mode and afterward the in standby or balancing mode.

Output

The output is corresponding to the state inputs given.
The first plot with Cell_Voltages displays the voltages of all 6 cells connected in the series. While the first 3000 seconds the voltage of the cells drops as the battery is discharging and during the standby period the voltage stabilizes as the cell balancing gets activated and even due to cell inherit behavior. Then while charging the cell voltage increases and while the cell balancing the voltage stabilizes.
The second plot with Pack_Current represents the current drawn and given to the battery while charging and discharging. It is also seen that while charging, first the current remains constant, and then it drops its charges in constant voltage mode.
The third plots the cell temperature of all individual cells and we can see then while charging and discharging the cell temperature increases.
The fourth plot shows the input state as per the given state input.
The fifth plot shows the state of charge of the entire pack by 3 different methods of calculation. The soc curve decreases as we discharge the battery and increases while charging.
The sixth plot shows the cell balancing command for all six cells. The 1st cell is having the lowest voltage does not need balancing thus we can see that all the other cell's signal have a magnitude of 1 whereas the 1st cell signal is at zero magnitudes.

Input Test Signal 2
The simulation is made to run for 20000 seconds in which the first 5000 seconds is the discharge or the driving mode than the rest of the time is set to charge the battery.

Output

The output is corresponding to the state inputs given.
The first plot with Cell_Voltages displays the voltages of all 6 cells connected in the series. While the first 5000 seconds the voltage of the cells drops as the battery is discharging and then while charging the cell voltage increases and while cell balancing the voltage stabilizes.
The second plot with Pack_Current represents the current drawn and given to the battery while charging and discharging. It is also seen that while charging, first the current remains constant, and then it drops it charges in constant voltage mode.
The third plots the cell temperature of all individual cells and we can see then while charging and discharging the cell temperature increases, at about 6000 seconds the cell temperature of the 6th cell increases to about 323.15 Kelvin, and the battery is sent to fault state.
The fourth plot shows the input state as per the given state-input until the fault occurs at about 6000 seconds.
The fifth plot shows the state of charge of the entire pack by 3 different methods of calculation. The soc curve decreases as we discharge the battery and increases while charging. The battery is charged up to 70-75% and stops charging once the fault occurs.
The sixth plot shows the cell balancing command for all six cells. The 1st cell is having the lowest voltage does not need balancing thus we can see that all the other cell's signal have a magnitude of 1 whereas the 1st cell signal is at zero magnitudes. The cell balancing starts when the battery starts to charge and at the onset of the fault the battery charging is stopped but the balancing happens.

Input Test Signal 3
The simulation is made to run for 20000 seconds in which the first 10000 seconds is the discharge or the driving mode then the rest of the time is set to charge the battery.

Output

The output is corresponding to the state inputs given.
The first plot with Cell_Voltages displays the voltages of all 6 cells connected in the series. The cell voltage keeps on dropping as the battery keeps on discharging up to zero state of charge and the simulation is stopped.
The second plot with Pack_Current represents the current drawn and given to the battery while charging and discharging. Here we can see that battery repeats the charging and discharging pattern as explained above in the charging and discharging load.
The third plots the cell temperature of all individual cells and we can see then while charging and discharging the cell temperature increases.
The fourth plot shows the input state as per the given state-input, the simulation only runs in discharging mode and when the SOC reaches zero the simulation is stopped at about 8692 seconds.
The fifth plot shows the state of charge of the entire pack by 3 different methods of calculation. The soc curve decreases as we discharge the battery and increases while charging. Here the battery keeps on discharging as the regenerative charging is very less.
The sixth plot shows the cell balancing command for all six cells. The cell balancing does not take place as the simulation runs only in a driving state.
