Schematics, that's your first problem right there.. You should seriously first figure out how it works now. Then re-trace schematics of it and look up control chip. Se what that can do for you...
Designing good quality switching power supply with high amperage is difficult. Do you really need 0-40 Volts range? I do some electronics as hobby and so far have not had use for anything over 15 Volts.
Maybe you could keep this unit as is 50V/20amps and design add on unit you hook with cables that handles lower power functionality?
40 Volts at 10A is 400 Watts of power. Be extremely careful what ever you build. That sort of power can kill, cause fire's, make things explode, etc...