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]

Comments

  1. JB says:

    Very cool. It reminded me of R2D2 chasing the ewoks with the electric zapper :P

  2. David says:

    I wanted to see the dog get fed up and latch onto it and “shake”. :)

  3. wilywampa says:

    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.

  4. D’awwww, corgi! Oh, and there’s some remote controlled balancing thing, too. That’s pretty nifty.

  5. tomdf says:

    I officially need to build one of these now.

  6. Owen b says:

    So what’s the thinking behind having the battery mounted up so high?

    • David says:

      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?

    • wilywampa says:

      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.

      • Neil Benson says:

        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.

        Neil

    • S says:

      That can test it yourself. Never balanced a stick or a broom in your hand or chin?

      Test how compares attaching some weight to the top/middle/bottom of it. Show it to the kids. ;)

  7. McGuiver says:

    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.

  8. hawkeye18 says:

    That’s pretty awesome. I mean, anything that chases an adorable fat Corgi around is pure win in my book!

  9. flink says:

    Nice build. I might like to try this myself. Well, as long as I don’t need to buy a Corgi, too. My cats would surely take advantage of it.

  10. Thanh says:

    Great work. Cute doggy :)

  11. Scott says:

    Corgis are necessary for the testing, no other breed would put up with it.

  12. SamQuin says:

    Hey, Wily Wampa,
    How can I contact you!
    I left you a message one day ago on the reedit pages where you discuss the new revision of your balancing 2 wheel robot.

  13. w1qtorr says:

    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.

    • wilywampa says:

      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.

  14. m.arif says:

    very nice job. Can you share arduino code ..?

  15. arif says:

    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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,468 other followers