“Lab” PSU design help - Page 1
Forum section: electronics / beginners

author: CountChocula
author_rank: Unknown
timestamp: September 19, 2022, 03:51:27 am
content: Hello—Absolute beginner here; I am trying to learn a bit about analog electronics by designing and wiring up a simple CC/CV power supply. My goal is for it to take a regulated 12VDC input and provide a variable 0-12V / 0-1A output.Using several reference circuits available online as a guide, I ended up designing the schematic below. I breadboarded it, and, somewhat to my surprise, itmostlyworks—I can set the voltage from 0 to ~11.95V, and the constant current limit works correctly between 0 and 1A as seen by R10.However, the load regulation is poor; for example, at 8V 1A, I see a drop of around 250mV, which seems excessive. I thought that perhaps there could be a problem with the input, but it stays at a solid 12V, so there is clearly something wrong with my circuit; just to be absolutely sure, I replaced R2 with a 5.1V zener reference, because I thought that perhaps a drop in VIN could skew the voltage set point, but that did nothing. I would be grateful for any suggestions!While I'm at it, I would also love some suggestions on how this circuit can be improved in general (or whether it evencanbe improved at all… most of the other circuits I've seen seem much more complex and go well over my head, so I suspect that I'm drastically underestimating the difficulty of the task at hand :-) ).For example, am I correct in assuming that the Q1/Q2 and Q4/Q5 darlingtons are superfluous? I wanted to be careful about not exceeding U1's 50mA output current (not the least because these TLC2272s cost $8 a pop!), but, if my calculations are correct, there should be no risk of that—even if either Q2 or Q5 were to drop all 12V across R7 or R8, they would be sinking ~60mA, and the worst-case beta of the 2N2222 is 30, which would mean that the circuit should never draw more than 4mA from the op amp).In any case, thanks in advance for any help. Cheers!

author: ledtester
author_rank: Super Contributor
timestamp: September 19, 2022, 05:58:21 am
content: Do you have a scope? The poor load regulation you're seeing might be an indication that your control loop and thus your output is oscillating. Such oscillations could be in the kilohertz and above range -- something a multimeter wouldn't pick up.Quoteoctopart.com is a convenient site for searching several major electronics distributors at one go. It looks like the SMD versions of this chip are significantly cheaper than the through-hole package. And with adapter boards you can get from ebay/aliexpress they can be made just as easy to use.SMD adapter boards:https://www.aliexpress.com/item/2251832772375001.html

author: magic
author_rank: Super Contributor
timestamp: September 19, 2022, 08:26:33 am
content: General remark: you don't need two power transistors in series, the two opamps could control one power transistor.General remark: I never built such a PSU, but others did and you should be able to find schematics somewhere on the forum or maybe somebody else could post links.It seems that you want rail to rail output. This is somewhat unique and it precludes a simple emitter follower output. It's very likely to be unstable without compensation because the output stage has voltage gain. Stability will depend on the value and ESR of the output capacitor - low resistive impedance provided by the capacitor reduces voltage gain of the common emitter output stage.Note that your current sense resistor reduced maximum output by 1V at full load.The datasheet says that your opamp can sustain output short circuit to either supply rail indefinitely.

author: strawberry
author_rank: Super Contributor
timestamp: September 19, 2022, 08:34:07 am
content: C5 small as possible (can destroy sensitive devices )temperature stable resistors in voltage/current sense and reference circuitsTL084 should be good enough down to couple mV levels (rail-rail OP amp wont go down to some mV anyway)differential amplifiers to rule out wire voltage drop (0.01ohm * 5A = 0.05V)zener stability is aprox -1..+10mV/K (depends on zener voltage and circuit design) compensated zener circuit less than ~0.1mV/K and LM399 1ppm/KTL431 with current source would get more stable (LM336 bit better bandgap reference ~20ppm)

author: magic
author_rank: Super Contributor
timestamp: September 19, 2022, 08:46:40 am
content: Output capacitance may destroy devices connected to the PSU by temporarily exceeding the preset current limit, but it is also essential to stabilizing LDOs, which OP apparently tries to build.

author: srb1954
author_rank: Super Contributor
timestamp: September 19, 2022, 09:12:08 am
content: Quote from: CountChocula on September 19, 2022, 03:51:27 amYou are going to need more than 12V I/P if you want the O/P to go up to 12V. Using an I/P voltage of 13.8V would be a good choice as there many power supplies available for this voltage. However, be aware you are getting close to the 16V maximum supply rating of the TLC2272.QuotePart of the problem is that you are taking the tap-off point for the O/P voltage at the bottom end of the current sense resistor. The circuitry is attempting to maintain the constant O/P voltage across the series connection of the output terminals and the current sense resistor. As the output current increases some of that constant voltage will be lost in the current sense resistor leaving less across the O/P terminals.The way around this is to move the current sense resistor closer to the input terminals and refer the bottom end of voltage control dividers R2/RV2 and R3/R4 to the negative O/P terminal. You will then definitely need to put a Zener diode across RV2 to ensure a stable reference voltage as you can no longer rely on the I/P voltage as a reference source.QuoteThe configuration of using a separate series pass transistor for current control and another for voltage control is unusual. More normally only a single series pass device is used and the controls for current and voltage are combined together to control this single device. This results in a more complex control circuit but is usually less expensive to manufacture and has the benefit of a lower drop-out voltage.The Darlingtons could be deleted and replaced by a single transistor. You could use a lower spec and cheaper op amp in this application as you don't really need the rail-to-rail inputs and outputs provided by the TLC2272.Lastly I would put a resistor, say 1k, between the base and emitter of each TIP42. This will bypass any leakage current from the transistors and ensure that they can be fully turned off when there is little or no load on the output of the power supply. Otherwise, you might find that the output voltage rises uncontrollably, particularly if it has been running at full load for while and the load is suddenly removed.

author: CountChocula
author_rank: Unknown
timestamp: September 19, 2022, 01:07:54 pm
content: Thank you all for the kind replies. I will try some of these suggestions out over the next few days and report back. Cheers!

author: xavier60
author_rank: Super Contributor
timestamp: September 20, 2022, 12:20:57 am
content: This is an example of the use of ORing diodes to allow the CV and CC loops to control one pass element,https://www.eevblog.com/forum/beginners/lm324-power-supply-with-variable-voltage-and-current/msg3582664/#msg3582664

author: CountChocula
author_rank: Unknown
timestamp: September 20, 2022, 03:58:51 am
content: Hello again! I managed to make things work in the end. As srb1954 suggested, the key was to move the current sense resistor at the input, and then reference everything else to it. It took me a while to understand what was going on, but I think I got there in the end, and I only released the magic smoke onceI also managed to eliminate one of the pass transistors as suggested, though I'm afraid that the circuit that xavier60 posted goes well above my head, so I don't know if, in the end, I landed on the same solution. I have added that schematic to my “dissection list”; I want to spend the time and redraw it to understand it better.I was able to swap in an LM358 for voltage control, but I could not, for the love of me, make it work as a differential amplifier for current regulation. For some reason, I would always get a ~0.65V offset on the output (suspiciously close to a diode drop, though I wouldn't understand the significance of that, tbh). I don't know if it is because I wired things incorrectly, or because of some other reason, but, once I substituted in a '2272, everything started working as expected. I will have to look more into this, I guess… right now, it doesn't make any sense (I got these from a reputable source, so I don't think there is anything wrong with them).In any case, these changes leave me with a well-behaved circuit. At 10V/1A draw (full scale with the 5.1V reference), I get a voltage drop of around 50mV, which represents a 0.5% error—I'll take it! There's a 100mV ripple, which is fine for my purposes and I think is caused primarily by the switched input line.One final question: am I correct in calculating that the sense resistor dissipates 1W per amp of current drawn by the circuit? Right now, I have 10 1/2W 10-ohm resistors wired in parallel, but they are getting mighty toasty :-)Thanks again for all the help—this has been a great learning experience. Updated schematic below; I welcome further suggestions and ideas for improvements. Cheers!

author: srb1954
author_rank: Super Contributor
timestamp: September 20, 2022, 07:29:23 am
content: Quote from: CountChocula on September 20, 2022, 03:58:51 amYou have also put the current sense resistor in the negative supply rail as long as the input supply is floating and doesn't share an output common with any other circuitry.QuoteThe reason why a 358 doesn't work in your circuit is that, unlike the TLC2272, its allowable input voltage range doesn't go all the way up to the positive supply. If either input exceeds Vcc - 1.5V the 358 is not guaranteed to function correctly. However, the 358 could be used as the current sense amplifier if the sense resistor was in the negative rail as the 358 operates correctly with its inputs all the way down to 0V and even a little below.QuoteThe 1sense resistor dissipates 1W at 1A output but the power dissipation varies as the square of the current, P=I2R, so at 2A output current the dissipation would be 4W. You could reduce the sense resistor value a little to reduce its power dissipation to a more acceptable level. The rest of the current sense circuit could be adjusted to compensate for the lower voltage across the sense resistor.You can expect the resistors to get toasty; normal film resistors typically have a surface temperature of 125-150C when operated at their rated power. A power wirewound resistor can be up to 250C when run at its rated power!You might want to modify the 358 circuit for the LED driver a little. With the configuration as shown it might not indicate reliably depending on the input offset voltage of the 358. By biasing the -ve input up to several hundred mV you will ensure that the TLC2272 can drive the 358 +ve input well above and below the comparison point and eliminate the uncertainty due to the input offset voltage.

author: magic
author_rank: Super Contributor
timestamp: September 20, 2022, 07:54:15 am
content: Quote from: srb1954 on September 20, 2022, 07:29:23 amOnly a little below and then the circuit's behavior becomes very poorly defined, with transistors saturating and base-collector junctions forward-biasing and stuff like that, the output may go to either rail and it's hard to guess which one without testing. I wouldn't even be surprised if the exact outcome varies from manufacturer to manufacturer or with temperature.Don't use LM358 with inputs below groundIf you want to use it here, connect the chip's power supply to the left of the current sense resistor.

author: Kleinstein
author_rank: Super Contributor
timestamp: September 20, 2022, 09:37:34 am
content: The power dissipation of the shunt is a tricky point and a principle problem: one wants enough resistance to also get a stable / low noise regulation also well below the full range. So making the resistor much smaller option is limited. A little smaller may work, if the amplifier directly following is a relatively good one. So it may be worth having something better than the LM358 there.For good accuracy one wants to operate the shunts well below there rated power. So 10 x 1/2 W is not yet overly large and when mounted close together the cooling is often reduced.As shown the compensation (BW limit) for the current limit is rather slow. Though not much room to saturation it will take quite some time until the current limit would react.The speed would also depend on the set current, as the resistance at the pot changes. So at least one should add a resistor in series with the wiper and chose a correspondingly smaller capacitor for the integrator.The current for the zener diode should come from before the shunt of cause.

author: CountChocula
author_rank: Unknown
timestamp: September 20, 2022, 11:50:56 am
content: Quote from: srb1954 on September 20, 2022, 07:29:23 amThank you again for your reply. I guess I didn't quite “get it” as much as I thought :-)Could you please help me understand this point better? I don't think I see how I have accidentally created a negative rail by placing the resistor where it is. Where do you think it should go? Maybe between D2 and R15, where it is unaffected by the current drawn by the zener reference and the bulk discharge resistor? (I meant this PSU to run from a floating supply, so maybe it doesn't matter, but I still would like to learn what you're trying to teach me here!)QuoteRight, but then we're back to the same problem with voltage sensing as before, correct? Or did you perhaps mean that I should have kept the current shunt where it was originally and connected the voltage sensing divider between the two output terminals?QuoteOuch—OK, well, at least I know my calculations were right. I think there's also a big airflow problem in the current configuration, as Kleinstein also suggests; the 10Ω resistors are bunched together on the breadboard due to space limitations and probably heat up even more as a result.QuoteThank you, that's a great suggestion. I was pretty iffy on this part of the circuit, but also too lazy to bias the non-inverting input; I should have just done that from the beginning.Cheers!

author: Kleinstein
author_rank: Super Contributor
timestamp: September 20, 2022, 01:19:41 pm
content: The comment about the shunt position was for the original circuit. In the first version the problem was not the position of the shunt, but the position of the negative side voltage sense.There are several possible positions for the shunt resistor, all with some downside:1) the shunt at the low side, as in the 1st. version of the regulator has the problem of getting voltage sensing right. A possible solution is to have the reference voltage also above the shunt and thus have the reference current also flowing through the shunt. This solution is used in some cases.2) the shunt directly at the positive supply, before the power transistor. This version has the problem of also including the base current for the power transistor. So the accuracy for the current is slightly limited. Another somewhat tricky part is getting the current signal down from the high side to the low side where the regulation is working relative to ground.3) the shunt directly at the positive side output. The difficutly here is that the shunts common mode voltage can move around quite a bit and this make the circuit prone to also react to common mode signal and it can get tricky to get a suitable common mode range for the amplifier. This is a somewhat tricky way, but it is done in some commercial supplies. The usual LM723 circuits current limit works this way, but this not made for precision, more like damage avoidance.

author: srb1954
author_rank: Super Contributor
timestamp: September 20, 2022, 07:47:29 pm
content: Quote from: CountChocula on September 20, 2022, 11:50:56 amYes, I didn't make it clear that the current sense resistor was to remain where it was in the negative output leg with the bottom of the voltage sensing divider to go to the top end of that resistor. The bottom end of the voltage reference chain would also have to go to the top end of the current sense resistor as well so that you are comparing the divided output voltage only against the reference voltage and not the reference voltage plus the voltage drop across the current sense resistor.

author: CountChocula
author_rank: Unknown
timestamp: September 21, 2022, 11:43:50 am
content: Quote from: srb1954 on September 20, 2022, 07:47:29 pmOK, understood. Thanks to you both—I'm away from home for a few days, but I will try implementing your suggestions and report when I'm back. Cheers!

author: CountChocula
author_rank: Unknown
timestamp: September 24, 2022, 04:06:03 am
content: Hello again! I had some time to work on this tonight and came up with the updated schematic below. I ended up moving the current-sensing resistor back to the low side of the output, and then referenced the voltage sensing divider across the output as discussed. This meant using a different zener for the current limiter, but it also got rid of one of the op amps, so I suppose that's good.It seems to work well enough, so maybe I'll try actually putting it on a PCB to see how it behaves once off the breadboard. Curious what everybody thinks… does this approach look reasonable?Thanks!

author: magic
author_rank: Super Contributor
timestamp: September 24, 2022, 06:46:51 am
content: You probably meant D4 to go to ground in parallel with RV2.You probably didn't mean to connect Q2/R4 with ISENSE.You haven't drawn U1 power supplies, be sure to connect it to ground and not ISENSE.Q4 can't turn on as drawn; if anything, put D2/R5 at its collector, not emitter.The ICONTROL circuit could be simplified further. For example, put the LED between R6 and Q1 and maybe add 1kΩ from Q1 base to ground to increase LED current. Then Q4 can be removed. Alternatively, if you increase R4 to force Q2 base voltage higher, U1B could steal R2 current away from Q2 base directly trough a diode (its inputs need to be swapped in such case). Then the LED with its resistor could be connected simply between U1B output and 12V.The 100nF compensation caps are a little heavy-handed, but OTOH regulation may go unstable if they are reduced too far. Currently the time constant is 10kΩ·100nF=1ms and I believe such will be the time to go from no output current to 63% of applied load when you suddenly apply load. Then another millisecond to cross 63% of the remaining 37% and so on. During that time, the output capacitor will discharge maybe a volt or two per amp of applied current. After removal of load current an output overshoot will occur, for the same but opposite reason.editSorry, it's 5kΩ·100nF and hence 0.5ms. So its twice faster and half the under/overshoot as I described.

author: Kleinstein
author_rank: Super Contributor
timestamp: September 24, 2022, 08:24:13 am
content: As the current redulation is also rather slow, it would be a good idea to have some kind of faster acting secondary current limit. This could be at the power transistor or the transistor before (e.g. limit the base voltage).The voltage regulation should work OK, though a bit slow.The cross over between CC and CV mode may still have some tricky points and not so ideal transients.3.3 V zener diodes are often not very stable. A TL431 ref chip with 2.5 V or a 5.1 or 5.6 V zener would be the more obvious choice.With the 5.1 V zener current also flowing through the current shunt, ripply from the input supply would be coupled to the measured current. It may be a good idea to add another layer of filtering / stabilization here. So split the resistor in 2 and have another zener (e.g. 10 V) and / or capacitor to ground to first.

author: CountChocula
author_rank: Unknown
timestamp: September 24, 2022, 12:59:55 pm
content: Quote from: magic on September 24, 2022, 06:46:51 amThank you! That was some really bad capture on my part. U1's power supply is shown as a separate unit at the bottom—that's just the way Kicad does it—but the rest were all mistakes. I'm not yet at the point where I can look at a diagram and intuitively grasp its intention (let alone its correctness), so I tend to make a lot of these.QuoteInteresting! Is the thinking here that, if I add a 1kΩ resistor from the base of Q1 to ground, I force U1B to supply more current in order to overcome it and effect the regulation, thus also increasing the voltage and providing enough Vf to turn on the LED?While I was mucking around last night, I noticed that there wasn't enough voltage between Q1 and R6 to turn the LED on, and so I just added another transistor, but this would be a much more elegant solution (and also very counterintuitive to me, so good learning experience).QuoteQuote from: KleinsteinThank you both for this—I picked 100nF because that's all I had on hand :-)I mostly play around with digital electronics, and so I tend not to have a large selection of passives in my stock. I'll drive by my local store and grab some soon; I did notice the transients, and figured that smaller values would be more appropriate for the compensation.QuoteYep, agree. Again, that's what I had in my drawers :-)I'll pick up some TL431s as well—I've been meaning to play around with it as well, as it seems like a very versatile chip.QuoteAh, very interesting; I hadn't thought about this at all. I'll give it a try. Thanks again!

author: CountChocula
author_rank: Unknown
timestamp: September 24, 2022, 08:42:04 pm
content: Quote from: CountChocula on September 24, 2022, 12:59:55 pmAnswering myself: Nope, that wasn't the thinkingI moved the LED around and added the 1k resistor to ground as suggested. Works a treat!I also procured some more caps and settled on 100pF for compensation, and 100uF as output bulk; this seems pretty stable with good transients and reasonable regulation.I also added buffered outputs for the voltage and current sense circuits, so that I can connect some kind of display, and external VSET/ISET inputs so that the circuit can be controlled externally (I would love to try using an MCU for that). I haven't dealt with improved voltage references yet… the store didn't carry TL431s, unfortunately, so I will have to mail-order them.New schematic attached; once more, I welcome a sanity check and all suggestions! I'd like to make a proper PCB out of this, even just to see the difference between it and breadboarding.A couple more questions if anyone can spare a few more thoughts:What additional protection circuits does it make sense to implement? Again, this is primarily a learning circuit, and so I'm curious to learn what other potential sources of disaster a professional would look for.I'm uncertain about the sizing of R6. My thought was that, in a worst-case scenario, it will have to drop all 12V of VCC to ground, which would dissipate 0.72W (so, even 1/2W is undersized, I suppose), but no matter what load I throw at the circuit, it hardly gets warm, which makes me wonder whether my assumptions are incorrect, I am not thinking about the right scenario, or both.Thanks!Edit: I should point out that, so far, I have only tested the PSU with purely resistive loads. I am a little hesitant to try something like a motor for fear that I haven't really thought through the consequences, but maybe I will give it a try. Worst case, it's just a couple cheap op amps

author: rstofer
author_rank: Super Contributor
timestamp: September 24, 2022, 09:17:25 pm
content: What happens to the poor TIP42 when it see maximum voltage drop and maximum current. Say the output is 1V at 1A and you actually have 12VDC input. The transistor is dropping 11V at 1A or 11 Watts. That may be ok with adequate heatsinking but without heatsinking, the transistor is only good for 2 W at 25 C ambient. With huge heatsinking, maybe the case temperature can be held to 25C and then the dissipation limit is 65W.https://www.onsemi.com/pdf/datasheet/tip42c-d.pdfIt is always the case that max current at lowest voltage creates the most heat for the poor transistor.

author: ledtester
author_rank: Super Contributor
timestamp: September 25, 2022, 06:12:12 pm
content: For an exploration of other design ideas, you might be interested in this video:Building a Lab Power Supply with a Discrete Linear Regulator -- The Post Apocalyptic Inventorhttps://youtu.be/_CFIovMkRygIt's more sophisticated, but the techniques are widely used in other designs.

author: CountChocula
author_rank: Unknown
timestamp: September 25, 2022, 07:27:47 pm
content: Quote from: rstofer on September 24, 2022, 09:17:25 pmWell, I suppose the answer to that is to either use a tracking pre-regulator to reduce the dissipation by making the supply always a little higher voltage than the desired output, or… use a big heatsink, which is what I am doing. I suppose you could even throw in active cooling if you prefer to keep things smaller, but all the “traditional” lab PSUs that I have ever seen typically sport some rather impressive chunks of metal to keep the pass transistors from melting into slagIt would be neat to add a pre-regulator to this circuit… I wonder how much harder it would be.Thanks!

author: CountChocula
author_rank: Unknown
timestamp: September 25, 2022, 07:28:31 pm
content: Quote from: ledtester on September 25, 2022, 06:12:12 pmThank you! Conveniently, I have to kill some time before a flight today, so I will check it out. Cheers!

author: magic
author_rank: Super Contributor
timestamp: September 25, 2022, 09:16:57 pm
content: A few remaining problems:R14 and R12 are (almost) parallel with R11. If you think that the output of the divider is half the output voltage, it's not. Furthermore, the error varies slightly with output current (ISENSE voltage). I think a clean solution is to connect R14 directly to the output and change the differential amplifier gain to 0.5x, i.e. R13=R14=20kΩ. Or use standard 22kΩ resistors for 0.45x gain.Also, you don't really need R9, one of the dividers could be reduced in resistance. C1 may need to be increased for stability.The second issue is that current regulation bandwidth is not well defined; C2 is C2, but output resistance of R2 wiper varies from 5kΩ (due to R7) down to zero. I wonder if the loop is stable and works correctly at very low current limits. Frankly, I would rearrange for U1B to directly steal current from Q2, then the inputs are swapped and it's trivial to add a fixed resistor between the inverting input and ISENSE.

author: CountChocula
author_rank: Unknown
timestamp: September 26, 2022, 11:23:18 am
content: Quote from: magic on September 25, 2022, 09:16:57 pmThank you, I see what you mean. I'll give that a try, but curious, as a learning opportunity: Would upping R12-15 to 100k also work in this case? That would make the divider network on the differential amplifier an order of magnitude larger than R11, and maybe have less impact on its operation, though I'm not sure how it would affect the operation of U2A.QuoteSo the idea here would be to, say, change R10 and R11 to 1k each, and give them double duty as a bleeder for C5?QuoteI think I understand what you're asking me to do, but I'm not 100% sure why; I think your point is that, because RV2 is in the feedback loop, it's harder to ensure that it will operate correctly and not oscillate out of control for the pot's entire range, and so if we flip the circuit around so that the pot is on the non-inverting input of U1B, that's no longer a problem and we end up with a more stable result. Is that right?Thanks again for all the input—I'm travelling for the next week, but I will try these modifications when I'm back home. In the meantime, I've gone ahead and ordered a PCB of my last design… it will be fun to see how it works once it's not on a breadboard. Cheers!

author: Kleinstein
author_rank: Super Contributor
timestamp: September 26, 2022, 03:53:19 pm
content: Increasing R12 and R14, so that the differential amplifier is not loading the FB divider so much is a good idea. The main loading effect is changing the gain, which would not be that bad, just a different adjustment range. However the load is toward the real ground. So the compensation of the drop on the shunt would not longer be full, so the regulation would be less good, with a part (e.g. some 1/4 with the 10 K resistors) of the shunt resistance added to the ouput resistance.Lower values for R10,R11 also help, but would need a larger capacitor for the compensation. A seprate R9 has the advanatge that the current does not flow through the shunt, and thus more accurate current measurement.The difference amplifier directly from the output is the more straight forward solution.There is no real need to buffer the current signal - the shunt is a low imedance sgnal to start with and normally not extra buffer needed.

author: CountChocula
author_rank: Unknown
timestamp: October 01, 2022, 12:27:01 am
content: Quote from: Kleinstein on September 26, 2022, 03:53:19 pmThanks! I knew about not needing to buffer the current signal, but I had an extra op amp on hand anyway

author: CountChocula
author_rank: Unknown
timestamp: October 01, 2022, 12:33:16 am
content: Back from my trip, and I've made a few of the changes suggested. I also received a shipment of TL431s while I was away, so I implemented the voltage references using them. Very neat parts, I love them!Things seem to work well; this time, I tried a variety of voltages and loads, and I don't see any major instability or oscillation. I'm having a bit of trouble getting consistent readings, though, and I think it's because the breadboard and jumper cables I'm using my be just too terrible… so I think I'm going to wait for the PCBs to arrive, which should be in a few days (I could also wire-wrap a prototype, but… meh, too much work).New schematic attached. I'm really warming up to the idea of adding a tracking pre-regulator like Dave did with his PSU; I think it might actually be fun to figure out how to set it up so that it's always a couple volts above the PSU's output. Maybe I'll see about getting my hands on a buck regulator to see if I can integrate it with the Frankenpower.Cheers!

author: xavier60
author_rank: Super Contributor
timestamp: October 01, 2022, 03:08:44 am
content: The setting of RV2 interacts with the frequency compensation of U2B.You could remove RV2 and then connect R9 between pin 6 and GND.RV2 can be placed across the U1 reference as RV1 is.A470K47K resistor from RV2's wiper to U2B's pin 6 should give a bit over 1A adjustment range.

author: xavier60
author_rank: Super Contributor
timestamp: October 01, 2022, 12:26:31 pm
content: C5 and D2 should connect to ISENSE. But this correction might reveal stability problems.ISENSE should have the "GND" label.

author: CountChocula
author_rank: Unknown
timestamp: October 01, 2022, 03:01:33 pm
content: Quote from: xavier60 on October 01, 2022, 03:08:44 amThank you! I think I see what you're suggesting, but could you please help me understand how this arrangement reduces the interference with U2B's frequency compensation? Is it because there is a smaller resistance swing than with the way I had it wired, where the wiper of RV2 could change all the way from 0 to 10kΩ?Also, I had set up a separate VREF for the current control circuit because the one used for voltage control is referenced to the high side of the sense resistors, rather than ground; my thought here was that, if I reused U1, VREF as seen by the op amp, which is referenced to GND, would change with the amount of current drawn by the load. Where is the flaw in my thinking? I'm still struggling a bit with how multiple references work—I'm used to there only being “one” groundThanks again, really appreciate the help!

author: xavier60
author_rank: Super Contributor
timestamp: October 01, 2022, 03:22:27 pm
content: Yes, the change that I suggested reduces the change in input resistance to U2B and also allows one reference to be needed for both CV and CC regulation.Things would make a bit more sense if the top of the ISENSE resistance is called GND especially for the CV function. The ISENSE signal now becomes negative with increasing current.

author: CountChocula
author_rank: Unknown
timestamp: October 02, 2022, 02:16:49 pm
content: Quote from: xavier60 on October 01, 2022, 03:22:27 pmUnderstood, thanks. I'll wire this up and see if I can make it work. Right now, I'm struggling to understand how I can make the op amp work if its negative rail is connected to the “new” GND—the current sensing voltage would then be negative, and I don't think the op amp would be able to deal with that because it is below its negative rail. I hope this will all become clear once I try it out in practice. Cheers!

author: xavier60
author_rank: Super Contributor
timestamp: October 02, 2022, 04:27:45 pm
content: Leave pin 4 of the opamps connected to the same place as they are now, the lower side of the ISENE resistors.Whenever U2B becomes active, its inputs will still be more positive than pin 4. R9 also connects to the lower side of the ISENSE resistors.The design I used in my bench supply operates in a similar way.

author: CountChocula
author_rank: Unknown
timestamp: October 03, 2022, 01:39:39 pm
content: Thank you! I will play around with this a bit and report back when I have some news (or when I hit the next brick wall, whichever comes first)

author: xavier60
author_rank: Super Contributor
timestamp: October 03, 2022, 10:38:33 pm
content: I think that 0.25Ω, 4 x 1Ω resistors would be more practical for the ISENSE resistance.

author: CountChocula
author_rank: Unknown
timestamp: October 04, 2022, 12:38:12 pm
content: Quote from: xavier60 on October 03, 2022, 10:38:33 pmWouldn't that make the circuit more susceptible to noise, though? With such low resistance, I wonder how stable things would be at low current limits, when the voltage drop of ISENSE would be in the low mV range. What do you think? Thanks!

author: xavier60
author_rank: Super Contributor
timestamp: October 04, 2022, 03:45:07 pm
content: Quote from: CountChocula on October 04, 2022, 12:38:12 pmIt will be fine. My bench supply uses 0.05Ω with no problems at low current settings.

author: CountChocula
author_rank: Unknown
timestamp: October 04, 2022, 10:23:50 pm
content: Understood. Looks like I will have to order some new parts. Terrible newsThanks!

author: xavier60
author_rank: Super Contributor
timestamp: October 04, 2022, 10:31:24 pm
content: Quote from: CountChocula on October 04, 2022, 10:23:50 pmI didn't realize your parts situation. You can just leave it the way it is and decide later.

author: CountChocula
author_rank: Unknown
timestamp: October 04, 2022, 10:41:58 pm
content: Quote from: xavier60 on October 04, 2022, 10:31:24 pmDon't worry, I'll take any excuse for a trip to Digikey… all kinds of other things tend to get magically added to my cart when I go looking for thingsJokes aside, I think it's good to try out something new; a few resistors won't break the bank. Cheers!

author: xavier60
author_rank: Super Contributor
timestamp: October 04, 2022, 10:55:54 pm
content: Do you have a collection of miscellaneous resistors for experimenting?The current range setting resistor will need to be increased to 180K.Q1 might need an Emitter degeneration resistor of approximately 47Ω.

author: CountChocula
author_rank: Unknown
timestamp: October 04, 2022, 11:18:32 pm
content: I do, thanks—I'm just short of anything either low resistance or high power… I just haven't really needed any of that stuff until now. Cheers!

author: CountChocula
author_rank: Unknown
timestamp: October 06, 2022, 01:52:02 am
content: By way of a quick update, while I wait for the new resistors (and a bit of time to work on a new schematic), the PCBs that I had ordered have arrived.These are based on Rev 5, which still had the zener-based references. No magic smoke, and, now that things are off of a breadboard, the regulation works remarkably well—around ±0.4% worst case scenario at 1A. Current regulation also seems to work pretty well, though I haven't yet had a chance to really dig into it.Unfortunately, there is still a crazy amount of ripple (about 185mV RMS), so I will try to play around with the size of the output cap.All in all, pretty happy with this—can't wait to try all the improvements. Cheers!Some pics below (the heatsink is obviously a temp—I will eventually get something beefier).

author: xavier60
author_rank: Super Contributor
timestamp: October 06, 2022, 05:14:37 am
content: That's oscillation due to design flaws or improper compensation.Is that happening in CV or CC mode? If CV mode, try replacing C1 with a 10K and 0.1uF in series.C5 should be grounded to the top of ISENSE. But correcting this could actually make things worse for now.

author: CountChocula
author_rank: Unknown
timestamp: October 07, 2022, 01:20:48 am
content: Thanks—I played with this a bit more tonight and, at first, I couldn't figure out what was going on. I tried your suggestion and a bunch of other RC combinations, but they seemed to have no effect on this oscillation.I then had the brilliant idea to poke around with the oscilloscope to see if I could figure out whether the problem was happening in places other than the obvious one and… long story short, after swapping out the upstream power supply and banging my head against the wall for a bit, I finally figured out that the problem was my dummy load, which has inexplicably decided to start misbehaving.Anyway, if I just use plain-old resistors as the load, the “ripple” is basically gone, both with my original 100pF cap and with your suggested 10n / 10kΩ RC network, though your suggestion results in better performance, so I'm keeping it in the next revision of the circuit. The image below is 1A at 8V, and I think it's pretty respectable.In other news, I have now procured two 0.5Ω, 50W resistors (as well as some other values, which is good since I needed them as the load!) from the local electronics store. They are comically large, but more than good enough to try your suggestion to use a smaller value for the current-sense resistor.More to come. Cheers!Edit: The dummy load is definitely broken—it oscillates at 500kHz even if I connect it directly to a known-good regulated power supply that I didn't design. Time to think about building a new one!Edit 2: Load fixed; it was a bad cap (of course… it'salwaysa bad cap).

author: CountChocula
author_rank: Unknown
timestamp: November 26, 2022, 08:36:38 pm
content: I thought I would provide an update on this project. I've had to travel a bunch for work in the last few weeks, but I'm finally back home for a few days and have had a chance to make some progress. Apologies in advance for the long post… lots of things have changedFirst, I ended up switching to a common collector topology using an NPN pass transistor. In the end, I've found it much easier to stabilize this type of circuit, and the additional Vbe drop cost is not a limiting factor for my needs. The circuit can now be powered with a much higher voltage (though at the cost of control precision), so no problems there.Second, I tried to make all the feedback loops ratiometrically controlled (I think that's the correct terminology). At the cost of a few trimmer pots, it's relatively easy to account for the inevitable variances in component specs, and use less expensive components like, for example, a cheap 0.1Ω 5% ceramic resistor.Finally, I added a switching preregulator to remove the total amount of power dissipated by the system. Especially low power/high voltage combinations, the pass transistor was getting unacceptably hot, to the point that I was unsure thatanyamount of heat sinking would have been enough to prevent it from burning out.Rather than rolling my own buck converter, I ended up buying a cheap LM2596-based module from Amazon (~$1 CAD each in a set of 10) and making a small mod to allow its output to be controlled by injecting an external voltage through a resistor into the existing feedback divider.Finally, I decided to use an MCU to control the circuit. I added in an inexpensive Arduino Mini Pro clone and added a few 12-bit AD/DA converters to give me reasonably accurate control over voltage and current limits (I didn't bother with the preregulator, choosing instead to use the ATMega328's internal ADC and a simple PWM control as a DAC, because I only need relatively rough control over its voltage). There is no UI yet—the plan is to eventually build a separate, galvanically isolated circuit, that can control multiple floating copies of the PSU and allow things like voltage and current tracking.With an MCU in the picture, I became worried about weird failure modes; for example, if the MCU crashes and the preregulator voltage control pin goes to 0V, the prereg will dump its maximum voltage and current into the pass transistor, regardless of what the output voltage is set to—something that doesn't sound very healthy. So, I added a line from the Arduino to LM2596's enable pin that is normally pulled high, which means that the preregulator is off unless positively turned on by the MCU. In case of failure, there is still current leaking from the base to the emitter, but this is limited by R202, which I think should be okay.I also added a Schottky diode between the preregulator's output and the pass transistor's collector to account for the possibility that the software will crash and somehow leave the preregulator at a lower voltage than the desired output voltage. This would lead to current leaking from the transistor into the output of the LM2596, which again doesn't sound like the best thing in the world.I breadboarded the circuit and it seems to work pretty well. Thanks to the preregulator, the pass transistor doesn't get hot at all—so much so that I think it might not even need a heatsink. The prereg gets warm, but even at 2A a small heatsink gets it below 50ºC. This is confirmed by the fact that, at 10V / 1A output (a convenient 10W), the input power draw is 11W, which implies around 90% efficiency. Line regulation is at around 0.1% and the ripple is below a level detectable with my (admittedly primitive and limited) setup and skills, though I guess we'll have to see what happens when I spin an actual PCB.New schematics attached below, alongside a picture of the circuit in all its breadboardy glory. Apologies that the schematic is on multiple sheets—this setup just helps me think better about things.This is easily the most complex circuit I've ever come up with, so thanks again for all your help getting me here. I'm sure there's still plenty suboptimal and/or wrong, so I welcome all suggestions as always!—CC