Wii Nunchuck Controlled Robot Exhibits Rock Solid Balancing

[Willy Wampa] is showing off his self-balancing robot. What strikes us about the build is how well tuned his feedback loop seems to be. In the video after the break you will see that there is absolutely no visible oscillation used to keep its balance.

The parts used are quite easy to obtain. The acrylic mounting plates are his wife’s design and were custom cut through the Pololu service. They were also the source of the gear motors. He’s using a SparkFun IMU with an Arduino and a motor shield. He first posted about the build about a month ago, but the new revision switches to a Pololu motor driver shield which he says works much better, and adds control via a wireless Wii Nunchuck.

The PID loop which gives it that remarkably solid upright stance is from a library written by [Brett Beauregard]. Once again the concept of open source lets us build great things by standing on the shoulders of others.

[via Reddit]

24 thoughts on “Wii Nunchuck Controlled Robot Exhibits Rock Solid Balancing

  1. Hey, thanks for featuring my project (although I wish you’d correct the spelling of my username – wily, not willy). Here are the parts that I used:

    Arduino Uno R3
    Pololu 29:1 Metal Gearmotor 37Dx52L mm with 64 CPR Encoder
    Pololu Wheel 90x10mm
    Pololu Dual VNH5019 Motor Driver Shield for Arduino
    SparkFun IMU Analog Combo Board – 5 Degrees of Freedom IDG500/ADXL335
    Nyko Wireless Kama

    I use a complementary filter to estimate the tilt angle and rate from the IMU vertical and longitudinal accelerometers and tilt gyroscope. The control loop has an outer PID loop of motor speed with tilt angle command output (from the encoders), a middle loop of tilt angle with tilt rate command output, and an inner loop of tilt rate with motor PWM command. There’s a separate loop to control yaw rate (turning) which is just PID with a setpoint from the Wii Nunchuck, input from the yaw gyroscope, and output of a differential PWM motor command.

    1. Putting the weight up higher (still thinking through the physics) might make it easier to balance because the lowers the amount of weight of the base. Maybe that would lower the power needs to stabilize the system? Moving a lower amount of mass is easier?

    2. I designed it so that the battery height would be adjustable, and found that the maximum height with the threaded rods I used was best. A balancing robot is essentially an inverted pendulum, which has a period inversely proportional to its length. The farther away the center of gravity is from the rotation axis, the longer the period, and hence the slower it falls over, making it easier to correct.

      1. To see that Wily is correct, try this:

        tape some weight (wraps of wire) to one end of a yardstick. Try to balance the stick on a finger when the weight is near your finger; then try to balance it when the weight is at the top.


  2. This is very cool. I want to do a project like this soon.

    Maybe a weed eating self balancing robot for the lawn edging.

    Thinking of using an old wheel chair chassis for the 2 wheels and belt driving them.

    Nice job. Very inspiring.

  3. Very nice robot! I am biulding similar construction right now.
    I have already built one prototype, but it turned out to be very heavy.
    Can You tell me the diameter of these metal rods and thickness of acryllic plates that You used ? Your construction seems to be very light and stable.

    1. The threaded rods are 8-32 and the acrylic is 3 mm thick. It still twists a little bit with the 8-32 rods, so that’s the minimum size if you’re making something on the same scale.

  4. very nice work:) I want make a robot like this.
    I have this items.
    arduino Uno and Arduino leonerdo
    Pololu 12V, 29:1 Gear Motor w / Encoder
    Pololu Wheel 90 x 10mm Black (Pair)
    Pololu 37D mm Metal Gearmotor Bracket (Pair)
    6 Degrees of Freedom ±2000° / sec ±16g IMU – ITG3200 / ADXL345
    Arduino Motor Shield rev 3 and Pololu Dual MC33926 Motor Driver Shield for Arduino
    But I havent ”Pololu Dual VNH5019 Motor Driver Shield for Arduino” and ”Nyko Wireless Kama” .. I dont know very well write arduino code. So ı want use your code.
    Can ı use motor drivers that I have.
    And have any advaice wiresles control? . I get ardunio Jy-mcu bluettoh . and PS3 console.
    I would be glad if you help.thanks

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.