From 7cedfb2f1c88f88bb178aa28b0e17d91aceec0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96ster?= Date: Mon, 10 Feb 2025 23:17:04 +0200 Subject: [PATCH] Add forcing SOC incase of 0W allowed --- Software/src/inverter/BYD-CAN.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Software/src/inverter/BYD-CAN.cpp b/Software/src/inverter/BYD-CAN.cpp index fd583657..ee051c68 100644 --- a/Software/src/inverter/BYD-CAN.cpp +++ b/Software/src/inverter/BYD-CAN.cpp @@ -126,6 +126,16 @@ void update_values_can_inverter() { //This function maps all the values fetched //SOC (100.00%) BYD_150.data.u8[0] = (datalayer.battery.status.reported_soc >> 8); BYD_150.data.u8[1] = (datalayer.battery.status.reported_soc & 0x00FF); + if (datalayer.battery.status.max_charge_current_dA == 0) { + //Force to 100.00% incase battery no longer wants to charge + BYD_150.data.u8[0] = (10000 >> 8); + BYD_150.data.u8[1] = (10000 & 0x00FF); + } + if (datalayer.battery.status.max_discharge_current_dA == 0) { + //Force to 0% incase battery no longer wants to discharge + BYD_150.data.u8[0] = 0; + BYD_150.data.u8[1] = 0; + } //StateOfHealth (100.00%) BYD_150.data.u8[2] = (datalayer.battery.status.soh_pptt >> 8); BYD_150.data.u8[3] = (datalayer.battery.status.soh_pptt & 0x00FF);