Change voltage limits to be able to go over 96soc

This commit is contained in:
Daniel Öster 2024-09-19 22:47:16 +03:00
parent 17bc9eb4db
commit dbd0d720de
2 changed files with 14 additions and 1 deletions

View file

@ -86,6 +86,19 @@ void update_values_battery() { //This function maps all the values fetched via
datalayer.battery.status.max_discharge_power_W = 5000; //TODO: Take from CAN
datalayer.battery.status.max_charge_power_W = 5000; //TODO: Take from CAN
// TODO: Remove this hacky wacky scaling down charge power when we find value from CAN
if (datalayer.battery.status.real_soc > 9500) {
datalayer.battery.status.max_charge_power_W = 3000;
}
if (datalayer.battery.status.real_soc > 9600) {
datalayer.battery.status.max_charge_power_W = 2000;
}
if (datalayer.battery.status.real_soc > 9700) {
datalayer.battery.status.max_charge_power_W = 1000;
}
if (datalayer.battery.status.real_soc > 9800) {
datalayer.battery.status.max_charge_power_W = 500;
}
//Power in watts, Negative = charging batt
datalayer.battery.status.active_power_W =

View file

@ -4,7 +4,7 @@
#define BATTERY_SELECTED
#define ABSOLUTE_CELL_MAX_VOLTAGE 4150
#define ABSOLUTE_CELL_MAX_VOLTAGE 4200
#define ABSOLUTE_CELL_MIN_VOLTAGE 3000
#define MAX_CELL_DEVIATION_MV 500