mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Add SOC% plausibility detection
This commit is contained in:
parent
1ae7d51ea9
commit
59da9eac2b
1 changed files with 8 additions and 0 deletions
|
@ -241,6 +241,14 @@ void update_values_leaf_battery() { /* This function maps all the values fetched
|
|||
max_target_discharge_power = 0;
|
||||
}
|
||||
|
||||
//Check if SOC% is plausible
|
||||
if (battery_voltage > (ABSOLUTE_MAX_VOLTAGE - 100)) {
|
||||
if (LB_SOC < 650) {
|
||||
bms_status = FAULT;
|
||||
Serial.println("ERROR: SOC% reported by battery not plausible. Restart battery!");
|
||||
}
|
||||
}
|
||||
|
||||
if (LB_Full_CHARGE_flag) { //Battery reports that it is fully charged stop all further charging incase it hasn't already
|
||||
max_target_charge_power = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue