In Which I Begin to Lose My Mind

In my last post, I attempted to reverse engineer an EL wire power supply to see how it worked.  This brought up a few more questions that I decided to investigate, and the following investigation brought me to the brink of insanity and back.  I started to doubt the very consistency of space and time as time and time again my measurements seemed to prove what I knew should be impossible.

Seriously, ask any of my friends.  I haven't been able to shut up about this all week.

Disclaimer

What follows is a very math/physics intensive and very dry explanation of some of the unique properties of inductors and transformers.  I originally intended to try to spice things up by making this post into a video "chalk-talk" where I could talk through my math, but after numerous attempts, I have realized that I do not have a concrete enough understanding of these topics to put myself on the spot like that.  Hopefully this post will suffice.

If you find any mistakes in my work, please let me know!  I'll be sure to update it.

A Terrible Discovery

The morning after publishing my EL wire post, I decided it would be fun to check my work.  In the post, I determined the turns ratio of the supply's transformer by measuring the inductances of each winding and taking \frac{\sqrt{L_{1}}}{\sqrt{L_{2}}} to get the turns ratio.  I came up with approximately 1:22.

This seemed to make sense because the input/output voltage ratio was approximately 1:22 as well (5V-ish in, 100V-ish out). Well, I set to work disassembling one of my transformers to count the windings:

There was a layer of protective tape around the wires and of course the inductor core itself. The core was comprised of two E-shaped pieces that were glued together. Unfortunately, I was unable to get to the wire without breaking the core apart. The primary winding came off easily:

I counted about 30-35 windings on each of the two taps. The secondary winding wasn't as easy to unwind.  It was made from extremely thin wire that broke about 15 turns in.  At this point, I was unable to find the end of the wire (like when you lose the end of the scotch tape), and decided to take a different approach:

Nothing a dremel couldn't fix.

Now all I had to do is count how many bits of wire there were.  Sure, it's a little tedious, but I only expected there to be 600-800 (22x30) of them, so it couldn't be too bad.

Ok, that is a lot of wire...

So I started counting, and got a little concerned when I reached 700 and didn't seem to be even close to done.  When I got to 1000, I knew something was wrong.

Okay, so this sucks.  Clearly my ratio is much higher than 1:22.  How high is it?

Bringing in the Big Guns

I needed a better method of measuring inductance.  For this, I turned to an Agilent LCR meter that I borrowed (they usually run around $400).  Here's what it came up with for the secondary winding.

414 mH is not that far away from the 450mH I estimated in the last post.  Not too bad. Now for the primary winding:

98 \muH, that's not too ba-wait.  I got 900\muH last time!

This thing is measuring an order of magnitude lower! At first, I thought I had maybe made a math error seeing how close I was to being exactly an order of magnitude off.  Further examination and re-checking of measurements revealed that my math was sound, so something else had to be wrong. In the short term, this cleared some things up.

Assuming the LCR meter was correct (and it was), my turns ratio is actually \frac{\sqrt{414mH}}{\sqrt{98\mu H}} which works out to 1:64.  This means that because my primary winding was 30 turns, my secondary was 1920!  That seems so much closer to the right number.

So What Did I Do Wrong?

The particularly strange thing is that I was able to find the same erroneous number through two different methods.  This leads me to two main questions:

  • If the inductance of the primary coil is actually 1/10 what I measured, how did I repeatedly get the same (wrong) value using my measurement method?
  • If the turns ratio is actually much higher, why don't I get a higher voltage at the output?

Parasites

So, let's review my method for determining the inductance of the primary winding.  When a capacitor and inductor are placed in parallel, they set up an LC oscillator.  If the oscillator is excited, current will begin to flow back and forth.  Essentially, energy is moved from the inductor to the capacitor and back again.  When the capacitor is fully charged (maximum energy) there is no current flow (minimum energy in the inductor) and vice versa. The important thing for me is that the frequency of this oscillation is based on this formula:

\Large F= \frac{1}{2\pi \sqrt{L\times C}}

The F is the resonant frequency, C is the value of the capacitor I placed in parallel, and L is the inductance which I'm trying to find. Here's a doodle of my oscillator:

There's just one thing wrong with this particular doodle.  It shows my inductor as an ideal inductor.  This is far from true. Inductors usually have some level of parasitic capacitance.  This is a result of having a bunch of insulated copper wound up into a small space, and it's a sometimes undesired effect that isn't easily avoided.

Though my inductor is not an ideal inductor, I can model it as one as long as I throw a parallel parasitic capacitance along with it.

Because these capacitances are in parallel, I can simply add them.  So now my equation becomes.

\Large F= \frac{1}{2\pi \sqrt{L\times (C+C_{P})}}

With this in mind, I ran the experiment again a few times.  I also cheated a bit.  Since I already knew what the inductance was, I instead solved for C_{P}.  If I didn't know the inductance, I could have found C_{P} and L at the same time using a system of equations and two data points. Here are my results:

Added Capacitance Resonant Frequency Parasitic Capacitance
1nF 41.11kHz 156nF
100nF 31.83kHz 163nF
.22nF 42kHz 151nF

So after running the experiment three times at three different capacitor values, I got similar results for parasitic capacitance. That's reassuring. My inductance appeared to be higher because I was making the poor assumption that the capacitance was lower (i.e. C_{P} = 0):

\Large \frac{1}{2\pi \sqrt{L\times (C+C_{P})}} \approx \frac{1}{2\pi \sqrt{(L+L_{error})\times C)}}

So if you're not careful, the same resonant frequency can get you different values for L.

Another cool note is that if you know the inductance (by reading it off a data sheet or something), you can quickly determine the parasitic capacitance by setting up your LC with no C at all!  The parasitic capacitance can be enough to get your inductor to self-resonate.

It's also worth noting that my original measurement for the secondary winding wasn't nearly as far off because the parasitic capacitance on the secondary winding was much smaller (I measured about 1.9nF)

So why didn't this capacitance effect the LCR meter?  Well, because it was $400 obviously.

Set Phasors to Stun

So, having this solution gave me temporary respite, but it still couldn't help to explain why my input/output voltage ratio was wrong. Typically, voltage ratios are determined as follows:

\Large \frac{V_{2}}{V_{1}} = \frac{N_{2}}{N_{1}}=\frac{I_1}{I_2}

So, how can it be that my output voltage wasn't 64 times my input voltage?  Again, I was assuming that my components were acting ideally. To solve this problem, I had to do a major refresher course of just about everything I learned in school.  Looking for a solution, I came across my notes for an old power electronics lab class I took.  As it turns out, Lecture 13 was on this very topic, and I still had the handout from that lecture!

Protip: Never throw anything away ever.

What follows is my attempt to work through the explanation offered in the notes.

Stick to Your Ideals

Let's first consider an ideal transformer:

An ideal transformer is one where all of the magnetic fields generated by one winding pass through the other winding.  In reality, magnetic fields will tend to fray out and pass through gaps in the windings.  We can reduce this effect by using special materials in our transformer cores that are said to have a low "Reluctance".

Similar to electricity traveling in the path of least resistance, magnetic fields will travel along the path of least reluctance. So these magnetic cores keep the magnetic fields in line. The total magnetic field passing through a coil is called the Magnetic Flux and is signified with a capital phi (\Phi).  This is basically, the magnetic flux density multiplied by the cross sectional area.

\Large \Phi = B\times A

Makes sense.  A density times an area gives you a quantity.  The flux passing through a coil (or rate of change of that flux) will determine things like the voltage across the coil, so it's generally good to know.

Keep in mind though that a piece of wire doesn't really know anything about the geometry of the magnetic field. It only cares about how much magnetic flux is passing through the overall loop.  It can't tell if it is wrapped many times around the same small area or once around a much larger area:

So, we usually don't deal with flux for transformers. We instead work with "flux linkage".  Flux linkage (\lambda) is simply the magnetic flux through the core multiplied by the number of windings in the inductor:

\Large \lambda = \Phi \times N

For a single winding inductor, \lambda = \Phi. It also happens that the flux linkage for a component is equal to the time integral of the voltage across it:

\Large \lambda = \int{V} dt

So, if we know that all of the flux in one winding of the transformer also passes through the other winding (ideal, remember?) we get:

\Large \frac{\lambda _{1}}{N_{1}} = \Phi = \frac{\lambda _{2}}{N_{2}}

\Large \frac{d}{dt}(\frac{\lambda _{1}}{N_{1}})= \frac{d}{dt}(\frac{\lambda _{2}}{N_{2}})

\Large \frac{V_{1}}{N_{1}} = \frac{V_{2}}{N_{2}}

Hey! Look familiar?

What Makes You So Perfect?

So what exactly gets a transformer closer to an ideal transformer?  Lets first model our transformer as a magnetic circuit.  Just like you can model electric circuits with resistors and voltage sources, you can model magnetic circuits with coils and reluctances.

So what do I mean by magnetic "circuit"?  Well, you've probably been wondering why it seems that transformer and inductor cores always seem to form loops such as in this torroidal inductor:

Or even in the E shaped core of the EL wire transformer:

Where there are actually two loops around the outside of the wire coil.  This isn't always the case though.  There are a number of bar-core inductors that do not produce a loop.  In this case, the bar starts the loop, but the loop is completed by the space surrounding it.  Surely you've seen one of these:

Where magnetic fields travel through air just fine.  As you will see though, this is far from ideal and will create a poor transformer.

So remember how magnetic reluctance (\mathcal{R}) is sort of like electrical resistance?  Like resistance, it's a property of the material that is creating the circuit loop.  In this case, it's a property of the core of my inductor or transformer.  The lower the reluctance, the more easily magnetic fields form inside the material.

In the case of an non-looping core, you would take the reluctance of the core along with the reluctance of the air completing the loop and sum them just like summing resistors in series. In fact, even in the looping inductor core, it's safe to say that not all of the magnetic fields pass entirely around the loop inside the core.  Some of them will leak out.  This is similar to having two resistors in parallel.  The core will represent a low-reluctance, and the air surrounding will represent a larger reluctance.  Most of the flux will pass through the lower reluctance path, but not all of it.

The formula for reluctance is:

\Large \mathcal{R} = \frac{l}{\mu \times A}

Where l and A are the length and cross sectional area of the magnetic path, and \mu is the permeability of the material.  I'll go into more detail on permeability later.

The only distinction to keep in mind between reluctance and resistance is that magnetic reluctance is non-dissipative.  I.e. unlike a resistor, it will not cause energy loss but will instead store energy.  Not a super important point for this discussion, but something to keep in mind.

Analogous to voltage which is the "Electro-Motive Force" we have the "Magneto-Motive Force" (Yes, I know, it sounds really corny).  The MMF (or \mathcal{F}) is measured in Ampere-turns and as its name suggests is equivalent to:

\Large \mathcal{F} = N\times I

Where N is the number of turns and I is the current.

So, to tie up our analogy, we need something magnetic that acts like current.  Well if current is the measure of electrons passing through a cross sectional area, we can use flux because it's a measure of magnetic fields passing through a cross-sectional area.  The flux through a wire coil is given by:

\Large \Phi = B\times A

Or more specifically:

\Large \Phi = \frac{\mu NIA}{l}

Where l is the magnetic path length. So now we can draw a circuit representation of our inductor:

Now as far as the specifics such as what exactly l is is irrelevant for this analysis.  All you need to know is that these values are equal for both turns of the inductor.

So you'll note that the MMF contributions of the primary and secondary windings are in series.  This is because we're assuming that all of the flux passing through one also passes through the other. Now let's test out this model starting with Ohm's law (but with magnetic fields).

\Large N_{1}I_{1}+N_{2}I_{2} = (\Phi )\times \mathcal{R}

\Large N_{1}I_{1}+N_{2}I_{2}= (BA)\times (\frac{l}{\mu A})

Keep in mind that B is actually the sum of the B fields produced in each coil.

\Large N_{1}I_{1}+N_{2}I_{2}= ((B_{1}+B_{2})A)\times (\frac{l}{\mu A})

\Large N_{1}I_{1}+N_{2}I_{2}= ((\frac{\mu N_{1}I_{1}}{l}+\frac{\mu N_{2}I_{2}}{l})A)\times (\frac{l}{\mu A})

\Large N_{1}I_{1}+N_{2}I_{2}= (N_{1}I_{1}+ N_{2}I_{2})

Alright, so apparently this model holds some water.  Now, we've said before that in an ideal transformer, \frac{N_{1}}{N_{2}} = \frac{I_{2}}{I_{1}}. That means:

\Large N_{1}I_{1}+N_{2}I_{2} = (\Phi )\times \mathcal{R}

\Large \Phi \times \mathcal{R} = 0

There are two possible solutions to this equation.  Either \Phi = 0 or \mathcal{R} =0.  The former is an obvious solution.  When there is no current in either winding, the magnetic flux is zero, so that's not very interesting.  The latter however is very useful.

\Large \mathcal{R} =0=\frac{l}{\mu A}

So if you want your transformer to be ideal, you either need to have l=0 or \mu A=\infty.  A zero length is going to be very hard to manufacture as is an infinite area.  That leaves \mu=\infty.

Let's Talk About Mu

\mu represents the "magnetic permeability" of a material.  Permeability describes the capacity of a space to hold magnetic fields.  A vacuum has a permeability (written \mu _{\circ} or "mu naught") which as it turns out is very close to that of air.

As manufacturers try to make better and better transformers, they try to find better and better materials for the core. They record their \mu usually as a coefficient of \mu _{\circ} sometimes called the "relative permeability" and written as \mu _{r}.  The goal is to have an infinite \mu, but they usually top off at about 2000 \mu _{\circ} for commonly used materials like the ferrite in my core.

Unfortunately, \mu is not a constant value inside an inductor.  A lot of times, as more and more magnetic field builds up in the core (more current travels around it), the permeability of the material drops.  You can see this happening in this graph:

Which I stole off of this data sheet for powdered metal cores.

This loss of permeability is called "saturation" and is caused by the reorientation of little magnetic dipoles inside the core material.  As a field builds up, dipoles are aligned.  When there are no more dipoles left to align, permeability drops.  I know this is a very vague explanation, but a thorough understanding is not necessary for this discussion.

Without knowing anything really about my transformer core, I want to hypothesize that my odd voltage ratio (lower than the turns ratio) has something to do with the transformer core saturating.  Let's see if I can demonstrate this trend mathematically.

Not So Perfect After All

So, let's go back to our flux linkage equation:

\Large \lambda = \Phi \times N

And be a little more explicit about exactly what this means.  There will be two flux linkages (one for each winding) and the flux in each winding is partially due the its own current and partially due to the current in the other winding.

\Large \lambda_{1} = (\Phi_{1} + \Phi_{2})\times N_{1}

\Large \lambda_{1} = (\frac{\mu N_{1}I_{1}A}{l} + \frac{\mu N_{2}I_{2}A}{l})\times N_{1}

\Large \lambda_{1} = (\frac{\mu N_{1}^{2}I_{1}A}{l}+\frac{\mu N_{2}N_{1}I_{2}A}{l})

If you look at the first term, you'll see something familiar:

\Large L=\frac{\mu N^{2}A}{l}

It looks like the formula for an inductor!  We can call this "self-inductance".  It's the amount that the first winding acts like an inductor as if the second coil wasn't there.  That leaves the second term where the N^2 is actually N_1N_2.  We can treat this as an inductor and call it "mutual inductance".  It basically indicates how well linked together the two windings of the transformer are.  So, we can rewrite this as:

\Large \lambda_{1}=L_{11}I_{1}+L_{21}I_{2}

Likewise, \lambda _2 can be written as:

\Large \lambda_{2}=L_{12}I_{1}+L_{22}I_{2}

So, to play with our new formulae, let's set up a fictional scenario where the primary winding is attached to a cosinusoidal current source and the second winding is attached to a resistive load:

In this case, I represents the magnitude of the current wave while i_1 represents the actual current.

So, if we want to see what's delivered to the load, we need to find the voltage on the secondary winding.  We can derive this by taking the time derivative of the flux linkage of the secondary winding:

\Large \frac{d}{dt}(\lambda _{2})=\frac{d}{dt}(L_{12}i_{1}+L_{22}i_{2})

\Large V_{2}=L_{12}\frac{di_{1}}{dt}+L_{22}\frac{di_{2}}{dt}

And if we remember from Ohm's law that V=IR, we can set our voltage equal to:

\Large V_{2}=L_{12}\frac{di_{1}}{dt}+L_{22}\frac{di_{2}}{dt}=-i_2R

The minus sign is a result of V_2 being an induced voltage that must be opposite in sign to \frac{\Delta \Phi}{\Delta t} (Lenz's Law).  That's kind of a weak explanation, but if you're looking for more solid proof, consider the case where i_1 is forced to be zero (circuit is opened) and the negative sign isn't there:

\Large i_2R = L_{22}\frac{di_2}{dt}

And you solve for i_2

\Large \int i_2R = \int L_{22}\frac{di_2}{dt}

\Large \int Rdt=\int L_{22}\frac{di_2}{i_2}

\Large RT = L_{22}ln(i_2)

\Large i_2=e^{\frac{RT}{L_{22}}}

This conclusion means that if there was any current in the secondary winding when you disconnected the primary winding, the current in the secondary would spiral out of control and generate infinite energy dissipation through R.  Obviously this is stupid, but if you make the exponent negative, there's exponential decay, and the current dies down in an orderly fashion.

The sign on i_1 is less important because it is an isolated system that can be switched around simply by altering the direction of the primary windings.

So, let's see if we can solve for i_2 in the more general case.  Let's use the scenario where we are driving our system with a cosinusoidal current source with magnitude I:

\Large i_{1} = Icos(j\omega t)

We're going to analyze the situation where the system has been running for a very long time and all transient conditions have died off completely.  We call this "steady state", and in steady state, all components are operating at the same frequency.  We can thus model the current in the secondary winding as:

\Large i_{2} = \hat{i}_{2}cos(\omega t)

Making the whole system:

\Large L_{21}\frac{d}{dt}(Icos(\omega t))+L_{22}\frac{d}{dt}(\hat{i}_2cos(\omega t))= \hat{i}_{2}R

Where \hat{i}_{2} is the magnitude of the current in the secondary winding.  This kind of setup is a perfect situation in which to use phasors. Phasors utilize Euler's formula:

\Large e^{jx}=cos(x)+jsin(x)

where we can replace cos(\omega t) with Re\{e^{j\omega t}\}.  We can use e^{j\omega t} for our analysis as long as we make sure to take the real part of both sides at the end.  The idea is that you get all of the exponential terms to cancel out and are left with just relative magnitude and phase information for your system.

(Note, for EEs, j=\sqrt{-1} like it should be)

So we can rewrite our system like this:

\Large Re\{L_{21}\frac{d}{dt}(Ie^{j\omega t})+L_{22}\frac{d}{dt}(\hat{i}_2e^{j\omega t})= -\hat{i}_{2}Re^{j\omega t}\}

Now, we can start to solve for \hat{i}_2:

\Large Re\{L_{21}j\omega Ie^{j\omega t}+L_{22}j\omega \hat{i}e^{j\omega t}= -\hat{i}_{2}Re^{j\omega t}\}

And we can cancel out some terms:

\Large Re\{L_{21}j\omega I+L_{22}j\omega \hat{i}_2= -\hat{i}_{2}R\}

\Large Re\{L_{21}j\omega I=-\hat{i}_2R-L_{22}j\omega \hat{i}_2\}

Now remember how L_{22} and L_{21} are defined and you can do this:

\Large Re\{\frac{L_{21}j\omega I}{L_{22}}=-\frac{\hat{i}_2R}{L_{22}}-j\omega \hat{i}_2\}

\Large Re\{\frac{N_1}{N_2}j\omega I=-\frac{\hat{i}_2R}{L_{22}}-j\omega \hat{i}_2\}

Now we can keep manipulating...

\Large Re\{\frac{N_1}{N_2}I=-\frac{\hat{i}_2R}{L_{22}j\omega }-\hat{i}_2\}

\Large Re\{-\frac{N_1}{N_2}I=\hat{i}_2(\frac{R}{L_{22}j\omega }+1)\}

\Large Re\{-\frac{N_1}{N_2}I\frac{1}{(\frac{R}{L_{22}j\omega }+1)}=\hat{i}_2\}

Now, before we bother taking the real part, you can already see some trends.  What happens when L_{22}=\infty:

\Large -\frac{N_1}{N_2}I\frac{1}{(\frac{R}{\infty j\omega }+1)}=\hat{i}_2

\Large -\frac{N_1}{N_2}I\frac{1}{(0+1)}=\hat{i}_2

\Large -\frac{N_1}{N_2}I\frac{1}{1}=\hat{i}_2

So, apparently if L_{22} goes to \infty, we get an ideal transformer.  So (we're getting really close here) what do we need to do to approach an ideal transformer?  Let's look at the definition of L_{22}:

\Large L_{22}=\frac{\mu N_{22}^{2}A}{l}

For this quantity to go to \infty, we need \mu to be infinite! This matches our condition from before.  What happens when \mu isn't infinite? The effective turns ratio drops, or:

\Large \hat{i}_2=-\frac{N_1}{N_2}I\frac{1}{(\frac{R}{\mu j\omega }+1)}=-\frac{(N_1-error)}{N_2}I

So my 1:64 ratio could drop as low as 1:22 and explain the voltage sag I saw at the output.

Imperfect by Design?


I've stated before that as current through an inductor rises, the \mu of the core drops. Usually, you'd want to have an ideal inductor with infinite \mu.

In the case of this cheap power supply, a good non-saturating inductor might have been too big or too expensive, so the designer came up with a better solution. If the core saturates, the input inductance will drop (remember that L_{12} and L_{11} also have \mu in them).  This is usually a bad thing as the sudden drop in inductance can cause bad current spikes that can cause the transformer to heat up (imagine the transformer suddenly turning into a piece of wire shorted across a power supply).

This is less of a concern here because the transformer is being driven by a resonant circuit so a drastic change in inductance will result in the system just oscillating at a different frequency. What probably happened during design is that the designer realized that the core was going to saturate and rather than trying to use a more expensive/bulkier core, decided to just super saturate the one they had.  They could use every last ounce of energy storage it had by adding way more turns than necessary.  More copper wire is cheaper than a beefier core.

This also explains why you're never supposed to run these supplies with out a load.  With no current in the secondary winding, you'll end up fully utilizing that 1:66 turns ratio and get one hell of an output voltage!

Conclusion

  • I was measuring a higher inductance than was present due to my ignoring the parasitic capacitance.
  • The output voltage drooped because of a saturating transformer core.
  • My measurement of the turns ratio through the LC oscillator and input/output voltage measurements was self-consistent entirely by chance.

So if you actually made it this far, I'm amazed.  This whole thing just started as a casual review for me and quickly turned into a brief crash course in transformer design.  I wrote it mostly as a reference for myself, but if you acquired anything from it, so much the better.

Again, if you find any errors in my work, please let me know! Shoot me an email or leave a comment.

Thanks for reading!

8 thoughts on “In Which I Begin to Lose My Mind

  1. Wouldn't life have been MUCH easier if you had that $400 LCR meter at the very beginning of this cluster fark? I'm pleased to tell you there is a $45 alternative. Google for "LC200A" , you can find it for sale lots of places (I bought mine on eBay) and you can find some very positive reviews, including a YouTube side-by-side competition against a huge benchtop LC measuring instrument by Hewlett Packard. If you prefer the joy of building test equipment yourself, there's quite a sophisticated "Accurate LC meter" kit on sale at electronics-diy.com

    • You're right that it probably would have been easier, but I also wouldn't have learned anything. Also, now that I've learned from my mistakes, I don't even need a $45 LCR meter as I can apparently manage with a cap and a scope.

      • Heh, in honor of your first posts to reddit many days ago, I concidentally found an car audio guy who had a honking huge chinese giant cap. I also estimated the farads with a resistor and a battery. I know not as cool as your scope LC approach, but I did think it was better idea than using the capacitance mode on my multimeter.

  2. oh my gosh... basically for the entire chapter of electromagnetic induction, i thought transformers was the easiest, because i only associated it with the turns ratio, but as it turns out, there is still so much for me to learn! @_@ anyway, great article and thanks so much for the enlightenment! :D

  3. Pingback: Bringing a Car Battery Back from the Dead: A Ch00ftech Halloween Tale | ch00ftech Industries

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>