Bob Allen and Ted Larson explain how Bender came to balance on its own two wheels.

Editor's note: Ted Larson and Bob Allen are members of the HomeBrew Robotics Club. They're also the brains behind Bender, a self-balancing robot that won the Open class gold medal at this year's ROBOlympics. On tonight's episode of "The Screen Savers," Larson and Allen will show off Bender and tell you how they built the gyro-balanced robot. Below, Allen gives a preview.

Building the perfect Bender

Ted and I sat down one day and decided to build a two-wheeled balancing robot called Bender. That decision was easy, but we had no idea how to build the robot or even where to begin. We started where everyone starts: We made a to-do list.

Motors and encoders

First on our list was selecting the motors and encoders. We set out to the nearest surplus store and found brand-new motors with high-resolution encoders attached. We couldn't pass up the price -- only 10 bucks each.

The next step was selecting the wheels. I looked in my trusty box full of wheels and found two hard-rubber, 6-inch-diameter model airplane wheels. We'd use those.

Bender No. 2 - Thumb


Programming the PICs

Being a software programmer, Ted researched what we'd need to program the PICs (programmable integrated circuits) for this project. He also looked into what we'd need for the balancing sensors.

To give Bender a sense of balance, Ted selected a gyro used in video cameras to keep the image stable. At about $24, the size and cost of the gyro was within our budget. To make sure Bender stayed within posted speed limits, we selected the Memsic accelerometer from Parallax, again about $24 each.

With those parts in hand, I sat down at my CAD design program to design a mechanical base while Ted worked on the electronics.

Bender's blueprint

The design is very simple. PVC plastic is the way to go when building a robot base. It's easy to cut, drill, tap, glue, and sand. Good sources for PVC plastic are Tap Plastics and MSC Industrial Supply Company.

Bender - No. 1 Thumb


Our design uses just two different PVC plastic parts.

  • Four motor brackets
  • Three 12-inch round disks, each one 1/4 inch thick
    • The top disk holds the gyro and main-control boards.
    • The center disk holds the batteries.
    • The bottom disk supports the motor brackets and motor's driver board.


We connected the disks with four 18-inch threaded rods. The rods allow us to move the disks up and down. That way, we can experiment with different balance positions.

As I completed the design, Ted started to look at the other circuitry we'd need. He came up with the following list.

  • An RC-interface circuit
  • Proportional integral derivative (PID) control software
  • A shaft encoder circuit
  • A main control PIC
  • A balance board
  • A motor drive circuit


Ted researched what it'd take to make a PID motor controller. PID is designed to keep both motors at a constant speed so Bender travels straight, even over small rocks and inclines. This sounds easy, but it wasn't.

Keeping Bender straight

The problem was that there were too many pulses coming from the motor encoder -- about 5,000 counts per revolution. To solve the problem, we added circuitry to divide the encoder counts by 16. This gave us about 312 counts per revolution, which can be handled by the PIC with no problem.

To complete the motor control circuitry, we used a pair of LM18200 motor-driver chips to drive the motors with pulse width modulation (PWM).

After putting all the components together, both electronic and mechanical, the final step was to have Ted write the balancing software. This was a hefty step. It took about two months, but it was well worth it.

Bender Standing - Thumb


This has been the most exciting robot project we've built to date. Getting this robot up and running inspired us to build two smaller balancing robots, half Bender's size, that we plan to make autonomous.