How light painting works
An 84-channel array sends 40 kHz ultrasound toward the table. The sound holds a 3 mm foam bead about 2.3 mm above the surface. As the trap moves, four WS2812 LEDs light the bead. It moves fast enough for your eyes to see a line.
Draw a shape
- Connect a device or stay in the simulator to plan and preview.
- Start the trap, then place the foam bead in the sound field.
- Pick a shape, size, and color, then choose Plan. The planner sets the speed, filters resonance, adds feedforward, and checks the result in simulation.
- Play draws the shape. Stop slows down and holds the bead in place. Release bead turns the field off.
- Use spin calibration to measure the trap’s sideways strength at level 255. The bead speeds up on an 8 mm circle.
Bypass path planning
Turn on Bypass path planning to start the trap and move it live. The current X/Y is the trap center. No path needs to be planned or played.
- Center X/Y: Changes go straight to the device.
- Left stick or WASD: Move at the selected speed and acceleration. Release to slow down and stop.
- Speed: 0.01–50 mm/s. Acceleration: 0.1–500 mm/s². Both can change live.
- Movement spans ±35 mm, like the X/Y sliders. Turn off the mode to stop live output and return to path planning.
Live output sends only the target position, not a path. Standard planning, uploading, and playback stay the same.
Array patterns (trap_mode 0–5)
Firmware supports six patterns: single focus, axial pair, side-by-side pair, ring, vortex, and double ring. Radius sets the size (minimum 0.5 mm); phase span sets the vortex twist (0 means one turn). Changing patterns replans and sends the new settings to the running device.
Hologram morph
Upload shapes as keyframes with 84 phase bytes and 84 amplitude bytes each. The device blends between frames on its own clock. Set the morph time, frame rate, amplitude, and loop period. At 128, the amplitude is full at 50% duty cycle. Preview field shows the current output frame.
Haptics (ULM)
The focus can oscillate sideways at 1–1000 Hz while following the path. At zero amplitude, the device uses A = v / 2πf. Choose X, Y, or a ring. The sawtooth jumps from +A to −A once per second. Start at low amplitude.
Browser requirements
The 3D view uses WebGL 2. A real device needs Chrome or Edge with Web Serial on HTTPS or localhost. The app detects the STM32 CDC serial port (VID 0483 / PID 5740).
About the model
The browser app uses the Python app’s sound field, trap model, speed planner, resonance filter, path interpolation, and protocol. The tests compare results with Python reference data.