Drone yaw drift while in Position hold and Loiter mode

You might consider disabling the internal compass. I ran Magfit on Mag0 and the CMOT values were maxed out.

I did get these for the external

COMPASS_OFS2_X 281
COMPASS_OFS2_Y -401
COMPASS_OFS2_Z -153
COMPASS_DIA2_X 0.870
COMPASS_DIA2_Y 1.025
COMPASS_DIA2_Z 0.800
COMPASS_ODI2_X 0.089
COMPASS_ODI2_Y -0.053
COMPASS_ODI2_Z 0.032
COMPASS_MOT2_X 10.000
COMPASS_MOT2_Y 3.629
COMPASS_MOT2_Z 2.147
COMPASS_SCALE2 1.00
COMPASS_MOTCT 2

Another consideration is to use Loiter mode rather than Pos-Hold. Loiter is more customizable and tuneable than Pos-Hold.

Tried it and it did not do anything better. Here is another log of todays flight. The external compass is now mag0, because I have set it to priority 1 and i am not using the internal compass.


Runnng magfit i got these parameters -

COMPASS_OFS_X 565
COMPASS_OFS_Y -428
COMPASS_OFS_Z -95
COMPASS_DIA_X 0.800
COMPASS_DIA_Y 0.951
COMPASS_DIA_Z 0.800
COMPASS_ODI_X 0.180
COMPASS_ODI_Y -0.200
COMPASS_ODI_Z 0.165
COMPASS_MOT_X 10.000
COMPASS_MOT_Y 5.435
COMPASS_MOT_Z 5.824
COMPASS_SCALE 1.00
COMPASS_MOTCT 2

Is it this yaw vs desired yaw that is the problem?

That’s from the second flight with bad landing.
In the first flight there is really only this:

I couldnt see anything obviously wrong.
Magfit gave me these, some are different so maybe that will help a little
COMPASS_OFS_X 623
COMPASS_OFS_Y -557
COMPASS_OFS_Z -4
COMPASS_DIA_X 0.800
COMPASS_DIA_Y 0.911
COMPASS_DIA_Z 0.800
COMPASS_ODI_X 0.200
COMPASS_ODI_Y -0.200
COMPASS_ODI_Z 0.178
COMPASS_MOT_X 10.000
COMPASS_MOT_Y 10.000
COMPASS_MOT_Z 3.615
COMPASS_SCALE 1.00
COMPASS_MOTCT 2

Otherwise try Yaw Autotunue with D term.
Set these:

ATC_RAT_YAW_D,0.001
AUTOTUNE_AXES,8

then give that a go.

Tried these parameters. Was somewhat better on the first flight, but on the second one i had terrible toilet bowling.

The issue that I had on my last flight was that the drone did touchdown in “land” mode and then immediately took off again against any pilot input and it was still in “land” mode.

Do you mean in the last section of the first flight?

I’ll keep checking for thecause

Yes. This is what i was thinking of