Measure your 3D printer’s mechanical resonance over USB (ADXL345 on an RP2040 “USB accelerometer” board) and use the built-in web UI to:
- Flash the firmware (UF2)
- Stream accelerometer samples over the browser’s Web Serial API
- View a live spectrogram / peak frequency
- Simulate data without hardware
- Optimise Marlin FT_MOTION input shaper coefficients from measured max-hold spectra
Live app (GitHub Pages): https://dbuezas.github.io/usb-Input-shaper-calibrator/
Source repository: https://github.com/dbuezas/usb-Input-shaper-calibrator
src/main.cpp: RP2040 firmware that reads an ADXL345 over SPI and streams packed samples over USB serial.platformio.ini: PlatformIO configuration forboard = pico(Earle Philhower Arduino core).UI/: React + Vite web app (deployed to GitHub Pages via.github/workflows/deploy.yaml).
- A Chromium-based browser with Web Serial support: Chrome, Edge, Opera.
- Hardware (optional): an RP2040 + ADXL345 “USB accelerometer” board (e.g. Mellow Fly ADXL345 USB-C).
- Open the web app.
- Install firmware → download
firmware.uf2. - Put the RP2040 into bootloader mode (hold BOOT while plugging in) and drag-and-drop the UF2 onto the
RPI-RP2drive. - Measure axis → click Connect and pick the serial device.
- Use Simulate if you want to try the UI without hardware.
- Optimize shaper → run Auto optimise to get suggested shaper taps.
This is only needed if you want to build your own UF2 instead of using the one bundled in the UI.
pio runThe firmware:
- Targets RP2040 (
board = pico) - Reads the ADXL345 via bit-banged SPI
- Streams samples over USB serial at
230400baud (UI expects the same)
cd UI
pnpm install
pnpm devThen open the printed local URL.
- USB-C ↔ USB-C cables: some boards don’t have CC resistors and won’t enumerate. Use USB-A → USB-C (or an A-port adapter) if connection is flaky.
- If Connect stays on “Connecting”, check you flashed the UF2, selected the right port, and the device is streaming.