# Absolute 3D Tracking With EM Fields

[Chris Gunawardena] is still holding his breath on Valve and Facebook surprising everyone by open sourcing their top secret VR prototypes. They have some really clever ways to track the exact location and orientation of the big black box they want people to strap to their faces. Until then, though, he decided to take his own stab at the 3D tracking problems they had to solve.

While they used light to perform the localization, he wanted to experiment with using electromagnetic fields to perform the same function. Every phone these days has a magnetometer built in. It’s used to figure out which way is up, but it can also measure the local strength of magnetic fields.

Unfortunately to get really good range on a magnetic field there’s a pesky problem involving inverse square laws. Some 9V batteries in series solved the high current DC voltage source problem and left him with magnetic field powerful enough to be detected almost ten centimeters away by his iPhone’s magnetometer.

As small as this range seems, it ended up being enough for his purposes. Using the existing math and a small iOS app he was able to perform rudimentary localization using EM fields. Pretty cool. He’s not done yet and hopes that a more sensitive magnetometer and a higher voltage power supply with let him achieve greater distances and accuracy in a future iteration.

## 28 thoughts on “Absolute 3D Tracking With EM Fields”

1. mikebarela says:

9 volt batteries in series provide additional voltage. 9 volt batteries in parallel provide additional available current.

1. Michangen says:

Adding an additional battery in parallel will allow you to draw more current if you are finding yourself limited by the internal resistance of the battery. If you need your circuit to draw more current than it currently does, increasing the voltage by putting the batteries in series makes sense.

2. harry says:

Some ohm’s law for you in case you’ve forgotten, in this example R will be 1 ohm.
U = R*I
9 = 1 * I
I = 9 amps. okay, let’s put 2 9 volt batteries in series
9 = 1 * I
I = 9 amps, okay so with 1 ohm load I still get 9 amps even if I have one 9 volt battery or 2 in parallell.

let’s put 2 batteries in series and see what happens.
9*2 = 1 * I
I = 18 amps. Okay, that’s more amps when I put the 9 volt batteries in series. Cool.

What you are thinking about is probably about Ri, the internal resistance and about how much batteries can actually deliver. It’s not clever of me to use 1 ohm resistance because it’s not common for a 9 volt battery to be able to deliver 9 or 18 amps (usually around 6 amps).

1. loans says:

Two batteries in series will provide additional runtime given the same current requirements. The parent comment wasn’t entirely precise, but that’s what it was alluding to.

1. Serious php issues there. Never ever have output print to the screen or console during an error situation (unless it is a user error) on a production environment.

1. That’s me, sorry. I didn’t realise this was going to be on hackaday. I’ll post back when I fix it.

2. Jacques1956 says:

“higher voltage power supply with let him achieve greater distances “,

It is not higher voltage that he needs but higher current. The strengh of magnetic field is related to current in the coil not voltage.

1. smeeg says:

The current through the coil is proportional to the voltage across it.

1. Jacques1956 says:

Obviously but the coil can be designed with bigger wire to reduce resistance. the point here is low resistance coil and a voltage source that can support high current output, this exclude 9 volt batteries.

3. Ted says:

The problem is even peskier than that: magnetic fields fall off with an inverse cube law.

4. Forrest Voight says:

Just look at the Sixense Razer Hydra for a great (several meter range) implementation of this for ideas…

1. Err, no. Hydra has a range of about 50cm at best. You simply can’t get more range from such a small coil and the power available from an USB port.

If you want ideas, then a better example is Polhemus Fastrak (and its many variants), Polhemus Liberty Latus (has wireless sensors), Ascension Technology MotionStar or the ancient Flock of Birds. There are probably some more magnetic tracking systems available, but these are the most common ones. Razer Hydra is the same thing, but on a much smaller and simplified scale.

These devices also don’t use magnetometers, because a magnetometer is simply too slow. Accurate localization needs at least 3 successive signals from 3 different coils, so if you want a reasonable update rate, the sensor needs to be fast. Pretty much all these sensors use wire coils for this reason.

If you want to do a full 6DoF localization (position + orientation in space), you need 3 coils for each sensor and 3 transmitting coils. Then some complicated math and it will give you the full solution.

If you want to know how this works, here is an article from 1979:
http://ieeexplore.ieee.org/document/4102227/

The basic technology changed very little since then, with only minor variants like AC vs DC tracking.

Oh, and pretty much everything in this field is heavily patented by Polhemus, Invensense and others – that’s why there have been zero low cost magnetic trackers until the Hydra (which was licensed).

1. Shakipu says:

Wooooh man, I was thinking about the Polhemus Fastrak cause I started working with it last week. That’s an awesome device !

2. DMPalmer says:

Anything in an article published in 1979 is now out of patent. (In theory.)

5. dassheep says:

> it’s used to figure out which way is up

Actually accelerometer is used for that. The magnetometer is used to figure out which way is north.

6. Junk Collector says:

It’s almost as if there is some relationship between voltage and current. I’ll have to meditate on this for a little while.

ohhmmmmmmmmmmmmmm…. ohmmmmmmmmmmmm….

7. If you use “magnetic fingerprinting” you could do all this without a base station. Effectively you calibrate to the room you are in and it builds the “map”. Company called IndoorAtlas are doing this with some smartphone software. It’s pretty trick for gross positional tracking.

1. Harold says:

Autism is a fundamental difference in brain structure. Brain stimulation therapy only works for when the brain is acting up, but is otherwise neurotypical. Not to mention you’re not going to do any brain alteration with a few 9v batteries, because otherwise, our perception of reality would change significantly every time we turned our heads.

2. echodelta says:

Or cause leukemia!

8. Paul says:

This reminds me of work I did around 1990, with the Ascension Technologies Bird (and later Flock of Birds). It’s still available, though they’ve upgraded their sensor technologies dramatically from the old fluxgate devices: http://www.ascension-tech.com/products/

The transmitter puts out a 4-state pseudo-static pulsed DC magnetic field (4 states: X, Y, Z, and off to compensate for ambient). The magnetometer sensor measures the magnetic field instensity and direction from each state and computes its position and orientation relative to the base. It’s a fun math problem.

The 10-cm cube transmitter has a working volume of about a cubic meter, and puts out enough magnetic field to make a CRT display unusable within that range. Back in the last millennium they also had a foot-cube transmitter for a whole room.

Other technologies (like Polhemus) use low-frequency AC instead of pseudo-static DC fields, but it’s a similar idea.

1. Yup, pretty much. The technology didn’t change significantly since the late 80s.

The sensors are are still coils, as far as I know, not integrated magnetometers. The “foot cube” is called Extended Range Emitter (ERT), weighs about 20 kilos and contains 3 enormous coils in a wooden box, driven by the Extended Range Controller (ERC). The smaller cube didn’t have a special driver box. The range of the large cube is about 3 meters around the cube and up to 2 could have been linked together, extending the workspace for motion capture in a larger volume. The cube It is still available, as an OEM product. And yeah, CRT monitors were totally unusable even next door from the tracking system – all the pulses were visible on the screens.

The Flock of Birds modules are actually a 80186 based “PCs”, the later MotionStar (both wired and wireless) was a regular Pentium PC running from a DOS floppy and streaming the tracking data over ethernet. The Flock of Birds modules were replaced by cards in a rack case. Otherwise the hw was the same. It was a very finicky gear, but once it was set up and running, it was rock solid.

Here is a history of the Ascension Tech products:
http://www.ascension-tech.com/products/product-history/

9. Zeff says:

http://embedded.fm/episodes/162 Is the episode of Embedded.fm where they talk to Alan Yates, one of the creators of the Vive. It’s a really good listen if you’re interested in the evolution of their spatial tracking hardware and a run through of the general architecture.

^^ This is a pretty neat. You can never have enough ways to sense stuff!

10. Turing Complete Machine Machine Machine Mach.... says:

Put 2 markers on the hinges and one on the bridge. Use 2 or 3 cheap cameras and locate the glasses in 3d space.
Example of markers (and more) here: http://artoolkit.org/documentation/doku.php?id=3_Marker_Training:marker_multi
I believe that if you remove the IR filter from the web cameras, you can use this system in the dark also (but you’ll need IR illumination and have to check that the markers are also detected).