This commit is contained in:
hamza
2024-07-08 23:43:41 +03:00
parent 73194c86ae
commit 4375bfce48
5 changed files with 160 additions and 162 deletions

View File

@ -49,10 +49,10 @@ void soc_update() {
last_current_time == 0) {
// Assume we're measuring OCV if there's been no current for a while (or
// we've just turned on the battery).
current_soc = soc_for_ocv(min_voltage);
//current_soc = soc_for_ocv(min_voltage);
} else {
// Otherwise, use the current counter to update SoC
float as_delta = shunt_data.current_counter - mAs_before_current;
float as_delta = CURRENT_MEASUREMENT - mAs_before_current;
float soc_delta = as_delta / SOC_ESTIMATION_BATTERY_CAPACITY * 100;
current_soc = soc_before_current + soc_delta;
}