Power supply design

Thread Starter

Sparky49

Joined Jul 16, 2011
833
Hmmm, I've just discovered something called a digital pot.

I suppose I could use this to control the voltage going to the ADJ of the regulator, and I could control it with the uC?
 

Pich

Joined Mar 11, 2008
119
Hi sparky49, I've joined a little late but I have just finished building a linear power supply with full uc interface, lots of work. It is an enjoyable project I could share all my frustrations with you if you like....
 

Thread Starter

Sparky49

Joined Jul 16, 2011
833
That would be great! :)

What would be even better is if you could post something on the Completed Projects Section - that way you'll have the satisfaction of showing off your project!

I put a project up, and it's a great feeling when you see it up. :)

Sparky
 

MrChips

Joined Oct 2, 2009
30,806
This would be great collaboration, someone who is just starting out with a trail blazer who has the bruises to prove it. This is much better than have the pros saying here is how I would do it but not actually do it.

BTW... Sparky, revealing your encounters along the MCU journey is another great idea.
 

Pich

Joined Mar 11, 2008
119
I have decided to post the power supply uC interface here because the software still needs work. I’ve just started learning C++ about a year ago and nowhere near up to speed.
The circuit itself is built and running in the power supply. All the basic functions of the power supply are being controlled by the uC except for the ADC, I’m having some problems programming it and therefore not finished and this is the reason I’m posting here and not the projects area.

Circuit description
U3A U4 and U17A provide the 2.5 and 5 volts reference for
Main supply voltage reference
Main supply Current reference
A second voltage reference for an axillary output
High speed over voltage protection
U17A selects between 2.5 and 5 volts controlled by uC. I selected the ADG452 analog switch instead of a 4066 for low on resistance which gives low source impedance to input to the DAC.
U1A is a high precision 16 bit 4 channel DAC, this IC is quite expensive and is not necessary if less accuracy is OK. There are cheaper DACs in the same family that cost less (direct replacement).
AD5064 uses SPI communication set up for write only. If going to 12 bit the program will need to be changed a little.
U13 is the heart of the circuit it is a 8 bit with 64k of flash. This flash size is about 2 times the amount the program needs but I don’t know how far the programming will take me so…way not.
The uC is programmed through the AVRIPS mkII USB interface.
U14 is for RS232 communications to other devices that is not implemented yet.
The voltage and current control is adjusted using encoders, J10 pin 4,6 for volts 8 and 10 for current and keypad J6
The keypad communicates to uC via I2C protocol with interrupt. With the driver installed it will support up to 3 4x4 keypads I’m using 2.
J8 LCD connector controls a 4x40 LCD screen. The driver sees the LCD as two separate units (2x40) therefore there are two separate enable lines E1 and E2. The driver installed can drive up to 7 LCD units, this is not a good idea it will slow the controller down to a crawl (at least with my programming).
J9 are all the input and output controls from the power supply, hopefully the description is self-explanatory.

PROGRAM
The program consists of driver that were downloaded off the net all shareware
Encoder count accumulator driver for voltage and current I have lost the originators name and is heavily modified, I hope he or she doesn’t mind.
LCD driver super versatile, again not mine but modified somewhat.
Keyboard driver by the same person modified somewhat
DAC SPI driver heavily modified
I put together the main program to connect all the function and control of the power supply
ADC driver…. Yes that….I have been working on it for a couple of months and only got as far as initializing the ADC when I try to run, it just hangs up. In order to display the voltage I have added two 4 1/2 digit LED displays, they complement the 16 bit resolution of the DAC.
There are lots of people out there that are much better at programming that I am so I will post it in Programmers corner and maybe someone can push me along. If age was a measure of programming skill a good programmer would be 50 years old andI am 1 year old. I hope it’s OK to have two treads on the same topic.
View attachment Power supply uC interface.pdf
 
Top