You’d think I’d be bored with self balancing robots by now but I’m not! The Technic Unimog has huge wheels and I thought I might as well put them on Anyway. Then I thought that one wheel might be enough to stay up right, and it was. I know this is not a true unicycle, but it fits the definition. “u·ni·cy·cle, Noun: A cycle with a single wheel, typically used by acrobats.” Either way, a fun experiment.
It’s running the standard Segway drivers with some minor but important modifications. First, steering and wheel synching is disabled. You would twist the wheel axle if you didn’t disable it. Look for these lines in the driver comment out the d_pwr:
motor[motorB] = motorpower;// + d_pwr;
motor[motorC] = motorpower;// – d_pwr;
The wheel diameter in the main program is set to 95 mm:
const float your_wheel_diameter = 95;
The balancing constants should be modified slightly:
- kp: 0.375
- ki: 3.03
- kd: 0.006
- Angle gain: 42.1
- Angular velocity gain: 0.4
- Motor position gain: 0.375
- Motor speed gain: 0.026
I found these constants with a tool I wrote to tune the constants live — while the robot is balancing. I wrote it a while back just for fun, but in this case it proved to be useful, too. Now that I’ve said this, I should probably do a blog post on that tool, too. Some day…


