Walking Robot Project

As a way to guilt myself into doing more work on this project, I'm going to try and make this page a very visible reminder to myself to get going on the project. Please excuse the HTML- I'm typing this in in VI, so there may be errors. This page will be a log of the progress.

Objective

Build a small 4 legged walking robot. This robot uses small, cheap, servos as the "muscles". It will be dynamically stabilized by the movement of a small servo controlled weight which will shift the center of gravity so that the robot is always stable. Each leg will use two motors and will move in a way that seems to me to be unique. I've been getting some help from my friend Glen, who has as little time as I do to work on the project.

Progress

July 25, 2000

Roughly a year after I conceived of it, I've decided to start documenting this robot on the web. I received the prototype PCBs yesterday from APCircuits. They were delivered as advertized, though it took a bit of tweaking of the gerbers to stay within their drill limitations, since extra drills would have increased the price by 100%. I've made the schematics and board design (top) (bottom) available.

The brains of the robot will be 5, yes, 5 Microchip PIC16F877s (datasheet). It may be overkill, but I wanted a multiprocessing challenge! One '877 will be the primary controller, and there will be one '877 per leg. The processors will talk to each other via I2C, and to the outside world via RS232. I chose this processor because of Microchip's very reasonably priced ICD, which will (hopefully) make the programming easier. I'm also planning on using the I2C to talk to an Analog Devices ADXL202 (datasheet), which will be used to automatically keep it level on varying terrain.

I've collected a bunch of the hardware for the legs, using mostly R/C hardware and brass square section tubing. I've been looking for some 1" C-channel aluminum- which nobody seems to have. I've picked up a bunch of servos from Tower Hobbies. For cheap servos, I haven't found any better place - about $10/servo.

September 20, 2000

partially completed board After a few DigiKey and Pioneer orders, I finally started populating the leg controller board. I'm not necessarily fully populating it, but I'm going to do enough at this point so that I can prove the functioning of the leg. I'm putting in the support for the center processor (the master) and the processor on the lower right (in the picture to the right). I still have to get some things (like a right angle 9 pin female connector and some ferrite beads) but I should be able to start moving servos soon, and start playing with I2C.

As to the leg- I've gotten a couple pieces of it together, but it looks kind of pathetic, so I'm not going to post a picture until it is a bit more complete. I've got the basic concept going, but I need to find a couple things. First, a good source of long 2-56 screws! I bought an assortment from DigiKey, but the 2-56 screws that came with it are just too short. I have some 2-56 allthread that I got from a local hobby store but I'd rather use screws for some things. I guess on my next trip there I'll have to ask if they have any 2-56 hardware. My next problem requires a bit more creativity to solve- I need to figure out a way to mount 2 servos together, so that their rotation axes are co-linear and facing each other, with enough room to mount all the leg-bits. This is one of the key points behind my leg design, with the proper geometry, the math gets relatively simple. I will go into the basic ideas behind the servo controls of the leg later, hopefully. (Never trust a promise to put up content on the web.)

September 24, 2000

I think I've figured out how to make the base for the robot- I found some overpriced aluminum at the local hardware mega-store. I found some angle-aluminum there too which will work as rails to support the servos as legs. Kinda hard to describe with just words, so I'll wait until I can get a picture of it together. I just have to cut the pieces to fit properly.

September 30, 2000

one legI've made the base, though I think the servo position will evolve. One leg is complete enough for me to start taking the code that Glen and I worked on a while ago, and make a leg move. Before I can do that, I need to do a bit more on the processor board, which is still in the same shape that you see above. I need to mount a few more capacitors, LEDs, resistors, and a connector for power.

The frame is almost complete, I used four pieces of angle aluminum which will act both to strengthen the aluminum plate, and also to mount the servos, as you can see in the picture to the right. I need some more strengthening across the plate, but this will work for now.

October 19, 2000

I've been doing a lot of work, though there hasn't been much real progress, so I haven't posted anything in a while, but tonight I got (one) leg to make a walking motion. It is still far from what I need it to do, but this shows the concept. Here's a short (5 second) movie of it making that motion. Now I've gotta make it work, and make 3 more legs. The spring looking thing thing in the picture above is just that, a springy type thing. It is just holding the platform up.

October 23, 2000

I've been tuning the algorithm- I've tried to smooth out the motion by increasing the size of the sine and cosine lookup table to as big as they can get in a simple table- 256 bytes (at least I think that is as big as I can get- I had to make careful use of org statements and the PCLATH register). I think it is moving a bit smoother now. It takes up lots of space, but I have lots on the chip. I don't think I have the discipline to fully program the full 8K words on the '877. I had to write a Perl program to generate the tables. I've normally used a spreadsheet to do it, but I don't seem to have one with a decimal to hex function anymore. I could use decimal, but the Perl program is much more useful, configurable, and the hex output is much prettier.

December 4, 2000

Finally some progress on the I2C code. Mostly, I've used the code as provided in the Microchip Application notes AN734: Using the PICmicro SSP for Slave I2C Communication (source) , and AN735: Using the PICmicro MSSP Module for I2C Communications (source) . Here's my source for the master and slave. I've also used a scope to take a couple pictures of what the signal actually looks like: slave address of 7 and slave address of 4. What you see in these is a write, and then a read back of the same data. I'm not exactly sure what is happening at the right side of the display, but it does appear to work, despite my consternation.

Now what I need to do is integrate the leg code, and then write the code to drive the master. I also have a lot of mechanical integration to do also, but I haven't been concerned about that, I know I can do that part. I've just never used the MSSP on a PIC before.

December 6, 2000

I've been coding some more, I have the code for the leg mostly done. I need to cobble up something to test that. I've also been thinking about the basic gait of the robot. I'm really have no clue on the true mechanics of walking, but I have an idea that I think will pull it off, preferably with the minimum of real decision making on the part of the master control processor. Divide and Conquer.

January 1, 2001

Into the new year- I have been making progress, though slowly. Not much in the past couple weeks, due to travel to the old homestead to see friends and family, despite the best efforts of Delta. Note to self: If I ever really want to actually get somewhere on a plane, don't fly Delta.

I think I have the I2C stuff squared away, though I did cheat a little, forcing retries if the message doesn't get through. One nasty thing about the PIC's implementation of I2C- the MSSP reads one of the bits on the wrong edge of the clock, which doesn't follow the specification, which makes it virtually impossible to do the data rates that Microchip advertizes. Apparently Microchip knows about the bug, but they don't actively disclose it. I read about this on the Piclist, with a sort-of fix. Here's a link to the actual post. You'll have to check here for the password to get into the archives.

So, the inter-PIC communication works for the most part now, and I'm trying to verify if some of the feedback I'm getting is a wierdness of the ICD or my code.

January 28, 2001

I've done a bit more of the mechanical work I've been avoiding, but thanks to my Dremel Tool, I was able to do it pretty well. Not quite as pretty as if I had a milling machine, but I can dream, can't I? I rotated the servos, which makes them mounted a bit more firmly. Now I have nothing holding me back from completing the rest of the legs.

February 7, 2001

Robot's first stand IT STANDS Major milestone here- I got the robot (I guess it needs a name) to stand, as shown by the picture to the right. The servos are holding it up- I disconnect the power, it falls. I know I have a lot more work to do to make it actually walk, but to tell the truth, I wasn't sure until today that it would be able to hold up its own weight. I have to calibrate the legs, since the servos don't seem to all have the same position for the same pulse width, but I expected that. I'd prefer to have them auto-calibrate, but I don't think that will happen until I have much more free time, so probably never. There are more important problems to solve. The only mechanical part I have left to do is to make the balance weight and then I will be ready to tackle trying to make it walk. I have an outline of how I'm going to do it, I just have to implement, and make sure that I can talk to all 4 microcontrollers.

I realize the picture is a bit cluttered, and it is hard to see how it is put together, but I need to sleep. I'll have better pictures soon.

Whoo Hoo!

November 13, 2001

In case you're windering why I haven't touched this in a pretty long time: a few days after I wrote the above log, I was trying to debug some I2C code, and I left the room to attend to something- I came back to a bad smell and a Tantalum capacitor that caught fire. I'm not sure why- the capacitor was installed correctly, and being used well within it's working voltage. I pulled the capacitor, but for some reason there still is a short on the power supply rails. This discouraged me pretty severely, plus I always have plenty of other projects to worry about. I'll get back to this one of these days.

November 29, 2001

Oh well, it appears that the capacitor in question was not installed correctly. It looks like there is a mistake in the polarity symbol I put into the copper. I'm charging the batteries right now to see if anything still works.


Back to Matt's Project Page.
Back To Matt's page.
This page was last modified 228 weeks ago, on Wed Aug 18 2004.

All information contained on this page is © 2001, Matthew J. Bennett, and may not be reproduced, archived, mirrored, bought, sold, or bartered without express written permission of the Author.