Not enough data points for Compass Live Calibration?

I’ve searched the forums and tried Live Calibration 6 times with different settings.
I can’t figure this out.

I just put together a DIY Q4 with Pixhawk. I do not have an external GPS or compass. I want to calibrate the Pixhawk’s internal compass. I’m using a usb cable not Mavlink.

Also, I’m using APM Planner 2.0.16 on a Mac OS X 10.9. I think this might be causing me difficulty. I’ve re-installed APM Planner 2.0 three times, just in case I’m doing this

On the Compass calibration page should I have Compass and Auto Declination enabled or disabled?

I’m sure my compass is working because I can see the three axes on the graph. So it’s not a power regulator thing. I’m using the internal compass so it’s not a bad connection to the GPS/Mag module.

What else could it be?

How do I collect a logfile for this?

After trying another compass Live Calibration I found the logfile and
copied this. Looks like compass 2 is not working. Is it expecting an external compass?
How can I turn that off?

DEBUG 2015-03-14T22:10:44.692 live Calibration Started
DEBUG 2015-03-14T22:10:46.468 Param: “COMPASS_OFS_X” : QVariant(double, 0)
DEBUG 2015-03-14T22:10:46.469 Param: “COMPASS_OFS_Y” : QVariant(double, 0)
DEBUG 2015-03-14T22:10:46.470 Param: “COMPASS_OFS_Z” : QVariant(double, 0)
DEBUG 2015-03-14T22:10:46.470 Param: “COMPASS_OFS2_X” : QVariant(double, 0)
DEBUG 2015-03-14T22:10:46.471 Param: “COMPASS_OFS2_Y” : QVariant(double, 0)
DEBUG 2015-03-14T22:10:46.472 Param: “COMPASS_OFS2_Z” : QVariant(double, 0)
DEBUG 2015-03-14T22:10:46.473 Param: “COMPASS_OFS3_X” : QVariant(double, 0)
DEBUG 2015-03-14T22:10:46.474 Param: “COMPASS_OFS3_Y” : QVariant(double, 0)
DEBUG 2015-03-14T22:10:46.475 Param: “COMPASS_OFS3_Z” : QVariant(double, 0)
DEBUG 2015-03-14T22:10:47.440 Compass1 offsets x: 0 y: 0 z: 0
DEBUG 2015-03-14T22:10:47.441 Compass2 offsets x: 0 y: 0 z: 0
DEBUG 2015-03-14T22:11:11.292 APM: Text Message rx’d "PreArm: RC not calibrated"
INFO 2015-03-14T22:11:11.293 STATUS TEXT: 3 : "PreArm: RC not calibrated"
DEBUG 2015-03-14T22:11:41.296 APM: Text Message rx’d "PreArm: RC not calibrated"
INFO 2015-03-14T22:11:41.297 STATUS TEXT: 3 : "PreArm: RC not calibrated"
INFO 2015-03-14T22:11:47.324 finishCompassCalibration with compass 1: 116 data points
INFO 2015-03-14T22:11:47.324 finishCompassCalibration with compass 2: 0 data points
DEBUG 2015-03-14T22:11:47.333 UAS::executeCommand 242 conf 1 param1 2 param2 72.2204 param3 -64.9316 param4 -126.45 param5 0 param6 0 param7 0
ERROR 2015-03-14T22:11:47.334 Not enough data points for calculation:
DEBUG 2015-03-14T22:11:47.420 APM: Text Message rx’d "SUCCESS: Executed CMD: 242"
DEBUG 2015-03-14T22:11:47.421 Rejecting message, check mismatch: current_state: 0 == 3 , system id 0 == 1 , comp id 1 == 1
DEBUG 2015-03-14T22:12:11.287 APM: Text Message rx’d “PreArm: RC not calibrated”

The Pixhawk automatically checks external compass. If it detects it, it becomes compass 1. If only have an internal compass, it becomes compass 1. Compass 2 in this case is ignored as it doesn’t exist!

Thanks billbonney,
Any idea whether 116 compass points is too low for Live Calibration?
Is there something else I can try?

There might be an error with only one compass connected as I reworked that code recently. I’ll do test later and make sure it’s working as excepted.

Something is not right here. I’ll raise this as an issue.

[code]
INFO 2015-03-15T21:17:50.755 STATUS TEXT: 3 : “PreArm: Alt disparity”

INFO 2015-03-15T21:18:09.541 finishCompassCalibration with compass 1: 170 data points

INFO 2015-03-15T21:18:09.541 finishCompassCalibration with compass 2: 0 data points

DEBUG 2015-03-15T21:18:09.551 UAS::executeCommand 242 conf 1 param1 2 param2 14.8284 param3 -302.473 param4 -314.515 param5 0 param6 0 param7 0

ERROR 2015-03-15T21:18:09.551 Not enough data points for calculation:

DEBUG 2015-03-15T21:18:09.756 APM: Text Message rx’d “SUCCESS: Executed CMD: 242”

DEBUG 2015-03-15T21:18:09.756 Rejecting message, check mismatch: current_state: 0 == 3 , system id 0 == 1 , comp id 1 == 1

HBD: Heartbeat stopped

HBD: Heartbeat started

DEBUG 2015-03-15T21:18:20.747 APM: Text Message rx’d “PreArm: Alt disparity”[/code]

Any news on this problem?
Is there another way to calibrate the magnetometers without Live Calibration?

I did some looking at the code (sorry been really busy this week with other projects) and the compass 1 should be set correctly. If you do the Live Calibration and then go to the Full Parameter view and refresh the parameters you should see the same match offsets for compass 1. That this line in the log (execute command and the success return). The Error is for the second compass not having any data points.

DEBUG 2015-03-15T21:18:09.551 UAS::executeCommand 242 conf 1 param1 2 param2 14.8284 param3 -302.473 param4 -314.515 param5 0 param6 0 param7 0

ERROR 2015-03-15T21:18:09.551 Not enough data points for calculation: <--- this message is for compass 2 not compass 1.

DEBUG 2015-03-15T21:18:09.756 APM: Text Message rx'd "SUCCESS: Executed CMD: 242"

I’ll see if I have time to test tomorrow. or can get you a build to test for me. But try with the latest 2.0.16 for firmware.diydrones.com

Got it.
Thanks.

Here’s a ‘daily’ build with a change in the improve the logging and message reporting around compass calibration

see firmware.diydrones.com/Tools/APM … 76_osx.dmg

feel free to give it a try and see is that works better for your.