I have an unused pc atx psu. I want to make a bench power supply. The usual ebay breakouts give 3v 5v and +12v and -12v. Can I use an LM317 and make a variable output up to 24v? Any advice gratefully received.
Can I use an LM317 and make a variable output up to 24v?
No. The LM317 has a voltage drop of ~2V, so the maximum you will get is ~22 V.
A better solution would be to boost the +12 V to +26 V using eg. an XL6009 based module, then regulate down to the voltage you want with the LM317.
To reduce power dissipation in the LM317 at lower output voltages you could turn the booster output voltage down, eg. to 14 V when the LM317 is regulating down to 12 V, or 12 V (minimum possible booster output) when regulating down to 10 V and lower.
Maybe, depending on your needs.
The first problem is that since the -12V is very limited in current, typically few hundred milliamperes tops, it will be the limiting factor, even if there is tens of amperes of +12V available.
Second problem is that the power supply 0V is connected to mains input earth, so the outputs really are +12V and -12V, even if the total voltage is 24V. So it is not a floating 24V power supply. If use it to power up a 24V device, remember that the negative lead is still -12V, and thus cannot be connected to any other earth-referenced device. If you do, it will short the -12V output to 0V via mains earth wires.
And no, making the supply float by disconnecting mains earth or modifying the internals to have floating output can be dangerous, even if some people do it.
Third problem is that it is still an ATX supply with multiple outputs. They may not be that stable when loading only one of the positive outputs, and when the load is suddenly disconnected. The power supply output may rise high enough that it hits the overvoltage protection limit and shuts down. So since it is an ATX power supply, power must be drawn from it as per the ATX specifications mandate how it must be used, or it may not work properly.
Basically, getting a proper lab power supply is better than making a makeshift lab power supply from ATX power supply.