1 kHz Safety Shielding for 7-DoF Arms: 65.2 µs C99 CBF-QP and C² Action-Chunk Takeover
Profiling a single-threaded FP64 C99 Control Barrier Function QP (0 deadline misses across 3,200 1-kHz ticks on i5-12400F) and cutting 10 Hz action-chunk transition jerk by 184× via quintic C² stitching.
Bridging 10 Hz Neural Action Chunks to a 1 kHz Joint Servo
Connecting a 10 Hz visuomotor diffusion or flow policy to a 1 kHz (1 ms cycle) 7-DoF torque/position servo exposes two low-level hazards:
- Whole-arm link collisions: elbow links sweeping near fixtures must be deflected inside the
1 msservo budget using nullspace redundancy; - Chunk-boundary jerk spikes: asynchronously switching to a newly arrived 16-step action chunk every
100 mscreates velocity and acceleration steps that excite structural resonance.
We implemented both layers in standalone FP64 screw kinematics and prepared C99 kernels, benchmarking each independently on an Intel Core i5-12400F (single-threaded FP64).
65.2 µs Velocity-Level Capsule CBF-QP
Modeling arm links and scene pillars as swept capsules with exact surface clearance , the velocity-level IK QP enforces first-order Control Barrier Function constraints alongside joint position and velocity bounds:
- Nullspace self-motion: locking the 6-DoF end-effector flange while pushing the elbow away from a nearby post displaced the elbow by 85.1 mm with only 0.01045 mm max flange drift;
- Two-pillar S-curve traversal (801 ticks): unconstrained damped least squares (DLS) violated the
14 mmsafety buffer on285ticks, whereasCBF-QPheld exact 14.00 mm minimum clearance throughout (7.33 mmmax flange tracking relaxation at the tightest pinch); - Single-step CPU wall time (including full PoE forward kinematics, all capsule-pair distance gradients, and active-set QP solve):
Benchmark Cohort (i5-12400F · 1T FP64 C99) |
Sample Count | Median / P99 Latency | Ticks |
|---|---|---|---|
| Shuffled paired state sweep | 192 states × 4 passes = 768 calls | 65.2 µs / 194.4 µs | 0 |
| Continuous 1 kHz closed-loop rollout | 3,200 consecutive ticks (3.2 s) |
P99 166.6 µs (max 672.3 µs) |
0 |
(For comparison, assembling matrices in Python per step yielded a 2,179.1 µs P99—pre-binding scene geometry in C99 compressed tail latency by over 10×.)
Quintic Chunk Takeover: Cutting Peak Jerk from 8,204 to 44.5 rad/s³
When a new 10 Hz action chunk arrives asynchronously, our stitcher matches the outgoing trajectory’s exact position, velocity, and acceleration at the scheduled takeover tick :
while dilating horizon duration as needed to respect a 72 rad/s³ command jerk budget (discarding stale late packets). Across a 4-second, 40-replan bounded PD+feedforward servo replay (measuring realized plant jerk via 1 ms backward differences of joint acceleration):
- Naive chunk switching: 8,203.64 rad/s³ peak jerk (
47.2%of ticks exceeding80 rad/s³); - Quintic takeover: 44.50 rad/s³ peak jerk (184× reduction, 0% of ticks above
80 rad/s³), trading25.30 mmRMS deviation against the discontinuous raw policy targets.
Measured datasets: 768-call paired timing log · 3,200-tick 1 kHz trace · Two-pillar avoidance summary · Nullspace elbow self-motion · takeover replay metrics