TedLarson.com
Home R/C Airplanes Home Workshop Robots AI Projects

 

Balancing Robot
Odyssey Robot
Tabletop Challenge
Fire-Fighter
Teamwork Bots
Lego Bots
AIME Bot
BotStack
My Electronics Lab
Robot CAD Symbols
Robotic Events
Robot Links

Home -> Robots -> Balancing Robot Project

Balancing Robot Project - "Bender"

I am currently working on a large, self-balancing robot.  I have teamed up with my friend Bob Allen, also in the San Jose Home Brew Robotics Club, to undertake this ambitious project.

The current goal, is to get this platform, self-balancing, and then to use it as a base-platform for building an autonomous rover.

Latest Updates:

(9/26/04): Flexo the balancing robot makes his debut at the 2004 Seattle Robothon, and takes the "Best Engineered Robot" award for the show.

(4/1/04):  It's Robot Week on Tech TV's, The Screen Savers, and we have been invited back to show off our latest developments with balancing robots.   We had a great time on the show.  Here is the link to their site, with the lowdown on the episode, and bonus footage not seen on the show.  It was the first debut of the autonomous self-balancing robot.

(3/21/04):  Bender takes home the Gold Medal in the Open class at the 1st annual Robolympics in San Francisco!!

(2/1/04):  Look for Bender in the February 2004 issue of "Servo Magazine", in the Robot Menagerie on page 41.  Actually, the robot pictured, is ISIS, but since they are twins, it's hard to tell them apart :-)

(1/20/04):  We now have a miniature version of the balancing robot that stands 16" tall, and is suitable for tabletop use.  This smaller platform uses off-the-shelf motors, not purchased at surplus, so we can easily make another robot and be able to find parts.

(10/27/03):  Both balancing robots participated in the Balancing Robot Symposium at the Seattle Robothon.   Most of the two-wheeled balancing robots (that actually work correctly and can stay balanced indefinitely) showed up.  Scroll to the bottom of the page for pictures and commentary.  It was awesome to meet fellow balancing robot builders from around the country!

(10/01/03):  I did some work on an article for Fortune Magazine called "Geek-Eye for the Luddite Guy".   They really liked that I was a robot builder, and thought it added to my "geek" credibility.  Anyway, they shot some photos of me holding the balancing robot, and it ended up in the table of contents for the magazine!   Unfortunately, the online version of the story doesn't have the photos.  Anyway, look for me and "Bender" in the October 6th issue of Fortune magazine!

(08/01/03):  TechTV invited us to come on their live technology TV show, "The Screen Savers", and talk about the robot.  We had a great time on the show, and really enjoyed the invitation.  Click on THIS LINK to see the details of the show, and the video clip of our appearance.  The clip is about half way down the page on the show details.

(06/27/03):  We took the balancing robot to the San Francisco Robotics Society of America annual expo, and it was a big hit!  It took 2nd place in the Best of Show.

 

The Initial Platform:

Bob came up with a brilliant yet simple mechanical design that utilized a strong aluminum frame to house the motors, and drive system, with PVC plastic tiers.  It is both lightweight and very strong.   Initially we hooked up the drive system via an R/C radio, to drive it around, and test the drive system.  Here it is, taking a stroll around the back yard, on it's way to terrorizing the unsuspecting dog who is busy sniffing the grass.  I dunno what it is about the dog, and things with wheels, like a wheelbarrow, or a vacuum cleaner, but the dog always seems to run around in-front of it barking at it.


Here is an underside shot of the milled aluminum frame, and motor mounting housing.  It is using some excellent motors we acquired at a local industrial surplus place, that have some very fine-grain shaft encoders pre-mounted on them.  The casters are basically training wheels that can be removed when we start the balancing experiments.

 

I shot some video of these test drives around the back yard.  It is in Windows Media 9.0 format.  Click Here to download and view the video.

The Updated Test Platform:

The initial platform is big and exciting, but it quickly proved too large to be a viable test platform.   Early testing with the big bot, damaged a couple of walls in my house.  Fears of having it run away from me, and blow literally through a wall, drove a decision to scale things down to get it debugged.  Then we can super-size it back up to the larger platform. 

 Here it is with the training wheels attached for debugging the PID algorithm.  Notice it has a tether attached to it so it doesn't run away without me, and so I can power it via a test supply, without having to load up all the batteries right away.


Brains:

Here is the self-designed robot balancing brain, all cooked up on a prototype board, and mounted to the top of the robot. The main CPU is a Microchip PIC18F452.  It has sub processing units for taking shaft encoder input from the motors, sending motor control signals to the speed controllers, and taking R/C input from radio.   Lots of software to write to make it all work right. Yippee!

Like I had mentioned before, early tests of the large bot proved unmanageable.  So, we needed to scale everything down to fit on the new, smaller test platform.  As you can see, that prototype board is too big to strap to the top of the smaller robot.  So, I took the circuit, put it into a CAD program, and we had some printed circuit boards made to scale everything down.  The main processor board is on the left, and the gyro board is on the right.

Balancing:

Here is the big balancing robot, all loaded up with the necessary gear to start doing some balancing tests.  The brain is all mounted up, and the batteries have been moved up high on the robot, in order to make it as top-heavy as possible.  Remember, it is always easier to balance a broom with the wicker end up rather than in your hand.  

Balancing is accomplished by using a small piezo-electric gyro (Tokin CG16DO)  combined with the output of a two-axis accelerometer (Memsic MXD2125-GW).  The gyroscope is a type commonly used for doing image stabilization in a camcorder, and the accelerometer, is of a type commonly used for building airbags to deploy in a car accident.  One of the goals of the project was to use inexpensive parts, and make up for any hardware issues with really good software.  In the PCB photo above, you can see the gyro and the accelerometer in the right hand portion of the photo.  They look like two little silver metallic boxes.  As far as I know, we are currently the only ones using the Memsic accelerometer in a balancing robot.  Most people are using the Analog Devices accelerometer.

ALL BALANCED (YAY!):

Here is the smaller test platform, balancing out in the back yard.  Look MA! Only two wheels!

It has the PCB mounted on it, and has been made a bit taller to get the center of mass up nice and high. 

It took quite A-LOT of work to get it to balance the first time.  Lots of trial and error.  I shot some videos along the way.

Baby's First Steps (2.2 meg) - First time it got to balancing was late on a Friday night.  The balancing algorithm is still a little shaky, but it is standing on it's own two wheels!

Backyard Balance (3.6 meg)- Here it is, much smoother now, on the nice, uneven surface of the brick patio, smoothly balancing.

Kitchen Rampage (4.2 meg) - I finally got the remote control algorithms working.  Now I can drive it around R/C.  Here it is, tearing around the kitchen floor.  My driving is not too good, but it doesn't fall down! Even when I crash it into a kitchen cabinet.  My house is getting more and more robot damage. ;-)

Robot Expo (3.8 meg) - Here is some footage of it balancing at the SF Robotics Society of America Robot Expo & Games.  It balanced for about 6 hours straight, and only fell over once when I accidentally drove it into my leg going full speed.  This was its longest balancing endurance yet.  It is amazing how good the battery life on a balancing robot is, since the motor is only delivering small corrections it draws very little current.

Bob recently got his balancing robot working too.  Here is a shot of the two of them balancing together at a recent robot club meeting.

Bender Gets a Head:

Bender has a head!  Thanks to the great design skills of Bob Allen.  The head can pan and tilt.  It adds some interesting additional complexity to the balancing problems to compensate for head movement, but it won't be that complicated to do...just a little more code!

Balancing Robots at the Seattle Robothon:

Most of the balancing robots in North America, (that actually work properly and can stay balanced indefinitely), showed up at the Seattle Robothon for a Balancing Robot Symposium.  It was inspirational to meet fellow balancing robot builders such as Dave Anderson, and Larry Barello.  Here is a shot of all the robots balancing together, like birds of a feather.  From left to right, the Legway, nBot, Gyrobot, Isis, and Bender.

Dave Anderson shot lots of video of nBot and bender balancing together, and belly bucking.  Hopefully his website will soon be updated with some fun clips. I learned a ton from seeing the other robots in-action, and sharing ideas with the other builders. 

Here are Bender and Isis all strapped into the back seat of the rental car for the trip over to the Seattle Center for the Robothon.  They survived the trip on the airplane quite nicely, thanks to lots of packing foam and a couple of big boxes, although I am sure the TSA didn't like them.

Overall, we had lots of fun at the Robothon.  Hats off to the Seattle Robotics Society for a well planned and executed event!

 


Mini Balancing Robot(s):

Mini-Bender Mini-ISIS

The first rework of the PCB is done.  We wanted to make another balancing robot, using off-the-shelf motors that wouldn't set us back lots of $$$.    As you might remember, Bender and ISIS are using surplus motors, which we can't hope to find again, unless we get really lucky.  We found some smaller motors that were only $15 new, and that had tail shafts to allow the mounting of a small optical encoder for motor feedback.  So, we had to scale down the mechanical design to one that the motors could accommodate.

Although we built two of these, they are both not yet perfect. Bobs was the first to be up and running.  It still needs a little bit of software work to make it more stable, but initial tests are encouraging.  Once I had it balancing, Bob took it home, and mounted a much larger battery pack on it than I had used in the initial tests.   When he showed up with it at the latest robot club meeting, I was really surprised to see how the extra mass helped the balancing stability.  Lately we have also been experimenting with gyro mounting locations, and it appears to be much more stable with the gyro/accelerometer board mounted down low on the robot, rather than up high, which is something that was not an obvious thing to do.  

Here are some video clips of mini-Bender.  These clips are in Windows Media Player 9.0 format:

bulletMini-Bender #1 - Here he is, balancing on the kitchen floor, looking pretty stable.
bulletMini-Bender #2 - I have the radio control unit hooked up, and am taking him for a spin around the kitchen floor.  It's a bit difficult to drive and film at the same time, but at least I don't run into anything :-)

Bender Takes the Gold at Robolympics

Bender was awarded the Gold Medal in the "Best of Show" category at the 1st annual Robolympics.  Here is a photo of bender wearing his gold medal.  As you can see he has become quite wirey from all the experiments.  I hope soon to perform some hardware upgrades on him, to clean up his boards, and make him more autonomous.

 

Balancing Robot goes AUTONOMOUS!:

We finally added the complete board stack to the mini-ISIS, to make mini-ISIS go autonomous!  We mounted a pan-tilt camera head, so it can chase some toys like my tabletop challenge robot.  It has a separate CPU board controlling the higher level functions.   We have been dreaming about doing this for awhile, but we really only started the whole process about 2 weeks ago.   One of the producers from Tech TV's, The Screen Savers, ran into us at the Robolympics, and was asking "So what are you guys working on that we haven't seen yet??"  And we said, well, we're working on mounting a camera on top of the robot, and his reply was "Thats cool!  Can you have it done next week for the show?!?"   A week later, it's working, and ready for it's debut on TV.

There were several major problems to be solved to make mini-bender autonomous with a camera on top.

  1. Mount a pan-tilt head on the robot
  2. Update the camera software and hardware from Tracker-bot, so that it was smoother, and could track faster.
  3. Build and tune a velocity-control algorithm so the robot could automatically adjust its tilt angle to achieve a constant wheel velocity.
  4. Write software to take the box tracking information, and convert that into the appropriate wheel geometry to steer and drive the robot toward the target.

Here are some video clips of the initial tests of some of each of these development components.  Again, as with all my videos, these are all Windows Media Player 9.0 format:

bulletPan-Tilt Camera Test (4.9 meg)- Video of the initial tests of the camera head, tracking the little red box from tracker-bot.
bulletDriving Test  (1.6 meg)- Early test of driving forward with constant velocity.  The algorithm is still a little clunky and needs some tuning at this point, but it does make it across the kitchen, despite crashing into the noisy dishwasher
bulletSteering Test (1 meg)- I needed to make sure that the robot could steer itself properly, and still maintain constant forward velocity.
bulletTarget Tracking (3.2 meg)- I took the robot to the club meeting only hours after finishing it.  I mounted a little red target on the end of a stick, that the robot could follow around.  Here is one of it's first demonstrations at the Home Brew Robotics Club.
bulletChildren Tracking (2.4 meg)- A new member of the club showed up to the meeting, and little did he know that his red shirt would attract self-balancing robots ;-)

Return to Tech TV's The Screen Savers:

Here I am on the set of The Screen Savers, with mini-ISIS doing his balancing thing.  It was great to be back on the show, and have lots of progress to report since our last appearance there, last year.  The hosts and producers of the show are really nice people, and we had an excellent time!

Flexo - The Balancing Robot

Yes, I finally put the finishing touches on my mini, balancing robot that does color tracking.  His name is Flexo.  Yes...after Benders smarter brother.  I used Flexo extensively for testing cone tracking techniques for our Robo-Magellan contest entry.   Here is Bob showing Flexo's cone tracking technique. 

Video Clip of Cone Tracking - (4.3 Meg)

Flexo has sonar onboard, so we can send him into a crowd, and he will find someone wearing red and follow them around without running into them. We took Flexo with us to Seattle for the 2004 SRS Robothon, and he was a big hit.  Every time we powered him up, he drew a good sized crowd, and almost always, he found someone wearing red to make friends with.

Sure enough, birds of a feather flock together, he ran into his big, balancing, distant cousin, a Segway, and it's owner was kind enough to let me get a photo of the Segway, and Flexo, balancing together.

Flexo took the "Best Engineered Robot" award at the 2004 Robothon.  Here is a snapshot of Flexo with his award ribbons, and Odyssey, our Robo-Magellan Robot, which took 2nd place in the Robo-Magellan competition.

Next steps for Flexo, are better navigation techniques for roaming around, and a better camera/vision system for doing more than just following the color red.

Next Steps:

That's it for now!  Still a little bit more work to do!  I need to make the software a bit smoother still.    We are going to go to the next level with the autonomy, and get it roaming around the house, and working more on autonomous navigation.  We have toyed with the idea of making our Robo-Magellan entry a balancer for next years competition.

We are going to do another run of boards, and then will be time to mount it up to the BIG BOT and try not to damage the house this time!  MORE ON THIS LATER!

Links to other Balancing Bots:

bulletBob Allen's balancing robot - Bender's brother ISIS.
bulletnBot - David Anderson's balancing robot, that was part of the inspiration to embark on this project.  David has some excellent video clips of his balancing robot in-action going over all kinds of varied terrain.
bulletGyrobot - Larry Barello of the Seattle Robotics Society built this balancing robot.
bulletTrevor Blackwell has built a self-balancing scooter.  A DIY Segway.  It looks like lots of fun to ride!  I especially like how he built it from spare parts laying around his shop.    Gotta love that extruded aluminum!
bulletSpider - Francisco Lobo has a pretty big balancing robot, that was inspired by Trevor's scooter design.  Good work Francisco!
bulletLegWay - Steve Hassenplug has built a 2 wheel robot using Lego Mindstorms, and it uses IR detectors to balance and do line following
bulletJoe - A group of French students at LEI have created an R/C balancing robot using signal processing techniques.

Links to other Balancing Resources:

bulletKalman Filters - This is the authoritative source for learning on Kalman Filters.
bulletRotomotion - Makers of several IMU units and AHRS.   I bought some Gyros I used in my early balancing robot, "Bender",  from these guys, and they sent me a cool, free T-Shirt!

 

(c) 2010 Ted Larson  ALL RIGHTS RESERVED