Introduction: Hexabot: Build a Heavy Duty Six-legged Robot!
Runner Up in the
Craftsman Workshop of the Future Contest
I constructed this robot as a final project for Making Things Interactive, a course offered at Carnegie Mellon University.
Typically, most of the robotics projects I've done have been on the small scale, not exceeding a foot in their largest dimension. With the recent donation of an electric wheelchair to the CMU Robotics Club, I was intrigued by the thought of using the wheelchair motors in some sort of big project. When I brought up the idea about making a large-scale something with Mark Gross, the CMU professor who teaches Making Things Interactive, his eyes lit up like a kid on Christmas morning. His response was "Go for it!"
With his approval, I needed to actually come up with something to build with these motors. Since the wheelchair motors were very powerful, I definitely wanted to make something that I could ride on. The idea of a wheeled vehicle seemed kind of boring, so I began thinking about walking mechanisms. This was somewhat challenging since I only had two motors at my disposal and still wanted to create something capable of turning, not just moving forwards and backwards. After some frustrating prototyping attempts, I began looking at toys on the internet to get some ideas. I happened to find the Tamiya Insect. It was perfect! With this as my inspiration, I was able to create CAD models of the robot and begin construction.
During the creation of this project, I was stupid and didn't take any pictures during the actual construction process. So, to create this Instructable, I took the robot apart and took pictures of the assembly process step-by-step. So, you may notice that holes appear before I talk about drilling them, and other little discrepancies that wouldn't exist if I had done this right in the first place!
Edit 1/20/09: I discovered that, for some reason, Step 10 had the exact same text as Step 4. This discrepancy has been corrected. Step 10 now tells you how to attach the motors, rather than telling you how to machine the motor linkages again. Also, thanks to Instructables for saving a history of edits, I was simply able to find an early version with the right text and copy/paste it in!
Step 1: CAD Model
Using SolidWorks, I created a CAD model of the robot so I could position components easily and determine the location of holes for the bolts that connect the legs and linkages of the robot to the frame. I didn't model the bolts themselves to save time. The frame is made from 1" x 1" and 2" x 1" steel tubing.
A folder of part, assembly, and drawing files for the robot can be downloaded below. You'll need SolidWorks to open the various files. There are some .pdf drawings in the folder as well, and these are also available to download in subsequent steps of this report.
Step 2: Materials
Here's a list of the materials you'll need to construct the robot:
-41 feet of 1" square steel tubing, 0.065" wall
-14 feet of 2" x 1" square rectangular steel tubing, 0.065" wall
- A 1" x 2" x 12" aluminum bar
-4 5" 3/4-10 bolts
-2 3" 3/4-10 bolts
-6 2 1/2" 1/2-13 bolts
-6 1 1/2" 1/2-13 bolts
-2 4 1/2" 1/2-13 bolts
- 4 3/4-10 standard nuts
- 6 3/4-10 nylon insert lock nuts
- 18 1/2-13 nylon insert lock nuts
- 2 3 1/2" ID 1/2-13 U bolts
- Small bolts for set screws (1/4-20 works well)
- Washers for 3/4" bolts
- Washers of 1/2" bolts
- 2 electric wheelchair motors (these can be found on ebay and may cost anywhere from $50 to $300 each)
- Some scrap wood and metal
- Microcontroller (I used an Arduino)
- Some perfboard (a proto shield is nice if you're using an Arduino)
- 4 High current SPDT relays (I used these automotive relays)
- 4 NPN Transistors that can handle the voltage put out from the battery (TIP 120's should work fine)
- 1 high current on/off switch
- A 30 amp fuse
- Inline fuse holder
-14 gauge wire
- Various electronics consumables (resistors, diodes, wire, crimp on terminals, switches and buttons)
- An enclosure to house the electronics
- 12V sealed lead acid batteries
Additional components you may want to add (but aren't necessary):
- A chair to mount to your robot (so you can ride it!)
- A joystick to control the robot
Step 3: Cut and Drill the Metal
After procuring the metal, you can begin cutting and drilling the various components, which is a pretty time consuming task.
Begin by cutting they following quantities and lengths of steel tubing:
1" x 1"
- Frame rails: 4 pieces 40" long
- Leg linkages: 6 pieces 24" long
- Center cross member: 1 piece 20" long
- Cross members: 8 pieces 18" long
- Motor supports: 2 pieces 8" long
2" x 1"
- Legs: 6 pieces 24" long
- Leg supports: 4 pieces 6 " long
After cutting the steel tubing, mark and drill the holes according to the drawings provided in this step (the drawings are also available with the CAD files in Step 1). The first drawing provides the hole locations and sizes for Leg supports and Motor support. The second drawing provides the hole sizes and locations for the Legs and Leg linkages.
*Note* The hole sizes in these drawings are the close fit sizes for 3/4" and 1/2" bolts, 49/64" and 33/64", respectively. I found though, that just using 3/4" and 1/2" drill bits make better holes. The fit is still loose enough to insert the bolts easily, but tight enough to eliminate a lot of slop in the joints, making for a very stable robot.
Step 4: Machine the Motor Linkages
After cutting and drilling the metal, you'll want to machine the linkages that connect to the motor and transfer power to the legs. The multiple holes allow for changing the step size of the robot (though you can't do that on mine, I'll explain why in a later step).
Start by cutting the 12" aluminum block into two ~5" pieces, then drill and mill the holes and slots. The slot is where the motor is attached to the linkage, and the sizing of it is dependent upon the shaft of the motors that you have.
After machining the block, drill two holes perpendicular to the slot, and tap them for set screws (see second image). My motors have two flats on the shaft, so adding set screws allows for extremely rigid attachment of the linkages.
If you don't have the skills or equipment to make these linkages, you could take your part drawing to a machine shop for manufacture. This is a very simple part to machine, so it shouldn't cost you much. I designed my linkage with a flat-bottomed slot (so I could secure it with a preexisting bolt on the motor shaft, as well as take advantage of the flats on the shaft), so that's why it needed machining in the first place. However, this linkage could be designed without a slot but rather a large through hole, so all the work could theoretically be done on a drill press.
The drawing I used for machining can be downloaded below. This drawing is missing the dimension of the depth of the slot, which should be marked as 3/4".
Step 5: Weld the Frame
Unfortunately, I did not take pictures of the process I went through to weld the frame, so there are only photos of the finished product. Welding itself is a topic to deep for this Instructable, so I won't get into the gritty details here. I MIG welded everything and used a grinder to smooth out the welds.
The frame uses all of the steel pieces cut in Step 3 except for the Legs and Leg linkages. You may notice that there's a few extra pieces of metal in my frame, but these are not critical structural components. They were added when I already had most of the robot assembled and decided to add some additional components.
When welding the frame, weld every joint. Anywhere that two different pieces of metal are touching, there should be a weld bead, even where the edge of a piece of tubing meets the wall of another. The gait of this robot subjects the frame to a lot of torsional stresses, so the frame needs to be as rigid as possible. Welding every joint completely will accomplish this.
You may notice that the two cross members in the middle are slightly out of position. I measured from the wrong side of the tubing when initially laying out the bottom half of the frame for welding, so the positions of those two cross members are off by 1 inch. Fortunately, this has little effect on the rigidity of the frame, so I wasn't compelled to remake the entire thing.
The pdf files presented here are drawings with dimensions to show the position of components in the frame. These files are also present in the folder with the CAD files in Step 1.
Step 6: Add Holes for Motor Mounts
After welding the frame, some additional holes need to be drilled for secure mounting of the motor. First place one motor into the frame, and add a bolt through the front mounting pivot and the Motor support on the frame. Make sure the motor drive shaft is sticking out of the frame, and that the motor is over the Center cross member.
You'll see that the barrel end of the motor is over a cross member. Place your U-bolt over the motor and center it on the cross member. Mark the location where the two ends of the U-bolt are positioned on the frame. These locations are where the holes must be drilled. Remove the motor. Now, since there is an upper cross member that would interfere with drilling, the frame needs to be turned over. Before the frame is turned over, measure the locations of these holes from the side of the frame, then turn the frame over and mark the holes according to the measurements you just took (and make sure you're marking on the correct side of the frame).
Drill the hole closer to the center first. Now, for the second hole close to the frame rail, some care must be taken. Depending on the size of your motor, the hole may be positioned over a weld that connects the cross member to the frame rail. This was the case for me. This puts your hole over the side wall of the frame rail, making drilling much more difficult. If you try to drill this hole with a regular drill bit, the geometry of the cutting tip and flexibility of the bit will not allow it to cut through the side wall, but rather bend the bit away from the wall, resulting in an out of position hole (see sketch).
There are two solutions to this problem:
1. Drill the hole with and end mill, which has a flat cutting tip to remove the side wall (requires clamping of frame onto drill press or mill)
2. Drill the hole with a drill bit, then file the hole to the correct position using a round file (takes a lot of effort and time)
After both holes are sized and positioned, repeat this process for the motor on the other side of the frame.
Step 7: Prepare Motors for Mounting
After drilling the holes for the motor mounts, the motors need to be prepared for mounting.
Locate one motor, along with an aluminum motor linkage, the set screws for the linkage, and a 5" 3/4-10 bolt. First, place the 5" bolt in the hole closest to the slot for the drive shaft, and place the bolt so that it will be pointing away from the motor when the linkage is attached to the motor. Next, place the linkage/bolt assembly on the drive shaft. Add the nut to the end of the drive shaft (my motors came with nuts for the drive shaft), and thread in the set screws by hand. Finally, tighten nut on the end of the drive shaft as well as the set screws.
Repeat this step for the other motor.
Step 8: Prepare the Legs for Moutning
The Legs cut in Step 3 need some final preparation before they can be mounted. The end of the leg that contacts the ground needs a "foot" added to protect the robot from damaging floors, as well as control the friction of the Leg on the Ground.
The bottom of the Leg is the end with a hole 1 3/8" from the edge. Cut a piece of wood that fits inside the leg, and drill a hole in the wood block so that it sticks out about 1/2" from the end of the tube. Bolt it in place with a 1 1/2" 1/2-13 bolt and nylon lock nut.
Repeat for the five remaining legs.
Step 9: Begin the Assembly
With the previous steps completed, the assembly of the robot is ready to be completed!
You'll want to prop the frame up on something when you're assembling the robot. Milk crates happen to be the perfect height for this task.
Place the frame on your supports
Step 10: Mount the Motors
Take one motor and put it into the frame (like you did when marking the mounting holes for the U-bolts). Add a 4 1/2" 12-13 bolt and lock nut, and tighten everything so that the motor is pulled up against the frame, but you are still able to move pivot the motor about the bolt.
Now, if your holes weren't drilled perfectly (mine weren't), then the the head of the drive bolt will be hitting the Center cross member. Before I discussing the solution to this problem, I'd like to point back to Step 4 where I mentioned that I couldn't change the step size on my robot. This is why. As you can clearly see, if the bolt were placed in any other hole, the head of the bolt would hit either the Center cross member or the frame rail. This problem is a design flaw that came about from my neglecting the size of the bolt head when I made my CAD model. Keep this in mind if you decide to make the robot; you may want to alter the size or position of components so that this doesn't happen.
The immediate bolt head clearance problem can be alleviated by adding a small riser under the barrel of the motor over the cross member. Since the motor can pivot about the main mounting bolt, raising the barrel of the motor raises the drive shaft, so we can get the necessary clearance. Cut a small piece of scrap wood or metal that lifts the motor enough to provide clearance. Then, add the U-bolt and secure it with lock nuts. Also secure the nut on the main mounting bolt.
Repeat this step for the other motor.
Step 11: Add the Leg Axles
With the motors mounted, the leg axles can be added. Add the front axles first. The front of my robot is indicated in the first picture below. Take a 5" 3/4-10 bolt and insert it so it is sticking out of the frame. Next, add two washers and two 3/4-10 standard hex nuts. Tighten the nuts. Repeat this process for the other front axle.
Add the rear axles next. Insert a 3" bolt pointing out from the frame. Add 3 washers. Repeat for the other rear axle.
Finally, add three washers to each drive bolt on the motor linkages.
Step 12: Add the Rear Leg and Linkage
These next three steps will be performed on one side of the robot.
Locate a Leg and a Linkage. Place the leg on the rear bolt, and add a 3/4-10 nylon lock nut. Do not tighten it yet. Make sure the wooden foot is pointing towards the floor.
Add the linkage by first putting it on the drive bolt. Then, using a 2 1/2" 12-13 bolt, connect the other end of the linkage to the top of the leg, placing a washer between the two. Add a nylon lock nut as well, but do not tighten it.
Step 13: Add Middle Leg and Linkage
Locate another Leg and Linkage. Add the leg to the drive bolt over the first linkage, with the wooden foot pointing towards the ground. Add the first linkage to the front axle, then join the linkage to the leg in the same manner as is Step 12. Do not tighten any bolts.
Step 14: Add the Front Leg and Linkage
Locate a third Leg and Linkage. Add the leg to the front axle, with the wooden foot pointing toward the ground. Add the linkage the drive bolt, then connect it to the top of the leg as was done in Step 12. Add a 3/4-10 nylon lock nut to the drive bolt and front axle.
Step 15: Tighten the Bolts and Repeat 3 Previous Steps
Now that everything is attached, you can tighten the bolts! Tighten them so that you can't spin the bolt by hand, but they spin easily with a wrench. Since we used lock nuts, they'll stay in position despite the constant movement of the joints. It's still a good idea to check them occasionally in case one has managed to work itself loose.
With the bolts tightened, one half of the robot is done. Complete the previous three steps for the other half of the robot. When that's done, the heavy-duty construction is completed, and we have something that looks like a robot!
Step 16: Electronics Time
With the heavy-duty construction out of the way, it's time to focus on electronics.
Since I didn't have budget for a motor controller, I decided to use relays to control the motors. Relays only allow for the motor to run at one speed, but that's the price you pay for a cheap controller circuit (no pun intended).
For the robot's brain, I used an Arduino mircocontroller, which is a cheap, open source microcontroller. Tons of documentation exists for this controller, and it is very easy to use (speaking as a mechanical engineering student who had no microcontroller experience prior to this past semester).
Since the relays being used are 12 V, they can't just be controlled with a direct output from the Arduino (which has a max voltage output of 5 V). Transistors connected to pins on the Arduino must be used to send the 12 V (which will be pulled from the lead acid batteries) to the relays.
You can download the motor control schematic below. The schematic was made using CadSoft's EAGLE layout program. It is available as freeware. The wiring for the joystick and switches/buttons is not included because it is very basic (the joystick just triggers four switches; a very simple design). There's a tutorial here if you're interested in learning how to properly wire a switch or push button into a microcontroller.
You'll notice there are resistors connected to the base of each transistor. You'll need to do some calculations to determine what value this resistor should be. This website is a good resource for determining this resistor value.
*Disclaimer* I'm no electrical engineer. I have a somewhat cursory understanding of electronics, so I'm going to have to gloss over the details in this step. I did learn a lot from my class, Making Things Interactive, as well as tutorials like this one from the Arduino Website. The motor schematic, which I drew, was actually designed by CMU Robotics Club Vice President Austin Buchan, who assisted me a great deal with all of the electrical aspects of this project.
Step 17: Wire It All Up
I used a Proto Shield from Adafruit Industries to interface the everything with the Arduino. You can also use perfboard, but the shield is nice because you can drop it right on you Arduino and the pins are instantly connected.
Before you begin wiring, though, find something to mount the components in. The space you have inside the enclosure will dictate how things are arranged. I used a blue project enclosure that I found in the CMU Robotics Club.
You'll also want to make the Arduino easy to reprogram without needing to open you enclosure. Since my enclosure is small and packed to the brim, I couldn't just plug in a USB cable to the Arduino, otherwise there would be no room for the battery. So, I wired a USB cable directly into the Arduino by soldering wires to the underside of the printed circuit board. I recommend using large enough box so you don't have to do this.
Once you have your enclosure, wire the circuit. You may want to to periodic checks by running test code from the Arduino every so often to make sure things are hooked up correctly. Add your switches and buttons, and don't forget to drill holes in the enclosure so they can be mounted.
I added a lot of connectors so the whole electronics package could be easily removed from the chassis, but it is entirely up to you if you want to do this or not. Making direct connections for everything is perfectly acceptable.
Step 18: Mount the Electronics Enclosure
With the wiring completed, you can mount the enclosure to the frame. I drilled two holes in my enclosure, then placed the enclosure on the robot and used a punch to transfer the position of the holes to the frame. I then drilled holes in the frame for two sheet metal screws, which secure the enclosure to the frame. Add the Arduino battery, then close it up!
The location of the enclosure is up to you. I found mounting it between the motors to be the most convenient.
Step 19: Add Batteries and Safety Features
The next step is to add the lead acid batteries. You'll need to mount the batteries in some fashion. I welded some angle iron to the frame to create a battery tray, but a wooden platform would work just as well. Secure the batteries with some sort of strap. I used bungee cords.
Wire all of the battery connections with 14 gauge wire. Since I'm running my motors at 12 V (and the relays are only rated to 12 V) I wired my batteries in parallel. This is also necessary since I'm under-volting my 24 V motors; a single battery cannot put out enough current to spin both motors.
Since we're dealing with high current batteries and a large robot, some safety features need to be implemented. First, a fuse should be added between the +12 V terminal battery and the relays. A fuse will protect you and the batteries in the event that the motors attempt to draw too much current. A 30 amp fuse should be sufficient. An easy way to add a fuse is to buy an inline fuse socket. The batteries I used (salvaged from an imitation Segway donated to the CMU Robotics Club) came with an inline fuse socket, which I reused on my robot.
Emergency Stop This is, perhaps, the most important component of the robot. A robot this large and powerful is capable of inflicting some serious damage should it get out of control. To create an emergency stop, add a high current on/off switch in series with the wire coming of off the +12 V terminal in between the fuse and the relays. With this switch in place, you can immediately cut power to the motors if the robot gets out of control. Mount it on the robot in a position where you can easily turn it off with one hand - you should mount it on something attached to the frame that rises at least 1 foot above the top of the robot's legs. You should not, under any circumstances, run your robot without an emergency stop installed.
Step 20: Route the Wires
Once the batteries, fuse, and emergency stop are in place, route all of the wires. Neatness counts! Run the wires along the frame and use zip ties to secure them.
Step 21: You're Ready to Rock!
At this point, the robot is ready to move! Just upload some code to the microcontroller, and you're good to go. If you are powering up for the first time, leave your robot on the milk crate/supports so that its legs are off of the ground. Something is bound to go wrong the first time you start it up, and having the robot mobile on the ground is a sure way to make things worse and less safe. Troubleshoot, and make adjustments as necessary.
My control code for the robot is available for download in the .txt file below.
Of course, the robot is cool now, but wouldn't it be so much cooler if you could ride it?
Step 22: Add a Chair
To make the robot more rideable, add a chair! I could only find the plastic seat to a chair, so I had to weld a frame to it. You certainly don't have to make your own frame if there's already one attached to the seat.
I wanted to make my chair easily removable so the robot would be more usable if I wanted to use it to haul large objects. To achieve this, I created mounting system using aluminum cylinders that fit tightly into the square 1" x 1" steel tubing. Two pegs are mounted to the frame, and two to the chair. They insert into the corresponding cross-sections on the chair and frame. It takes a bit of finagling to get it on and off, but it does mount securely, which is important since movement of the robot is somewhat rough.
Step 23: Add a Joystick
When you're sitting on your robot, you may want to have some means of controlling. A joystick works great for this purpose.
I mounted my joystick in a small box made of sheet metal and some plastic sheet. The emergency stop switch is also mounted to this box. To attach the joystick at a comfortable height for the seated operator, I used a piece of square aluminum tubing. The tubing is bolted to the frame, and the wiring for the joystick and emergency stop is fed through the inside of the tube. The joystick box is mounted to the top of the aluminum tube with a few bolts.
Step 24: World Domination!
You're done! Unleash your Hexabot on the world!
Step 25: Epilogue
I learned a lot in the process of building (and documenting) this robot. It's definitely the proudest accomplishment of my robot building career.
Some notes after having ridden and operated Hexabot:
-The the phase of the rotation between the two motors affects the robot's ability to move around. It seems that adding encoders to the motors would allow for better control of the gait.
-The wooden feet do protect floors, but are not perfect. There tends to be a decent amount of slippage on the surfaces I have tested it on so far (a wooden floor, smooth concrete floor, and linoleum floors).
- The robot may need feet with a larger surface area to walk on grass/dirt surfaces. Though I haven't tested it on these surfaces yet, it seems that, due to its mass, it may tend to sink into the ground due to the small surface area of the feet.
- With the batteries I have (2 12V 17Ah lead acids wired in parallel) the run time of the robot seems to be about 2.5 ~ 3 hours of intermittent use.
- With the motors I have, I estimate the capacity of the robot to be about 200 pounds.
Step 26: Credits
This project wouldn't have been possible without the assistance of the following individuals and organizations:
Professor of computational design in CMU's school of architecture
Thanks to Mark for teaching me programming, electronics, and above all else, encouraging me to do this project!
Scene Shop Supervisor, CMU Drama Department
Ben was my instructor for the welding class I took this past (Fall 2008) semester. He also was also able to get me all of the steel tubing I needed for free!
CMU Robotics Club 2008-2009 Vice President
Austin is the resident electrical engineering guru of the CMU Robotics Club. He designed the h-bridge motor control circuit and was always willing to answer my electricity-related queries
The Carnegie Mellon University Robotics Club
The Robotics Club is probably the single most important student project resource on campus. Not only do they have a fully equipped machine shop, electronics bench, and fridge, they also have an abundance of members who are always willing to share their expertise on a subject, be it programming or machine component design. I did the majority of the project work in the Robotics Club. Hexabot's motors and batteries (both expensive components) came courtesy of the Club's abundance of random project parts.
We have a be nice policy.
Please be positive and constructive.