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…

About the author

28 Responses
    1. There’s a complete tutorial here. This “unicycle” is just that same segway, except with one wheel that’s wide enough that it doesn’t fall to the left or right.

      1. Ryan

        We are already starting to build this unicycle. The Segway with two wheels works perfect and we started playing with the variables. But we are having problem finding a wheel that we can use for the unicycle. The 4 wheels from the Kit are all small. Is it possible to use small wheel for the unicycle? Also we don’t know how to export the c program to the Mindstorm Controller, can you tell us how? Thanks

        1. You need RobotC to do that.

          But why don’t you just use the NXTG program that I made? The one you have used successfully already?

          This isn’t a unicycle. It’s just a normal Segway with a wheel that’s wide enough so that it doesn’t fall to the left or right.

  1. Theo

    May I ask if you are willing to give us every parts you used for the robot? The Mindstorms NXT 2.0 is very expensive, we are trying to buy by parts to minimize the expense for our project.

    Thank You in advance!

      1. elpepe73

        I have new sensor from mindsensors. But snadard bloc is very complicated and slow. Is any way to program faster block? I want use this sensor for my unicycle.

  2. Peter

    great work.
    Im working on a Segway-type and a tool for changing the parameters live would be very helpful.
    How did you do this?

  3. abasba

    I have a question about Nxt-G programming.How can i make a NXT-G program it reads data (a text file) from pc ? It is too important for me

  4. Dung Phan

    Dear Mr Laurens,
    I want to build the unicycle same with you by EV3. Can you help me program for it?
    Thank you very much

Leave a Reply


EV3 Discovery

Discover the many features of the EV3 set, and learn to build and program your own robots! Learn more

Start Building Robots


Website Maintenance

Robotsquare is currently being updated, which means that it may look a little different (and not very polished) for a while. All the content and pages should still be there, though. It should be back and fully operational soon. Thanks for your patience!