Department of Computer Science · University of Cape Town · Honours Project 2026

Benchmarking Reinforcement Learning Controllers for Quadcopter Stabilisation

A shared-simulation benchmark of PID and six deep reinforcement learning controllers for quadcopter hover stabilisation under wind disturbance.

  • Wietske van der WesthuizenOff-policy controllersvwswie001@myuct.ac.za
  • Mathew MaartensOn-policy controllersmrtmat016@myuct.ac.za
  • Krupa PragSupervisorkrupa.prag@uct.ac.za
Identical drones and wind profile using three unique controllers. PID (classical), PPO (on-policy RL) and SAC (off-policy RL) each try to hold the drone on the target through composite wind. Simulation.

The project in four numbers

6deep RL algorithms vs a tuned PID baseline
10independent training seeds per controller
2wind conditions: still air and composite gusts
1shared simulator, reward, curriculum and metric set

Why quadcopter control is hard

Quadcopters are underactuated: six degrees of freedom, only four rotors. Their rotor dynamics are tightly coupled, they are open-loop unstable, and wind, motor noise or a shifting payload keeps nudging them away from equilibrium. As drones move into logistics, search and rescue and precision agriculture, reliable low-level control becomes the foundation everything else rests on.

The dominant solution is the Proportional–Integral–Derivative (PID) controller. It is cheap, interpretable and well understood, and it works very well near hover where the dynamics are almost linear. Its weakness is that fixed gains are tuned for ideal conditions; gusts push the vehicle into non-linear behaviour that PID was never designed for.

Reinforcement learning (RL) offers a model-free alternative: a policy learns directly from interaction with the physics. The open question is whether it genuinely beats PID, or only looks better because of how each study was set up.

The benchmarking gap we address

Undisclosed tuning

Many studies don’t report how RL or PID were tuned, so results are hard to reproduce.

Different simulators

MuJoCo, Gazebo and custom engines are mixed, so gains may be simulator artefacts, not algorithmic ones.

Wrong metrics

Reward curves dominate; hover stability, settling and steady-state error are rarely measured.

One fair arena for every controller

Every controller flies the same Bitcraze Crazyflie 2 model in the same MuJoCo Warp / Gymnasium environment, with the same reward, curriculum, wind model, tuning protocol and evaluation metrics.

Simulation environment

Physics
MuJoCo Warp, 500 Hz
Control rate
50 Hz
Task
Take off from the floor, climb to 1.5 m and hover for 20 s
Observation
17-D: position error, velocity, attitude, angular rate, previous action, in-tolerance flag
Action
4-D normalised motor commands in [−1, 1]

Bounded multiplicative reward

Proximity gates everything. Penalties can only shrink the reward, never make it negative, so crashing early can never pay off.

rt= F(et) ⋅ exp (− λu F(et)2 ‖ΔatΔuref‖2 − λω (ωzωref)2 )

with proximity F(e) = tol / (tol + e) and a 0.30 m tolerance.

The wind: still air versus composite disturbance

Controllers are evaluated in still air (best case) and under a composite profile: a constant force plus random gusts, which tests both steady-state rejection and recovery. During training the wind intensity ramps up with the curriculum, reaching 1.2× the evaluation intensity. See an example episode in motion.

Composite wind model. Magnitudes are fractions of hover thrust.
ComponentSpecification
Constant force0.20 of hover thrust
Gust magnitudeuniform [0.15, 0.40] per gust
Gust durationuniform [0.5, 2.0] s
Gust intervaluniform [3.0, 5.0] s between gusts; first gust at t = 5 s
Directionrandom, drawn once per episode and shared by the constant force and all gusts

Fair-tuning pipeline

  1. Calibration

    Probe which metric, budget and pruning rule rank configurations most reliably.

  2. HPO search

    100 Optuna TPE trials per controller, PID included, on a matched budget.

  3. Validation

    Top 5 configurations retrained on fresh seeds; one winner picked by a fixed rule.

  4. Benchmark

    10 untouched seeds, 3 episodes per seed and condition, Wilcoxon tests with Holm correction.

Metrics

Flight-specific rather than theoretical reinforcememt learning metrics: success and completion rate, position RMSE, attitude oscillation, control smoothness, time-to-arrival and fraction-in-tolerance, plus learning curves and inference latency.

What the quadcopter is up against

A steady push plus unpredictable gusts, redrawn for every episode. Pick an example and watch the force on the vehicle (bottom) and the drone being shoved off its target and tilting back into it (top).

Quadcopter hovering in wind A side view of a small quadcopter holding its position inside a dashed tolerance ring while wind streaks blow across it. During each gust the streaks strengthen and the drone is pushed downwind and tilts, then recovers. The gust schedule of the selected episode is listed in the table below.
wind → force 0.20 force 0.50 force 0.58 force 0.38
← wind force 0.20 force 0.56 force 0.41 force 0.47
wind → force 0.20 force 0.42 force 0.53 force 0.36 force 0.59
Wind force over one 20-second episode A step chart of wind force as a fraction of hover thrust over 20 seconds. A constant force of 0.20 runs for the whole episode and gusts add to it at the times listed in the table below. force (× hover thrust) 0.2 0.4 0.6 0 5 10 15 20 s
G1 G2 G3
G1 G2 G3
G1 G2 G3 G4
Example A. Wind blowing left to right. Forces are fractions of hover thrust.
ComponentStartsLastsAddsTotal
Constant0 swhole flight0.200.20
Gust 15.0 s1.4 s0.300.50
Gust 210.2 s0.7 s0.380.58
Gust 314.8 s1.8 s0.180.38
Example B. Wind blowing right to left. Forces are fractions of hover thrust.
ComponentStartsLastsAddsTotal
Constant0 swhole flight0.200.20
Gust 15.0 s0.9 s0.360.56
Gust 210.3 s1.9 s0.210.41
Gust 315.5 s1.2 s0.270.47
Example C. Wind blowing left to right. Forces are fractions of hover thrust.
ComponentStartsLastsAddsTotal
Constant0 swhole flight0.200.20
Gust 15.0 s0.6 s0.220.42
Gust 28.8 s1.5 s0.330.53
Gust 313.9 s0.8 s0.160.36
Gust 418.8 s1.1 s0.390.59
Illustrative episodes. Three samples drawn from the model's rules, not recorded flights. In every real episode the gust count (3–4), times, sizes, durations and wind direction are redrawn at random. The dashed ring is the 0.30 m tolerance zone (not to scale). Each animation loops in real time (20 s).

Why this is hard

  • The steady 0.20 force never goes away, so a controller must lean into it permanently.
  • Gusts arrive at unpredictable times and sizes, so there is no time to retune.
  • The full envelope reaches 0.60 of hover thrust, so countering it can use about 88% of the thrust available.

Wind is where learned control pulls ahead

In still air, PID is competitive with the best RL controllers. Under composite wind, PID loses almost every flight in both studies, while the strongest RL controllers keep hovering.

Success rate: composite wind

Share of evaluation episodes that took off and held a stable hover at the target.

Off-policy (Wietske)

  • SAC83.3%
  • TD333.3%
  • TAD316.7%
  • PID0.0%

On-policy (Mathew)

  • PPO70.0%
  • SCR-PPO63.3%
  • A2C30.0%
  • PID0.0%

Key findings

  • Still air is solved by all controllers. PID matches the best RL controllers on success and tracks within centimetres.
  • Composite wind separates them. PID’s episode completion collapses to roughly 10–13%, with corrective thrust lagging the gusts.
  • Best off-policy: SAC. Significantly ahead of TD3 and TAD3 under wind.
  • Best on-policy: PPO. Highest fraction-in-tolerance (0.900 vs PID’s 0.274) and the tightest seed spread.
  • Two open hypotheses. TAD3’s mean-aggregation benefit over TD3 and SCR-PPO’s dynamic-clipping benefit were both inconclusive.
  • Real-time feasible. RL inference takes about 2.6–2.9 ms against a 4 ms budget; PID takes about 44 µs.

Reading the two charts side by side. Both studies use the same environment, reward, curriculum and wind model, but they trained for different step budgets (1.5 M vs 3.5 M) and each report evaluates its own PID and success criterion. Compare controllers within a report; the detailed tables are on the individual pages.

Limitations and future work

Limitations

  • One simulated airframe (Crazyflie 2), one hover task and one wind family; no physical flight.
  • PID comparisons under composite wind are underpowered because PID rarely completes an episode.
  • Tight episode boundaries end flights early, which limits recovery and statistical power.

Future work

  • More seeds, vehicles and disturbance profiles.
  • Cascaded controllers with multiple control loops.
  • Pre-registered replication of the dynamic-clipping ablation.
  • Latency measured on embedded flight hardware.

Read the work

The research proposal was written jointly; literature reviews and final reports are individual. Everything is collected on one page.

  • PDF

    Research proposal

    Joint document, 10 pages: “Beyond PID: Benchmarking Reinforcement Learning Controllers for Quadcopter Stabilisation”.

    Open

Browse all documents and code