Acceptable interference and I-yaw values

What’s the allowable value of I-yaw/interference to ensure the drone can fly safely without toilet bowling and what is the rationale behind concluding to that value as safe

We’re observing yaw discrepancies of up to 10 degrees (i yaw values, which are corrected during yaw reset) during takeoff when the drone is pointed north or south due to magnetic interference. The distance between the battery and compass is 0.25m, and altering the antenna height isn’t feasible at the moment since our current setup is in production. We consider any yaw deviation exceeding 10 degrees as abnormal and hold off on clearing the systems until the problem is resolved.
@priseborough your insights will be of many help here.

FWIW I generally avoid this by doing an accurate compass calibration and then change the value of EK3_MAG_CAL. The default exists, as I understand it, because people were taking off from their cars and therefore only an in-flight reset was appropriate, but I suspect this is the exception not the rule and I find that the over-throttle/vibes of takeoff can really mess with the EKF.

Hi @Mihir_Salot,

To set an upper limit, over 45degrees of error is certainly unsafe because this means the circling will get worse over time.

ArduPilot’s arming checks require that the attitude estimators yaw estimates are within 20deg (see code here) but when we added the check the “20” was somewhat arbitrary in that it was just based on experience and trying to maintain a balance between safety and too many false positives which would greatly annoy users.

My guess, based just on experience, is that 10 deg is probably unnecessarily strict. 15 is probably a good number for a well built vehicle.

1 Like

For our case:

  1. Yaw is accurate during takeoff (since we takeoff from ground only, with almost zero magnetic interference)
  2. When yaw is realigned at appx 2.5m post takeoff, magnetic interference is signifcant, and hence new estimate after realignment will be incorrect.
    In this case, I feel it is safer not to realign upon takeoff! What are your thoughts on this? Is there any parameter to directly control it? Would setting EK3_MAG_CAL = 4 uses 3-axis fusion at all times help?

Currently we are using EK3_MAG_CAL = 3 uses heading fusion on the ground and 3-axis fusion after the first in-air field and yaw reset has completed, and is the default for copters.

Thanks for sharing. Even in our experience we havent seen any issues till 15 degrees till now.

1 Like

Ho @Mihir_Salot,

To disable the yaw reset at 2m I think you could set EK3_MAG_CAL = 0 (When Flying) or 4 (Always). I would lean towards setting it to 0.

I’m not completely clear on the difference between 0 and 4 but 0 is the default for plane and I think it means that the EKF will only do “2D fusion” when disarmed and then 3D fusion once armed and flying. “2D fusion” means it only uses the compass’s X and Y axis to calculate the heading and ignores the Z which is fine (perhaps even preferable) when the vehicle is level.