EEVblog Electronics Community Forum

EEVblog => EEVblog Specific => Topic started by: migsantiago on May 29, 2010, 02:54:23 pm

Title: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: migsantiago on May 29, 2010, 02:54:23 pm
Hi

I just saw this tutorial and there's something I didn't understand. In the step-down regulator, how does the diode provide current from GND? There's no negative source, how come the current can flow in that way?

(https://www.eevblog.com/forum/index.php?action=dlattach;topic=610.0;attach=972)

Another question, in the linear regulator an ampop is shown configured as a comparator. If REF is greater that the voltage at the resistor, the ampop will output a Vss voltage (Vss as in +V supply). If the voltage at the resistor is greater than REF, the ampop will output 0V. How can the NPN transistor be regulated if there are only 2 different voltages that the ampop can output?

(https://www.eevblog.com/forum/index.php?action=dlattach;topic=610.0;attach=974)

Thanks!!
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: jahonen on May 29, 2010, 03:16:15 pm
In the step-down regulator, it is the inductor which provides the continuous current when the switch is off. Current is continuous in the inductor. Of course, the current will slowly decay to zero. Diode just provides the path for the current. You can see that arrow in the diode schematic symbol is in the same direction than the current in the loop, pointing to the inductor.

In linear regulator, opamp does not behave as a comparator, it "finds" linear operation point (assuming that loop is stable). Another way to say is that linear power supply is just error amplifier followed by high-current follower.

Regards,
Janne
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: s3c on May 29, 2010, 03:50:05 pm
Quote
In the step-down regulator, how does the diode provide current from GND? There's no negative source, how come the current can flow in that way?

When the transistor switches off there is some energy stored in the inductor, this energy can't just dissipate and has to go somewhere, recall that an inductor tries to avoid changes in current so it will try and up the voltage till current can flow in the direction it was flowing in before the transistor turned off. This will create the needed voltage drop across the diode to put it in the forward active region and complete the loop.

Quote
If REF is greater that the voltage at the resistor, the ampop will output a Vss voltage (Vss as in +V supply). If the voltage at the resistor is greater than REF, the ampop will output 0V. How can the NPN transistor be regulated if there are only 2 different voltages that the ampop can output?

Recall that real op amps can't change their output instantaneously (look up slew rate), it would be more accurate to say that when REF is greater than the feedback voltage it increases it's output and decreases otherwise, this is a continual process that stabilizes around the output point that gives equilibrium.
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: s3c on May 29, 2010, 03:52:08 pm
I'm new to switching regulators so could anyone comment on the frequency and waveform shape used by the oscillator? I'm assuming the frequency has something to do with the LC circuit?
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: migsantiago on May 29, 2010, 04:01:18 pm
Inductors have always been a mistery to me. I quite don't understand how they can store energy just by being a single cable assembled into a loop. But science is science and I believe it hehe  ;D

Thanks Janne and S3C for your explanations!  ;D
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: jahonen on May 29, 2010, 05:28:07 pm
Energy storage in the inductor is just like in the capacitor, but current and voltage change roles. Capacitor stores E=½CU^2 in electric field and inductor E=½LI^2 in the magnetic field, so no difference there :) Energy stored in the magnetic field can be huge for given inductance if you have enough current. If you know the LHC, its main magnets used to bend the beam around the ring store about 11 gigajoules of energy in the magnetic field at maximum current, and magnets are nothing but suitably arranged inductors (superconducting wire but nevertheless inductors). To put that in perspective, the house where I live, consumes in winter coldest time about 100 kWh of electricity per day (direct electric heating). 11 gigajoules could supply the house for 30 days! That would make a nice battery :)

But back to the subject, my favorite 1 A switch-mode step-down regulator has been National LM2675 (http://www.national.com/ds/LM/LM2675.pdf). It is really easy to use and works quite stable even with poor layouts. If you look inside the datasheet, you'll find quite comprehensive block diagram. There are several ways to do the modulation. One which Dave represented in his blog episode is a burst mode, where fixed duty cycle oscillator is switched on and off. Other types are available, like hysteretic controllers or fixed-frequency PWM. The LM2675 uses fixed-frequency PWM-modulation. Burst mode yields better efficiency at low loads, but has higher output ripple. There are also ones which change modes according to the load.

Regards,
Janne
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: migsantiago on May 29, 2010, 06:26:06 pm
Capacitor - Electric field.
Inductor - Magnetic field.

Got it!!

Thanks again Janne and Shafri.  :D

I have used the TL2575HV-05 to reduce a 60V supply to a 5V supply and it also works great. It uses a 330uH inductor.

http://mexico.newark.com/texas-instruments/tl2575hv-05in/dc-dc-converter-ic/dp/27M1040?Ntt=tl2575hv-05in
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on May 29, 2010, 06:37:47 pm
I'm quite interested in the LDO regs as I'm planning on using some, how does temperature affect stability ?
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: jahonen on May 29, 2010, 06:55:51 pm
I'm quite interested in the LDO regs as I'm planning on using some, how does temperature affect stability ?

That is usually via capacitor capacitance/ESR change via temperature so if you use decent caps, that should not be a problem. If you use ceramic caps, then do not use Y5V ceramics. That has terrible voltage and temperature dependency of the capacitance. Y5V looses something like 80% of specified capacitance when used at rated voltage. However, not all LDO regulators accept ceramic capacitors, for example otherwise nice LP2951 does not like low ESR caps at all.

Electrolytic capacitors have tendency to have rising ESR when temperature drops. That might in some cases lead to instability. Using "high-ESR" tantalums might work in such cases, if you can use them.

Regards,
Janne
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on May 29, 2010, 07:00:25 pm
well I'm working with high temps
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: jahonen on May 29, 2010, 07:04:19 pm
well I'm working with high temps

Can you specify the temp range you need? Ceramic capacitors are recommended anyway if you want longevity.

Regards,
Janne
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on May 29, 2010, 07:07:08 pm
well not sure but maybe 70C
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: allanw on May 29, 2010, 07:09:30 pm
Thanks for this episode. I've always wanted to know why one wouldn't just always use a LDO. It was difficult for me to find disadvantages laid out clearly.
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: EEVblog on May 29, 2010, 10:34:22 pm
BTW, I forgot to mention in this tutorial that the displayed technique for the SMPS control is just one example of many. There are many other techniques that can be used for the gate control like fixed frequency PWM, and more exotic techniques and combinations. And that's just for the buck!
But I wanted to KISS and dumb it down.

Dave.

Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: mikeselectricstuff on May 29, 2010, 11:26:24 pm
A quick tip on inductors for SM regs.
The inductance is really not critical in most cases. DC resistance is often at least as important as it affects efficiency.
The inductance value is typically a tradeoff betwen two things :
1) The inductance needs to be high enough to not have any saturation issues at the lowest operating frequency.
2) For a given physical size, a lower inductance value will have a lower DC resistance and hence lower losses.

Datasheets often quote 'odd' values like 68uH, but you will usually find that availability & choice of parts is better for  E3 series values (10,22,47,100 etc,).
Rounding up the datasheet/calculated value up to the nearest E3 value will rarely impact efficiency too much and usually gives a wider choice of parts.

Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on May 30, 2010, 05:47:47 am
Dave what effect does a variable frequency have on the inductor and efficiency ? I think the main issue for people is choosing the values for the inductor
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: EEVblog on May 30, 2010, 08:15:01 am
Dave what effect does a variable frequency have on the inductor and efficiency ? I think the main issue for people is choosing the values for the inductor

There are usually far too many variables to give a clear cut answer to those sorts of questions when it comes to switchmodes. The golden rule is follow the datasheet and app notes to get a ballpark value and then test'n'tweak.

As a general rule, the higher the switching frequency the smaller the value and size of the inductor (which is usually cheaper), but the higher the switching losses and greater the demand on the output caps. It's a never-ending battle.

Dave.
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: mikeselectricstuff on May 30, 2010, 09:55:48 am
As a general rule, the higher the switching frequency the smaller the value and size of the inductor (which is usually cheaper),
..or lower DC Resistance for a given package size
Quote
but the higher the switching losses and greater the demand on the output caps. It's a never-ending battle.
Although as you get into really high frequencies, ceramic output caps become very viable, reducing size and cost significantly over electrolytics or tants.
There are many switchers up in the >1MHz range these days, some up to 4MHz, with pretty decent efficiencies. Particularly where you're tight on space, the lower inductor DCR at lower inductance values will at least partially compensate for higher switching losses at higher frequencies. High switching frequency also gives faster transient response.   
A nice example is the Allegro A4403 : 9-46Vin, 3A out, 2x10uf ceramic output caps and only costs about GBP1 at 100x.
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: TheWelly888 on May 30, 2010, 10:36:52 am
Oh Gawd!  ::) SMPSUs! In the mid 1990s, I was unemployed and did 6 month's unpaid work experience for a firm specialising in bespoke PSU manufacturing. My job was to test them before they left the factory and fault find any customer returns.

The firm ( since gone under and the factory site now a legal eagle's nest ) had contracts to supply cable TV companies with PSUs for distribution boxes ( at the time all the UK's streets were being trenched for cable TV! ) and high current PSUs for overhead projector ( OHP ) lamps among other things.

Even though I had circuit diagrams it was a mystery to me how they worked but I was usually able to diagnose some faults and fix them. One design was absolute shite, the PWM timing capacitors were electrolytic!!! This model was overwhelming sent back to us for repair and I had to drill out the rivets to open the case, replace ALL the electrolytics and cross fingers, test them uncased then once working use the riveting machine - it got to the point I knew the part numbers by heart!

The OHP PSUs were interesting, they had no output smoothing capacitors or rectification at all - I think they only had inductors on the output and the waveform was a kind of amplitude modulated rectangular waveform. I think they were 12V 10A output. The size of the units were maybe 100mm by 160mm in area. A separate board with fuse and rectifier was connected to provide DC to the cooling fan and boy, the number of times the fuses were blown thanks to clumsy assembly at the OHP's factory! It was a boring job checking those crappy little boards.

Having said all that, the experience I gained in that factory was useful even if it didn't lead to a paid job there.
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on May 30, 2010, 11:20:39 am
Well i have heard on inductor only solutions but for low power to run high output leds, I expect that it is a good tradeoff if you can afford a not so stable output ?
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: logictom on May 30, 2010, 12:49:40 pm
Great video as usual!
Both designs use a precision voltage references, what is used as a reference and how does it work?
After this video I thought I would grab some parts and have a play around, are there any recommended bog standard parts like the equivalent of the LM305/317?
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on May 30, 2010, 12:56:34 pm
you can get precision voltage reference chips try looking on your usual suppliers website.
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: s3c on May 30, 2010, 01:23:22 pm
Can anyone point me to a good reference for how voltage references work, using a Zener or normal diode doesn't give results nearly as good as stand alone units which is to be expected but why? How do they work then?
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on May 30, 2010, 05:10:52 pm
As i said above go to your usual suppliers website and see what they have in stock. they will have a range of parts, zeners are not a great reference because they drift with temperature and load (which will vary with input voltage)
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: s3c on May 30, 2010, 05:55:49 pm
I'm not particularly interested in getting one that works, I'm interested in finding out how it works, the web seems to be a bit lacking on that front.
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: jimmc on May 30, 2010, 06:28:01 pm
Can anyone point me to a good reference for how voltage references work, using a Zener or normal diode doesn't give results nearly as good as stand alone units which is to be expected but why? How do they work then?

Consult this guy! http://www.national.com/rap/Horrible/czar.html

See http://www.national.com/rap/Application/0,1570,24,00.html for a very good explanation of the intricacies of designing bandgap references.

Jim
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: s3c on May 30, 2010, 09:49:53 pm
Thanks Jim, exactly what I was looking for.
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: RayJones on May 31, 2010, 09:01:54 am
With regards to the lack of stability of the LDO regulator, it occurred to me whilst watching the Vblog that an emitter follower would have a very low source impedance to the load.

The collector based output of the LDO version however would be somewhat higher in impedance.
Perhaps this leads to this configuration being more likely to be unstable (more load sensitive)?
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: KTP on June 02, 2010, 01:58:29 pm
I don't know if anyone pointed out to the OP that even though current cannot change instantaneously in an inductor, voltage can.  When the transistor switches off, the voltage across the inductor instantly flips polarity across it such that the diode's cathode (negative terminal) is low enough such that current can flow through the diode (so it would be somewhere between -0.6V and -1.0V depending on the diode type and current).

hey so interestingly, I had found this simple 3 transistor switching power supply application note a few days ago.  It is actually a current regulator but still very nice and simple:

http://www.nxp.com/documents/application_note/AN10739.pdf

Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Pyr0Beast on June 26, 2010, 02:46:08 pm
I don't know if anyone pointed out to the OP that even though current cannot change instantaneously in an inductor, voltage can.  When the transistor switches off, the voltage across the inductor instantly flips polarity across it such that the diode's cathode (negative terminal) is low enough such that current can flow through the diode (so it would be somewhere between -0.6V and -1.0V depending on the diode type and current).

hey so interestingly, I had found this simple 3 transistor switching power supply application note a few days ago.  It is actually a current regulator but still very nice and simple:

http://www.nxp.com/documents/application_note/AN10739.pdf



Wooow. That is really a nice find. I just love how you can do switchers with discrete components :)
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on June 26, 2010, 03:50:51 pm
anything can be done in descrete components, IC's only make it simpler and cheaper and faster to implement, you know we had computers long before IC's but instead of an IC you had a room or more full of panels full of relays or valves
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: NiHaoMike on June 26, 2010, 07:18:36 pm
Simple switchers that only use a few discrete components are fun to design. I even built one that would "period skip" at low load to increase efficiency.
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on June 26, 2010, 10:28:25 pm
I'd like to see a switcher that ajusts frequency to load but maybe that would have issues with inductor values, but then if your switcher leaves a period dead that amounts to the same thing ? although a fixed frequency
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: NiHaoMike on June 27, 2010, 02:58:35 am
Period skipping will not cause the inductor to saturate. The basic idea is that in a power supply that never period skips, the pulses become narrower with decreasing load. At some point, the pulse has to be so narrow that a very significant amount of it is turning on and off the transistors. Efficiency drops as a result.

Now imagine if every other period is skipped, meaning that the output pulse is suppressed. Now the pulses are twice as large as before and the effective operating frequency halved, reducing losses. The pulses are still narrower than when the power supply is operating at full load, so inductor saturation does not occur. The low output current also means that the filter capacitors will be able to cope with the low frequency.

In reality, a 1:2 skip ratio is very low. My discrete design (2 transistors, but I forgot the details) had a skip ratio on the order of 1:1000, since it operates at about 25kHz and slows down to a pulse a few times a second at no load (only the load of the voltage sense circuit). It only pulls a few mW from the rectified AC line in that condition, not bad for a simple circuit! (If designs like that were used in the standby circuit of modern electronics, standby loss would be a lot less significant!)
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Simon on June 27, 2010, 06:04:48 am
sounds like a very good design
Title: Re: EEVblog #90 - Linear and LDO regulators and Switch Mode Power Supply Tutorial
Post by: Pyr0Beast on June 27, 2010, 12:17:07 pm
Indeed it does :)