From 27285050ab8451051ea70ab6cf5d6898072ebcc1 Mon Sep 17 00:00:00 2001 From: Mortificator Date: Wed, 15 Jul 2026 11:23:30 +0200 Subject: [PATCH 1/2] main-ctrl charge-ok vc_charge_end check Since vc_charge_start can be set higher than vc_charge_end in VESC tool, we need to always check for that, regardless of charging state --- vbms32_micro/vbms32_micro.lisp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vbms32_micro/vbms32_micro.lisp b/vbms32_micro/vbms32_micro.lisp index d961c044..fa682376 100644 --- a/vbms32_micro/vbms32_micro.lisp +++ b/vbms32_micro/vbms32_micro.lisp @@ -644,6 +644,8 @@ loopwhile-thd (bms-get-param 'vc_charge_end) (bms-get-param 'vc_charge_start) )) + ; Since vc_charge_start can be set higher than vc_charge_end in VESC tool, we need to always check for that + (< c-max (bms-get-param 'vc_charge_end)) (> c-min (bms-get-param 'vc_charge_min)) (< t-max (bms-get-param 't_charge_max)) (> t-min (bms-get-param 't_charge_min)) From 575387cf81246275a4071abe1756e2a183ad871c Mon Sep 17 00:00:00 2001 From: Mortificator Date: Wed, 15 Jul 2026 11:25:39 +0200 Subject: [PATCH 2/2] start-fun charge-ok vc_charge_start check Charging should only start if the voltage is lower than vc_charge_start --- vbms32_micro/vbms32_micro.lisp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vbms32_micro/vbms32_micro.lisp b/vbms32_micro/vbms32_micro.lisp index fa682376..784a29b0 100644 --- a/vbms32_micro/vbms32_micro.lisp +++ b/vbms32_micro/vbms32_micro.lisp @@ -375,6 +375,8 @@ loopwhile-thd (setq init-done true) (setq charge-ok (and + ; charging should only start if the voltage is lower than vc_charge_start + (< c-max (bms-get-param 'vc_charge_start)) (< c-max (bms-get-param 'vc_charge_end)) (> c-min (bms-get-param 'vc_charge_min)) (< t-max (bms-get-param 't_charge_max))