Zimmer Research Project: 3-D Magnetic Tracking System

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Zimmer

Research
Project
2010
3-D Magnetic
University at Buffalo
Christopher Van Loon Tracking
System
2|P ag e

Table of Contents
Introduction 3
Concept 3
Experience and Results 4
Magnet Selection 4
Data Acquisition 6
Sensor Selection 6
Testing the Sensor 7
Data Acquisition Issues 8
Filtering 8
Final Circuit Construction 10
DAQ Accuracy and Quantization 11
Calibration 12
15
Testing in 2D Plane
20
Comments on Accuracy
Alternatives and Future Considerations 20
Commercialization 21
Special Thanks 21
3|P ag e

Introduction

This project was initially proposed to me by Dr. Singh in the fall semester of the 2009-2010
academic year. I wanted to explore the opportunities of graduate school at Buffalo and figured it would
be a good way to do it. I was shown some of the research work performed by Vincent Schlageter, Pierre-
Andre Besse, Radivoje Popvic, and Pavel Kucera of the Swiss federal institute of technology at Lausanne,
Switzerland. This project ended up being Vincent Schlageter’s PhD thesis which has since been
commercialized in a product to map a person’s digestive system ( I will discuss this in a later section as
well). Although I didn’t get the final result I wanted in terms of functionality, I feel that this experience
has been very beneficial in terms of what I have learned technically and what I have learned of the
research process. I have learned from success and failure through the process and feel that I am better
for it. This paper is meant to be a summary of the process I went through and what I learned.

Concept

The purpose of the device is to measure the location of a small magnet in a 3 dimensional space.
The magnet can be located based on the equation of an ideal dipole magnet. The assumption is that the
magnet is small enough to represent a point source. If this is the case, then you can assume that the
magnetic field a point sees is equal to the following:

Where B represents the magnetic field, m the magnetic moment, r is the coordinates of the magnet with
respect to a reference position and μ is the permeability of free space. This equation could be solved
with readings from the 16 hall sensors, making it an over determined system (5 degrees of freedom) To
begin, I wanted to look at restricting the device to 3 degrees of freedom, by eliminating the rotation of
the magnet. This allowed me to simplify the equation to the following (when the magnet’s moment is
restricted to the z direction):

Once values were found for values of B from multiple sensors it would be a matter of solving a non-
linear, over-determined system. I planned to use a Levenberg-Marquet optimization algorithm I had
found online for MATLAB.

The original developers of the device mentioned used 16 Hall Effect sensors with integrated flux
concentrators. The flux concentrators were integrated into the chip and serve to amplify the magnetic
field accepted by the device. This is shown in a picture below. I wanted to contact the original makers to
4|P ag e

see, because I couldn’t find sensors with these qualities anywhere. I


asked a knowledgeable member online as well who gave me
instruction as to how to make flux concentrators with a diamond saw
and a piece of ferrite that were not integrated, but they would be
rather large and cumbersome for this project. Other than the sensor,
and the fact they mounted their device on a PCB, my implementation
tactic would be similar. In nature

Experience and Results

This section of the report is meant to show the stages in design that I followed and what
happened along the way. I will cover successes and failures while trying to give an idea of what was
learned at a personal level along the way.

Magnet Selection

To Begin, I started looking into what it took to buy a magnet that would work for my application.
The magnet used by the researchers in the paper I based my work off of was a rare earth magnet that
had a magnetic moment of 0.2 Am2. Using this as a guideline I began to investigate. I first had difficulties
determining how I could purchase a magnet with a known magnetic dipole moment, as none of the
manufactures I found would list that as an attribute of the magnet. As I found later, it’s not a very
common attribute to be known as it is an approximation. Eventually I found a site that described what
exactly a magnetic moment was more clearly and how I could calculate it from more common
specifications given by manufacturers. The site I found is at:

www.netdenizen.com/emagnet/offaxis/mmoffaxis.htm

The site describes a magnetic dipole as a way to approximate the magnetic field a certain distance away
from the point where the magnet exists. It mentions that at a distance 5 times the largest magnet
dimension, 2 % error will be introduced into the calculation. Therefore, it is important to keep the
magnet as small as possible. It later described that a permanent magnet has a magnetic moment of:

Where V is volume, μ is the permeability of free space and Bi is the intrinsic induction of the magnet in
tesla’s (a measure of magnetic field). The value of this equation is the relation between the magnetic
moment and Bi as I noticed that Bi was often given in manufacture’s magnet properties.

With this new information, I determined that K&J magnetic offered the most organized method
for me to go about searching for a magnet. First I looked at the available magnets sizes and materials. I
could then look materials property table list (a piece of which is shown below) and determine B i. Note:
in the table below Bi = Br.
5|P ag e

I purchased 3 magnets varying in size and material. They are shown below:

The calculation for the 3/16”x3/16” N52 is shown below:

With this calculation I could determine the value for the magnetic moment:

The magnetic moments were calculated as m=.156-.158 Am2 for the 1/8 x 3/16 magnet and .116-.118
Am2 for the 1/8 x 1/8 magnet.
6|P ag e

Data acquisition

The next thing I looked at was how I would go about taking in voltage readings from the Hall
Effect sensor. This turned out to be a longer process than I intended, but what I learned and reinforced
was valuable. I started the process working with a board used by a previous Masters student working
with Dr Singh. I was offered to work on a computer that had a UMI 7764 board in it. The board is mainly
used for motion control, however had 4 analog channels.
I was fairly new to it all so I started researching how to
use it with LabView. After asking around a bit online I was
told that the device was over-kill for what I was doing
and that I should see what other resources I had to
simplify the process. After looking at numerous devices I
could purchase online, Dr Singh, mentioned I could talk
to Scott Woodward about using something he had. He
offered a DAQ Card 1200 that could be installed in my
laptop. It had 8 channels with 12 bits of resolution. The
device also had programmable gains of up to 100, which
would come in handy later. Mr Woodward offered me much of the equipment I used during the course
of the semester. I would eventually use LabView in order to save a data file and use it later with matlab.

Sensor selection

While looking at Data acquisition systems, I was also looking at possible sensors to use. My first
discovery was that Hall Sensors are more generally used for applications where there needs to be simply
a test of weather or not a magnet is present. It was much less common to find a “linear” Hall Effect
sensor that varied its voltage with respect to the magnetic field it sensed. Regardless, I found that the
most important specification of the sensor would end up being that of sensitivity (mV/Gauss). This had a
very large impact on my application because the voltage changes that I would experience would be so
small due to the small changes in magnetic field. In order to get a good idea of how the sensor would
react to the magnet I purchased (m=.4) I did the following analysis. I set a coordinate system and varied
only the z location of the magnet. Using the equation for the ideal magnetic moment, I determined the
fields I could expect. The results are shown in the table below:
7|P ag e

Distance (cm) Magnetic Field


(Gauss)
14 .2915
13 .364
10 .8
9 1.097
8 1.5625
7.5 1.8963
6 3.703
5.75 4.21
3 29.63
2.9 32.8

From these values, I could determine the expected change in magnetic field, thus a change in voltage,
assuming I knew the sensitivity of the sensor. After looking around a bit, I decided that my best
alternative was a sensor made by Honeywell that had 5 mV/Gauss sensitivity. I then did analysis on the
expected accuracy of the system. This analysis is summarized in the table below:

Comparison Expected Voltage Change (mV)


Between 14 cm and 13 cm .3625
Between 10 cm and 9 cm 1.485
Between 8 cm and 7.5 cm 1.669
Between 6 cm and 5.75 cm 2.5
Between 3 cm and 2.9 cm 15.85

As you can see, the sensor has a hard time in the 13-14 cm range, but could detect the other differences
quite well. I eventually decided to purchase the sensor. Asking around online I was warned that the
device may have bad drift. I contacted a Honeywell Engineer and he said the drift would be less than a
tenth of a percent per degree Celsius, which wasn’t going to be a problem.

Testing the Sensor

After playing with some of the equipment Mr. Woodward gave me, we decided to hook up the
sensor to an oscilloscope to see what kind of signal we were getting out of it. The signal was very noisy
(discussed later) but definitely demonstrated the characteristics I was looking for. Unfortunately though,
I didn’t get range I expected out of it. By lowering the volts/division and putting the oscilloscope in “AC-
Coupling” mode, we were able to get an idea of the range that was expected out of the sensor. By
putting the Oscilloscope in AC-Coupling, the signal only changes if it senses changes in the input.
Because of this, we could move around the magnet at a certain height and see where there was visible
motion in the signal on the oscilloscope. Unfortunately, this occurred at around 8 cm or so. The noise
was also fairly significant spanning around .8 V (800 mV)
8|P ag e

Data Acquisition Issues

The problem I now faced was that the voltage signal from the Hall Effect sensor was 2.5 volts
when there was no magnet present. In order to amplify the signal, I needed to first offset this voltage so
that it would read 0V. I purchased some instrumentation amplifiers online and wired a circuit on a
breadboard that was suggested by its data sheet (Diagram to the left). This allowed me to offset the
voltage to 0 and then amplify it by whatever gain I wanted by selecting RG. When I hooked it up, the
sensor acted as a switch instead of a linear sensor. I brought the circuit again to Mr. Woodward, and
after looking at it for a while, we couldn’t understand why the circuit was behaving the way it was. To
simplify the process, we decided to make a simple differential
amplifier. The differential amplifier allowed me to offset the
voltage as well with a trim-pot, and apply a desired gain. The
disadvantages were accuracy and noise. The suggested circuit is
also shown to the left. The circuit is governed by the equation
below:

After a lot of trial and error, I got the circuit to work for my sensor,
with a gain of 1. This was now ready to be read by the DAQCard
1200.

Filtering

After Finalizing the circuit, I ran it into the DAQCard This is the signal I got:
9|P ag e

As you can see, it is very noisy. In order to get rid of this noise, I used a low-pass filter. This was made by
adding a capacitor in parallel with the resistor that connects the output of the op-amp to the inverting
input. The following demonstrate noise levels observed using different capacitors

25 microFarad
10 | P a g e

3300 micro Farad

4700 micro Farad

There was virtually no difference between the 3300 and 4700 capacitors, therefore, due to size I chose
to use 3300 μF Capacitors to filter the signal.

Final Circuit Construction

The final circuit construction used 2 dual op-amps, and the only 2 sensors I had. Conveniently,
when I hooked up the new circuit (with out the capacitor) the noise was gone, so it seemed as though
the new op-amps eliminated the noise. A picture of the final circuit is shown below:
11 | P a g e

DAQ accuracy and Quantization

Before I began a calibration, I wanted to explore the accuracy of the DAQ device I would be using and
ensure that it would demonstrate the accuracy I would expect. I used a data logger program provided by
lab view and adjusted the programmable gain per the following:
12 | P a g e

The .1 and -.1 on the bottom in orange set the maximum and minimum voltage values. These values
were one of the prescribed programmable gains of the device. I could calculate the expected voltage
jumps by making the following calculations:

The device had 12 bits of resolution therefore;

Steps from the minimum to the maximum voltage. With the span of .1-(-.1) = .2, the expected voltage
step size was:

I then ran the program shown above and opened the data in excel. By zooming in on part of the plot I
could see clearly that these voltage step sizes where as expected.

Quantization
0.0609
0.06085
Voltage Reading

0.0608 0.060791016
0.06075 0.060742188
0.0607
0.06065
0.0606
0 200 400 600 800 1000
Sample Number

The voltage step size is:

0.060791016-0.060742188= 4.8828x10-5

Therefore, I got the results I wanted

Calibration

Again, using equipment of Mr. Woodward, I was able to calibrate the device. A picture of the set
up used is shown below:
13 | P a g e

The blue rod coming out of the device had a magnet on the end of it. I could accurately move the
magnet up and down and measure voltages from the hall sensor. To calibrate the device, simply varied
the vertical positioning of the magnet above the sensor and measured the corresponding voltage. The
measured distance from the sensor allowed an accurate calculation of the magnetic field. Sensor 1
calibration is shown below:

Voltage (V) Distance Field (T)


(cm)
0.019683551 2 0.01
-0.007759238 2.5 0.00512
-0.021002994 3 0.002962963
-0.028753101 3.5 0.001865889
-0.03130501 4 0.00125
-0.03130501 4.5 0.000877915
-0.035935992 5 0.00064
-0.03614477 5.5 0.000480841
-0.038520864 6 0.00037037
14 | P a g e

Sensor 1 Calibration
0.012
0.01
y = 0.16828723x + 0.00656488
R² = 0.99581803 0.008
Field (T)

0.006
0.004
0.002
0
-0.05 -0.04 -0.03 -0.02 -0.01 0 0.01 0.02 0.03
Sensor Reading (V)

The calibration results for Sensor 2, carried in the same fashion as sensor 1 are shown below:

Voltage (V) Distance Field (T)


(cm)
0.065958435 2 0.01
0.04036941 2.5 0.00512
0.030127526 3 0.002962963
0.021374483 3.5 0.001865889
0.017934808 4 0.00125
0.016878622 4.5 0.000877915
0.013992932 5 0.00064
0.013019061 5.5 0.000480841
0.012542831 6 0.00037037
15 | P a g e

Sensor 2 Calibration
0.012
0.01
y = 0.17898906x - 0.00199922
0.008 R² = 0.99607138
Field (T)

0.006
0.004
0.002
0
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07
Sensor Reading (V)

Testing in 2-D plane

Shown below are the testing coordinates and their position relative to each of the sensors:
16 | P a g e

Demonstrations can be found on my blog for this project at:

http://vanloonzimmer.blogspot.com/

or, along with other projects on my YouTube channel “cvanloon”

To summarize the demonstrations, I began by setting the magnet. In the first demonstration I set the
magnet to 1.27 cm in the x direction and 4 cm in the z direction. In other words, this was approximately
17 | P a g e

the middle of the sensing range. I ran the data loggers to get the voltage readings from the sensors. I
then took these two sensor readings and calculated the corresponding magnetic field. From these values
I could use a matlab program using a function handle and Levenberg-Marquardt algorithm to determine
the location of the magnet. The returned values were 1.22 cm in the x direction and 4.21 cm in the z
direction. This is illustrated below:

The above grid shows the expected sensing range of the device. The green dot is the actual location of
the magnet while the red dot is the location measured by the Hall Effect sensors. As you can see this is a
respectable reading. A few more readings are shown below as well with the same color scheme:
18 | P a g e

I then wanted to test the limits of the device and see how it reacted as I moved away from the sensors.
This tested the expected range discussed earlier. These results were found:
19 | P a g e
20 | P a g e

As you can see, as the distance grows, the sensors accuracy begins to deplete. A few explanations
include the fact that there are only 2 sensors measuring 2 variables, and I used a tape measurer to
measure the x axis value. The system is naturally a little inaccurate. I discuss this later in the future
considerations section.

Comments on accuracy

The accuracy of the device was actually pretty surprising to me. The use of 2 sensors to
determine 2 unknowns (not over determined) would yield
some fairly in-accurate results. The paper I based my work off
of used over determined systems in terms of 5 unknowns with
8 and 16 sensor setups. The graph to the right demonstrates
the error they discovered. As you can see they would get up to
3 mm of error when y was in the range that I sensed. My error
was generally within 1-2 mm when testing the device.

Alternatives and Future Considerations

To continue with the device, I would need to get a different sensor. Unfortunately, when I was
ready to purchase more sensors, the only site that offered single quantities of them ran out of stock.
Also, after getting a better idea of the capabilities of the sensors, I feel that they
didn’t work that well for this application. Although they were cheap ($4 each) they
21 | P a g e

would only give accurate readings of up to 6 cm away from the sensor. Mr. Woodward did a little
searching and found a sensor that would work better for it. The MicroMag 3 axis magnetometer is pre-
amplified and conditioned for magnetic fields between +/- 11 Gauss, which is right around the sensing
range required for the magnet I used. This would be something that I would continue to explore and
determine whether or not it’s properties would be better suited to make a more complex device. This
device costs $59.95 from SparkFun.com.

Commercialization

As I mentioned earlier, Dr Schlageter used this work for his PhD thesis. After contacting him and
some of his colleagues, I found that he had started a company based
on his findings. The company is called Motilis and specializes in
digestive system tracking. The device is used for patients who have
problems with constipation, diarrhea, IBS or gastroparesis. Through
this application, a magnet, in the form of a pill, is ingested and tracked
for 72 hours as it passes through the digestive system. This device is so
advantageous because it eliminates tubing and X-rays once used. The
patient is able to simply ingest the pill and live a normal lifestyle. The
device also allows doctors to analyze transient behavior in the
digestive system by easier, faster, and more cost efficient means. It
enables them to see where exactly a problem is, whether or not it is
permanent, and if treatment is working or not. The company was
started in 2007 with two of the members mentioned on the paper I
worked from (Vincent Schageter and Pavel Kucera). I found it
interesting to see from the outside how a research project made the
conversion to a potentially successful commercial product. Knowing a lot of what goes into the
technology also made it an interesting discovery and to see how the technology is applied.

Special Thanks

I would like to give a special thank you to both Dr Singh and Scott Woodward. Both helped a lot
through various stages in the process and have made the experience a lot more enjoyable. I would also
like to thank those involved in Zimmer selection process as their contributions have made the project
possible.

You might also like