# Mini Project: Magnetic FEA – Current Sense Coil Position Dependency

One method of measuring current through a wire is using a current sense coil. This is a mostly nonintrusive way of measuring current by detecting the magnetic field around the wire, however it only works for AC signals. In this setup we have a coil of wire wrapped around a ferromagnetic toroid. We then pass our AC current carrying wire through the centre of this toroid and measure the voltage induced on the coil. Due to the very high permeability of the toroid, we can assume that the magnetic field inside it is insensitive to the exact location of the wire passing through the toroid. A voltage is induced on the orange coil when an AC current flows through the red wire

I wanted to investigate this relationship between the sensitivity to the location of the wire inside the toroid and the permeability of the toroid. This can inform how high the permeability needs to be before we can assume that the position of the wire is not important. To do this I used the FEMM finite element magnetics package. This allows me to create an arbitrary geometry of coils and toroid and measure the magnetic field inside the toroid.

But first, a little background on the theory…

The origin of the magnetic field is Ampère’s law which states that magnetic field lines encircle a current carrying wire. Or more precisely:

Where J is the current density vector and H is the magnetic field strength vector. Using Stoke’s theorem this can be transformed into the form:

Which states that the integration of the H-field around a closed loop is equal to the total current enclosed by that loop, I. However, this requires that the H-field is pointing in the direction of our loop along the whole length of the loop. By symmetry, we can assume that the H-field is flowing in a circle around our wire and has a constant magnitude at all locations around that circle. Therefore, by choosing our closed loop to be a circle centred on the wire, we can simplify this equation to say that the magnitude of the H-field at any point on that circular loop multiplied by the length of the loop (2πr) is equal to the current through the wire. H-field around a current carrying wire at a point at a distance r from the wire

This field can then be detected by taking advantage of Faraday’s Law which states that the voltage developed around a closed loop is proportional to the rate of change in magnetic flux flowing through the surface enclosed by the loop.

Where V is the voltage around the loop and Φ is the magnetic flux through the loop. Changing magnetic flux through a loop generates a voltage in that loop

Total flux can be calculated as the flux density inside the loop, B, integrated over the area of the loop. However, it is important to note that this flux must be flowing perpendicular to the surface fo the loop – put simply it must flow straight through the loop, rather than at an angle.

If we assume that the flux density is in the direction perpendicular to our loop and that it is constant inside the loop then this can be simplified to:

B is related to the magnetic field strength, H, by the magnetic permeability of the material through which it flows. The magnetic permeability of materials is typically measured compared to the magnetic permeability of a vacuum which is approximately 12.57×10−7H/m. Some types of iron may have a magnetic permeability that is 200000 times greater than that of a vacuum, in which case we say it has a relative magnetic permeability of 200000.

Where µr is the relative permeability of the material and µ0 is the permeability of a vacuum.

Putting this all together we can see that if we place a loop of wire in the plane of the current carrying wire then the flux that encircles the wire will pass through our loop. If the current in our wire is varying then the flux through our loop will also vary, resulting in a generated voltage. Magnetic flux encircling a current carrying wire (red) generates a voltage in a loop (blue)

By combining the equations above we get a total equation of:

Where A is the area of our loop, µrµ0 is the permeability of our material, r is the distance of the loop from the current carrying wire, and I is the current though the wire. We also are able to multiply our voltage by connecting N loops of wire in series rather than just one. If we assume a sinusoidal current of magnitude I and frequency f we can rewrite this as:

We can see that the voltage depends on the distance from the coil to the current carrying wire – this is undesirable as we need to control the position of our coil relative to the wire which may be very difficult if the measurement setup is not well controlled. This can be rectified by replacing the air inside our coil with a ferromagnetic material with a very large magnetic permeability. To do this we place our current carrying wire through the centre of a ferromagnetic toroid. Diagram of toroid around a current carrying wire (red). Our loop (blue) is wrapped around the toroid.

The toroid presents a much lower reluctance path for magnetic flux to flow and therefore the magnetic flux always “chooses” to flow in a circular path centred on the toroid rather a circular path centred on the wire. Therefore, the flux through our loop is insensitive to the position of the wire, so long as it is inside the toroid. Diagram showing that the generated H-field is insensitive to the location of the current carrying wire.

As a second benefit to this, because the material has a much higher magnetic permeability, the magnetic flux density will be much higher which also increases the induced voltage which makes it easier to detect.

Background complete, now to investigate the problem…

I wanted to investigate this dependency on the position of the wire and understand how high the permeability of the toroid really had to be in order to be insensitive to the location of the wire. To do so I setup the problem in FEMM which is a finite element analysis package and allows me to setup an arbitrary geometry and simulate the magnetic field.

For this I defined a 100x100mm box of air. Inside this I define a toroid of variable magnetic permeability – I based the dimensions on a real toroid on DigiKey with an outer diameter of 31mm, an inner diameter of 17.7mm and a depth of 16.1mm. Through the centre of this toroid I run a conductor carrying 1A. This current then returns via a second conductor on the outside of the loop. I then simulate a single turn coil on the north side of the toroid by integrating the B-field flowing through a radial line at the top of the toroid to get the total flux through my coil – this will be proportional to the voltage generated for an AC current.

One of the nice things about FEMM is that it supports Lua scripting which means that I can automate the process of creating geometry and solving. First I created a script to create a toroid of relative permeability 10 and then sweep the y-position of the current carrying wire to see the impact of the y-position of the wire on the total flux through my loop. Animation showing the y-position of the current carrying wire being swept. Toroid has a relative permeability of 10.

We can see that as the current carrying wire moves from the bottom of the toroid to the top the magnetic field inside the toroid changes. We see that as the wire comes closer to the sense coil, the density of the field lines through the sense coil increases, resulting in a greater flux through the coil. Due to the symmetry of the problem in the y-axis we can see that all field lines pass perpendicularly through the sense coil.

We can plot the flux flowing perpendicularly through the coil against the y-position of the coil. Graph of magnetic flux flowing perpendicularly through our sense coil versus the y-position of the current carrying wire

We can see that when the wire is at a maximum distance from the sense coil (y = -8mm) there is a flux of around 11.5nWb (nanowebers) flowing perpendicularly through our coil whereas when it is closest to the sense coil (y = +8mm) there is a flux of 26.6nWb. This is a difference of 2.3x which shows that we can expect our sense coil voltage to have a strong dependency on the location of the wire.

I also swept the x-position of the wire to see the impact. Animation showing the x-position of the current carrying wire being swept. Toroid has a relative permeability of 10.

Here we can see that when the current carrying wire is away from centre, the magnetic field lines do not pass perpendicularly through the sense coil. As a result the sense coil does not detect the full impact of the flux as only the component that is perpendicular to the coil will generate a voltage. Also, as the wire moves away from the centre of the toroid the distance between the sense coil and the wire increases resulting in the density of the field lines decreasing slightly.

The combination of these two effects (non-perpendicular and lower density field lines), which occur symmetrically as the wire moves left or right from centre, means we can expect to see a peak perpendicular flux when the current carrying wire is in the centre of the toroid. Once again we can plot a graph: Graph of magnetic flux flowing perpendicularly through our sense coil versus the x-position of the current carrying wire

As expected there is a peak perpendicular flux of 14.3nWb which drops off to 12.8nWb as the wire moves left or right. This is a significantly smaller change than we observed when moving the wire in the y-direction which indicates that the sense voltage is less dependent on the x-position of the wire relative to the sense coil.

Finally, I also looked at the effect of the diameter of the wire on the magnetic flux through the sense coil. Animation showing the diameter of the current carrying wire being swept. Toroid has a relative permeability of 10.

Here we can see that the diameter of the wire has little impact on the field flowing perpendicularly through the sense coil. Since the geometry continues to have symmetry in the y-axis, all the field lines flow perpendicularly through the sense coil. Although the field lines through the coil seem to be changing this is just a side effect of how the field lines are plotted and they actually maintain a constant density. Therefore, we expect the flux to be independent of wire diameter, which makes sense given that our original equations had no reference to the diameter of the conductor. Graph of magnetic flux flowing perpendicularly through our sense coil versus the diameter of the current carrying wire

Sure enough, our graph of flux vs wire diameter shows no dependency.

So overall we can see that with a relative permeability of 10 or less there is a strong dependency on the location of the wire inside the toroid. We can vary the relative permeability and repeat this experiment in order to see how this sensitivity changes. Rather than rerun the full sweeps above, I selected the two points with maximum and minimum flux to repeat for each value of permeability. These are the two points when the conductor has a maximum and minimum y-position (although we could probably achieve a slightly lower flux by varying the x- and y-positions simultaneously). Graph of the minimum flux divided by the maximum flux as the wire varies in y-location versus the relative permeability of the toroid.

For each value of relative permeability we take the minimum flux (when the wire is furthest from the sense coil) and divide it by the maximum flux (when the wire is closest to the sense coil). This is then plotted above agains the relative permeability.

We can see that at low values of relative permeability there is a very strong dependancy on the wire position – the ratio of minimum flux to maximum flux is only around 0.15. As the relative permeability increases this ratio becomes closer to one, indicating that the flux is less dependant on the position of the wire. We need a relative permeability of about 1000 before the ratio increases to 0.99. This implies that at a relative permeability of 1000, we cannot achieve an accuracy better than 1% unless we control the location of the wire inside the sense coil. Luckily a relative permeability of 1000 is fairly low for common ferromagnetic materials, which can be as high as 200000.

In summary, we have shown that the sense voltage developed by a current sense coil is dependent on wire position inside the coil, however this sensitivity can be mitigated by increasing the relative permeability of the toroid. It is also worth noting that this analysis has been performed on a specific geometry and the results will vary depending on the geometry. Also, we have assumed the sense coil is at a very thin strip at one point around the toroid, whereas in reality the coil is often wrapped around the entire perimeter of the toroid. Increasing the coil to extend around a greater region of the toroid may decrease the sensitivity to wire location. This is because as the wire moves further from one part of the coil, it will move closer to another part of the coil, offsetting some of the variation.

Here is an example script for generating the current carrying wire diameter sweep:

```-- FEMM 4.2
clearconsole()
showconsole()

air_width = 100
air_height = 100
outer_diameter = 31
inner_diameter = 17.7
depth = 16.1
u_custom = 1

current_diameter = 1
current_x = 0
current_y = 0

-- Define function for drawing rectangles
function rectangle(x,y,w,h)

-- connect the nodes with segments
end

function set_material(x, y, material, mag_direction, circuit, turns)
mi_clearselected()
mi_selectlabel(x, y)
mi_setblockprop(material, 0, 0.5, circuit, mag_direction, 0, turns) --material, automesh, meshsize, circuit, magdirection, gorup, turns
mi_clearselected()
end

function circle(x,y,r)
mi_addarc(x, y+r, x, y-r, 180, 1)
mi_addarc(x, y-r, x, y+r, 180, 1)
end

function evaluate_flux(air_width, air_height, outer_diameter, inner_diameter, depth, u_custom, current_diameter, current_x, current_y, filename)
newdocument(0) --magnetics problem
mi_probdef(0,"millimeters","planar", 1e-8, depth) -- freq, units, type, precision, depth
mi_showgrid()
mi_grid_snap("on")
mi_setgrid(1, "cart")

mi_getmaterial("Air")

-- Create circuit

rectangle(0,0,air_width,air_height) -- draw air
circle(0, 0, outer_diameter/2) -- draw outer ring
circle(0, 0, inner_diameter/2) -- draw inner ring
mi_addsegment(0, outer_diameter/2, 0, inner_diameter/2) -- line at top through which we evaluate flux
circle(current_x, current_y, current_diameter/2) -- draw current through coil
circle(0, -outer_diameter/2 - 0.5, 0.5) -- return current

set_material(-air_width/2 + 1, air_height/2-1, "Air", 0, "<None>", 0) --set air material
set_material((inner_diameter+outer_diameter)/4, 0, "custom_material", 0, "<None>", 0) -- core material
set_material(current_x, current_y, "Air", 0, "Coil", 1) -- current material
set_material(0, -outer_diameter/2-0.5, "Air", 0, "Coil", -1) -- return current material
set_material(current_x+current_diameter/2 + 0.1, current_y, "Air", 0, "<None>", 0) -- center material

mi_zoomnatural() -- zoom to fit
mi_saveas("temp.fem") -- save to a temporary file (necessary to mesh)

mi_showmesh()
mi_purgemesh()
mi_createmesh()

mi_analyze()

mo_hidemesh()
mo_showdensityplot(0, 0,0,1, "bmag")

mo_savebitmap(filename)

mo_clearcontour()
mo_selectpoint(0,outer_diameter/2)
mo_selectpoint(0,inner_diameter/2)
flux = mo_lineintegral(0)
mo_clearcontour()

mi_close()
mo_close()
return flux
end

mus = {1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000}
ratios = {}
for i = 4,4,1
do
u_custom = mus[i]
fluxes = {}
for j = 0,16,1
do
current_diameter=j
filename = "images\\current_sense_mu"..u_custom.."_d"..current_diameter..".bmp"
flux = evaluate_flux(air_width, air_height, outer_diameter, inner_diameter, depth, u_custom, current_diameter, current_x, current_y, filename)
fluxes[j] = flux
print(flux)
end
ratio = fluxes/fluxes
print(fluxes, fluxes, ratio)
ratios[i] = ratio
end
```