Problem with HMC5883L

Post Reply
Scotth72
Posts: 23
Joined: Sat Jan 21, 2012 4:11 am

Problem with HMC5883L

Post by Scotth72 »

I am trying to get my compass reading correctly. I have the readings going in the proper direction per the sensor position directions. The problem is when I turn the quad upside down. The N/S axis does not flip like it should when its flipped on its pitch axis. If I flip the quad on the roll axis, the compass readings do flip. Is this a problem? I'm preparing for GPS, I need to make sure the compass is working properly.

kalle123
Posts: 106
Joined: Sun Oct 09, 2011 10:07 am

Re: Problem with HMC5883L

Post by kalle123 »

I think you don't want to fly upside down with MAG on.

Scotth72
Posts: 23
Joined: Sat Jan 21, 2012 4:11 am

Re: Problem with HMC5883L

Post by Scotth72 »

Understood. It does show that the Mag is not always showing where north is, which could cause problems with navigation.

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: Problem with HMC5883L

Post by mr.rc-cam »

It does show that the Mag is not always showing where north is, which could cause problems with navigation.

If the Mag sensor is not accurate then there is a chance that the "3D" calibration was not performed correctly or the sensor is too close to metal objects or magnets.

BTW, you should also check the mag sensor's accuracy *under all throttle settings* to ensure that magnetic fields from the nearby high current wiring does not affect it.

- Thomas

kalle123
Posts: 106
Joined: Sun Oct 09, 2011 10:07 am

Re: Problem with HMC5883L

Post by kalle123 »

Working with multiwii is is always a good idea to have a standard arduino (like UNO etc.) around to directly check those sensors.

You can find sketches for the sensors in the web.

MAG -> https://www.loveelectronics.co.uk/Tutor ... no-library

Then you know, it is not the sensor but the software.

BR

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Problem with HMC5883L

Post by Noctaro »

Did you assign the right axis definition in config.h?
Does it behave like descirbed in the FAQ? -> http://www.multiwii.com/faq
How should be the sensor axis directions

TILT the MULTI to the RIGHT (left side up):

MAG_ROLL, ACC_ROLL and GYRO_ROLL goes up
MAG_Z and ACC_Z goes down

TILT the MULTI forward (tail up):

MAG_PITCH, ACC_PITCH and GYRO_PITCH goes up
MAG_Z and ACC_Z goes down

Rotating the copter clockwise (YAW):

GYRO_YAW goes up

The copter stays level:

MAG_Z is positive ; ACC_Z is positive


greetz
noctaro

Scotth72
Posts: 23
Joined: Sat Jan 21, 2012 4:11 am

Re: Problem with HMC5883L

Post by Scotth72 »

Yes, the sensors move according to the FAQ. It just seems that it should always point north, even when its inverted, and it does not currently. I did find that the roll and pitch axis do NOT correspond to the silkscreening on the sensor bob. Silkscreen says y is roll, but I had to tell software x is roll to get proper values in GUI.

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Problem with HMC5883L

Post by Noctaro »

hmmm....got weird with the axis definition of mag since the beginning......
i know anywhere around here was a threat about an alternative compass calibration....wasnt it EOSBandi who talked about?
i will have a look if i can find it.

edit:
here we go ->
viewtopic.php?f=8&t=1068&p=7329&hilit=compass+calibration#p7329

maybe this will help you out?
...just guessing...as i did not prepare for gps right now ;)

greetz

Noc

Post Reply