simulation, first real run in1296 graded episodes4 arms
Tell it your driver, your models and your rates. It tells you the controller.
robot_controllers treats a robot controller as a trajectory plus a feed-forward model plus a feedback model, placed by a layout: where each runs (plan time, the host, or the servo driver), how often, and how far ahead it samples. It grades a population of layouts against the conditions a real arm meets, and answers the question with a lookup.
BAM's five-bar on a moteus bus at 50 Hz, a rigid-body model that's 10 % off; best accuracy
recommend(Setup(arm='bam_fivebar', host_rate_hz=50, bus=datasheet_bus(6), feedforward='rigid_body', model_error=0.1))P7 — model, at plan time · computed-torque gains, re-sent each tick · lookahead calibrated
P7 (rigid_body@plan + ctc@board_scheduled, tangent, lookahead calibrated) is the best of the 12 passing configs this driver and feed-forward can run on bam_fivebar/path@nominal·50Hz·bus=datasheet·ff±10%·gains×1 · expected: tool error p95 1.5 mm, joint error p95 0.613 °
the full reasoning
P7 (rigid_body@plan + ctc@board_scheduled, tangent, lookahead calibrated) is the best of the 12 passing configs this driver and feed-forward can run on bam_fivebar/path@nominal·50Hz·bus=datasheet·ff±10%·gains×1 (the nearest graded scenario, distance 7.4e-17) for accuracy: tool_p95_mm 1.5 mm, tracking_p95_deg 0.613 deg; runner-up P7s: tool_p95_mm 1.54 mm, tracking_p95_deg 0.605 deg; its lookahead is the twin's calibrated bus delay there shifted by your bus - measure yours with `robot-controllers calibrate`
The same arm, but you care most about noticing a collision
recommend(... objective='collision_detection')P7s — model, at plan time · computed-torque gains, re-sent each tick · lookahead calibrated · secant velocity
P7s (rigid_body@plan + ctc@board_scheduled, secant_mid_ff, lookahead calibrated) is the best of the 13 passing configs this driver and feed-forward can run on bam_fivebar/collision·50Hz·bus=datasheet·ff±10%·gains×1 · expected: noticed in 1.25 ms, impact 27.1 N·m
the full reasoning
P7s (rigid_body@plan + ctc@board_scheduled, secant_mid_ff, lookahead calibrated) is the best of the 13 passing configs this driver and feed-forward can run on bam_fivebar/collision·50Hz·bus=datasheet·ff±10%·gains×1 (the nearest graded scenario, distance 7.4e-17) for collision_detection: collision_detect_ms 1.25 ms, collision_margin 41.7; runner-up P7: collision_detect_ms 1.25 ms, collision_margin 40; its lookahead is the twin's calibrated bus delay there shifted by your bus - measure yours with `robot-controllers calibrate`
A UR5e-sized arm whose driver can't close a PD loop itself, 100 Hz host
recommend(Setup(arm='ur5e', host_rate_hz=100, ..., driver_caps=DriverCaps(board_pd=False)))P9 — model, on the host at the measured state · computed torque on the host · lookahead none
P9 (rigid_body@host_measured + ctc@host, tangent, lookahead none) is the best of the 2 passing configs this driver and feed-forward can run on ur5e/path@nominal·100Hz·bus=datasheet·ff±10%·gains×1 · expected: tool error p95 7.46 mm, joint error p95 0.591 °
the full reasoning
P9 (rigid_body@host_measured + ctc@host, tangent, lookahead none) is the best of the 2 passing configs this driver and feed-forward can run on ur5e/path@nominal·100Hz·bus=datasheet·ff±10%·gains×1 (the nearest graded scenario, distance 7.4e-17) for accuracy: tool_p95_mm 7.46 mm, tracking_p95_deg 0.591 deg; runner-up P10: tool_p95_mm 7.75 mm, tracking_p95_deg 0.599 deg; better but not runnable here: P6s (the driver cannot run feedback at board / feed-forward at host_measured), P4s (the driver cannot run feedback at board / feed-forward at plan), P7s (the driver cannot run feedback at board_scheduled / feed-forward at plan), P3s (the driver cannot run feedback at board / feed-forward at plan), P5s (the driver cannot run feedback at board / feed-forward at plan), P4 (the driver cannot run feedback at board / feed-forward at plan), P2s (the driver cannot run feedback at board / feed-forward at trajectory), P3 (the driver cannot run feedback at board / feed-forward at plan), P6 (the driver cannot run feedback at board / feed-forward at host_measured), P5 (the driver cannot run feedback at board / feed-forward at plan), P7 (the driver cannot run feedback at board_scheduled / feed-forward at plan), P2 (the driver cannot run feedback at board / feed-forward at trajectory); P9 is not real-safe (§5.5: feedback on the host, or no feed-forward): on a real arm the best real-safe one here is none (no REAL_SAFE config passes)
The idea
What it found
A UR5e twin on fast moves at 50 Hz, the same law three ways: as built, + lookahead, + secant velocity. The trace is the tool's error.
The answer per arm
At the rig's conditions: 50 Hz host, the datasheet bus, a model 10 % off. One row per objective.
| best at the rig's conditions | Planar twin (2 joints) | UR5e (6 joints) | BAM five-bar arm (6 joints) | 1-DOF pendulum |
|---|---|---|---|---|
| accuracy (tool error) | P7s 1.26 mm · 15/16 pass | P7s 1.65 mm · 16/16 pass | P7 1.5 mm · 14/16 pass | P3s 5.48 mm · 15/16 pass |
| impact (peak torque into a stop) | P9 125 N·m · 16/16 pass | P6s 5706 N·m · 13/16 pass | P6s 25.6 N·m · 15/16 pass | P1 274 N·m · 16/16 pass |
| collision detection (time to notice) | P5s 2.25 ms · 16/16 pass | P5s 2.25 ms · 13/16 pass | P7s 1.25 ms · 15/16 pass | P7s 1.75 ms · 16/16 pass |
| cost (host CPU, bus bytes) | P2 0.191 % of a core · 15/16 pass | P2 0.184 % of a core · 16/16 pass | P2 0.144 % of a core · 14/16 pass | P2 0.0981 % of a core · 15/16 pass |
The population
| config | feed-forward | feedback | lookahead |
|---|---|---|---|
| P1 | none | board PD | calibrated |
| P2 | the trajectory's torque column | board PD | none |
| P3 | model, at plan time | board PD | datasheet |
| P4 | model, at plan time | board PD | calibrated |
| P5 | model + friction, at plan time | board PD | calibrated |
| P6 | model, on the host at the measured state | board PD | calibrated |
| P7 | model, at plan time | computed-torque gains, re-sent each tick | calibrated |
| P8 | model, at plan time | spring on the host, damper on the board | none |
| P9 | model, on the host at the measured state | computed torque on the host | none |
| P10 | model, at plan time | PD on the host | none |
P2–P7 also run with the secant velocity (suffix s): 16 configs.
The scenarios
Around that base, one axis at a time, on fixed target trajectories per arm: trajectory speed (slow, nominal, fast); host rate (25, 50, 100, 200 Hz); how wrong the feed-forward model is (0, 10, 30 %); how soft or stiff the driver's gains are (×0.5, ×1, ×2); the bus (ideal, datasheet, as measured on the rig, with jitter); a collision with a hard stop; and the host rate × model error grid the lookup interpolates over. Metrics: tracking and tool error, saturation, the share of torque feedback supplies, host CPU, bus bytes, impact torque, and time to detect a collision.
How each config did
| config | Planar twin | UR5e | BAM five-bar arm | 1-DOF pendulum |
|---|---|---|---|---|
| P1 | 1 best · 1 within 10 % passes 19/21 | 0 best · 1 within 10 % passes 19/20 | 0 best · 0 within 10 % passes 1/20 | 2 best · 2 within 10 % passes 2/20 |
| P2 | 17 best · 19 within 10 % passes 21/21 | 15 best · 18 within 10 % passes 20/20 | 12 best · 15 within 10 % passes 20/20 | 14 best · 18 within 10 % passes 20/20 |
| P2s | 0 best · 3 within 10 % passes 21/21 | 2 best · 5 within 10 % passes 20/20 | 3 best · 6 within 10 % passes 20/20 | 0 best · 6 within 10 % passes 20/20 |
| P3 | 0 best · 1 within 10 % passes 21/21 | 0 best · 1 within 10 % passes 20/20 | 0 best · 1 within 10 % passes 20/20 | 1 best · 11 within 10 % passes 20/20 |
| P3s | 1 best · 8 within 10 % passes 21/21 | 0 best · 5 within 10 % passes 20/20 | 0 best · 1 within 10 % passes 20/20 | 5 best · 16 within 10 % passes 20/20 |
| P4 | 1 best · 2 within 10 % passes 21/21 | 0 best · 1 within 10 % passes 20/20 | 0 best · 1 within 10 % passes 20/20 | 1 best · 9 within 10 % passes 20/20 |
| P4s | 0 best · 9 within 10 % passes 21/21 | 3 best · 13 within 10 % passes 20/20 | 0 best · 1 within 10 % passes 20/20 | 0 best · 1 within 10 % passes 20/20 |
| P5 | 0 best · 1 within 10 % passes 21/21 | 0 best · 1 within 10 % passes 20/20 | 0 best · 3 within 10 % passes 20/20 | 1 best · 4 within 10 % passes 16/20 |
| P5s | 5 best · 11 within 10 % passes 21/21 | 3 best · 5 within 10 % passes 20/20 | 0 best · 4 within 10 % passes 20/20 | 0 best · 1 within 10 % passes 16/20 |
| P6 | 0 best · 1 within 10 % passes 21/21 | 0 best · 1 within 10 % passes 20/20 | 0 best · 1 within 10 % passes 20/20 | 1 best · 3 within 10 % passes 20/20 |
| P6s | 4 best · 9 within 10 % passes 21/21 | 7 best · 9 within 10 % passes 20/20 | 1 best · 1 within 10 % passes 20/20 | 1 best · 2 within 10 % passes 20/20 |
| P7 | 1 best · 4 within 10 % passes 18/21 | 0 best · 1 within 10 % passes 17/20 | 7 best · 14 within 10 % passes 20/20 | 1 best · 3 within 10 % passes 20/20 |
| P7s | 10 best · 12 within 10 % passes 21/21 | 8 best · 18 within 10 % passes 20/20 | 7 best · 15 within 10 % passes 20/20 | 1 best · 3 within 10 % passes 20/20 |
| P8 | 0 best · 3 within 10 % passes 18/21 | 2 best · 4 within 10 % passes 19/20 | 4 best · 5 within 10 % passes 18/20 | 0 best · 8 within 10 % passes 20/20 |
| P9 | 1 best · 1 within 10 % passes 12/21 | 0 best · 0 within 10 % passes 12/20 | 6 best · 9 within 10 % passes 14/20 | 9 best · 17 within 10 % passes 20/20 |
| P10 | 0 best · 0 within 10 % passes 4/21 | 0 best · 2 within 10 % passes 10/20 | 0 best · 0 within 10 % passes 0/20 | 3 best · 10 within 10 % passes 20/20 |
Across every scenario and objective an arm was graded on: how often each config was the best, or within 10 % of it, and how many scenarios it passed every gate in.
Bus timing: the datasheet, a calibration, and a drift alarm
The nominal delay comes from the adapter's and driver's datasheets. One run with no lookahead measures each joint's real delay; a live monitor then watches it and raises an alert when a joint drifts by more than 2 ms. On a slow joint the motor's own friction lag reads as delay, so a calibration reports two numbers: the bus delay (what's compared with the datasheet) and the best lookahead (what the controller uses).
| arm (50 Hz) | datasheet delay (ms, per joint) | calibrated bus delay | best lookahead |
|---|---|---|---|
| Planar twin (2 joints) | 1.25/2.5 | 1.25/2.5 | 2/3.25 |
| UR5e (6 joints) | 1.25/2.5/3.75/5/6.25/7.5 | 1.25/2.5/4.5/8.75/10.75/8 | 2.5/3.25/6.25/11.5/14/8 |
| BAM five-bar arm (6 joints) | 1.25/2.5/3.75/5/6.25/7.5 | 1.75/9.75/11.25/5/6.5/7.75 | 3.25/11.75/15/6/8/9 |
| 1-DOF pendulum | 1.25 | 19.75 | 25 |
Collision detection
| time to notice a hard stop | P1 no FF | P2 | P2s | P4 | P4s | P9 host CTC |
|---|---|---|---|---|---|---|
| Planar twin (2 joints) | 4.25 ms margin 10.4 | 3 ms margin 20.3 | 2.25 ms margin 33.7 | 3 ms margin 19.5 | 2.25 ms margin 33.4 | 21.8 ms margin 4.55 |
| UR5e (6 joints) | 5.25 ms margin 9.56 | 2.75 ms margin 36.6 | 2.25 ms margin 69.3 | 3 ms margin 36.2 | 2.25 ms margin 64.7 | 7.25 ms margin 20.4 |
| BAM five-bar arm (6 joints) | 153 ms margin 1.29 | 2 ms margin 6.97 | 2 ms margin 7.11 | 2 ms margin 6.92 | 2 ms margin 7.08 | 146 ms margin 2.06 |
| 1-DOF pendulum | 5 ms margin 12.0 | 3 ms margin 37.5 | 3 ms margin 39.0 | 3 ms margin 37.5 | 3 ms margin 39.0 | 17.0 ms margin 37.9 |
The detector is the feedback torque over the driver's cap, low-passed, against 1.25× its own peak in the same run without the stop. Margin = how far over that threshold the hit goes.
Real validation
The first real run is in the ledger, scored by the same metrics as the twin. Every other number on this page is simulation; more real runs go through the rigs' owners and land here.
| arm | what ran | real (tool p95 · joint p95) | its twin config at the base conditions |
|---|---|---|---|
| BAM five-bar arm (6 joints) | P5 (model + Coulomb at plan time, board PD) with a flat 5.5 ms lookahead, at speed 0.5, 58.8 Hz | 5.62 mm · 0.664° | P5: 4.79 mm · 0.421° |
The twin's base has a model 10 % off and the datasheet bus; the real run had its own identified model and the rig's bus, so read this as the same order, not a match.
Related work and references
Compliant and impedance controller stacks
- CRISP controllers · repo · paper
Torque-based Cartesian impedance and operational-space controllers for ros2_control, with Python and Gymnasium layers, built to track learned policies and teleoperation. - ros2_impedance_controller
Cartesian impedance on ros2_control + Pinocchio: Hogan's law with optional inertia shaping, a PD version, an MPC version in development. - FZI cartesian_controllers
Cartesian motion, force and compliance controllers for ros2_control (Humble, Iron, Jazzy), on joint position or velocity interfaces. - franka_ros2 Cartesian impedance example · libfranka
Franka's reference Cartesian impedance controller for the FR3 (jazzy branch). - MoveIt Pro admittance (JTAC) · velocity/force control · MoveIt Servo
MoveIt's compliance lives in MoveIt Pro: a joint-trajectory admittance controller and a hybrid velocity/force controller. MoveIt itself has no impedance controller; MoveIt Servo streams real-time targets.
The ros2_control ecosystem
- joint_trajectory_controller
The reference JTC: interpolates joint waypoints; robot_controllers' JTC follows its time-driven sampling and hold-at-end semantics. - JTC PR #1306: sample at t + dT
Since Nov 2024 the JTC samples its command one control period ahead: the same idea as lookahead, for one period. - admittance_controller
Chainable admittance from a tool F/T sensor; the JTC can feed it. - Controller chaining
Cascaded controllers run in one cycle; our layout adds where each link of the chain physically runs.
Drivers and timing
- moteus control modes
Position, velocity and torque modes; mjbots advises putting as much of the law as possible in the drive's position controller. - moteus theory of operation
The drive integrates its setpoint at the commanded velocity between frames: why the secant velocity matters. - Beckhoff TwinCAT: Dead time compensation
Drive and encoder dead-time compensation in the motion stack. - Tomizuka 1987, ZPETC
Using future reference samples to cancel tracking lag; lookahead is its pure-delay case. - Smith 1957, the Smith predictor
Delay inside a feedback loop needs prediction (Chem. Eng. Prog. 53(5):217; explainer link).
Collision detection
- De Luca et al. 2006, collision detection on the DLR-III arm
The momentum-observer residual for collision detection and reaction. - Haddadin, De Luca, Albu-Schäffer 2017, Robot Collisions survey
Detection, isolation and identification of collisions.
Impedance classics
- Hogan 1985, Impedance Control
Control the relationship between motion and force. - Ott 2008, Cartesian Impedance Control
Redundant and flexible-joint robots. - Salisbury 1980, Active stiffness control
A Cartesian spring from joint servos: K_q = JᵀKJ.
Closest benchmarks
- Port-Hamiltonian impedance control benchmarking (ICAR 2025)
Passivity and fidelity metrics for grading impedance controllers. - Aljalbout et al. 2024, the role of the action space
13 control spaces, 250+ agents, sim to real. - safe-control-gym
PID, LQR, MPC and RL under disturbances (cart-pole, quadrotor).
Links checked on 2026-11-20 (pages opened; paywalled DOIs checked through Crossref).