Loiter Mode: Drone Drifts Aggressively After Releasing Sticks to Neutral — Regression in 4.8.0dev (Works Fine on 4.6)

Bug Report

Issue details

In Loiter mode, after flying for a certain period of time, when the RC joysticks are released to center (neutral position), the drone exhibits aggressive movements and drifts in a random direction instead of holding position. The issue is a regression introduced in 4.8; the same hardware and configuration works correctly on 4.6.

The system includes M8N Gps & IST8310, Sbus RC reciever and no external sensors(optical flow, distance, etc…)

Steps to reproduce:

  1. Arm the vehicle and take off in Loiter mode
  2. Fly for a certain period of time
  3. Release both joysticks to neutral/center
  4. Drone begins aggressive movement and drifts in one direction instead of holding position

Expected behavior:
Drone should hold its position when sticks are centered in Loiter mode.

Actual behavior:
Drone exhibits aggressive uncommanded movement and drifts in a fixed direction.

Regression: Issue is not present on 4.6. Confirmed working correctly on 4.6 with identical hardware and configuration.

Version
ArduCopter 4.8.0dev (master branch)

Platform
All
AntennaTracker
Copter
Plane
Rover
Submarine

Airframe type
Quadcopter

Hardware type
Pixhawk V6X-based custom carrier board

Logs

Two logs are provided from the exact same hardware and configuration — only the firmware version differs:

  • 4.6 this link — Normal Loiter behavior, drone holds position when sticks are centered.

  • 4.8 this log Aggressive uncommanded movement and drift observed when sticks are released to neutral in Loiter mode.

You’re going to need to provide a better log to look at. There is only one point, less that 3 seconds, where either the pitch and roll are neutral. The default loiter breaking delay is 1 second, so in that 3 seconds, the quad did level out and respond as requested.

The tune of this quad is not ideal. Rate outputs and vibrations are good, so you might be able to get away with setting the notch filter and re-tuning.

I looked at both logs, and the tune seems to be consistent. It wasn’t good in 4.6 or 4.8.

It looks like your input shaping stopped being sufficient to mask too high acceleration limits

I would recommend going through the configuration using AMC.

The PID tune is dedicated by Autotune outcomes. So the values of PID for Roll, Pitch and Yaw not given by randomly.
For v4.6 vs v4.8 flights, When flying at loiter mode, after flying 2-3min and releasing the rc joystick to middle/neutral position it should be stable on the position. While fliying with same hardware same configuration with 4.6, The drone stables itself as soon as we release the jostick. But with 4.8 when we release the joystick it cant stable it self, it drifts hard and agressively. Thats why the log files are short time period.
We’re afraid of the crush thats actually why we keeping flight time short. We can detect the problem directly with our eyes.

Autotune only does a good job if certain preconditions are met.

Using the configuration sequence guided by the AMC software forces you to meet the optimal preconditions required for Autotune to optimally tune your vehicle.

There are bad Autotune and good Autotune results.

Which ones do you want?

I’ve had a quick look at the logs and a few observations:

  1. ATC_INPUT_TC is the default value of 0.1 which means it’s less likely that this is the cause of the problem.
  2. As @iampete reported the 4.8 log is using a non-standard version although I suspect the only addition is a new board has been added. Still, it would be good to use 4.7.0-beta7 for testing.
  3. Tuning doesn’t look too bad to me with the exception of the PSCE and PSCN desired, target and actual velocities. There’s a graph below which shows the actual velocity significantly underperforming. I must admit though that I have not looked at the velocity tuning very much.

  4. Some important parameter changes between 4.6 and 4.8 logs:
    • ATC_RAT_PIT_P was reduced from 0.049 to 0.046.
    • MOT_THST_HOVER was increased from 0.125 to 0.339
    • Acceleration and compass calibration values are different

I suspect we need input from @Leonardthall

1 Like

Are you able to repeat both tests using unchanged code?

A really nice test is if you do all the maneuvers on a north south line and attempt to run the same profiles on each version.

1 Like

BTW, it’s possible the mismatch in actual velocities is an EKF issue so below are some EKF velocity innovations between the 4.6 and 4.8 logs.


1 Like

This may all be simply because you have:
LOIT_OPTIONS 1

This turns on coordinated turns. You are doing a bunch of circles. Try setting it to zero and seeing if that makes it behave the same.

3 Likes

The problem’s source is not PID values, they’re not good we already know it, but the problem is with 4.8 there’re some changes applied on loiter mode or something like that.
How we know that is as we mentioned, we’ve been tried this hardware&configuration on 4.6 and there is no problem at all. The problem only occurs on 4.8 with loiter mode.
But thank for inspecting our problem.

We returned to the master branch with our custom configurations,
Thanks to @Leonardthall , by changing the “LOIT_OPTIONS 1” to “0” the problem has been solved.
This parameters not included at 4.6.3, it seems new parameters added with new versions.
Our lastest test outcomes like this
Thanks for all you guys for inspecting the problem.

1 Like