I wanted to spend more time with reinforcement learning on a robot small enough to build in a few evenings. The idea was simple: knock it over and it gets itself back up. Two servo joints, a battery and an onboard controller. I started from Homemade Garbage’s self-rising robot, adapting the hardware and packaging along the way.
2DoF Always Standing (2026)
V1: make it work
I designed the arm in Onshape, printed it in PLA and assembled the electronics on top of the base. Codex wrote the firmware and handled the simulation and training. It could get back up, but the battery, controller and wires were all hanging out. Very much a prototype.
V2: clean it up
I hate wires, so I asked Codex to move the electronics into an enclosure underneath the robot. This was new for me: having AI work on the mechanical design. I supplied the CAD, reviewed the design, printed it, checked the fit and sent back photos and feedback. We went through three enclosure revisions.
The result has locating stops for the boards and battery, thinner walls, two self-tapping screws, an accessible USB-C port and a side-mounted power switch. I still did all the soldering and assembly, which was easily the fiddliest part. Moving the electronics also changed the center of gravity and IMU position, so we updated the simulation and retrained.
From simulation to the desk
A Seeed XIAO nRF52840 Sense reads its onboard IMU and runs a 4,994-parameter neural network at 50 Hz. Two PTK 7465 MG servos and a 500 mAh single-cell LiPo do the rest. Training uses MuJoCo and Stable-Baselines3 PPO, with varied floor friction, mass and servo dynamics. A small supervisor handles retries and straight-arm holding.
The servos don’t report their angles, so the simulator includes limited torque, speed and command delay. Sometimes it needs another try to get up. That is part of the fun—the little movements make it feel surprisingly alive.
What stuck with me was how much easier it became to refine the small details. I would normally have left this as a mess of wires. A custom PCB would be a good next step; there are still plenty of wires inside.
The CAD, BOM, firmware and training code are on GitHub. I talk through the build and what it got me thinking about in the video below.
Build walkthrough — starts at the robot segment, 6:07.