Appearance
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:
$$ e_p = p_{ref} - p,\quad e_v = v_{ref} - v $$
Outer-loop acceleration command:
$$ a_c = K_p e_p + K_d e_v + K_i \int e_p,dt $$
The command is mapped to attitude and thrust for the inner loop.
Algorithm Procedure
- Compute position and velocity errors from state estimate.
- Generate desired acceleration from PID law.
- Convert acceleration command to desired roll, pitch, and thrust.
- Stabilize attitude with inner-loop PID and actuator mixing.
Tuning Guidance
- Tune
K_dbefore increasingK_pto avoid oscillation. - Integrator anti-windup is required near thrust saturation.
- Set vertical-axis gains independently from lateral gains.
Failure Modes and Diagnostics
- High
K_ican 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 uav_sim.simulations.path_tracking.pid_hoverEvidence
![]()