From 25e30d07583949ee3aa2466ca5d2ce32f96dda73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20L=C3=B6w?= Date: Mon, 10 Feb 2025 18:52:31 +0100 Subject: [PATCH] :art: daly bms: use user settings pre-defined values instead of redefining them ourselves --- Software/src/battery/DALY-BMS.cpp | 6 +++--- Software/src/battery/DALY-BMS.h | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Software/src/battery/DALY-BMS.cpp b/Software/src/battery/DALY-BMS.cpp index e62bc441..974abd5a 100644 --- a/Software/src/battery/DALY-BMS.cpp +++ b/Software/src/battery/DALY-BMS.cpp @@ -27,8 +27,8 @@ void update_values_battery() { 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.max_charge_power_W = (MAX_CHARGE_AMPS * voltage_dV) / 10; - datalayer.battery.status.max_discharge_power_W = (MAX_DISCHARGE_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 = (BATTERY_MAX_DISCHARGE_AMP * voltage_dV) / 100; uint32_t adaptive_power_limit = 999999; 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.max_cell_voltage_mV = MAX_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]) { diff --git a/Software/src/battery/DALY-BMS.h b/Software/src/battery/DALY-BMS.h index 162e5e25..dfc3df02 100644 --- a/Software/src/battery/DALY-BMS.h +++ b/Software/src/battery/DALY-BMS.h @@ -3,13 +3,10 @@ /* Tweak these according to your battery build */ #define CELL_COUNT 14 -#define PACK_CAPACITY_AH 100 //100 = 100Ah #define MAX_PACK_VOLTAGE_DV 588 //588 = 58.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 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%, ...) /* Do not modify any rows below*/