compas problems on arducopter

Hi,

I have an quad arducopter running the ArduPiratesNG code.

I am having problems with the compass heading. The compass is reporting useless values between 60 and 150 degrees. When flying it does not keep a steady heading and slowly rotates.

 

So far I've tried the following:

- calibrate the compass using the CLI

- replaced the compass hardware

- test the electronics outside the frame

- added zigbee to help debug the problem

- add debugging code

 

I  added some debugging  to AP_Compass_HMC5843.cpp. One problem is that it fails to initialize the compass in the AP_Compass_HMC5843::init method. The mag_x, mag_y, mag_z values are supposed to be in the range abs(v) > 500 && abs(v) < 1000. The values I get are mag_x=-1219, mag_y=1185, mag_z=-1184.

Here is some other information that could be helpful. The problem started  after I replaced the frame of my arducopter. I must have damaged something because after that it was behaving erratically. Eventually I figured out that this was resolved by unplugging the GPS module. Not sure why. Now it flies, but it slowly rotates, making it uncontrollable.

Has anyone seen this before? Any idea what may be wrong? I'm running out of ideas. The only thing I have not tried is replacing the main electronics.

Have fun,

    Arthur van Hoff

 

3690893284?profile=original

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

Join diydrones

Email me when people reply –

Replies

  • Developer

    So I think the issue here is that you're using the new compass, the 5883L but the arducopterNG code and libraries are built for the old compass, the 5843. 

     

    There are a few differences between the compasses including the flipping of the order of two of the axis in the internal registry (which is likely causing the nonsense values you're seeing) and the gain (which is causing the init call to fail because it's seeing what it thinks are crazy values).

     

    Master Tridge with some minor input from me made some changes to the lib for ACM to work with both compasses seamlessly and also fixed a bunch of bugs.  As you seem to know your way around the code, you could probably hack in the ACM changes to the NG libraries.  The ACM code is here.

     

    Good luck, i'm sure you'll get it to work. 

This reply was deleted.

Activity