# How the Helmholtz do you make a good electromagnet?

Perhaps not a question that has come to every persons’s mind, but it’s happened to me once or twice, so let’s take a look at it.

If you move in the right circles, it’s actually a problem of some consequence. How to make a nice clean magnetic field? Helmholtz coils are usually the answer and a set of really good coils is an essential component to a number of modern physics laboratories. I’ve used many of them in magnetic resonance experiments and have personally witnessed them in various labs studying plasma physics, exotic ultracold atom states, and ultra-sensitive magnetometer/gyroscope schemes. Really, their use pops up all over the place, even the biology of magnetotactic bacteria and magnetoreceptive honeybees.

# The Simple Helmholtz Coil  (images by Ansgar Hellwig & Geek3, under a CC-BY-SA 3.0 license)

The principle is quite simple: Take two coils of wire, connect them, pass a current, and you’re left with a very homogeneous magnetic field at the midpoint between the coils. The magnitude of the field produced scales with the radius, , of the coils, the number, turns of wire, the applied current, , and the spacing between coils. To obtain the most homogeneous field, the two coils must be spaced a distance of from one another – the sweet spot is then at . For this nicely symmetric, ideal case, the central field magnitude is where is the magnetic permeability constant and we’re calling the center axial midpoint the origin of our coordinate system.

But for many experiments, it’s the field homogeneity that’s most important. What happens if the coil symmetry is off? What’s the error on that? By how much does the magnetic field diverge and over what distance? The expression above says nothing about variations in or directions. For many applications, these are questions that must be answered at the outset since they ultimately limit sensitivity. But how do we do this before building anything? Answer: Simulation!

# Forth-Order Helmholtz Equations

Luckily, the most difficult portions of this task have been solved in a publication by M.S. Crosser, et al. In their paper, they sketch a solution for magnetic fields in and around the center point, including terms out to forth order, . At this precision, the order of approximation for any calculated is probably better than our general engineering skills. Here’s the system they’re working with: M.S. Crosser, et al., Rev. Sci. Instrum. 81, 084701 (2010).

The relavant symbols are defined in the table below (ignore the rest, which are used only in the derivation). But take notice of the four rectangular blocks – these are the coil cross-sections, where the tiny inner squares represent an individual wire turning. “Wait, now… aren’t wires round? Why is the wire square?” We’ll get back to that in a moment.

For now, just realize that we’ve got several tunable parameters to play with. The coil’s rectangular dimensions are adjustable, allowing for a different number of horizontal and verticle windings ( and ), or even different thicknesses of wire, , and wire insulation, (see figure below).

Additionally, there are correction terms, and , available for each coil’s radius. This allows each to have an independent mean radius: for the left coil and for the right coil. So if , then there’s no longer a plane of symmetry in the center and we can account for this in the calculation. The purpose of including all these parameters is to be able to simulate realistic imperfections in the Helmholtz system. Very nice!

symbol description magnetic field in direction at point  (x,y) magnetic field in direction at point  ideal coil radius and separation between coil midplanes total number of wire turns in each coil number of horizontal windings per coil number of vertical windings per coil current applied to the system permeability constant width of coil height of coil thickness of wire thickness of wire insulation correction term for left coil radius:  correction term for right coil radius: So, what do these forth order expressions look like? Honestly, anything out to is going to be quite ugly. On the other hand, it is just a bunch of algebra, and so should be fairly easy to code up. Here are the main field terms and their associated factors: Alright, now we have all the mathematical tools needed to start making design choices for our set of Helmholtz coils. Let’s implement the equations in python and then start asking questions.

# Winding Dimensions Matter

In the above equations, we have a choice of winding dimensions for these coils. So, what dimensions should be chosen? In essence, each coil could be a solenoid of 20 turns ( ). Or, we could stack the same 20 windings vertically ( ).

The choice here might seem arbitrary until you look at how the higher order terms are affected. The best possible choice will involve minimizing the higher order terms as much as possible. For instance, one way to minimize field divergence at the center point would be to ensure that each coil radius is exactly R, meaning the correction factors and are zero. Take another look above at how many terms drop out when – it definitely makes a difference.

Another way to minimize higher order terms is to balance the ratio of winding width to winding height. The expressions for and both contain the factor , and so each will go to zero when . We only have integer winding numbers to work with, so the closest match will be .

How much of a difference does this really make, though? Let’s visualize it. Wow, that’s up to a factor of 10000 difference in field errors simply due to our choice of coil winding geometry. Sticking to and definitely seems to be the wiser choice. Anyone making flat coils, take heed… stacking the windings even a few times pays big dividends in field homogeneity.

# Wire Dimensions Matter Tongling Jinglong Electric Material Co. and M.S. Crosser, et al., Rev. Sci. Instrum. 81, 084701 (2010).

Another issue addressed by the M.S. Crosser, et al. paper is the effect of wire geometry. When you find magnet wire out in the wild, it usually has a circular cross-section. But this geometry just doesn’t lend itself to layered stacking very well. Instead, some manufacturers are beginning to specialize in other geometries (ribbon, square, hollow, etc.).

The full effects of modeling the wire geometry are a bit long to get into here (see, for instance, this paper). Suffice to say, however, that field homogeneity is degraded with a lower filling-factor of copper wire, but is greatly aided by having current flow uniformly within the entire coil cross-section, . Therefore, the square geometry is best for this purpose as it minimizes the formation of voids between wires. The authors of the Rev. Sci. Instrum. paper even account for effects due to insulation thickness, , which can be something of a tunable parameter since manufacturers like MWS Wire Industries allow you to specify the insulation type/thickness.

In any case, the insulation effects of square magnet wire tend to cancel out in the horizontal direction, but produce an effective increase to the vertical height: where is wire thickness, is insulation thickness. To make the math easier by symmetry, this only accounts for magnets with an even number of vertical layers, and so in this case , with .

Before simulating the entire magnet, let’s first write the function accounting for this contribution.

# Forth-Order Helmholtz Field Simulation

## Ideal Case

While all the above information is (hopefully) a mix of interesting/informative, it doesn’t really carry enough weight to be a punch-line. We’ll make good use of it, though, because now we get to simulate the entire field distribution around the center of the Helmholtz coil.

This part is crucial to anyone who wants to expose some macroscopic object to a uniform magnetic field. How large can the object be before the field divergence becomes unacceptable?

First, we’ll have to make some design choices about our magnet. Let’s mock-up something large enough to sit on a bench and as close to ideal as we can manage, given the above information. Also, wire specifications will be defined by making use of the MWS Wire Industries datasheet for its Microsquare Magnet Wire line.

Note that the wire length, resistance, and heating are all approximations. Length because we’ve used , and resistance and heating/power since these depend on a host of things (resistance depends on coil temperature, coil temperature depends on cooling rate, cooling rate depends on ambient temperature, material thermal conductivities and capacities, etc.).

Okay, now with that done, we can finally get down to modeling field divergence in the central patch of the Helmholtz. We’ll define some area around the center to calculate both and . Using these, we’ll calculate the field vectors, , and magnitudes, , as well. To capture the field divergence, we’ll use . Okay, that looks fantastic! Within the contour lines showing a deviation of , we have a field homogeneity of about 130 parts-per-billion (and 13 ppb within the line). For this size electromagnet, this gives us an extremely clean field over a fairly large working volume, allowing for centimeter-scale objects or samples.

## Non-Ideal Case

Now, the non-ideal case. What happens when we introduce even a minor imperfection? Let’s see what the case with mm looks like. This is equivalent to a mismatch in coil radii by just half a milimeter. as you can see, the Helmholtz is fairly sensitive to changes in symmetry to the system. Now we’ll probably need to make do with ppm deviations (still pretty good). # Handling Imperfections

Realistically, there will be a host of small imperfections. Here are a few of the most notorious:

1. As the driving current heats up the coils, non-uniform thermal expansions of the magnet form material will take place, causing and to deviate from zero.
2. While winding the magnet coils, as you reach the last turn of a horizontal layer, the wire has to suddenly “pop up” to the next vertical layer, leaving a small void and ruining the uniformity of current flowing through the coil.
3. Real materials have a magnetic susceptibility, , causing them to become magnetized along with, or against, the electromagnet. Therefore, the materials of the magnet form, wires themselves, and any object placed in the magnet are going to affect the field distribution according to their intrinsic value of .

A few of these issues can be mitigated through a choice of materials – for instance, simply using aluminum for the magnet form solves most of the problems of points 1 and 3. The “pop up” effect is more difficult to deal with, though.

For any real construction of a Helmholtz electromagnet, some number of non-ideal conditions are going to be unavoidable. Fortunately, there are few addon options available for these cases.

1. A second set of smaller Helmholtz coils can be set within the center region of the first and act as correction coils (discussed in the M.S. Crosser, et al. paper).
2. A third, central coil can be placed within the primary Helmholtz coil to act as a correction coil. This is called a Maxwell coil and improves the Helmholtz field homogeneity out to .
3. A magnetic core can be placed within the pole of each Helmholtz coil, acting as a field concentrator. Not only does this aid homogeneity, you get an added boost to magnetic field strength, as well. The drawback is that residual magnetization, or remanance, of the core will remain when the Helmholtz is driven to/around zero magnetic field.