Saturday, July 24, 2010

DESIGNING AN AC-DC FLYBACK CONVERTER - PART II



One important thing to know about your flyback converter is whether it will mainly operate in continuous current mode (CCM) or discontinuous current mode (DCM.) For the highest power output per cubic inch, lowest noise, and lower peak currents, CCM is the choice (and most commercial converters are CCM.)

The advantage of DCM is that their is no right-half plane zero in the gain vs. frequency response which is difficult to compensate for. In the CCM condition there is a right-half zero so the bandwidth of the converter must be limited so that the zero does not cause instability.

The use of current limiting in modern converters helps to maintain stability and simplifies design of the feedback compensation network. We will discuss the feedback compensation and design of the feedback network in a later post.

Most practical flyback converters will operate in both CCM and DCM (but not at the same time) if conditions are allowed to put the converter into one mode or the other. Some converters are designed to operate right on the boundary between CCM and DCM.

You can find the operating point of your converter under operating conditions by calculation of the value of the minimum input voltage to maintain DCM which is also the maximum input to maintain CCM operation. This point depends on primary inductance, operating frequency, power required at the input, and the reflected voltage on the primary from the secondary, as well as other factors which we will ignore in this calculation:

Vdccm = ( ( 1 / ( 2 * Lp * Fs * Pin )) - ( 1 / VRO) )^-1

As a practical example, suppose that

VRO = 350 volts

Lp = 0.007 H

Fs = 100000HZ

Pin = 5.8 watts

Then

Vdccm = 126 volts approximately.

So 126 volts is the minimum input voltage to maintain DCM operation. A lower input voltage will force this converter design into CCM operation.

Or conversely, if the input voltage is higher than 126 volts, you cannot maintain CCm operation and you will be operating in DCM mode.

Wednesday, July 21, 2010

AC-DC FLYBACK CONVERTER CALCULATIONS, PART I



Fig. 1 shows a simplified schematic of a typical flyback converter topology. Not shown is the feedback loop components and the source of VCC power for the PWM IC, which will not be discussed in this article. A brief description of the circuit is as follows: V1 is the main source of AC power. The AC power is rectified by the diodes D1 - D4 and filtered into a DC voltage by the input capacitor C1. L1 and L2 make up the switching transformer, with L1 being the primary and L2 being the secondary (isolated form the primary side high voltage.) There can be several secondaries with either a low voltage output of high voltage output or combination of both. M1 is a NMOS mosfet usually used for switching current through L1. This semiconductor could also be an IGBT or other type of high frequency solid state switch. R1 senses the peak switch current and allows the PWM IC to turn off the M1 switch if the current reaches the maximum setting allowed determined by the value of R1 and the voltage threshold level in the IC, usually approximately 1 volt. When the switch M1 turns off, the current in the inductance L1 causes a high voltage spike to appear on the drain of M1 which is due to the leakage inductance of the transformer. The best made switching transformers usually have less than 3% leakage inductance between the primary and secondaries. The voltage spike is "snubbed" by the diode D5 and the snubbing elements R2 and C2. R2 will dissipate power during the snubbing period and so can have a major effect on the efficiency of the converter. Following the "spike", energy is transferred to the secondaries, rectified by D6 and filtered by C3. R3 represents the load. A feedback signal is usually taken from one of secondaries to feedback to the PWM IC. The feedback components are not shown in Fig. 1. There are many "gotchas" in a design like this if the designer is not careful in his selection of circuit values and components. This article will start with a few basic calculations to get started.

Required input power is calculated from the required output power as

Pin = Po / Eff

where Po is the required output power and Eff is the required efficiency of the converter. These values are usually in the unit specifications.

Minimum and maximum DC voltage after rectification (ignoring losses in the diodes and traces, etc.)

Vdcmin = 2^0.5 * Vacmin

Vdcmax = 2^0.5 * Vacmax

An important calculation is the reflected voltage seen at the switch M1 from the secondary of the transformer:

VRO = Np * (( Vo + Vf ) / Ns )

where Np is the number of primary turns and Ns is the number of secondary turns (see my previous posts on transformer design), and Vf is the diode forward voltage.

We can make a calculation to see if the design will work with the minimum AC voltage input from the following equation:

Vdcmin = ( 2 * Vacmin^2 - Pin * ( 1 - Dch ) /( C1 * Fl ) ) ^0.5

where Dch is the DC link charging ratio (refer to Fairchild semiconductor application note AN-4138) Dch is usually approximately 0.2 for a quick estimate. Fl is the AC line frequency. If Vdcmin comes out to be an imaginary number this means that Vacmin is too low, or Pin is too high, or C1 is too low, Dch is too high, or all of the above.

The nominal voltage on the drain of the switch (not including the leakage inductance spike) is

Vdsnom = Vdcmax + VRO

The base value of the peak current in L1 and M1 is given by

IEDC = Pin / (Vdcmin * Dmax )

where Dmax is the maximum allowed duty cycle on switch on-time. This value is usually determined by the specifications of the PWM IC but it is also affected by the current limit set by R1 in the circuit.

An additional component of the current in continuous current mode (CCM) is given by

dI = Vdcmin * Dmax / (L1 * Fs )

where Fs is the switching frequency determined by the PWM IC and sometimes some external RC timing components (not shown if Fig.)

The maximum peak current is then

Idspeak = IEDC + ( dI / 2 )

We can also calculate the RMs switch current in L1 and M1. This information is good to determine so that switch and transformer power dissipation can be calculated.

Idsrms = ( 3 * IEDC^2 + dI^2 * (Dmax / 12 ) ) ^0.5

Idsrms is the RMS value of switch current at minimum DC voltage input.

Wednesday, July 7, 2010

DESIGNING SECONDARY WINDINGS OF A FLYBACK TRANSFORMER

In a previous post we discussed the design of the primary of a switchmode transformer for a flyback converter. In the last post we described the basic topology of a flyback converter with one output. Now we want to design the secondary winding of the converter. We will use the specifications we discussed in the just before the one immediately preceding this one. In that post we described a 100 watt converter with a maximum input voltage of 1000V and a 70% efficiency. A 150 watt input power was required to provide the 100 watt output. The primary was 90 turns with an inductance of 5 mH.

Lets assume the following basic specifications for the secondary side output circuit;

12 volt output at 8.333 amps (100 watts). We will shoot for 8.5 amps for a very slight margin over 100 watts to 102 watts.

First we recognize that in a flyback converter, energy is stored in the primary side inductor and air gap during switch-on time, is then transferred to the secondary circuit, less the energy lost in lossy elements in the primary side circuit, when the switch turns off, and the core resets. Lossy elements are the transistor switch, snubber circuit, the primary winding resistance, and other lossy elements including parasitics. By conservation of energy we can write the equation for the energy balance:

Ef * Lp * Ip^2 = Ls * Is^2

where Ef if the efficiency of the primary side circuit in this simplified equation, Lp is the inductance of the primary, Ip is the primary current, Ls is the secondary winding inductance, and Is is the secondary current. From that equation we can use a little algebra to find the inductance of the secondary winding. We will use input current for a 1000v input that would be 0.15 amps for a 150 watt input capability:

Ls = Ef * Lp * ( Ip / Is )^2 = 0.7 * 0.005 * ( 0.150 / 8.5 )^2 = 1.09 * 10^-6 H

or approximately 1 microhenry for the secondary inductance.

We also have the standard transformer equations which are not totally accurate for a flyback converter but they will serve well enough for preliminary calculations:

Np / Ns = sqrt ( Lp / Ls )

In other words, the turns ratio is equal to the square root of the inductance ratio. We can use the above equation, adding the efficiency factor into the equation to solve for the number of secondary turns:

Ns = Np / sqrt ( Ef * Lp / Ls ) = 90 / sqrt ( 0.7 * 0.005 / 10^-6 ) = 1.52 turns

In the construction of a prototype sample we would probably round up the turns to 2 although there are methods of winding the equivalent of fractional turns. This winding would probably be made of copper foil instead of wire for better coupling with the primary winding.

We have now have a preliminary calculation of the secondary inductance and number of turns, but there is a lot of work left to do. Now it would be a good idea to simulate the transformer and power switching stage using SPICE or some other simulation software. You might find that the secondary inductance and number of turns needs some change in values, especially when parasitic and lossy elements are introduced.

In the above calculation we did not consider the condition of minimum input voltage. If the minimum input is say 200 volts, we would get much different answers in the above calculations and it would be necessary to use the values for the minimum input voltage to make sure we will have enough output power and voltage.

In another post we will discuss design of the remainder of the secondary circuit elements (refer to Fig. 1 in the previous post.)

THE BASIC FLYBACK CONVERTER



Fig. 1 shows the topology of a basic flyback converter (less the drive control and feedback circuits for simplicity.) This will be the basis for further discussion of key components and the basic function of the converter.

V1 is the source of voltage to be converted. If the source is an AC source it will have to be full wave rectified to DC before it is applied as the DC source to the converter. The full wave rectification circuit is not shown here for simplicity. C1 is the basic input filter capacitor. It must have a large enough value to filter noise from the switching of the transistor M1 and also be high enough to "hold up" the DC voltage to the converter in the event of a line droop. The time to hold-up the system is usually 1/2 AC cycles to 1 full AC cycle.

M1 is the main switching transistor that allows control of the duty cycle of the converter through the action of its control circuit (not shown.) R2 is used to sense peak current through the transistor and the current in the primary, L1, of the transformer consisting of L1 and L2.

R3, C3, and D2 work together to "snub" the peak voltage on the transistor M1 to help control the initial turn-off voltage spike which occurs on the drain of the transistor on each on-off cycle. R3 and C3 are carefully chosen to get the best snubbing without excessive dissipation in R3 or loss of energy being transferred to the secondary circuit.

L1 is the primary of the transformer and must be carefully designed to handle the sometimes high voltage input and the large peak currents that can be required. My previous post covers some of the design considerations for the primary.

The secondary circuit consisting of L2 of the transformer, D1, C2, and R1 should be isolated from the primary side of the circuit to protect uses from electrical shock from the voltage source which might be a high voltage. R1 represents the load which could be a combination of inductance, capacitance, and resistance. An Example would be an electric motor. One important note about C2 is that in flyback circuits, this capacitor has a very high ripple current with high peak values and it must be carefully selected for its current rating and long life. A good choice for this capacitor is the solid aluminum electrolytic capacitor or other long life types for low voltage outputs. Later posts will go into more detail on design of the secondary circuit.

Sunday, July 4, 2010

CALCULATING THE PRIMARY WINDING AND AIR GAP FOR A SWITCHMODE TRANSFORMER

In the previous blog we showed how to calculate the inductance needed for an example power supply with a max input of 1000 volts and a power rating of 150 watts. Now lets see how to calculate the number of turns required. This is the standard formula for a square wave voltage so it approximates the switchmode condition. This formula will give us a starting point and it also verifies that we have at least the number of turns to withstand the applied voltage without magnetic saturation:

N = Vpk * 10^8 / (4 * Bmax * Ac * F)

where N is the number of turns, Bmax is the maximum allowed flux density without saturation for the material to be used ( some type of ferrite ), Ac is the core area, and the frequency F. We will work in CGS units and the flux density will be in Gauss units.

For a 150 watt transformer, from experience I will estimate the size of the transformer as a cube approximately 5 cm on a side ( about 2 inches.) This will also be the approximate size of a magnetic structure of say an EI or EE structure. Assume that the structure will be an EE form with a single air gap in the center of the structure. With this size and form I will further estimate (based on experience that the core area will be a square cross-section 1 cm on a side or 1 sq. cm. Assume further that the operating frequency will be 100KHZ. Now we can calculate our initial number of turns from our equation above using Bmax as 4000 (you will need to check what Bmax is for the ferrite material you plan to use) as

N = 1000 *10^8 / (4 * 4000 * 1 * 100000) = 62.5 round off to 63

Now we will need to know what is the magnetic path length of the core structure we have selected. You will most likely use the number you find in the manufactures catalog. Here we will estimate it to be 10 cm based on the size of the magnetic structure and its form. Also we will use 1/2 of the Bmax value as our max operating flux level, or 2000 Gauss. Then we will use our data so far and the following formula to calculate the effective permeability of the core as

Ue = B * Pl / ( 1.257 * N * I )

We will use 1 amp as our max current I, flux density B of 2000 Gauss and for the magnetic path length Pl our estimate of 10 cm:

Ue = 2000 * 10 / ( 1.257 * 63 * 1 ) = 252.55 round off to 253

From the catalog we need to obtain the permeability, U, of the ferrite material we are going to use. Lets assume that the basic permeability is 2500. Now we can make a first calculation of the air gap from the formula

Lg = Pl * ( 1 / Ue ) - Pl * ( 1 / U)

Lg = 10 * ( 1 / 253 ) - 10 * ( 1 / 2500 ) = 0.0355 cm

The above would be enough calculations to build an experimental transformer, but it might be wise to do some more calculations to verify the previous results. I will not do all of the numerical examples here but I will show the equations you can use , still working in CGS units.

Re-calculate the number of turns based on the effective permeability, Ue, and the required current I :

N = B * Pl / ( 1.257 * Ue * I ) = 62.89

This value of 62.89 checks well with our original calculation of 62.5, so we will stay with 63 turns for the primary of the transformer.

Next we can calculate the actual inductance of our transformer primary for our design to this point:

L = 1.257 * Ue * N^2 * Ac * 10^-8 / Pl = 0.00126 Henry

This value is less than what we originally decided we needed (from the previous post) of 0.005 H. So we will need to increase the area of the core by a factor of approximately 4 increasing Ac to 4 cm sq.

Now we need to check on the core area, Ac, that we need so we will compute it from the desired inductance value and effective permeability, assuming we did not change it:

Ac = L * Pl * 10^8 / ( 1.257 * Ue * N^2 ) = 3.96 cm^2

The result of the calculation is obvious from looking at the equation. We could have also increased Ue or N to achieve the same result, but it is better to increase Ac so that the maximum operating magnetic flux is not increased. Now it would be good to run back through our above calculations with our new value for L and Ac to get a design closer to what is needed (several iterations may be needed.)

But lets look at a little more design work. It may be better to compromise between the original estimate of Ac and the new, so that you might want to try some new values for Ac and N. One thing to note in the inductance formula is that L is proportional to the square of N so we can just do a minor increase in N along with a more practical value for Ac to get the 5 mH inductance we want. To do this we will "push" the design a little making it a little more risky but easier to make the transformer. For example, as a more practical value lets try 2 cm sq.for Ac. Also lets increase the turns N by a factor of about 1.4 or to 90 turns. We can wind the primary as two layers of 45 turns each. After re-doing the inductance and operating flux density calculations we have the following (the reader should be able to do these calculations now):

V = 1000 volts (spec.)
I = 1.0 amps (spec.)
Ac = 2 cm sq. (changed)
N= 90 turns (changed)
Ue = 253 (did not change this)

L = 0.00515 mH
B = 2862 Gauss

So now the changes yield the inductance you want at the price of increasing the operating flux density but still staying considerably less than the maximum of 4000 Gauss. This would be a possible starting point to for your design, but you will still need to determine how to design the secondary windings. We will cover this in another post.

Friday, July 2, 2010

HOW DO YOU PICK INDUCTANCE FOR A FLYBACK CONVERTER?

In the initial design phase of a flyback converter, there is the usual need to pick or design the inductor-transformer as a basic component. So what should the primary inductance be set to? Well it depends on what the global specifications are for your power supply, i.e., maximum input voltage, power required at the output, and an estimate of the switching frequency of the power supply.

The switching frequency is usually decided on the basis of the design and manufacturing technology you have available to you and is usually between 100KHZ and 1MHZ. The higher the frequency is, the smaller the filter components need to be, but the more difficult the design and manufacturing gets to be. For example, if you already know that all of the power supplies you have designed or your company designs run at approximately 100KHZ, you will probably need to operate at that frequency.

So lets say that you have the following global specifications as a minimum to start with:

maximum input voltage 1000 volts.
minimum input voltage 600 volts.
power output 100 watts.
efficiency 70% minimum

So now it is easy to compute the input power, Pin, based on the output power, Pout, required and the efficiency, e :

Pin = Pout / e = 100 / 0.7 = 143 watts

To provide a little power safety margin, lets round up to 150 watts for the required input power.

We will assume for this initial calculation that load current is reasonably constant so that we can compute the average input current that is required at the maximum input voltage, Vinmax, as

Iavg = Pin / Vinmax = 150 / 1000 = 150 ma

Lets assume further that your converter will operate at a frequency F = 100KHZ

Now my rule-of-thumb formula for the required inductance L is the following:

L = Vinmax * Dmax * T / Ipk where Dmax is the duty cycle, T is the switching period, and Ipk is the peak switch corresponding to the max duty cycle (from the equation V = L * di / dt .) Note that Ipk will never be zero in theory or in real operation.

We can re-write the equation for L in terms of frequency as

L = V * D / ( Ipk * F )

Assume that we will allow an Ipk of 1 amp before the switch is turned off. At a duty cycle of 0.25 we would have an average current input of approximately 250 ma which would allow a peak power of 250 watts input at 1000V input (0.25 * 1000) and 150 watts at 600V minimum input. This should be plenty of power capability. If the minimum input voltage is lower, more peak switch current will have to be allowed, Ipk.

Assume worst case conditions for the inductor; maximum input voltage and maximum duty cycle of 50%. Compute the required inductance at 100KHZ switching frequency:

L = Vpk * D / (Ipk * F) = 1000 * 0.5 / ( 1 * 100000 ) = 0.005 Henry = 5 mH

Now the next thing you need to consider is the fact that the inductor-transformer must not be allowed to saturate due to excessive magnetic field density in the core. If it does saturate the inductance will drop to a very low value and current will become an indefinitely large value possibly destroying the power supply.

The equation for calculating the maximum flux density ( and verifying that the value is within the inductor-transformer specifications ) is as follows:

Bmax = Vpk * 10^8 / ( 4 * N * Ac * F )

where N is the specified number of primary side turns and Ac is the core area. The above equation is a worst case situation where any air gap is very small or zero. Note that the allowed Bmax depends on the magnetic material in the core which is usually a ferrite material.