Upgraded Mag Compass from HMC 5843 to HMC 5883L . 

 

To verify the the 5883L was a good unit,  I ran the Compass Library test program comparing the 5843 to the 5883L . Both the 5843 & 5883L reported about the same number (~ 180) for a heading of South.

 

Next I installed the 5883L and did a Upload with Arduino and complete software setup with planner including eeprom erase.  With the 5883L installed, South(180 degrees) now displays as 145 degrees.

 

In config.h, under //  MAGNETOMETER. I found :

# define MAG_PROTOCOL  MAG_PROTOCOL_5843  // Default Setting.

 

I changed that to :

# define MAG_PROTOCOL  MAG_PROTOCOL_5883L.

Again did a Arduino software upload and  planner setup including eeprom erase. This did not work, compass reports 60 degrees instead of 180.

 

Last test was to remove all # define MAG_PROTOCOL leaving :

#ifndef MAG_PROTOCOL

#endif

Compass displays 145 degrees instead of 180.

Just reporting the problem.

Max_Crash

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

Join diydrones

Email me when people reply –

Replies

  • 3D Robotics
    APM and ArduCopter should both autodetect which magnetometer you are using. You don't need to specify it in the code.

    Please try loading the APM code instead and see if that works. If so, we can zero in on your problem.
  • I have the same with two different APM units after loading 2.0.37. Never had a yaw or mag problem before, now the compass just hovers close to north as if the mag is not installed or not enabled, I've tried everything I can think of, but no luck.
This reply was deleted.

Activity

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