Skip to main content
Calibrates friction (tune.friction) and gravity (tune.gravity) for all 14 joints, both arms times seven, in one command. You can also run it from the diagnostics dashboard (axol serve). For a step-by-step walkthrough, see Calibrating Axol. Each joint sweeps back and forth at several speeds. From one sweep the tool fits both the joint’s friction and the center of mass of the link it moves.
  • Time: about 6 minutes per joint, about 1.5 hours for both arms.
  • Order: each arm runs from wrist_3 to shoulder_1. Each joint’s fit is saved before the next joint sweeps, so the shoulder fits use the corrected wrist and elbow values.
  • Poses: the clearance and gravity-load poses are the same as in tune.friction and tune.gravity.
The default slow profile calibrates friction for slow, smooth motion. On shoulder_1, shoulder_2 and elbow, a slow-profile calibration also switches the joint to stiffer slow-motion gains. A joint without one keeps the standard gains.

Where the results go

The results are saved to ~/.almond/calibration.json, and this computer uses them right away. They are also uploaded under the serial number of Axol’s hub, which stays with the arms when you swap the computer. The upload needs a write key in .env:
Without a key, the run calibrates this computer only and tells you so. Downloading needs no key. The upload merges with what is already stored, joint by joint:
  • A one-arm run keeps the other arm’s values.
  • A joint whose gravity fit is rejected keeps its earlier com and mass.
  • An interrupted run keeps and uploads every joint that finished.

Custom end-effectors

The gravity fit keeps each link’s mass fixed and fits only its center of mass. A gripper much heavier or longer than stock can push the fit past its 60 mm limit, so the fit is rejected. Give the gripper’s mass up front instead. The gripper counts as part of the wrist_3 link, so --mass wrist_3=<kg> sets it. --com optionally sets a starting center of mass, in metres, in that arm’s URDF link frame. Both values are written to ~/.almond/calibration.json before the sweeps, so every fit uses them. They are uploaded with the calibration even if a fit fails. To go back to a standard gripper, pass the stock mass (--mass wrist_3=0.75) and calibrate again.
  • A --mass without a side applies to every arm being calibrated.
  • --com must name its side (left. or right.), because the arms are mirror images.
  • An arm that isn’t being calibrated, an unknown joint, or a mass of zero or less is an error, reported before anything moves.

Keeping a hand-tuned gravity model

If you set link masses or centers of mass by hand in the control panel (Settings → Advanced → Axol), run with --keep-gravity. The run then fits friction against your settings and doesn’t fit or save any mass or center of mass. --mass and --com still take priority over the settings. Without the flag, the run warns at start when your settings override a link’s mass or center of mass.
The saved calibration holds friction, mass (kg) and com for each joint:
The calibration tools (tune.factory, tune.friction, tune.gravity, tune.breakaway) move the arm under impedance control at fixed calibration gains, with gravity fed forward. They never use the motors’ firmware position loops or the production gains. Every joint is held before anything moves.

calibration.push

Uploads this computer’s calibration file (~/.almond/calibration.json) under the hub serial. It merges joint by joint with what is already stored. Use it after you calibrate joints one at a time with tune.friction, tune.gravity or tune.pid, so you don’t have to run tune.factory. It needs the same write key. --dry-run shows what would be uploaded and needs no key.

calibration.pull

Downloads a robot’s uploaded calibration into ~/.almond/factory_calibration.json. This includes friction, link masses and centers of mass, so a custom gripper’s weight comes along. It needs no key. can.setup runs it at the end, so a new computer gets its robot’s calibration during setup. Run it by hand to refresh:
When a value is set in more than one place, this order applies, from lowest to highest priority:
  1. The built-in defaults.
  2. The downloaded calibration.
  3. The calibration file on this computer, ~/.almond/calibration.json.
Anything you save locally afterwards with tune.friction --save, tune.pid --save or tune.gravity --save overrides the downloaded values.