You are here

Boost Converter/charger feature

3 posts / 0 new
Last post
shaman
Offline
Last seen: 2 weeks 3 days ago
VESC Free
Joined: 2018-12-09 15:59
Posts: 34
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

Image

vadicus
Offline
Last seen: 9 hours 3 min ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 14

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 https://www.electronoobs.com/eng_circuitos_tut10_1.php

/*

 * 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

}

TechAUmNu
Offline
Last seen: 20 hours 19 min ago
VESC Free
Joined: 2017-09-22 01:27
Posts: 346

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.