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