Pages: [1]   Go Down
Author Topic: Mag + Gyro correct directions AND MagZ axis question  (Read 1010 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
Karma: 1
Posts: 152
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


can someone confirm that I put the orientation of my IMU right.

- If I point X to North and turn it right, MagX decreases. So MagX=MagX*-1 , correct?
- If I point Y to North and turn it right, MagY decreases. So MagY=MagX*-1 , correct?

- If I point X(front) upwards, AccX raises. So AccX=AccX, correct?
- If I point Y(front) upwards, AccY raises. So AccY=AccY, correct?
- If I pint Z up, the value is negative. If I point Z down it is negatve. So AccZ=AccZ*-1, correct?

Regarding MagZ: I point it North (IMU 90° tilt - so upside north) and I get positive values. I turn it right 360° but the values always stay positive.
The only way to get negative values for MagZ is if I point it 45° down and North .
What am I doing wrong here? How do I find the correct orientation for MagZ?


« Last Edit: January 18, 2013, 07:26:25 am by robvoi » Logged

Offline Offline
Faraday Member
Karma: 62
Posts: 3080
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I suggest you look at how the earth's magnetic field works.  It depends where you are.

The lines of the earth's magnetic field head generally in the direction of the north magnetic pole
and they also point down into the ground ( or out of the ground ).   The readings from the magnetic
sensor form a vector which shows the direction of this field.  When you wave the device around,  this
vector will always point in the same physical direction,  but its apparent coordinates in terms of the
nominal axes of the device will seem to change,  as you move those axes around.

If you hold the device so that one of the axes of the device is aligned with the earths magnetic field,
then the vector coordinate for that axis will be maximum  and the coordinate for the other two axes
will be close to zero.

The different sensor devices on your board are not necessarily all aligned the same way.   If they are not,
you just swap the coordinates in your code so they are.

Pages: [1]   Go Up
Jump to: