Mixed linear and switch-mode topology in a lab power supply? - Page 1
Forum section: electronics / projects

author: technix
author_rank: Super Contributor
timestamp: March 23, 2016, 02:27:17 pm
content: I am a little but frustrated at my bench power supply so I am still pondering on the idea of building my own. I have acquired most of the parts I think I would need (since my projects are budget-sensitive I have to make sure the parts are cheap enough before going ahead) so it is drawing board time.I am thinking about creating the lab power supply with an adjustable buck converter followed by an adjustable PMOS low drop-out linear regulator. This should give me a best-of-both-worlds design - by tracking the SMPS output slightly higher than system output + LDO dropout I can achieve a similar efficiency as the SMPS but the low output noise of the LDO.Is this a good idea? Don't worry about the controller chips, the 62.5kHz PWM output of the ATmega328P MCU is good enough for me to control the SMPS, and the TLC5615 DAC is good enough as the adjustable reference for the linear stage.Also, how to add the adjustable constant current stage, potentially without a separate pass transistor? (adding a relay is OK though.) Since the SMPS is already software defined is it a good idea to let the SMPS stage track the actual output voltage when it is in CC mode?

author: Warhawk
author_rank: Frequent Contributor
timestamp: March 23, 2016, 03:08:38 pm
content: My EX752M from TTi has this approach. A DC-DC converter and a linear post-regulator.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 23, 2016, 07:13:37 pm
content: Controlling the SMPS from the µC is rather difficult, and needs quite some software. Also the frequency is limited. I would prefer using a SMPS chip. Some, like MC33062 or UC3842 are really cheap.The combination of SMPS and linear is a viable way - though not that easy from the layout and usually not the absolute lowest noise. The usual way is to let the SMPS part regulate to something like 2-4 V higher than the actual output voltage in both CC amd CV mode.The TLC5615 is a rather low end DAC, so not really good performance (INL and noise) for a lab supply. PWM plus filter could get generally better performance for a supply.

author: macgeorge
author_rank: Newbie
timestamp: March 23, 2016, 08:25:41 pm
content: The Hameg 7042-4 also has the same approach. A switch mode DC-DC converter with high frequency transformer (most probably a forward converter), followed by a linear regulator.Theuser manualactually, includes a brief overview of this approach, showing its advantages, validating your remarks.

author: technix
author_rank: Super Contributor
timestamp: March 24, 2016, 04:58:42 pm
content: Quote from: Kleinstein on March 23, 2016, 07:13:37 pmControlling SMPS with a microcontroller is something I have done before, and I believe I can do it again. Also there are very few digitally-adjustable SMPS controller out there, which is why I am creating this. (In fact I have a "stock" firmware that turns an ATtiny25 into a I2C-adjustable SMPS controller.) Also the maximum PWM frequency attainable of the ATmega328P, 62.5kHz, is acceptable in my design. Also this means my controlling section consists of just three chips: the ATmega328P MCU which is also the SMPS controller, a Bluetooth 4.0 module as the iPhone interface, the TLC5615 DAC (I'm okay with the noise and INL of TLC5615 as those will get drowned out by the LM324 downstream.) and the LM324 quad op-amp (With a +35V supply for analog section to drive the IRF540 NMOS pass transistor even with the output voltage turned to the max of 20V I don't get many options for op amps.)

author: Kleinstein
author_rank: Super Contributor
timestamp: March 24, 2016, 07:54:30 pm
content: The choice for the linear supply part somewhat depends on the SMPS part used and the output voltages wanted. The unregulated voltage might be useful to power some of the regulator parts.For a low output voltage (e.g. less than about 25 V one could get away with the LM324 or similar OP and a FET as source follower. However a faster OPs might be desirable to get reasonable fast current limiting. The quite general floating regulator can get a way with the LM324 even for higher voltages, but usually requires an auxiliary supply, and the controlling µC usually powered from this - so generally a separate µC from the SMPS controller.Controlling the SMPS digitally is not an advantage but more of an extra difficulty. Usually a fixed difference to the actual output is wanted.

author: TimFox
author_rank: Super Contributor
timestamp: March 24, 2016, 08:17:53 pm
content: Be sure to check the specifications on the linear regulator that follows the SMPS. The ripple rejection falls at high frequencies, compared with 120 Hz.

author: Marco
author_rank: Super Contributor
timestamp: March 24, 2016, 09:44:27 pm
content: Quote from: technix on March 23, 2016, 02:27:17 pmI'd go fixed flyback for galvanic isolation, followed by adjustable buck, followed by semi-discrete NPN regulator (plenty of headroom, so no need for messing around with PNP or PMOS at all, with a Darlington you can simply connect the collector for the first NPN to the flyback output).QuoteIf you make your own semi-discrete regulator you do it like in almost every power supply, high side current monitor with an opamp control loop which overrides the regular control loop (diode combiner) to pull down the output voltage when current gets too high. With a NPN pass transistor you of course get a small inaccuracy in the current from limited and varying beta, use a n-MOSFET or normal Darlington (with collectors tied together, so Vbe+Vce drop out) instead if it bothers you.

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 12:30:05 pm
content: Quote from: Kleinstein on March 24, 2016, 07:54:30 pmI do want this fixed difference but how,if not using an digitally adjustable switcher? (I do have some LM2596-ADJ with me and a headroom of 1.25V is ideal for my LDO stage)

author: Kleinstein
author_rank: Super Contributor
timestamp: March 25, 2016, 01:22:14 pm
content: The setting of the extra headroom for the following linear regulator can be done analog as well. The typical way is a kind of difference amplifier that transfers the difference from output and input of the linear stage to the feedback of the SMPS part.Usually the difference is a little higher than 1.3 V, so allow for some dynamic reserve, so the SMPS does not have to react so fast. But the circuit can easily adjust for this, even toward a smaller difference if really wanted.The following link shows a DIY supply with SMPS preregulator. Post 245 shown an example on how the SMPS part might look like to get something like a 5 V headroom for the linear part.https://www.eevblog.com/forum/projects/diy-programmable-dual-channel-bench-psu-0-50v3a/225/?topicseen

author: dannyf
author_rank: Super Contributor
timestamp: March 25, 2016, 01:49:50 pm
content: 1. It can be done, as I have done that.2. It is easier said than done.The basic topology is to use a linear regulator after a smps, however, with the smps voltage output slightly higher the the desired output, and for the smps feedback pickup on the linear regulator output. Essentially the smps is a tracking regulator.The issue here is the compromise: for high efficiency, you want to run the smps at high frequency. For better ripple rejection, you want to run the smps at the lowest frequency.I think a better compromise us a typical regulator plus SCR whose conduction is controlled by the output voltage.

author: Kalvin
author_rank: Super Contributor
timestamp: March 25, 2016, 02:12:57 pm
content: Linear Technology has some low noise SMPS regulators. They are using controlled slew rate for the switching devices in order to reduce the switching noise.

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 03:04:26 pm
content: Quote from: Kalvin on March 25, 2016, 02:12:57 pmI have exactly three options for the SMPS controllers: LM2596, MC34063, and rolling my own using an MCU and external MOSFET. I don't have the budget to get those $10 chips, and have to stick to those really cheap stuff.

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 03:08:41 pm
content: Quote from: Kleinstein on March 25, 2016, 01:22:14 pmSince my op amp is LM324 and I have pegged the SMPS output at Vout+2.5V (using one of the four amps wired as a differential amplifier with a gain on 1, thanks to DIL resistor packs,) do I really need a regulated +35V rail? ( a boost using MC34063 directly from the unregulated input, which is about +33V, Schottky bridge rectified AC24V.)

author: BravoV
author_rank: Super Contributor
timestamp: March 25, 2016, 03:32:15 pm
content: Quote from: technix on March 24, 2016, 04:58:42 pmShow us and post the circuit, I am interested to see it.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 25, 2016, 04:12:30 pm
content: The MC34063 is likely not helping you very much - as it's of limited power and not well suited to drive a MOSFET. In this case a UC3842 or similar (usually also rather cheap, something like 40 cents here) might be a better choice. It is more suited to drive a MOSFET.There are several options both for the SMPS part and the linear part. Some need an auxiliary supply, some not.For the SMPS part you have:1) use a positive side buck converter (might need P-MOSFET) or bootstrapped poweror a LM2596 as monolithic version.2) use a negative side buck converter (can work with UC3842 and N_MOSFET or µC and N_MOSFET3) use a positive side boost converter (e.g. 12 V input) (maybe µC and NMOS)4) Flyback converter starting from mains - possible but difficult.For the linear part one could use a classical emiter-follower type regulator, especially at lower voltages. However current regulation might be slow. And the LM324 OP would be limited to about 28 volts. This would need an auxiliary supply of less than about 5 volts drop are wanted. In combination with a positive buck converter the raw input might be used here. For the current limiting there is still choice of high side or low side shunt - both have disadvantages. For fast acting current limiting you might want a faster (slew rate) OP than the 324. High side current regulation might need an extra supply too. NMOS output would need more auxiliary power or cause higher drop - so not very attractive.An not so good alternative might be a low drop regulator with PNP or P_MOS - here a negative auxiliary supply might be needed for low voltages. Might use unregulated power of negative buck for this.An other alternative would be a floating regulator, thus with a auxiliary supply (e.g. 5-10 V). This would not have direct limits on the voltage and could use either NPN (Darlington) or N-MOS Fet. The auxiliary supply could also power a µC to set voltage and current and display values, but simple pot and analog meter works as well.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 25, 2016, 04:15:29 pm
content: Quote from: technix on March 25, 2016, 03:04:26 pmCalling an MCU a "controller" sounds awfully suspicious to me...There's nothing on an AVR8 that can be used for proper, good quality, safe, stable SMPS control.More specifically, anything with active current feedback, with loop bandwidth comparable to the average switching frequency.Perhaps one could wire the analog comparator to a flip-flop, but the propagation delay is several microseconds. To be reasonably safe as a peak current mode controller, that would require an average operating frequency of perhaps 20kHz or less, worse than MC34063 (which is already far more horrible than anyone deserves).Average current mode control would require an external ADC, as the internal one is much too slow (~20kS/s). Even so, there's no time to do more than rudimentary DSP. A PID loop is all that's needed, but you can't expand it if needed.Anything else will be horribly hacky: for example, textbook voltage mode PWM with loop stability problems and no fault protection (or worse hacks to deal with it as a special case).In any case, it's no problem! You don't need controller chips to get good performance; you don't even need comparators and logic gates. This performs almost as well as a UC3842, does not exhibit chaos at high current levels, and contains about $0.50 of semiconductors:Tim

author: Kalvin
author_rank: Super Contributor
timestamp: March 25, 2016, 04:18:06 pm
content: Quote from: technix on March 25, 2016, 03:04:26 pmI understand. Just wanted to point out how to reduce the switching noise. The same principle should be applicable to other designs as well if you can control the switching device's slew rate.

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 04:20:18 pm
content: Quote from: BravoV on March 25, 2016, 03:32:15 pmOK. This is the circuit my ATtiny25 (shown as '85 here, which is pin- and binary-compatible) SMPS with I2C controls. The LM2596 is just supplying it (and the rest of the LV logic) their internal supply rail.

author: Kalvin
author_rank: Super Contributor
timestamp: March 25, 2016, 04:24:46 pm
content: Quote from: T3sl4co1l on March 25, 2016, 04:15:29 pmGood points. In this particular case the situation may not be that bad as the SMPS is used only as pre-regulator which is followed by linear post regulator. Should the control loop fail, there is still the linear regulator which will still regulate the output voltage and take the heat. The system should have temperature protection though, which will shutdown the power supply should the linear regulator get too hot.

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 04:29:50 pm
content: Quote from: T3sl4co1l on March 25, 2016, 04:15:29 pmYou have missed my point, as I am digitally controlling the SMPS here.You really need to read up some datasheet summaries. I usually use the ATtiny25/45/85 with a special firmware as theI2C-controlledSMPS. It can run at 16MHz with 250kHz PWM switching frequency, thanks to its internal system clock and high speed peripheral PLLs.

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 04:44:42 pm
content: Quote from: Kleinstein on March 25, 2016, 04:12:30 pmI don't really need much power on the +35V rail, as it is only used to power the LM324 and the gate of the pass transistor. I believe a maximum of 100mA is okay here. The remainder of the controlling circuit, including the built-in iPhone charger (the power supply have a very reduced native user interface and is largely controlled over Bluetooth Low Energy from an iPhone, hence the built-in charger,) is powered from a 5V rail with maximum drive capacity of 2.5A (so I can charge late-model iPhones and iPads at 2A.)

author: Kalvin
author_rank: Super Contributor
timestamp: March 25, 2016, 04:46:24 pm
content: You already have the solution. Take your MCU-based SMPS design and add the linear regulatorYou have few options to adjust the output voltage and the current limit, but I would make the design in analog way so that a potentiometer is used to adjust the output voltage. Make the design so that the the MCU can also read the potentimeter's voltage level, so that the MCU can set the SMPS's output voltage to the desired output voltage plus whatever voltage marging is required for proper operation of the linear regulator. This solution should still keep the output voltage regulated even if the MCU-based SMPS should fail whatever reason.

author: Marco
author_rank: Super Contributor
timestamp: March 25, 2016, 04:48:08 pm
content: Quote from: T3sl4co1l on March 25, 2016, 04:15:29 pmYou let the LM2596 go without comment, as far as I can see that's simply bang bang. An AVR8 can obviously handle that. You don't need 95% efficiency or absolute minimum ripple here ...

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 05:05:02 pm
content: Quote from: Kalvin on March 25, 2016, 04:46:24 pmI am revising the design with a largely analog main power chain, but I am still not using a pot (as I want to control it on my iPhone through an app and Bluetooth Low Energy.) The SMPS section is an LM2596-ADJ with some external op amp circuitry pegging its output at 2.5V above output voltage of the linear section (since I already have an LM324 there with a spare amp available.)Now I am having trouble about designing the analog section with both CV and CC capabilities, and feeding both the current sensing and voltage sensing signal into the MCU.

author: Kalvin
author_rank: Super Contributor
timestamp: March 25, 2016, 05:30:56 pm
content: LT1970A with two external power transistors would be a simple solution for the linear regulator with CV and CC functionality. The CV and CC can be set using analog voltage 0V - 5V (DACs or PWMs+RC-filters should be fine, too). The chip has status outputs, if needed. There might be similar devices available from other manufacturers, or you could take some ideas from the LT1970A and roll your own. Just add the MCU-based SMPS as a pre-regulator.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 25, 2016, 05:34:30 pm
content: The suggested µC based solution with P-MOSFET is a really bad one - switching is slow, so not good for higher frequency, but at least possibly low noise. But voltage is limited to what the gate can withstand, so likely no more than 20 V to be save. Still the µC is more expensive than a 34063 or UC38.. and not providing protection, e.g. during startup or short power drops in the grid. The SMPS part usually does not need the CC mode, current limiting is just for protection, mainly during startup.With low power there is also the option to leave out the switcher all together and just use two transformer taps.If you need to go µC for control and display, I would use the floating regulator. The old circuit from the repair section could give you a rough idea:https://www.eevblog.com/forum/repair/1983-oltronix-power-supply-died-despite-current-limiting/It already includes using two transformer taps, so with preregulator the second power transistor can be left out.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 25, 2016, 05:55:21 pm
content: Quote from: technix on March 25, 2016, 04:29:50 pmA very safe and reliable digital control method is, MCU + DAC + ADC, providing voltage reference to the analog circuit, and reading the operating point. It can be arbitrarily slow without risking any damage to itself or the load. (This includes any equivalent system, like an integrated controller IC with SPI/I2C inputs.)But you haven't talked about such a topology. So unless I'm missing something, my points still stand, whether you think to dismiss them or not.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 25, 2016, 06:00:04 pm
content: Quote from: Marco on March 25, 2016, 04:48:08 pmAbsence of comment is obviously not an endorsement.Its diagram seems to suggest current mode behavior, but it's vague enough to fit into much the same category as 34063. In any case, its error amp voltage gain is pitiful, so the regulation is awful (several percent over load range). With correctly sized parts, it should at least be reasonable in parts cost and electrical noise... unlike the 34063, which saves a few cents on the controller while spending several dollars extra in the massive choke and capacitors required to filter the slow, noisy bastard.Neither is setting any records on efficiency, being bipolar.QuoteProvide a reference design (including schematic and at least a code flowchart) and we'll see.Tim

author: Marco
author_rank: Super Contributor
timestamp: March 25, 2016, 07:00:20 pm
content: Quote from: T3sl4co1l on March 25, 2016, 06:00:04 pmOops, missed the active capacitor. Current only figures into a fixed limit though, so voltage mode.

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 07:05:43 pm
content: The analog section. Mostly autonomous, but takes a few inputs from the digital section:VSET: (Analog-IN) output voltage settingISET: (Analog-IN) output current settingEN: (LVCMOS-IN) output enableAnd the analog section have a few outputs:VSEN: (Analog-OUT) output voltage sense, 2.5V FSISEN: (Analog-OUT) output current sense, 5V FSCV: (TTL-OC) constant voltage mode

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 07:09:36 pm
content: Quote from: T3sl4co1l on March 25, 2016, 05:55:21 pmThe on-chip ADC is already good enough for me, and for MCU-as-SMPS-controller why do I need a DAC again since I already have on-chip PWM controllers?

author: Kleinstein
author_rank: Super Contributor
timestamp: March 25, 2016, 07:34:46 pm
content: The µC only makes a marginal SMPS controller. So I see not real advantage a µC here, as dedicated SMPS controllers are cheaper, better (current limiting, more reliable, can have internal gate drivers) - and it will be hard to use a single µc for a buck converter and to control the linear part, as the MOSFET is relative to the input side.The suggested linear part looks rather poor. Switching from CC to CV mode does not work with a relais. Current sense is poor accuracy or would need expensive resistors (e.g. 0.01%). Several of the slow OPs in the path would result a rather slow operation, especially for CC mode. No protection of the MOSFET against to much gate voltage. It also uses quite a lot of parts.Especially if a MOS-FET is planed as a power device, I would strongly suggest a floating regulator, as this makes gate drive and protection easier. The main disadvantage is the need for an isolated supply of maybe 10 V. So a flyback (or royer) instead of the boost converter.Between SMPS part and linear part there should be an extra LC filter. Feedback for the SMPS should also include a fast component directly from the output of the SMPS - the LM2596 might need to sense the ripple.

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 07:50:28 pm
content: Quote from: Kleinstein on March 25, 2016, 07:34:46 pmThe MCU is gone. I am now trying to track the LM2596 against the output.Quote from: Kleinstein on March 25, 2016, 07:34:46 pmFloating regulator have some issues for me (e.g.how to get the multitude of controlling SPI lines in there without using expensive isolator chips?) And those current sense chips cost way more than a few precision resistors. Also the 35V supply voltage is a barrier for OP selection. The analog section is just two chips (and a bunch of resistors.) If I used something else (e.g. two diodes) then how to construct the circuitry?Quote from: Kleinstein on March 25, 2016, 07:34:46 pmHow? I am currently tasking the linear stage to thin out the output ripple.

author: technix
author_rank: Super Contributor
timestamp: March 25, 2016, 08:17:57 pm
content: Quote from: Kleinstein on March 25, 2016, 07:34:46 pmDo you mean something like this to switch between CC and CV? Also I have added a Zener clamp at 13V between G and S of the MOSFET. The leftover comparator is used to construct an emergency shutdown feature that shuts down the main switch regulator when the common heatsink got too hot (the 5V and 12V are still working as the MCU and the fan still depend on them.)

author: dannyf
author_rank: Super Contributor
timestamp: March 26, 2016, 01:54:31 am
content: this actually reminds me: I did a series of exeriment a few years back - documented here as well - where I tried a few different ways to use a smps as a tracking pre-regulator in front of a linear regulator. I think I used a mosfet, an optocoupler, and then settled on a led+photoresistor, with very good results.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 26, 2016, 09:37:43 am
content: Bahah, wow, relay in a control loop. If you build this, please send one to Dave, he'll get a kick out of it.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 26, 2016, 09:57:29 am
content: Quote from: technix on March 25, 2016, 07:09:36 pmGood enough based on what criteria? That it works to a few percent error and at DC? That's missing a lot of bandwidth, meanwhile the transistor's grunting away every microsecond.With a digital control, you wouldn't need a DAC, because the error amp would take a digital input already. Or, in effect, the amp's fake-analog input (meaning, it takes an integer, which approximates what would've been a continuous quantity, if the same system were built with analog parts), is just another number in memory, so the act of simply pushing a number into it forms the DAC.(Thinking in terms of standard blocks, like registers and DACs and amps, isn't made useless just because the whole system is pulled into the digital domain. The semantics are still present, even if every signal is now just words in memory.)My point is, I suspect your system isn't fast enough to do its job safely. It'll work, in a similar sense that a LM2596 or MC34063 will make DC, but it won't be capable of responding to sufficiently fast changes in its outer environment (like an input voltage surge, or a faulted (open or shorted) load), and won't be optimally fast for the component values used (necessitating much larger component values than would otherwise be necessary, further driving up cost and size).And if it does, in fact, fit neatly into all of these constraints, it would be much more interesting because, not only is it then a good control system, but it's pushing the limits of what such meager hardware is capable of: probably a rather unimpressive "demo", but a "demo" nonetheless, and demos are cool bits of software!Tim

author: Kleinstein
author_rank: Super Contributor
timestamp: March 26, 2016, 11:18:16 am
content: The current sense part is not working well - there is just two much voltage signal mixed with the small voltage at the shunt. So one would need something like a instrumentation amplifier or much better resistors and OP. At the very least the shunt should be considerable larger - this also helps to stabilize to voltage regulation.Combining current and voltage regulation looks much better now. However due to the low slew rate of the 324, it takes quite some time for the current limiting to engage. Also the still missing compensation circuit might give a delay (even if a faster OP is used). So this type of circuit should have at least a kind of second layer of fast current limiting.The filter between SMPS and linear part is in principle OK, but the inductor and cap should be way smaller. More like 470 µF-1mF at the SMPS and than more like 10 µH - 100 µF+1µF for the filter. The main purpose of the filter is to suppress the the higher Frequencies, e.g. from switch / diode ringing, not so much the main switcher frequency.The zener clamp at the gate should also prevent to negative a gate voltage - this is even the more likely case to happen, e.g. turn down set voltage faster than the output cap can discharge.

author: Radiohead
author_rank: Contributor
timestamp: March 26, 2016, 11:20:28 am
content: Hello Technix,Look at designs from HP, Agilent, keysight, Delta and others as they've made Bench Power supplies with SMPS Pre-regulators as well. You can learn a lot from their designs. For example: the Hameg HM7042. Search for the service manual for the schematics and analyse them.Some comments on your current design:Mosfets might have lower voltage drop compared to a BJT transistor, but the use of an BJT instead of an Mosfet is much better for linear operation. The specified IRF540 Mosfet is not a true linear mode mosfet as those from IXYS and could develop hotspots. In the Hameg HM7042 a TIP147 (PNP TO-247) is used. Since the SMPS pre-regulator isn’t so fast, using a larger package instead of a TO-220 is preferable. During short-circuits or transients, the pass-device needs to dissipate a lot of heat. The TO-247 will have a much higher maximum power dissipation compared to a TO-220. The lower thermal resistance of the TO-247 will make it a lot easier to dissipate any heat as well, since the thermal resistance will be lower with larger packages. The lower thermal resistance between TO-220 and TO-247 or TO-264 is quite significant for the junction temperature of the pass device and determines the minimal thermal resistance of the heat sink. Try to calculate this and you’ll come to the same conclusion that larger packages with lower thermal resistances are much better.The high side current sensing with the differential Opamp configuration isn’t great, common-mode offset will be dependent on the resistor tolerances and matching of all four resistors. The bandwidth of the differential amplifier will not be great without additional frequency compensation or difficult to stabilize. High side current sensing is better compared to low-side current sensing for a power supply, it might be a lot easier if you used low side sensing as is done in the HM7042. The sense resistor can be amplified with a non-inverting amplifier, but it would be better to supply the op-amps with a negative supply to reduce the offset errors and input limitations of the LM324 with a single supply.Your temperature protection will keep turning on and off without any hysteresis. With an additional resistor you can create hysteresis to turn the output off at for example 100 degrees and only turn it back on when the heatsink has cooled down to 50 degrees. Especially for DIY PSU’s it’s recommended to have thermal protection to keep the magic smoke from escaping. Also add a LED or direct indicator to notify you of an active thermal protection, so you’re not scratching your head why your PSU isn’t working.The thing I miss most in your design is a requirement of the wanted output voltage and current, specify this and it will be easier to design accordingly. Also take a good look at the suggested reference designs of SMPS based bench supplies and other designs on the Eevblog, you’ll learn a lot that way.

author: technix
author_rank: Super Contributor
timestamp: March 26, 2016, 11:23:27 am
content: Quote from: T3sl4co1l on March 26, 2016, 09:37:43 amIn my school's lab I can hear a relay click when the (linear-only) PSU switches from CC to CV and vice versa. Explain why.

author: Radiohead
author_rank: Contributor
timestamp: March 26, 2016, 11:41:09 am
content: Probably it switches between two transformer tabs to reduce power dissipation instead of a SMPS or other pre-regulator. On a short-circuit of the output, the relais will switch to the lowest voltage tab to limit power dissipation.

author: technix
author_rank: Super Contributor
timestamp: March 26, 2016, 11:44:06 am
content: Quote from: Radiohead on March 26, 2016, 11:20:28 amThanks for the tip, and I will look into the BJT pass element for the linear section. The fixed headroom of 2.5V should be enough.Low-side current sensing is not really an option for me as it will mess with my output tracking. Also I don't have a negative supply rail, (although this does not prevent me from adding one, giving up the +35V rail and replacing it with a -12V one)The temperature reading itself is passed to the MCU so if the heat protection kicked in I would have some idea. I ran out of pins on my MCU so that SHDN line is not connected (I need the TEMP reading to control the cooling fan, so when the components start to get hot I can kick up the fan, attempting to blow the heat out before thermal protection kicks in.)

author: technix
author_rank: Super Contributor
timestamp: March 26, 2016, 02:12:36 pm
content: Another revision, updates:1) NPN BJT pass transistor for analog section. (driving TIP3055 is a nightmare, as it takes another power device TIP31C, and then a MOSFET 2N7002, to avoid loading the op amps too much)2) +35V rail is gone, so is high side sensing. (combining low-side sensing and normal feedback line is atrocious though)3) MC34063 is NOT gone though, now I have a -12V/100mA rail along with 12V/1A, 5V/2.5A and 3.3V/200mA rails (sounds ATX-ish...) derived from the filtered input.4) Better op amps: TL084 instead of LM324 (thanks to the new voltage rail configuration)5) SMPS tracking and voltage sensing brought out big guns: INA126 instrumentation amplifier (also thanks to the +/-12V rails)About thermals, all six power elements share one single heatsink and there is a fan blowing at it (I have even gave it a computer-like 4-pin PWM interface so I can reuse a computer chassis fan. Such fans, by default, run at full speed if there is no PWM signal.) The seventh spot on the heatsink is the LM35 temperature sensor, which will trigger a thermal shutdown of the main power rail if the heatsink got too hot. (Internal rails are not shut down, as the MCU and the cooling fan, which will be running at full speed already, will depend on them.)Order of the components on the shared heatsink:1) LM2596-12 SMPS controller for internal +12V rail,2) LM2596-5.0 SMPS controller for internal +5V rail,3) LM2596-ADJ SMPS for main rail,4) MBR1045 rectifier for the main rail,4.5) gap5) TIP3055 pass transistor,6) LM35 temperature sensor,7) TIP31C pass transistor driver.Signals "going nowhere" but marked goes to the digital section. VSET and ISET nets go to the two TLC5615 DACs and everything else go to the ATmega328P MCU.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 26, 2016, 04:42:51 pm
content: Just for the SMPS tracking there is no need to use an expensive INA: just a transistor can do that as well, as there is no need for precision here.Also the differential amplifier for voltage sensing does not have to be that accurate - a simple OP with resistors is usually good enough. Speed is not critical if you choose to transfer the voltage reference to the level above the shunt.The NPN output stage is still wrong, should not work this way at all. Just a Darlington like TIP142 or TIP3055+BD139 would be OK. There should be a diode to protect the NPNs from excessive negative base-emitter voltage. This in consequence would require current limiting for the 2N7000.With the use of the FET in source configuration the FET does quite some amplification. This changes the regulation in many respects - different type of compensation. As a side effect no more need for fast OPs, as the OP only work with a limited range of output voltages.The +12 V only needs rather little power (OPs - so a 7812 or even resistor and Zener diode should be good enough.Still there needs to be a way to prevent a spike on power on, as the OPs need power to actively turn down the output.

author: technix
author_rank: Super Contributor
timestamp: March 26, 2016, 06:39:26 pm
content: Quote from: Kleinstein on March 26, 2016, 04:42:51 pmHow to do that tracking using just a few transistors? I need exactly (Vout-Vinterim)/2 at the feedback pin so the headroom can be fixed at 2Vfb for LM2596 (about 2.5V)The output is relay switched (that is, disconnected until the MCU switches it on) so let it spike, I doubt the relay will let it get through. If that can become a problem I can reconfigure the circuit (1 74LVC1G08 chip, 1 MCU pin, 1 resistor) into shutting the main switching regulator off until the MCU turns it on (which will take a little while)I need 2A at the base for TIP3055 so I can push out 10A (this power supply have a 0-20V, 0-10A primary output rating with a software-limited maximum output power of 50W. LM2596 limits output power at about 80W with 24VAC input ignoring the fuse. I can only have up to 6 power devices heatsinked or there won't be any airflow for those extra devices) so how? Triple darlington with TIP3055/TIP31C/SS8050? (SS8050 is a cheap Chinese replacement for PN2222A, pin-to-pin compatible, slightly higher current capability and hFE)Also how exactly to drive the output transistor without the output of the op amps rise beyond +12V? The small MOSFET here is also a level shifter as the op amp maxes out at 10.5V but the output can rise beyond that. There is no way to run TL081 at 35V and still do low-side sensing, and I am really not willing to add a new supply rail.The 12V rail have some load so the 1A rating is required: a system cooling fan. I added this 12V rail so the all-so-common 12V computer chassis fans can be used.I'd rather keep the INA intact at the output voltage sensing line, as I am shifting the sense voltage down to GND level. If I can score a dual INA chip on the cheap the tracking INA will also be kept intact (as I already have a spare gate in the chip) otherwise I am willing to switch over to a transistor-only diff amp.

author: technix
author_rank: Super Contributor
timestamp: March 26, 2016, 07:20:31 pm
content: Quote from: Kleinstein on March 26, 2016, 04:42:51 pmJust realized my stupidity. The output level shifter is still the same topology but a bigger MOSFET is used (which can take the 2A worst-case scenario current.) That part is fairly awkward as the op amps have to run at a lower voltage than the output rail. Now the darlington-like circuit is IRF540/TIP31C/TIP2955 (start to look like an IGBT or PNP LDO eh?)

author: Kleinstein
author_rank: Super Contributor
timestamp: March 26, 2016, 08:08:34 pm
content: Having an output stage with NPN-PNP pair with local feedback adds another level of complication. It's possible but needs careful tests / simulation and may need an extra resistor (like the shunt) at the high side to avoid local instability. A Darlington configuration is easier and more predictable at low output currents.Not need to have a large MOSFET for the driver - the two transistor output stage has plenty of current gain. It may help to replace the resistor by a constant current source. Just the resistor could be tricky during transients. So the 2N7000 or maybe something twice the size should be good enough. The LM2596 will deliver a maximum of 3 A (better no more than 2-2.5 A) anyway so . So no more than maybe 10 mA needed to drive a darlington, even with a low BE resistor. Still you need a current limit for the FET and a diode to limit a negative U_BE.

author: technix
author_rank: Super Contributor
timestamp: March 26, 2016, 09:53:15 pm
content: Quote from: Kleinstein on March 26, 2016, 08:08:34 pmLM2596 maxes out at 3A, but that is its current draw from the power source, and that is where the 10A diode and inductor comes into play. (for buck converters, output current is the sum of pass element current, 3A here, plus flyback diode current.) So the output current can ramp up to 10A at lower voltages without the LM2596 even going near 3A. It is the inductor and the catch diode that need to withhold all the current.About the output transistor, the op amps maxes out at 12V, so how to drive that pass darlington that have all their terminals above 20V?About the constant current source, how to build it? TL431 + current mirror?

author: Marco
author_rank: Super Contributor
timestamp: March 27, 2016, 02:25:13 am
content: Quote from: technix on March 26, 2016, 09:53:15 pmUnless the load provides energy there is no way to increase the inductor current higher than 3A, with a resistive load with low side connected to ground it's simply impossible.

author: technix
author_rank: Super Contributor
timestamp: March 27, 2016, 05:46:56 am
content: Will this kind of switch-mode controller work? The gist is that use MC34063 but with external switching FET, either two NMOS with a gate driver (shown here) or a pair of CMOS.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 27, 2016, 06:27:05 am
content: Uh... nope?

author: BravoV
author_rank: Super Contributor
timestamp: March 27, 2016, 06:51:26 am
content: Quote from: technix on March 25, 2016, 04:20:18 pmI don't think this is a decent power switcher, are you sure you've built it and it worked ?If it is, let alone the transient response, even for the basic regulation will be like crap.

author: amspire
author_rank: Super Contributor
timestamp: March 27, 2016, 07:27:12 am
content: Quote from: BravoV on March 27, 2016, 06:51:26 amShould be OK - that is a 4700uF cap on the switch output, so you do not need a great loop bandwidth. Any micro can probably do at least a 1kHz control loop bandwidth. The A/D on those chips has an analog bandwidth over 30kHz and a minimum conversion time in the tens of uS. So you would have time to average several readings and calculate a PWM adjustment with a totally adequate rate.The thing that the good PWM chips do is that the designers have thought about everything that could go wrong, and have made it so the the FET doesn't get left ON in a fault condition. With a micro, you have to think about all those things yourself, and write code that never fails or never get stuck in a loop.For example, in that circuit, an the micro PWM output goes to a MOSFET input that then drives the power mosfet. If the micro fails to start and the PWM output is in a high impedance state, then the MOSFET input is basically floating and could be ON or OFF. Simple to fix with a pull down resistor.

author: technix
author_rank: Super Contributor
timestamp: March 27, 2016, 09:50:38 am
content: Quote from: BravoV on March 27, 2016, 06:51:26 amWhat I have done before was a boost converter, pulling the 3.7V-4.2V from a Li-po to 5V for an ATmega running at 16MHz (slight overclock at boot up, within spec after the MCU started.) For that converter I don't even need a remote sense wire as ATmega can measure its own supply voltage.

author: technix
author_rank: Super Contributor
timestamp: March 27, 2016, 10:44:29 am
content: Quote from: Marco on March 27, 2016, 02:25:13 amELI5 why yout computer's PSU can push out 1V 200A from a 12V 48A rail?

author: Kleinstein
author_rank: Super Contributor
timestamp: March 27, 2016, 11:15:54 am
content: With the integrated SMPS chips, they note the maximum current of the switch. With a buck converter the output current is a little smaller than the peak current of the switch. So the output current of these regulators can not be (much) larger than the rated current. However the average input current will be smaller. So you can use the LM2596 to convert 24 V 1.5 A to about 10 V at 3 A, but not (much) more, even if the voltage goes down. The LM2596 is effectively limited to about 3 A maximum output current - as with many maximum ratings, it is likely better to use even a little less to ease on cooling.If you want a 10 A current you likely need to go with a controlling SMPS chip and separate MOSFETs to do the switching.

author: Marco
author_rank: Super Contributor
timestamp: March 27, 2016, 12:57:44 pm
content: Quote from: technix on March 27, 2016, 10:44:29 amELI5?Any way, to go from 12V 48A to 1V 200A with buck you would use 6+ phases.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 27, 2016, 01:48:34 pm
content: Quote from: technix on March 26, 2016, 09:53:15 pmOn what basis do you assert this? Intuition? Does the datasheet say so? Have you actually tested one above 3A?I think you will find that the device is limited on peak current, not average input current. Therefore, the inductor current can never be above 3A peak*, which means the average output current will be less than this, in fact by half the current-ripple amount (independent of supply and load voltage).*Give or take device tolerances, because the threshold won't beexactly3.0A in practice, nor will it turn off the instant the inductor current reaches that level.Tim

author: technix
author_rank: Super Contributor
timestamp: March 27, 2016, 03:44:52 pm
content: Quote from: Kleinstein on March 27, 2016, 11:15:54 amWell now I need more than one MCU then. One with high speed PWM and two PWM channels in sync so I can do synchronized rectifying, a second one controlling the analog section, and a third for user interface and Bluetooth.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 27, 2016, 04:18:22 pm
content: The LM2596 is limited in peak current to slightly more than 3 A - so that with reasonable inductor a 3 A output current is possible. But as the peak current is limited, the maximum output current can not be much larger than 3 A - slightly more would likely work under favorable conditions (e.g. large inductor for low ripple).@technix:If you really like to do the SMPS part with an µC, you would need two µCs, but there is no good reason to do the SMPS part with a µC: there are ready made SMPS controller chips, that are better and may be cheaper. I think it's hard to beat a 40 Cents UC3842 in price or performnace with an AVR controller. Synchronous rectification makes things even more complicated and difficult fro the layout - this is only needed for low voltages.For the supply you can get away with one µC for the analog control and the user interface. So just an RS232 and maybe an USB interface would be isolated, but no second µc needed here. Only with more channels an extra µC might help.

author: technix
author_rank: Super Contributor
timestamp: March 27, 2016, 05:13:42 pm
content: Quote from: Kleinstein on March 27, 2016, 04:18:22 pmCurrentlyI have one uC - juggling the two DACs (over SPI) controlling the analog section, the LCD/keypad user interface (over I2C,) and an Bluetooth interface (over LVCMOS UART) I will stop using USB in new batteryless designs as that is awkward to isolate and cannot interface an iPhone, and only use USB when there is a battery to charge. Bluetooth is easier to tackle - it is wireless so no isolation required, it can support iPhone without MFi license, and for computers either you already have built in Bluetooth (most laptops, Raspberry Pi 3, or anything that is built by Apple) or it is easy enough to add it (USB Bluetooth dongle)I think with my tracking of 2.5V over Vout I can get away without sync rectifying...

author: Kleinstein
author_rank: Super Contributor
timestamp: March 27, 2016, 07:42:18 pm
content: Isolation for USB is not even that difficult: There are chips for USB/UART conversion. It is easy to isolate an UART and than have the USB/RS232 powered over USB. But this is really a separate step.

author: technix
author_rank: Super Contributor
timestamp: March 28, 2016, 12:24:19 am
content: Quote from: Kleinstein on March 27, 2016, 07:42:18 pmI tried that in a few projects but that feels awkward. And it being unable to support iPhones is a big kicker. I do not dare buying FTDI or Prolific chips, but WCH chips have driver issues under OS X.

author: sarepairman2
author_rank: Frequent Contributor
timestamp: March 28, 2016, 12:36:56 am
content: a good power supply will probobly have different pass elements for different current ranges, and you would probobly want to have a voltage with crowbar, current with over current, then current limiting modes..whenever you add a feature another part of it suffers.you could even argue that having the ability to bypass the linear section could be useful in some cases.

author: technix
author_rank: Super Contributor
timestamp: March 28, 2016, 06:45:25 am
content: Quote from: Kleinstein on March 27, 2016, 04:18:22 pmI Almost got misguided! UC3842 is not ideal for non-isolated purposes. Might as well go back to MC34063 with external FET. I spend my entire trip from uni back to the city searching for an appropriate chip in TI's handbook. Should that fail on me again I would just try figure out a way to use either a MCU or NE555+LM393+MC1403 or something along those lines.

author: technix
author_rank: Super Contributor
timestamp: March 28, 2016, 02:55:06 pm
content: Quote from: AcHmed99 on March 28, 2016, 11:46:49 amI cannot even find a single app note on how to use that do drive an external FET in buck configuration. Also the 14-pin version is ultra expensive.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 28, 2016, 04:05:09 pm
content: To use the UC384x as a buck converter, only usually has to build it as a negative side buck. So the positive side going through and an N MOSFET with the negative side. One thing is to get a version that can go to 100 % on time (e.g. UCx842) and not one that is limited to 50% on time.

author: dannyf
author_rank: Super Contributor
timestamp: March 28, 2016, 05:59:38 pm
content: "How to do that tracking using just a few transistors? "The typical approach is to use a transistor across the linear regulator to control the switching regulators output. It works on the basic notion that as the load increases, the voltage drop over the linear regulator goes up. This, through the transisyor, increases the smps output, bring the power supply back into balance.What I did is to use a led to sense the voltage drop, and couple the LED with a photo resistor that controls smps output.Much easier to construct than the standard approach that uses a PNP or a p CH MOSFET.

author: technix
author_rank: Super Contributor
timestamp: March 29, 2016, 03:42:26 am
content: Quote from: Kleinstein on March 28, 2016, 04:05:09 pmNow where do I tap off +5 and +/-12V auxiliary rails? And how can I keep track of the output rails using just op amps without a common ground?

author: technix
author_rank: Super Contributor
timestamp: March 29, 2016, 09:15:57 am
content: Updates:1) MC34063 with external PMOS switch for the SMPS stage. I cannot use low-side buck as it will prevent me from sensing voltage and current properly. Also it can be disastrous if someone assumed that the ground of the iPhone charger and the power supply output are common. (currently it just disables current sensing but thankfully my regulator is fused)2) PNP tracking. Is this the correct waydoing it? (accuracy is not critical, as there is another regulator after the SMPS stage)3) CC-driven output stage using a TL431-current mirror CC regulator. There are a lot of NPNs so will it go haywire? Will the current regulator's supply being the unregulated input instead of a boost regulator give me issues?4) Moved auxilary rail regulators to a separate page

author: technix
author_rank: Super Contributor
timestamp: March 29, 2016, 09:28:24 am
content: Update:1) Added something I would call "poor man's active rectification" using a diode and a pullup resistor. I already have a +12V rail (op amps, the cooling fan, and maybe relay are already using it) and it can be a nice gate drive voltage for the low-side NMOS.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 29, 2016, 11:47:44 am
content: Quote from: technix on March 29, 2016, 09:28:24 amYou're trying too many things at once. Way too many.Take a step back and build only what you've built before. Then make small, single variations on that until you understand what everything does.As shown, you'll dissipate way more heat than even a bare 34063's efficiency would suggest. And you've piled up the cost heavily with all these transistors and still the massively oversized inductors and capacitors required for the awful performance you'll get.Please, go shop for some real controllers.Tim

author: technix
author_rank: Super Contributor
timestamp: March 29, 2016, 03:24:29 pm
content: Quote from: T3sl4co1l on March 29, 2016, 11:47:44 amIf you send me some of the chips you are suggesting I will try them. Or I will be budget restricted and have to stick to what is available at the local parts store. Those fancy controllers you are talking about are 1) not available from those stores and have to be ordered from Shenzhen - somewhere I don't really trust and 2) too expensive for me as a tinkerer.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 29, 2016, 05:05:10 pm
content: The MC34063 is not really suited to drive MOSFETs. Adding a gate driver makes things more complicated. It is also limited to relatively low frequency and thus needs large inductors and capacitors. So the cheap chip may not save much.For the UC384x (no need for the 14 Pin version) is mainly the question if you can live with a negative side buck converter (negative buck -works well with N-MOSFET) - if yes this is a viable low cost solution. The difference to the 34063 is that it include a gate driver for an N_Mosfet at the GND side.A positive side buck converter either needs a P-MOSFET or a special boots-trapped high side driver for an N-MOSFET and still has limits. There are reasons for more fancy and more expensive controllers - so a cheap controller will have some downside like more noise, less efficiency.For learning it could be OK to use older more standard chips, but this also works with lower power - so the first version really should be lower power. Designing an SMPS is not that easy - you can well burn a few MOSFETs / diodes / caps. For a 10 A version this could even blow the board.

author: technix
author_rank: Super Contributor
timestamp: March 29, 2016, 07:23:46 pm
content: Quote from: Kleinstein on March 29, 2016, 05:05:10 pmThe reason I started off at 10A is because of chips like LM2596 rendering the point of rolling a buck at the current of a few amps moot. I have previously designed a few boosts using MCU (a self-powering boost) or MC34063 (the MOSFET gate drive for my M102v5 board) and those worked very well. Also I have some previous experience of IRF4905 MOSFET in LDO application and that worked well too.I am looking at alternatives on TI's product page and this caught my eyes: TL5001. Its datasheet have shown using it as a high-side buck driving a PMOS, and I believe my existing way of converting a PMOS drive with OC output into synchronized rectifier (the diode and pull up for gate drive) should work with my 30V input. A con point for that chip: it is more expensive than ATtiny85 from some sources.I am editing the circuit now, replacing the MC34063 with that TL5001 and add a relay switching for the input windings. My transformer have dual 12V windings and so far my design puts them in series. Now I am adding a relay so if the output voltage of the SMPS stage goes lower than 10V the two windings are paralleled instead of being winded in series.Also, do not take resistor values for granted, as I will recalculate them after the schematics are done.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 30, 2016, 11:25:06 am
content: Well, toss in a current transformer and an additional error amp, and you can do as well as anyone would ever hope: a proper average-current-mode buck controller. But the reference circuit they give? Yeah, stick with 34063...Tim

author: technix
author_rank: Super Contributor
timestamp: March 30, 2016, 04:20:39 pm
content: Quote from: T3sl4co1l on March 30, 2016, 11:25:06 amIt seem to me that you have an unquenchale hatred toward MC34063.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 30, 2016, 11:27:31 pm
content: Eh?

author: technix
author_rank: Super Contributor
timestamp: March 31, 2016, 04:30:58 am
content: This is it, no more argument on which chip to use.Main rail uses LM3477 (this puppy have built-in NMOS bootstrap circuitry) with IRF540 as the external switch. I need good efficiency but don't need good ripple suppression on the primary SMPS as the linear section immediately follows, with 2.5V headroom.Auxiliaries are the domain of LM2596 and MC34063. I don't need good efficiency on those rails as they only drive internal circuitry (5V logic from LM2596-5.0, 12V op amps, relays and cooling fan from LM2596-12, 3.3V BTLE module from MC34063 and -12V op amps from MC34063). The 5V rail is the secondary output but LM2596-5.0 on its own is already good enough.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 31, 2016, 01:30:44 pm
content: Quote from: technix on March 31, 2016, 04:30:58 amOoh, this one looks good!Tim

author: technix
author_rank: Super Contributor
timestamp: March 31, 2016, 09:22:24 pm
content: Quote from: T3sl4co1l on March 31, 2016, 01:30:44 pmReworked the SMPS section again. Compensation computation got complicated since I am using a tracking regulator instead of a normal resistive divider for feedback. The 4.5uH inductor is self wound.The two AC12V inputs can be switched between series and parallel using a relay. SMPS output of 15V is the threshold. Some hysteresis is added.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 31, 2016, 09:51:55 pm
content: Probably the filter cap can be a whole lot smaller too.Hrm, also that inductor will get preposterously hot. You need ferrite at that frequency and ripple%. mu=75 powdered irons are crappy even at 50kHz. They're cheap and that's it...Also, is that feedback actually going to work? It seems to have ludicrous voltage gain off the output node, which isn't a good sign.Tim

author: technix
author_rank: Super Contributor
timestamp: April 01, 2016, 02:14:37 am
content: Quote from: T3sl4co1l on March 31, 2016, 09:51:55 pmHow much output filtering do you suggest? 470uF?From the datasheet of my ferrite it works up to 1MHz. I do have a few mu=4 ones but those 50MHz ones toroidal requires 80-100 turns. Or maybe I can reuse a few of those "3R6"s I took out of a dead Core 2 Duo motherboard?The feedback is intended to make the output of the SMPS track the voltage of the output of the linear voltage with a constant offset of 2.5V. So here I need a differential voltage gain of 0.5 or so.

author: Kleinstein
author_rank: Super Contributor
timestamp: April 01, 2016, 09:44:53 am
content: There might need to be an additional capacitor right before the regulator. There is quite some ripple at the input side and no real need to pass this through the relays. At least have a look at the ripple current ratings for the caps. For EMI reasons one might also need some filtering on the input side.If space/ weight is not at a premium, a slightly larger (both value and mechanical size) inductor is often working better.With a switched mode regulator, is there a real need to switch the transformer ?The relays and the double rectifier also give some extra loss. So I am not that sure the slightly better SMPS performance at lower voltage is worth it. Just using a good inductor, diode and FET might be easier.The current feedback circuit looks like having gain. Just the pot at the collector side tends to be rather nonlinear and temperature sensitive. To get rid of the gain and make it more temperature stable one usually has a resistor at the emitter of the transistor too. The two resistors at emitter and collector set the gain and voltage difference for the linear regulator. Usually a gain of something like 0.5 should be about right. Depending on the SMPS chip, you may need a capacitive coupled direct feedback too, especially if an LC filter before the linear stage is used.

author: technix
author_rank: Super Contributor
timestamp: April 01, 2016, 12:08:14 pm
content: Quote from: Kleinstein on April 01, 2016, 09:44:53 amThe input comes from a mains rated transformer. How can I do EMI filteringaftersuch an transformer?If I used mains-side switching (something the UC3842 mentioned above really masters at) I would definitely include EMI filtering (and maybe active PFC too)Quote from: Kleinstein on April 01, 2016, 09:44:53 amIt is indeed not at premium, but the SMPS controller chip have a tight tolerance for inductance (I can go from 3.7uH to 6.0uH, so somewhere in the middle I got 4.7uH)Quote from: Kleinstein on April 01, 2016, 09:44:53 amIt is not the volts, it is the current. This is not a 2-phase SMPS so I have to switch the windings to get more current if needed. The double rectifier may indeed be a problem but fusing can be problematic (as each winding have its own fuse)Quote from: Kleinstein on April 01, 2016, 09:44:53 amI did think about emitter-side resistors but I need the ability to adjust the tracking anywhere between 1.3V and 3V no matter what voltage the output is. When I go for 1.3V tracking the emitter resistor really will give me headroom issues when the output is approaching zero.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 01, 2016, 01:25:23 pm
content: Quote from: technix on April 01, 2016, 02:14:37 amDepends on the compensation components, but those can change too. Probably a minimum of 22uF would be a good starting point: which has the advantage of being very fast, so you can have quick response and lower 60Hz ripple.QuoteOh, is it actually a ferrite? What's the datasheet?QuoteThose might be good; in that service, they would've been at a similar frequency (or higher), dropping 12V to ~1V at piles-of-amps. You probably want a bit more inductance though ("3R6" = 3.6uH).QuoteIntended yes, but beware that an intention-aware circuit has yet to be created.A transistor wired like that will have a voltage gain of about 20, increasing your loop gain considerably. If nothing else, your compensation RC will have to be very different from usual.Better to have the SMPS programmed from the same reference as the analog output, merely with an offset added in.Programming is very simple as you only need a resistor from REF to FB. Think of FB as an inverting input, with a fixed precision offset voltage; or as the voltage sense divider from two voltages (jointly from OUT to FB to GND, and REF to FB to GND).The downside is, you don't get the SMPS output tracking the analog output under current limit conditions.Tim

author: technix
author_rank: Super Contributor
timestamp: April 01, 2016, 05:28:14 pm
content: Quote from: T3sl4co1l on April 01, 2016, 01:25:23 pmToroid core. Yellow/white -26 iron power core.Quote from: T3sl4co1l on April 01, 2016, 01:25:23 pmRechecked, those says R36 so bummer.Quote from: T3sl4co1l on April 01, 2016, 01:25:23 pmHow do I track it without introducing gain then? I think I will have to compromise and allow the SMPS to have bad tracking when the output voltage drops lower.

author: Kleinstein
author_rank: Super Contributor
timestamp: April 01, 2016, 06:20:55 pm
content: for the tracking Feedback, the single transistor should work reasonably well: with equal resistors at emitter an collector you get a gain of about 1 and an difference voltage of about 0.6 V + 1.3 V = 1.9 V. With a smaller resistor at the FB pin one would get 2.5-3 V at a gain of about 0.5. An additional RC combination can provide direct AC feedback from the voltage if needed. So no real problem here. Only a drop of less than 1.9 V might cause trouble, but I see no need or use for less than 2 V as this also gives little room for ripple and fast load changes.The first step would be testing the SMPS alone, thus with normal Feedback.Iron powder is not a good choice at 500 kHz - So you might need to think about a different core.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 01, 2016, 06:38:03 pm
content: Quote from: technix on April 01, 2016, 05:28:14 pmOk yeah, mix #26 pretty much useless for > 10% ripple at >50kHz. It makes a bad resistor and an even worse inductor at >100s kHz...Tim

author: technix
author_rank: Super Contributor
timestamp: April 01, 2016, 06:40:04 pm
content: Quote from: Kleinstein on April 01, 2016, 06:20:55 pmDifferent core material is hard to come by, and at 10A inductor heat is hard to deal with. I am really in the middle of reworking the circuit again but either go back to MC34063 (which have a lower switching frequency hence lower requirement at inductor) or go up to LM2642, a 2-phase synchronized rectifying controller so I can split the current into 2 inductors and 2 sets of switching elements (also lower frequency at 300kHz).Or maybe it would be better for me to scratch the entire idea of mains transformer - nonisolated SMPS - linear regulator, and use mains-side switching (UC3842 controller + IRG4BC20KD IGBT as switching element) + flyback regulator instead. Maybe in that way I can tackle both the power delivery issue and magnetics issues together.

author: Kleinstein
author_rank: Super Contributor
timestamp: April 02, 2016, 10:09:49 am
content: Having a classical transformer and switched mode regulator after that, still has the advantage of lower common mode noise. The common mode coupling if a flyback converter is hard to filter, and the linear stage does not help at all with this.A flyback converter is also more sensitive to the magnetics and more difficult / dangerous to test/measure. It is somewhat attractive as is might be cheaper than iron transformer.Using a dual phase regulator might be interesting as this reduces ripple current to the input side capacitors, but it also makes the layout more complicated. With the still rather high output voltage (full power only at more than about 12 V) I don't think using synchronous rectification makes much sense. The lower frequency makes some sense, as this simplifies the layout and choice of parts, though it requires a larger inductor - 300 kHz are still not that low.

author: technix
author_rank: Super Contributor
timestamp: April 02, 2016, 01:11:01 pm
content: Quote from: Kleinstein on April 02, 2016, 10:09:49 amLM2642 requires synchronized rectification anyway, or I have to switch to yet another controller chip. The good thing about '2642 is that it have 2 identical controller units operating at 180 degree phase difference inside, which can be configured into a 2-phase buck, so I can get both 30V/5A (with phase 2 turned off) and 12V/10A (both phases on) with a single 24V/5A winding on the transformer.If I step frequency down even more my next option is sadly ATtiny25 with SMPS firmware, using its 250kHz PWM signal. Then it is down to ye olde MC34063 with external FET...

author: Kleinstein
author_rank: Super Contributor
timestamp: April 02, 2016, 03:14:03 pm
content: The advantage of a 2 phase controller is reducing the ripple current and possibly faster response at the same clock frequency. There is also an advantage with very high currents, when parallel FETs would be needed anyway. The input current seen by the transformer is about the same for a 1 or 2 phase controller. So it's more about less requirements for the input side capacitors (and if present filter) and less noise. 2 phases are especially interesting when the voltage is reduces to about half, but still work with a variable voltage.It would be rather unusual to have 2 phases using different input voltages. The 2 phase controller actually works very good from 30 V to 10 V. So I would still use both phases powered from about 30 V. Using a lower input voltage might be an advantage for less than 5-8 V output, but this is already at not so high power - so not a problem for the transformer, but only more demanding for the filter. Still I think classical 2 phase operation would be a larger advantage than using 2 input voltages but only single phase operation.With an 5 A (AC) rated transformer you would not get 5 A at the full voltage anyway (this would require PFC at least), but more like a 3 A maximum. With the switched mode this limit will gradually go up at lower voltage - giving an about constant power and than level off at a maximum current set by the SMPS. So maybe 3 A at 30 V, 5 A at 17 V 8 A at 10 V and 10 A below 8 V.One could consider turning of one phase at light loads (e.g. less than 0.1 - 0.5 A) - some controllers include this feature, but it's not absolutely needed. With a linear regulator to follow one could even consider turning the switching regulator fully off (e.g. FET turned on, so full output) at very light loads to get a low noise version for low currents. However this does not work with bootstrapped N-MOSFETs for a positive buck converter - it would need an extra P-MOSFET to bypass the regulator.

author: technix
author_rank: Super Contributor
timestamp: April 02, 2016, 04:51:44 pm
content: Quote from: Kleinstein on April 02, 2016, 03:14:03 pmDon't worry about the PFC issue - I have a power cap of 50W along with a current cap of 10A.I will research into that LM2642-based 2-phase buck pre-regulator (and leave LM3477 for some other projects in the future.) LM2642's two phases are capable of individual operation including running at different output voltages and being switched off, which is a feature I am very willing to exploit. So I am trying out this:* LM2642 controller (300kHz 2-phase, bootstrapped high side N-channel switching, synchronous rectifier)* Power FETs: 4x IRF7470 (at less than 0.5W dissipation I am trusting this SO-8 MOSFET without heatsinks)* SMPS stage can be bypassed using a single IRF7404 (when the dissipation on the linear pass transistor is lower than 10W, and the transistor's temperature is lower than 50 degrees Celsius: that is, since the input voltage is 34V rectified, 30V 1A gets straight linear regulator, but 5V 0.5A will use the SMPS)* Each of the two phases have a maximum current of 5A.* When the output current is lower than 1A, phase 2 (the one without the power good output) of the LM2642 controller will be turned off.* Microcontroller: STM32 + ADuM3160? Or the good old ATmega328P? Bluetooth go external anyway.* Control interfaces: Keypad & screen (good ol' HD44780 20x4 LCD,) Bluetooth Low Energy + iPhone app, for the STM32 I can add native USB too.

author: Kleinstein
author_rank: Super Contributor
timestamp: April 02, 2016, 06:21:08 pm
content: The LM2642 is specified for 30/32 V max supply. So it can easily blow with a 34 V input. Even the LM3477 with a maximum of 36 V is rather close.The gate drivers of the LM2642 are not very strong to drive large FETs - so the losses might be to high to get 5 A from each channel, especially with FETs that are not effectively cooled.The IRF7404 is only a 20 V FET, but at least 40 V, better more would be needed.For the controlling µC, USB integrated in the µC does not help very much, as the µC is likely connected to the output. As isolation on USB level is rather difficult, I would prefer UART level for isolation and an extra UART-USB chip if needed. As the cheap LCDs often want 5 V signals, a 8 Bit µC running on 5 V might be easier. A AVRmega88 might not have enough pins - so you might need a mega164 or similar.

author: technix
author_rank: Super Contributor
timestamp: April 02, 2016, 07:05:46 pm
content: Quote from: Kleinstein on April 02, 2016, 06:21:08 pmSince LM3477 is a no-go due to inductor nonavailability and obviously MC34063 is being hated on passionately, I have to dial down the input transformer and the maximum output voltage. AC20V/5A input 25V/10A/50W max output, or AC18V/5A input 20V/10A/50W max output.Quote from: Kleinstein on April 02, 2016, 06:21:08 pmIRF7470 are fairly small, logic level FETs. LM2642's requirement of the use of logic-level FETs is kind of a barrier here, and I don't really want to put IRL540 out here. Also how do I cool SO-8 FETs?Quote from: Kleinstein on April 02, 2016, 06:21:08 pmThen I'll just use a relay to switch it. Ha even less loss.Quote from: Kleinstein on April 02, 2016, 06:21:08 pmCheap LCD may want 5V but it is fairly simple to isolate that - PCF8574. Those I2C GPIO extenders can work with a 3.3V I2C bus while itself being powered by 5V. Or maybe I can just run it headless and rely entirely on Bluetooth for control.I am going to try the circuit with ATmega328P first, and if I find that lacking I am going to switch over to ATmega644 or maybe ATmega128. (Or maybe I should give PIC16F1939 or PIC24FV32KA304 a shot too?)

author: Kleinstein
author_rank: Super Contributor
timestamp: April 02, 2016, 07:57:56 pm
content: There are P_channel MOSFETs for more than 20 V. A PNP might work as well, as the mode without the switched mode would be useful mainly for low currents. Some drop is not a problem as the voltage is too high in most cases anyway. So no reason to use a relay. A relay is bulky and slow.For the µC I see not need for large processing power and lots of memory. With some extra controls you may just need more than the about 20 IO pins available with the Atmel mega??8 series.The LM2642 curves go up to 5 A per channel with a 20 V FET - so it might be difficult to reach that level with a 40 V FET. It might work - but I would not take is for granted. With only a 50 W power limit, there may not be that much use in planing for up to 10 A anyway. You lose something like 2-3 V for the linear regulator, maybe 0.5 V for the switched mode part - so 10 A would be available at very low voltages (e.g. less than 1-2 V) only.

author: technix
author_rank: Super Contributor
timestamp: April 02, 2016, 09:30:41 pm
content: Quote from: Kleinstein on April 02, 2016, 07:57:56 pmIRF7240. This ought to make it. Another SO-8 business though.Quote from: Kleinstein on April 02, 2016, 07:57:56 pmSince those pin- and code-compatible parts cost about the same I went for the larger one so I can have some extra room for calibration data and software features.Quote from: Kleinstein on April 02, 2016, 07:57:56 pmThe 50W power limit is on the output power. So the 10A current is only available when the output voltage is less than or equal to 5V. At maximum output voltage (20/25V) the current is limited to 2.5/2.0A.

author: technix
author_rank: Super Contributor
timestamp: April 04, 2016, 07:54:08 am
content: </thread>I am splitting this project in two: M103v1-3 with same structure but a reduced current ratings (3A max so LM2596-ADJ can work, the 30V voltage cap and 50W output power cap still stands) and M103v2-10 with same ratings but uses mains-side switching (two UC3842 forward converters, one outputting auxiliary rails and one outputting primary rail, with active PFC.) This will result in simpler power inductor selection for me (as I am budget and supplier restricted) and easier design.