Individual contribution · On-policy RL

Beyond PID: Benchmarking Reinforcement Learning Controllers for Quadcopter Stabilisation

Mathew Maartens · Supervisor: Krupa Prag · University of Cape Town

A2CPPOSCR-PPOPID

What this report did and found

This report benchmarks three on-policy RL controllers, Advantage Actor–Critic (A2C), Proximal Policy Optimisation (PPO) and Stabilising Constraint Regularisation PPO (SCR-PPO), against a tuned PID baseline for quadcopter hover. All controllers share one environment, reward, disturbance specification and evaluation protocol; the RL controllers also share the training curriculum and step budget.

Every controller solved still air at about 0.95 fraction-in-tolerance (FIT). Composite wind separated them: PPO 0.900, SCR-PPO 0.796, A2C 0.458, PID 0.274. A 30-seed matched ablation favoured dynamic over fixed clipping (0.861 vs 0.813 FIT) but did not pass the Holm-corrected decision rule (p = 0.084).

0.900PPO composite FIT (PID: 0.274)
70%PPO composite success (PID: 0%)
3.5 Mtraining steps × 10 seeds per controller
p = 0.084dynamic vs fixed clipping: promising, unconfirmed

Research questions

RQ1Final performance. How do A2C, PPO, SCR-PPO and PID compare under identical evaluation conditions?
RQ2Learning and reliability. What trade-offs arise between the on-policy algorithms in learning progression, sample efficiency, reliability and resulting policy performance?
RQ3Dynamic clipping. How does SCR-PPO compare with PPO, and does dynamic clipping improve final flight performance relative to an otherwise identical fixed-clipping control?

The controllers and the ablation

A2C → PPO → SCR-PPO

  • A2C: synchronous actor-critic, one update per rollout.
  • PPO: clipped surrogate objective allows several minibatch epochs per rollout, so samples are reused.
  • SCR-PPO: replaces PPO’s fixed clip ε with a per-minibatch value driven by the spread of actions, bounded between εmin and εmax.

Flat PID baseline

A non-cascade PID: position and attitude loops computed in parallel and combined before motor mixing, with derivative terms from measured velocities. Gains were selected through a separate 100-trial search under the same evaluation conditions.

Training and validation

  • 100-trial Optuna TPE search per algorithm (2 M steps), ranked by composite FIT minus its standard error.
  • 5 shortlisted configurations × 5 seeds (2.5 M steps), then 10 benchmark seeds at 3.5 M steps.
  • Curriculum difficulty ramps to 1.0 over 85% of the budget; 30% of episodes are floor-level “anchor” spawns.

Dynamic-clipping ablation

SCR-PPO versus an otherwise identical arm with fixed ε = 0.1761, the mean of the dynamic values measured in two instrumented runs. 30 matched seeds (200–229) per condition; Holm-corrected Wilcoxon on final FIT.

Disclosed deviations. A2C’s selected configuration was chosen by a documented post-hoc override because all candidates had zero composite success, and the ablation was expanded from 10 to 30 seeds after inspecting initial results.

Selected RL configurations
Selected configurations. Rollout, world and batch sizes are derived values; all policies use tanh MLPs.
MethodLRWorldsSteps/worldRolloutBatchγGAE λLayers
A2C.0038266410640640.98719.9640464, 64
PPO.00152151232163842048.98741.95403128, 128
SCR-PPO.001111102416163841024.98349.9308964, 64

Final controller performance

Final performance at 3.5 M steps (10 seeds, 3 episodes per seed and condition; seed means, between-seed SD in brackets). RMSE includes incomplete episodes.
MetricPIDA2CPPOSCR-PPO
Still air
FIT ↑0.954 (0.000)0.954 (0.001)0.952 (0.003)0.952 (0.002)
Success ↑1.0001.0001.0001.000
Completion ↑1.0001.0001.0001.000
RMSE (m) ↓0.02360.03450.01710.0114
Composite disturbance
FIT ↑0.274 (0.038)0.458 (0.317)0.900 (0.033)0.796 (0.268)
Success ↑0.0000.3000.7000.633
Completion ↑0.1000.4330.7330.633
RMSE (m) ↓0.76530.58970.16950.2741

Still air. All controllers succeeded and completed every episode. After Holm correction, SCR-PPO had significantly lower final-window RMSE than A2C and PID, and PPO beat A2C.

Composite wind. PPO led on FIT, success, completion and all-episode RMSE. In the all-episode FIT family, PPO beat A2C and PID, and SCR-PPO beat PID, after Holm correction; PPO and SCR-PPO were not statistically separated. PID comparisons on completion-conditioned RMSE kept only 2–3 pairs and are underpowered.

Time to arrival

Median (IQR) seconds across seed-level means; n = contributing seeds. Read alongside completion and success.
ControllerStill airComposite
Flat PID0.927 (0.005), n = 1019.340 (0.240), n = 2
A2C0.920 (0.030), n = 109.520 (7.940), n = 8
PPO0.947 (0.027), n = 101.117 (1.430), n = 10
SCR-PPO0.940 (0.035), n = 101.097 (0.071), n = 8
Median distance to target and altitude in still air and composite wind for PPO, SCR-PPO, A2C and PID. Under wind, PID repeatedly leaves the 30 cm tolerance while the learned controllers stay closer to the target.
Figure 1. Median within-episode convergence across 10 seeds × 3 episodes, with interquartile bands. Terminated episodes stop contributing after failure, so a shrinking band can reflect fewer surviving episodes. Read alongside completion and success. Click to view at full size.

How each algorithm learned

Normalised composite learning-curve area

  • PPO0.527
  • SCR-PPO0.477
  • A2C0.302

Bars are scaled to the 0–1 range of the area.

Key observations

  • Nominal hover is learned before disturbance rejection. A2C hit 0.84 still-air FIT by 400 K steps but plateaued under wind.
  • PPO was the most sample-efficient and reliable (composite FIT SD 0.033).
  • SCR-PPO was strong but seed-sensitive (SD 0.268; seeds 201 and 206 fell sharply).
  • The curriculum is coupled to training progress, so curriculum effects cannot be isolated causally.
Mean fraction-in-tolerance versus training steps for PPO, SCR-PPO and A2C, with one standard error bands and dashed PID baselines. All learn still-air hover; PPO finishes highest under composite wind.
Figure 2. Mean FIT ± 1 SE across 10 seeds at 12 training checkpoints; dashed lines show the tuned PID baseline. Training steps use a logarithmic scale. Click to view at full size.
Final fraction-in-tolerance for each of 10 benchmark seeds in still air and composite wind, with horizontal mean bars. PPO has the highest composite mean and smallest spread among the learned controllers; SCR-PPO and A2C vary more.
Figure 3. One mean FIT value per benchmark training seed, with bars showing controller means. Composite seed SD: PPO 0.033, SCR-PPO 0.268, A2C 0.317 and PID 0.038. Click to view at full size.

Does dynamic clipping help?

Dynamic vs fixed clipping at 3.5 M steps, 30 paired seeds per condition. Holm correction across the two FIT tests.
ConditionDynamic FITFixed FITMean diff. [95% CI]rrbp (unadjusted)Significant
Still air0.95310.9536−0.0006 [−0.0012, −0.0001]−0.4150.047No
Composite0.86130.8130+0.0483 [−0.0243, 0.1198]+0.3630.084No

Under composite wind dynamic clipping won on 19 of 30 paired seeds, and composite success was 0.744 vs 0.589 (supporting, not part of the corrected family). Instrumentation confirmed that εt really varied during training (means 0.1829 and 0.1693, range about 0.08–0.29, never clamped), but the mechanism behind the higher point estimate remains unexplained. The result is promising but unconfirmed and warrants a pre-registered replication.

Flights

Video 1. Flat PID (left) and PPO (right) under composite wind (constant force plus gusts): benchmark seed 202, episode 0, PPO policy at 3.5 M training steps, identical spawn and wind. The green sphere marks the 0.3 m tolerance zone. This saved benchmark replay illustrates one episode; aggregate performance is reported above.

Limitations and future research

Limitations

  • The PID baseline is flat, not cascaded; results do not extend to stronger classical controllers.
  • One simulated vehicle, task, disturbance family and training budget.
  • A2C’s selected setting sits on the lower boundary of the searched world count.
  • The ablation sample was expanded after inspecting initial results.

Future research

  • Trajectory tracking, other vehicles, more disturbance profiles, and physical flight.
  • Pre-registered clipping replication with more instrumented runs and several fixed clip values.

Reports and code

  • PDF

    Final report

    Beyond PID: Benchmarking Reinforcement Learning Controllers for Quadcopter Stabilisation

    Open
  • PDF

    Literature review

    Individual literature review.

    Open
  • ZIP

    Source code

    Shared project codebase (both authors).

    Download

All project documents →