Failure analysis for robot manipulation
Every robot failure, caught, explained and fixed.
Amperes Failure Lab records every attempt your robot makes, labels each failure, traces it to a root cause and verifies the fix by replay, with the data kept on your own machine.
Proved on real hardware: a UFactory xArm6 that plays chess, where every move is a trial the lab can triage.
In the lab so far
Real xArm6 chess trials since the first chess game on 29 Oct, counted from the lab's own store at 2:39 PM on 30 Oct.
How it works
What the lab does
Point it at a robot cell. Every attempt becomes an episode with its evidence, and every failure gets a name, a cause and a fix you can check.
Record
Every attempt: camera images, depth, poses, the gripper reading and the outcome.
Label
Each failure gets a name: missed grasp, slip, collision stop, unsafe motion refused.
Triage
Recurring failures are grouped into incidents and traced to a root cause.
Verify
Replay and regression cases show whether a fix helped and what it broke.
Export
Clean, labelled datasets in LeRobot format, plus incident and readiness reports in Markdown and JSON.
One console, eleven views
Robot labLive robotLabelOverviewEpisodesQualityIncidentsOperationsReplay & regressionEvaluationExportLocal-first. Episodes, findings and incidents live in a SQLite store under amperes_data/ on your own machine. Only two things send data out: opt‑in MongoDB Atlas sync, and Claude piece recognition in the chess robot, which sends camera photos to Anthropic's API and runs only when an ANTHROPIC_API_KEY is set.
Fleet memory on MongoDB Atlas
Find the same failure in other sessions
Opt‑in, with MONGODB_URI set. Sync sends episode index rows, quality findings, incidents, events and one failure-signature vector per episode. No raw streams leave the machine. Similar failures are then found with Atlas Vector Search.
All 39 robot sessions are synced. A missed grasp from a chess game on 30 Oct (ep_3a3941af689d14f7) matched 6 missed grasps with identical recorded evidence in other sessions, one of them from the evening before.
# opt-in: needs MONGODB_URI
python -m amperes.cli atlas sync <dataset_id>
python -m amperes.cli atlas similar <episode_id> -k 6
A signature is a deterministic vector built from recorded evidence: the quality rules that fired, the quality status, the event classes and the failure category. There is no learned embedding. In the console, the same actions are the Sync to MongoDB Atlas and …across all stations (Atlas Vector Search) buttons, shown only when Atlas is configured.
Proof
The proof: a robot that plays chess
Chess is a hard, honest test for a pick-and-place robot. If the lab can debug that in two days, it can debug your pick-and-place cell.
Small objects in six different shapes, crowded together.
Every piece has to land in the middle of its square.
A person reaches into the workspace, right next to the arm.
The rules of chess and the wrist camera check every move; the tripod camera records it.


What the chess robot does
- Sets up the board from a messy table: it identifies the upright pieces and puts each one on its start square.
- Plays a person. The wrist camera sees your move, or you type it, and the arm answers.
- Plays both sides by itself: robot against robot, with the arm making every move.
- Calls every move out loud in plain words, with squares in capitals: White knight to F3, check.
- Never records a move that did not happen. The gripper reading and the camera must both confirm it; a missed grip is retried at once.
- Stops for hands under the gripper and waits until they are gone; after 20 s it stops the session.
- Resets the board after the game. It tracks every piece, uses slots beside the board and keeps spare queens in reserve for promotion.
The rig
- Arm
- UFactory xArm6 with a G2 gripper, on the Viam machine sfhack1
- Cameras
- Intel RealSense on the wrist, a second RealSense on a tripod
- Motion
- Viam motion service with the table and obstacles modelled
- Moves
- Stockfish picks the robot's move
- Pieces
- Claude vision names each piece, cross-checked against its depth-measured height
Measured
| Robot moves confirmed by the camera, game 1 (29 Oct) | 10 of 10 |
| Pick-and-places in a row after the camera fix (30 Oct) | 14 of 14 |
| Simulated board resets of all 34 pieces, zero gripper contact | 600 of 600 |
| Workspace scan, max error over 186 commanded poses | 0.34 mm |
Failures fixed
Seven failures, traced and fixed
Every chess move is recorded as a trial. These are the failures found while building and running the chess robot over two days, what caused them and what changed.
Retried grips pressed pieces into the board
Moves recorded that never happened
Collision stops on long, fast swings
Board reset going in circles
A typed move was ignored
Pieces mislabelled: a rook read as a pawn, a bishop misread
Demo
See it run
Both consoles run locally at localhost:8765. Play a game in the chess console; when it ends, End game + import brings every move into the Failure Lab as a trial, next to everything else the arm did.
Each screenshot opens at full size.
Rehearsal, 30 Oct, 2:33 PM
Robot against robot on the real arm, from a mid-game position.
6 of 6half-moves confirmed by the wrist camera and called out loud
9 of 9pick-and-places succeeded, 0 failures
Calls included Black knight takes D4. White knight takes D4. Black pawn takes D4. White queen to B4. Black queen to F6. and, at the end, Game over: stopped after 6 half-moves.
Run it
# Python 3.12 git clone \ https://github.com/vnmoorthy/amperes-haunted-chess \ failure-lab cd failure-lab python3.12 -m venv .venv .venv/bin/pip install -r requirements.txt cp .env.example .env # your Viam machine keys .venv/bin/python -m amperes.cli serve --port 8765
Then
- Open
http://localhost:8765/for the Failure Lab and/chessfor the chess robot. - To bring a game into the lab, press End game + import only when the phase reads your move or game over. Ending a game while the arm is moving stops it mid-move.
- No robot?
python -m amperes.integrations.chess_simreplays the reset planner offline, and.venv/bin/python -m pytest -qruns the 132 tests. - Giving the talk? Follow the 3-minute storyboard.
Safety
Built to work next to people
A person plays from the other side of the board, so the guard rails are in code, not in a checklist.
Hand guard
Before every descent the wrist depth camera looks under the gripper. Anything more than 110 mm above the board makes the arm hold still; if it is still there after 20 s, the session stops.
Safety envelope
Every target is checked against a box around the board with clearance margins, and no move may turn the gripper more than 100 degrees.
Slow near the pieces
Transit runs at 75 deg/s; the last 60 mm above the board run at 10 deg/s.
Telemetry watchdog
A separate connection watches the arm while it moves. If telemetry stops, the arm stops.
Operator acknowledgement
Dry run by default. The arm moves only after the operator confirms the e-stop is in reach, and STOP works mid-move.
Recorded, not hidden
Refused motions and safety stops are recorded in the lab with the evidence attached. Safety stops are marked invalid and kept out of training data.
Built to reuse
Bring your own robot
Chess was the test. Nothing in the lab is specific to it.
Any Viam arm, gripper and camera
Components are chosen by name: AMPERES_ARM, AMPERES_GRIPPER, AMPERES_MOTION, AMPERES_CAMERAS.
Any recorded session
The lab ingests recorded Viam sessions through a read-only recorder, along with JSONL, CSV and LeRobot datasets.
Clean datasets out
LeRobot export, incident and readiness reports in Markdown and JSON, and opt‑in MongoDB Atlas sync.
Pick-and-place modules
Multi-view survey with a fitted camera correction, a clearance-aware reset planner and a supervised Viam session you can lift as they are.
Tested
132 automated tests, and an offline simulator that replays reset plans and counts gripper contacts.
Runs on your machine
The lab's API, console and SQLite store run locally, next to the robot. Data leaves only through opt‑in Atlas sync and Claude piece recognition.
Honest limitations
- It cannot stand a fallen piece back up; a top-down parallel gripper can't.
- Telling pieces apart from straight above needs the height check and, now and then, an operator's correction.
- Speed is capped by the arm's own collision detection.
- Arm errors are cleared by hand; nothing in the lab clears them automatically.





