Inverted pendulum
A single arm on a bench that swings itself up and balances. Started as a way to get a real-time control loop onto hardware I actually own.
A brushless motor at the shoulder, an absolute encoder on the shaft, and a Rust control loop running at 200 Hz on a Raspberry Pi. MuJoCo for the simulation, and Blender renders built from the CAD so I can watch a recorded run back on the real geometry.
It first swung up and balanced on 1 September 2026 — ten runs out of ten at the operating point I had predicted, and 14 of 22 across all the currents I tried that night. The posts below are in the order things happened. Most of them are about places the simulator and the bench disagreed, which turned out to be the part worth writing down.
The rig
The app
The rig has an owner app rather than a console. It says what the machine is doing in words a person can act on, and nothing moves unless somebody presses a button. The same app drives the simulator and the bench, with a label in the corner saying which.
Posts, in order
- The first write-ups are on the way.
Four more are drafted and not published yet: measuring the torque constant against cogging, a flag that only half applied itself, a safety monitor the simulator never modelled, and the prediction I committed before any of it ran. They will go up as I finish checking the numbers in them.
Where it stands
Swing-up and balance work at the studied operating point. Three things are still open: the velocity register hits a limit somewhere around 14 rad/s — in units I have not pinned down yet — and the fix is not in; the friction terms are stale; and cogging and stiction are not in the model at all. Next is the saturated-reading fix, because the control loop acts on that number.
