Power supply design based off #224 eevblog - Page 1
Forum section: electronics / projects

author: Alex30
author_rank: Regular Contributor
timestamp: August 21, 2014, 02:27:28 pm
content: Hey all, first post so hopefully this is the right section.I was interested in building a power supply based off of Dave's basic design (before he added all that fancy micro controller stuff) as a basic current limiter and voltage adjust with a pot is all I need. I have tried to reproduce Dave's circuit sketch in LTspice (project attached) but I am having some problems as the output voltage and current is incorrect and I can't work out why. I'm a bit new to these techniques and the software, so either I have misinterpreted Dave's sketch or I have not used LTspice correctly.I had some success by using the standard default part with parameters set, instead of just typing in the desired capacitance or selecting generic opamp units. This means that some of my capacitance varies as I wasn't able to select a capacitor smaller than 1u.Any help here would really be appreciated as I feel like I have a decent understanding of how this circuit works but I can't reproduce it.Thanks

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: August 21, 2014, 02:46:16 pm
content: You can post the asc files if you zip them. This will make it easier for people to help.Your op amps seem to have the power rails connected reverse. Maybe that will fix it.Also IN5818?? you need a voltage ref.

author: Alex30
author_rank: Regular Contributor
timestamp: August 21, 2014, 02:53:54 pm
content: Ah, the weird way ltspice rotates and mirrors caught me out there, thanks. But it didn't seem to fix the problem. Uploaded the asc as you said.Thanks for your help this seems like a really good community, I will probably spend some time here.EDITOh yeah those resistors meant to represent the sliders are actually not set up in an equivalent way to the example, but I don't think that should matter?

author: Alex30
author_rank: Regular Contributor
timestamp: August 21, 2014, 04:09:17 pm
content: Quote from: HackedFridgeMagnet on August 21, 2014, 02:46:16 pmDave's schematic included a zener diode at that point, I assumed it was for voltage limiting so I just selected a high voltage so that it wouldn't affect my initial voltage adjustments. Do I really need a voltage ref? Can't I just sample the voltage at the output of the first opamp? If I do, how do I wire that one up considering the trim shown in the typical circuit does not exist in the same fashion with this circuit?

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: August 21, 2014, 11:48:28 pm
content: But IN5818 is a shottky diode not a zener.You want a 2.5 volt reference here, to enable a comparison between it and your output voltage. A Shottky will not breakdown to provide this voltage.I changed your sim a bit. Just to get it to sort of work, hope this helps.

author: Alex30
author_rank: Regular Contributor
timestamp: August 22, 2014, 09:29:57 am
content: Thanks a lot for that hacked fridge you sent me on the right track there. I managed to get it working perfectly and have modified it into a 12v 2a supply.Some of the things that I had wrong\needed to fix1. The LT1001 was a bad opamp to use and was giving anomalous results, I think it may be due to the 7V typical offset voltage2. The gain resistors on the voltage adjust opamp did not provide enough gain, ie 12k resulted in 1.2V gain, so this could be changed to about 50k for a 6V supply or 110k for a 12v supply3. I had my reference voltage all confused so thanks for fixing that for me4. A few resistors needed slight adjustment to odd values to compensate - I think having calibration pots on the board may be a great idea for this project5. My 20mA load was on the wrong way (doh!)6. Set minimum current limit at ~40mA to ensure minimum 20mA loading for the LT3080 (which reminds me the load needs to be 40mA now that there is two of the 3080's)Also I am still getting some odd behavior from setting my pots at different levels when I run the sim. For example I set my pot to deliver 12V, runs fine, then reset to deliver 1V, runs fine, then I set it to deliver 6V and the opamp refuses to deliver any power. I think its just a bug in the program as there is no logical reason why it wouldn't work.Anyway I have attached a screenshot and the project again for anyone who is interested. Please note though that most of the caps are wrong values as I couldnt find the right package in LTspice.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: August 22, 2014, 12:03:41 pm
content: Lol Alex30.It seems strange to me that you can deal with LTSpice which is not easy but are missing a few of the fundamentals of electronics.I dont mean to be disparaging either, keep trying, you will learn this stuff.QuoteYes some op amps have borked models in LTSpice but I would imagine the LT ones would be ok. But hey at least it is an opamp. LT1017 is not a useful replacement as it is a comparator and not an opamp.The difference between these two is not always that great.An opamp is meant to operate in it's linear region and has good linearity over it's operating range. So is used to accurately amplify differences.Whereas a comparator is meant operate as a switch, thus has very high gain but not as good linearity.In many places you can use one instead of the other, in many places you shouldn't.I am guessing U1 and U2 need to go back to opamps and you may get 6 volts.QuoteBetter read that datasheet again. That number is too high for an offset voltage.

author: Alex30
author_rank: Regular Contributor
timestamp: August 22, 2014, 12:57:05 pm
content: Mate, you got me. I am actually more into micro controller programming and have done a couple of projects where I've written code from the ground up for POV LED arrays and such, so the electronics side is definitely not my expertise, which is why I'm here! I am also quite new to using opamps and using ltspice (which I picked up yesterday) so I didn't notice they were comparators as they look the same, so cheers for pointing that out.I will keep you updated on how I go!EDITQuote from: HackedFridgeMagnet on August 22, 2014, 12:03:41 pmI actually want 12V

author: MrsR
author_rank: Regular Contributor
timestamp: August 22, 2014, 02:28:40 pm
content: Quote from: Alex30 on August 22, 2014, 12:57:05 pm

author: Alex30
author_rank: Regular Contributor
timestamp: August 22, 2014, 02:42:06 pm
content: Well that did the trick, it's really working well now in the sim - gonna start ordering parts soon. Attached is a few graphs that I produced (for testing purposes) by isolating the voltage set and current set from the feedback loop (by driving the voltage separately)The first two graphs shows a 6ohm load and the current limiter is turned from 0->full. The top graph shows the application of the current load and the resultant voltage changing to match the limit, the second one shows the current sense changing nicely as the current set is increased.The last two graphs show the current limiter set at 0.75V which translates to 1.5A (as it is doubled due to the 0.5ohm reference resistor) while the voltage set is turned from 0->full. The third graph shows the load power rising nicely and being chopped off at roughly the right point. The fourth graph shows the current sense rising as the power is increased and then being shunted through the current limiter @ roughly 0.75V.Unfortunately its a bit hard to simulate the current limiter kicking in under normal conditions as the sim just goes into an infinite feedback loop so you have to end the simulation manually (which is why it was better to isolate the voltage set and current set like I did for testing)Pretty happy with it, who says I can't do electronics(Thanks to Dave)Quote from: MrsR on August 22, 2014, 02:28:40 pmBecause including the MCU units is actually more complicated than just having pots, it's adding another framework onto it (for better accuracy) that I just don't need. Plus I wanted to set myself a goal of controlling the unit with analog only (except the displays). Thanks for the info anyway mate!