Pixhawk 2.1 compass setup

For the past few weeks I have been converting my s1000+ to the pixhawk 2.1. Its been a rough road but the community and search tool has been very helpful. I have one last hurdle I am struggling with. I am pretty sure the pixhawk 2.1 has 3 compasses. I have my pixhawk orientated with the arrow pointing to the left, so the AHRS orientation should be 270. Whenever I try to calibrate all three internal compasses I always have one compass where the x,y and z axis dont match the other 2. I am using mission planners tuning graph to look at mx,my,mz,mx2,my2,mz2,mx3,my3,mz3. offsets all look good… all are green. I have tried it outside atleast 400 feet from anything and used the live calibration, onboard calibration and also qgroundcontrol. My ekf error compass spikes up and down even when on the ground not moving. I also have the original 3dr GPS/compass hooked up so I set that as compass 1, external, no change in orientation (arrow pointing forward) and tried calibration in all different methods. I also have a chinese gps/compass module and tried to set compass 0 and compass 1 external but I still get ekf compass errors. Last i disabled all compasses except compass 0 and set it to external with the 3dr compass/gps. It flys fine but the ekf compass spikes all the way up but its kind of random, it doesnt always spike when i give large throttle or turns so I dont think it is getting interference from the motors or wiring. Is there something I am missing on how to properly set up one or two external compass and just one of the pixhawk 2.1’s internal compass?

I have logs if its needed

I think if you only use external compass, after cal you should check the heading direction, you can compare the yaw against the direction you can get from a mobile phone. BTW,when i cal the external compass, my 3dr compass has same direction with hawk2. But the external rotation checkbox should be ROTATION_YAW_180. It is very different from pixhawk1. very strange.

I haven’t ever heard of the external compass needing a rotation like that. Can you explain more or maybe take a snapshot of your compass settings?

the compass used is 3dr COMPASS/GPS module. only one compass is used.

@wyq200704 thanks for the information. I also have a Navio 2 that I played around with for a while. There was an issue where the compass sensor was rotated and the firmware was supposed to account for this so the user wouldn’t have to set the two internal compasses in different orientations. I am wondering if this is what is happening? I am going to investigate further over the holidays.

1 Like

Hello, did you solve the problem of the compass not giving the same values? I have now purchased a Pixhawk 2.1 and am having this problem! It’s my first with pixhawk so the difficulty is still greater.
Another thing, can you tell me where the 3 compass is? On GPS or Cube?

@Ecoplanet_Renovaveis Compass 3 is internal to your PH 2.1