Magnetic field of a ferrite core solenoid

Consider a solenoid made of wire wrapped around a rod made of iron, ferrite, or other ferromagnetic material:

Image by Svjo via Wikimedia Commons

It is well known that the magnetic field will be significantly stronger inside such a solenoid, compared to an air core solenoid. The ferromagnetic core becomes temporarily magnetized and reinforces the magnetic field. But what I’m more interested in is: what is the effect of the ferromagnetic core on the field outside the solenoid, some arbitrary distance away? This question is interesting when using such a coil as part of a magnetically-coupled data or power transfer system, or when considering the electromagnetic interference produced by such a solenoid.

Some sources seem to suggest that the field will be confined more closely when a ferromagnetic core is used, as is the case for ferrite-core transformers. Other sources seem to suggest the opposite, namely that the ferromagnetic core increases the range of the field. Meanwhile a naive application of the Biot-Savart law would suggest that the field outside the solenoid does not change. Which of these is true?


To answer this question, I ran a simple simulation with and without an iron core in the excellent FEMM field solver. Here is a picture of the results:

This is an axisymmetric simulation around the z axis. To picture the results in 3D, mentally revolve the half-circle about the z axis at the left. The outer sphere can be ignored, it is just the boundary of the simulation volume.

The conclusion from the simulation is that — at least for a fixed current — the magnetic field is higher outside the solenoid (at any given distance) when an iron core is added.

But surely as we learnt in physics classes, we should be able to calculate the external magnetic field by summing up all the current elements of the solenoid, per the Biot-Savart law? Why does adding an iron core make a difference?

I believe the explanation is that there are “bound currents” at the boundaries of the iron core which also need to be included in any such piecewise calculation of the magnetic field. This stackexchange answer has some good diagrams that help to explain how these bound currents come about.

Constant energy comparison

Now it should be noted that the above simulation has assumed a constant current of 1A in both cases. When the iron core is added, the inductance of the solenoid increases and we had to pump more energy into the solenoid to produce this 1A steady state — so perhaps it’s not surprising that the field is stronger outside the solenoid. To make a more “fair” comparison, I reduced the current through the iron core solenoid to produce the same total energy storage:

Notice that, at least for this geometry, the external magnetic field is still higher at any given distance.

“Return path”

So why do people consider iron/ferrite cores to confine fields more tightly? Well, the issue with the above solenoid design (or perhaps feature if you are trying to increase range) is that the return path of the magnetic field lines is through air and not through iron. We have boosted the magnetic field within the iron, but we’ve ended up with most of the field energy in the air.

If we were to put the iron all the way around the solenoid, which is closer to the usual design of transformers, the result does indeed confine the fields tightly (N.B. I have used the same colour mapping here so that it can be directly compared):

I hope that this post helps to clear up some confusion and might be of help the next time someone is searching for information about the external magnetic fields of ferrite core solenoids (like I was earlier today)! If you think I have got anything wrong, please let me know.

Posted in Physics | 3 Comments

Designing and making a ring

Recently I designed an engagement ring for my (now-)fiancée, from scratch. This was a fascinating and challenging process, and gave me a new appreciation for both the art and engineering of jewellery design.

The first step in the process was to make a collection of existing designs that we both liked. Heather already knew that she liked diamonds with a step cut shape (such as the emerald cut) so this narrowed it down. Here is one of the pages of our initial design exploration:

We visited a local jeweller, who showed us some designs in similar styles. There were a few features that were missing though; for example, I really liked the gap between the center stone and halo in the vintage ring. For practical reasons I also wanted to design a ring that had a low side profile, as I had nightmares about Heather losing a ring finger in machinery.

Granted, I’m sure a good jeweller could have designed something fitting the bill, but I had been doing a bit of CAD recently and I thought… how hard would it be to design a ring myself?

(The answer, it turns out, is that it’s surprisingly hard if you haven’t done it before. I did intermittently find myself wishing that I was working more closely with a jeweller, but it was a labour of love…!)

Here you can see the evolution of my design in Onshape, from an initial shape, to the detailed design of halo and shoulder, and then some final changes based on manufacturing feedback:

The final design was manufactured using a lost wax casting process. In this process, the model is first 3D printed in a wax-like resin. A flask is placed around the model and flooded with a plaster-like investment material. Once the investment has hardened, the wax model is melted out, and metal is cast in the chamber that remains.

The printing and casting was done by Pure Casting in Sydney, who did an amazing job. I wasn’t sure how the design on the shoulder would turn out; the raised design is only about 0.2mm high, and about the same in line width, so it requires very high resolution. But it turned out perfectly. Pure Casting also arranged polishing and stone setting for me. (I thought briefly about doing it myself, but this time I decided against it!)

Here is a photo of a draft cast in silver, unpolished and without stones:

And here is the final ring:

Here are some notes about this design:

  • In the final design, the ring is manufactured in two pieces and soldered together at the end, otherwise it would be difficult to polish in between the parts. (Thank you to Gillian at Pure Casting for this and other good advice.)
  • The majority of ring designs use round/cylindrical prongs, but I used rectangular prongs here. I felt that this better suited the angular nature of the emerald cut, and I also think that this shape may be slightly better mechanically (a round prong with the same diameter has less metal, while a round prong with the same area is harder to bend over). Originally I added taper angles to the prongs, but it was suggested to keep them simple and leave finishing details to the setter.
  • The majority of designs use flat or nearly-flat halos, but each face of this halo is inclined outwards significantly (35 degrees). Again, I wanted to echo the faces of the emerald cut, as well as providing a softer side profile to the ring. This means, however, that each of the eight faces of the halo is in a different plane, and this made the placement of the halo diamonds and prongs more challenging.
  • To make sure the dimensions were right, I measured the actual diamond dimensions and angles from macro photos, and built a CAD model of the diamond. I did find a lot of curiosities; for example, I was also expecting the corners of an emerald cut to be cut at 45 degrees, but in fact they were around 42 degrees, and one corner was slightly ‘off’. The key with any gem setting, therefore, is to design in some tolerance.

The biggest challenge in the design was the engraving-like design on the shoulder of the ring. I was inspired by vines but, not having the artistic ability to draw vines, I made it more geometric. The final engraving design took all of my CAD knowledge, and some spline mathematics, to implement.

Heather and I are both thrilled with the end result. Thank you again to Onshape for building an awesome CAD system, and to Pure Casting for turning my design into reality.

Posted in Other | Leave a comment

Splines in Onshape, part 2

In part 1, we talked about 2D splines and how they can be created in Onshape sketches. In this second part, I’ll briefly cover drawing splines directly in 3D, and then discuss offset curves, which are the original reason I started on this long journey delving into Onshape curves. Continue reading

Posted in Computing | 5 Comments

Splines in Onshape, part 1


First can I say how much I love Onshape. I have no association with the company other than being a user, so you can trust that this is real, genuine puppy love. Onshape provides much of the functionality of parametric CAD systems such as SolidWorks in your browser, which at first sight seems like magic. Since I’m a Linux user and the native CAD landscape on Linux is quite limited, being able to do CAD in a browser works brilliantly for me. Even better, it’s free for non-commercial use.

My first little project in Onshape, several moons ago, was a vertical illuminator for my home-brew microscope. The problem I had was that when using high magnifications — which require the lens very close — I couldn’t get enough light in under the lens to illuminate opaque samples. A vertical illuminator is the solution to this problem, sending light down through the lens via a beamsplitter. I designed the physical parts in Onshape, exported to STL format and uploaded to 3DHubs; a local maker printed the parts and within a few days I had it back and working.

Scripting in Onshape

Onshape has a scripting language called FeatureScript. FeatureScript allows extending the Onshape interface with domain-specific tools (features as they’re known in Onshape). For example, if you are doing furniture design in Onshape, you can write features that produce panels and joints and then do high-level design in the user interface, rather than having to work with low-level primitives such as lines and boxes. Clearly this can be a huge boon to productivity. Here is a screenshot from one of the Onshape demonstration videos showing a custom box joint feature that, once created, can be used just like built-in features:

As a programmer and perfectionist I like the idea of writing code to simplify the CAD process rather than spending hours placing parts in a GUI. Prior to Onshape I’ve used OpenSCAD a few times. But for complex designs it gets difficult to mentally keep track of what’s where without having a live preview, and OpenSCAD rendering can get very slow once you start chamfering, filleting and making things pretty. This is where Onshape and FeatureScript shine.

Recently I’ve been doing a bit of jewellery design in Onshape, and this involves a lot of curves and curved surfaces. While I can approximately create the curves I want in the GUI, I wanted to do it programmatically in FeatureScript. Unfortunately a number of the functions that I needed to use were minimally documented so I had to do a lot of trial and error in the process. This article is an attempt to explain some of the missing links for those following in my footsteps.

Onshape is still being developed at a breakneck pace, and since I started writing this article there are now a number of new features related to curves including the option to directly create splines in 3D. I’ll start, though, from the ‘traditional’ way of creating curves in Onshape — by creating them in a 2D sketch and then lofting/extruding/etc. — and I’ll briefly mention 3D curves later in the piece. Continue reading

Posted in Computing | 5 Comments

Dell Venue 11 Pro travel keyboard troubleshooting


I recently purchased a pair of Dell Venue 11 Pro 7140 tablet computers — one for myself and one for my girlfriend. I figured this would be a good crossover device between a tablet and a laptop, and so far I’m not disappointed. One important reason I chose this model is because they are more easily serviceable than other comparable offerings like the Microsoft Surface Pro line; the Surface Pro is glued together in a way that is difficult to disassemble and reassemble, which makes me very unhappy. Batteries have a limited service life (as I know all too well from my last post), and I don’t want to throw away a perfectly good tablet in a couple of years just because the battery is not holding a charge. Even if you don’t have any interest in taking apart your own devices, I would encourage you to consider the fixability of your device and vote with your wallet against throw-away devices. Anyway, enough of that rant.

Together with my Dell tablet I bought a keyboard. There’s two types of keyboard available for the Dell Venue 11 Pro: a “slim tablet” keyboard (K11A), which is just a keyboard and touchpad, and a “mobile” or “travel” keyboard (K12A), which additionally has a battery in it. I chose the latter version with the battery inside so that I could get more battery life out of my tablet.

I ran into an interesting problem with the travel keyboard, or at least my unit. Sometimes after attaching it to the tablet, the touchpad didn’t work. Sometimes the whole keyboard wouldn’t work. Strangely though, if I disconnected the battery inside the keyboard or let it drain completely, it would always work reliably, so I knew that it was some interaction with the voltage from the battery. Continue reading

Posted in Computing | 2 Comments

Unlocking my Lenovo laptop, part 3

The decryption function

If you are just joining this story you may want to start at part 1.

In part 2, we discovered that a embedded controller update is performed by uploading a small ‘flasher’ program to the EC. This flasher program is then responsible for programming a new firmware image to the EC’s internal flash memory. However, both the flasher program and part of the firmware image are encrypted: the old (currently running) EC firmware decrypts the flasher program, and the flasher program then decrypts the new firmware update. This creates a bit of a chicken-and-egg problem that prevents discovering the encryption algorithm from firmware update files alone. Continue reading

Posted in Computing | 77 Comments

Unlocking my Lenovo laptop, part 2

The embedded controller

In part 1, we looked at the communication between a Lenovo Thinkpad X230T laptop and battery, and discovered that there a challenge-response protocol used to authenticate ‘genuine’ Lenovo batteries. On the laptop side, this – and battery communication in general – is implemented in a component known as the embedded controller (EC). Continue reading

Posted in Computing | 26 Comments

Unlocking my Lenovo laptop, part 1


Two months ago, I bought a new battery for my Lenovo laptop (a ThinkPad X230T). I was about to go away on holidays and wanted a battery that could last me through a plane flight; the original battery was by then barely lasting ten minutes. Little did I know that I was about to be in for an adventure. Continue reading

Posted in Computing | 23 Comments

Introduction to photography slides

These are some slide decks I used to use when I ran introductory courses for the UNSW Photography Club. They are a pretty good set of slides so I figured they should have a home on the Web.

Part I: Camera Principles (focal length, ISO speed, shutter speed, aperture, etc.)
Part II: Metering/White Balance

Bonus slide deck: Lighting and Studio Photography

Posted in Other | Leave a comment

Global food security

I went to a great lecture today by Professor Chris Barrett on “The Global Food Security Challenge in the Coming Decades”. The slides from this lecture are available here. Here are my notes:

  • Current global food demand growth is ~1.25% pa, while annual growth in supply has been falling and is now only ~1% pa.
  • This means food prices are now rising (after decades of falling food prices). 2011 was a record profit year for US farmers. This is good news for renewed investment in the agricultural sector, but until supply can be increased, the poorest will suffer.
  • Developing countries have by far the largest effect on food demand. Not only are they growing much faster than developed countries, but a much larger proportion of income increases are spent on food.
  • Currently 85-90% of food is consumed in the country it is produced. However, most arable land in Asia is already used, so rising Asian demand will require large increases in productivity per hectare or large-scale food imports.
  • The remaining unutilised arable land in the world is mostly in Sub-Saharan Africa and Latin America. Huge land grabs by foreign investors are occurring as a result. In many corrupt countries, the proceeds are going to the political classes, while the poor get dispossessed (even in those countries with property rights, many poor are not within the land title system). A 2008 Daewoo deal to lease 1.3 million hectares in Madagascar contributed to the overthrow of the government there.
  • Nutrient deficiencies in the developing world are more severe than energy deficiencies (~15% of population in developing countries are deficient in energy, 31% in Vitamin A, 33% in iodine, 61% in iron). Effects of nutrient deficiencies on intellectual development constitute a poverty trap.
  • Governments everywhere need to invest more in research on productivity-increasing sustainable farming methods, which may or may not include GMOs, to avoid excessive monopolisation of agricultural technology vital to food security. Patent reform may be required.
Posted in Other | 1 Comment