Hello, newbie electronic hobbyist there.
I've been trying to building DIY digital power supply for my electronic lab, and also for some learning experiences.
I aim 0 to 20V output, non-isolated dual channel with maximum total 5A, CC/CV.
For the first version i used STM32F103C8T6 for the MCU, a low-pass filter for the DAC that drives output transistor, a current shunt with TL084 for current sensing, and a 24V 6A power supply for the main supply.
The first version failed pretty miserably, with 24V single-supply, the current sensing TL084 did'nt work properly (i'm not even testing or simulating it beforehand, doh!). The MCU died several times because the amp might output more than 3.3V to the ADC. the MCU had some speed problem with the interrupt loop, i aimed for 50kHz loop but ended up getting 20kHz, but probably 20kHz loop might be better though, because higher frequency might introduce instability, oscillation and stuffs.
And then after that, i decided to use the raw output of the 0.1 ohm shunt resistor, and while i was still working the code, accidentally short circuit-ed the output also kill the MCU, so i added adc protection with two diode, but probably because my diode had pretty high reverse leakage current, it kind of messed up with the ADC reading, but meh i think it's better than getting my MCU fried everytime.
And for some reason sometime, turning on the supply might kill the MCU, so i added soft-starter with RC circuit mosfet and relay.
And at last, it does work but the power supply chassis is just full of mod wires and stuffs that added later on that i did'nt even think of, like MOSFET fan switches, buzzer driver because i didn't have active buzzer at a time and did'nt want to load MCU, the soft-starter relay, and other stuffs. I can't really measure the overall performance of the power supply like the noise or ripple, short circuit or current limit response time, oscillation, and stuffs because i don't have oscilloscope there, but i think it's baadd, sometime i can't power a laptop with this power supply, but for most of my other work it does just fine like powering mcu, testing electronics, charging batteries, i mean better than having no lab power supply at all
.
But because the inside chassis of my lab power supply is full of stuff that is dangling all around and really hard to clean, it recently killed the main power supply after just 4 month of operation because bare copper wire dropped and shorted something and killed my precious made in Japan 24V adaptor
.
So i decided to just rebuild everything from scratch. I plan to just order a pcb and had a proper connector for every component outside PCB so that no one get dangling and no more bare wire dropped incident.
This time i plan to use LM324 on current sense with +5V and -5V supply, the LTSpice simulation seems good and the output nicely clamp itself to around 3.5V at extreme current cases, so no more fried MCU, but i haven't tested it yet. the negative rail is generated by MC34063 by inverting the 7805 output. and apparently just using voltage divider at positive output will give inaccurate result because voltage drop of shunt resistor, so this time i plan to use differential amp LM324 (+-5V supply, so offset voltage did'nt interfere) with gain lower than 1 to feed the voltage sense ADC.
And remove 10nF cap on output of amp because i just read from STM32 ADC guide, C(ext) will just slow down the sampling. probably keeping STM32F1 as MCU.
I attached the first version of the schematic, because next version is full of mod hence no eagle schematic at all.
I decided to remove the dummy load functionality because it will just load the MCU more. it had a lot of revision on I/O of MCU, like the upside down TIP41C that drive buzzer and fan, added CC/CV LED indicator, changed 7805 to buck converter because it burns with 24V input, and more.
I will base the rebuild from previous build, so i want recommendation or critics on my design, or probably reference to other digital power supply design, mainly software or MCU, hardware is fine but here in my place it is pretty hard to get wide range of components, so i prefer really widely available component for every components, like MC34063, LM324, TL074, ATMega, STM32F1, AMS1117, 7805. Aside from that, i also have really limited budget, like 20$ only.
Thank you for the attention, i'm sorry if i had english error.