Uploaded February 2025 | Updated September 2026, 1 week ago
Short demo showcasing MicroPython-based SENSORLESS homing & centering of a stepper motor. The control uses RP2040-Zero and PIO (Programmable Input/Output) combined with Trinamic TMC2209 driver.
The StallGuard feature is used for homing detection, while the PIO's are used for steps counting and for stepper centering: The stepper is stopped in the middle of the 2 detected homes.
Setup:
- 1 NEMA 17 stepper motors.
- 1 RP2040-Zero board.
- 1 Trinamic TMC2209 driver.
- the stepper is 200 pulses/rev, set to 1/8 microstep, therefore 1600 pulses/rev.
- the stepper is controlled by the RP2040-Zero board, running MicroPython.
- the range in between the hard-stops (homes) is varied along the video.
- each time the push button is pressed, a new homing & centering cycle is started.
- the stepper speed is alternated between 400Hz and 1200Hz.
- UART comunication between RP2040 and TMC2209.
This control method is part of a larger project (youtu.be/ORftNl7bZG4), but it can be adapted for other applications requiring sensorless homing.
Code & Examples: github.com/AndreaFavero71/stepper_sensorless_homing
Code tested on RP2040-Zero, and it's expected to also work on RP2350-Zero (both having the RGB led onboard).
Demo with fixture and board from Lewis (DIY Machines): youtu.be/fMuNHKNTSt8
Lewis tutorial: youtu.be/TEkM0uLlkHU
Short demo showcasing MicroPython-based SENSORLESS homing & centering of a stepper motor. The control uses RP2040-Zero and PIO (Programmable Input/Output) combined with Trinamic TMC2209 driver.
The StallGuard feature is used for homing detection, while the PIO's are used for steps counting and for stepper centering: The stepper is stopped in the middle of the 2 detected homes.
Setup:
- 1 NEMA 17 stepper motors.
- 1 RP2040-Zero board.
- 1 Trinamic TMC2209 driver.
- the stepper is 200 pulses/rev, set to 1/8 microstep, therefore 1600 pulses/rev.
- the stepper is controlled by the RP2040-Zero board, running MicroPython.
- the range in between the hard-stops (homes) is varied along the video.
- each time the push button is pressed, a new homing & centering cycle is started.
- the stepper speed is alternated between 400Hz and 1200Hz.
- UART comunication between RP2040 and TMC2209.
This control method is part of a larger project (youtu.be/ORftNl7bZG4), but it can be adapted for other applications requiring sensorless homing.
Code & Examples: github.com/AndreaFavero71/stepper_sensorless_homing
Code tested on RP2040-Zero, and it's expected to also work on RP2350-Zero (both having the RGB led onboard).
Demo with fixture and board from Lewis (DIY Machines): youtu.be/fMuNHKNTSt8
Lewis tutorial: youtu.be/TEkM0uLlkHU



![MirrorBallBot, a different ball balancing robot
More info at GitHub: [https://github.com/AndreaFavero71/mirrorballbot]
Open source project: All files, code, schematics, 3D printing files, and a detailed manual are availate at GitHub
#BallBalancingRobot #OpenSource #RaspberryPi #MirrorBallBot #ComputerVision #DIY # Ball Balancing Robot MirrorBallBot, a different ball balancing robot](https://i.ytimg.com/vi/Jo7lKZNvu-A/mqdefault.jpg)





![Ball balancing robot, a new approach: MirrorBallBot [Raspberry Pi, RP2040, TMC2209, stepper motors]
MirrorBallBot is an innovative yet simple ball balancing robot. Most ball balancing robots place the camera either above the platform (resulting in a taller structure) or underneath it (requiring a smaller platform). I wanted neither... so I added a mirror. Problem solved!
What it can do:
- Auto-balance – keeps the ball centered
- Follow your finger on the touchscreen in real time
- Record and replay custom paths
- Predefined paths: square, circle, triangle, infinity, line
- Automatic color calibration
Open source – Python / MicroPython
All files, code, schematics, 3D printing files, and a detailed manual are linked below.
Materials cost: ~€300
Special thanks to:
- ELECROW for sponsoring the 7 DSI touchscreen
- PCBWay for sponsoring the custom PCB and supporting the DIY community
Hope you like the project! Let me know what you think.
Links:
- GitHub: [https://github.com/AndreaFavero71/mirrorballbot]
Sponsors:
- PCBWay: [https://www.pcbway.com/]
- ELECROW: [https://www.elecrow.com/7-inch-800-480-dsi-display-touch-screen-with-bracket-compatible-with-raspberry-pi.html?idd=5]
0:00 Disturbance rejection of the robot
0:10 Introduction to MirrorBallBot
0:27 Finger-follower and path recording feature
0:53 Classic camera placement
1:18 Solving the camera placement with a mirror
1:56 Predefined geometrical Paths
2:47 Touchscreen graphical interface
3:14 Calibration, and automatic ball color calibration (HSV) demo
3:35 Commercial components (stepper motors, Raspberry Pi camera, 7-inch DSI touchscreen by ELECROW)
3:51 Custom PCB (Raspberry Pi HAT) by PCBWay
4:25 Electronic (Raspberry Pi 4B, RP2040, TMC2209)
5:04 Open Source, files and conclusions
#robot
#3dprinting
#DIY
#BallBalancingRobot
#OpenSource
#RaspberryPi
#ComputerVision
# Ball Balancing Robot Ball balancing robot, a new approach: MirrorBallBot [Raspberry Pi, RP2040, TMC2209, stepper motors]](https://i.ytimg.com/vi/ORftNl7bZG4/mqdefault.jpg)
