🎨 daly bms: use user settings pre-defined values instead of redefining them ourselves

This commit is contained in:
Jakob Löw 2025-02-10 18:52:31 +01:00
parent 9712200e7a
commit 25e30d0758
No known key found for this signature in database
GPG key ID: B77685F55C7C46C6
2 changed files with 3 additions and 6 deletions

View file

@ -27,8 +27,8 @@ void update_values_battery() {
datalayer.battery.status.current_dA = current_dA; //value is *10 (150 = 15.0) datalayer.battery.status.current_dA = current_dA; //value is *10 (150 = 15.0)
datalayer.battery.status.remaining_capacity_Wh = (remaining_capacity_mAh * (uint32_t)voltage_dV) / 10000; datalayer.battery.status.remaining_capacity_Wh = (remaining_capacity_mAh * (uint32_t)voltage_dV) / 10000;
datalayer.battery.status.max_charge_power_W = (MAX_CHARGE_AMPS * voltage_dV) / 10; datalayer.battery.status.max_charge_power_W = (BATTERY_MAX_CHARGE_AMP * voltage_dV) / 100;
datalayer.battery.status.max_discharge_power_W = (MAX_DISCHARGE_AMPS * voltage_dV) / 10; datalayer.battery.status.max_discharge_power_W = (BATTERY_MAX_DISCHARGE_AMP * voltage_dV) / 100;
uint32_t adaptive_power_limit = 999999; uint32_t adaptive_power_limit = 999999;
if (SOC < 2000) if (SOC < 2000)
@ -59,7 +59,7 @@ void setup_battery(void) { // Performs one time setup at startup
datalayer.battery.info.min_design_voltage_dV = MIN_PACK_VOLTAGE_DV; datalayer.battery.info.min_design_voltage_dV = MIN_PACK_VOLTAGE_DV;
datalayer.battery.info.max_cell_voltage_mV = MAX_CELL_VOLTAGE_MV; datalayer.battery.info.max_cell_voltage_mV = MAX_CELL_VOLTAGE_MV;
datalayer.battery.info.min_cell_voltage_mV = MIN_CELL_VOLTAGE_MV; datalayer.battery.info.min_cell_voltage_mV = MIN_CELL_VOLTAGE_MV;
datalayer.battery.info.total_capacity_Wh = PACK_CAPACITY_AH; datalayer.battery.info.total_capacity_Wh = BATTERY_WH_MAX;
} }
uint8_t calculate_checksum(uint8_t buff[12]) { uint8_t calculate_checksum(uint8_t buff[12]) {

View file

@ -3,13 +3,10 @@
/* Tweak these according to your battery build */ /* Tweak these according to your battery build */
#define CELL_COUNT 14 #define CELL_COUNT 14
#define PACK_CAPACITY_AH 100 //100 = 100Ah
#define MAX_PACK_VOLTAGE_DV 588 //588 = 58.8V #define MAX_PACK_VOLTAGE_DV 588 //588 = 58.8V
#define MIN_PACK_VOLTAGE_DV 518 //518 = 51.8V #define MIN_PACK_VOLTAGE_DV 518 //518 = 51.8V
#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 MAX_CHARGE_AMPS 32
#define MAX_DISCHARGE_AMPS 32
#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%, ...)
/* Do not modify any rows below*/ /* Do not modify any rows below*/