ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.15k stars 16.71k forks source link

Copter: Yaw drift too high when not using magnetometer #13326

Open NitinJSanket opened 4 years ago

NitinJSanket commented 4 years ago

Bug report

Issue details

The Yaw drift on APM much much higher than that on Betaflight/Cleanflight when not using a magnetometer. We observed drift of about 1 degree in 1.5 mins on betaflight when sitting on the desk and in APM 1 degree drift was observed in about 10 secs. Tested this on various autopilots and the performance is the same. Our guess was that this is because of the EKF not tuned correctly when not using a magnetometer, so we tried reducing the noise values of gyro and acc but it didn't really make much of a difference. Any ideas?

Version 3.6.11 - 4.0.0

Platform [ ] All [ ] AntennaTracker [ x ] Copter [ ] Plane [ ] Rover [ ] Submarine

Airframe type Quad X

Hardware type Kakute F7 AIO, Kakute F7 V1.5, Pixracer, mRo Pixhawk

Logs Please provide a link to any relevant logs that show the issue

NitinJSanket commented 4 years ago

Also, I'm operating indoors with no optical flow and no GPS.

NitinJSanket commented 4 years ago

Ok, Here's what I think. Even if you disable EKF usage for attitude estimation using AHRS_EK2_USE = 0, I think the attitude estimation using DCM uses gyro scale and biases updated from EKF, making the drift crazy. Here's a snapshot and the log accompanied. Capture

2 12-31-1969 7-00-00 PM.zip

rmackay9 commented 4 years ago

I suspect that the issue is that we calibrate the gyros once soon after startup and perhaps before the board and sensors have warmed up. I'll bet if the gyro calibration is done again later the drift will be much less. I think it's possible to re-do the gyro calibration from MP's Flight Data, Action screen (see top left drop-down).

NitinJSanket commented 4 years ago

It did become better, but the drift is still too high, its about 10 degrees in 3 mins now, the betaflight drifts far far less, about 1 degree in 90 secs.