{
  "id": 21600990,
  "title": "I benchmarked 5 ways to auto-tune a robot arm's PID gains. Random search broke the safety limits in 73.8% of trials. Safe BO: 1.8%.",
  "url": "https://urgent.news/2026/11/24/i-benchmarked-5-ways-to-auto-tune-a-robot-arms-pid-gains-random",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-24T13:34:22.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/pack_petter_73cbede229ec2/i-benchmarked-5-ways-to-auto-tune-a-robot-arms-pid-gains-random-search-broke-the-safety-limits-in-njj"
  },
  "original_language": "en",
  "account": "Five methods were tested to auto-tune a robot arm's PID gains in a simulated environment, all sharing the same budget and 20 independent runs each. Random search resulted in unsafe trials 73.8% of the time, while standard Bayesian optimization (EI) was unsafe 36.8% of the time. Covariance Matrix Adaptation Evolution Strategy (CMA-ES) had an unsafe trial rate of 12.7%, and Safe Bayesian Optimization (GP models of performance and safety) managed only 1.8% unsafe trials. The SAFETY BUDGET ONLY APPROVED APPROACH reduced unsafe trials to an astonishing 1.8%. The tuned controller also improved tracking error by halving the RMS error compared to the initial gains (from 1.12° to 0.60°) without generating additional torque ripple. The researchers found that safety measures did not compromise performance; instead, they appeared to sacrifice patience. The study also examined payload changes (from 1.0 to 2.5 to 1.75 to 0.5 to 2.0 kg), and found that using previous experiments as context allowed the system to approach the optimum within 13–17% after just 10 trials, as opposed to 18–29% for a cold start. Remarkably, after just 3 trials in later stages, the system was able to reach 20–25% of the optimum, as compared to 44–50% for a cold start. Warm-starting was found to be more beneficial than a more advanced acquisition function in the current context. The simulation was based on a testbed featuring a two-link arm model (including friction, torque limits, a noisy 16-bit encoder, and a control delay), an industrial-style 500 Hz PID with anti-windup, and six gains to tune. The GP model was written from scratch (Matérn-5/2 ARD) and cross-checked against scikit-learn, primarily to examine the safety logic without relying on a library in the middle. The full project, including code, raw results, and a tuning handbook, is available on Gumroad: https://gridlabnotes.gumroad.com/l/teusxx.",
  "summary": "Hand-tuning PID gains is slow, and every payload change means starting over. Letting an optimiser explore on the real machine is tempting — but a \"trial\" there isn't a wasted data point, it's a torque spike into a joint limit. So I built a small testbed to ask a simple question: how much does safety-aware optimisation actually buy you? Setup: a simulated two-link arm (friction, torque limits,…",
  "key_points": [
    "Random search broke safety limits in 73.8% of trials",
    "Safe Bayesian Optimization achieved only 1.8% unsafe trials",
    "Warm-starting proved more effective than advanced acquisition functions"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}