Skip to main content
These commands measure how a joint follows its command at different frequencies, and use that to make a known motion track better. The workflow has four steps:
  1. motion.chirp builds a sine sweep for one joint.
  2. tune.motion replays it on the robot.
  3. tune.tf fits a tracking model to the replay.
  4. tune.motion --invert replays a motion through the inverse of that model, which cancels the joint’s lag and resonance.
The fitted model is H(s) = K (1 + s/ωz) ωn² / (s² + 2ζωn s + ωn²) · e^(−sτ) with a natural frequency ωn, damping ζ, an optional zero ωz and a delay τ. For slow motion, most of the shake comes from friction, not from the tracking response. Calibrate friction first with tune.friction --profile slow. The tracking model matters more for faster motion.

1. Build the sweep: motion.chirp

The command refuses a sweep that would leave the joint’s range.

2. Replay it: tune.motion

Use the same --gain and --fast-impedance settings you will run the motion with. The model is only valid for those settings.

3. Fit: tune.tf

The command prints:
  • the response at a few frequencies, and the fitted model
  • a warning if the joint is lightly damped, with how much it amplifies a command at its resonance
  • a warning if the fitted resonance lies above the band the data covers
  • if the run recorded the wrist IMU, how closely the wrist’s vertical motion follows the command in each band. Where it drops, something the joint encoder can’t see is moving the tool.

4. Use it: tune.motion --invert

--invert pre-compensates every modelled joint that moves and isn’t held. The correction boosts no frequency more than 3 times, fades out above the measured band, and ramps in and out over 0.5 s, so the motion still starts and ends where it should. The run is scored against the original motion.
  • If a joint’s saved gains differ from the run’s, the tool warns.
  • If a joint’s model has a resonance outside the measured band, the tool skips that joint.