Servers by jDrones

Unable to live calibrate compass on APM 2.8

I seem to have the classic live calibration problem explained online, but none of the solutions so far are working for me.

PROBLEM:
I am using an APM 2.8 running Copter v3.2.1(EDIT 1) with a Chinese GPS and compass module called Neo 7M powered by Ublox. The GPS works fine, however, the pre-arm checks give me a bad compass/mag field warning. When I try to live calibrate the compass, the calibrator just gets stuck after collecting about 3 - 10 samples. It says ‘compass 1 error: 99’. Also, it shows only a single compass that I have selected to be externally mounted although I know APM 2.8 has an internal magnetometer too. I have so far been unable to live calibrate the external compass.

What I have tried so far:

  1. I have removed the MAG jumper beside the GPS port, EDIT 1: set the orientation at ROLL_180.
  2. Yes, I am plugging the magnetometer wire to the port below the GPS port(APM 2.8)
  3. I have tried soldering the MUX_SCL and MUX_SDA points behind the board and tried using the I2C port after that. Same results.
  4. I have tried downgrading the Mission Planner software and doing the calibration on previous versions to no avail.
  5. I have also tried setting the EXTERNAL_COMPASS parameter to ‘2’ so as to enable forced use of the external compass but sadly, no improvements.
    EDIT 1: 6. I have also tried swapping the magnetometer SCL and SDA wires.

Its been weeks and I seem to have come to a dead end. Please help! Any suggestions are welcome. Thanks in advance guys. I am attaching a picture below showing the wiring.

EDIT 2: So I checked out my log file and here’s what I got:

Log File C:\Users\User\AppData\Local\Temp\tmp8808.tmp.log
Size (kb) 28.7685546875
No of lines 658
Duration 0:00:00
Vehicletype ArduCopter
Firmware Version V3.2.1
Firmware Hash 36b405fb
Hardware Type
Free Mem 0
Skipped Lines 0
Test: Autotune = UNKNOWN - No ATUN log data
Test: Brownout = GOOD -
Test: Compass = GOOD - No MAG data, unable to test mag_field interference

Test: Dupe Log Data = GOOD -
Test: Empty = GOOD -
Test: Event/Failsafe = GOOD -
Test: GPS = FAIL - Min satellites: 0, Max HDop: 99.99
Test: IMU Mismatch = UNKNOWN - No IMU log data
Test: Motor Balance = UNKNOWN -
Test: NaNs = GOOD -
Test: OpticalFlow = FAIL - ‘FLOW_FXSCALER’ not found
Test: Parameters = GOOD -
Test: PM = GOOD -
Test: Pitch/Roll = GOOD -
Test: Thrust = GOOD -
Test: VCC = GOOD -

The GPS failure is fine as I was indoors in a place with low connectivity. The usually get a 3D lock outdoors as I have tested it out. Any idea why the ‘Test: Compass = GOOD - No MAG data, unable to test mag_field interference’ message is popping up? Thanks!

On an APM2.8 you are on firmware 3.2.1 whatever you think you selelcted.Mission Planner will recognise the board and fit the lastest firmware for that board,which is 3.2.1 in your case.

You’ll need to get the compass orientation correct,and that’s usually (but not always) ROLL_180

Got a log ? That will give us parameters to browse.

Yes, I am so sorry about the wrong firmware mentioned. I will update it in the post.
Also, yes, I have set the orientation to ROLL_180.
I will post the logs now once I test it out once again. Thanks!

Please do check out the log file pasted in the original post, thank you!

I never pay any attention to that particular analysis tool.Try this one instead.Download from the first post.It’s designed for working with 3.2.1 firmware and gives some good analysis.A good way to learn about logs and may have more of a message about the compass.

https://www.rcgroups.com/forums/showthread.php?2151318-APM-Log-Analyser

A bad connector in a compass lead can cause havoc.I’ve replaced a couple that checked out with continuity but didn’t work with a compass.Only found out by replacement.

The no mag field data is usual if you haven’t done a compass mot test.Which isn’t worth doing on an APM from what I’ve heard.

Hi there
I have the same problem with the compass and tried all the things you have. Now waiting on delivery of new unit.
Out of interest, did you get any solutions to your problem ?

First you need to make sure you are using the right compass(s). Most APM 2.8 do NOT have an onboard compass. Disconnect your external compass, power up and look in the advanced parameters and see if there are any mag found with a serial number. IF not then you don’t have a mag onboard. Then plug in your external and see what mag it lists the serial number for compass 1 or compass 2. That stops you from testing things that are not connected.

If you still have problems you need to take your gps/compass case off if it has one and determine the orientation of the mag chip. Is on the same top side as the GPS antenna or under the circuit brd upside down? Then you need to determine which way is foward. The lettering on the chip is written forward to back on the chip.

Hey
I got a new module and everything works perfectly now. I still haven’t figured out what was wrong with my old module. Planning to look into it when I get time. Will keep you posted if I find something.
Good luck to you buddy :slight_smile:

Yes, my APM 2.8 does have an on-board magnetometer(Honeywell’s HMC58831).
Yes, my GPS module also has a magnetometer chip and the orientation is correctly marked on the Mission Planner software.
I finally had to get a new unit, it works perfectly now. However, I still do not know what the problem was with my old module.

Thank you for your tips and time buddy.
As mentioned, got a new module and everything is fine now. Will look into my old one to try find the issue and keep you posted.
Thanks again :slight_smile:

I am having same problem please help me I’m new with apm

Hey, as mentioned, I never actually did get to finding the root cause of the issue.
I assume it was a hardware failure on my external magnetometer module. Replacing the compass module with a new one solved the issue for me.
If you do figure out what the problem is, please keep us posted so someone else stumbling here bas further help troubleshooting/debugging the issue.
Thanks!

Servers by jDrones