Skip to content
Physical AI
All experiments

Timing lab: sensor latency, CAN timing groups and actuator delay

Observation delay, timing skew between CAN timing groups, jitter and actuator delay on one timeline: how old each part of the policy's observation is, and when its command actually takes effect.

Loading simulation…

What it demonstrates

Observation delay, timing skew between CAN timing groups, jitter and actuator delay on one timeline: how old each part of the policy's observation is, and when its command actually takes effect.

How it works

A joint swings at 2 Hz. At each 50 Hz policy step the observation for each of three CAN timing groups is the joint angle at an earlier time: the read time minus a common latency, minus the group index times a skew, minus a uniform random jitter. The policy in this demo simply commands the angle it observes for group 1.

The command is applied on the first 5 ms physics step at or after the read time plus the actuator delay, then held. The timeline shows the last policy step; the chart shows the true angle, what the policy saw for groups 1 and 3, and the command in effect.

Adjustable parameters

  • Sensor + bus latency (0–20 ms)
  • Skew between groups (0–5 ms)
  • Jitter (0–5 ms)
  • Actuator delay (0–20 ms)
  • Playback speed

Known limitations

  • Menlo documents CAN timing groups 1–3 but not their membership or timing; the 4/4/4 split and every delay value here are illustrative.
  • Observations are taken from a continuous signal; a real IO path samples at discrete instants.

Equations

tgsample=tread−L−g σ−J u,u∼U(0,1), g∈{0,1,2}t^{sample}_g = t_{read} - L - g\,\sigma - J\,u,\quad u \sim \mathcal{U}(0,1),\ g \in \{0,1,2\}
q^g=q(tgsample),skew=max⁡gtgsample−min⁡gtgsample\hat q_g = q\big(t^{sample}_g\big),\qquad \text{skew} = \max_g t^{sample}_g - \min_g t^{sample}_g
kapply=⌈(tread+dact)/Δtphys⌉k_{apply} = \left\lceil (t_{read} + d_{act}) / \Delta t_{phys} \right\rceil

Core update rule

if (runsOnStep(k, 50)) {
  const obs = [0, 1, 2].map((g) => q(t - latency - g * skew - jitter * rng()));
  pending.push({ step: Math.ceil((t + actDelay) / 0.005), u: obs[0] });
}
while (pending[0]?.step <= k) applied = pending.shift().u;

Explained in Chapter 6: Asimov Simulation