Individual contribution · Off-policy RL

Benchmarking Off-Policy Reinforcement Learning Controllers for Quadcopter Stabilisation

Wietske van der Westhuizen · Supervisor: Krupa Prag · University of Cape Town

SACTD3TAD3PID

What I did and what I found

I compared three off-policy RL controllers, Soft Actor-Critic (SAC), Twin Delayed DDPG (TD3) and Twin Average Delayed DDPG (TAD3), against the PID controller for quadcopter hover under wind. Each was tuned with the same Optuna-driven HPO pipeline and benchmarked over 10 seeds in still air and composite wind, using flight-specific metrics and real-time latency profiling.

PID was competitive in still air but its success rate fell to 0% under composite wind. SAC was the best RL controller, while the TAD3 mean-aggregation hypothesis was inconclusive: there was not enough evidence that it differs from TD3.

83%SAC success under composite wind (PID: 0%)
0.006 mSAC still-air RMSE (PID: 0.023 m)
2.9 msSAC inference latency vs a 4 ms budget
p = 0.0039SAC vs TD3/TAD3 under wind (Holm-significant)

Research questions

RQ1Solution quality. Under a matched HPO budget and identical dynamics, do SAC, TD3 and TAD3 achieve higher hover success, lower RMSE and tighter attitude stability than PID, in both nominal and composite wind?
RQ2Algorithmic efficiency. Does replacing TD3’s minimum target critic with an average (TAD3) reduce over-conservative value estimates, and how does that affect convergence reliability and disturbance rejection?
RQ3Computational feasibility. Can the off-policy neural controllers keep inference latency below 4,000 µs, the budget for 250–1000 Hz control loops?

My technical contributions

Custom TAD3 implementation

TD3 uses the minimum of its twin critics, which prevents overestimation but introduces underestimation bias. TAD3 replaces the minimum with the mean, keeping delayed policy updates and target-policy smoothing. It is implemented by subclassing SBX’s TD3 and overriding the target-Q computation.

yTAD3=r+γ Qθ1′(s′,a~) + Qθ2′(s′,a~) 2

Multi-stage HPO and evaluation

  • Calibration: Spearman rank correlation across checkpoints chose the objective (fraction in tolerance, ρ = 0.957), trial budget and episode count.
  • Search: 100 Optuna TPE trials per controller (20 random + 80 TPE) at 750 K steps; top 20 clustered by k-medoids into 5 candidates using a conservative score (mean minus standard error).
  • Validation: 5 configurations × 5 fresh seeds at 1 M steps; a four-tier rule picks the winner.
  • Benchmark: 10 fresh seeds, 1.5 M steps, 11 checkpoints, 3 episodes per seed-condition.

Disturbance stress-testing

Still air versus the composite wind profile (constant 0.20 hover-thrust force plus 0.15–0.40 gusts; up to 88% of available thrust to counter). Evaluation seeds are strictly disjoint from tuning and training seeds.

Latency profiling

Average wall-clock time to compute one action, measured per controller and compared with the 4,000 µs onboard-feasibility budget.

Final tuned hyperparameters (Appendix A)
Selected configurations after the HPO pipeline. Replay buffer 1,000,000 and learning start 10,000 steps for all.
ParameterSACTD3TAD3
Learning rate1.49×10−41.18×10−32.31×10−3
Discount γ0.97680.97710.9771
Polyak τ0.01810.01520.0195
Batch size128512512
Network[256, 256][256, 256][256, 256]
Action noisenormal, 0.359ou, 0.051ou, 0.152
Entropy α0.01––
Policy delay–33
Target policy noise / clip–0.266 / 0.3930.153 / 0.337

Controller flight performance

Benchmark summary (10 seeds × 3 episodes per condition; mean ± SE). Lower is better for RMSE, oscillation and smoothness.
Controller Success Completion RMSE last 10 s (m) Attitude osc. (°) Ctrl smoothness
No disturbance
SAC1.000 ± 0.0001.000 ± 0.0000.006 ± 0.0010.01 ± 0.002.6 ± 0.3
TD30.967 ± 0.0330.967 ± 0.0330.016 ± 0.0040.94 ± 0.3414.9 ± 2.6
TAD30.800 ± 0.1330.900 ± 0.1000.188 ± 0.1637.54 ± 3.60219.8 ± 72.4
PID1.000 ± 0.0001.000 ± 0.0000.023 ± 0.0011.02 ± 0.10687.2 ± 27.0
Composite wind
SAC0.833 ± 0.0561.000 ± 0.0000.132 ± 0.01129.0 ± 1.521.3 ± 1.4
TD30.333 ± 0.0700.767 ± 0.0870.283 ± 0.04031.6 ± 1.9578.8 ± 123.9
TAD30.167 ± 0.0560.733 ± 0.1090.434 ± 0.13731.9 ± 4.91680.4 ± 321.0
PID0.000 ± 0.0000.133 ± 0.0740.426 ± 0.03557.3 ± 1.6483.8 ± 15.0

PID’s composite RMSE is computed over only its few completed episodes, so it flatters PID; unconditional RMSE across all episodes is 0.770 m for PID vs 0.132 m for SAC.

PID versus RL

Still air. SAC and PID both succeeded in every episode. SAC had the lowest RMSE (0.006 m vs PID’s 0.023 m; Wilcoxon p = 0.002, effect size r = −1.00, Holm-significant). TD3 was numerically better than PID but not significantly (p = 0.106). PID gave by far the most erratic control inputs (smoothness 687.2 vs SAC’s 2.6), overshooting repeatedly because its fixed-gain braking is applied identically everywhere.

Composite wind. PID’s completion rate collapsed from 100% to 13.3% and none of its episodes succeeded. Its corrective thrust trailed the gusts (phase lag), producing large elliptical swings that left the arena bounds. SAC kept 100% completion. Because PID completed so few episodes, the RL-vs-PID tests have only n = 3 pairs, so the smallest attainable p is 0.25. These are underpowered, not merely non-significant, and are read directionally.

Four 3-D plots of flown trajectories from the start point to the hover target under composite wind. SAC and TD3 settle close to the target, TAD3 oscillates more severely, and PID swings in large sweeps across the arena.
Figure 1. Flown trajectories of (a) SAC, (b) TD3, (c) TAD3 and (d) PID from start to the fixed hover target (0, 0, 1.5) m under composite wind (seed 202, episode 0). Panels (a)–(b) and (c)–(d) use different scales to make the trajectories visible.

SAC versus TD3 versus TAD3

Pairwise comparison of RL controllers on RMSE (last 10 s), paired by seed. Wilcoxon signed-rank, Holm-corrected α = 0.00417.
ComparisonConditionMean diff. (m)Effect size rpSignificant
SAC vs TD3No disturbance−0.010−0.850.0137No
SAC vs TAD3No disturbance−0.183−1.000.0039Yes
TD3 vs TAD3No disturbance−0.172−0.560.1641No
SAC vs TD3Composite−0.151−0.960.0039Yes
SAC vs TAD3Composite−0.305−1.000.0039Yes
TD3 vs TAD3Composite−0.137−0.160.7344No

SAC is the superior RL controller. It had the lowest RMSE, least attitude oscillation, smoothest inputs and highest success under both conditions. A plausible explanation is architectural: SAC’s entropy-regularised stochastic policy smooths out poor Q-estimates and adapts exploration, whereas TD3/TAD3 rely on a fixed exploration-noise hyperparameter.

The TAD3 hypothesis is inconclusive. TD3 and TAD3 were not significantly different on RMSE (p = 0.164 and 0.734). Descriptively, however, TD3 had about twice TAD3’s composite success rate and about a third of its control roughness, so mean aggregation did not demonstrably help and may have hurt by letting less-verified actions through during training.

Sample efficiency

Calibration

  • Fraction in tolerance was the best ranking metric (ρ = 0.957).
  • Reward plateaued at 400 K steps (TD3), 500 K (SAC) and 750 K (TAD3), which set the 750 K search budget.

Steps needed to beat PID

  • TD3 beat PID’s still-air RMSE within 400 K steps, and under wind first at 900 K.
  • SAC took longer (1.2 M still air, 1.1 M wind) but plateaued at a higher ceiling.
  • TAD3 never beat PID’s still-air RMSE and was the least efficient.
Two line charts of RMSE over the final 10 seconds against training steps for SAC, TD3 and TAD3, with a dashed PID baseline: (a) no disturbance and (b) composite wind. RMSE falls as training progresses, with SAC lowest at the end under composite wind.
Figure 2. RMSE (final 10 s) vs training step for SAC, TD3 and TAD3 in (a) no disturbance and (b) composite wind, with ±1 SE ribbons across the 10 benchmark seeds. The dashed line is the final PID value.
Two line charts of episode completion rate against training steps for SAC, TD3 and TAD3, with a dashed PID baseline: (a) no disturbance, where SAC and TD3 reach 1.0 early, and (b) composite wind, where completion rises late in training and SAC ends at 1.0.
Figure 3. Completion rate vs training step, with the same controllers, conditions and PID reference as Figure 2.

Inference latency (RQ3)

Mean inference latency pooled across conditions and completed episodes.
ControllerLatency (µs)% of 4,000 µs
SAC2,898 ± 42972%
TD32,570 ± 51464%
TAD32,861 ± 60572%
PID44.1 ± 0.31.1%

All three RL controllers fit inside the real-time budget on the benchmarking machine, but PID is about 60–65× faster thanks to its O(1) arithmetic, versus full neural-network forward passes for the RL policies.

The latency is dominated by a single-sample GPU dispatch, not the algorithm, and was not measured on an embedded processor. The spread is large relative to the headroom, so feasibility on real flight hardware remains unconfirmed.

Flights

Video 1. PID (left) and SAC (right) flying the same composite-wind episode: benchmark seed 200, episode 0, RL policy at 1.5 M training steps, identical spawn and wind. The green sphere is the 0.3 m success zone. Simulated in MuJoCo Warp.

Limitations and future work

Limitations

  • Single airframe, simulation only; no physical flight.
  • 3 of 12 RMSE tests are underpowered under composite wind.
  • Significance testing covers RMSE only; other metrics are descriptive.
  • Episode boundaries cut off recoverable flights for TAD3 and PID.

Future work

  • More seeds, conditions and airframes for a firmer ranking.
  • Cascade controller architectures (separate altitude and attitude loops).
  • Wider environment bounds to allow recovery and higher completion.
  • Latency on embedded hardware.

Reports and code

  • PDF

    Final report

    Benchmarking Off-Policy Reinforcement Learning Controllers for Quadcopter Stabilisation

    Open
  • PDF

    Literature review

    Evaluating Off-Policy Reinforcement Learning Control Systems Against PID for Quadcopters (5 pages).

    Open
  • ZIP

    Source code

    Shared project codebase (both authors).

    Download

All project documents →