Compass Calibrating

I am having a very difficult time calibrating my compass with the Rover Firmware. I had it working for a few hours, except every time I would disarm after a mission I’d have to reposition my pixhawk to get the green or blue blinking light again. After several missions and repositions I ended up at about 45degrees yaw and 45 degrees pitch from where it was supposed to be and that’s when both the magnetometer and the pixhawk were happy.

Now I can’t get the compasses in sync with eachother and have had yellow blinking lights for hours while trying to recalibrate and with different ground stations. Any suggestions?

@schuler,
What do you have the COMPASS_LEARN parameter set to?
Regards,
TCIII AVD

Could you please attach one dataflash (.bin) log file whilst the error is happening. You will have to set LOG_DISARMED to 1 to get the logging working whilst disarmed.

Thanks, Grant.

COMPASS_LEARN is set to Disabled

I have never downloaded a Log file before. How do I do this in QGC? Also, I do not see a LOG_DISARMED param in QGC.

Only desktop version of QGC supports log download. Select Log Download from the Widgets menu. You should be presented a list of logs to pick from. Also if you are running Rover with QGC I would suggest using a daily build if you are not already. I recently pushed through a large pile of fixes to make Rover support much better.

In MissionPlanner if you do a compass calibration and it completes successfully then it turns off COMPASS_LEARN automatically. The reason for this is in flight (yes I know this is a Rover forum) the mag is only exposed to -45 - + 45 roll, -20 + 45 pitch? and all of yaw, this is a very one sided sphere. The calibration forces it beyond that narrow scope and can provide a better instant answer.

I’m not sure what QGC’s behaviour is.

Thanks, Grant.

QGC never touches the COMPASS_LEARN parameter. Should it clear that after a calibration?

Its up to you Don :slight_smile: Michael makes MP clear it for the reasons he states above. Basically he thinks that the manual compass calibration is the best your gunna get and you shouldn’t mess with it after that so he turns off COMPASS_LEARN.
Actually looks like ArduPilot will turn off the COMPASS_LEARN after a calibration anyway
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Compass/AP_Compass_Calibration.cpp#L65
so you may need to do nothing :slight_smile:

Thanks, Gran.t

I don’t use the internal ardupilot calibration code so I’ll need to do it myself

Hi Don. Its the best way to do a compass calibration on ArduPilot as it produces the best cailbration. You can send the ArduPilot a mavlink command to do the compass cal and then get messages back on its progress you can provide to the user. Have a look at
MAV_CMD_DO_START_MAG_CAL
MAV_CMD_DO_ACCEPT_MAG_CAL
MAV_CMD_DO_CANCEL_MAG_CAL
MAG_CAL_PROGRESS
Have a look in MAVProxy/modules/mavproxy_calibration.py as that’s how MAVProxy does it.

Thanks, Grant.

Hi, Is there any idea about using radio to realize this onboard compass calibration?
Thanks

Not sure what you mean? The compass calibration is already done onboard and its started by a command over the telem radio.

Thanks, Grant.