Nice, I didn't know the LM338 existed. For a solution with LM317 I'm thinking, how about a PNP power transistor turned on in parallel with an LM317 by a small resistor in the line between 40V and the LM317 with a drop of say 0.6V and above helping the transistor to take most of the current. But the LM338 is simpler and without checking I'm not sure if my idea works! As you say, the problem with this and any other linear power supply is getting rid of the lost power I x (Vin - Vout). Hence the benefit of switching supplies. Easy enough to design switching supplies with known input and output voltage, harder if the output voltage is required to vary over a wide range for a bench top power supply.You could use an LM338 which operates the same as an LM317 with a 1.2V-32V output range, but has a maximum current rating of 5A.
The main concern will be the size heat sink to handle its power dissipation.
It's better to let the regulator operate near its maximum so its safe area protection can also protect the external pass transistor.For a solution with LM317 I'm thinking, how about a PNP power transistor turned on in parallel with an LM317 by a small resistor in the line between 40V and the LM317 with a drop of say 0.6V and above helping the transistor to take most of the current.

The PNP wrap around transistor trick is a classic that has been used for a lot of years. It has been approved by experts and included in many trustworthy publications.It's better to let the regulator operate near its maximum so its safe area protection can also protect the external pass transistor.
From National Semiconductor:
View attachment 275267
True.The PNP wrap around transistor trick is a classic that has been used for a lot of years. It has been approved by experts and included in many trustworthy publications.


thank ypu for this, i really appreciate it, i will gather all the parts needed for the circuit, anyway, are those caps polarized? and what are they voltage ratings? i have also seen in the comments that adding a series diode in d1 and d2 will give more voltage? and that d3 doesnt need a resistor from 40v line?Hi muno,
This is what LTS shows with a 12V Zener from the +40Vs, the LM358 is powered from +28V.
[circuit includes also the last modifications posted, ie: 7k and 2k7 resistor changes]
Note the power dissipation in the TIP power transistor.
E
Added a 2nd image showing Node voltages, when set for 25V at 3A
May be helpful in debugging your built circuit.
View attachment 275307
hi muno..hi i will be using STPS20H100C as bridge rectifier, my transformer is 230VAC pri, 28-0-28 sec. it will be full wave centre tap.