Author Topic: uC based buck converter  (Read 5543 times)

0 Members and 1 Guest are viewing this topic.

Offline ElectroWarriorTopic starter

  • Contributor
  • Posts: 13
  • Country: dk
uC based buck converter
« on: October 23, 2013, 07:47:04 am »
Hi guys, im working on a project where I need to have a buck convterter, and some uC based stuff. I was thinking if it is possible to make a buck converter usingthe uC as the controller. The plan is to use the integrated PWM module of the uC to control the buck converter transistor, and the uC ADC to probe the output and thereby making a control loop.
However the problem is that most low cost microcontrollers only produce PWM frequency of 16-20kHz if i need a minimum duty cycle resolution of 10bits. At a PWM frequency of 16-20kHz the inductor and filter cap has to be quite large.
The question is:
Is it possible to multiply the PWM frequency while keeping the dutycycle information in some way? - maybe some PLL or other stuff?
I know if it is done this way, the duty cyle will only update at 16-20kHz rate, however that should be fast enough for a fair regulation.
Best Regards
ElectroWarrior
- The humble servant of the mighty Electron -
 

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: au
Re: uC based buck converter
« Reply #1 on: October 23, 2013, 09:16:45 am »
Pretty much every manufacturer has app notes on digital control of power converters.

As for low cost uC, well it depends on how low cost you mean.  Once you get to 16bit and beyond pretty much every manufacturer has models that have high speed PWM units (>100MHz), usually multi-phase for this exact purpose.  I haven't seen a 32bit controller that doesn't have them.  Usually you also need the higher power of the these controllers with fast ADC and 16 or 32 bit MAC instructions, depending on how fast you want you control loop.  If you're trying to do it on a $1 8bit uC, then you're probably going to be better off using an analog solution.

If you go to any of the major's website and have a look at uCs for power conversion applications you'll find lots of documentation.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7377
  • Country: nl
  • Current job: ATEX product design
Re: uC based buck converter
« Reply #2 on: October 23, 2013, 12:06:34 pm »
Have you looked at the dsPIC33 series? It is supposed to be a fast PWM power supply chip from microchip, they are basically PIC24 with more stuff. I find digital control slow for practical applications, but I've seen implementations.
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: uC based buck converter
« Reply #3 on: October 23, 2013, 01:31:24 pm »
Inductor and Output filter cap...what do you consider quite large?  Depends on the input/output current and voltage your trying to work with, and the ripple, PCB size requirements you have to meet.

I've successfully designed and built several 20KHz PWM 16Fxxx 8bit low cost PIC MCU (20MHz) as the complete SMPS controller, circuits using external dual comparator and an a dual op-amp  and so can use150 to 330uH inductors to make very efficient >5-amp Li-Ion chargers with simple cirucitry, and with a low-RDSon MOSFET, got a very high efficiency, losses mostly due to Schottky diodes, inductor resistance heating, but overall, very quite  good results  in regulation and ripple and high output current and yet capable of operating over a wide range of DC input voltages just a few volts over >Vbattery to >36V Vin.

The catch Sw. inductor  size is, always  the biggest hog of PCB real estate, followed by in/ouput filter caps, but total area needed is always in proportion to output current requirements..yet I have gotten very low cost, good size/efficiency/performance with output currents <3 Amp.

If have used a PIC MCU and a cheap IC comparator to PWM control a TI/Natsemi ~500KHz switcher IC output voltage with very good efficiency, 5-amp output, small inductor size and good regulation with acceptable load change transient response but the cost of the fast LM switcher is not so attractive considering the large quan. of free larger toroidial inductors I have on hand from defective PC power supplies and discarded PC printers, so I opt often to work with 20KHz PWM if PCB size is not an issue.

If you bother to build a freq. multiplier, your best bet would be dicard this idea in favor of using a MCU to control something like a LM2678 fast SMPS IC, due to the large circuit complexity.
« Last Edit: October 23, 2013, 01:52:39 pm by Paul Price »
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13746
  • Country: gb
    • Mike's Electric Stuff
Re: uC based buck converter
« Reply #4 on: October 23, 2013, 05:06:07 pm »
Although it's doable, it's often not worth the hassle unless you're very cost-constrained.
Software regulators can take up significant resources, and risk smoke (of both the reg and in the case of bucks, what it's powering) if the firmware has problems.
There can also be smoke issues when debugging if you happen to halt when the PWM is on, and you need to be sure you know what will  happen under all reset and brownout conditions.
A seperate buck will "just work", have overcurrent protection etc.    There are plenty of cheap (<<$1) buck convs, especially as you move away from mainstream ICs from TI - look at Richtek, Diodes and Alpha Omega.
Microchip's MCP16301 is also good.
the higher PWM freqs you'll be able to use on seperate regs will allow small inductors and often ceramic-only decoupling, and this alone may outweight any cost savings of doing it in software
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline TMM

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: au
Re: uC based buck converter
« Reply #5 on: October 24, 2013, 10:04:10 am »
I agree with Mike. The uC will be running flat out for the best transient performance - making it pretty useless for anything else. It may work ok in an application where you don't expect sudden changes in load (e.g. a battery charger).
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: uC based buck converter
« Reply #6 on: October 24, 2013, 12:06:05 pm »
Its not a useless technique but you shouldn't expect to built the best converter ever. In one of my products I was lucky to use the uC as the PWM controller. Half way the project it turned out the load needed current control instead of voltage control. In that design the current limiting is done in hardware though.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline ovnr

  • Frequent Contributor
  • **
  • Posts: 658
  • Country: no
  • Lurker
Re: uC based buck converter
« Reply #7 on: October 24, 2013, 12:34:46 pm »
Having recently built one myself: They do work, and you're not restricted to low frequencies either. I'm running a PIC12F1501, and doing 500 kHz PWM on it. You only get 6 bits of resolution, but if you do some magic with the CLC and NCO modules, that gets expanded to 15 bits - see AN1476. This is essentially just dithering, but it shouldn't present any real problems.

Yes, transient response is rather bad (ADC is limited to ~80 KSPS), but for my application, it's fine. Also no problems re: overvoltage on the output, as the downstream device is fine with pretty much whatever I feed in. I'd obviously not go power a laser diode with it ;).

The main reason I picked a µC-based solution was that I needed it to be programmable over a serial bus, and I didn't feel like dicking around with PWMing the feedback pin on a dedicated regulator, or using digipots.
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7377
  • Country: nl
  • Current job: ATEX product design
Re: uC based buck converter
« Reply #8 on: October 24, 2013, 04:46:42 pm »
Having recently built one myself: They do work, and you're not restricted to low frequencies either. I'm running a PIC12F1501, and doing 500 kHz PWM on it. You only get 6 bits of resolution, but if you do some magic with the CLC and NCO modules, that gets expanded to 15 bits - see AN1476. This is essentially just dithering, but it shouldn't present any real problems.
If you make dithering on a power converter, that doesnt help that much. The reason is that the dithered frequency will be the same frequency as if you used lower frequency PWM. And you dont want a "wobble" on the output, so you need to design your output filter below the dither filter. So we are at square 1. Sometimes it is useful though.
 

Offline ovnr

  • Frequent Contributor
  • **
  • Posts: 658
  • Country: no
  • Lurker
Re: uC based buck converter
« Reply #9 on: October 24, 2013, 05:22:11 pm »
If you make dithering on a power converter, that doesnt help that much. The reason is that the dithered frequency will be the same frequency as if you used lower frequency PWM. And you dont want a "wobble" on the output, so you need to design your output filter below the dither filter. So we are at square 1. Sometimes it is useful though.

Well, the magnitude of the dither "frequency" as it were is going to be significantly less than if you just tried to push 20kHz through a filter designed for 500kHz. I don't need a super stable output voltage, so I'm happy to deal with a bit more low-frequency ripple compared to having an enormous inductor.
 

Offline ElectroWarriorTopic starter

  • Contributor
  • Posts: 13
  • Country: dk
Re: uC based buck converter
« Reply #10 on: October 25, 2013, 09:59:39 am »
I want to thank everybody for all your great inputs!
The point behind the project is to make a 5V 500mA USB charger, being as low cost as possible, while having some ability to do some minor processing. The USB specification does not explain much about ripple voltage, however it specifies that the voltage has to be between 4.75V to 5.25V. And since a USB charger does not experience major transient loading conditions - I hope it will be possible to regulate the converter by using a uC, and thereby having some headroom for a bit of proccessing. I have read the AN1476 application note, and the information is amazing, just what i needed. I will try and see if I can make it work - Thank you very much ovnr.
Best Regards
ElectroWarrior
- The humble servant of the mighty Electron -
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf