Theme
Tier 5 · lesson 5 of 9 · 35 min

Find zero, and which way is positive

You will: Measure each joint's zero and direction on an assembled arm, and change them from assumed to measured.

Builds on Where safety actually lives.

A servo reports counts, 0 to 4095 for one turn. A joint is described in radians, from a zero the URDF defines. Between the two sit two facts about one particular assembled arm: the count a servo reads when its joint is at zero, which depends on which tooth the horn went on, and whether the servo turns the same way as the joint's axis, which depends on which way round it was mounted.

Neither can be known before there is an arm. So the profile carries them now as what a perfectly centred arm would have, 2048 and +1 for every joint, and labels all twelve numbers assumed. That label is the point. A wrong direction does not fail a test; it drives a joint the wrong way, at full speed, the first time anything moves.

So calibration is a procedure with a test at each end. Before: the arm, powered off, can reach both of each joint's limits by hand, or the fault is mechanical and no number will fix it. During: the arm is held in the URDF's zero pose — upper arm vertical, forearm and gripper level, the picture make view shows with every slider at zero — and each servo's count is read. After: the first motion is small and slow, and a joint that moves the wrong way is fixed in the profile, never in code.

The numbers then change from assumed to measured, and stay measured. Re-seating one horn by a tooth changes one of them by 4096 / the number of teeth, which is why it is a profile value rather than a constant.

Planned: the steps on the SO-101 are not written yet. Waits on the physical arm: the procedure is the second recorded session. What can be rehearsed now, make view at zero and the profile's calibration block, is in the tests already.

In the simulation

Rehearse the two numbers before there is an arm. Home is the zero pose, where a perfectly centred servo reads 2048; the frames' arrows show which way each joint's axis calls positive, and with direction +1 a positive angle must raise the count.

Kinematic: joints move at their real speed limit, but there is no gravity, no load and no physics.

The SO-101 loads as you reach it.

In this lesson

  1. Press f to show the frames, and select shoulder_pan. Its arrow is the direction the profile's +1 assumes.
  2. Open Inspect, then servo bus. Predict which way the gripper swings for a positive pan, then turn shoulder_pan positive until the tool is 10 cm to one side.
  3. Home the arm with h. This is the pose you would hold the real arm in while reading each servo's count.

Terms

Calibration
The per-arm numbers that map what a sensor reports onto what the description means. For each servo here, a zero count and a direction.
Zero pose
The pose in which every joint is at zero in the description. For the SO-101: upper arm vertical, forearm and gripper level, pointing forward.