We performed a couple flights yesterday using the 4.1.0-dev and the drone started to spin in loiter mode. It does not look like a bad compass since we had flown on that terrain several times. It looks more as the loiter mode control after there were a disturbance in yaw, started to command it to keep on spinning on that direction. We were using EK3. As it can be seen below, the pilot did not command yaw while the drone rotates (RCIN.C4 remains at 1500), and the yaw started to deviate (XKF1.Yaw, yellow) before the controller of the loiter mode (ATT.DesYaw, purple) commanded it to keep on rotating on that direction making everything worse.
The yaw rotation is not commanded. the desired yaw (in red) is being dragged behind the actual yaw (in green). The attitude controller never lets the yaw target be more than 10degrees or so from the actual. This is a safety precaution.
Thank you for your replies @rmackay9 and @andyp1per ! I was not aware about the 10 deg restriction for the setpoint. Indeed, in another flight it showed a similar behavior, but this time it triggered the potential thrust loss(3) message after some seconds:
What can be producing the drone to command such a huge value to the motor 3? Today we performed about 5 flights with the same drone using the Copter 4.0.7 version in loiter mode and it performed perfectly, so it may not be a hardware issue since we did not change the hardware at all. The yaw drifting looks like a consequence of the controller thinking it needs to increase the speed of motor 3 since it happens just after it commands the high value as you pointed out:
The high motor output is most likely a natural result of the vehicle trying to maintain its attitude. I would be very surprised if the problem is software although anything is possible especially when using “latest” which has not been trough any beta testing.
I think it is most likely hardware and it will happen in 4.0.x as well.
I’d stick with the stable releases if possible. We will start beta testing of 4.1.0 in the next month or so but it is difficult for us to provide support for unreleased software.
Thank you for your help @rmackay9! I did switch to the master branch because I am very interested in the lane switch feature of the EK3 which as I understand it is only available in the master branch. Tomorrow, I will try flying in loiter mode with another drone to make sure it is not a hardware issue.
Yes, 4.1 has lots of improvements to the EKF including “affinity”, lane switching and sensor source selection. It should be a very significant release for AP.