Transformer Calculations
Stuff we learned:
max duty cycle should be between 0.4 - 0.6 (we’ll spec it to be 0.5)
operating switching frequency should be between 50 to 140 kHz
Primary Side Inductance Calculation:
DCM formula: https://www.infineon.com/dgdl/an-1024.pdf?fileId=5546d462533600a401535591115e0f6d
If Cres doesn’t exist (which doesnt exist in the InnoSwitch design), then the following formula comes out (found on a different DCM source, https://www.monolithicpower.com/how-to-design-a-flyback-converter-in-seven-steps )
To check whether that formula is correct, let’s take the 180W innoswitch example and then plug in their design parameters and see if the inductance we get is close to what they used:
We don’t know how FACTOR_Z impacts the primary inductor calcs, so we’ll just ignore that.
Plugging in the values yields 414.1 uH, which is very close to the 430uH they used!
So now we can calculate with our parameters:
efficiency = 95% (the 180W example used 97% in calculation, but only achieved 95% irl)
Vin_min = 90V (min voltage of battery pack)
Pout_max = 70W (a little more than the 60W expected max power draw in requirements page)
K = 1 (because DCM)
f = 55 kHz (datasheet recommends 50-140kHz, but since lower freq is more efficient (less switching loss), we will also pick a low value. 55 is between 50 ('recommded min) and 57, which is the 180W example amount)
So the L we get from the above equation is the maximum primary side inductance we can use such that the converter is always in DCM, even in worst-case scenarios (which were the inputs to the above).
We will also spec the inductor to be slightly less than 250uH, just to be safe, so L = 240uH.
Using that inductance value, we can then reverse-calculate the duty cycle we expect to see at certain operating parameters (pack voltage and power consumption):
Nominal duty cycle of 0.23 is reasonable, so L = 240uH is reasonable!
Turns Ratio Calculation
Output voltage is a function of turns ratio, input voltage and duty cycle, in the following formula:
In our applications, since the input voltage is significantly higher than the output voltage, we expect N2 to be less than N1. Also, since it’s a ratio, we can define the ratio as ‘n:1’, where n is the number of coils on the primary side for a given number of coils on the secondary side (simplified to 1 for math’s purposes)
So then, the formula becomes:
Then, clearly, if n is very large, then D has to be larger to compensate in order to keep Vout the same. Likewise, is n is smaller, then D has to be smaller to compensate.
We will define the ‘worst case scenario’ as when D is as large as possible (0.5), and ask ‘at this point, what is the MAXIMUM value of n before the output voltage can no longer be the desired amount (12V). We will actually round 12V up to 12.5 just to be safe. In this worst-case scenario, we also will define the Vin to be the minimum (90V), since lower Vin means larger D.
So then, we define our worst-case parameters as follows:
Therefore, for an N:1 turns-ratio transformer, N must be less than 7.2. Conveniently, we will pick N=7, so our transformer should have a 7:1 primary to secondary turns ratio
Peak Primary Current, Ipk
Peak primary current is supposedly calculated using the following formula (from here):
Dmax = 0.5 (from above)
Vin_min = 90V (from above)
fsw = 55 kHz (from above)
Lp_max = 240uH (calculated from above)
But then why is there a 2 term in the denominator? We’re not using RMS, these are DC values
From this other source, there’s no 2 in the equation:
When you also try to derive the equations yourself with V = L dI/dt and tON = D*1/f, you don’t get a 2
So we will assume there is no 2 involved:
Ipk = 3.4A, which is very high….
Looking at the InnoSwitch datasheet, these are the rated I_limit values
With this in mind, we should use INN4076 (or higher) with the 4.7uF BPP configuration
Transformer Core Selection
This is a very trial-and-error and convoluted process, but I will try to document the decisions and calculations
Calculations were performed on this spreadsheet: https://docs.google.com/spreadsheets/d/1O1wjWdbnPksTQmW_tAbk-rAPtSNWPjp_Yc3J71V07ag/edit#gid=1114770555 , and a Desmos page that @Jonathan Xie used just for clarity of presentation
Skin Depth
Regardless of what core selection method we follow, skin depth is an important factor to consider, as it determines the minimum wire gauge that should be used at our operating frequency.
Skin depth, based on the formula from Charlotte EDU (see section below), is:
where Awire is in mm^2, so we want to pick a wire with a MINIMUM cross-sectional area of 0.25mm^2, or 0.0025cm^2, or 2.5cm^2*10^3
To verify this is correct, we use Skin Depth Calculator - Engineering Calculators & Tools , and see:
So then plug into area of circle formula:
We see minimum wire area is also ~0.25mm!
According to Table 4-9 in chapter 4, we the MINIMUM wire size we can use is 23-AWG. Since that is not a common AWG size, we will instead use 22-AWG as our minimum wire size. 22 AWG will be used for the primary coils, since they carry low current and require many turns.
Core Selection - Area Product Method
Previously, I tried following the area-product method from a video (shown below), but it didn’t yield such good results, due to lack of clear calculation steps and available resources for types of transformer cores and their properties.
However, the video is very useful for learning about the general procedure of finding a transformer, and the fundamentals behind the magnetics
Examples
180W uses this: https://www.digikey.ca/en/products/detail/tdk-corporation/PC95PQ32-30Z-12/9607321
60W uses this: ATQ23.7 (not on digikey)
Charlotte EDU - Ku Method
I found a series of lecture material regarding magnetics. The most important one is Chapter 13, Transformer and Inductor Design, which containts many examples (with calculations) of how to design a transformer for power converters:
This is a very long process, so I will summarize what was done below, and then put all the details in an expand:
Calculate parameters that we already knew such as peak primary current, average primary current, primary inductance, etc
Based on these input parameters, we use their magical equation to determine ‘Kg’, or the ‘core geometry factor’, which is a product of the Ac (core area), Aw (winding area) and MLT (mean length per turn)
Transformers come in standardized packages, each of which with varying values for Aw, Ac, etc, so they all have an associated Kg value. We then find transformers with similar (or slightly higher) Kg values as calculated above, and then we will use a spreadsheet on those transformers to pick one (next section)
For details, see below:
Number of Primary Windings
Now that we have a list of transformer core options, we can pick one that best suits our purposes, and then find the number of primary windings we should have. This was a semi trial-and-error process, but I got a reasonable conclusion in the end, so:
Both the Powerful Electronics and Charlotte EDU approach involve finding a balance between two things:
Finding a core area such as to not saturate the core during peak primary current
Adequate winding area (cross-sectional) so that there is enough space to fit all wire
The number of primary turns, which we will denote with ‘Np’, plays into both of the above parameters, because:
You need a MINIMUM amount of primary turns such as to not saturate your core during peak primary current, BUT
You cannot have too many turns, or else your wire becomes too small (and thus has too high of a resistance), or you will run out of transformer core space
So, whenever you are designing around 2 restrictions, you usually want to optimize for one restriction, and then calculate the corresponding effect on the other restriction
‘The dumb method:’
If you wish to base primary windings off the 2nd restriction, you have to:
estimate what percentage area of the transformer will be used for primary windings (typically 40-50%)
define a target current density, 'J' (typically 3A/mm^2 for copper)
define a factor that represents what percentage of the available space you actually have for copper, since you will have wasted space from wire insulation, inability to pack properly, etc (usually also 0.4 to 0.5)
THEN, you can calculate, based on the available winding area of the transformer, how much space you have available for primary windings, and then divide by the cross-sectional area of the wire you want to use, which will yield your desired number of turns. But this is kinda dumb, because it runs off raw assumptions.
'The smart method'
Instead, we will use the 1st restriction, which is must more simple, and more critical, because you never want to saturate your core.
Using this good resource, The Effects of an Air Gap in Magnetics and the Powerful Magnetics video, we can derive from Faraday’s Law and the properties of an inductor, that:
Where IP is peak current, L is primary inductance, B is magnetic flux density, A is the core area, and N is the number of turns. Every core saturates at a certian value of Bmax, which is a material property. Since we will use a Ferrite core (it is more efficient at these high switching frequencies and is commonly available for cheap), we will define Bmax = 300mT.
So then, we can calculate the minimum number of turns, Np, such that the resulting B is less than 300mT!!
Selecting a Core
Using the spreadsheet, we see that the EFD-30 core requires at least 39.5 primary turns to not saturate, which we can conveniently round up to the next number divisible by 7, which is 42! This of course means the secondary number of turns will be 6
Also, 42 seems like a ‘reasonable’ number. The 180W example has 40 primary turns.
I then found a core on digikey: https://www.digikey.ca/en/products/detail/epcos-tdk-electronics/B66423G0000X187/3914948
and its associated bobbin: https://www.digikey.ca/en/products/detail/epcos-tdk-electronics/B66424W1012D001/3914953
which both happened to have CAD models, so I downloaded those and started hypothetically testing wire fits.
Determining the Gap
(The resource The Effects of an Air Gap in Magnetics is a very good read, and will be heavily cited for this portion)
Now that we have a core, all that’s left to do is roughly calculate the gap that will be required to achieve our desired inductance.
Every core has a specified ‘Al’ value, which is in units of H/turns^2. The EFD-30 core has an Al value of 2.05uH/turns^2, so multiply that by 42^2 yields 3616uH, which is far larger than our desired 240uH. As such, we will introduce an air gap in our transformer to reduce the magnetic permeability of the transformer, thus decreasing the primary side inductance.
The magnetic reluctance, R, of a transformer is given by:
Where N is the number of primary turns, and L is the required inductance
According to The Effects of an Air Gap in Magnetics and other resources, it is a reasonable assumption to assume that almost all of the magnetic relucatance of a gapped transformer comes from the air gap (since the core itself has very low reluctance). So then, the magnetic relucance, R, of the transformer based on a given gap, g, is given by:
where μ0 is the magnetic permeability constance of air (4π*10^-7 H/m), and A is the effective area of the core (Ac). Then, the gap, g, can be easily isolated for.
However, that is not the end, as there is something known as the fringing factor. You can read the linked resource about what that is, but basically, this fringing factor causes the true inductance of the transformer to be actually HIGHER than what it theoretifcally should be. This can be counteracted in two ways:
reducing number of turns
increasing the gap to be larger
Online resources to use option 1, as less wire = less ESR (equivalent series resistance) and you save money and space. However, we absolutely don’t want to saturate the core, and we have enough space, so we will go with option 2.
Also, the theoreitcal gap required to achieve 240uH will definitely be different than the actual gap, so this will be a trial-and-error thing anyway. Thus, we should not change the primary number of coils to account for fringing factor, which is what some resources will recommend.
Also, since the gap is actually distributed across 3 sections of the transformer (as opposed to one), the ‘true’ fringing factor will be different, as the fringing factor formula is non linear. That is,
f(g) != 3*f(1/3*g)
where f(g) is the fringing factor for a given gap, g. But again, we will trial and error the gap. The only thing to check with calculations is that the required gap is not an unreasonable number. The calculator says the required gap for EFD-30 is 0.635mm, which is very reasonable and consistant with other examples
Transformer Cross-Section
The EFD-30 core (orange) and its bobbin (green) are shown in the assembly below
I then made the following transformer cross-section diagram:
(outer bounding box is taken from the true space available between bobbin and core)
Layer | Function | # strands x wire gauge | Turns | Reasoning |
---|---|---|---|---|
1 | Primary Layer 1 | 1 x 22 AWG | 21 | 22 AWG is smallest common wire size based on skin depth at f = 55kHz |
2 | Primary Bias | 3 x 30 AWG | 4? | Yes 30 AWG is less than skin depth, but this shouldn’t matter since this is just for the bias windings, which draw very little current. Also there will be 3 strands |
2 | Secondary Bias | 3 x 30 AWG | 3? | ^^ |
2 | Shield | 1 x 30 AWG | (until the end) | Wires that exist for shielding go brrrrrr (idk everyone else does it and we need to fill the leftover space in the bias layer) |
3 | Secondary | 3 x 20 AWG |
| Want more surface area for secondary layer since higher current will be experienced. 20 AWG is the max size that the height restriction of the core allows, and 3 strands is the most that the width restriction allows |
4 | Primary Layer 2 | 1 x 22 AWG | 21 | Split primary windings into 2 layer |
PI expert
(ignore this, gave useless information)
Bias Windings
Now that we know there will be 42 primary windings (and 6 secondary windings), we can determine the required number of windings for the primary bias (VBPP) and secondary bias (VBPS)
According to absolute maximums:
But then for nominal voltages:
But, both biases should provide operational voltages within the entire operating input voltage range. Doing the math, while factoring in the 1.25V drop across the rectifying diode:
We see that the bounding regions overlap. That is, there is no number that perfectly satisfies both the max/min voltage conditions at max/min battery voltage, respectively (the min is greater than the max).
As always, we learn by example, so let’s see what the the 180W example did:
The title of the design states that the module accepts 90-265VAC input, but under the ‘transformer design spreadsheet’, the input voltage range is defined as 300-410VAC for some reason. Either way, using the numbers they have for primary, bias 1 and bias 2 windings, we see that in every single case, the voltage at both the BPP and BPS pins are much higher than 6V.
So, I will assume it is always better to have over-voltage than under-voltage. So we will pick bias windings of Bias 1 = 5 turns and Bias 2 = 4 turns