Magnometer off by 180 degrees

I have followed the instructions on http://code.google.com/p/arducopter/wiki/AC2_Magnetos for adding the Magnometer directly to the APM board in the components down pins forward orientation. I have the APM board mounted according to http://code.google.com/p/arducopter/wiki/AC2_Frame_Assembly where the RC pins are towards the back of ArduCopter and which places the Magnometer on the "front". I have an X configuration with the APM pointed between the 2 legs.

 

I noticed in the Mission Planner that the HUD shows the ArduCopter pointing S when it's really pointing north. Moving the ArduCopter shows the heading changing the correct amount but always off by 180 degrees. I guess what I am doing is looking to confirm that I actually have assembled things correctly. For reference I am using https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-HMC5843-01.

 

I would appreciate any suggestions on what I may have done incorrectly.

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

Join diydrones

Email me when people reply –

Replies

  • Did you run an offsetts calibration? it helped us.

    1; switch to CLI

    2. Setup

    3: offests

    4 now turn your copter over every axis up side down until the numbers do not change anymore. make sure you have your copter a few times in any attitude possible upside down allso.

    5. hit enter

     

    now check again.

     

  • I have been running from SVN anyway since I needed to change INPUT_VOLTAGE for the battery monitor, so it wasn't too much to make these changes.

    When I tried the following, the heading started around 60 degrees and only changed +-30 when rotating the copter full around.

    #define MAG_PROTOCOL       MAG_PROTOCOL_5883L
    #define MAG_ORIENTATION AP_COMPASS_HMC5883L_COMPONENTS_DOWN_PINS_FORWARD

    So I commented out the MAG_PROTOCOL, but left the orientation, and that seems to work correctly. Hand rotating the copter produces the expected results and North is North!
    Just to be complete, the change that worked for me was to define only:
    #define MAG_ORIENTATION    AP_COMPASS_HMC5883L_COMPONENTS_DOWN_PINS_FORWARD

    I bought my HMC5843 on 5/5.

    Thanks again for the help. I have been reading the forums here for awhile and it's great to see so many people
    willing to help. I hope that I will be able to start contributing back someday soon.
  • 3D Robotics
    It appears that the new magnetometers (which have switched one orientation) started shipping earlier than we expected. The dev team is hard at work at updating the code to autodetect which version mag you've got and correct accordingly, but this may take a day or two. Sorry for the inconvinience, but stay tuned!
  • Developer

     

    hmm, you might not have done anything wrong.

     

    You've got the new magnetometer and the orientation of the chip is different compared to the old one but I suspect that the code that's being downloaded by the APM Mission Planner assumes you have the old mag.


    You are loading the code with the mission planner right?  You don't have the ability to download the code directly from SVN and modify your APM_Config.h file right?  If you did you could add a couple of lines like:

    #define MAG_PROTOCOL       MAG_PROTOCOL_5883L
    #define MAG_ORIENTATION AP_COMPASS_HMC5883L_COMPONENTS_DOWN_PINS_FORWARD

    I think we will need to add some more download options from AP Mission Planner or something!
This reply was deleted.

Activity

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