LM317 Voltage Jump - Page 1
Forum section: electronics / projects

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 28, 2024, 08:41:25 am
content: There is a problem when switching fixed voltages on the LM317: The adjust pin floats for a short time until the next contact is closed. The output voltage can then shoot up to the input voltage. With catastrophic consequences. Is there a simple solution to this problem other than a make-before-break switch?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 28, 2024, 09:17:56 am
content: If you switch R5 instead, the effect of the break is to drop to 1.2VYou may need a separate minimum load current sink, or a load resistor, if your circuit does not already give that.

author: RoGeorge
author_rank: Super Contributor
timestamp: September 28, 2024, 09:38:39 am
content: Add a capacitor between ADJ and ground, to "remember" the voltage of the ADJ pin for the very short time while the switch moves from one plot to another.

author: Roehrenonkel
author_rank: Frequent Contributor
timestamp: September 28, 2024, 10:57:12 am
content: Hi 0xFFF0,just use a make-before-break rotary-switch.Good luck

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 28, 2024, 12:50:46 pm
content: Quote from: PCB.Wiz on September 28, 2024, 09:17:56 amR5 can not be switched because it is ~22 times smaller than the other resistors. The contact resistance of the switch leads to inaccuracies.

author: moffy
author_rank: Super Contributor
timestamp: September 28, 2024, 12:50:52 pm
content: A simple solution is to have one resistor permanently wired in (the highest value) and adjust the other values for being in parallel with that one.

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 28, 2024, 12:53:28 pm
content: Quote from: RoGeorge on September 28, 2024, 09:38:39 amWith R5=240 ohm and e.g. 10uF, I get a few milliseconds. My switch is not that fast. And the regulator should also be able to regulate quickly.

author: Phil1977
author_rank: Frequent Contributor
timestamp: September 28, 2024, 12:54:09 pm
content: An elegant idea for a very similar problem:https://www.edn.com/adjustable-regulator-trimmer-simple-failsafe-circuit/

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 28, 2024, 12:58:21 pm
content: Quote from: moffy on September 28, 2024, 12:50:52 pmIf the highest resistor (permanently present) is 30 volts and the smallest is 3V and the second smallest is 5V. Then the voltage jumps to 30V when switching from 3 to 5V.

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 28, 2024, 01:00:53 pm
content: Quote from: Phil1977 on September 28, 2024, 12:54:09 pmI know these circuits. But you need a pot for that solution. Do you know a solution for switches?

author: tooki
author_rank: Super Contributor
timestamp: September 28, 2024, 01:20:54 pm
content: Quote from: 0xFFF0 on September 28, 2024, 01:00:53 pmLook at Figure 2 in that circuit. Now imagine the wiper is at the full right position. Would you be able to replace the pot with a fixed resistor?Look at Figure 3 of that circuit. How does that relate to your substituted fixed resistor?And how does that relate to your switched design?

author: Andy Chee
author_rank: Super Contributor
timestamp: September 28, 2024, 01:37:49 pm
content: Quote from: 0xFFF0 on September 28, 2024, 01:00:53 pm

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 28, 2024, 02:12:08 pm
content: The circuit does not make sense. When switching, a float still occurs (Ua=Ui).

author: Phil1977
author_rank: Frequent Contributor
timestamp: September 28, 2024, 02:12:46 pm
content: Are emitter and collector swapped in the sketched circuit?

author: Andy Chee
author_rank: Super Contributor
timestamp: September 28, 2024, 02:31:29 pm
content: Quote from: 0xFFF0 on September 28, 2024, 02:12:08 pmYou're right.Change the transistor with PNP, and swap around collector and emitter.

author: Roehrenonkel
author_rank: Frequent Contributor
timestamp: September 28, 2024, 02:43:59 pm
content: Hi again,why don't you just get the right switch for the job??https://www.buerklin.com/de/p/lorlin-electronics/drehschalter-und-stufenschalter/ck-1058/16G3514/

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 28, 2024, 02:51:50 pm
content: Quote from: Roehrenonkel on September 28, 2024, 02:43:59 pmThis is not a 100% solution. Contact problems can still lead to loss of contact. In this case, the sensitive connected circuit is defect.

author: tooki
author_rank: Super Contributor
timestamp: September 28, 2024, 03:10:25 pm
content: Quote from: 0xFFF0 on September 28, 2024, 02:51:50 pmThat is moving the goalpost.In the original post, your concern is the break while switching, not contact failure when already switched. This make-before-break switch is one common solution to the originally stated problem.

author: tooki
author_rank: Super Contributor
timestamp: September 28, 2024, 03:18:17 pm
content: Quote from: 0xFFF0 on September 28, 2024, 02:12:08 pmFYI, since this is an English-language forum, it's probably better to use English designators and symbols, not German ones, since most people here won't intuitively know that Ua is the output voltage (since they don't know "aus" is "out"). Vin(or Vi) and Vout(or Vo) are the most common, Uin(or Ui) and Uout(or Uo) are much rarer. (And Einand Eoutare rarer still.)

author: magic
author_rank: Super Contributor
timestamp: September 28, 2024, 03:53:06 pm
content: Quote from: 0xFFF0 on September 28, 2024, 08:41:25 amI don't know what problem you have, but any simple and reliable solution probably doesn't involve switching feedback resistors to LM317.

author: Zero999
author_rank: Super Contributor
timestamp: September 28, 2024, 05:11:01 pm
content: Quote from: 0xFFF0 on September 28, 2024, 12:53:28 pmYou're right. There is no way to protect against the switch going open circuit, without a voltage spike, for an indefinite period.How slow is your switch?What voltage spike is acceptable?You're overthinking this.Use a larger capacitor. The current through R1 is constant. I = VREF/R. The voltage rise on the capacitor depends on the current, time and capacitance. ΔV = t*I/CIt won't affect the transient response. It will improve the ripple rejection and is even recommended on the data sheet. Add some protection diodes to the regulator and you're done.Spice simulation showing a 1.04V spike when R1 = 240R and the switch is opened for 200ms.

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 28, 2024, 05:23:18 pm
content: But you can't put a 1000uF capacitor on the adjust pin. How is the LM317 supposed to regulate then? And even if it works, you'll have a voltage doubling in 200ms. Your circuit is dead.

author: Zero999
author_rank: Super Contributor
timestamp: September 28, 2024, 05:44:44 pm
content: Quote from: 0xFFF0 on September 28, 2024, 05:23:18 pmWhat if the adj pin is connected to 0V? It regulates perfectly well then. All the capacitor does it bypass the lower resistor, at AC.Refer to page 13 of the data sheet.https://www.ti.com/lit/ds/slvs044y/slvs044y.pdfQuoteWhere did you get double from?No it doesn't double. Even my the circuit posted above, it doesn't double, but increases by 1.04V. The voltage will always increase by the same amount, irrespective of the voltage settling. Refer to the formula I posted above. And 200ms is a heck of a long time for the switch to go open circuit. In reality, it will be under 100ms. Do some experiments with an oscilloscope to see how long it actually goes open circuit for.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 28, 2024, 07:35:48 pm
content: Quote from: 0xFFF0 on September 28, 2024, 12:50:46 pm?There is no law that says R5 has to be very low.Just think smarter and provide the minimum load current separately, then you only need focus on the bias current and select a part for that.Addit: Or just switch to a better/more modern regulator, that avoids this issue ?

author: Ian.M
author_rank: Super Contributor
timestamp: September 28, 2024, 08:36:28 pm
content: The right way to solve this is a make before break switch, or a more modern ground-referenced regulator, but if you *MUST* use a LM317 and a break before make switch, its fairly simple to use a NPN transistor to pull down ADJ so the output goes to near 1.25V if the switch is between contacts. The trick is to use a silicon small signal diode, cathode to the contact per fixed switch contact to pull down the base, with an extra diode in series with the base to compensate for the Vf of the active pulldown diode. See attached sim.N.B. It still needs *some* decoupling on ADJ to prevent overshoot returning to the set voltage when the transistor cuts off due to the LM317 limited control loop bandwidth.

author: Zero999
author_rank: Super Contributor
timestamp: September 28, 2024, 08:43:05 pm
content: That's clever, but we're overthinking this.The original poster has arranged the resistors incorrectly. Put them in series, so the switch shorts to 0V, that way the transistor method can be used to guard against open circuits.

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 29, 2024, 08:50:03 am
content: Have to admit, not bad.The variable setting still causes problems because the other resistors are in series.

author: magic
author_rank: Super Contributor
timestamp: September 29, 2024, 10:40:10 am
content: Hmm, maybe you guys are right. But in such case, if the switch is mechanical and doesn't need to be ground referenced, there is no need for any stinking transistor at all.editOr maybe there is a need, because ADJ bias current will increase output voltage at low settings. Zero999's circuit doesn't have this problem.But it seems to have a different problem, that when the switch goes open circuit, the NPN will instantly discharge the ADJ capacitor. Maybe it should work without a capacitor.

author: Ian.M
author_rank: Super Contributor
timestamp: September 29, 2024, 11:15:49 am
content: The problem is: the fixed resistor chain + multi-way switch can be treated as a potentiometer for the purpose of implementing open wiper (switch) protection, but when you also want a real potentiometer, you either have to settle for a limited output voltage range that cant pass any of the fixed voltages, or have to design some method to switch in the potentiometer and switch out the fixed resistor chain, and protect that switchover against open contacts. That's not so simple.The protection circuit I proposed above doesn't require a series resistor chain so its easy to have an independent trimmer for each set voltage and a variable resistor for the full variable voltage range. 1N4148 diode are only a few cents each @Mouser in 100 qty, and a 'jellybean' TO92 NPN is around ten cents, so no-compromise protection can be implemented for under one euro.If the discharge current of the Adj decoupling capacitor is a concern, simply increase R3 in my circuit - the resistor feeding the protection transistor base - so the transistor comes out of saturation before it exceeds its IC(max). If you want to eliminate the Adj decoupling capacitor (and forego the benefits of reduced output noise) but still avoid overshoot, you need to 'slug' the switching speed of the protection transistor bay adding Miller capacitance between its collector and base - 100pF should do the job for just about any jellybean TO92 or SOT23 NPN.

author: Zero999
author_rank: Super Contributor
timestamp: September 29, 2024, 04:58:32 pm
content: Quote from: 0xFFF0 on September 29, 2024, 08:50:03 amWhy didn't you mention it at the start of the thread?If you put the variable resistor in series with the upper resistor, the adjustment range will scale, with the setting, giving you finer adjustment at lower voltage settings, which is generally preferable.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 29, 2024, 05:43:30 pm
content: Quote from: 0xFFF0 on September 29, 2024, 08:50:03 amA variant of #25, would be to add a 900mV dropping resistor to the switch common, and connect to a setting resistor of BCR430 LED DRIVER. ( or an equivalent comparator and current sink AP4310/AP4320 etc ?)set the led driver to ‘match’ the regulator set current, and the droop effect on the bounce is greatly reduced.When the switch is open, BCR430 sinks current and when 900mV is present, the BCR430 drops to IqWith this change the new variable pot setting can go 2.1-24V+(fixed typo)

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 29, 2024, 06:56:38 pm
content: Quote from: Zero999 on September 29, 2024, 04:58:32 pmYes, it can be useful to have a fine +/- 10% type sweep about the fixed setpoint to check sensitivity.

author: Paul T
author_rank: Regular Contributor
timestamp: September 29, 2024, 09:30:16 pm
content: Hopefully a lot of current isn't planned. There is potentially a lot of headroom voltage which will turn into heat in this type of regulator.Edit: Example30V in & 3V out was mentioned in this thread. At 1A current, the regulator is shedding 27 Watts!As a reference, 1W is going to be the absolute limit for a TO-220 package without a heat sink. This is why buck converters exist."When a TO-220 package is used without a heatsink, the package acts as its own heatsink, and the heatsink-to-ambient thermal resistance in air for a TO-220 package is approximately 70 °C/W. "Meaning, at 1W the package in still air will get to almost 100 °C

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 30, 2024, 03:02:57 pm
content: In linear power supplies, heat is desired.

author: Andy Chee
author_rank: Super Contributor
timestamp: September 30, 2024, 03:18:17 pm
content: Quote from: 0xFFF0 on September 30, 2024, 03:02:57 pmIs that a mistranslation? Why would anyone desire heat??Yes, heat is inevitable in linear power supplies, but desired??

author: 0xFFF0
author_rank: Regular Contributor
timestamp: September 30, 2024, 03:28:21 pm
content: Europe is very cold compared to Australia.

author: tooki
author_rank: Super Contributor
timestamp: September 30, 2024, 09:28:23 pm
content: Quote from: 0xFFF0 on September 30, 2024, 03:02:57 pmNo, it is not.Quote from: 0xFFF0 on September 30, 2024, 03:28:21 pmYou can’t generalize like that. Europe does not have a single consistent climate. Helsinki and Athens have radically different climates. Other than doing it at opposite times of the year, the climates of Malta and Sydney are practically the same.But even in cold parts of Europe, during the winter, you wouldn’t want to waste electricity in a linear supply. You are smarter to heat using a heat pump (which is FAR more efficient than resistive heating) or using another fuel.

author: Zero999
author_rank: Super Contributor
timestamp: September 30, 2024, 09:52:50 pm
content: Many parts of Europe are warmer than parts of Australia.Europehttps://en.wikipedia.org/wiki/M%C3%A1laga?useskin=vector#Climatehttps://en.wikipedia.org/wiki/London?useskin=vector#ClimateAustraliahttps://en.wikipedia.org/wiki/Charlotte_Pass,_New_South_Wales?useskin=vector#Climatehttps://en.wikipedia.org/w/index.php?title=Liawenee&useskin=vector

author: youngda9
author_rank: Regular Contributor
timestamp: October 01, 2024, 11:31:24 am
content: Set it up so that the largest resistor value does not have a switch, it is static. The rest of the switches then place a resistor in parallel with the static resistor. This way the circuit is never open.

author: Ian.M
author_rank: Super Contributor
timestamp: October 01, 2024, 11:34:56 am
content: Quote from: youngda9 on October 01, 2024, 11:31:24 amThat still jumps, to the voltage set by the max. resistor. If e.g. that's 12V and you are switching between 5V and 3.3V for a logic circuit, and haven't disconnected the load, that's a problem.

author: Paul T
author_rank: Regular Contributor
timestamp: October 02, 2024, 09:42:00 am
content: If a noisy/wonky potentiometer is being used, or one that could jump track at the end of travel, the voltage jump could be present.In most applications, fixed resistors are used to set the general voltage range, and the potentiometer is only used to make small adjustments. Both ends of the variable resistor are in series with the circuit so no discontinuity ever occurs. Zener diodes that are a little above the highest voltage may be on across the output to prevent sudden jumps in voltage.If switching noise is not an issue, DC-DC converters, not DC-DC regulators, should be implemented if a wide range of voltages are needed and some current is expected. High temperature rise from the operation of voltage regulators will change their Vref, causing drift between power-on and running state.