add a configurable low temperature limit to DALY BMS max power calculations

This commit is contained in:
Jakob Löw 2025-02-26 08:27:26 +01:00
parent e122567c6b
commit 6f9b72ed85
No known key found for this signature in database
GPG key ID: B77685F55C7C46C6
2 changed files with 5 additions and 0 deletions

View file

@ -37,6 +37,9 @@ void update_values_battery() {
else if (SOC > 8000) else if (SOC > 8000)
adaptive_power_limit = ((10000 - (uint32_t)SOC) * POWER_PER_PERCENT) / 100; adaptive_power_limit = ((10000 - (uint32_t)SOC) * POWER_PER_PERCENT) / 100;
if (temperature_min_dC < LOW_TEMP_POWER_LIMIT_START && adaptive_power_limit > LOW_TEMP_POWER_LIMIT)
adaptive_power_limit = LOW_TEMP_POWER_LIMIT;
if (adaptive_power_limit < datalayer.battery.status.max_charge_power_W) if (adaptive_power_limit < datalayer.battery.status.max_charge_power_W)
datalayer.battery.status.max_charge_power_W = adaptive_power_limit; datalayer.battery.status.max_charge_power_W = adaptive_power_limit;
if (SOC < 2000 && adaptive_power_limit < datalayer.battery.status.max_discharge_power_W) if (SOC < 2000 && adaptive_power_limit < datalayer.battery.status.max_discharge_power_W)

View file

@ -8,6 +8,8 @@
#define MAX_CELL_VOLTAGE_MV 4250 //Battery is put into emergency stop if one cell goes over this value #define MAX_CELL_VOLTAGE_MV 4250 //Battery is put into emergency stop if one cell goes over this value
#define MIN_CELL_VOLTAGE_MV 2700 //Battery is put into emergency stop if one cell goes below this value #define MIN_CELL_VOLTAGE_MV 2700 //Battery is put into emergency stop if one cell goes below this value
#define POWER_PER_PERCENT 50 // below 20% and above 80% limit power to 50W * SOC (i.e. 150W at 3%, 500W at 10%, ...) #define POWER_PER_PERCENT 50 // below 20% and above 80% limit power to 50W * SOC (i.e. 150W at 3%, 500W at 10%, ...)
#define LOW_TEMP_POWER_LIMIT 800 // max power when temperature below limit
#define LOW_TEMP_POWER_LIMIT_START 50 // start limiting when below 50 = 5.0 °C
/* Do not modify any rows below*/ /* Do not modify any rows below*/
#define BATTERY_SELECTED #define BATTERY_SELECTED