diff --git a/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp b/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp index 17a420a2..75423990 100644 --- a/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp +++ b/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp @@ -169,6 +169,10 @@ void update_values_battery() { //This function maps all the values fetched via system_SOH_pptt = static_cast((static_cast(nominal_full_pack_energy) / bat_beginning_of_life) * 10000.0); } + //If the calculation went wrong, set SOH to 100% + if (StateOfHealth > 10000) { + StateOfHealth = 10000; + } //If the value is unavailable, set SOH to 99% if (nominal_full_pack_energy < REASONABLE_ENERGYAMOUNT) { system_SOH_pptt = 9900; @@ -249,8 +253,8 @@ void update_values_battery() { //This function maps all the values fetched via //Once cell chemistry is determined, set maximum and minimum total pack voltage safety limits if (system_LFP_Chemistry) { - system_max_design_voltage_dV = 3640; - system_min_design_voltage_dV = 2450; + system_max_design_voltage_dV = 3880; + system_min_design_voltage_dV = 2968; } else { // NCM/A chemistry system_max_design_voltage_dV = 4030; system_min_design_voltage_dV = 3100; @@ -258,8 +262,8 @@ void update_values_battery() { //This function maps all the values fetched via //Check if SOC% is plausible if (system_battery_voltage_dV > - (system_max_design_voltage_dV - 100)) { // When pack voltage is close to max, and SOC% is still low, raise FAULT - if (system_real_SOC_pptt < 6500) { //When SOC is less than 65.00% when approaching max voltage + (system_max_design_voltage_dV - 20)) { // When pack voltage is close to max, and SOC% is still low, raise FAULT + if (system_real_SOC_pptt < 5000) { //When SOC is less than 50.00% when approaching max voltage set_event(EVENT_SOC_PLAUSIBILITY_ERROR, system_real_SOC_pptt / 100); } }