Project Summary
Trackball to Spacemouse Emulator is an embedded input-device project that turns a standard USB trackball receiver into a 3D navigation controller for CAD software. It uses the 3Dconnexion SpaceMouse driver path, so the computer can treat the device like a familiar 3D navigation controller rather than a normal mouse.
The project exists because a dedicated 3D mouse is useful, but not always easy to justify for occasional CAD work. Reusing a spare trackball and a Raspberry Pi Pico keeps the build practical, inexpensive, and aligned with the spirit of making useful tools from hardware already on hand.
The interesting part is that the board bridges two USB roles at once. On one side, it acts as a USB host for the trackball receiver. On the other side, it acts as a USB device connected to the computer. Firmware translates mouse-style input into six-degree-of-freedom navigation signals for CAD tools.
Project Pages
- Component List
- Installation Instructions
- GitHub repository: planned public link after the repositories are reviewed for secrets and cleaned for release.
- Media and demo videos: planned.
What It Does Today
- A USB trackball receiver is connected to the Pico through a USB host connection.
- The firmware reads HID mouse reports from the trackball receiver.
- Trackball movement, wheel movement, and button state are mapped to 3D navigation axes.
- The Pico presents itself to the computer through the 3Dconnexion SpaceMouse driver path.
- CAD software such as Fusion 360 and FreeCAD receives translation and rotation reports from the emulated device.
- A local browser setup page can read and update axis mappings, behavior, and sensitivity over USB serial.
Current Features
- Raspberry Pi Pico 2 W firmware using the Pico SDK.
- TinyUSB device mode for presenting a HID controller to the computer.
- TinyUSB host support through PIO USB for reading the trackball receiver.
- Multi-axis HID report descriptor with translation and rotation reports.
- Configurable mapping for movement, scroll input, and button-modified behavior.
- Per-axis sensitivity settings.
- Persistent configuration stored in device flash.
- USB CDC command interface for reading and writing configuration.
- Browser-based Web Serial configurator for axis and sensitivity settings.
- Tested on Windows and macOS with Fusion 360 and FreeCAD.
Architecture
USB trackball receiver -> Pico PIO USB host -> TinyUSB host HID parser -> axis mapping and sensitivity logic -> TinyUSB HID device reports -> 3Dconnexion SpaceMouse driver path -> CAD application on the computer Browser configurator -> Web Serial -> USB CDC command interface -> flash-backed device configuration
The firmware is split around two responsibilities: reading input from the trackball and emitting a different kind of input device to the computer. The host side services USB input, while the device side sends steady HID reports and handles configuration commands.
Main Components
- Pico Firmware: initializes the board, loads saved settings, reads HID reports, maps input to 3D axes, and sends HID reports to the computer.
- USB Host Input: reads reports from the trackball receiver and keeps the input path responsive.
- Axis Mapping Layer: converts mouse-style movement into translate X/Y/Z and rotate X/Y/Z controls.
- HID Device Output: exposes a multi-axis controller descriptor through the SpaceMouse driver path.
- Persistent Configuration: stores mappings and sensitivity values in flash.
- Web Configurator: uses the browser Web Serial API to load, change, and save device configuration.
Services And Technologies Used
Current services and technologies:
- Raspberry Pi Pico 2 W as the embedded controller.
- Pico SDK for firmware development.
- TinyUSB for USB device and host support.
- PIO USB for the additional USB host port.
- USB HID for trackball input and multi-axis controller output.
- 3Dconnexion SpaceMouse drivers on the host computer.
- USB CDC for configuration commands.
- On-device flash storage for saved settings.
- Web Serial API for the browser configurator.
- C and CMake for the firmware build.
- HTML, CSS, and JavaScript for the configuration UI.
Planned refinements:
- CAD-focused tuning profiles for tools such as FreeCAD and Fusion.
- More robust support for different trackball HID report formats.
- Improved calibration, smoothing, dead zone, and acceleration controls in the configurator.
Design Principles
- Reuse inexpensive, familiar input hardware for a specialized CAD workflow.
- Keep the runtime local, fast, and independent of network services.
- Keep real-time input translation on the embedded device.
- Use a browser configurator instead of requiring a custom desktop application.
- Use standard USB classes where possible for broad compatibility.
- Store only small behavior settings, not unnecessary user data.
Roadmap
- Test additional CAD applications beyond Fusion 360 and FreeCAD.
- Continue long-session testing with the intended trackball receiver.
- Add safer parsing for varied HID mouse report layouts.
- Tune default axis mappings for practical CAD navigation.
- Add smoothing, dead zone, and acceleration options.
- Add named profiles to the web configurator.
- Improve status feedback during save and reboot.
- Document wiring, flashing, and configuration as repeatable build steps.
Project Status
The project is a working embedded input-device build. It reads trackball-style HID input, maps it to 3D axes, exposes itself through the 3Dconnexion SpaceMouse driver path, and saves user configuration through a local browser interface. The next milestone is refinement: broader device compatibility, smoother navigation tuning, and clearer setup documentation.