Identify the soft servo tuning, bus latency and tool-mass sag of an SO-101 cell from bench logs, then ship a policy that draws open layout lines with a marking pen at high feed, robust to job-to-job drift
harbor run -t reactive-labs/layout-marking-bc2-2438harbor download reactive-labs/layout-marking-bc2-2438BC2-2438 is being set up as a layout station for the sheet-metal cell. The marking pen MP-2 in spring holder PH-1 is now clamped in the jaws, and the cell must draw layout lines (bend lines, trim lines, weld seams) on sheet-metal blanks: the pen tip runs on the part face (the spring holder takes up the touch) along a path at a set feed speed while the pen marks the blank. The cell still runs press-fitting on the other shift, so the servos keep the SOFT-2 compliance profile that press-fitting needs, and they will not be re-tuned. The program written from the drawing values does not work on this unit. Build a policy that does.
The cell, the simulator, the unit file format and the policy contract are described in /app/CELL_SHEET.md. The simulator is built to the drawing values. On this unit:
/app/data/unit_BC2-2438.json.kp, kv) and the joint friction (frictionloss) of the arm servos differ from the drawing, and the line's bus adapter may buffer commands (latency_steps). Joint damping, armature and force_limit are at their drawing values.payload_mass = 0.045 in the simulator). Its mass does not change on the line.kp of the arm servos by up to +-16 % (one factor for all of them), and the line's bus adapter drops up to 2 % of the commands (latency_jitter 0 to 0.02). The bench runs below were made over about an hour while the servos warmed up, so they show some of this too.The records from the bench session are in /app/data/:
runs.csv and logs/: 6 runs logged at 30 Hz. Runs R01 to R06 move one joint through a step program or a stepped sine from a test pose while the other joints hold; all of them were made with MP-2 fitted. Each run starts from rest at its first goal. The log header explains the columns: the goal written to every servo at each tick and the position read back at the end of that tick, both in encoder counts.bench_notebook.txt: the technician's notebook for the session. Check the records against it before you trust them.Save the policy to /app/out/policy/ (policy.py defining class Policy, plus any files it loads), as set out in the cell sheet under "Deployed policies".
How the acceptance run works:
It runs 20 layout line jobs that you do not see, each once, on this unit with MP-2 fitted. Each job runs on the unit as it is that day: friction, gain and dropped commands are drawn for each job from the ranges above. The tray and the target pad are off the table. Each episode starts with the arm holding the readings [0, -1.57, 1.57, 0.75, 1.57, 0] and lasts duration seconds.
Your policy sees only obs["t"] and obs["joints"] (encoder readings). reset(info) receives the job: {"episode": n, "contour": [[x, y], ...], "closed": false, "z": ..., "feed": ..., "t_open": 4.0, "t_close": ..., "duration": ...} in metres, metres per second and seconds. contour is the layout line as an open polyline in the world frame, from its first point to its last (it does not close). Arcs come as runs of short segments; a single vertex is a sharp corner. closed is false. z is the height of the layout line above the table (between 0.008 and 0.016 m), feed the feed speed (between 0.040 and 0.060 m/s). Every path lies inside x 0.195 to 0.295 m and y -0.100 to 0.100 m.
The pen goes down at t_open and lifts at t_close = t_open + (line length) / feed. The program expects the tool point (site gripperframe) at the line point that lies at arc length feed x (t - t_open) from the first point, going in the listed order, at height z. The tool point has to arrive at the first point already moving at the feed and leave the last point at the feed; what it does outside the window is up to you, as long as it stays clear of the table.
At the end of every tick of the process window (t_open <= t <= t_close) the acceptance run takes the tool point and measures, per job:
z). Full marks at or below 0.30 mm, nothing at or above 0.60 mm.Each measure is linear between its two limits. A job scores the lowest of the three. It scores 0 if the policy raised an error or broke a time limit, or if the jaw axis (the x axis of site gripperframe) tilted more than 10 deg from straight down at any tick of the window.
Reward = min(1, mean job score / 0.85).
Policy time: the acceptance run gives the policy 300 s of act() time in total over its 20 episodes, on top of the per-call and per-episode limits in /app/CELL_SHEET.md. Once that is used up, the remaining episodes fail.