## Magnetometer Axis Label Identification

ultrazapp
Posts: 6
Joined: Sat Aug 12, 2017 8:01 pm
Location: West Lancashire U.K.
Contact: Website

### Magnetometer Axis Label Identification

Hi

I have set up the sense hat to data log and export to a CSV file. The CSV file identifies three axis X, Y and Z and each axis contains data collected from the sense hat. For the life of me I cannot seem to find any information as which axis label relates to to either pitch, roll or yaw.

I have found information on the web from a different make of magnetometer that lists:

Z = Yaw
X = Roll
Y = Pitch

But I have no idea if the sense hat uses the same labels in the same sequence?

ultrazapp
Posts: 6
Joined: Sat Aug 12, 2017 8:01 pm
Location: West Lancashire U.K.
Contact: Website

### Re: Magnetometer Axis Label Identification

Post Follow Up

I have managed to find the following information published by http://cse.ssl.berkeley.edu/segway/WSW_kindex.html
that suggests that I was wrong with my first assumptions relating to Yaw, Roll and Pitch and that the X, Y. Z data produced by the magnetometer realtes to axes in Cartesian Space. Cartesian coordinates are used in mathmatics to plot graphs in three dimensions:

• X: represents the magnetic field strength in roughly the direction of the north magnetic pole. A positive x-value means that part of the magnetic field is pointing north. A negative x-value means that part of the magnetic field is pointing south.

• Y: represents the magnetic field strength 90 degrees from the x-direction in the “magnetic east” direction. A positive y-value means that part of the magnetic field is pointing towards magnetic east. A negative y-value means that part of the magnetic field is pointing towards magnetic west.

• Z: represents the magnetic field strength in the local nadir direction (vertically down).

Does anyone know where I can find any more information about the Sense Hat Magnetometer? I have many questions such as over what area is the magnetometer recording data is it yards, feet, miles? I would think that if it worked on the ISS it records the earths magnetic field over a wide area, but how wide/deep,high?

Is the data entered into the data logger in Gauss or is it compass coordinates?

Does anyone know how I could maybe contact the Sense Hat Developer?

Davespice
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

### Re: Magnetometer Axis Label Identification

Here's a link to the data sheet for the IMU sensor, of which the magnetometer is a part.
I hope this helps.

Many thanks

Dave

ultrazapp
Posts: 6
Joined: Sat Aug 12, 2017 8:01 pm
Location: West Lancashire U.K.
Contact: Website

### Re: Magnetometer Axis Label Identification

Thank you Dave much appreciated.

bensimmo
Posts: 4211
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

### Re: Magnetometer Axis Label Identification

https://www.raspberrypi.org/learning/ge ... worksheet/

is that what you need?

Then the easiest way to get the axis is to just measure them with something magnetic. Stick it in each axis looking at the readings.

Assuming python programming and the API then it's micro-tesla https://pythonhosted.org/sense-hat/api/ ... al-sensors

The code is here, so you can look in it
https://github.com/RPi-Distro/python-sense-hat?files=1

ultrazapp
Posts: 6
Joined: Sat Aug 12, 2017 8:01 pm
Location: West Lancashire U.K.
Contact: Website

### Re: Magnetometer Axis Label Identification

Hi bensimmo

Thank you for your reply

I don't think so, I think that although that image shows the X,Y,Z axis it relates to the sense hats gyroscope rather than the axes on the magnetometer (although they may actually be one and the same?).

I have just read the data sheet that Dave posted cover to cover and it tells me how it works, that it reads a magnetic field and the Gauss range that it measures but it does not tell me what area it is measuring. For example is it measuring the magnetic field on my desk, the room that I am in, my house or at an extreme my town?

I want to fly the Pi and the sense hat from a quadcopter and use the sense hats instruments to measure the environment at about 200 feet in altitude for a PhD project on honeybees, ultimately to produce a 3D graph/map of the area as we know that honeybees use the earths magnetic field to navigate. Guaranteed the first thing my supervisor at Uni is going to ask me is "What does it measure and over what physical area, and Er prove it son"

I have used the data produced from the sense hats magnetometer data to produce the attached 3D graph which as I thought shows magnetic peaks, troughs, valleys and mountain ranges that the bees are likely to use to navigate, but Im really struggling to put any meaning to the image as I have no idea of the physical area being measured as in Length x Height x Width?

I missed the Astro Pi project, just wondering if there were any experiments on the ISS using the magnetometer that might help me answer these questions? Or I could have it all wrong and the magnetometer might just have been used with the accelerometer and gyro and I am going off in entirely the wrong direction.
Magnetometer.png (97.69 KiB) Viewed 4716 times

bensimmo
Posts: 4211
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

### Re: Magnetometer Axis Label Identification

They can be used separate and do note in the tech specs the magnetometer picture is rotates for some reason.
X,y,z are all the same axis as far as I remember.

It measures the field at that specific point, which as far as I know is a combination of everything its sensitivity can measure. It is not a 'distance'.

Stick a plotting compass on a desk and it measure a combination of everything, this should be just the same.
Move a large magnetic field near it and it will see in a higher ratio over earth's field, probably drowning it out.

You may need to calibrate it on your device to remove background motors etc,though they will be constant -ish.

Other should be able to give you more detail on the MEMS device itself.

Note not tried and just thought.
One idea to remove background could be to mount one device front and rear, anything 'close' will be quite obviously different in numbers.
If that can then be removed, I don't know.
Or if it's needed, unfortunately I don't know own enough about them.

(We stick them in rockets up to 1km at the moment).

Burngate
Posts: 6151
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

### Re: Magnetometer Axis Label Identification

ultrazapp wrote:
Fri Sep 01, 2017 5:38 pm
... I have just read the data sheet that Dave posted cover to cover and it tells me how it works, that it reads a magnetic field and the Gauss range that it measures but it does not tell me what area it is measuring. For example is it measuring the magnetic field on my desk, the room that I am in, my house or at an extreme my town?

I want to fly the Pi and the sense hat from a quadcopter and use the sense hats instruments to measure the environment at about 200 feet in altitude for a PhD project on honeybees, ultimately to produce a 3D graph/map of the area as we know that honeybees use the earths magnetic field to navigate. Guaranteed the first thing my supervisor at Uni is going to ask me is "What does it measure and over what physical area, and Er prove it son"

I have used the data produced from the sense hats magnetometer data to produce the attached 3D graph which as I thought shows magnetic peaks, troughs, valleys and mountain ranges that the bees are likely to use to navigate, but Im really struggling to put any meaning to the image as I have no idea of the physical area being measured as in Length x Height x Width?
It may be that you're misunderstanding what a magnetic field is.
The field strength only refers to one point in space. A mile away, a yard away, a nanometre away, it could be different.

The magnetometer has a physical size, and so averages the field strength over its volume, but the principle still applies - it's a measurement that refers to one point only

A honey bee has some mechanism for sensing magnetic fields (possibly lumps of ferrite - the mechanism isn't important) that averages forces over its volume.
If you were to look at a large-capacity disc drive, you'd find the data is written in the magnetic field structure on the surface, and the read head at any rate is smaller than a honey bee's sensing system, so it can sense smaller details of the field.
Go to a hi-tech physics lab and investigate the magnetic field of a hydrogen atom. You'll find that the field caused by the orbiting electron is ginormous, within the volume of the atom, but is cancelled out by other atoms close by (an angstrom or so) and by the proton rotating at the centre. The proton, in turn, is three "rotating" and "orbiting" quarks each with their own magnetic fields, though it becomes less meaningful to talk about their position or velocity at that scale, and the magnetic field strength becomes meaningless.

ultrazapp
Posts: 6
Joined: Sat Aug 12, 2017 8:01 pm
Location: West Lancashire U.K.
Contact: Website

### Re: Magnetometer Axis Label Identification

Thank you everyone, I will keep digging and post any new information that I can find out here

bensimmo
Posts: 4211
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

### Re: Magnetometer Axis Label Identification

grab some magnets and lay them out a distance away and see if you can map them in a room, it might give you more of a feeling for what's happening.
See if you can 'see' the magnets position.

Burngate
Posts: 6151
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

### Re: Magnetometer Axis Label Identification

An interesting site I came across had this page: http://www.eng-tips.com/viewthread.cfm?qid=21199
From there, I quote:
The definitions below gives 1 Gauss as 6.45 lines/in^2, just as JW says, and I've verified by calculation. Hope it helps.

Calculation:

From Definitions,
1 Max = 1 Line
since 1 Gauss = 1 Max/cm^2,

Simple conversion(1/cm^2 to 1/in^2) gives:

1 Gauss = 6.45lines/in^2

Definitions:

gauss (G or Gs) [1]
the CGS unit of magnetic flux density. A field of one gauss exerts, on a current-carrying conductor placed in the field, a force of 0.1 dyne per ampere of current per centimeter of conductor. One gauss represents a magnetic flux of one maxwell per square centimeter of cross-section perpendicular to the field. In SI units, one gauss equals 10-4 tesla. The unit is named for the German mathematician and astronomer Karl Friedrich Gauss (1777-1855).

maxwell (Mx)
a CGS unit of magnetic flux, equal to 10-8 weber. In a magnetic field of strength one gauss, one maxwell is the total flux across a surface of one square centimeter perpendicular to the field. This unit was formerly called the line [2]. The newer name honors the British physicist James Clerk Maxwell (1831-1879), who presented the unified theory of electromagnetism is 1864.

line (li) [2]
a former name for the maxwell, the CGS unit of magnetic flux. The unit was called the line because magnetic fields were traditionally represented by lines depicting the direction of the field; the idea was to quantify the strength of these lines. This is a small unit, so fields were often measured in megalines; one megaline is equal to 0.01 weber.

Definitions from this page:

http://www.unc.edu/~rowlett/units

Etrix
He talks about lines and Maxwells for the amount of field, and Gauss (what you're measuring) and lines per square inch.
Your device effectively counts lines passing through it, and divides by its area.

ultrazapp
Posts: 6
Joined: Sat Aug 12, 2017 8:01 pm
Location: West Lancashire U.K.
Contact: Website

### Re: Magnetometer Axis Label Identification

Thank you much appreciated, I'll let you know how I get on.

Return to “Astro Pi”