diff --git a/vbms32_micro/vbms32_micro.lisp b/vbms32_micro/vbms32_micro.lisp index d961c044..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)) @@ -644,6 +646,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))