by John Lauer
Two-board Molecule interferometer with onboard RP2040, USB-C data, 15 V USB-C PD power and a JST stage interface.
c0c5c9b
name: smi-dash description: >- Drive the self-mixing interferometer dashboard (smi-dash): live ADC0/ADC1 fringes from the Raspberry Pi Pico or the built-in simulator, fringe counting with direction, displacement in nm and um, velocity, spectrum, SYNC markers, CSV/HDF5 recording, an accuracy suite against simulated ground truth, and on board 1.3 every board setting: laser enable and current, offsets, gains, monitor bias, auto-centre and tune for fringes, plus the test stage: home, step, stop, a self-test, and Calibrate, where the stage is the moving target and the board calibrates itself. Use when asked to show the interferometer, simulate a moving target, count fringes, record the photodiode channels, set or tune the laser, centre a channel, change a gain, check the detector's error, move or home the stage, run the stage self-test, or calibrate the board.
smi-dash
Start one server per AI thread and reuse it:
smi-dash ls # what is running
smi-dash --ai-thread "<your thread>" start # reuses a live instance for that thread
smi-dash --ai-thread "<your thread>" show
Every verb answers OK:/ERROR: with Hint: lines; follow the hints. Verbs: status, source sim|serial,
sim --profile constant|sine|step|hand|hold|stage ..., detect --lp-hz --threshold --invert, view --window-ms --history-s --pause --resume --keep-awake, zero, record start|stop|status, ui toast|click|reveal|cursor|reload,
settings get|set, console, eval --suite|--board, stop.
Board 1.3: laser on --beam-safe|off|current <mA> [--wait]|read, offset ch1|ch2 <V> [--counts],
offset auto [ch1|ch2|both], gain ch1-tia|ch1-amp|ch2-tia|ch2-amp <value>, bias low|mid|high,
ctl <map id> <value>, board [map|clear-fault|config], tune [--status|--stop].
Test stage (board 1.3 J4): stage [status], stage home, stage step N [--nm], stage move POS,
stage speed PPS, stage stop, stage off, stage current, stage align, stage selftest [--status],
calibrate --beam-safe [--status|--stop]. Home before moving (the firmware refuses otherwise); moves stay
in 0..1600 pulses (15.625 nm each, nominal). On the simulator every stage result is simulated: say so,
and never present it as a measurement. Calibrate turns the laser off and on, so it needs the same
human confirmation as laser on; it runs on the simulator only for now.
Laser rules for an AI: only turn the laser on with --beam-safe when the human has said the beam is
enclosed or they wear eyewear. Tuning never turns it on. Offsets, gains and bias change only with the
laser off (board rule; the firmware refuses otherwise); offset auto and tune cycle the laser for
their writes themselves. Each set-point write restarts the head's soft-start, so set the current once,
with --wait, rather than in small steps. Tune needs a moving target. After a gain change run
offset auto. If board shows a fault, report it to the human before board clear-fault.
Selectors for ui click: #btn-pause #btn-zero #btn-record #btn-settings #src-sim #src-serial [data-profile=sine] #mm-toggle #s-close #tab-board #tab-sim #btn-centre #btn-tune #btn-tune-stop #laser-off [data-ctl=<map id>][data-v=<value>] #tab-stage #st-home #st-stop #st-off #st-neg #st-posb #st-sizes button[data-n=128] #st-speeds button[data-n=640] #st-test #cal-interlock #cal-go. Enabling the laser needs a real one-second hold on the
page, so use the CLI for that. ui tab board|stage|sim switches the side panel. A toast you raise with ui toast appears on the user's screen.
Displaying this app (REQUIRED, read before showing anything)
To SHOW this app, use smi-dash show (it opens the proper Hydrogen webview tab itself). For
manual display, FIRST load the webview skill (adom-workspace-control) and follow it.
- NEVER open this app in VS Code's "Simple Browser": not a webview in the Adom ecosystem, no live channel, no console read-back, no AI drivability. Using it is a bug.
- Surfaces: wv (Hydrogen webview panel), pup (
pupskill), the user's real signed-in browser (Adom browser extension), and hdbw (Hydrogen's standalone browser window, only under Hydrogen). Simple Browser is NEVER one of them. ?frame=16x9letterboxes the page to an exact 16:9 stage for screen recordings.
Limits to tell the user
Counting resolves one fringe (329 nm at 658 nm). Keep the fringe rate under about two thirds of the
detector low-pass (default 10 kHz, so about 2 mm/s); raise --lp-hz to 60000 for up to 5 mm/s. 10 mm/s
fails. The multimode laser case fails on purpose. Not yet verified on physical hardware; the stage is
not assembled, so no stage result is a measurement.
---
name: smi-dash
description: >-
Drive the self-mixing interferometer dashboard (smi-dash): live ADC0/ADC1 fringes from the
Raspberry Pi Pico or the built-in simulator, fringe counting with direction, displacement in
nm and um, velocity, spectrum, SYNC markers, CSV/HDF5 recording, an accuracy suite against
simulated ground truth, and on board 1.3 every board setting: laser enable and current, offsets,
gains, monitor bias, auto-centre and tune for fringes, plus the test stage: home, step, stop, a
self-test, and Calibrate, where the stage is the moving target and the board calibrates itself. Use when asked to show the interferometer,
simulate a moving target, count fringes, record the photodiode channels, set or tune the laser,
centre a channel, change a gain, check the detector's error, move or home the stage, run the stage self-test,
or calibrate the board.
---
# smi-dash
Start one server per AI thread and reuse it:
```
smi-dash ls # what is running
smi-dash --ai-thread "<your thread>" start # reuses a live instance for that thread
smi-dash --ai-thread "<your thread>" show
```
Every verb answers `OK:`/`ERROR:` with `Hint:` lines; follow the hints. Verbs: `status`, `source sim|serial`,
`sim --profile constant|sine|step|hand|hold|stage ...`, `detect --lp-hz --threshold --invert`, `view --window-ms
--history-s --pause --resume --keep-awake`, `zero`, `record start|stop|status`, `ui toast|click|reveal|cursor|reload`,
`settings get|set`, `console`, `eval --suite|--board`, `stop`.
Board 1.3: `laser on --beam-safe|off|current <mA> [--wait]|read`, `offset ch1|ch2 <V> [--counts]`,
`offset auto [ch1|ch2|both]`, `gain ch1-tia|ch1-amp|ch2-tia|ch2-amp <value>`, `bias low|mid|high`,
`ctl <map id> <value>`, `board [map|clear-fault|config]`, `tune [--status|--stop]`.
Test stage (board 1.3 J4): `stage [status]`, `stage home`, `stage step N [--nm]`, `stage move POS`,
`stage speed PPS`, `stage stop`, `stage off`, `stage current`, `stage align`, `stage selftest [--status]`,
`calibrate --beam-safe [--status|--stop]`. Home before moving (the firmware refuses otherwise); moves stay
in 0..1600 pulses (15.625 nm each, nominal). On the simulator every stage result is simulated: say so,
and never present it as a measurement. Calibrate turns the laser off and on, so it needs the same
human confirmation as `laser on`; it runs on the simulator only for now.
Laser rules for an AI: only turn the laser on with `--beam-safe` when the human has said the beam is
enclosed or they wear eyewear. Tuning never turns it on. Offsets, gains and bias change only with the
laser off (board rule; the firmware refuses otherwise); `offset auto` and `tune` cycle the laser for
their writes themselves. Each set-point write restarts the head's soft-start, so set the current once,
with `--wait`, rather than in small steps. Tune needs a moving target. After a gain change run
`offset auto`. If `board` shows a fault, report it to the human before `board clear-fault`.
Selectors for `ui click`: `#btn-pause #btn-zero #btn-record #btn-settings #src-sim #src-serial
[data-profile=sine] #mm-toggle #s-close #tab-board #tab-sim #btn-centre #btn-tune #btn-tune-stop
#laser-off [data-ctl=<map id>][data-v=<value>] #tab-stage #st-home #st-stop #st-off #st-neg #st-posb
#st-sizes button[data-n=128] #st-speeds button[data-n=640] #st-test #cal-interlock #cal-go`. Enabling the laser needs a real one-second hold on the
page, so use the CLI for that. `ui tab board|stage|sim` switches the side panel. A toast you raise with `ui toast` appears on the user's screen.
## Displaying this app (REQUIRED, read before showing anything)
To SHOW this app, use `smi-dash show` (it opens the proper Hydrogen webview tab itself). For
manual display, FIRST load the `webview` skill (adom-workspace-control) and follow it.
- **NEVER open this app in VS Code's "Simple Browser"**: not a webview in the Adom
ecosystem, no live channel, no console read-back, no AI drivability. Using it is a bug.
- Surfaces: **wv** (Hydrogen webview panel), **pup** (`pup` skill), the user's **real signed-in browser**
(Adom browser extension), and **hdbw** (Hydrogen's standalone browser window, only under Hydrogen).
Simple Browser is NEVER one of them.
- `?frame=16x9` letterboxes the page to an exact 16:9 stage for screen recordings.
## Limits to tell the user
Counting resolves one fringe (329 nm at 658 nm). Keep the fringe rate under about two thirds of the
detector low-pass (default 10 kHz, so about 2 mm/s); raise `--lp-hz` to 60000 for up to 5 mm/s. 10 mm/s
fails. The multimode laser case fails on purpose. Not yet verified on physical hardware; the stage is
not assembled, so no stage result is a measurement.