Forums

MicroController control for switching regulator

Started by RogerN December 25, 2012
I'm wanting to use a microcontroller to control the output of a switching 
regulator, maybe something like a LM2576 simple switcher.  I see the 
adjustability is on the feedback lead but what's the best way make it 
adjustable from a microcontroller.  I'm guessing the feedback may be used in 
switching timing, ie, I guess I can't just use a DAC and get an output of 
1.23V more than the DAC output?  I want to monitor voltage and current and 
use a control algorithm in the microcontroller (Arduino at first for 
experimentation) for custom battery charging experimentation.

RogerN


On 25/12/2012 8:05 PM, RogerN wrote:
> I'm wanting to use a microcontroller to control the output of a switching > regulator, maybe something like a LM2576 simple switcher. I see the > adjustability is on the feedback lead but what's the best way make it > adjustable from a microcontroller. I'm guessing the feedback may be used in > switching timing, ie, I guess I can't just use a DAC and get an output of > 1.23V more than the DAC output? I want to monitor voltage and current and > use a control algorithm in the microcontroller (Arduino at first for > experimentation) for custom battery charging experimentation. > > RogerN > >
What did Jan Pabntelje's uC switcher do? I remember it but not the details.
On 12/25/2012 4:05 AM, RogerN wrote:
> I'm wanting to use a microcontroller to control the output of a switching > regulator, maybe something like a LM2576 simple switcher. I see the > adjustability is on the feedback lead but what's the best way make it > adjustable from a microcontroller. I'm guessing the feedback may be used in > switching timing, ie, I guess I can't just use a DAC and get an output of > 1.23V more than the DAC output? I want to monitor voltage and current and > use a control algorithm in the microcontroller (Arduino at first for > experimentation) for custom battery charging experimentation. > > RogerN > >
Power supply design is an art. First, you have to decide EXACTLY what you want. Not, kinda-sorta, EXACTLY. The electrons have no concept of battery charger. All they know is voltage and current and fault conditions and how to explode stuff. The devil is in the details. The rest is 99% boiler plate copy the datasheet example and 1% "why did the board catch fire?" And fixing that 1% takes 500% of the time you planned to spend on it, and smokes more devices than you ordered. I'll rattle off the top few things I can remember on short notice. Safety first. Wear those safety glasses. Somewhere in Wilsonville, Oregon, there's a ceiling containing many chunks of epoxy and silicon from switching power supplies I exploded during evaluation. I also expect the floor still smells like pee. 1.23V is a seriously inconvenient minimum voltage for a general purpose supply. The LM2576 appears to have no capability for programmable current limit. How you implement that will have a major impact on your topology. What transient response do you expect for current transients or going in and out of current limit? And what do you want to happen when the internal safety limit interacts with your external limit? The datasheet gives you clear instructions on component selection given a fixed in/out voltage and current. Extrapolating to a wide range supply is not so simple. The Onsemi datasheet mentions core saturation, but not in a way that emphasizes its importance...AKA 1% Exactly where you connect the wires is CRITICAL. They drew the circuits funny with all the connections to a single ground node for a reason. And many of the other connections can be just as critical...I can tell you stories... If your battery charging experiments are limited to charging one technology and voltage, your requirements just got simpler... And more complicated. Using the example circuits, it's easy to come up with a design that goes up in smoke if you connect the battery before the input power. If the supply doesn't explode, the battery might. A lot depends on exactly what you're trying to accomplish. I wouldn't attempt to build any power supply without access to an oscilloscope, but that's just me. I've redesigned many a power supply designed by engineers who didn't take the project seriously. That 1% can look mighty big when you're surrounded by smoke and flying debris...and you smell like pee. If you want to build a power supply, go for it. If you want to experiment with batteries, buy a power supply. When your power supply fails shorted and the battery explodes, things get ugly. YMMV
On Tue, 25 Dec 2012 06:05:02 -0600, "RogerN" <regor@midwest.net> wrote:

> >I'm wanting to use a microcontroller to control the output of a switching >regulator, maybe something like a LM2576 simple switcher. I see the >adjustability is on the feedback lead but what's the best way make it >adjustable from a microcontroller. I'm guessing the feedback may be used in >switching timing, ie, I guess I can't just use a DAC and get an output of >1.23V more than the DAC output? I want to monitor voltage and current and >use a control algorithm in the microcontroller (Arduino at first for >experimentation) for custom battery charging experimentation. > >RogerN >
Overkill.
On Tue, 25 Dec 2012 20:46:09 +0800, Dennis <none@null.net.au> wrote:

>Jan Pabntelje's
Pabulum Boy! The new Super Non-Hero!
"RogerN" <regor@midwest.net> wrote:

> >I'm wanting to use a microcontroller to control the output of a switching >regulator, maybe something like a LM2576 simple switcher. I see the
Use a fast microcontroller (IOW: ARM) and use the PWM + ADC from the controller to do what you want. -- Failure does not prove something is impossible, failure simply indicates you are not using the right tools... nico@nctdevpuntnl (punt=.) --------------------------------------------------------------
On 25/12/2012 8:05 PM, RogerN wrote:
> I'm wanting to use a microcontroller to control the output of a switching > regulator, maybe something like a LM2576 simple switcher. I see the > adjustability is on the feedback lead but what's the best way make it > adjustable from a microcontroller. I'm guessing the feedback may be used in > switching timing, ie, I guess I can't just use a DAC and get an output of > 1.23V more than the DAC output? I want to monitor voltage and current and > use a control algorithm in the microcontroller (Arduino at first for > experimentation) for custom battery charging experimentation. > > RogerN > >
The ADC in the Arduino is not too flash, as in not being stable. You will see the value "jitter" up and down. Previous advice about using purpose designed devices would seem a better idea to me :-) Cheers .......... Rheilly P
On Tue, 25 Dec 2012 13:45:27 GMT, nico@puntnl.niks (Nico Coesel) wrote:

>"RogerN" <regor@midwest.net> wrote: > >> >>I'm wanting to use a microcontroller to control the output of a switching >>regulator, maybe something like a LM2576 simple switcher. I see the > >Use a fast microcontroller (IOW: ARM) and use the PWM + ADC from the >controller to do what you want.
Use this pair and make your own switcher and controller. UC1526J & UC1832J That, with a couple op amps and you can make it a voltage and current controlled and monitored supply. Drive a pair of FETs or the like into your transformer, and then rectify or multiply and store for the final voltage. on the output. Shunt and tap that node for the feedback, monitoring and control. Voila!
On a sunny day (Tue, 25 Dec 2012 20:46:09 +0800) it happened Dennis
<none@null.net.au> wrote in <1OqdneW6opiTPUTNnZ2dnUVZ_jGdnZ2d@westnet.com.au>:

>On 25/12/2012 8:05 PM, RogerN wrote: >> I'm wanting to use a microcontroller to control the output of a switching >> regulator, maybe something like a LM2576 simple switcher. I see the >> adjustability is on the feedback lead but what's the best way make it >> adjustable from a microcontroller. I'm guessing the feedback may be used in >> switching timing, ie, I guess I can't just use a DAC and get an output of >> 1.23V more than the DAC output? I want to monitor voltage and current and >> use a control algorithm in the microcontroller (Arduino at first for >> experimentation) for custom battery charging experimentation. >> >> RogerN >> >> > > >What did Jan Pabntelje's uC switcher do? I remember it but not the details.
It is my lab suply, on 12 hours a day: http://http://panteltje.com/panteltje/pic/pwr_pic/ I dunno about arduino, but I use a Microchip PIC PWM output, and monitor current in real time (with an internal PIC comparator), called cycle by cycle current limiting. The real time thing avoids the need for a specialized chip. Can arduino do that? Looks like overkill to me even if it can. The LM2576 could be controlled by a multiplying DAC over some range, seems a bit dangerous... (reference DAC on output, output DAC on feedback of LM2576). Output voltage limited to whatever the DAC can stand, add resistor divider for more, could even work, but DAC to zero would create zero feedback and push the output way up and saturate that inductor I am sure. ------- R -------- Vout | 8 bit control --> DAC ----> pin 4 feedback LM2576 form arduino? | /// And you cannot go to zero that way.
On 25/12/2012 9:29 PM, MrTallyman wrote:
> On Tue, 25 Dec 2012 20:46:09 +0800, Dennis <none@null.net.au> wrote: > >> Jan Pabntelje's > > > Pabulum Boy! > > The new Super Non-Hero! >
Cheers TallyWhacker - I'm just in the process or rebuilding my filters..........