Ok, so to understand how this works, let's start with a test. This component below is called a choke and is used in switching supplies to block higher-frequency while passing direct current. But we could use it today as a 1 to 1 transformer. Because, in the end, that’s what it is. We have two windings, one on each side, with the same amount of turns, and a ferromagnetic material passing through, and that creates a transformer. We could use this in our todays experiment as a FLYBACK transformer and create a DC to DC converter. I place this component on my breadboard. I will use an Arduino to create a fast PWM pulse that will change its value with the potentiometer, as you can see now on the oscilloscope. We will se later how with this pulse we can change the output voltage of our circuit.
I apply this pulse to some transistors that will be connected to the primary winding of the FLYBACK transformer. At the secondary winding we have to place a diode, a capacitor and a small resistor as a load. Now, I supply 12V at the input of this simple circuit and look what happens. By changing the PWM signal, we can change the output voltage, just as with the buck or boost converters from the past tutorials. We can get a pretty-decent control of the output. I can easily set it to 5V for example using the potentiometer.
Instead of the potentiometer, we could add a simple feedback connected to the Arduino analog input, and set the voltage at a defined value, let’s say 5V. And the coupled inductor doesn’t have to be this big. A small one would do the job as well. So, is very simple to regulate DC voltage with this circuit, but not just that. We have a lot of other advantages by using this setup, so let’s start and see how the FLYBACK converter works.
Ok, below we can see the same circuit we had in the buck or boost tutorial with a coil and diode. But now, instead of that coil we use a transformer, for the first example, with a 1 to 1 ratio. So, how a 1 to 1 transformer could increase or decrease DC voltage. Well, we will see that when we add a diode at the output of the transformer, that will act as a coupled inductor.
In a transformer, we push current through the first winding and another current will pass through the secondary winding and the load attached to that, that’s something basic. In a coupled inductor, we will see later, that because we have a diode at the secondary winding, when we push current trough the first winding, current won’t be able to pass trough the secondary winding. But that energy must go somewhere. Well, the energy will be stored in the core of the inductor as a magnetic field, just as we have seen in the boost/buck tutorial.
Then, in the second stage of the voltage conversion, when we cut the current from the primary, the magnetic field created will collapse and push current in the opposite way in the secondary winding. That’s why, in this configuration, our transformer acts as a coupled inductor, but if we look at the current and voltage values, the coupled inductor acts as a transformer, so we could have a gain and the inductance ratio is given by this formula where n is the amount of turns of each winding.
Then, in a very fast instant, we open switch 1 and close switch 2. The magnetic field that build up will collapse and current will now flow towards the dot of the secondary coil, so a voltage drop will be crated in this way, so we have reversed polarity. So, we can use this reversed polarity voltage in order to get rid of the second switch.
We know that a diode will let current pas only in one direction. So, we change the second switch with a diode. In this case, when switch 1 is closed it will create a voltage of this polarity on the primary. And that will create a voltage of this polarity on the secondary. So current will want to flow opposite to the diode, so by that, the current flow will be blocked and that’s exactly what the second switch was doing when it was open. At this stage, energy will be pushed into the core of the inductor.
Now, when we open the first switch, the field will collapse. If the current in the primary was going into the dot like this, the current in the secondary will now go into the second dot like this, so the current flow is now available and we have a voltage drop on the load in this direction. That’s how we get rid of the second switch with the use of a diode. To get a positive voltage, what we do is to invert the secondary coil, so now the dot will be at the bottom here, and invert the diode as well.
Now we will have a voltage at the output of this polarity. And if we add a capacitor, we could smooth the output and store the voltage, and basically that’s how the FLYBACK converter works. This time period will be given by the PWM signal we have seen before, that will control the switch. But in our example, the switch will be a MOSFET and connected like this to the primary winding. This is the schematic I’ve made for this experiment. The Arduino will control the Don and Doff times according to the potentiometer value.
The PWM signal is applied to a small BJT transistor that acts as a MOSFET driver and that is connected to the MOSFET gate. The MSOFET is our switch that will control the voltage to the primary coil. At the output we have the diode, capacitor and the load and as seen before, we can regulate the output voltage. I have 12V connected at the input. The inductor is a 1 to 1 ratio that’s why the output voltage could only go from the input value to lower values.
The code is just an example with no feedback. We read the value from the potentiometer and depending on that, we create a fast PWM signal and apply that to the BJT and then to the MOSFET. In this way we control the output voltage.
This is the schematic for this Feedback example but with feedback. Make the connections and get the code from below.
So, what advantages we have? First, we have isolation between the input and the output and that’s very important for safety. As you can see, there is no direct connection between the primary and secondary so high voltage could be on one side and low voltage on the other. For example, in a switch supply like this one, the main input is 230V and the output is 12V. Having a perfect isolation between these voltages is a very good safety feature.
Another advantage is the use of multiple outputs. Remember that at the beginning we saw that this transformer had a lot of outputs. That’s because, to the same primary inductor, we could add multiple secondary coils with a different winding ratio. In case of two outputs, the energy that builds in the primary, will then divide for the two outputs and we could have different values at the output. We could even have one positive and one negative output, depending on the configuration. That’s why, switched power supplies with multiple outputs will have a big transformer with multiple windings.
Another advantage is that we could use this as a boost or buck converter since depending on the winding ratio, we could increase or decrease the voltage or do both at the same time.
A disadvantage of this converter is the output noise. Since we have discontinuous current at the input and output, that will create a ripple and the output voltage will have noise. But that is common with all switched voltage converters and we could just ignore it for everyday circuits. For more precise voltage values, you might want to look into other forms of regulating than switched supplies.