Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Challenge 2: Find the circuit flaw?

Status
Not open for further replies.

MrAl

Well-Known Member
Most Helpful Member
Hello again,

First, thanks to the other members for participating in the first circuit challenge with the LM317. It is interesting to hear others ideas about these circuit problems and how they might be dealt with.

Here again we have an LM317, except this time there are two of them in the same circuit and no, they are not wired in parallel for higher current.

There is a serious flaw in this circuit, doing strictly by the data sheet specs. But this circuit also begs the question, "Why two LM317's in the same circuit if they are not in parallel, what could possibly be the advantage of doing this?"

Assuming we could 'fix' that flaw, there are also a couple drawbacks. One is that the lower LM317 can only be adjusted down to a min of 1.25v and with the upper at a min of 1.25v that means the minimum output voltage is 2.5v not 1.25v like with a single LM317. This may or may not be significant for your personal use, but worth noting. For now however we will assume that we want a min output of something above 2.5v, and for this particular problem the output is adjusted to 14.200 volts.

So can you find the fatal flaw, and if fixed, what would be the reason for using two LM317's instead of just one when they are not intended to be wired in parallel for more output current ?

If you would like to provide your results then please go ahead and just post them. If someone else agrees then they can just post that or more if they like.

Thanks for your interest :)
 

Attachments

  • RegulatorProblems-02.gif
    RegulatorProblems-02.gif
    16.7 KB · Views: 238
Sorry, but I have no clue as to why you would connect two regulators in that fashion. :confused: Seems a total waste. Until I know that, I can't fix the "fatal flaw". I need a clue.
 
Hi Carl,

Thanks for your reply and taking a look at this. I'll wait for a couple other members to reply hopefully they find this interesting too. I didnt realize i was posting these so close to the weekend too when people are probably doing other things, but so far so good.

And let me assure you and other readers that this will be interesting too, maybe even more than last time because so many people knew the answer to the last one :)

Oh and, if you assume that there is a reason for doing this then you may see the problem. It's very tricky though i will say that, but significant.
 
Hi again,

Geeze, i have to apologize here as i posted the wrong circuit for the question about "why" there would be two of them as that circuit has an op amp too. Too much in a hurry to get it posted but i am glad i came back to double check it.:)

It is however the circuit for the question about "the fatal flaw". So the question here is what is the fatal flaw and not why the two are in the circuit. I'll try to draw that one up tonight or tomorrow.

The second question, "why two LM317's" is still valid for that circuit, but only when the output is at least about 5v or so, and better at 10v and above. So if you would still like to tackle it as is, that's fine too, but only the advantage of two occurs only when the output voltage is about 5v or higher.
 
Last edited:
The one problem I see is that it has poor ripple rejection as any ripple at the output shows up on the sense voltage. Haven't seen an advantage yet.:wideyed:
 
My take on it is that the circuit with two LM317s is less sensitive to the voltage drop problem of the circuit with the single LM317.

The flaw in the circuit is that there is no allowance for the reference current for the upper regulator or the output current of the lower regulator. The voltage across both 120 Ω resistors should be the same, so the currents through them should be the same. At the point where the two resistors meet, the current should be the same in each, so all the current through one should go though the other. That means there is nowhere for the two regulator currents to go. The lower 120 Ω resistor should be decreased (and the potentiometer changed or adjusted) so that the output current of the lower regulator, plus the reference current of the upper regulator, and the remaining 120 Ω resistor current, can all go though the lower resistor.

Alternatively, a load resistor can be added from the output of the lower regulator to ground.

The LM317 has a minimum load current requirement of anything up to 12 mA (https://www.fairchildsemi.com/datasheets/LM/LM317.pdf) and a reference current of 100 μA, so worst case is that 12.1 mA more current must be guaranteed in the lower resistor than the upper one.

If the upper regulator has an output range of 1.2 - 1.3 V, so to get 12 mA at 1.2 V the upper resistor should be less than 100 Ω. If 1% resistors are used, that can be 99 Ω ±1. The worst case current is 1.3 / 98 = 13.26 mA, so adding to that the 100 μA and the 12 mA, we get 25.36 mA, and to sink that at 1.2 V, we need 47.3 Ω, and again the resistor tolerance should be applied to that.
 
Hi again,

ronv:
I think you are right there. If the ripple can get to the reference, then the reference adds ripple to the reference for the top regulator. I guess you would want to add some capacitance then? This sounds like one of the ideas i'd like to see come out in this thread.

Diver300:
You seem to be right on the money :)
There's another small detail which i'll get to in a minute, but you've covered it pretty well for the usual applications of this regulator.


FATAL FLAW PROBLEM
The "fatal flaw" was that the top regulator sources current into the bottom regulator, so the bottom regulator must be made able to handle the top current plus it's own current, which as Diver said, is about twice the normal current. So with this idea in mind, the bottom regulators R1 should be 60 ohms or add another resistor in parallel to the whole bottom regulator.


VOLTAGE DROP PROBLEM
One advantage is the voltage drop due to series resistance Rs is much less with the external reference. There is another advantage which i'll address far below.
To illustrate the "Rs" drop problem (Rs is the resistance between the very output of the regulator and the top bias resistor R1 which is 120 ohms but sometimes is made as high as 220 ohms) we can first calculate the voltage using the 'normal' equation i provided in the previous thread:
Vout=(Vref*(R2+R1)*RL)/(R1*RL+Rs*RL+Rs*R2+Rs*R1)
where Vref is the internal reference voltage usually taken to be 1.25v,
R1 is the top bias resistor usually 120 to 220 ohms,
R2 is the bottom bias resistor (the voltage set resistor),
RL is the load resistance loaded somewhere after the Rs resistor so that the load current flows through Rs also,
Rs is the pesky series resistance at the output of the regulator.

That equation is for the single IC version, and calculating the output with:
R1=120
R2=1243.2,
Rs=0.000,
RL=14.2,
Vref=1.25,

we get:
Vout=14.2 volts

No surprise there since R2 was calculated R2 to provide us with this voltage.

Next, raise Rs up to 0.020 ohms (the wire resistance) and we get now:
Vout=13.974

So we see that small wire resistance cost us 0.2 volts, and that's a lot for a circuit that is supposed to be regulating the voltage.

Lets see what happens with the new circuit, where the second LM317 is used as an external voltage reference...

Because the circuit topology is different now, we have a new equation:
Vout=((Vref*R1+Vext*R1+Rs*Vext)*RL)/(R1*RL+Rs*RL+Rs*R1)

One thing that stands out already if we compare the two equations: the first equation has Rs in the denominator only, while the second equation has Rs in the numerator as well. So for the first equation when Rs increases, the voltage must drop, but in the second equation when Rs increases there is a compensating term in the numerator which means it should not go down as far. Lets see what happens when we evaluate.

With this new equation the output at the very output of the regulator will be whatever is at the ADJ terminal plus the reference, so we need Vext to be:
Vext=14.2-Vref=14.2-1.25=12.95 volts.

So plugging in:
R1=120,
RL=14.2,
Vref=1.25,
Vext=12.95,
Rs=0.000,

we get:
Vout=14.2 volts.

Again this is what we set it for and since Rs=0 there's no drop at all.

Now lets set Rs=0.020 again and we get:
Vout=14.18 volts.

Wow, the error before was 0.2v and now it is only 0.02 volts, so that's quite an improvement.

So we see a big advantage here. Be back in a minute with the second advantage which will be interesting for bench power supplies.


ADVANTAGE #2, TEMPERATURE COMPENSATION
First let me say that this second advantage is applicable mainly to bench power supplies or power supplies which operate in ambient air temperatures which are relatively stable. It is amazing how much difference this can make with a bench power supply made from an LM317 though.

One of the problems with the LM317 is that the voltage reference is located on the same chip as its drive circuit, so when the drive circuit heats up so does the voltage reference. This results in significant output voltage drift for a bench supply. By removing the reference from the same package as the driver circuit at least in part, we can improve this quite a bit too. With the bulk of the reference voltage external to the chip, the external reference behavior dominates over the internal reference behavior.

Starting with the old equation:
Vout=(Vref*(R2+R1)*RL)/(R1*RL+Rs*RL+Rs*R2+Rs*R1)

with Rs=0 (we dont care about that resistance anymore) we get:
Vout=Vref*(R2+R1)/R1

Now with values selected as before:
R1=120,
R2=1243.2

we get:
Vout=14.2 volts

of course, but now let Vref vary by -1 percent and we get:
Vout=14.058

Not very nice is it? For a standard power supply this might not be a problem, but for a bench supply it's a nightmare.
And this does not come about because the ambient temperature suddenly became equal to that on Mars in the sunlight, it's because the heat sink had heated up due to the load current of 1 amp and an input output differential of maybe 8 volts or so and a decent heat sink.

Ok, so back to the new equation:
Vout=((Vref*R1+Vext*R1+Rs*Vext)*RL)/(R1*RL+Rs*RL+Rs*R1)

We can work with Rs=0 again because we are no longer concerned about that resistances effect so we have:
Vout=Vref+Vext

Raise your hand if you expected such a simple result :)

Too simple? Well that's what it comes down to. With the internal gain assumed to be high (and it is) that's what we get.

Right away we can see now that if the reference voltage changes it is not going to be comparable to Vout if Vext is a few times larger than the initial Vref.

With our output of 14.2v and Vref=1.25 and Vext=12.95 we of course again get 14.2 volts output, but now when we change Vref by -1 percent we get:
Vout=14.1875

and that is almost 14.19 volts, so now we've only lost about 10mv instead of 140mv, a significant improvement.

So there you have it. Two advantages to using the second regulator. BTW, the lower regulator can be an LM317L device so it is much smaller, but it MUST NOT be located on or near the same heatsink as the top regulator as it must have free air flow from the ambient air temperature that should be somewhat stable.
 
Last edited:
^^^^

Interesting and thank's MrAl. I learned something here :)

Regards,
tvtech
 
It appears that the lower '317, which sources current from the 20V input, can not provide a proper current sink for the top regulator. The top regulator '338 requires a current sink for proper operation, which the lower one can't provide. That would make the '317 completely useless, and I'd expect better results by removing the '317 all together.

Also: You should put some caps in there for stability. 0.1uF on the inside, 10-20uF on the out.

Now I'll read the other responses and see if I was even close!
 
...OK, you are looking for temperature stability with the 2nd regulator. Why not use a precision reference diode? Or instead use an external zener diode, I think it would provide a better reference be and simpler and cheaper than a 2nd LM317.
 
Hi Rich,

That was very observant of you to see that flaw. And yes, we just wanted to get better temperature stability and also better immunity to that pesky resistance Rs, which now looks smaller thanks to the second LM317.

And yes, you can use a voltage reference diode if you like, as any good voltage reference will do the same thing. You can get LM317L's pretty cheap though (59 cents) but it's up to you. It think you can get LM317T's for like 50 cents sometimes too.

The benefit is less if the output voltage is set lower, but for most normal voltages the second device or reference diode should help.

Also, for my own personal use, i had an LM317T that wasnt doing anything once i converted the PS to the LM338 so i figured i would use it up here.
Since then though i went to a full blown feedback circuit with op amp.

It's also interesting because our first impression is like, "What the heck is that for", so it makes it kind of interesting to see that it does help.
 
I see. I'm new on this site, I assumed it was an academic exercise from the "book". If this is a project from your workbench then I totally get why one would use "unique" parts. I sometimes do some very strange things because of what I have on hand and not what is considered the best "engineering solution". Sometimes I'll even design a project based around that one unusual part I found somewhere that I just want to use.

If I were designing a consumer product though where the bottom line is the price, I would definitely go for a diode that can be bought for under $0.10. A few pennies here and there can add up to thousands over the course of a production year.

BTW: I did learn something here - never much thought about the temperature drift of the '317 even though I use it constantly, sometimes as a resistor-programmed regulator and sometimes as a current regulator/limiter, and even as a digital power switch. Clever how it can be made more accurate by moving the reference off of the main pass transistor device to a cool, quiet area of the circuit board.
 
Hi again,

Well welcome to the site and im sure you'll find interesting conversation here about stuff like this.

I tend to think there is a kind of engineering gradient at work here. For something like this we might start with a resistor in series to drop some voltage, then to a voltage divider, then to a transistor with pot, then to an LM317, and so i see the next step as two LM317's like this, or as you mentioned a reference diode. So i dont see this as a purely hobby circuit, but it's probably not what is needed for a commercial product anyway unless it needs higher accuracy. And also BTW the LM317L can be had at around 10 cents per piece in quantities of 1000 so it sort of fits your budget too :)

I was mainly look at something that would more classify as a bench power supply though, because for that we probably want more solid regulation.

Then there is the alternate view as in tvtech's experience. If we ALLOW the heat sink to heat up and therefore lower the output voltage a little, then we've achieve a softer output profile once again. The battery charges hard for a few minutes while the heat sink heats up, then the voltage falls so the current falls, then as the battery charges up the voltage rises gradually. So it can act like a sort of current limiter for battery charging. Not the way i like to do it, but it would do it that way too.

The other circuit i was talking about uses an op amp as the main error amp, and just uses the second LM317 as the voltage reference for that. That circuit takes all the variation out of the picture, as long as the reference stays at or near ambient. Loaded voltage is almost constant within maybe a millivolt or two, and temperature drift is gone too. The cheap op amp makes it look as if the reference is no longer on the chip at all.

There's one more problem with the LM317 that i would like to bring out in another thread. The last 'flaw' type circuit problem. For this last one though i dont know the answer to yet either and it's been bugging me a little, so i'll be looking for a solution too.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top