Step-down converter by AVR

Go To Last Post
27 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I would like to build a Step-down converter with AVR.
Uin = 17-55V
Uout = 14.4V
Iout = 10A

I attached the schematic.
Datasheets:
http://lomex.hu/pdf/irfp4710.pdf
http://lomex.hu/pdf/byw77p.pdf

The schematic is right?
The IRF Gate to the AVR (ATmega8) PWM module.

I would like to know a formula which tha AVR can calculate the switching frequency and I would like to know the value of C1, L1.

(Sorry about my orthographic mistakes, my English is bad.)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

People have done such SMPS in the past with an AVR. If I remember correctly, the results were not to great.

What is missing in your schematic is feedback from the output to the AVR, so you can close the loop and run a PID controller in the AVR.

You also won't be able to drive an IRFP4710 directly from an AVR. I didn't look into the datasheet (bad, I know), but I bet it needs a lot more "oomph" to switch (VGS) than an AVR's maximum 5 V.

The switching frequency should be as high as possible. But seriously, if you need to ask how to dimension this 144 W output power supply (could be well 200 W input power), you are probably attempting something which is way over your head. Try something simpler.

SMPS can behave very ugly, and high-power SMPS even more. Your best bet is probably to buy a complete SMPS. But if you want to build a SMPS on your own, then start at last with an off-the-shelf SMPS IC, not with an AVR. And start with less power.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your reply!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Based on my very limited experience, the MOSFET you selected looks like something too beefy for an AVR to pump through. Good RDSon, but very large gate charge, Qg. Try selecting MOSFETS by low Qg first. IRF740A, IRF630N, IRFB4620. They have an order of magnitude larger RDSon, which is bad news, but the good news is that a bare AVR will be able to open/close them very quickly. BTW, that little 10 ohm resistor may significantly reduce efficiency, too, providing nothing.

I'm not sure why an AVR-based converter has to be less efficient than same based on a dedicated chip. Your demand of amperage is crazy though, I don't think it's very safe for a first project.

The Dark Boxes are coming.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I've built a step down convertor using an ATTINY26. My PID algorithm is rather basic (the ATTiny has no hardware multiplier), but it does work rather well at low voltage (its supposed to run on mains, but I haven't gotten that far yet). I'm not a profesional SMPS design engineer, and my convertor is an experimental prototype, so I can't say I've used the best implementation of this topology for my or your requirements. Any project worthwhile will require numerous stages of investigation, prototyping and development, so don't be put off by seeming to be in over your head. You can't learn to swim on dry land.

The circuit you've got there won't work because your transistor gate voltage needs to be referenced to its source, which is the node connecting the inductor, diode and transistor.
IMO this is one of the trickiest parts of designing a step down convertor (H-bridges have the same problem). A popular method is to use a low inductance 1:1 transformer, typically made by winding 2 wires with 10 or 20 turns onto a small ferrite ring, and driving one coil with a transistor bridge or a dual half inverting fet driver (like the TC4426). In my circuit I've used an isolated 12v supply with -V connected to the transistor source node and +V providing power for a high speed optoisolator (10Mbps, about 40ns lag) and a TC4427 1.5Amp dual fet driver coupled to the gate by a 10ohm resistor (this limits the peak current to the gate and helps keep noise and ringing off the local supply). I haven't yet fully tested this arrangement, but it does suffer from a minimum on period due to the rise/fall of the optoisolator output compared to the driver input threshold.

Looking at the data sheets for the components you've selected, I'd say you've over specified somewhat. The maximum current your fet will see is Iout, which you say is 10A. Its fair to over spec by a factor of 2, so a 100V 20A device would do just as well. A lower specced device will usually have a faster switch time, but may not always have lower Rds(on), so there's no garuantee of improved efficiency.
For the voltages you are using, a Schottky diode would be a better choice, as they switch much faster and drop less volts, increasing efficiency. Al€so, higher ampere rated diodes will let more current flow back through them before they switch off, even compared with diodes of the same switching time, which further reduces efficiency.

Selection of L and C are dependent up your target ripple voltage and current. Increasing capacitcance decreases voltage ripple, increasing inductance reduces current ripple.
Higher switching frequencies also reduce ripple, and allow smaller values for L and C. The trade off is that switching losses become more significant as the switch period decreases.
Typically one chooses values to keep a current flowing in the inductor at all times (the constant current condition)I can't remember off the top of my head what the formulas are. You can find them on the net if you wiki, or check manufacturers application notes. You should be able to derive them yourself from basic circuit theory. (If you can't, then you've got a lot of study you should do before you proceed).

A note on feedback - current feedback is generally used in SMPS ics. Using voltage feedback alone can cause ringing, large surge currents and voltages at startup and in response to changes in load.

And that concludes todays recitation of Power Electronics 101.
Have fun experimenting, and if you dont have a pile of dead fets at the end of the day, you haven't been working hard enough :wink: )

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The main problem with an MCU as a SMPS controller is that transient response is very slow and regulation is relatively poor due to limited PWM resolution.

This is a nice site about SMPS design.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Content deleted: this is the Atmel AVR-forum :!:

< Plons >

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's not that you can't do it with a micro, it's that you "probably" shouldn't. Use the right tool for job. Unless this is just being done for fun, using dedicated hardware is the easiest, quickest, and probably the most trouble free method.

Although the micro should do a decent job at voltage regulation (assuming the control loop is written properly), there are things that the hardware does that the micro cannot do fast enough without additional hardware (like fast current limit). Hardware SMPS controllers have a comparator that looks at the voltage across a current sense resistor that turns off the output switch when instantaneous current goes too high. This can happen in sub-microsecond time frame. Unless the output switch is turned off quickly, it's toast. If you are willing to add an external comparator and current sense resistor, then feed the comparator into the micro interrupt, then you may be ok.

But why go through all this trouble when hardware solutions already exist ?

Also, how do you plan to drive that N-CH FET in the "high side" ? You are going to have to add a charge pump to drive the gate on this N-CH FET. A P-CH FET would be easier to drive for this topology.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
But why go through all this trouble when hardware solutions already exist ?
IMO it's a good learning experience. Several designs are discussed in the General Electronics forum. Do a search over there. And as recommended: start with a not-so-beefy design.

Enjoy !

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are MCUs that are highly suitable; they aren't made by Atmel, though.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

curator_ami wrote:
The maximum current your fet will see is Iout, which you say is 10A.
No, that isn't true. The current can be much larger. I am to lazy to look the details up now, but it is a classic error to equate inductor current (as switched by the FET) with output current.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
No, that isn't true. The current can be much larger. I am to lazy to look the details up now, but it is a classic error to equate inductor current (as switched by the FET) with output current.

That may well be true - certainly, looking at the waveforms in my converter, there's a great deal of parasitic oscillation in the inductor (it's been a while since I played with this circuit, mind). I was quoting the Id(max)=Iout from Texas Instrument's SMPS Topology chart, document number SLUW001D. But of course, that is the case for an ideal converter, and not a real one.
If you can find those details, I'd be interested in them.

Quote:
There are MCUs that are highly suitable; they aren't made by Atmel, though.

Atmel make the AT90PWM which is designed for SMPS and motor control applications. I've not tried them yet as they are SMD only.
There is also supposed to be an atmel chip with a 150MHz asynchronous PWM timer. I can't remember which one.
And then theres the XMega. I have some xmega128 A1s at work. They have two 2Msps ADCs and two 1Msps DACs, a whole bunch of PWMs, and their top cpu clock is 32MHz. If you can't make a good SMPS with that... bleh, I dunno. Would perhaps be overkill unless you wanted it for some demanding and unusual application.
Oh, I don't know, I just do this for fun.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also about mosfet driving in N channel,the VGS must be up to +20V when Source is in 0V.Here,in the design Source is in 14.4V,so the gate must be biased in 14.4V+VGS.Using some linear dedicated pwm ic i think the all project would be much easier.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The time will come I will do some neat SMPS-job using the AT90PWM3, but so far I used standard AVR's for such jobs. Tiny2313, Mega8 (16 and 32) and Mega88. And except the SMPS-job, they do other tasks as well.
I found it an exciting voyage.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear Everybody,

I reading the lot of reply with gladly!
Thanks!

I had took a break.

I had been thinking about the implementing of this project.

I will use this tool: http://schmidt-walter.eit.h-da.d... (thanks to jayjay1974)
I think I have to a Buck Converter.

I calculated some value:
Vin_min = 16V
Vin_max = 40V
Vout = 14.4V
Iout = 10A (max)
f = 100KHz
L = 23.74uH
http://schmidt-walter.eit.h-da.d...
And what about the Cout?
The value of Cout is not important?
Can I use for example 1000uF/25V elko capacitor?
How to can I calculate the duty cycle?
The connection of FET on the schematic which I attached in my first post is right?
The IRLZ44NPBF FET is good change for this application?

Curator_ami!
Can we see the schematic an the source of your Step-down Converter project?

Thanks,
Szabolcs

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree with others that a dedicated PWM chip is probably a better approach. I was at one point considering building a buck converter using an ATTiny, but this makes it so much easier: This chip, for example. The datasheet gives you all sorts of application information, including equations to calculate your various inductor, resistor, and capacitor values.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've done several low power buck and a couple boost converters with tiny and irlm6401 even though it was not cost effective. I had the parts and it was fun. Buck is easier than boost. I also did a few high power supplies using "proper" components and it was not so much fun.

I suggest starting out with cheap 7 cent Jameco 100uh chokes and working up through the $1 toroids and only then get to the biggies which are quite expensive. Or roll you own.

Get used to the smell of smoke and make sure you have a box of spares. The more power the more dramatic the fireworks :eek: hence advice to start small.

It is totally fascinating to see a dollars worth of parts generate voltages linear regs can only dream of and orders of magnitude more efficient. Highly recommended.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are examples with AVR.

RES

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For LEDs and battery chargers a MCU as controller is very feasible because the load is quite constant and predictable with no quick and possibly large transients. The slow response is no problem then.

On the other hand, what is the advantage of the above pictured circuit compared to a dedicated (white) LED driver IC? It's only useful if you combine it with some other features, like auto-off, dimming or low-battery warnings. And the circuit does not even use feedback, a 555 would work just as well.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jayjay1974 wrote:
MCU as controller is very feasible because the load is quite constant

True. No PID or Kalman filters here. :)

jayjay1974 wrote:
And the circuit does not even use feedback, a 555 would work just as well.

Actually a 555 makes crummy PWM and requires many times more components to do it.

The real problem is the OP needs a buck converter and the one in the diagram is a boost.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A 555 needs two resistors and cap. A 555 is cheaper too and easily offsets the cost of the two resistors :) It's easy to set the duty cycle on a 555.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

johnwarfin wrote:

Quote:
The real problem is the OP needs a buck converter and the one in the diagram is a boost.

No - the topology shown in the sch posted by the OP is a buck.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jayjay1974 wrote:
A 555 needs two resistors and cap. A 555 is cheaper too and easily offsets the cost of the two resistors :) It's easy to set the duty cycle on a 555.

So only 300% increase in component count? :)

Also note that CMOS 555 costs more than t11 which, although discontinued, still shows up on Ebay (I have 15k). T10 just coming out now is also cheaper.

The CMOS 555 is somewhat frequency stable but pulse with varies all over the place with temp and volts. A CMOS gate (i.e. hc00. 02, etc.) can also do the job and is cheaper but in reality best bet is Max or Linear chip or at least soemthing with ADC so feedback can be implemented.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gahelton wrote:
No - the topology shown in the sch posted by the OP is a buck.

I was referring to RES's diagram which is a boost. The OPs schematic had other problems.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But a 555 can run up to 15V :P The cheapest 555 is €0.106 in single quantities at Farnell. And needs no programming. I'm thinking more or less mass-production here, of course. For a one-off you could use a mega2561 if that's all you have in the drawer on that raining Sunday afternoon :)

I used a tiny25 to control a flyback converter to convert 5V to +/-15V and +/-30V. Winding transformers is fun :) The load was a bunch opamps for which a superstable supply was not required. With only 8 bits PWM resolution, output voltage accuracy was ghastly. It would almost always oscillate between two PWM values because the required duty cycle lied somewhere in between.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jayjay1974 wrote:
But a 555 can run up to 15V :P The cheapest 555 is €0.106 in single quantities at Farnell.

Since component cost is only about 1/4 production the 555 turns out to be more expensive than the t11 I used for my client considering the 300% increase in component count. Even an hc00 which is cheaper than a 555 cost more than the Tiny. Also note CMOS 555 is required which costs more. I suspect the new t10 will cost less than a 555.

Too bad Atmel killed the t11. Fortunately I have a huge stock but still miss it.

jayjay1974 wrote:
It would almost always oscillate between two PWM values because the required duty cycle lied somewhere in between.

Drop the ADC and this will not happen.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Drop the AVR, use a real controller and all the problems are gone 8)

I used the t25 because it has complimentary PWM outputs with selectable dead time, my converter started as a simple push-pull converter. The t25 replaced a LT3439. And then you start experimenting as a push pull cannot be regulated and you end up with a flyback. You quickly learn the abilities and limitations then :)