okrasolar/kalman-soc

Add Usage section to readme

Opened this issue · 1 comments

@mlarash Thx for sharing this EKF implemention for SOC estimation. Never worked with meson, I took me some time to compile the project.

Would you welcome a PR for the readme.md, which adds a Usage section with the steps contained in script beneath? Furthermore the readme could reference the .sh script and warn users to only execute before reading it.


#This Script builds kalman-soc Algo
#Resource:https://mesonbuild.com/Tutorial.html#the-humble-beginning

# Install Meson (Build Systems) and it's Dependencies 
sudo apt install meson ninja-build build-essential clang-format

# Clone Git Repo to build including subprojects cpputests located folder /dep/
git clone --recursive git@github.com:okrasolar/kalman-soc.git

cd kalman-soc/dep/cpputest/

# Get missing meson.build file for cpputest subproject
wget https://raw.githubusercontent.com/hofab/meson-cpputest/master/subprojects/cpputest/meson.build
cd ..
cd ..

# Adjust main meson.build to work with the above cpputest meson.build file
sed -i ''s/'cpputest_dep'/'lcpp_dep'/g''  meson.build

meson setup builddir
cd builddir
ninja

After getting it to compile and the Unit Test passing at the same time. I now got the backtest running as well.

The missing files for it to run are in data.zip, they need to be located in the main directory of the repository kalman-soc/data/:

data.zip

  • node_data.csv (contains 0-1 columns. Column[0] = true (lithium or lead) Column[1] = 12 (battery system voltage) )
  • 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)

The data in raw_sensor_data.csv is synthetic, I still need to generate some real data. Everything inside the raw_sensor file after "timestamp" column is ignored by the backtest, that's why the expected result (SOC) and another synthetic example is stored in the file. The file has been produced by reading the main.cpp backtest code.

To get the backtest running steps are as follows:

sudo apt install unzip #requirement
cd kalman-soc/ #enter the git repo
wget https://github.com/okrasolar/kalman-soc/files/6930437/data.zip #download
unzip data.zip
cd builddir
./backtest # execute backtest

ouput on the command line should be:

Finished reading.
Finished writing.

The output file should be the same as example_processed_sensor_data.csv and is named processed_sensor_data.csv.

Happy testing :)

@atochukwu0 as you forked the project the above information might be of interest as well. In case you worked with the code too, would be happy to engage with you :)