Magnetometer problem

Hi Guys,

 

I just got my APM and IMU set up. Managed to get the code loaded and the CLI working. However I'm having a problem getting the magnetometer working. When I try to calibrate the compass offsets in the CLI (by typing -c) all I get is zeros:

Heading:0.00   (0,0,0) offsets(0.00,0.00,0.00)

I've made sure the compass is activated in the CLI, I've checked that #IsMag is defined, and I've also ensured I have the correct orientation defined for the magnetometer.

 

It turns out I'm one of the lucky few who was mistakenly sent an APM with an ATmega2560 chip. Would this make a difference? I've been through the magnetometer code and I can't find any reference to the chip in use.

 

Anything else I can try, or is it likely I have a dodgy magnetometer?

 

Cheers,

 

Chris

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • It appears that this is your problem:

     

    ATTENTION: The magnetometer (HMC5843 - Triple Axis Magnetometer Rev 1.1) item has been removed from stock. There is a malfunction currently affecting this product; once we have determined exactly what is the problem, the item will go back on sale. All customers with defective magnetometers, please contact Customer Service to arrange a replacement. All replacements will be issued once the problem is resolved as well. 
    We apologize for the inconvenience this may cause and thank you all for your continued support.

  • Developer

    Hey Chris,

     

         Presumably you have the new style of mag which has just one "wing"?  i.e. it looks exactly like the picture on the top of the mag wiki page?

     

         You could try a couple more things:

             1. triple check that you've followed the instructions on the wiki completely.

             2. load up the example sketch from the AP_Compass library to see if it also returns zeros (you can find it under File, Examples, AP_Compass)

     

         I think it's unlikely that it's because of your 2560 although that particular configuration hasn't been tested, as far as I know it's nearly identical to the 1280 except it's got more RAM (which we don't need yet anyway).

     

         My guess is that you have a dodgy magnetometer and you'll need to return it to Jordi + Chris for a replacement.  If you do that, please send them the link to this chat.

     

    -Randy

  • Christopher, you don't mention how you have your mag mounted.  Did you solder to the board or connect with the molex connector?  Also did you check the configurator?  I am still a noob here myself but I have had my share of problems that the fine folks here have helped me figure out.  You will get an answer just be patient.
This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…