State of Charge Estimation Function based on Kalman Filter

An EKF_SOC_Estimation function estimates a battery's terminal voltage and state of charge using a second order RC equivalent circuit.
3.2K Downloads
Updated Tue, 29 Jun 2021 13:36:23 +0000

View License

The EKF_SOC_Estimation function estimates a battery's terminal voltage (Vt) and state of charge (SOC) using a second order RC equivalent circuit model. The function can be used either an extended Kalman Filter (EKF) or adaptive-extended Kalman filter (AEKF). Users also have the options of estimating SOC from -20C to 40C. Included is a sample LA92 driving cycle, battery parameters including internal resistance, and SOC-OCV curve for a Turnigy battery cell. To run the sample, simply download all the file and run main.mlx.

Cite As

F. Khanum, E. Louback, F. Duperly, C. Jenkins, P. J. Kollmeyer, and A. Emadi, “A Kalman Filter Based Battery State of Charge Estimation MATLAB Function,” in 2021 IEEE Transportation Electrification Conference & Expo, 2021, pp. 484 - 489.

MATLAB Release Compatibility
Created with R2021a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
3.1.0

Update reference/citation: please reference the ITEC conference paper.

3.0.0

Bugfix: matrix C calculation
Update: function and KF parameters to default to EKF
Update: separate SOC-OCV curve .mat file

2.1.0

Updated capacity to single values instead of being interpolated

2.0.0

Added temperature interpolation at each step within AEKF loop.
Updated parameter interpolation/extrapolation functions.
Included battery model parameters for -10C to 40C and LA92 40C drive cycle.
Tuned KF P,Q,R values for LA92 and US06 drive cycles.

1.1.0

Tuned Kalman Filter parameters for better current bias and offset results.

1.0.0