PID tuning in AirSim

Hi there,

I am trying to improve the flight behavior of my drone using AirSim in a UE environment with Ardupilot. I have been tuning my PID values to achieve a good control response (inspired by this post: Airsim SITL Copter overshoots · microsoft/AirSim · Discussion #4539 · GitHub).
Currently, I’m using the following parameters

The results are definitely better than the default parameters, and I am able to fly the drone. However, I’m still encountering two issues:

  1. Yaw issue: When I stop giving a yaw command, the drone continues to rotate slightly before coming to a full stop (feels like inertia).
  2. Pitch and Roll issue: When I stop giving a pitch or roll command, the drone tilts backward slightly (which is expected for deceleration). However, about one second later, it tilts further in the same direction before finally stabilizing into a hover. This secondary tilt seems unnecessary.

I’ve tried modifying a bit P, I or D-gains, but I feel like I will never achieve something by trying things randomly. For example, increasing the D-gain for pitch/roll from 0.003 to 0.008 didn’t seem to change the behavior. I haven’t observed any typical oscillations but still this single overshoot before it stabilizes.

I’m new to PID tuning for drones, so any advice or suggestions on how to proceed would be greatly appreciated! I’m also happy to share videos or logs to help illustrate the problem better.

If you think this might not be purely a PID issue and is related to something else, I’m open to trying other approaches.

Thanks in advance for your help!