Quad copter drifting

hello everyone, i have been facing an issue first time. the issue is that my drone started to drift midflight. when i saw log file i saw the the horizon of my drone changed mid flight. The mean value of roll pitch and yaw suddenly changed. i will attach the log file. You may compare the desired roll from ATT tab and Roll from AHR tab.
can anyone tell me where the issue lies?
https://drive.google.com/drive/folders/1i02AlJAidnBDy1DAx-MYD09mr4zPvMnC?usp=sharing

The usual issue is improper tuning. Without a log file is not possible to pin-point the problem.

But you can fix it by using New ArduPilot methodic configurator GUI

i have shared the log file in the post

There is some missing voltage values and failsafe actions, plus the copter could probably benefit from the harmonic notch filter.

For the drifting, try doing the Calibrate Level in MissionPlanner - pack under the landing gear to get the whole motors/props/arms “prop disc” level in every direction.
Also do the IMU temperature calibration procedure.


see how my drone is drifting

It will not stop drifting unless you do what we told you to do.

Hi @amilcarlucas thanks for your feedback!

Have you checked the log file? Tunning at first sight seems good. Attitude Control looks good, no big overshoots or anything.

Can you give your opinion by looking at the logs? Thanks!!

I am not at my PC. No I can not check the log now.

Here is a more visual representation of what the error is, first image is before the flight, second image is after about 9 mins of flying. The drone is exactly in the same place (perfectly flat surface), and we can see much different values for roll and pitch in the HUD.

After reboot it goes back to normal.

@Leonardthall @rmackay9 @rishabsingh3003 Would you mind PLEASE taking a look at the log? I suspect this may be faulty hardware. In my 10+ years using ardupilot I have never seen anything like this.

I dont know how to make sure if it is hardware related or not.

Try the IMU temperature calibration first before pinging everyone

1 Like

@xfacta we will try IMU temperature Calibration. Can you tell me the reason why you are recommending this?

Hi @ddomit,

Lets address your question first.

Your aircraft is not drifting. Your aircraft is holding position as it should. Even in Alt Hold you needed to hold the lean angle to maintain position.

If you had yawed the aircraft slowly 360 degrees and the roll and pitch didn’t change while holding position I might think there was a problem but this is not the case. If you saw this while the aircraft was sitting on a stationary table I may also wonder if there was a problem but even then GPS drift can cause small deviations in attitude. If you see this and do a slow 360 degree rotation I would look at that log with an open mind to a problem.

I see no gyro bias changes that look crazy:

Small accel drift over time but I don’t think this is a problem:

All I think has happened is you have a small breeze that requires a 2 to 3 degree lean to maintain position.

This is solid advice but should not cause the drift you see:

Temperature drift may cause IMU bias drift and this can cause the leans a temperature calibration helps address this but the EKF predicts the bias and compensates so temperature calibration is only really significant if you are starting your aircraft on a moving platform.

Onto the question you did not ask. Your tune and setup:

  • Your noise levels are good. Harmonic notches are not required but may make it even better, hard to say.
  • Your filter setup for roll and pitch is fine. Given your noise levels you may be able to increase the cut-off frequency but given your results I wouldn’t bother.
  • Your attitude control tune looks good.

@amilcarlucas @xfacta I really appreciate all the help you provide on line and how frustrating it can be too. I don’t think the following words fostered the atmosphere you would normally aspire to create.

2 Likes

@Leonardthall Hello, when i plotted graph of AHR2.roll and ATT.roll. They both were showing different values of roll. And it was drifting too much during flight. We haven’t face similar issue before.

@Leonardthall Another thing we noticed was the change of orientation on HUD after flight. We could see a that our copter was not aligned. So, we rebooted the Cube, and it went back to normal.


@Leonardthall This thing is very confusing and unusual. I hope I cleared what issues we have faced till now

Hi leonard,

I really appreciate your time to review this case!

I forgot to mention it was completely windless, the movements you see in alt hold are because the aircraft thinks its level, but actually when it thinks its level its rolling and pitching, that is why i have to react with the controller to move it back to position.

It would seem like a stable wind but in reality there was NO WIND, the drone was driftng with controls at 0 input.

i hope this makes the case clearer.

If you need I can do a full 360 degree after i see the error.

1 Like

I see what you mean with the difference with the AHRS.

This sort of thing could be caused by:

  • Temperature change causing bias change (looks ok)
  • Aliasing from higher frequency noise (This is hard to detect but you don’t have high vibrations)
  • GPS drift (Seems stable)
  • Heading error (this looks suspicious)

Seems to get worse about half way through the flight where we see pitch diverge too. May be just coincidence or a side effect of the real problem but …

In any case your mag cal isn’t great. I would recalibrate your compasses and also do use the MagFit tool using in flight data. Just make sure you do full yaw’s and some roll and pitch input for the MagFit flgiht.

Other options can be a out of level FC or bad motor cant and bent props.

1 Like

It seems to shift during flight though. Maybe if one of those things weren’t perfectly secured it could cause this. Well worth a check!