Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

bench/limits-search.ts <url> runs the limits search per joint against the fake bus or a given arm server and prints a before/after table (lands once main is green) #538

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

I added bench/limits-search.ts, its test, and a "Faster limits" paragraph in Software/so101/README.md. I did not run the whole bun test or a clean type check, and forge.json is untouched. bun x tsc --noEmit fails here with a missing bun type definition, which comes from this environment.

Notes

shipped merged

opened this

I added bench/limits-search.ts, its test, and a "Faster limits" paragraph in Software/so101/README.md. I did not run the whole bun test or a clean type check, and forge.json is untouched. bun x tsc --noEmit fails here with a missing bun type definition, which comes from this environment. Only the new bench/limits-search.test.ts ran (2 pass), plus one real run on the fake bus.

  • Running it: with no argument it runs on the fake bus. bun bench/limits-search.ts <url> [--joint N] runs on that arm server. It skips the gripper unless --joint 6 names it.
  • Search and limits: for each joint it drives searchLimits from src/limits-search.ts, starting at 90 °/s and 360 °/s². It steps up through five ascending steps (135/600 … 360/3600) and keeps the last step that did not make p95 error or overshoot worse. Limits are read from GET /settings and written with PUT /settings as jointSpeedDegS / jointAccelDegS2.
  • Safety: it refuses to start unless /status shows nobody driving, no STOP and no E-stop. It re-checks /status during every sweep. If any of those appears, it stops and searchLimits puts the starting limits back.
  • Output: it prints the command line, then one markdown table: joint, limits before → after, and p95 error, overshoot and time to arrive before → after.
  • Sweep: it reuses targets from bench/limits-sweep.ts and RESEND_MS from src/tuning-sweep.ts. It has its own per-joint driver, because limits-sweep.ts only sweeps every joint in turn. It takes the numbers from the live session card in /precision, so the 10-minute window can't carry earlier sessions into a joint's result.
  • Fake-bus result: --joint 2 ended at 360 °/s and 3600 °/s², with p95 error 19.95 → 12.3 and time to arrive 434 → 207 ms.
  • Test: bench/limits-search.test.ts runs joint 1 end to end on the fake bus. It checks that a table comes out and that the arm's settings end at the reported "after" limits. A second test checks it refuses to start while someone drives.

Closes #513

commented

I added bench/limits-search.ts, its test, and a "Faster limits" paragraph in Software/so101/README.md. I did not run the whole bun test or a clean type check, and forge.json is untouched. bun x tsc --noEmit fails here with a missing bun type definition, which comes from this environment. Only the new bench/limits-search.test.ts ran (2 pass), plus one real run on the fake bus.

  • Running it: with no argument it runs on the fake bus. bun bench/limits-search.ts <url> [--joint N] runs on that arm server. It skips the gripper unless --joint 6 names it.
  • Search and limits: for each joint it drives searchLimits from src/limits-search.ts, starting at 90 °/s and 360 °/s². It steps up through five ascending steps (135/600 … 360/3600) and keeps the last step that did not make p95 error or overshoot worse. Limits are read from GET /settings and written with PUT /settings as jointSpeedDegS / jointAccelDegS2.
  • Safety: it refuses to start unless /status shows nobody driving, no STOP and no E-stop. It re-checks /status during every sweep. If any of those appears, it stops and searchLimits puts the starting limits back.
  • Output: it prints the command line, then one markdown table: joint, limits before → after, and p95 error, overshoot and time to arrive before → after.
  • Sweep: it reuses targets from bench/limits-sweep.ts and RESEND_MS from src/tuning-sweep.ts. It has its own per-joint driver, because limits-sweep.ts only sweeps every joint in turn. It takes the numbers from the live session card in /precision, so the 10-minute window can't carry earlier sessions into a joint's result.
  • Fake-bus result: --joint 2 ended at 360 °/s and 3600 °/s², with p95 error 19.95 → 12.3 and time to arrive 434 → 207 ms.
  • Test: bench/limits-search.test.ts runs joint 1 end to end on the fake bus. It checks that a table comes out and that the arm's settings end at the reported "after" limits. A second test checks it refuses to start while someone drives.
Approved

Does what the issue asked: a per-joint limits search against the fake bus or a given arm URL, driven by the existing searchLimits, with a before/after table and a README paragraph. It refuses to start while anyone drives or a STOP/E-stop is in force, and it re-checks /status after every target. Limits go through the validated PUT /settings, and searchLimits writes the starting limits back on any throw. No new dependency (ws is already in package.json) and no server change. It is a bench script, so the page, tty and preview checks do not apply.

Two things I would do next:

  1. Test the stop path: make /status report a STOP or E-stop mid-sweep and assert that run() rejects and /settings is back at the starting limits. That is the safety claim of the change and no test covers it.
  2. Validate --joint to 1-6 at the CLI (it currently accepts any integer and fails later with "no joint N"). Also add a test for the no-step-was-better case, where the table falls back to the before row.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs