lm317 powersupply overshoot - Page 1
Forum section: electronics / projects

author: mj21
author_rank: Regular Contributor
timestamp: June 17, 2013, 09:53:23 am
content: i build a small power supply based on lm317 with a pnp pass transistor to add extra current capability, at the out put i got a switch to switch the load on and off. now the voltage are selected with a rotary switch with per-selected resistor values. after selecting the required out put i use the load switch to turn the load on and of, but doing so the power supply over shoots around 2 to 4 volts with out a load and with a load about 2 volts.now the circuit is very simple, it work fine but no matter what i do i can not stop it to over shoot.can some one please let me know what i need to do to fix this?thanks

author: SeanB
author_rank: Super Contributor
timestamp: June 17, 2013, 10:16:48 am
content: Move the 1uF on the input to be across R4. add a 1000uF capacitor ( about 35 or 63V rating will do depending on the input unregulated voltage) to the input before the regulator, at the emitter junction of the transistor. Preferably add the 2 protective diodes mentioned in the datasheet and it will work.

author: Paul Price
author_rank: Super Contributor
timestamp: June 17, 2013, 12:32:21 pm
content: I am fairly certain Your trouble is not as described nor fixed by the previous answer.Here's what I think is happening. As you change the voltage output setting with the switch there is a fraction of a second between contact settings that causes the output voltage setting circuit to be upset because the setting resistor is infinite during this transit period.between contacts and so what you are during that instant is selecting maximum output voltage. You probably have what is called a break before make type of rotary switch. The break is what is causing the problem. What you need to is put about a 100uF capacitor from the ADJ terminal to ground to stabilize the set voltage while the switch is in transit between contact points.

author: mj21
author_rank: Regular Contributor
timestamp: June 17, 2013, 03:24:58 pm
content: sorry i prob didn't make my self clear. the switch for the voltage selection is before the switch for output load. i use the rotary switch to select a voltage then after many seconds i use the load switch to turn the load on or of, it is at this point that the overshoot happens.this is the switch which i use for the load.

author: Strada916
author_rank: Frequent Contributor
timestamp: June 17, 2013, 03:28:01 pm
content: You might want to replace the 330 ohm resistor with 33 ohm and a limiting resistor to the collector leg. 1ohm for 1amp. .5 for 2amps.

author: mj21
author_rank: Regular Contributor
timestamp: June 17, 2013, 03:38:12 pm
content: thnx i will try that.

author: c4757p
author_rank: Super Contributor
timestamp: June 17, 2013, 03:41:27 pm
content: What are you using for R3? LM317 has a 10mA minimum load, and if you're not meeting that it could misbehave when you finally do. Note that the example circuits in the datasheets oftendo not meet the minimum load themselves- you must be drawing at least 10mA. The example 240 ohm resistor will only draw 5.2mA...

author: c4757p
author_rank: Super Contributor
timestamp: June 17, 2013, 03:48:24 pm
content: Quote from: mj21 on June 17, 2013, 09:53:23 amHow does the power supply overshoot when you toggle the load switch, when there's no load? How exactly is this switch connected?

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: June 17, 2013, 03:55:19 pm
content: Quote from: c4757p on June 17, 2013, 03:48:24 pmWondering the same thing. The load switch should be the last thing before the load.

author: mj21
author_rank: Regular Contributor
timestamp: June 17, 2013, 05:03:32 pm
content: here is schematic of the circuit. i made one up quick as i didn't have one in hand. now as the previous person said i didn't not have a minimum load at the out put only an led which is after the load switch. so i put an resistor to see it it make any difference, it does at lower voltages a bit but still i get overshoot.thanks

author: c4757p
author_rank: Super Contributor
timestamp: June 17, 2013, 05:19:32 pm
content: Add an output capacitor directly between VO and ground!By the way - obviously it won't actually affect your circuit operation - but you've used the wrong symbol for the transistor. You used the NPN symbol (arrow points out) when it's a PNP transistor (arrow points in). As a rule of thumb, the current flows in the direction of the arrow.

author: mj21
author_rank: Regular Contributor
timestamp: June 17, 2013, 05:20:32 pm
content: ops sorry i forgot to draw that. i have 10 mf and 100 nf across the output.

author: c4757p
author_rank: Super Contributor
timestamp: June 17, 2013, 05:25:33 pm
content: 1) On which side of the load switch?2) mf is millifarad (1000 uF).

author: SeanB
author_rank: Super Contributor
timestamp: June 17, 2013, 05:25:58 pm
content: You have a problem by R2, R4, in this circuit the transistor ( should be a PNP anyhow in the drawing) will never work.The switch will have to be a make before break one though, otherwise the LM317 will try to go to full unregulated rail voltage. The only way to fix that with the existing switch is to use a fixed resistor to ground and use the switched resistors in the R10 position to set the desired voltages.

author: c4757p
author_rank: Super Contributor
timestamp: June 17, 2013, 05:33:47 pm
content: Quote from: SeanB on June 17, 2013, 05:25:58 pmAh, yes. R2 should be in the current path flowing into the LM317, because it acts as a sense resistor, turning the transistor on as the voltage drop on it approaches VBE. It should also be a much lower value than 22R - more like 0.5-1R!Speaking of resistor values - how does that LED smell when you use it with a 22R resistor?Not at all, probably - the LED's backwards!Be more careful drawing these schematics - it's hard to tell what's a true problem with your circuit and what's a schematic error.

author: Dave
author_rank: Super Contributor
timestamp: June 17, 2013, 06:40:35 pm
content: There are many mistakes in this circuit.-As others have pointed out, the PNP transistor is connected incorrectly. Also, that thing in the schematic should be a PNP, not an NPN. Fix it.-Your LED is flipped and your resistor is suspiciously low value. Have you done the math on that? This thing is going to change brightness with your voltage settings. Are you OK with this?-You are missing the output capacitor.-That voltage selection switch is awfully implemented. If the switch is non-shorting, the voltage on the output will go crazy when you rotate the switch. If it is shorting, the voltage on the output is going to dip between different voltage selections.Here is my quick and dirty schematic for a better solution (the switch MUST be shorting):

author: Paul Price
author_rank: Super Contributor
timestamp: June 17, 2013, 06:52:58 pm
content: Hey, that's what I told him!But he said he is not using a rotary switch, only using a single throw switch to enable the output.BTW, R8 is still going to fry the LED.

author: c4757p
author_rank: Super Contributor
timestamp: June 17, 2013, 06:54:20 pm
content: Hey, I can play this game too!Added a base resistor to the follower so it will have some sort of limit if the output goes dead short. There is an existing limiting effect without it, but it's not really much of a limit.Added a CC driver to the LED (only requires two parts, uses the existing 1.25V reference from the LM317) to keep the LED at constant brightness.Added a protection diode from ADJ to VO because of the large capacitor on ADJ (LM317 doesn't like a big discharge there if the input is shorted).

author: Paul Price
author_rank: Super Contributor
timestamp: June 17, 2013, 07:02:36 pm
content: The LED may be very very dim at the lowest output voltage switch setting with C4757's last drawing, but the circuit below makes the lamp always on and always the same brightness.C4757p has the right idea to use an NPN in the way of his suggestion below if you want the lamp to indicate when the output is on.If you use my LED idea as well as the C4757p NPN idea the you can have both a power indicator and an output indicator LED.

author: c4757p
author_rank: Super Contributor
timestamp: June 17, 2013, 07:06:57 pm
content: Probably best to put it on the input side, really. If you want it to follow the load switch, you can use a DPDT switch, or control it with an NPN transistor with the base to the output through a resistor.

author: Dave
author_rank: Super Contributor
timestamp: June 17, 2013, 07:32:28 pm
content: Paul, sorry, I didn't really take the time to read the whole thread before posting, so I kind of repeated exactly what you said. No hard feelings, eh?Like c4757p said, a NPN to indicate the state of the output.Also, a reverse diode on the output to protect from inductive spikes.I enjoy this game of "improve the schematic", we should play it more often.

author: Paul Price
author_rank: Super Contributor
timestamp: June 17, 2013, 07:42:59 pm
content: Butthese excellent modifications are not going to fix the overshoot problem, which is the real complaint here.The thing is, LED or no LED, the transient response of the LM317 is causing the problem. Switching in a sudden load causes the PNP transistor to conduct a large current before the LM317 can correct this fault, so this is what causes the output overshoot.And while the LM317 does a good job of sourcing current, it does a terrible job of sinking it to correct the output overshoot condition.C4757p, No hard feelings. I enjoy helping others and very much like the game of improving the schematic.

author: c4757p
author_rank: Super Contributor
timestamp: June 17, 2013, 08:07:00 pm
content: Good point about the transistor. You're right, I don't think there's much that can be done about that transient response with this specific circuit. I'd consider using a different regulator (LM350 does 3A), or (gasp!) a switcher (LM2576 also does 3A and will have much lower requirements for heat sinking; there's a related version that does 5A but I don't remember the part number at the moment.) Over 1A with a linear regulator is not trivial - look inside a real, commercial PSU if you don't believe me. Even the One Hung Low cheap ones don't come quite as cheap and simple as an LM317 and follower transistor.

author: Dave
author_rank: Super Contributor
timestamp: June 17, 2013, 08:30:38 pm
content: LM317, LM350, LT3080,... none of these integrated regulators quite cut it for a lab grade power supply. They are fine for playing around and experimenting, but if you want reliability, you need to make your own regulation loop, which you can tweak and tune to your preference. There isn't much to it, just a series pass transistor (can be a BJT or a FET, whatever works for you), and an opamp with a negative feedback circuit. You can just combine more opamps for things like current regulation. The real magic of the circuit is in the passive elements in the negative feedback loop.Look up service manuals of old HP/Agilent power supplies, they are a goldmine of knowledge and inspiration.

author: c4757p
author_rank: Super Contributor
timestamp: June 17, 2013, 08:37:55 pm
content: They're not bad, though, if it's your first power supply. I'd recommend using an adjustable regulator over a custom op amp-based one, even if the adjustable ones aren't perfect. I've never had stability problems with an LM317 that wasn't seriously abused, but there are fifty ways to make your own control loop unstable. I'd concentrate on things like heat management and whatnot in this one, just use an adjustable regulator and suffer its inadequacies, and move on later.

author: Paul Price
author_rank: Super Contributor
timestamp: June 17, 2013, 08:44:18 pm
content: An adjustable output voltage 5A power supply the cool easy way.

author: mj21
author_rank: Regular Contributor
timestamp: June 17, 2013, 09:04:54 pm
content: thank you very much guys for all your helps, lol makes me feel like a kid compare to some of you guys knowing so much. the schematic i draw got lots of flows. the resistor for led its not a 22r lol,and the caps are in micro farads. i used proteus which i never used before and it was a quick ting.Dave your right, i think it will be better to use op-amp and transistor to make my own circuit. but as i had lots of lm317s lying around i thought i put them to good use. one thing i might try is to get rid of the transistors and see if the overshoot still exist, if not then i just use this to power small projects.does any one have a good power supply schematic they can put up so i can re-design mine. as it stand the one i got now with its crazy overshoot is just not good. better to use battery instead lol.once again guys thank you for all your helps..

author: Paul Price
author_rank: Super Contributor
timestamp: June 17, 2013, 09:10:50 pm
content: mj21How about the simple switcher schematic I just posted?

author: mj21
author_rank: Regular Contributor
timestamp: June 17, 2013, 09:15:24 pm
content: the one you posted is good, but i don't have the ic at hand at the moment. i got lots of op-amps and transistor and stuff lying around, was trying to build something with what i got, also i already have an switching power supply and i think it be a good thing to have a linear one as well. also got few toroid transformers with beefy amperage i can use for my linear power supply.

author: Paul Price
author_rank: Super Contributor
timestamp: June 17, 2013, 09:23:13 pm
content: Do you have anyLM339comparators and aschottky power diodeand a powerN-Chan MOSFETlying around? I can show you a schematic I designed to create a switcher with these few parts. You can get a lot of the parts you need, including the LM339(in many older models) and always nice high current schottky diodes and large heat sings and lotsa electrolytic capacitors, etc. from a discarded Desktop PC power supply. A discarded desktop PC motherboard always has a good half-dozen or so high current N-Chan MOSFETs that can be salvaged off it for free.Or you can buy these parts.

author: mj21
author_rank: Regular Contributor
timestamp: June 17, 2013, 09:25:55 pm
content: yep got lots. thanks.

author: Paul Price
author_rank: Super Contributor
timestamp: June 18, 2013, 10:57:22 am
content: Meaning???

author: mj21
author_rank: Regular Contributor
timestamp: June 18, 2013, 09:14:53 pm
content: you asked me if i have the parts you mentioned on the post before and i replied yes i do. lm 339, mosfets and the rest.

author: Paul Price
author_rank: Super Contributor
timestamp: June 18, 2013, 10:37:55 pm
content: what N-chan MOSFET do you have. Can it handle 20-30V 20V G-S, 6Amp or better? What about a power inductor that can handle as much current +30% as you might want to get out of your supply (needs to be in the 100-470uH range). Do you have a 3, 6 or better Amp Schottky with inverse voltage >=30V?

author: mj21
author_rank: Regular Contributor
timestamp: June 19, 2013, 08:49:32 am
content: yes to all, as you mentioned before computer psus have lots of useful components, i been scrapping computer psus for long time and got lots and lots of components salvaged from them.

author: Paul Price
author_rank: Super Contributor
timestamp: June 20, 2013, 01:27:24 am
content: mj21, your comment " also i already have an switching power supply and i think it be agood thing to have a linear one as well.also got few toroid transformers with beefy amperage i can use for my linear power supply.Do you want a switcher or a linear, what input voltage and current, output voltage range and current range?