Hi, I've designed a constant current and constant voltage dummy load, I'm here to share.
The thing has thermal shut down using an LM35 on the heatsink, a comparator with a diode and some hysteresis, it should cut down at about 70ºC at the heatsink and go back up at about 50ºC. The PCB also has all the necessary pin headers for sensing the set and output values, leaving out the voltage reference and the pots, a set signal could be fed via the set pins.
Works as constant voltage at the set voltage till it hits the set current when it starts working in constant current, CV can be disabled by removing a jumper (also CC but you shouldn't do that). It uses an IRF540 and a 0.22Ω 2W sense resistor, with the values I selected should be good up to 2.5A CC and up to 30V CV, with the power limitations of the thermal management, haven't fully tested at high power but seems to behave at lower powers at least. Swapping a few resistors the ranges could be adjusted to your needs, the 0.22Ω resistor is quite low for low currents.
I run some simulations, I decided to go quite slow on the CV mode as it would minimize the current overshoot when fast voltage step is applied, hence the 10nF capacitor in the loop. If faster voltage control is desired it could be lowered one or two orders of magnitude but current overshoots will be higher, I should play a bit further with the loop compensation to get a faster response and with less overshoot, but as it is seems quite nice for the simplicity of the design.
Some low power, real world testing has been done, the circuit behaves as it should. I tested it over the same 9V battery it was running, directly in CC mode it started to oscillate pretty funny but that's probably due to the battery voltage going down as it was loaded. Then I added a 360Ω resistor in series between the battery and the input, CC and CV works as it should.
Scope capture, turning down the CV pot (I used log pots for better control in the lower range and because they were in the bin, couldn't find any 10k linear ones of as most of my projects are audio related, might be better for the voltage but I'm happy with the log for the current) Blue trace is the voltage, yellow is current, purple the current after a filter. CC was set to about 20mA (360Ω resistor with a fresh 9V would go up to 25mA)
I leave the schematic and a picture of the thing, now it has the ICs installed and the heatsink screwed and greased.
Hope you enjoyed it, regards!
JS