Simplified version of Bench power supply circuit from EEVBlog #221? - Page 1
Forum section: electronics / projects

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 16, 2014, 01:37:11 am
content: As a novice with cursory knowledge of adjustable linear voltage regulators, I watched Dave's blog #221 with much appreciation. If you haven't seen it, he goes through the steps of the design process of designing a current and voltage controlled bench power supply. In addition, he discusses driving the adjust pins with a microprocessor such as Arduino. I found the video intriguing. He starts out with a basic circuit found in almost every datasheet of like regulators. It then morphs into his own design, but retains the basic concept of two series sub-circuits, one for current control and one for voltage.Attached is the circuit lifted from the Onsemi datasheet for reference.Dave isn't specifically designing his circuit for MPU's exclusively, but I'm considering that approach for mine. What I'm wondering is if the first sub-circuit, the one for current control can be omitted completely? The use of a microprocessor means that we can use a voltage sense resistor on the output of the voltage circuit and monitor it with the MPU (determine. Then, adjust the pin accordingly to limit the current, programmatically. Seems much simpler and should use considerably less power (my design will be 10V, 3A). Do you see any problems with this approach?

author: dumle29
author_rank: Regular Contributor
timestamp: March 16, 2014, 02:29:00 am
content: Well you would still need some sort of sense amplifier chip, so the question is if that would be better than the current limiting chip?

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 16, 2014, 03:06:49 am
content: IIRC, Dave's design uses an op-amp for the current control circuit. So, if I had to use an op-amp to amplify the sense signal, it's kind of a lateral move there. Eliminating the extra voltage regulator would save about 6 watts of power, figuring 2V dropout at 3A. Op amp wouldn't require much power for a couple mA of output. I'm far from an expert. In fact, calling myself a novice might even be an overestimation of my ability. But, I don't see why it wouldn't work.

author: dumle29
author_rank: Regular Contributor
timestamp: March 16, 2014, 03:34:05 am
content: Well I would say we are about equal on our experience, but with different areas of focusI'm quite the novice too, tho I've recently been looking at PSU designs, mainly LiPo battery stuff, and solars.As for daves design, I haven't actually watched the video, I thought he just used two LM317's and the resistors for those. That obviously won't give you too much current, without big sinks, but yeah. Watching video now

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 16, 2014, 03:46:47 am
content: That video is a good watch. I enjoyed it. How clever.Your earlier comment about the sense amplifier... I don't really think you'd need to amplify it. Many, if not most of the Atmel MPU's have analog input capability. Reading the voltage should be fairly simple I would think. Current would be calculated based on the known resistance.

author: dumle29
author_rank: Regular Contributor
timestamp: March 16, 2014, 03:50:10 am
content: Yes you should amplify it, as the voltage over the resistor will be down in the noise of the regulator. you will want to use something like a 0.1 (or two in series) to have as little a power loss in the resistor. If you play your cards right, a 1206 1% resistor will be sufficient (low resistance, and maybe 2-4 ½w resistors in parallel, and you can afford 1-2w powerloss over the sense resistors, plenty of headroom, and keeps the effect of ppm/°C down).

author: electrodacus
author_rank: Super Contributor
timestamp: March 16, 2014, 03:58:55 am
content: Quote from: chipwitch on March 16, 2014, 01:37:11 amYou can not limit the current from software in the way you propose but you can use an op-amp instead of the linear regulator used for current limit.There is full of CC-CV DC-DC converters (not linear) on eBay that use one of those LM2596 or similar and an opamp for current limit.There is one similar not with LM2596 I will need to check what they use. I have one you can see on not my last video the one before on youtube (the 38min video about my BMS)That is just 10$ including shipping CC-CV and even has two 3 digit 7 segment LED display one for current and one for voltage.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 16, 2014, 05:00:03 am
content: Why can't you control the current output with the MPU? That's the question. The voltage regulator can be controlled by sending a signal of the appropriate voltage to the adjust pin. If current is to be limited to say 100 mA and the MPU is constantly reading voltage drop, if the current rises above 100mA, the MPU reduces voltage via the adjust pin kind of in the same way as an op-amp.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 16, 2014, 05:01:01 am
content: I can understand if speed is a problem...

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 16, 2014, 05:10:00 am
content: Thanks for suggesting the PS, but the whole point of making one is to learn. I doubt I'll ever be able to design something that can't be purchased for little money. But, if I just buy everything, I'll never learn anything. Reading will get me pretty far, but it won't build anything.

author: Rerouter
author_rank: Super Contributor
timestamp: March 16, 2014, 05:37:24 am
content: Here is a circuit for measuring current that i only found recently, The inputs only need to be rail to rail,change the 2.5V to any voltage and that becomes your zero point,

author: pickle9000
author_rank: Super Contributor
timestamp: March 16, 2014, 05:43:21 am
content: When you have a micro in a power supply it basically acts as a person adjusting knobs (for current and voltage) the actual regulation is handled by the circuit. The reason is simple a dedicated circuit can react much faster than a micro.The basic routine is to use a micro as a means of setting up the supply. Once the power output is on the then it acts a voltmeter / current meter and so on. Meanwhile the circuit that controls the regulation carries on doing its thing.

author: dumle29
author_rank: Regular Contributor
timestamp: March 16, 2014, 11:05:42 am
content: This thread has actually made me want to build a PSU of some sorts. Using a moteino could be pretty cool. I already have a rebrand of one of those cheap slim linears that Dave had a video on.As for your PSU, what I'd recommend would be a 15v PSU, 3A. So get a transformer with an 15v secondary, 12v secondary and 6v secondary, then use the mpu and some relays to switch the different tabs in. This will leave less volts to burn in the regs.

author: dumle29
author_rank: Regular Contributor
timestamp: March 16, 2014, 11:10:05 am
content: Those would be RMS voltages, therefore peak voltages would be higher, And so would the rectified DC voltages be.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 16, 2014, 12:15:24 pm
content: @pickle, I agree with you. There is a response time with a mpu where an op-amp is instant. Still, I wonder what the response time would be and would it be good enough. I think I'm going to set up an experiment to try. It would be interesting to see just how slow the response would be. A dedicated mpu for monitor/adjust would be necessary for optimal speed. So too would using interrupts and programming in assembler. If the program could be written in just a few lines of code, it might be fast enough. There are also affordable 32 bit MPU's that would be faster responders.Could some kind of "dampener" be used in the circuitry to slow down the current dv/dt to give the MPU more time to respond? A few ms would probably be sufficient.

author: dumle29
author_rank: Regular Contributor
timestamp: March 16, 2014, 12:57:28 pm
content: I cannot see why you want to have the mpu control the current? An opamp is cents, and never hangs.

author: dannyf
author_rank: Super Contributor
timestamp: March 16, 2014, 02:54:53 pm
content: In one of those threads, I proposed a mcu-based power CC/CV power supply. It can be fairly easily expanded as the regulator is a mosfet.The sensing is done via two opamps + two opamps to drive the output.It is fairly simple to build but the hardware side can be tricky - the opamps have floating supply to address issues with common mode voltage range.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 16, 2014, 05:35:13 pm
content: I started this thread because I wanted to know if what I proposed could be done and if not, why? If the goal of electronics was to find the cheapest, most efficient, most practical, would there be any reason for any of us to bother learning it as a hobby? I'll never EVER design or build a marketable circuit. I'd have to be a lunatic to think otherwise. If someone asks, "Hey will this work?" She isn't asking for suggestions on where she can buy something that will do the same thing, or how to use completely different methods to accomplish the task. Sometimes the whole point of doing a thing is just to see if it can be done. Why does the world need 12 cylinder engines or helicopters? Aren't there are far more efficient alternatives?There are dozens of ways to make a power supply. Infinite if you want to include every little detail. How boring the world would be if we all did things exactly the same. Arguably more efficient perhaps, but not where I'd imagine many people would want to live. Thank you for aiding me in my quest to learn electronics.I'm sorry. I just find it discouraging. I know you're all trying to help.

author: electrodacus
author_rank: Super Contributor
timestamp: March 16, 2014, 06:18:29 pm
content: Quote from: chipwitch on March 16, 2014, 05:35:13 pmMaybe you are referring at my proposal to buy one form eBay that was just so that you see how they made the design and eventualy experiment on that.This is a linear regulator that you try to use and doing a digital current limit will defeat the purpose of having a clean linear regulator.I will suggest looking at the SG1526 and see the app note search for "SG1526 digital current limiting"

author: dannyf
author_rank: Super Contributor
timestamp: March 16, 2014, 06:25:38 pm
content: I think everyone has the right to his or her own ways, however ineffective or inefficient. That should be respected, may not be recommended.in yor case, the idea of a sense resistor is only workable if the voltages are within the mcus adv input voltage range.one way to solve that is to re-reference the voltage to ground. Google high side current sense.a similar issue exists for controlling the output.so there are sound rationale why your approach isn't as widely used.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 16, 2014, 06:55:56 pm
content: electrodacus, I wasn't singling you out. It happens all the time, whether my threads or those of others. I appreciate your effort. I know you were trying to help. Heck, I even saw a post from our illustrious host (Dave Jones) where he voiced a similar complaint with regard to computers or something. Getting a hundred different opinions on this or that each one different. It's sort of the nature of the internet. Makes it no less discouraging though.Dannyf, if I understand what you're saying, by "high side" you mean on the input side of the voltage regulator. I was talking about the output side. As for the MCU's input voltage, it's irrelevant to the OP. If there is a voltage drop on a resistor, then that reading can be read. Whether amplified or derated, any of a number of methods could be employed in keeping that voltage within a range acceptable by the MCU. There is in effect a similar sense resistor in the circuit Dave proposed in his vblog #221.Dave already established the fact that an MCU can be used to adjust the output of the voltage regulator. My premise is that if we can determine the voltage of a known resistance on the output side of the regulator, then programmatically, that MCU could further adjust the VR to prevent the current from exceeding some limit. Current would simply be an overriding factor as it is in Dave's video, only programmatically so. Response time is the only thing I see that may be a problem... I'm guessing Dave's circuit has a response time in the useconds range. mseconds may be too ambitious for arduino and unacceptable to prevent overcurrent draw.

author: dumle29
author_rank: Regular Contributor
timestamp: March 17, 2014, 12:10:46 am
content: Okay so the reason I would never go for the µC controlling the current directly, is the followingA µC, having to be programmed, is prone to bugs, and is prone to hanging. This might mean no currentlimiting.A µC, although very very fast, is not as fast as analogA µC, won't give you an analog, linear output response, tho this points is rather moot, as you can get rather close, as for a smooth linear supply, I don't know what the difference would beSo I guess it should work, I don't think (I have never actually tried ti) that it would be a particularly good PSU, and It would have a lot higher risk factor under use.

author: uwezi
author_rank: Unknown
timestamp: March 17, 2014, 08:43:19 am
content: Thumbs up for all reasons given bydumle29.Chipwitch, did you hear Dave talk about noise all the time when designing this particular power supply? With a digital control you will always be bound by the least step size of your DAC or PWM and your ADC.Use 10 bit on a 1 A full scale current, then you get a step size of about 1 mA, but you will never be able to keep the current accurate to 1 mA in this setup with pure digital control.Use the same resolution and an analog regulator with low noise and offset, and there is no problem. There are things which are still better done analog than digital in 2014...

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 17, 2014, 12:31:17 pm
content: Yes, uwezi, I DID hear Dave.No one's arguing dumle29's points (though the one about programming bugs is a bit weak) or the fact that analog is better for this purpose. "Better" covers a very broad range. Noise will be inherent in lots of circuits. My atx-based bench top power supply has noise.The OP asks the question, "Is there any reason this won't work?" No reply has said, "no." While your points might be quite valid, it isn't a deterrent because no one has said it won't work or that the noise will be so sever that my neighbors will complain or my LM350 will explode. I wouldn't expectyouto try this.I'm still discovering.You say "noise." I'm still green and wonder what that means. I know how noise is defined and can recognize it on a scope,qualitatively. I lack aquantitativeunderstanding of it. How much is too much? How are components affected by it? How does one mitigate it? What is a decibel (not the definition of it)?While you think it a waste of time to even consider it, I see it as an opportunity to learn first hand.

author: electrodacus
author_rank: Super Contributor
timestamp: March 17, 2014, 04:53:42 pm
content: chipwitch is me againI just want to make sure you checked "SG1526 digital current limiting" the application note from Microsemi.They describe how you can do a digital current limiting and what are the benefits compared to analogue current limiting.You do not need to use their chip but you can learn quite a lot form their app note not the datasheet.

author: edavid
author_rank: Super Contributor
timestamp: March 17, 2014, 05:04:56 pm
content: Quote from: chipwitch on March 16, 2014, 01:37:11 amActually there are 2 different questions here:1. Is it possible to eliminate the current limiting regulator, and use a single pass device to control voltage and current? Absolutely, and that is how most bench power supplies work. You need a kind of analog AND gate to apply both voltage and current control to one device.2. Is it possible to use a digital current limiting loop? Yes, but it's usually not a good tradeoff for a bench supply. It doesn't save much, if anything, and it makes the current limiting behavior less predictable. (I should mention that if you use a regulator as the pass device, it provides backup current limiting, so this is not as much of a problem as with a transistor pass device.)

author: dannyf
author_rank: Super Contributor
timestamp: March 17, 2014, 05:31:12 pm
content: -You need a kind of analog AND gate to apply both voltage and current control to one device.-the circuit I proposed and the microsemi chip mentioned earlier use analog or (on active low signals).

author: electrodacus
author_rank: Super Contributor
timestamp: March 17, 2014, 06:24:06 pm
content: Quote from: dannyf on March 17, 2014, 05:31:12 pmThe microsemi chip uses a voltage comparator to check if current exceeded the set threshold you can see at page 12 the diagram and use a logic gate to to cut the pwm pulse going to the switch when that happen so current is controlled at each pulse.It also seems to provide a more linear current limiting performance than the analogue loop.The problem is that this can only be applied to Switch mode power supply not linear like the one OP mentioned but if he wants to use digital control for current limit there is no benefit in using a linear regulator.http://www.microsemi.com/document-portal/doc_download/129605-sg1526-digital-current-limiting-techniques-for-switching-power-supplies

author: electronics man
author_rank: Frequent Contributor
timestamp: March 17, 2014, 06:31:35 pm
content: avoid the current limit circuit dave did because when i made it it oscillated horribly. i dont know how dave got it working but it didnt work for me, although all the opamps were working properly and i followed the schematic properly.

author: uwezi
author_rank: Unknown
timestamp: March 17, 2014, 06:42:56 pm
content: Quote from: edavid on March 17, 2014, 05:04:56 pm...and the detailed answer to that is given in Dave's series on his lab power supply. If I remember it correctly from my Youtube marathon yesterday, it was already in Part 2!

author: uwezi
author_rank: Unknown
timestamp: March 17, 2014, 06:57:59 pm
content: Quote from: chipwitch on March 17, 2014, 12:31:17 pmI don't - and I suppose nobody else either - want to stop you from experimenting and learning-by-doing. I definitely want to encourage you to do so!But...If your goal is to build a lab power supply which will be useful to you and which you will be able to use many many years in the future, you might want to listen to the experience of us. After all, it was you asking the question here in the first place.Perhaps we are also not talking the same language here. When Dave (or me) talks about the current limit, then he means that you can use the power supply not only in a constant-voltage mode, but also with the same fine adjustment in a constant-current mode.Why?Consider a standard 5 mm LED. These are normally specified for a forward current of 20 mA. Now you want to test a couple of LEDs out of your project box. Adjust your power supply to a moderate voltage of 5 V, connect the first LED - puff, the gray smoke comes out, which normally makes the LED shine.Now take a constant-current capable lab power supply. Turn it to 5 Vand20 mA. Take your multimeter and measure the voltage: it will output 5 V. Now take the first LED, a blue one, connect it. The control loops in the power supply will instantaneously limit the current to 20 mA by at the same time reducing the voltage to 3.5 V. Take now a red LED and you will see that the voltage goes down to 1.2 V.Trying to do this regulation in a software loop will not be fast enough - I promise.I built my first lab power supply when I was 17, that's 27 years ago and after some reconstruction a couple of years ago, it still works and is my workhorse here at home. But I am planning to build a new one, which should then have digital (remote) control of voltage and current, two tracking channels (positive and negative), a third independent variable channel and fixed +5 V and +3.3 V.

author: dannyf
author_rank: Super Contributor
timestamp: March 17, 2014, 09:02:58 pm
content: Most of those CC/CV power supplies out there are really CV power supplies with adjustable current limits. True CC/CV supplies simply don't exist.When pushed to the current limits, they necessarily oscillate.

author: PeteJM
author_rank: Contributor
timestamp: March 17, 2014, 11:09:00 pm
content: A huge warning as you wont be able to get your full potential out of the LM350 at higher amperages (2+) with a voltage difference between input and output of more than 22V Roughly (interpolation of the datasheet). So for 3.3V at higher amperages, this circuit is useless above 1.5A. And you are going to need a ginormous heatsink as well. However, if you use a pre-regulating LM350 to drive the voltage down to 7V-10V above the output LM350, you will be golden for any amperage the LM350 can drive out.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 18, 2014, 04:17:55 am
content: Quote from: uwezi on March 17, 2014, 06:57:59 pmThat says it all.QuoteIt's not my goal, as I've said.QuoteNow THIS is something I can use. It's relevant to the OP. You're telling me that the circuit I propose will not do what Dave's does. Not just not do it as well, butNOT DO IT PERIOD.THIS is something I didn't know and is like learning of black holes or anti-matter for the first time. By what means is this accomplished? I mean, what allows one to seemingly break Ohm's law? If the output is 5V and the circuit consists of nothing but a 10 ohm resistor, how can the amperage remain at 20mA? You are telling me that if I measure the current through the resistor, it will measure 20mA (assuming that's where the current limiter is set), and the voltage drop will measure 5V, right? Please, explain.QuoteI do not doubt it.QuoteThat's wonderful. Maybe someday, I will do the same. Right now, I'm dissecting frogs, not trying to perform brain surgery on 3rd world children. While your experience and that of others here is all well and good... it's abundant on the internet. I read it. I take it in. I catalog it in my brain. It all has absolutely no relevance to the OP. But, it's still quite useful. I seriously doubt that you obtained your experience without a healthy dose of spinning your wheels on something that you knew was likely to go nowhere. I feel so unfortunate to not be gifted with the knowledge of electronics at birth. I say all this with all due respect to you and others offering their experience, and tongue in cheek. But (there's that word again), feeling inspired by one of Dave's videos ignited my awe and wonder, corny as that may sound. I'm not asking for anyone to share my enthusiasm. If I seem like a toddler who thinks if she flaps her arms hard enough, she can fly, well, maybe it's because that's where I am at on my journey into electronics. I'm not jumping off of buildings just yet. It's okay to tell me why it won't work. THAT's what I asked for. But, what harm is there in letting me flap my arms around the yard like a simpleton? My arms will soon tire and I'll learn first hand that I can't leap out of windows. I hope that imagery left you with a smile while simultaneously making my point. Perhaps, in a few short months you will see that I've grown tremendously. But, I ask you to have a modicum of patience with me... and understand why I push back is because I have been inspired. And inspiration is the best motivator I've found. Maybe it's just the medium, (text-based forum). Instead of being encouraged (which I did not request nor do I require), I feel very nearlyderided.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 18, 2014, 04:28:07 am
content: Pete, yes I know. I have read the datasheet. Actually, you can get even more than 3 amps out of it, under the right conditions. And it is sinked. If you read the OP, you'll see that a 22v differential isn't possible from a 10v PSU.

author: uwezi
author_rank: Unknown
timestamp: March 18, 2014, 10:10:30 am
content: Quote from: chipwitch on March 18, 2014, 04:17:55 amNo, it will not break Ohm's law. And it will not show or measure 5V anymore.If you look at a constant-voltage supply then you are adjusting the output voltage to 5V and ideally it will be able to maintain this voltage independent on what you connect to the output. The regulation loop inside does so by gradually opening or closing the pass-element, in Dave's example this is a power transistor inside the LT3080 and the regulation is done inside this chip.If you only have the low standby current which this particular chip requires, then the pass-transistor will be in a highly resistive state. This means that most of the primary supply voltage is dropped over the pass transistor. Let us assume you feed the circuit with +12 V then 7 V will drop over the pass-transistor leaving 5 V for your external load.Now you connect a 10 ohm resistor to the output. With nothing changed this will make the output voltage collapse. Let us assume the standby current was 1 mA then now with the same state of the pass-transistor the voltage will drop to around 10 mV. But long before that actually happens the feedback loop kicks in and notices that the voltage is dropping. It will react by setting the pass-transistor to allow more current to flow. Depending on the loop and the design and the output capacitance of the power supply this is a faster or slower process and results in the step-response which Dave is also looking at in his videos.Once stable again now the pass-transistor will allow for the 500 mA to flow through, which are needed for a voltage drop of 5 V over a 10 ohm resistor. Inside the LT3080 now the difference between the two input voltages on the "error amplifier" is zero (or close to zero) again.Disconnecting the 10 ohm resistor again, now the exact opposite happens, the voltage at the output would try to rise, but then automatically the pass-transistor is set to let again only the lower standby current pass.All the time you would have the same voltage setting, but the current which your power supply delivers changes.Now for a constant-current setting: here you have another knob which limits the maximum current which your supply is allowed to deliver to the load.Let's assume the same setup as before, but with the additional feature of a current limit of 100 mA. First we leave the output open, only internally delivering 1 mA of standby current. Then our feedback loop will regulate the output voltage to the allowed maximum value of 5 V. We have set it to 100 mA of current, but we also limit the maximum voltage it may present at its output.Now we connect the 10 ohm resistor. The feedback loop kicks in and opens the pass-transistor wider - but before reaching the previous setting where we would get 500 mA through our 10 ohm resistor the regulation is stopped when it reaches the current limit of 100 mA. The power supply will now maintain a constant current of 100 mA through our resistor and the voltage over the 10 ohm resistor would hence only be 1 V. On Dave's display you would see the setpoint or limiting value of 5 V and the actual value of 1 V and it would somehow tell you also that the power supply is in the constant current mode. In many commercial, non-computerized power supplies the actual limiting mode is indicated by two LEDs: CV and CC - for constant voltage and constant current.If you take a constant-voltage power supply, like most wall warts, these will also have a current limit by default. This is caused either by the physical limitation of the power supply (bad) or by some kind of limiting circuitry. Many of these power supplies will just either shut-off their output completely or give some uncontrolled combination of a voltage below the nominal voltage and a current below the maximum current - depending on the actual resistance attached to the output.

author: PeteJM
author_rank: Contributor
timestamp: March 18, 2014, 10:24:05 am
content: Quote from: chipwitch on March 18, 2014, 04:28:07 amWell that was a definite derp on my part, didnt read that it is a 10V 3A PSUSorry about that! Thought you were going to shoot for 30V for some reason

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 18, 2014, 11:45:41 am
content: Uwezi, that was thorough. I'mreallysorry for putting you through that. It was late when I read the post where you wrote:QuoteYour description is pretty much exactly how I understand it. The last part I don't remember reading. Maybe I dozed! You get kudos for such an excellent description. I first saw the current and voltage limiting circuit maybe a year or so ago, and remember having a hard time understanding it. It was a paradox to me. "Can't break Ohm's law," yet that's exactly what the circuitseemedbe doing. I finally figured it out, but I sure could have used your description, then.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 18, 2014, 11:51:39 am
content: Pete, lol... first time I've heard "derp." Not a South Park fan. (Looked it up. Thanks Urban Dictionary). No worries. As you can see from my previous post, I'm not reading everything either apparently.