Re: Using a uC for DC-DC conversion?

From: Terry Given (my_name_at_ieee.org)
Date: 10/12/04


Date: Wed, 13 Oct 2004 11:16:44 +1300

Joerg wrote:

> Hi All,
>
> Micro controllers can be used to drive a switcher from their PWM output.
> Most of us know how to do that. But my question: Is there some nifty
> literature on the web or elsewhere about all the trade-offs this entails?
>
> What I mean are trade-offs with respect to PWM granularity, for example.
> Suppose the counter runs off 5MHz. In order to arrive at reasonable cost
> for the magnetics the PWM output needs to be, say, 300KHz or higher.
> That leaves only 4 bits of granularity. So it would idle like a Harley
> with worn spark plugs, something that may be ok. Then there is the
> feedback. Most uCs with an on-board ADC are out of price range so slope
> may have to do. On top of that there may be a limit of one slope
> conversion unless eternal muxing is done.
>
> Current mode is another topic. Tough to do on a uC but then again if one
> can measure both current and voltage the uC "knows" where about the PWM
> should be. But it's all not very precise. Then there is the issue of
> making the code that runs the PWM safe and fast enough. After all, one
> minor hangup in this area could result in a plume of smoke. Next, there
> is the trend to ever lower VCC levels which renders the task of turning
> on a FET hard enough non-trivial.
>
> Regards, Joerg

Hi Joerg,

you can dither to increase the resolution, but it doesnt gain you much.
AFAIK the answer is more clock speed (there are cunning tricks to
increase resolution, but all require a DIY pwm generator and a faster
clock).

micro sample rate is usually the killer. I am designing a drive at the
moment using a TI dsp that clocks at 150MHz, has 16 1us ADCs etc. Full
digital control, BUT hardware peak current limit/trip, cross-conduction
control and DC bus voltage limiting. software never works properly, and
programmers do stuff like step-to-breakpoint which is a great way of
applying DC to a machine :)

think synchronous sampling for current measurement - if you use
symmetric PWM (triangle not sawtooth reference wave, ie count up then
count down) then you always know where the middle of the pulse is, and
here is a good place to sample current as it is furthest away from
switching edges. also serves to remove switching-frequency ripple from
current measurement.

I once had to use a nasty little atmel micro (no multiply instruction
?!) for a 400W smps - it was a customers design I had to make go. They
had a 3-phase smps (no particular reason, and not cost-effective) so 6x
output ripple ie can tolerate low output inductance. They switched
T0-220 IGBTs at about 2kHz, with a loop time of 100ms and a 10uH output
inductor; cpu crystal was 4MHz. Needless to say, first I had to up the
switching frequency. They refused to change micros, so I made a 3-phase
pwm generator (7-bit parallel duty cycle input) with a ROM and a pair of
counters (< $1), interlock included. Changed to FETs, upped Fswitch to
100kHz and increased xtal to 12MHz. I also used the current limit
circuitry inherent in the (IIRC) IR2110 gate driver IC, and measured the
DC bus voltage for feed-forward. Oh, there was no isolation either - the
output "0V" was -200V wrt protective earth. Probably not a good
marketing strategy as most customers will die the first time they touch
it.....

Static psu performance with the new hardware was very good. But they
still closed the digital loop at 100ms, so dynamic behaviour was
atrocious. Using the shitty micro I came up with a "novel" PI controller
with feed-forward that didnt use a multiply instruction (not easy!), and
with the control loop running at 5kHz the dynamic performance was OK.
The final design was about 2x larger and more expensive than a
conventional 400W smps, but they were happy and paid my bill (note: I
didnt make it any larger, my stuff fitted into the existing design).

Never again will I do such a silly thing. Using the shitty micro I mean,
not making a stupid design work. reminds me of another job, where the
first team used a $50 8051-derivative micro from Cygnal (68-pin,
lightspeed operation etc). We used a $4 8051 derivative, and did the
same job.

cheers
Terry