This minor project is derived from a fascinating design focused on simulating and estimating the state of charge (SoC) of a lithium battery. In this article, I'll delve into the experiments conducted, the process of identifying parameters, and the simulation of an extended Kalman filter (EKF) as part of this endeavor.
General Content:
Creating a Li-ion battery model involves identifying and verifying parameters, as well as estimating the State of Charge (SoC) using an Extended Kalman Filter (EKF) in two ways:
- Utilizing Simulinks for EKF implementation.
- Employing scripts for EKF and Unscented Kalman Filter (UKF) implementations.
First Try:
The model takes inputs such as current and voltage derived from battery data in HPPC (Hybrid Pulse Power Characteristic) tests.
The simulation file "EKFSim_R2016.slx" contains the Thevenin equivalent circuit model and Extended Kalman Filter. The structure of the file is depicted in the snapshot below.
In areas of current pulses, the estimated curve shows noticeable divergences, whereas it converges to the actual value during constant current discharges.
The estimated State of Charge (SoC) and the update voltage (Up) of the RC element in the Thevenin Equivalent Circuit Model (ECM) change synchronously. This synchronicity is evident in the 'EKF' function block where they share the same state vector.
The Kalman filter updates the states, including SoC and Up, based on the discrepancy between observed values and predicted values of the load voltage (UL). The code format for this expression is as follows:
X_upd = X_pre + K*(UL_obs-UL_pre);
The simulation output results are depicted in the following figures.
Improvement:
Following improvements, the input-output relationship between modules is now clearer. The updated Simulink file reflecting these improvements is named "Improved_EKFSim.slx".
Here, the input current is generated using the Signal Builder block, which defines the working conditions.
The output results are shown in the figures belows.
Scripts:
MATLAB scripts are employed to simulate the discharge process of a lithium-ion battery under two different working conditions: Signal Builder and constant current. The simulation incorporates observation noise and utilizes either the EKF or UKF method to estimate the State of Charge (SoC) of the battery.
function main(Work_modes, SoC_est_init)
The main function of the script requires two arguments:
- Work_mode: This argument represents the choice of working condition, where 1 corresponds to BBDST working condition and 2 corresponds to constant current working condition.
- SoC_est_init: This argument represents the initial value of the estimated SoC. It defaults to 1 if only one argument is passed.
If you require the code, please reach out to me on WhatsApp using the following link:
Read Also :-
Labels :
#Automotive Control Systems ,#Automotive Technology ,#BMS ,#Control Systems ,#MATLAB ,#Projects ,#Simulink ,#System Optimization ,
Getting Info...