You are here

Boost Converter/charger feature

6 posts / 0 new
Last post
Last seen: 1 month 2 weeks ago
Joined: 2018-12-09 15:59
Posts: 60
Boost Converter/charger feature

The VESC has most things present to achieve boost DC/DC and charging functions. Some controllers on the market feature this. One of the motor phases could be used as an inductor or even an external inductor could be used. 

the way that it could work: disconnect a phase leads so you have access to the H-bridge

battery stays connected in the same way as if it were a motor controller.

on the the phase leads input your power supply(Ud) with caps (Cd) in parallel and inductor (L) in series. (referenced to BAT-)

Uo is the battery.

T1 is the bottom switch T2 is top switch


Last seen: 7 hours 41 min ago
Joined: 2018-08-17 07:26
Posts: 348

Voting for this feature. It seems like VESC has ALL it takes to run a DC/DC booster. I would like to add it to my custom 150v controller.  Ideally, without having to disconnect anything to get into charge mode. Just plug in the DC source.

Now, the "easy" part: Implement it in the software. It would makes sense to add it as an "app" module similar to ADC or IMU modules.

Looking up some examples for the code, it does look pretty simple. Some example from here


 * This is an example code for a BOOST converter circuit made with arduino + feedback

 * I've used arduino NANO. We have to set the timer of the PWM on pin D3

 * The feedback is connected to A1 and we set the desired voltage with a

 * potnetiometer connected to A0.




int potentiometer = A0; //The input from the potentiometer is A0

int feedback = A1;      //The feedback input is A1

int PWM = 3;            //Digital pin D3 por PWM signal

int pwm = 0;            //Initial value of PWM width

void setup() {

  pinMode(potentiometer, INPUT);

  pinMode(feedback, INPUT);

  pinMode(PWM, OUTPUT);  

  TCCR2B = TCCR2B & B11111000 | B00000001;    // pin 3 and 11 PWM frequency of 31372.55 Hz


void loop() {  

  float voltage = analogRead(potentiometer);    //We read the value of the potentiometer, which is the desired value

  float output  = analogRead(feedback);         //We read the feedback, which is the real value

  //If the desired value is HIGHER than the real value, we increase PWM width

  if (voltage > output)


    pwm = pwm+1;

    pwm = constrain(pwm, 1, 254);



  //If the desired value is LOWER than the real value, we decreaase PWM width

  if (voltage < output)


    pwm = pwm-1;

    pwm = constrain(pwm, 1, 254);


   analogWrite(PWM,pwm);  //Finally, we create the PWM signal




NextGen FOC High voltage 144v/32s, 30kw (

Last seen: 2 days 1 hour ago
Joined: 2017-09-22 01:27
Posts: 575

Would be a cool feature to have a DC/DC supply app, so you can just set what voltage/current you want. VESC already operates as a big buck converter and you can use it to run constant current through high power LEDs, or provide a high current constant voltage power supply. The control loop is quite slow and pwm speed doesn't make it great for anything fast though. 

Last seen: 6 months 1 week ago
Joined: 2018-10-31 03:33
Posts: 9

+1. It would be pretty cool to be able to charge with one of those pocket-sized 100W GaN chargers or your buddy's MacBook charger. They max out at 20V @ 5A, so being able to boost back up to battery voltage is key. 

Last seen: 1 year 5 months ago
Joined: 2021-05-31 00:10
Posts: 2

Hi guys, is there already someone working on it or should I start modifying the firmware (and maybe the board) from scratch?

Last seen: 1 month 3 weeks ago
Joined: 2022-06-11 22:44
Posts: 1

Maybe ya'll have seen this:

vedderb himself:

I suppose you could set up two profiles in the phone app, one for charging, and one for motation.