Loiter yaw problem

Hi, I’m using a motion capture system and mavros to send position to arducopter.

During loiter tuning (Indoor position controller tuning) I’ve seen a strange behaviour, when the copter is turned on yaw it flies in the “opposite direction” and then comes back in position, can this be related to some kind of sensor offset?

@rmackay9 said on a previous video:

I think the yaw estimate is off. I suspect you can see this if you just walk the vehicle around. I think you’ll probably find that if you hold the vehicle’s heading steady and walk forward in the room that the vehicle’s position on the ground station map doesn’t move forward but instead moves off to the side…

But I double checked that, the orientation passed by the system is ok. I’ve even moved the markers to have a better asymmetric body for the cameras to get orientation.

Then I recorded this video, the only input is a few degree counterclockwise rotation and then the copter comes back in place. This is repeated multiple times.
As you can see, this weird “involontary movement” is corrected by position controller which almost correctly comes back in place. This movement is always related to the body frame of the copter. Maybe it has something to do with some inconsistency with the frame of the velocities?

Heres the log file of the video

In another test with a slow and costant yaw rotation input the copter seems to follow a circle path around a point a few meters ahead of its nose.
It happens also if the copter is turned clockwise, with a drift in the opposite direction.

The PIDs are fine tuned indoor following @Leonardthall suggestions, the copter flies very well in STABILIZE.
The firmware is the ardupilot master of a couple months ago on Chibios, next time I’ll test with 3.6rc10

Maybe there are some parameters to check or so, have you any insight on this?

Thank you all for your great work!

Hi guglie,

I think this may be because you have not leveled the aircraft in flight. So it thinks it is fighting a wind but it is actually fighting it’s own level offset. So where it expects it to fight in the same direction, it actually rotates with the aircraft.

Try doing this process and see if it helps.


Hi @Leonardthall, thanks for your reply!

I’ve already done the autotrim procedure before the tests and the copter stays still in stabilize.

Here’s a new log I’ve done yesterday with the same problem.

I’m wondering why the velocity here (green) is opposite to the movement on the position (blue), probably there’s something I don’t understand.

Here’s the log file

@Leonardthall gave me a very useful insight here

Plotting the roll and pitch we can see that the roll and pitch are non zero when the copter is holding position. (But they are zero on arming and takeoff)

I’ll make new tests trying to remove that offset, thanks!