You are here

Quiescent Current with FOC and PID

2 posts / 0 new
Last post
twald
Offline
Last seen: 1 week 2 days ago
VESC Free
Joined: 2024-08-03 05:48
Posts: 2
Quiescent Current with FOC and PID

Hi,
I am using a VESC controller on an e-bike with only a hand throttle input. have a PID set up to automatically brake when the throttle is released. 
The trike is used for short runs, then rests for extended periods. I don't want to bother with switching on/off the key, as it is unnecessary and a nuisance. The system works fine with the exception that the battery life is less than ideal, due to the controller not shutting down.
After some research, I was able to turn off the PID controller after a period of inactivity using (set-current 0) in a LispBM script. Looking at the live display I can see that the D/Q current goes to zero, but the voltage and duty cycle are non-zero. 

Does this mean that gate drivers are still active? is there a way to fully disable the FET output via software? What else can I do to minimize quiescant current?

twald
Offline
Last seen: 1 week 2 days ago
VESC Free
Joined: 2024-08-03 05:48
Posts: 2

For reference, here's the script:
 

(define idle-start (systime))
(define idle-threshold 60)   ; real seconds
(define adc-zero 0.95)
(define erpm-zero 300)
(define is-idle 0)

(defun check-idle ()
  (let ((throttle (get-adc 0))
        (rpm (abs (get-rpm))))
    (if (and (< throttle adc-zero)
             (< rpm erpm-zero))
      (progn
        (if (= is-idle 0)
          (progn
            (setq idle-start (systime))
            (setq is-idle 1)))
        (if (>= (secs-since idle-start) idle-threshold)
          (set-current 0)))
      (progn
        (setq is-idle 0)))))

(loopwhile t
  (check-idle)
  (sleep 0.1))