Why calibrate (and what zero means)

Calibration teaches each arm where its joints start and stop. Afterwards 0 is the middle of the range you recorded, and both arms agree.

A motor only knows a raw number between 0 and 4095 for one full turn. It does not know what 'straight' means on your arm. Two arms built a little differently give two different raw numbers for the same pose.

Calibration fixes that. For every joint, the arm records the lowest and the highest position it can reach. Then:

  • 0 is the middle of the range you recorded. It is not 'the arm looks straight'.
  • In degrees: a joint reads (raw reading minus the halfway point of the range) times 360 divided by 4095. The halfway point reads 0, one end reads a negative number, the other end a positive number.
  • In the -100 to +100 scale LeRobot uses: the lowest point is -100, the middle is 0 and the highest point is +100. The gripper is different: it runs from 0 to 100.

The wrist roll can spin around freely, so it is calibrated as a full turn and you do not sweep it from end to end. All the other joints you move through their full range, from one end stop to the other.

Two things go wrong most often. First, moving a joint only part of the way: the middle then ends up in the wrong place. Second, thinking that 0 means 'looks straight': it means the middle of what you recorded.

The result is saved as a file, the same file LeRobot uses: ~/.cache/huggingface/lerobot/calibration/robots/so_follower/YOUR-NAME.json for the follower and .../teleoperators/so_leader/YOUR-NAME.json for the leader.

Here is how to calibrate one arm in the app:

  1. Plug in the arm's USB cable and power supply, then open the Calibrate page and choose that arm.
  2. Read the picture of the middle pose on the page: every joint about halfway through its travel.
  3. Read the first line of the card the page shows: it must say The arm is limp. If the follower arm is stiff (holding itself), do not touch it: press Lower the arm and make it limp and keep your hands clear until it says limp. The arm lowers itself onto the table first, so nothing drops. (The leader arm is always limp.)
  4. Only now, with the arm limp, take it in your hands and move each joint until it looks like the picture, then press the button that says the arm is centred (It's centred) with your free hand.
  5. Move ONE joint from one end stop all the way to the other end stop, and back again. Go as slowly as lowering a cup onto a saucer.
  6. Look at that joint's bar on the page. You will see its minimum and maximum markers move outward from the middle, and a tick appears when the span is big enough.
  7. Do steps 5 and 6 for each joint in turn, except the wrist roll. Leave the wrist roll alone.
  8. Press the button that saves the calibration (Save). The page shows the file path it saved to.
See it in the app

This article is also inside the app, next to the 3D arm. Open it in the live demo.