Close

Measuring Magnetic Fields in a Volume

A project log for low-field MRI

an attempt to develop a low-field coded-field compressed sensing magnetic resonance imager

peter jansenpeter jansen 04/03/2015 at 03:462 Comments

Let's have a look at the first test rig for measuring magnetic fields over a 3D volume.

I confess that I've been thinking about this for a few weeks, and it's been a fun (and sometimes frustrating) design process. We'd like to accurately map the magnetic field intensity and direction at each location in a small volume -- say a 10cm cube. Normally if you'd like to move something through a volume (say, like a 3D printer extruder), you'd put together three perpendicular linear axes, mount your tool or sensor, and that would be it.

But here, getting accurate readings is very important -- this will ultimately be used to measure the first coded fields, and the accuracy of those field measurements will determine the quality of our reconstructions, and in the extreme case, whether the technique will work at all. And it just so happens that most of the things linear axes are made out of -- stepper motors, lead screws, nuts, and other hardware, are magnetic. So we'll have to think a little unconventionally, and figure out a way to make a scanning system that keeps these components somewhat distant from the scanning volume.

The Z and rotational axes

The design I've settled on for this first test uses polar coordinates, and keeps most of the metal parts (and all the metal parts that move or have electromagnets in them, like the steppers) reasonably far away from the magnetometer. To help give a sense of scale, the rig is 8 inches in diameter, and 12 inches tall. First we'll look at the Z and rotational (theta) axes, and then look at the radial (rho) axis.

The base for the rotational stage is mounted on two M8 nylon lead screws that transfer linear motion, and move the whole stage up and down in Z. The base has three 1/4 inch aluminum slides with nylon bushings at 120 degree angles, and there are also three stationary 1/4-20 threaded rods up the length of the machine that help keep everything rigid.

I really like how the rotational (theta) axis worked out -- I had some MLX (2.03mm pitch) timing belts left over from another project, and ended up (after several attempts) being able to successfully laser cut a giant ~5 inch timing pulley (with about 185 teeth) that easily rotates, and also serves as a platform for the radial (rho) stage that we'll see below.

A critical aspect of this stage is that, to make it useful for further testing (of the code coils, or even primary coil), it has to have a large open area in the center where stationary coils could be mounted from the bottom. This complicated the design a bit, but it ends up working out pretty well, and just the Z and rotational axes could very easily serve as the platform for a tiny CT scanner (or other interesting projects that need to rotate around a stationary sample).

Two NEMA14 motors power the Z axis, and are coupled to the nylon lead screws using flexible aluminum couplers.

I like to try and include extra holes and mount patterns on the things that I design so that I can elegantly mount wires or other things as it develops without cutting a new part. Here I've included mount patterns for a Raspberry Pi and Arduino Uno on either side of the bottom of the base.

The lid on the top fits perfectly. Ideally under here there'll be a scanning magnetometer, and an extra stage.

These next few pictures are looking top-down (without the lid). It was such a wonderful angle to photograph, I've included three pictures! I think these are some of my favorite photos that I've had the change to take recently.

Now let's have a look at the radial (rho) stage, that physically translates the magnetometer from the center of the polar circle, outward along a radial line.

Radial (rho) stage (including the magnetometer)

The radial stage definitely looks unusual, but it's what my brain settled upon after thinking of many more complicated ideas. The idea here, again, is to keep all of the moving metal parts as far away from the magnetometer as possible, while still being able to transfer precise linear motion to the magnetometer.

Looking down from the top of the stage, we can see the magnetometer itself (an HMC5883L breakout board from Sparkfun), which has to move from the center of the circle all the way to one side (the right side, in this orientation). It's mounted on a tiny linear stage, and instead of a belt or screw, it uses a cable to transfer linear motion. I've seen this before in some old pen plotters that I took apart years ago, and it really seemed to fit this niche. An elastic band (left side) provides tension to return the axis to the center when the cable isn't actively being pulled.

Kind of silly, but the string that I used at first broke after only about 100 cycles, and I needed to find something around the house that could serve as a more durable replacement. I ended up substituting in some satin dental floss, which causes the machine to smell very pleasantly minty when operating! :)

Here's the underside of the radial (rho) axis. Since this axis moves in several directions relative to the rest of the machine, and contains the sensitive magnetometer, everything is made out of nonmetalic materials. The machine screws and bushings are nylon, and the linear rails are made out of 1/4 inch delrin rods. The tiny carriage that holds the magnetometer is just four pieces of MDF sandwiched together, with press-fit slots for the bushings, captive t-slot nuts for the magnetometer to mount to, and cutouts to securely hang onto the elastic and cable, er, I mean dental floss...

The range of motion (about 4cm, currently) is so short for the radial axis, that we can get away with using a servo motor instead of a stepper, and save an extra stepper controller. This also provides reasonably accurate absolute positioning without the need for a homing endstop or external encoder.

The servo is mounted towards the bottom of this axis (which is about 20cm tall), to keep it as far away from the magnetometer as possible.

And here's the whole thing, indexed up in Z about 4cm. Time to give it a try! I connected it up to an Arduino, and wrote a quick sketch in Processing to visualize the magnetometer field strength at a given location. The Z axis still isn't perfect and has a bit of a ~5mm wobble (it will likely require a third lead screw for stabilization), so I just captured one 2D circular slice of the cylindrical volume, pictured below.

Here we have the very first rough magnetic field image from the machine! This is a baseline image, so the fields are just from Earth's field, as well as whatever the machine itself generates. The variation is surprisingly low -- dark represents the lowest measured field (about 40uT), and light represents the highest field (about 52uT). Samples were taken every 10 degrees in theta, and about every 2mm in rho, so this represents a circle that's about 6cm in diameter, and is the average of about 64 samples per point, which got the variation down to about 0.1uT, which translates into a frequency variation of only 4Hz in the frequency domain! For orientation, the lighter area is centered towards the area of the machine that has two lead screws closer together, where as the dark is centered around the single lead screw.

There's still plenty to do with this rig to characterize the measurements and determine it's accuracy, but it's certainly exciting to see some initial data from the machine.

Thanks for reading!

Discussions

Anthony wrote 05/05/2015 at 03:26 point

My advice, with a good deal of experience in other 'imaging' industries is that you should also implement a very standard form of linear encoder. I could suggest some companies that produce them by a laser trace device, but especially for this scale, on a clear film, one could 'home make' something on a common laser printer. 

On this note, I would check out Avago as though the modules themselves are seeming 'simply' they are widely used in the industry....

These 'new fields', so often they 'calculate', and never during the process itself 'double-check'.... No wonder the end result sucks.. 

  Are you sure? yes | no

AssidiousBlue wrote 04/28/2015 at 14:12 point
This is an awesome project. May I ask: why not RF sensing? With a prepolarising pulse, earth's-field volume MR is slow but possible. I presume the RF sensing (which is what has held me back) but I'm told that some FPGA skills make it trivial (there are paperson it using small permanent magnet setups As for gradient vs coding coils, are gradient coils not simply a special case of coding coil where the mask is linear (and made soe with both physical and electronic shimming?). I suggest, have a look at shimming coil designs. I also suggest using the standard hemi-holtz and saddle setup of gradient coils, but have additional coils in between the main coils that can effectively put a gradient-on-your-gradient. For the hemi-holtz this may look like two larger-current coils at either end, and an array of coils in series between them of lower curreny capacity, and joins at known increments along the coil, essetinally dividing it like a series of resistors. By varying the voltage applied to different points, Ala; 5v 0v 5v 12v 0v 12v | | | | | | | | | | | | vvvvvv vvvvv vvvvv vvvvv vvvvv --> > <<== _____ _____ _____ | | -______- - - - - |_____| Saddle coils are more tricky, but you could rotate the axis to the X,Y gradent coils or invert them between iterations. And you could have the Z(+) and Z(z) pairs operate at diffferent orientations from each other, losing resolution in the process. Even a corase mask made only of basic x,y,z gradient coils being operated such as to provide variable orientation to the magnetic gradient compared to B0 (earth) will get youi there is you can measure the imperfections well enough. Final suggestion. Scan using the golden number, or rather it's conjugate. You'll thank me. It will fill your field beautifally efficiently. phi = (1 + sqrt(5))/2 http://oeis.org/A001622 Phi = -(1 - sqrt(5))/2 <> 0.6180339887... multiply by 2*pi degrees (or 360, giving you 222.5deg) and also do it the opposite way (giving you 137.5deg). You'll be protected by the irrationally irrational nature of phi, and it packs very well, i a mathematically ordered way when it comes to back-calculating In fact, rotate your scanner one way and your B1(x,y,z) the other way, and Cheers, AssidiousBlue

  Are you sure? yes | no