Author Topic: LM317 Voltage Jump  (Read 1655 times)

xavier60 and 1 Guest are viewing this topic.

Offline 0xFFF0Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
LM317 Voltage Jump
« on: September 28, 2024, 08:41:25 am »
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?
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1828
  • Country: au
Re: LM317 Voltage Jump
« Reply #1 on: September 28, 2024, 09:17:56 am »
If you switch R5 instead, the effect of the break is to drop to 1.2V
You may need a separate minimum load current sink, or a load resistor, if your circuit does not already give that.
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6676
  • Country: ro
Re: LM317 Voltage Jump
« Reply #2 on: September 28, 2024, 09:38:39 am »
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.
 
The following users thanked this post: tooki

Offline Roehrenonkel

  • Regular Contributor
  • *
  • Posts: 229
  • Country: de
Re: LM317 Voltage Jump
« Reply #3 on: September 28, 2024, 10:57:12 am »
Hi 0xFFF0,

just use a make-before-break rotary-switch.

Good luck
 
The following users thanked this post: tooki

Offline 0xFFF0Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
Re: LM317 Voltage Jump
« Reply #4 on: September 28, 2024, 12:50:46 pm »
If you switch R5 instead, the effect of the break is to drop to 1.2V
You may need a separate minimum load current sink, or a load resistor, if your circuit does not already give that.
R5 can not be switched because it is ~22 times smaller than the other resistors. The contact resistance of the switch leads to inaccuracies.
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 2058
  • Country: au
Re: LM317 Voltage Jump
« Reply #5 on: September 28, 2024, 12:50:52 pm »
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.
 
The following users thanked this post: tooki

Offline 0xFFF0Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
Re: LM317 Voltage Jump
« Reply #6 on: September 28, 2024, 12:53:28 pm »
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.
With 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.
 

Online Phil1977

  • Frequent Contributor
  • **
  • Posts: 683
  • Country: de
Re: LM317 Voltage Jump
« Reply #7 on: September 28, 2024, 12:54:09 pm »
 
The following users thanked this post: tooki, MK14

Offline 0xFFF0Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
Re: LM317 Voltage Jump
« Reply #8 on: September 28, 2024, 12:58:21 pm »
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.
If 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.
 

Offline 0xFFF0Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
Re: LM317 Voltage Jump
« Reply #9 on: September 28, 2024, 01:00:53 pm »
An elegant idea for a very similar problem:

https://www.edn.com/adjustable-regulator-trimmer-simple-failsafe-circuit/
I know these circuits. But you need a pot for that solution. Do you know a solution for switches?
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12551
  • Country: ch
Re: LM317 Voltage Jump
« Reply #10 on: September 28, 2024, 01:20:54 pm »
An elegant idea for a very similar problem:

https://www.edn.com/adjustable-regulator-trimmer-simple-failsafe-circuit/
I know these circuits. But you need a pot for that solution. Do you know a solution for switches?
Look 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?
 
The following users thanked this post: MK14

Online Andy Chee

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: au
Re: LM317 Voltage Jump
« Reply #11 on: September 28, 2024, 01:37:49 pm »
An elegant idea for a very similar problem:

https://www.edn.com/adjustable-regulator-trimmer-simple-failsafe-circuit/
I know these circuits. But you need a pot for that solution. Do you know a solution for switches?
 
The following users thanked this post: MK14, Phil1977

Offline 0xFFF0Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
Re: LM317 Voltage Jump
« Reply #12 on: September 28, 2024, 02:12:08 pm »
The circuit does not make sense. When switching, a float still occurs (Ua=Ui).
 

Online Phil1977

  • Frequent Contributor
  • **
  • Posts: 683
  • Country: de
Re: LM317 Voltage Jump
« Reply #13 on: September 28, 2024, 02:12:46 pm »
Are emitter and collector swapped in the sketched circuit?
 

Online Andy Chee

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: au
Re: LM317 Voltage Jump
« Reply #14 on: September 28, 2024, 02:31:29 pm »
The circuit does not make sense. When switching, a float still occurs (Ua=Ui).
You're right.

Change the transistor with PNP, and swap around collector and emitter.
 

Offline Roehrenonkel

  • Regular Contributor
  • *
  • Posts: 229
  • Country: de
Re: LM317 Voltage Jump
« Reply #15 on: September 28, 2024, 02:43:59 pm »
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/
 

Offline 0xFFF0Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
Re: LM317 Voltage Jump
« Reply #16 on: September 28, 2024, 02:51:50 pm »
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/

This is not a 100% solution. Contact problems can still lead to loss of contact. In this case, the sensitive connected circuit is defect.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12551
  • Country: ch
Re: LM317 Voltage Jump
« Reply #17 on: September 28, 2024, 03:10:25 pm »
This is not a 100% solution. Contact problems can still lead to loss of contact. In this case, the sensitive connected circuit is defect.
That 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.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12551
  • Country: ch
Re: LM317 Voltage Jump
« Reply #18 on: September 28, 2024, 03:18:17 pm »
The circuit does not make sense. When switching, a float still occurs (Ua=Ui).
FYI, 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 Ein and Eout are rarer still.)
 

Online magic

  • Super Contributor
  • ***
  • Posts: 7154
  • Country: pl
Re: LM317 Voltage Jump
« Reply #19 on: September 28, 2024, 03:53:06 pm »
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?
I don't know what problem you have, but any simple and reliable solution probably doesn't involve switching feedback resistors to LM317.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19888
  • Country: gb
  • 0999
Re: LM317 Voltage Jump
« Reply #20 on: September 28, 2024, 05:11:01 pm »
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.
With 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.
You'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/C

It 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.
 
The following users thanked this post: tooki

Offline 0xFFF0Topic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
Re: LM317 Voltage Jump
« Reply #21 on: September 28, 2024, 05:23:18 pm »
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.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19888
  • Country: gb
  • 0999
Re: LM317 Voltage Jump
« Reply #22 on: September 28, 2024, 05:44:44 pm »
But you can't put a 1000uF capacitor on the adjust pin. How is the LM317 supposed to regulate then?
What 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.pdf

Quote
And even if it works, you'll have a voltage doubling in 200ms. Your circuit is dead.
Where 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.
 
The following users thanked this post: tooki

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1828
  • Country: au
Re: LM317 Voltage Jump
« Reply #23 on: September 28, 2024, 07:35:48 pm »
R5 can not be switched because it is ~22 times smaller than the other resistors. The contact resistance of the switch leads to inaccuracies.
?
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 ?
« Last Edit: September 28, 2024, 07:47:37 pm by PCB.Wiz »
 
The following users thanked this post: tooki

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13045
Re: LM317 Voltage Jump
« Reply #24 on: September 28, 2024, 08:36:28 pm »
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.
« Last Edit: September 29, 2024, 09:20:53 am by Ian.M »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf