Q&A

# How do I design a flyback converter? What are the basics I should know?

+5
−0

I need to design a simple flyback converter like this: -

I want to control duty cycle from another circuit such as an MCU but, I'm unsure how to proceed. My requirements are: -

• Input voltage 125 volts
• Output voltage 500 volts
• Load resistance is 10 kohm
• Transformer turns ratio 1:1
• Primary/secondary inductance 1 mH
• Operating frequency 100 kHz
Why does this post require moderator attention?
Why should this post be closed?

+9
−0

# Equivalent Circuit, 1:1 transformer

Start by simplifying the circuit and change the transformer to a single inductor. This simplification ignores the benefits of isolation but, flyback converter theory is about transferring energy and not fundamentally about isolation: -

We also don't need to worry about the output polarity being inverted because, when a transformer is used in the real circuit, isolation and correct DC polarity are delivered

# The Operating mode, 1:1 transformer

The circuit operates in either of two modes but, the voltage transfer equation is different for each mode. Therefore, you need to establish the operating mode before you can calculate duty cycle. The operating modes are: -

• DCM (discontinuous conduction mode) - inductor current will fall to zero amps. Accommodates light to medium load currents. Duty cycle lower than CCM.
• CCM (continuous conduction mode) - inductor current remains above zero amps. Accommodates medium to heavier load currents. Duty cycle higher than DCM.

DCM has three distinct phases per switching cycle; charge (red), transfer (green) and hold. The length of the hold-phase accommodates load current variations: -

CCM has just two phases; charge (red) and transfer (green). Load current changes are accommodated by the whole of the inductor current waveform rising or falling: -

CCM and DCM summary

Only one mode will deliver 500 volts to the 10 kΩ load with $V_{IN}$, $L$ and $F_{SW}$ as specified.

• Lighter loads are usually serviced in DCM
• Heavier loads are usually serviced in CCM
• CCM is a natural outcome when DCM can't service the heavier load
• DCM is a natural outcome when CCM can't service the lighter load

The next step is to decide which operating mode fulfills the requirements of the proposed design. To do this we consider the boundary condition.

# Boundary condition, 1:1 transformer

This is where DCM meets CCM; the inductor has delivered all it's energy to the output and the switching cycle restarts immediately. We then need to ask this hypothetical question: -

$$\color{red}{\boxed{\large\text{Is the boundary power transfer more than required by the load?}}}$$

If the answer is yes, then we will operate in DCM. If the answer is no we will operate in CCM.

Boundary Power Transfer Analysis

We need to find the input output relationship and duty cycle in the boundary condition. Simple analysis tells us: -

$$\text{boundary condition }\Bigg\rvert\dfrac{V_O}{V_{IN}} = \dfrac{D}{1-D}\text{ and } D = \dfrac{V_O}{V_{IN}+V_O}\Bigg\rvert\text{ boundary condition}$$

Calculate D using the values in the question: -

$$D = \dfrac{V_O}{V_{IN}+V_O} = \dfrac{500}{125+500} = 0.8000$$

This also delivers $t_1$ (time taken to charge the inductor): -

$$t_1 = \dfrac{D}{F_{SW}} = \dfrac{0.8}{\text{100 kHz}} = \text{8 μs}$$

# Calculating $I_{PK}$ in the boundary condition

Using Faraday's equation for an inductor we know: -

$$\boxed{V = L\cdot\dfrac{di}{dt}}$$

• $V = V_{IN}$ = 125 volts
• $di = I_{PK}$ (the peak current at the end of phase 1)
• $dt = t_1$ = 8 μs
• $L\ =$ inductance (1 mH in this example)

Hence:

$$V_{IN} = L\cdot\dfrac{I_{PK}}{t_1}\therefore I_{PK} = \dfrac{t_1\cdot V_{IN}}{L} = \text{ 1.00 amps}$$

# The stored energy (W) in boundary condition

The inductor's stored energy (W) is found using this well-known formula: -

$$\boxed{W = \dfrac{1}{2}\cdot L\cdot I_{PK}^2}$$

If we plug the numbers in for current and inductance we get an energy figure of 500 μJ.

# The power transfer in the boundary condition

Inductor stored energy of 500 μJ is transferred to the load 100,000 times per second ($F_{SW}$).

$$\color{red}{\boxed{\large\text{This is an equivalent continuous power transfer of 50 watts}}}$$

# How much power is transferred to the actual load?

Unlike the boost converter, all the load power comes through charging the magnetics hence the load requires 500$^2$/10 kΩ = 25 watts. This is significantly less than the power that could be transferred in the boundary condition therefore: -

$$\color{red}{\boxed{\large\text{The flyback converter will operate in DCM}}}$$

# What DCM duty cycle is needed?

We need to deliver a power of 25 watts to sustain 500 volts across a 10 kΩ output load. So now we reverse back from 25 watts and calculate energy transfer (W) per switching cycle.

$$W = \dfrac{\text{25 watts}}{\text{100 kHz}} = \text{250 μJ}$$

This means that the peak current in the inductor is: -

$$I_{PK} = \sqrt{\dfrac{2\cdot W}{L}} = \text{ 0.7071 amps}$$

And, given that we know $V_{IN}$ and $L$, we can calculate $t_1$ by: -

$$t_1 = \dfrac{L\cdot I_{PK}}{V_{IN}} = \text{5.657 μs}$$

$$\color{red}{\boxed{\large\text{This of course is a duty cycle of 0.5657}}}$$

Here's a simulation tool that demonstrates the current waveforms for a 1:1 transformer: -

Hopefully, once I've ironed out a couple of bugs, I'll make this tool available on-line.

# Flyback voltage considerations

In the example above we used a 1:1 flyback transformer to produce 500 volts DC on the secondary. The "flyback" that creates 500 volts DC on the output also gets 1:1 reflected to the primary winding and this means that when the MOSFET switch is deactivated, the DRAIN will see the input voltage (125 volts) plus the 500 volts of flyback. This means that the MOSFET will need to be rated sparingly in excess of 625 volts to avoid damage.

Using a step-up transformer

To reduce this we can use a step-up secondary winding. For example, if a 1:2 step-up transformer is used then the secondary "flyback" of 500 volts is only 250 volts on the primary and, this means the MOSFET can be rated greater than 375 volts on the DRAIN. If a 1:4 transformer is used, the primary "flyback" is 125 volts and a MOSFET with a rating greater than 250 volts can be chosen: -

Note the "N" factor in the above relationships for $V_{SECONDARY}$ and $V_{PRIMARY}$.

Leakage Inductance considerations

There will always be energy stored in the primary that cannot be transferred to the secondary because the two coils will never be 100% coupled. The outcome of this is that when the MOSFET turns off, in addition to the fly-back voltage raising the drain higher than $V_{IN}$ there will be an extra spike due to leakage inductance. This can be dealt with using a diode-capacitor-resistor clamp or a zener clamp: -

Above picture from here.

Note that the zener diode has to allow the normal flyback voltage to occur hence its voltage rating has to be greater than the natural flyback voltage seen on the primary winding.

# Micro-cap 12 simulation 1:1 transformer

• $V_{IN}$ is 125 volts
• D is set to 0.5657
• The peak $V_{OUT}$ is 498.45 volts (target 500 volts)
• The reflected primary voltage is 623.45 volts (498.45 + 125 volts)
Why does this post require moderator attention?

+5
−0

I see Andy has already given a detailed answer with a lot of good background on flyback converters. I'll answer the question more directly about how I would step thru this design if given these requirements.

For reference, here is the general flyback converter circuit copied from the question:

We are further told that:

Vin = 125 V
Vout = 500 V
Rl = 10 kΩ
transformer ratio = 1:1
Lp and Ls inductance = 1 mH
Switching frequency = 100 kHz

The first thing I would do is push back on some of these specs. I can accept that the client needs 500 V across a 10 kΩ load, and that 125 V is available. However, they shouldn't be telling me what transformer to use or what the switching frequency should be. Perhaps there are good reasons for those requirements, but I certainly wouldn't take them at face value. Clients will often over-spec such things and not be aware of the tradeoffs.

Let's say that after a conversation with the client, we find that they really do need to use this specific transformer (unlikely in the real world), and 100 kHz switching frequency (more likely to have a legitimate cause). I really don't like the transformer, since a 1:1 ratio is not ideal for boosting the voltage by 4x. However, we'll go with this anyway.

The next thing I want to know is what power level this is at. That puts the whole design in perspective at the high level. In this case, we know the voltage and load resistance, so the appropriate equation is:

W = V2 / Ω

where W is the power in Watts, V the EMF in Volts, and Ω the load resistance in Ohms.

(500 V)2 / (10 kΩ) = 25 W

OK, now we at least know what ballpark we're in. We're going to have to pay attention to heat dissipation, but shouldn't have to do anything out of the ordinary.

The next thing I want to know is how much primary current can we build up in a single switching cycle. The equation for current change in an inductor is:

A = V s / H

where A is the current change in Amps, V the applied voltage, s the time in seconds, and H the inductance in Henries.

(125 V)(10 µs)/(1 mH) = 1.25 A

I would immediately check this against the saturation limit of the primary, which is not given in this case. For sake of continuing, let's say that 1.25 A is comfortably below the saturation limit of the primary winding.

Then I want to know whether transferring 25 W is reasonably feasible. I really really want this to run in discontinuous mode. With 500 V output it's going to be essentially impossible to find a diode that has fast enough reverse recovery to make this design feasible. The current thru the diode needs to have stopped before the next input pulse start, which applies a large reverse voltage on the diode.

The energy in Joules stored in an inductor is:

J = ½ H A2

(1 mH)(1.25 A)2/2 = 781 µJ

Since we're switching at 100 kHz, the power transfer is (100 k)(781 µJ) = 78 W. This pretends the stored energy can magically discharge instantaneously to the output, but it gives a course-level sanity check. Since 78 W is considerably more than the 25 W we need, it's worth continuing with the more detailed calculations. If it was close to or less than 25 W, we would need to go back to the client and explain that something has to give.

Now let's find what the parameters of the input and output pulses will really be. First we find the energy that needs to be tranferred each cycle.

(25 W)/(100,000 cycles/s) = 250 µJ/cycle

From that we work the energy in an inductor equation backwards to find the primary current that causes 250 µJ.

A = sqrt(2 J / H)

sqrt(2 (250 µJ) / (1 mH)) = 707 mA

Now we find how long the switch needs to be on for to result in 707 mA primary current.

s = A H / V

(707 mA)(1 mH)/(125 V) = 5.66 µs

Since the secondary has the same inductance but there will be 4x the voltage decreasing the current during the output pulse, we know that the output will take ¼ as long, or 1.41 µs. That leaves 10 µs - 5.66 µs - 1.41 µs = 2.93 µs dead time between the end of the output pulse and the start of the next input pulse.

Of course there will be some losses, and the above numbers aren't as precise as they look. I usually do intermediate calculations with at least one extra digit to not add meaningful error to the eventual result. The losses will cause less energy to be transfered to the output than we assumed above. That in turn will cause the controller to lengthen the input pulses a bit to get the desired output voltage. Still, with roughly 60% charge, 15% discharge, and 25% off, there is comfortable margin.

So far all we've done is validate this thing is feasible, and found what the operating parameters will be. Now we have to do the actual circuit design.

The first thing I'd do there is replace the suggested FET switch with a bipolar transistor. At first glance, it might look like the switch only needs to work with 125 V on it, but it's actually far worse than that. During the discharge phase, there will be 500 V on the secondary. Since the transformer ratio is 1:1, there will also be 500 V on the primary. The top of the switch will see this 500 V added to the 125 V supply voltage, or 625 V. There will also be some kickback due to the leakage inductance. I'd want a transistor rated for 700 V at least.

In the 700 to 800 V range, bipolar transistors are going to have better characteristics, be more available, and cost less than FETs. Another advantage is that a FET at that voltage will need at least 12 V gate drive, whereas a BJT still only needs less than a volt on its base. The maybe 1 V or so saturation voltage of the BJT is of little consequence when starting with 125 V. A secondary advantage of a BJT is that it will deal better with the leakage kickback. The Miller capacitance will essentially limit the voltage slope a bit at the end of the charge time. FETs don't handle high dV/dt like that as gracefully.

Let's say we can find an NPN transistor with a gain of 20 at the voltage we require. I haven't actually looked, so this is an example. We found previously that the maximum current will be a bit over 700 mA, so let's use 750 mA as the design point. (750 mA)/20 = 38 mA. That's how much base drive we'll have to give the NPN low side switch. Here is one way to achieve that, assuming a 3.3 V digital signal from a microcontroller, and a 3.3 V supply capable of the extra 40 mA or so:

Q3 is the switch being driven. When the digital signal is low, Q1 is on, which drives base current into Q3 thru R1. Ideally, that is all that would be needed. However, we need Q3 to turn off quickly. Q2 turns on quickly when the digital signal goes high, which then quickly turns off Q3, even if Q1 is slow to turn off.

Note that Q1-2 and R1-3 are all jellybean parts without particularly stringent requirements. Even though Q3 is switching over 600 V, all these parts are operating at low voltage.

Another important design consideration is the output diode (D1). We already found that there will be a couple µs or so dead time between the end of the discharge phase and before the switch is turned on again. The major constraint is the voltage. When the supply is fully running, there will be 500 V on the right side of D1. During the charge phase, there will be -125 V on the left side, for a total of 625 V reverse voltage stress. Of course we want some margin. All together, we need a diode that can withstand 700 V, pass 750 mA, and has a reverse recovery time of 2 µs.

Lastly, we look at what requirements are on the capacitor. Obviously it needs to handle 500 V minimum. We weren't given any ripple spec, but let's say that the 100 kHz ripple should not exceed 1 V. The equation for voltage change on a capacitor is

V = A s / F

where F is the capacitance in Farads. Rearranged to find the capacitance, it becomes

F = A s / V

With 500 V on 10 kΩ, the output current is 50 mA. The minimum capacitance is therefore

(50 mA)(10 µs)/(1 V) = 500 nF

At ½ µF and 550 V, that's going to be a rather substantial and expensive capacitor. This is where I'd go back to the client and find out how much ripple can really be tolerated.

Why does this post require moderator attention?