Just finished building, programming, and testing V3.
Here's some photos.
Lots of lessons learned with this project. The schematic does not represent the final design. The biggest change is changing the feedback to be at 1.1v maximum for current and voltage. This was done to use the internal 1.1v reference of the atmega328, instead of the 5v rail. Additionally, I switched from a mcp4802 8-bit DAC for voltage/current setting and moved to a 12 bit equivalent.
as you can see, with the 8 bit DAC I was getting some pretty horrible differential nonlinearity. After moving to the new DAC, I was also able to quantify some pretty horrible gain offset.
I was able to fix this using linear regression and applying a calibration.
Overall, the biggest lesson I learned was the use of connectors and secure mounting. In previous projects, I soldered everything point to point and hot-glued everything down. Needless to say this was not great. In this project, I used quick disconnected and connected the front board to the mainboard with an IDC connector and ribbon cable. This greatly aided troubleshooting and assembly. (there is however still hot glue... what can I say...)
I'm really stretching the limits of the ATMEGA328 with this project: two encoders, SPI LCD, floating point math.
Update time. I've been working on a V2 that fixes many issues with V1.
Big ticket items include:
better voltage and overcurrent feedback
discrete power stage
Firstly: digital control
I've realized how unfun it is to dial in the voltage with a multimeter, so i'm adding digital control. Nothing fancy, just a 16x2 LCD, two encoders, and an ATMEGA328. I'm having lots of fun teaching myself AVR.
Secondly, better voltage and current feedback
I've added a low pass filter to the feedback network to hopefully dampen oscillations. With the transistor pulling down the feedback network for overcurrent events, I could never get the stability I wanted. Instead, I moved to a differential amplifier. Don't know how it's more stable, but it works in SPICE.
Lastly: discrete power stage
Building a discrete power stage allows me to eliminate the negative supply rail needed to get below Vref on the LM350.
I've ordered parts and will post on the prototype soon. Enjoy a schematic.
I've done plenty of testing and thinking about the power supply, and now that I have an oscilloscope, I can finally verify the performance of my supply. Spoiler alert: it doesn't look good...
First, load testing: Here is the power supply outputting 12v at 1.2A through a 10R resistor:
Yea, that's 1v pk-pk ripple, not so good. Although I only specified a maximum voltage of 12v, it can actually go up to about 14. At this point, it looks even worse. The top waveform is the rectified and filtered mains voltage, and the bottom waveform is the output voltage into the same 10R resistor:
Note for next version: way more capacitance.
Here is the current limiting in action. The waveform on top is the base of the current limiting transistor in the feedback loop, and the waveform on bottom is the output voltage:
Yea, that's not so good. There appears to be some oscillation. I believe that a low pass filter in the feedback loop would mitigate this, but I'm pretty sure I'm also running into the slew rate of the LM324. It is specified at 0.5V/uS, and the rise time on the top waveform is about equal to that.
I don't believe this architecture will carry me very far. In simulating, I could never get the performance I wanted with the transistor current limiting. Additionally, using an integrated linear regulator is too much of a hassle, as it requires negative voltages to reach 0-1.25v. I believe moving to a discrete design would work better. I've already started work on a new and improved design that is digitally controlled. Removing the need for negative voltages is also necessary for this digital control, as I want the digital section to be isolated. Good luck finding a dual secondary winding 36v transformer with center tap!
Firstly, I added provisions for the supply to be controlled by a microcontroller. This can be done by depopulating some parts, cutting a jumper, and connecting it to the header. I've added all the necessary connections for good functionality.
Secondly, I have buffered the voltage reference. Although it wasn't under much load, it was becoming a problem. I had a spare opamp in the LM324 so it is not big deal.
Additionally, I've massively increased the input capacitance. I was having many problems with this and it took a while to nail down. About 600 uF seems to do the trick. Lastly, I changed around some component values to be more standard and more functional. The output voltage divider was giving me trouble, and I was only able to get 11.7V. I've designed it with some headroom to reach a maximum of 14.25v. I'm pretty proud of that part, I was able to get it down to 5 unique resistor values!
I have a list of features I'd want to add, but haven't for the time being. My big goal was to allow it to be supplied from a single +16v supply. As the negative rail has very little current draw, I was going to use a switched capacitance converter to create the -12v volts or so, but the only converters I can find have a maximum input voltage of +12v, when my +VCC rail is around 14. I also wanted to add some capacitors in the feedback loop or possibly a capacitance multiplier to the output. I have no way of doing transient or noise testing at the moment, so I'm going to hold off (I'm looking out for cheap scopes though).
I've been busy working on a working prototype of the bench power supply and have made great progress. I was having problems reaching full load due to an under specced transformer and poor capacitor bypassing. I've bumped up the transformer to 36v and increased the capacitance from 100uF to more like 600uF.
I still haven't been able to get full voltage and current out of the power supply, only 10v at 1A into a 10R load. I'm noticing a drop in the rectified voltage when under load, so I suspect that I just need more bypassing.
With that said, I think I'm going to work on making a PCB for this project. I want to incorporate a few changes, mainly regarding flexibility. I'd like to make the board capable of being powered off of a single +12V supply, which I might accomplish with a switched capacitance converter, as the negative supply does not need much current. I may also add a capacitance multiplier or some other noise reduction device to the output for lower noise. I don't have any way of measuring said noise, but I might be getting an oscilloscope soon.
I built a quick prototype, and it seems to be functional. I didn't have the right transformer, so I could not get the negative supply voltage. This meant that the output voltage could only be a minimum of 1.25v. I also didn't have a big enough load resistor to test it fully. Parts are in the mail for the final build.