Dual redundant compass issue (against failure NOT bad data) - Here with Pixhawk 2.1

Have a problem and wondering if anyone has any insight!

We are aiming to have dual redundant compasses using 2 x Here GPS compass units with the Pixhawk 2.1.

We understand that only one compass can be used at one time for navigation, and also that the FC cannot distinguish between good and bad compass data, but we do want to have a system whereby if the Primary compass fails (data stream to Pixhawk lost due to failure such as connection or power supply to compass) the FC switches to using a backup compass.

So first we installed dual Here units in GPS port 1 and 2. Switches on Compass 1 and 3 as external compasses and switched off compass 2 (internal). Both compasses calibrated OK and show green, but in flight there is clearly an issue with aircraft showing classic signs of compass issues.

Next we switched off compass 3 and switched on compass 2 (internal). Calibrated OK and flew normally, both compasses logging OK data with minimal variance. We then armed the aircraft and unplugged compass 1 hoping the FC would default to the internal, but instead we got a ā€˜no compassā€™ warning and could not fly. Next we did the same process with compass 1 and 3 activated and calibrated with same result.

We are quite familiar with the Pixhawk but cannot seem to find a way to get it to switch to a secondary compass in case of a total failure of the Primary. As stated earlier this is not about redundancy against bad data or interference, but only in case of a total failure which should be easy for the Pixhawk to recogniseā€¦if the code is in place. As long as there is another connected and calibrated compass, I would expect it to switch in this case, but it doesnā€™t seem to do it.

Does anyone have any input here? Is this a setting or coding issue? Thanks for any help!

1 Like

Iā€™m no expert but have been around for some time on this system and I think you may be making some incorrect assumptions. As far as I know the system uses Extended Kalman Filters to determine the most correct compass switching automatically between them (up to 3) depending on which it deems is the most correct.

If all fail, then it will estimate direction, the accuracy of which will deteriorate over time.

The new compasses have dual chips in them and Pixhawk 2.1 itself has another internally. If you connect two compass units then that means there are 5 compasses in total and I donā€™t think the system can switch between 5 different compasses. The system is as redundant as is realistic with 3 compasses, older APMā€™s flew quite happily on 1 compass. Ensuring a reliable connection and power supply for the compasses should negate any risk of ā€œlosingā€ all the compasses (which is highly unlikely anyway).

Thanks Graham! You are right that EKF filtering is used to balance the input of various sensors (GPS and optical flow for example) but as far as I am aware there is no real way for the flight controller to accurately tell what is ā€˜goodā€™ compass data and what is ā€˜badā€™, which is why flight controllers of all types still suffer from compass interference issues, and why systems like dual GPS heading are not a bad idea!

I should mention that this is not really about the worry of an actual failure, but about convincing people in certain industries that the aircraft are safe. There are many people in industry (and even in legislative roles in some countries) that are making decisions and rules about what makes a ā€˜safeā€™ drone with very little real understanding of how the systems work, and the real safety issues rather than the perceived issues. In many cases this is resulting in a ā€˜you must have multiples of everythingā€™ attitude, as most would instinctively believe that two (or three) of something must be better than one. Clearly this is not always the case, these are highly complex systems, but in some ways in is understandable that looking at them from the outside this would make sense. From a system builder point of view we often find ourselves having to build aircraft that are less safe than they would be simply to meet the ā€˜rulesā€™ or criteria set by those regulating the use of drones, or those deciding to whether to use them in certain industries. So irrespective of the real likelihood of failure, to be able to demonstrate that the flight controller is using one compass, and that if you unplug it to simulate failure (for example) the flight controller switches to a backup would be very useful.

1 Like

You might find this a valuable watch as it will give you some insights into the code base, specifically the EKF

Agreed. I remember issues years ago where inertial navigation appeared to mimic the compass output so even if there was no compass the compass direction moved giving the appearance that the compass was working. Very frustrating.
Unfortunately there are lots of parts of Ardupilot which havenā€™t been updated since the purely hobby days, long before commercial use. Some were ā€œfixedā€ in those days but nothing has been done since. So yes having a transparent compass system would be great but until someone writes it and adds it to the system weā€™re stuck with it.

1 Like

Hi Xelax,

I just would like to know if there is a new insight in this topic.
Iā€™m currently facing a similiar problem like you were. Namely, Iā€™d like to use two external here compasses and I expect that if I remove one it switches to the other.
Were you able to achieve this or progressed in a way?

Thank you for your help

Hi Philipp,
Simple answer is no in terms of getting a definite solution and we have not taken the time to do any in depth testing to take this further. Graham makes a good point about the number of compasses the Ardu is designed to handle, we always disable the internal but it may be possible to persuade the FC that compass two or three are external in GPS 2. Not tried this though. FYI we recently tried an external mag from Drotek which seems to work well and this may give you options beyond the Here units and config with combined GPS / mag.
Right now we are waiting for the Here Pro, donā€™t know much about this and it has been ā€˜comingā€™ for some time, I do know there have been some issues but sounds like it may finally appear soon. This is a dual RTK onboard solution (so reference and relative GPS are both on board instead of one in a ground unit and one airside as you normally see with RTK) that is aimed at heading without compasses. Clearly this then relies on good GPS so I assume that the main compass remains an option / backup in case of loss of GPS. Weā€™ll have to see.

Hi Alex,

Thank you for your response and your help. The concept of the HerePro sounds interesting, letā€™s see what it will look like and how well it performs.

Kind regards
Philipp