Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It depends on if you need closed-loop control (feedback-driven systems like DC motors with encoders) or open-loop control (where you just output a signal and you can trust that the system moves to a specific state without checking up on it).

A few years ago I made a 3d printer that used an open-loop stepper system in userland on the original raspberry pi. I got stepper precision down to 2 microseconds [1] — which IIRC is better than the arduino-based systems out there were using. Latency was a different matter — the steppers would still overstep a few times after triggering the endstops.

It takes some hacking (I used DMA and the audio peripherals to offload timing-critical parts from the cpu), but open-loop control is totally doable at 2 microseconds if you’re dedicated to getting it working. Maybe you can get down to 1 us on the newer raspberry pi’s. If you repurpose the video core, maybe you can find a way to do real-time closed-loop control, but that sounds even more involved than what in the end is a relatively simple DMA hack.

[1] https://github.com/Wallacoloo/printipi/blob/master/README.md... Read the scheduler code or check the video linked from the readme if you want more detail.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: