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
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
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.
shipped 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. 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 6names it. - Search and limits: for each joint it drives
searchLimitsfromsrc/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 fromGET /settingsand written withPUT /settingsasjointSpeedDegS/jointAccelDegS2. - Safety: it refuses to start unless
/statusshows nobody driving, no STOP and no E-stop. It re-checks/statusduring every sweep. If any of those appears, it stops andsearchLimitsputs 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
targetsfrombench/limits-sweep.tsandRESEND_MSfromsrc/tuning-sweep.ts. It has its own per-joint driver, becauselimits-sweep.tsonly sweeps every joint in turn. It takes the numbers from the livesessioncard in/precision, so the 10-minute window can't carry earlier sessions into a joint's result. - Fake-bus result:
--joint 2ended 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.tsruns 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.
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:
- 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.
- 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.
I added
bench/limits-search.ts, its test, and a "Faster limits" paragraph inSoftware/so101/README.md. I did not run the wholebun testor a clean type check, and forge.json is untouched.bun x tsc --noEmitfails here with a missingbuntype definition, which comes from this environment. Only the newbench/limits-search.test.tsran (2 pass), plus one real run on the fake bus.bun bench/limits-search.ts <url> [--joint N]runs on that arm server. It skips the gripper unless--joint 6names it.searchLimitsfromsrc/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 fromGET /settingsand written withPUT /settingsasjointSpeedDegS/jointAccelDegS2./statusshows nobody driving, no STOP and no E-stop. It re-checks/statusduring every sweep. If any of those appears, it stops andsearchLimitsputs the starting limits back.targetsfrombench/limits-sweep.tsandRESEND_MSfromsrc/tuning-sweep.ts. It has its own per-joint driver, becauselimits-sweep.tsonly sweeps every joint in turn. It takes the numbers from the livesessioncard in/precision, so the 10-minute window can't carry earlier sessions into a joint's result.--joint 2ended at 360 °/s and 3600 °/s², with p95 error 19.95 → 12.3 and time to arrive 434 → 207 ms.bench/limits-search.test.tsruns 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