Modding switchmode PSUs for different output voltage and why it sucks - Page 1
Forum section: electronics / projects

author: magic
author_rank: Super Contributor
timestamp: October 20, 2021, 10:05:09 am
content: Most of us have some unused wall warts or laptop PSUs lying around and the topic of converting them for new applications comes up every now and then.I recently tried to do it myself, and...So here's what a typical wall wart circuit looks like, ignoring snubbers, input EMI filters, fuses, etc. The "zener" on the secondary will usually be TL431 or even more complex chip on high power PSUs with synchronous rectification. Still larger PSUs like ATX use more complex primary topologies and aren't covered here. The "OVP and Demag" pin is specific to variable frequency quasi-resonant controllers and may not exist on others, such as the classic UC384x series. Sometimes the primary switching MOSFET is integrated inside the IC.Switchers like this are able to convert a wide range of input voltages into one output voltage, but unfortunately it doesn't necessarily mean that they can produce arbitrary output voltages. The important thing is that there is no magic trick in the transformer - it's an ordinary (high frequency) transformer and it obeys the turns ratio equation, with all its consequences. It usually has three windings, no two, and the primary winding is inverted in polarity.When the MOSFET conducts, both output windings go negative (divided by turns ratio) and are blocked by diodes, so input voltage doesn't matter too much as long as nothing breaks down. When the MOSFET turns off, flyback effect causes winding voltages to drop down, invert and rise in opposite directions, until something starts to conduct somewhere. Normally it's the secondary rectifier and then the secondary winding sees voltage equal to the output voltage plus one diode drop. The primary sees the same voltage amplified by turns ratio and inverted. Primary voltage appears "stacked" on top of rectified mains and the MOSFET needs to block it.Increasing output voltage sucks.Simply enough, if you go too far, the MOSFET on the primary will break down. In addition, secondary diodes will see more reverse voltage when the MOSFET is on and the secondary goes negative and you don't even know how much it is without measuring. Output capacitors may need to be upgraded for higher voltage, resulting in larger capacitors which may or may not fit in available space.The auxiliary winding (see below) will produce proportionally higher voltage too, increasing power dissipation in the controller and maybe EMI (faster switching). In extreme cases addition of a voltage regulator may be necessary to prevent instant damage of the PWM chip or MOSFET gate. There is also a capacitor there, pay attention to its voltage rating.Decreasing output voltage also sucks.See that third winding, on the primary side? It powers VCC of the PWM controller chip (and may have other roles - see pin 1). Typically 10~15V is necessary and this voltage is not regulated in any way. If the output is 24V then this winding has half the number of turns to produces roughly 12V and that's it. Startup is enabled by the R* resistor, sometimes with additional regulation in the chip, sometimes tied directly to VCC. Converting the startup circuit into a shunt regulator for the PWM chip is a PITA because a few mA are needed (you often don't even know how much) and this translates to over 1W of power lost in R*.Another problem is that the secondary circuit also needs a few volts minimum to operate, just to send feedback signal back to the primary. It will not be able to throttle down the PWM until this minimum voltage is present on the secondary.Furthermore, if synchronous rectification is employed, the MOSFET (not diode!) rectifiers may overheat if there isn't enough voltage on the secondary to turn them on.Increasing output current sucks.You may think: I found some way to reduce the output voltage and still keep the PWM chip going, I will get more current from the same power capacity of the PSU. But that's not how it works, because output current is limited by PWM duty cycle and peak secondary winding current after primary MOSFET turn-off, which happens to be equal to peak primary winding current before primary MOSFET turn-off, multiplied by turns ratio. Peak primary current is limited by means of the CS pin circuitry and can't be safely increased due to risk of core saturation and total disaster. Duty cycle does change when output voltage is reduced, but if the starting duty cycle is 50% then secondary output current won't increase more than 2x even into a short circuit.An additional problem is that increased secondary current causes more power dissipation in the secondary winding and rectifiers.Limiting output current sucks.Yes, it really does. There is, of course, no problem with underutilizing the PSU. But if you add a secondary circuit which throttles the primary controller down when overcurrent is detected, you run into all the problems with reducing output voltage.Out of the box, such PSUs have no direct secondary current limit, only peak primary current is actively limited by the PWM controller, which translates to a rough secondary current limit as described earlier. When overcurrent occurs, output voltage sags down and so does the auxiliary supply powering the PWM controller. At some point the PWM turns off and comes back a moment later after R* recharges its supply back to operating level. With persistent output overload, the PSU will periodically try to restart until the fault is cleared.Coming next: how I attempted to provide power to the PWM chip for reduced output voltage and why you shouldn't do it my way.I still need to finish the postmortem

author: Siwastaja
author_rank: Super Contributor
timestamp: October 20, 2021, 10:25:16 am
content: Yeah, they are only good for minor adjustments. Conversion from 12V to 13.8V to float charge a lead acid battery is usually doable but there is no much margin for more. Then again for said battery floating you'd need to find a supply that has actual current limiting (CC mode, even inaccurate). As you say, conversion is difficult or impossible if there is hickup or latch mode current limit instead, which is the typical case.

author: magic
author_rank: Super Contributor
timestamp: October 21, 2021, 04:39:06 pm
content: And here's my brilliant solution to provide power to the PWM controller: a capacitive dropper, probably the cheapest and dodgiest power supply possible besides a brute linear regulator.Problem is, the combination of cap dropper and full bridge rectifier becomes a voltage doublerWhen current flows through C3 to the right, it returns to mains through the PWM controller circuit and D2 in the bridge rectifier.When current flows through C3 to the left, it flows through the forward biased zener but then it has to pass through C1 to reach D1 so it charges itI built a prototype and it worked flawlessly because the converter turned on and discharged C1 faster than it was being overcharged. However, a small modification in the "final" build caused the converter not to start, and I found over 500V on C1 after turning off the PSU. Thankfully, nothing appears to be obviously damaged but I will have to fix this circuit to really confirm.Any ideas if this cap drop design can still be saved?I guess I can always buy one of those cemented 5W resistors

author: NiHaoMike
author_rank: Super Contributor
timestamp: October 22, 2021, 01:04:56 pm
content: Quote from: magic on October 21, 2021, 04:39:06 pmConvert the rectifier to half wave and double up on the capacitance, but that's only practical for relatively small power supplies.

author: magic
author_rank: Super Contributor
timestamp: October 22, 2021, 04:41:17 pm
content: That looks like it could eliminate the problem.Not sure how much my electricity supplier would hate me for that power factor and for putting DC on mainsI tried to come up with some modification of the circuit, rearranging the diodes or using more, but still nothing that actually works right in all cases.

author: NiHaoMike
author_rank: Super Contributor
timestamp: October 23, 2021, 02:24:46 pm
content: Unless you're doing that with a particularly large power supply (in which case a small auxiliary switcher would probably make more sense anyways), it's going to be insignificant compared to even one heating appliance that uses a diode for the half power mode.

author: magic
author_rank: Super Contributor
timestamp: January 18, 2022, 11:20:50 am
content: I found that there was an error in my original description of output current limiting, this is corrected now.I needed this PSU converted for one project so I took the simplest solution68kΩ/5W resistor provides ~5mA from positive rectifier output to VCC and a 13V zener limits voltage to safe level. I tried 12V first but it regulated just below 12V and the controller didn't start. Turns out that 5mA is barely enough and VCC sags down to 8V at the maximum switching frequency this converter can pull off, which is ~111kHz. If I caught it at the prototype stage when everything was connected with alligator clips I would have reduced resistance to 47kΩ, but now I'm too lazy to fix it since it still works with some small marginIt looks like the resistor lead almost touches the heatsink, but actual distance is ~3mm. I insulated both leads with heatshrink just in case and tied the resistor to the heatsink so it doesn't flap around in the breeze and gets some cooling. It dissipates 1.7W, it was getting hot to the touch without heatsinking, now it's just warm. (Goes without saying, I'm not touching anything here without unplugging the device from power)Because my output voltage range goes slightly higher than the original output of this PSU, the AUX winding could go higher than 12V too. For that reason, I removed the diode going from AUX to VCC to prevent any risk of AUX winding overloading my 13V zener.The PWM controller is now powered 100% by my shunt regulator at all output voltage levels.And now the secondary.R1 provides ~1mA to the TL431 without turning on the optocoupler. This is necessary because TL431 requires 1mA before it is guaranteed to work correctly.R3 and C1 are frequency compensation, I left them alone. Thankfully the PSU is still stable at all output voltage and current combinations I tried so far.R2 unfortunately limits the lowest voltage that can be regulated, but it likely plays a role in frequency compensation. I left it alone, I can still get 5V and I'm happy.It could be tempting to simply replace R4 with a potentiometer, but that's a very bad idea for two reasons:1. if the wiper loses contact with the track (intermittently during turning or permanently) the output voltage will go up without a limit2. if the potentiometer is set to short circuit and there is no further resistance in series with it, the TL431 will go bonkers, regulation will stop working and everything will blow up. More on this fascinating topichere. It's just a theory not tested in practice, but I have enough confidence in my theory that I refuse to test it in practiceFor those reasons, I used the slightly more complex arrangement shown above. R6 is not strictly necessary, it limits the minimum voltage that can be set to 5V. But allowing lower voltages to be set makes little sense because this circuit wouldn't be able to regulate less than ~4V anyway.

author: SilverSolder
author_rank: Super Contributor
timestamp: January 18, 2022, 02:38:39 pm
content: What about adding (or removing) windings from the transformer secondary?

author: SilverSolder
author_rank: Super Contributor
timestamp: January 18, 2022, 03:04:27 pm
content: If modifying the existing transformer is difficult because of its construction (sealed in epoxy or whatever) - maybe it is possible to add an extra transformer to the circuit, along the following lines?Depending on the polarity of the secondary, this could either increase or decrease the output voltage...Of course, once you get to this level of work, you might as well wind your own transformer and replace the existing one. How hard is that, actually?

author: magic
author_rank: Super Contributor
timestamp: January 18, 2022, 03:18:48 pm
content: I have no idea how hard it is to mod those transformer. I recall that somebody (Electroboom?) tears down transformers to inspect their safety, maybe I will take a look later.So far I'm exploring low-tech mods, without increasing output voltage far beyond the original specMy PSU was originally rated 16V/4A. After modding, it goes up to:- 4.5A @ 18V into 4Ω- 7A @ 7V into 1ΩBoth on transient basis as my load resistors are not good enough and I'm a little worried about overheating the secondary.I currently have no use for currents more than 4A so I consider it a success.

author: SilverSolder
author_rank: Super Contributor
timestamp: January 18, 2022, 04:14:08 pm
content: Quote from: magic on January 18, 2022, 03:18:48 pmThat's a pretty good result!Switchers are definitely temperamental to work with. I sometimes just add a linear regulator as an "afterburner" to a switcher to get the voltages I need. For equipment that is not in use 24/7, the simplicity (and heat emission) of such brutality is excusable!

author: magic
author_rank: Super Contributor
timestamp: January 18, 2022, 05:58:27 pm
content: Quote from: magic on January 18, 2022, 03:18:48 pmIt was DiodeGoneWild.It seems you are going to have two main problems: the two halves of the core are glued together and some windings may need undoing to access others. I imagine it could be doable if you are masochistically inclined enough.Now brace up for the horrors

author: tunk
author_rank: Super Contributor
timestamp: January 18, 2022, 07:20:32 pm
content: Diodegonewild did rewind a transformer that blew up:https://youtu.be/WblalRdECGY

author: SilverSolder
author_rank: Super Contributor
timestamp: January 18, 2022, 10:28:22 pm
content: It seems pretty easy to add a few more turns to the secondary - no need to unwind the existing transformer, just wind a few more turns on the outside of everything, and put them in series with the existing secondary. With a bit of luck, you don't even need to take the core apart to do that!To reduce the output voltage, you just connect the winding in opposition to the existing one.Looks like rewinding the transformer completely actually stands a good chance of improving safety as well! OMG some of the ones taken apart by Diode Gone Wild looked scary...