From d810752a7a883e613fa7ba12914b27348f8336e5 Mon Sep 17 00:00:00 2001 From: Michael Balzer Date: Wed, 8 Nov 2017 23:01:36 +0100 Subject: [PATCH] - Fix: temperature compensation does not inhibit charge stop --- KlausBMS.ino | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/KlausBMS.ino b/KlausBMS.ino index 07dcaf1..9bf3826 100644 --- a/KlausBMS.ino +++ b/KlausBMS.ino @@ -26,7 +26,7 @@ * */ -#define KLAUS_BMS_VERSION "V0.9.1 (2017-11-08)" +#define KLAUS_BMS_VERSION "V0.9.2 (2017-11-08)" #include #include @@ -1068,8 +1068,10 @@ public: drvpwr = max(drvpwr - dt * dy, 0); dy = (max_recup_power - max_recup_power_0c) / 20; recpwr = max(recpwr - dt * dy, 0); - dy = (max_charge_current - max_charge_current_0c) / 20; - chgcur = max(chgcur - dt * dy, 5); + if (chgcur != 0) { + dy = (max_charge_current - max_charge_current_0c) / 20; + chgcur = max(chgcur - dt * dy, 5); + } } #endif // CALIBRATION_MODE