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

Plan timetrajectoryfeed-forward model(once per sample) Host loop25–200 Hzsample ahead (lookahead)FF or FB live, if placed here BusCAN-FD, boards in turndatasheet vs measureddelay per joint Driver (board)PD at kHz, 0.5 ms delaywalks the setpoint at thesent velocity between commands A controller = a trajectory + a feed-forward model + a feedback model + a layout: where each runs, how often, and how far ahead. The grade varies the layout (the population) against the conditions it will meet (the scenarios).

What it found

Feedback stays on the driver. At the rig's 50 Hz a driver-closed config beat computed torque on the host on every arm (best Planar twin 1.26 vs 3.13 mm, UR5e 1.65 vs 8.25 mm, BAM five-bar arm 1.5 vs 1.62 mm, 1-DOF pendulum 5.48 vs 5.55 mm). PD on the host saturated the drivers (up to 96.8 % of the time).
Look ahead by the bus delay, and send the secant velocity. The plan is known ahead, so each setpoint is sent early by the time it takes to reach the driver, and the velocity sent is the straight line to the next sample (a moteus walks its setpoint at that velocity between commands). On the UR5e twin that takes the trajectory-forwarding JTC from 6.8 to 1.8 mm at the tool; on the planar twin from 2.78 to 1.36 mm.
Re-send inertia-scaled gains each tick. Re-sending computed-torque gains (diag M(q)·ωn²) with every command, still closed by the driver, was the most accurate on three of four arms: the five-bar goes from 12.1 mm (fixed gains) to 1.5 mm.
Model the friction where it dominates. The five-bar's drives are friction-bound: adding Coulomb friction to the plan-time model takes it from 12.1 to 4.93 mm, where the secant velocity alone did nothing.
A good model notices collisions sooner. With a feed-forward and the feedback on the driver, a hard stop is noticed in 1.25–3.75 ms on every arm; with no feed-forward it takes 4.25–153 ms, and with computed torque on the host 7.25–146 ms. Less torque left for feedback in free motion makes a hit stand out.
Calibrate the delay, but know its limit. One run with no lookahead measures each joint's delay; the friction-aware fit is the one to look ahead by. On a single high-friction joint the joint's own lag swamps the bus (the pendulum reads 19.75 ms on a 1.25 ms bus), so there the datasheet value, or a lookahead sweep on the real arm, is the one to trust.

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 conditionsPlanar 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

configfeed-forwardfeedbacklookahead
P1noneboard PDcalibrated
P2the trajectory's torque columnboard PDnone
P3model, at plan timeboard PDdatasheet
P4model, at plan timeboard PDcalibrated
P5model + friction, at plan timeboard PDcalibrated
P6model, on the host at the measured stateboard PDcalibrated
P7model, at plan timecomputed-torque gains, re-sent each tickcalibrated
P8model, at plan timespring on the host, damper on the boardnone
P9model, on the host at the measured statecomputed torque on the hostnone
P10model, at plan timePD on the hostnone

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

configPlanar twinUR5eBAM five-bar arm1-DOF pendulum
P11 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
P217 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
P2s0 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
P30 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
P3s1 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
P41 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
P4s0 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
P50 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
P5s5 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
P60 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
P6s4 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
P71 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
P7s10 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
P80 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
P91 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
P100 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 delaybest lookahead
Planar twin (2 joints)1.25/2.51.25/2.52/3.25
UR5e (6 joints)1.25/2.5/3.75/5/6.25/7.51.25/2.5/4.5/8.75/10.75/82.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.51.75/9.75/11.25/5/6.5/7.753.25/11.75/15/6/8/9
1-DOF pendulum1.2519.7525

Collision detection

time to notice a hard stopP1 no FFP2P2sP4P4sP9 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 pendulum5 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.

armwhat ranreal (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 Hz5.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

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

Collision detection

Impedance classics

Closest benchmarks

Links checked on 2026-11-20 (pages opened; paywalled DOIs checked through Crossref).