Position (Orientation) Control on Heading

Setup: ArduCopter 4.6.3 on a quadrotor, using FAST-LIO2 SLAM as the external navigation/positioning source (GPS-denied). Loiter flight mode.

Problem: The drone holds attitude and altitude well under disturbance. If I hit it with wind or physically push it, roll, pitch, and height all recover to their setpoints. But, heading is not held. If an external disturbance yaws the airframe, the controller does not rotate back to the heading it held before the push, it just accepts the new heading.

My current understanding: I suspect nothing is closing a hold loop on yaw. As I understand it, ArduCopter’s position controller (PSC) has authority over the NED position axes but not over heading. Yaw is handled separately by the attitude controller, so after a disturbance there’s no command driving the aircraft back to its original heading.

Questions:

  1. Is that understanding correct? Does the PSC not close a loop on heading, and should yaw be holding an absolute heading target in this mode (loiter)?
  2. Why would attitude and altitude recover but not heading(e.g. yaw being commanded in rate vs angle mode, or the behavior of the EKF/external-nav yaw source)?
  3. What are the recommended ways to make it actively hold and recover heading against external yaw disturbances?

Any pointers on the relevant parameters or the control architecture would be much appreciated.

Do you have a compass?

No, I do not. All of my EK3_SRC1 parameters, including the yaw src, are set to 6 (mavlink/fast-lio)

Don’t know what Fast-Lio is but have you checked if the mavlink yaw values are valid?

Yes, the yaw values are accurate and valid

I personally wouldn’t expect the EKF to be able to hold the heading well using only the gyro data.

The gyro drift in the pitch and roll axes can be frequently corrected using the accelerometers. The altitude can be corrected using the barometer. Without a compass, I don’t see how the relatively inexpensive IMUs in a flight controller can hold an accurate heading.

I thought this sort of station keeping using an IMU alone was reserved for more expensive equipment.

Are you expecting too much from these IMUs? I’d be interested to hear others’ opinion. Hopefully I’m wrong.

Have you set EK3_SRC1_YAW to Mavlink?