That's so simple ! it is enough you create PWM signal with your MCU and then use a float driver e.g IR2117 . and then a filter and then a feedback to your ADC !
Yes, this is my general idea, to use PWM signals to control voltage and current limit, and with ADC to read voltage and current and show them on display. I try something which I think out last night and it works, but I want to see schematics of working power supplies just to see if someone make better solution...
How much is your input voltage ? where it is coming from ? main power line ? or perhaps a transformer ?
I order transformer 220VAC/36VAC 200VA, I made calculation that in worst case I have 42V input voltage to stabilizer:
- worst LO case is that input main voltage is 200VAC, in that case I'll get 32.7VAC on secondary, which means that I have 46.3V after diode bridge in peak, when I reduce this by 1.4V (two diodes in bridge), and reduce by ~2V for voltage drops on filter capacitors (when current is 2A) I get a about 42V.
- worst HI case is that input main voltage is 240VAC, in that case I'll get 39.3VAC on secondary, which means that I have 55.5V after diode bridge in peak, when I reduce this by 1.4V (two diodes in bridge), and reduce by ~2V for voltage drops on filter capacitors (when current is 2A) I get a about 52V.
Here is schematic which I tried (with difference that Vref1 and Vref2 I made with trimmer 10kOhm, never used PWM on PIC before so this was faster for test):
Mr.Cube