Ground Mag Anomaly - Potential Here4 magnetometer issue

Hi everyone,

Today we had a “Yaw Re-aligned” after takeoff, during a pilot training session.

LOG: https://drive.google.com/file/d/1lY8S1yFkH-2_G-jdE1jrf3OiwSWrIA8h/view?usp=sharing

Checking the log, I noticed some insane values for XKF4.SM, and they suddenly go back to normal as soon as IMU0 and IMU1 switch to COMPASS 1.

Digging a bit, I found that these crazy values came from XKF3.IMZ

Our setup:
Cube orange+
Kore Carrier Board
Dual Here4
25kg TOW

Considerations:

  • In the previous reboot, there was a “pre-arm: Compass Not Healthy” that cleared after reboot.
  • Previous batches of Here4 had cronical issue with the magnetometers failing. We had several compass failures that CubePilot investigated and recognized. We are replacing all units with newer batches – the one from this post is a remaining from the olders. However, we have never seen a failure like that, causing such spikes.
  • Several other flights were done taking off from the exact same place. No issues at all.
  • Before you ask: yes, we are using a quite old FW version. The reason is that we have to conduct hundreds of software integration tests and demonstrations every time we update the autopilot FW, due to regulatory matters.

Questions:

  • The Here4 compass issue is the most likely root cause, but could I be missing something?
  • Why did it take SO LONG for the EKF3 to switch the compass source?

Mag1 has lots of noise on the Z axis, this looks like a fault to me.
Mag3 is just typical for a Kore carrier onboard compass.

At this stage it’s not worth messing with small calibration changes, Mag1 and Mag2 were good enough before Mag1 went bad. It seems it was already bad before this flight - there’s no change in quality during the flight.
I would say disable Mag1 until it’s replaced and just rely on Mag2 for now - the copter would be fine for all but critical operations.

COMPASS_USE,0

In other news, I would set these

ARMING_CHECK,1
BATT_FS_LOW_ACT,2  or 3

and I think these can use some adjustment, but up to you:

ATC_ACCEL_Y_MAX,10000
ATC_RAT_YAW_I,0.08
ATC_RAT_YAW_P,0.8
ATC_SLEW_YAW,3000
ATC_THR_MIX_MAN,0.5
GPS_AUTO_CONFIG,2
GPS_GNSS_MODE,7
GPS_GNSS_MODE2,7
PILOT_TKOFF_ALT,200
PILOT_THR_BHV,7
PILOT_Y_EXPO,0.3
PILOT_Y_RATE,60
PSC_ACCZ_I,0.6
PSC_ACCZ_P,0.3
WP_NAVALT_MIN,2

This should give yaw more suited to a big copter, give a more positive takeoff to 2m altitude which reduces the chances of landing gear snagging on the ground, and throttle from mid-stick to suit your RC input.

I’d like to see a log with these

INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

because I suspect the harmonic notch filter is incorrect.

EDIT:
I cant say why it took so long to switch to the second compass, even though the noisy Z field of the first compass was was quite bad. EKF does consider the GPS heading too, so that could be a factor.
Consider updating the firmware to latest stable too, 4.5.7 at this time, since there could have been improvements - I cant remember at the moment but I’ll check and let you know if there is anything relevant.

1 Like

Thanks, @xfacta
We’re replacing that compass now. I’m asking the local team to send older logs to understand when this GPS/Compass unit started to show these measurements.

We see the same issue in the two previous logs (237 and 238), but no one noticed anything unusual since the switch occurred right after takeoff.

LOG 237: https://drive.google.com/file/d/1F81gGKqm_5Ep2hm-l_WcI675wYV6sBEQ/view?usp=drive_link

LOG 238: https://drive.google.com/file/d/1WM6dRbE-SRWCtDalqkGYjUXFFPMNYgRw/view?usp=drive_link

The issue appeared during the flight from the log 236.

LOG 236: https://drive.google.com/file/d/1uN8vjzXd9mY1-MugW2__X6HcPacqnJPV/view?usp=drive_link

Before 236, it was performing normally.

LOG 235: https://drive.google.com/file/d/1LWBDzQsqsVBpsEIAhRVAYbIOe1kzq9QH/view?usp=drive_link

LOG 228: https://drive.google.com/file/d/1YWURdlIMuVT7gsJmaOqX0AUfTVEwmuE7/view?usp=drive_link


After replacing the compass, all back to normal

Good work tracking that down and letting us know.

1 Like