Smart Bench Supply - uSupply Derivative - Critiques please! - Page 1
Forum section: electronics / projects

author: kcbanner
author_rank: Contributor
timestamp: December 11, 2016, 09:30:20 pm
content: Hi everyone! I'm new here but have been a long time eevblog follower. I've been working on a uSupply derivative, with some simplifications and changes that I have to (I think) a good state.I'm getting ready to start the layout and would love some critiques on this design.The overall design goals:Powered by 12-15V wall wartVariable output from 0V-10V (upper limit depending on input, but 10V max)0-1A current limitUSB for communication (logging values, PC control)User inputs:Power on/off cut switchCurrent limit encoder (push in for setting limit)Voltage output encoder (push in for setting limit)Output on/off pushbuttonZero pushbuttonReset (not on front panel, used for resetting into bootloader)The idea is to have limits for both voltage and current so you can't accidentally blow the thing connected it by bumping the knob.Interface:16x2 LCD for displaying statusLED indicating output power is on / bootloader stateI'm using the INA219 for precision current sensing at lower ranges, and LM334 for minimum load requirements on the LT3080. I'm feeding the buffered current output and voltage output (scaled to 0-1v, and 0-2v) to the AVR for ADC. Instead of a DAC I'm using the 16 bit timer PWM outputs through a two stage low pass filter. If I use a TOP value of 1599 in this timer, with the AVR running at 16Mhz, I believe I can achieve a 10kHz PWM with 10 bit resolution. I'm also feeding the output of those PWM DACs back into the AVR ADC in order for it to be able to self calibrate, depending on what exactly the 5v rail is at. The idea would be that when it boots up it performs a self calibration to figure out it's PWM DAC range and calibrate accordingly.I'm not using a pre-regulator before the LT3080 will this be a problem at lower output voltages? Will there be issues feeding a (filtered) 10khz PWM into the ADC? Are any of my above assumptions wrong?I would appreciate any feedback! Thanks!

author: Dave
author_rank: Super Contributor
timestamp: December 11, 2016, 10:23:56 pm
content: This thing will oscillate.

author: Dave
author_rank: Super Contributor
timestamp: December 11, 2016, 10:55:58 pm
content: Quote from: wilfred on December 11, 2016, 10:35:31 pmI intentionally dropped a vague hint to get OP to investigate it and find the problem himself/herself.There have been so many threads on this forum with the exact same problems over and over again, it really isn't that hard to scroll through a couple.

author: kcbanner
author_rank: Contributor
timestamp: December 12, 2016, 03:25:07 am
content: Quote from: Dave on December 11, 2016, 10:55:58 pmThanks for the hint. Dave mentioned in the videos the comparator might not be stable, hence the 22uF cap.I did some LTSpice simulations and got the following results (attached). Indeed there were some oscillations on the output (osc3 and osc3_close)! After removing the 22uF cap on the SET pin they were gone, but I noticed some start up oscilliation (osc4).This made me curious so I added a load that pulsed on/off with a 1ms period, 50% duty cycle...sure enough there were crazy oscillations as the 200mA current limit was tripped (osc5). Adding the 22uF cap back smooths it somewhat but it's still crazy (osc6).So it looks like I need to have a more linear solution to changing the set voltage instead of something purely on/off? Back to the drawing board!

author: ZeTeX
author_rank: Frequent Contributor
timestamp: December 12, 2016, 12:43:55 pm
content: Quote from: kcbanner on December 12, 2016, 03:25:07 amAt some point in designing power supply you will have to do stability analysis, which is the hardest and whats make a lab power supply actually a use-able lab power supply.the circuit you have posted has been posted a lot of times and some members pointed out the problems with that, generally speaking, you would scrap the circuit and start designing it from 0 without LT3080 or LM317 because they don't have many advantages over NPN series pass transistor and are harder to or impossibly to get stable fast current limiting.just google "EEVBLOG LAB POWER SUPPLY" and you will find many threads about designing lab power supply.Here is a simple 1A stable power supply:https://www.eevblog.com/forum/projects/general-purpose-power-supply-design-7488/

author: kcbanner
author_rank: Contributor
timestamp: December 12, 2016, 08:14:48 pm
content: Quote from: ZeTeX on December 12, 2016, 12:43:55 pmThanks for the response ZeTeX. The one part I'm a bit confused about is "actually a use-able lab power supply". I guess I'm failing to grasp in what applications this design fails. Let's say I'm using this supply to test a LED dimmer controller, and it's drawing between 100-200mA depending on the brightness level, with voltage set to say 6v. Now I see that if I had say set the current limit to 150mA, I'm going to get crazy oscillations when I cross over that limit. But for the sake of example let's say I set the limit to 400mA. Based on the simulations I've done (and I realize this may not reflect the actual circuit, I need to build this up and measure), but I don't see how this impacts things in a negative way? The load draws its's 100-200mA and the voltage stays at 6v with almost no ripple?I definitely have a huge blind spot on this stuff and want to learn more so I can understand and correct for it. I feel like I'm trying to design to solve a problem I don't fully appreciate.The thread you linked is a goldmine and I somehow missed it in my searches. The PWM stuff especially. Thanks for your patience, my expertise is on the software side, not analog.

author: ZeTeX
author_rank: Frequent Contributor
timestamp: December 12, 2016, 09:21:55 pm
content: Quote from: kcbanner on December 12, 2016, 08:14:48 pmYes, the CV will work good in this circuit, but the CC will be slow and unstable, so what's the point of the CC if it doesn't work good?if you only want CV then sure, go for LT3080 or something, it will work good, but trying to add CC to a built it regulator that you can't modify from the inside is problematic.

author: kcbanner
author_rank: Contributor
timestamp: December 12, 2016, 09:31:07 pm
content: Got it, thanks. Going to look into other solutions.

author: David Hess
author_rank: Super Contributor
timestamp: December 13, 2016, 12:30:05 am
content: My first "bench" power supply design used an instrumentation (difference) amplifier to sense the high side current and while I was able to make it stable through brute force frequency compensation, its constant current performance was pretty horrible compared to if I had used a simpler but more sophisticated design. Is that a contradiction?Take a look at how simple and how few stages the current and voltage control loops in old but fully documented power supplies like the Tektronix PS501 and PS503 and similar old HP power supplies have.Quote from: ZeTeX on December 12, 2016, 12:43:55 pmI have never had a problem using the LM317/LM337 as a protected power pass element and the LT3080 should be even better but agree that they compromise performance compared to fast power transistors; I do not think they are significantly worse than the commonly used slower transistors used in power supplies like the 2955/3055, MJ802/MJ4502, MJ15003/MJ15004, TIP series, etc. and the LT3080 might be somewhat better than them. It is too bad that protected integrated transistors like the LM395 never caught on.Using fast transistors like the D44/D45 series for a really high performance design presents its own challenges and for a bench power supply, I believe their capability is wasted; they make sense for a point of load regulator though. The same reasoning implies that the extra performance of the LT3080 over an LM317 is also wasted in a bench power supply.

author: analogNewbie
author_rank: Regular Contributor
timestamp: December 13, 2016, 01:59:53 am
content: Is it circuit gonna work when current limit value is quite small? The U6A( LM358 ) is not a Rail-to-rail input OPAMP.

author: StillTrying
author_rank: Super Contributor
timestamp: December 13, 2016, 03:33:29 pm
content: Quote from: analogNewbie on December 13, 2016, 01:59:53 amU6A won't work at any current level, with its +ve input up there, it's been mentioned before but keeps coming back!

author: David Hess
author_rank: Super Contributor
timestamp: December 13, 2016, 04:55:18 pm
content: Quote from: StillTrying on December 13, 2016, 03:33:29 pmAgreed, it is not going to work at all. It would not even work well with a rail-to-rail input and output operational amplifier.Move the current sensing to the *output* side of the pass element. Then the unregulated input voltage can be used as a bias supply for the current sense circuits.The instrumentation amplifier followed by current comparator followed by transistor gain element is still going to be a bitch to frequency compensate. On the Tektronix power supplies I mentioned, the level shifting is done on the current control signal so the current error amplifier follows the output voltage and there is only one stage instead of three stages within the control loop for trivial (none!) frequency compensation. Of course this does not allow current measurement without a separate circuit but even adding the separate circuit would be less complex than the design now.

author: brainwash
author_rank: Frequent Contributor
timestamp: December 14, 2016, 02:51:38 am
content: After trying my own hand at various design iterations with similar requirements I just shelled out the money for a KA3005P supply for 70E/80$.Here's why:- electrical design - if you are not an experienced designer you'll never get it right- space - sure, that devboard and shields and whatnot look small by themselves, but by the time you put them in a case you are taking up the same footprint- mess of wires - unless you spin your own board (time-consuming, several iterations) you'll have a web of jumper wires going everywhere. They also add up a lot of noise.- usb is already included- higher voltage/current capabilities and higher precision than what I can achieve for the cost- the flaws are already pretty well documentedThe only disadvantage is that you need to power it from mains voltage - i.e. cannot use car or LiPo batteries.While it sounds like a nice idea, programmable PSUs cannot be designed without very good knowledge of everything, and even then, cannot be made for the price, if you have to include all the bits that go into making a finished product (case, display, connectors, buttons, faceplate).I think the only sensible thing (except buying) is to design an add-on for an existing supply that does data logging and GPIB control. Even that is challenging enough.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 16, 2016, 09:59:07 am
content: With one of those cheap Chinese supplies there is still one thing to do: reduce the maximum ouput current to something like 50-70%: at full current these cheap supplies usually run way to hot and may blow up rather soon. A dead short is already bad, but worst case is usually current limit at a certain higher voltage (around 20 V), so it is just using the full transformer voltage.The second point is to have a look inside - to see if there are obvious safety flaws, like lose mains cables or low voltage cables close the the mains part without proper insulation. Some of those bad point are relatively easy to fix with a few cable ties.Building your own regulator is more difficult than it seems at first view, but it is still possible.

author: kcbanner
author_rank: Contributor
timestamp: December 16, 2016, 04:24:25 pm
content: Yea I've watched enough teardowns of those supplies to be a bit afraid of them safety wise, but in the short term that seems to be the way to go. I'm going to look at simpler designs and build something simpler as a learning project I think.

author: analogNewbie
author_rank: Regular Contributor
timestamp: December 18, 2016, 10:44:46 am
content: Quote from: StillTrying on December 13, 2016, 03:33:29 pmWhy it won't work at any current level? Is it gonna be ok if it's a RRIO OPAMP?Thanks

author: David Hess
author_rank: Super Contributor
timestamp: December 19, 2016, 12:25:57 am
content: Quote from: analogNewbie on December 18, 2016, 10:44:46 amThe input common mode and output voltage ranges of the LM358 do not include the positive supply; they are not even close.Even a rail-to-rail input and output operational amplifier will be marginal because its output voltage range only approaches the rails.

author: StillTrying
author_rank: Super Contributor
timestamp: December 19, 2016, 01:03:53 am
content: I think you'll always be better off using a high-side current sense IC.