Switching-mode power supply
Switching-mode electronics always fascinated me. Switching-mode power electronic devices seem to be small, light and have very low loses. Indeed, this is why you can find them anywhere around.
But still, to my humble opinion, the most fascinating design belongs to the most basic switching-mode power supply you can have.
Step-down power supply
This is an inventory needed to make one: a diode, a transistor, an inductive coil, a capacitor and an oscillator that will generate a square-wave to trigger the transistor. In reality you will probably need some more elements but these are the most important ones.
You noticed that our simplest switching-mode power supply has no regulation feedback. So how does it adjust itself to changes in output current? It is actually self-adjusting by its nature. As the load takes more current out, our power supply feeds more current in, and so the output voltage (measured at capacitor) is always maintained. Of course, there are some limitations, but this is a very neat property for such a simple power supply, dont you think.
The transistor works as a switch, and is driven by the square-wave supplied from the oscillator - high voltage from the oscillator switches transistor on, while low voltage switches it off. These on and off times do not have to be shared 50:50. As a matter of fact, changing the on and off time ratio is the right way to preset the output voltage of the power supply. Once preset, the output voltage will be maintained by power supplys self-adjusting ability.
As this is a step-down power supply, it is required that the input voltage be higher than the maintained output voltage. In addition, the input voltage must be pretty stable (an important disadvantage of this basic design).
While the transistor is switched on, the input voltage pushes current through the inductive coil and so the coils current rises. The rising speed depends on the difference between input and output voltage and the inductivity of the coil. In the next step, while the transistor is switched off, the inductive coil itself continues pushing the current, but the current will be falling due to counter-voltage at the capacitor (therefore, the output voltage). The speed of falling depends on the output voltage and, of course, the inductivity of the coil.
The upper diagram shows the voltage at oscilator output or at transistor emiter (they are more or less the same).
The lower one shows the input (Vin) and output (Vout) voltage levels
Although the coil current rises and falls during the switching cycle, in average it is equal (unbiased) to the output current that is supplied to the load.
By the way, the diode in this circuit closes current loop when the transistor goes off (without it, an extremely high voltage would be generated on the inductive coil).
What happens if the output voltage drops a little? Evidently, during transistors on-time the current will start rising a little bit faster because the difference between input and output voltage has increased. On the other hand, during transistor off-time, the current will be falling a little bit slower because counter-voltage has dropped. As our oscillator always works the same and as on/off ratio never changes, we can see that then the average level of the coil current will climb. As the average level of coil current rises, the capacitor will become better filled and finally, the output voltage should rise back. This is how the power-supply is self-adjusting.
Transient on supplied current change. The output voltage will oscilate around new equilibrium for some time - it will
eventually settle because of loses in real-word components (inductive coil resistance).
So, whenever the output voltage drops because of increased power consumption, or if the output voltage rises because of decreased power consumption, the power supply adjusts average coil current level that feeds its output capacitor to neutralize the effect.
The problem with this simple design is that if the load doesnt consume enough power then the output voltage raises very high. Here is what is happening In normal work, the average coil current is unbiased to the output current of the power supply and the output voltage is maintained. The coil current has a form of saw-wave it is rising and falling but it never stops flowing. However if the output current drops very low, the saw-like coil current will try to follow but at some point its lowest portions will touch the zero. Unfortunately the coil current cannot drop any lower than zero (the diode doesnt allow it to change its direction) and so its waveform will become deformed and our nice self-adjusting effect will vanish. As the average coil current now remains higher than it should be, the output voltage level will not be maintained as before anymore, but will become settled at some higher level.
One can try several things to solve this problem. Among other methods, one can tray to make coil current amplitude smaller using much higher switching frequency. In this case it will work even for very small loads (one can then add a small, always-present dummy load, like a resistor or a LED, to the power supply output to ensure that the consumed power never goes below some minimum).
Step-up power supply
That was nice. We learned a little about switching mode power supplies and about the way to convert high level DC voltage to lower level DC voltage.
But there is an equally simple switching-mode power supply (DC-DC converter) that can take low level DC voltage at its input and supply high-level DC voltage at its output. In fact, it uses equal components.
In this case the transistor first charges the inductive coil alone (the diode prevents discharging of the capacitor while transistor is on). Energy builds up in coils magnetic field. Then in next step, while transistor is switched off, this energy is pumped through the diode into the capacitor.
This one is also self-regulating. If output voltage on capacitor drops, the average current through inductive coil will start rising because counter-voltage (during transistor off-time) dropped.
Note that this one fills the output capacitor only during the transistor off-time. This will make output voltage rougher and thus a larger capacitor will be needed to counteract that. On the other hand, this design is much nicer to the input voltage source.
The real world
Two designs, presented here, are never used in the real world. They have too many disadvantages.
Usually switching-mode power supplies with galvanic separation are used. They use a high-frequency transformer which primary winding is excited by square voltage pulses. These pulses are generated by a transistor that, in turn, is supplied from the power grid (a gretz and a capacitor pack stand in between).
The high-frequency transformer can have many secondary windings many output voltage levels. At any of secondary windings, a square-wave AC voltage is generated. It is smoothed (easy because it is a square wave) and supplied to load.