Skip to content

Spacemouse emulation - #51

Open
devonjones wants to merge 10 commits into
sb-ocr:mainfrom
devonjones:spacemouse-emulation
Open

devonjones wants to merge 10 commits into
sb-ocr:mainfrom
devonjones:spacemouse-emulation

Conversation

@devonjones

Copy link
Copy Markdown

No description provided.

devonjones and others added 10 commits July 9, 2026 19:26
USB/HID emulation (patterns proven across community forks):
- Present as SpaceMouse Compact (VID 0x256F, PID 0xC635) so 3DxWare
  and spacenavd bind natively
- Split HID reports to match genuine hardware: translation (ID 1),
  rotation (ID 2), buttons (ID 3), logical range +/-350
- Strip the CDC serial interface for a pure-HID descriptor; debug
  builds (-DENABLE_DEBUG_SERIAL) keep it and enable telemetry
- Round-robin report dispatch (TinyUSB carries one report per poll)
  and a 50ms keepalive while deflected

Motion pipeline, calibrated from guided captures of this unit
(tools/calibration/):
- Fitted 6x6 decoupling matrix + per-direction trims: full deflection
  reaches +/-350 both ways despite asymmetric sensor response, and
  cross-axis bleed is cancelled (untreated, rolling the cap produced
  a pan up to 4x the roll signal)
- Second-stage per-direction cross-coupling corrections for the
  direction-dependent bleed a linear matrix can't express
- Soft dead zones (per-axis, sized from measured noise floors) with a
  sensitivity curve: fine control at light touch, full speed at full
  deflection; pitch runs a steeper curve and lower trim to tame its
  oversensitive mid-range

Quality of life:
- Hold both buttons 10s to reboot into the UF2 bootloader — reflash
  without opening the case (the loose-board USB dropouts came from
  removing the cover to reach the BOOT button)
- Idle LED color cycles via 3s right-button hold, persisted in flash
  (default purple, to match the case)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…iag build

- Move unit-specific calibration (matrix, trims, dead zones, curves,
  LED default) into firmware/include/units/unit<n>.h, selected by
  -DUNIT; platformio.ini gains one env per physical unit
- unit1: the fitted purple-case unit; unit2: black case, bootstrap
  diagonal values ready for its calibration capture (LED defaults green)
- Add diag env (pio run -e diag): serial-only firmware that probes each
  magnetometer under both load-switch polarities and alternates the LED
  rail, to localize assembly faults (bad joints, AP22816A/B variants)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…action, config guards, tooling precondition)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…pile-time dead-zone guard, kSqrt3, USB re-attach delay)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…e; dedupe unit2.h pipeline docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…n, unit-1 trim warning, literal suffix)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…to feel-approved strength, RY- trim boost with compensated cross row)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant