Skip to content

PID Hover ​

Problem Statement ​

PID hover control provides a robust baseline for multirotor stabilization and waypoint holding. It decomposes position and attitude regulation into cascaded loops with straightforward gain interpretation.

Model and Formulation ​

Position error:

ep=pref−p,ev=vref−v

Outer-loop acceleration command:

ac=Kpep+Kdev+Ki∫epdt

The command is mapped to attitude and thrust for the inner loop.

Algorithm Procedure ​

  1. Compute position and velocity errors from state estimate.
  2. Generate desired acceleration from PID law.
  3. Convert acceleration command to desired roll, pitch, and thrust.
  4. Stabilize attitude with inner-loop PID and actuator mixing.

Tuning Guidance ​

  • Tune K_d before increasing K_p to avoid oscillation.
  • Integrator anti-windup is required near thrust saturation.
  • Set vertical-axis gains independently from lateral gains.

Failure Modes and Diagnostics ​

  • High K_i can cause slow oscillation and overshoot after disturbances.
  • Actuator saturation can destabilize attitude during large position errors.
  • Check phase margins by injecting small-step position commands.

Implementation and Execution ​

bash
python -m flybots.simulations.path_tracking.pid_hover

Evidence ​

PID Hover

References ​

Released under the MIT License.