How can I hold yaw rotation?

I use Lumenier QAV550 quadrotor, 13inch rotor.

But , when I rotate yaw rotation, it drifts over 15cm.

Even pixhawk knows drift, it doesn’t converge during rotation.

How can I solve this?? It’s related to PID gain tune??

To summarize,

  1. Yaw rotation drift
  2. Error doesn’t converge during rotation even pixhawk knows the drift.


I have a few question to understand what is going on:

  • Could you explain more on the sensor and estimator configuration?
  • Is the position drift you are observing the local position estimation drifting?
  • How high was the yaw speed when making the rotation

A log showing what is going on will further clarify the problem

Thank you Mr. Lim

This is my plight log

We use EKF2 + EV platform system and April Tag for Ground Truth.
Yaw speed is not fast, it’s about 3~4 deg/sec.

The one thing I didn’t mention about our UAV.

It is a little rectangular configuration.

PItch axis is 397mm, Roll axis is 374mm, and we didn’t modify mixer file.

It’s effected for Yaw rotation drift??

Are you using an external magnetometer that is far away from power electronics and ESCs? It looks like you have a electromagnetic interference on the magnetometer and therefore your yaw estimate might be off.

Check this plot:

The magnetic field shifts big time as soon as the motors start spinning.

Try using an external mag (the ones that come with GPS) on a pole and twist all DC high power cabling.


Also, from the logs I can see a lot of oscillations around the pitch, roll and yaw axis. It seems like the attitude controller is over tuned or there is vibration in the airframe. This can have a huge impact on the EKF estimation.

Yaw estimate off as soon as motors start spinning is for our April Tag.
At the start point, our tag is tilted.

@jongbeom.her It is not related to the EV input. Looking at the magnetic field - thrust graph as @JulianOes has linked, the thrust / magnetic field interference seems to be quite significant.

Mr. Lim
Attitude controller is over tuned? not Rate controller??

And if there is vibration in the airframe, which point should I check?

I already have checked IMU damper, fastening of the parts.


a. Sorry about the confusion. What I meant was the rate controller, as your estimated rates are oscillating quite high around the rate setpoints.

b. To check vibrations, you can check this graph:

It is not too significant, but you seem to have something vibrating at 40Hz. You can also look at this document to see how you can mitigate this problem

Finally I have solved this issue.

After I modify mixer file, yaw rotation is perfect.!!

Thank for everyone


Hi, could you please explain here how did you modified your mixel file? I am facing the same issue and have not been able to resolve it.


Hi @Fernando_Medrano You can follow this guide to modify the mixer file

I´m having the same issue. What did you modify in the mixer file, the geometry? Or did you change some offset value? It would be really helpfull for me.