Skip to content

Okra's lightweight embedded state of charge algorithm.

License

Notifications You must be signed in to change notification settings

mulles/kalman-soc

 
 

Repository files navigation

kalman-soc

Fork of Okra's lightweight embedded state of charge (SoC) algorithm based on extend kalman filter (EKF).

Usage (Linux)

Build

#Install requirements
  sudo apt install meson ninja-build build-essential clang-format cmake  

#Git clone this repository with `--recursive` option:  
  git clone --recursive /~https://github.com/mulles/kalman-soc.git  
  #or run `git submodule update --init --recursive` after normal clone.

#Setup build directory  
 cd kalman-soc  
 meson setup build

#Build with ninja
 cd build  
 ninja  

#Run unit tests
 ./run_tests   


Run backtests

Backtest a dataset of current and voltage measurements you recorded in the past by running:

./backtest

A dataset is located in /data and consist of raw_sensor_data.csv and node_data.csv as input data.

  • node_data.csv (contains 0-1 columns. Column[0] = boolean (lithium[1] or lead[0]) Column[1] = 12 (battery system voltage) as integer)
  • raw_sensor_data.csv (contains 0-4 columns)
  • example_processed_sensor_data.csv (contains the input raw sensor data and the calculated SOC in column 5, it is generated by the backtest and named processed_sensor_data.csv)

On successful run, output on the command line should be:

Finished reading.
Finished writing.

The output file would be processed_sensor_data.csv.

Visualisation of backtest results:

https://raw.githack.com/mulles/kalman-soc/main/data/EVLKpN_20210817-20210830_SOC_Graph.html
https://raw.githack.com/mulles/kalman-soc/main/data/mppt-1210-hus_2021-05-28T20:10:00.000Z-2021-05-29T02:19:00.000Z_SOC_Graph.html

About

Okra's lightweight embedded state of charge algorithm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 99.9%
  • Other 0.1%