Re-zero SO-101 cell BC2-2182 after 2 servo swaps with an untouched mount: recover zero offsets and gear play from a powered touch-off log on a jig plate in two placements, the session notes and 4 wrist stills
harbor run -t reactive-labs/rezero-bc2-2182harbor download reactive-labs/rezero-bc2-2182BC2-2182 came back from the repair bench with two servos replaced (elbow_flex and wrist_roll). The zero offsets of the replaced servos are lost. The arm stayed on its mount; the mount pose in the old unit file still holds. Before the cell goes back to production, its unit file has to match the arm again, so that jobs planned in simulation land where they should.
The cell, the simulator and the unit file format are described in /app/CELL_SHEET.md. What is known from the unit file before the repair:
| servo | zero offset (rad) |
|---|---|
shoulder_pan (not replaced) |
-0.00202 |
shoulder_lift (not replaced) |
+0.02779 |
wrist_flex (not replaced) |
+0.01313 |
base): [-0.00028, 0.00108, 0.0, 0.00183].The technician's records are in /app/data/:
touchoff.csv: 12 touch-off records on jig plate JP-1 (220 x 180 x 6 mm, 5 x 4 divots on a 40 mm grid). The plate was used in two placements, given in the plate column: A with its centre at (0.200, 0.000) m turned +0.000 rad about +z, and B at (0.193, -0.032) m turned -0.154 rad. In plate coordinates (origin at the plate centre, x along its 220 mm side) divot Dij is at x = -0.080 + 0.040 i, y = -0.060 + 0.040 j (m); a seated tip (site gripperframe) sits 1.0 mm below the plate top, at z = 0.0050 m. With the servos powered, the technician jogged the arm from the pendant until the tip seated in the divot, then saved a record: goal_* (the goal position the pendant last wrote to each servo), all in the reading frame. last_jog gives the direction of the last jog of each arm joint, shoulder_pan to wrist_roll: + means the joint's last move was towards higher readings. The technician typed the divot labels by hand. On this jig a seated tip repeats to about 0.25 mm (one standard deviation along each axis).session_log.txt: the technician's notes from the session.wrist/: 4 wrist-camera stills (320 x 240) looking at the plate in its last placement (the plate column), with the present positions logged when each still was taken (wrist/readings.csv). The divots are the dark dots; the magenta square marks the plate's (+x, +y) corner.Write the unit file to /app/out/unit.json:
{"joint_offset": [pan, lift, elbow, wrist_flex, wrist_roll, 0.0],
"base": [x, y, 0.0, yaw],
"backlash": [pan, lift, elbow, wrist_flex, wrist_roll, 0.0]}
Units are radians and metres, with the meanings and conventions of the cell sheet (reading = true angle + offset; backlash is the gear play of each joint, 0 for a joint without play). A key left out takes its drawing value, and other keys are ignored. The wrist_roll servo is new and its gear play was measured on the bench as nil, so its backlash is 0.
The file is checked in two ways against what this unit actually does:
Four measures, each a mean over its set: readings position error (full marks at 1.25 mm or less, zero at 4.0 mm), readings orientation error (full at 0.4 deg, zero at 1.2 deg), goals position error (full at 1.25 mm, zero at 4.0 mm) and goals orientation error (full at 0.4 deg, zero at 1.2 deg). Each scores 1 at full marks and 0 at its zero value, linear in between. The reward is the mean of the four.