It has been a while, but some progress has been made on my small mobile power supply. I have received the PCB and build both versions of the apparatus, one with the LM20323 and the other with the lm2596. Both versions function as expected actually.
The version with the LM20323 did not work, as it goes berserk when the current feedback kicks in, because it tries to compensate for what the chip thinks is an overvoltage problem. When it comes to voltage limiting capabilities it works very good, because it is much more efficient than the version with the LM2596, which above 2-2.5 amps gets quite hot.
The version with the LM2596 works quite well, although in current limiting mode there is some oscillation for the moment (I did not try to compensate for this yet). Furthermore it tends too make a high pitched noise in some load conditions. The voltage ripple is about 50mV and the current ripple 50mA. Which I think is still quite a lot, hopefully I will find some way to improve it.
So you can charge batteries with it, but it is not a laboratory supply (yet).
There were some minor errors, like the opamp apparently having two different versions, one with VDD and VSS reversed, of course I chose the most exotic of the two parts... Furthermore the Vusb detection pin was connected to a non 5V tolerant pin and started to supply 5V to the 3.3v rail via the PICs internal diodes, my bad.
So, now I need to start thinking about getting rid of the oscillations and order one of these babies, which will make it look way more badass. Let me know what you guys think of the design up till now.
On the computer control side of things. I first need to switch back to the C18 compiler instead of the XC8, too bad the USB stack does not work on the new compiler yet.
EDIT: Ok, I also found the solution to the oscillations and noise. The second coil added too much phase delay, thereby making the thing unstable. I removed the coil and now I only get 30mV of ripple while regulating a voltage and 50mV of ripple while current regulating :D