Académique Documents
Professionnel Documents
Culture Documents
Living
Outside
Play
Technology
Workshop
Table of Contents
Simple 18dof Hexapod, Arduino nano (optionally with pololu maestro) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Intro: Simple 18dof Hexapod, Arduino nano (optionally with pololu maestro) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 1: Make the Paper Templates for Femur and Tibia Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Step 8: Assemble Legs onto Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Step 9: Wire 'er up! 12 servo output version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Step 10: Wire 'er up! Pololu Serial servo controller, 18 servo version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Step 11: 12 Servo Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Step 12: 18 Servo Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Step 13: Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
Author:orangenarwhals
i like hexapods, nyancake, bioart, and... sleep.
Intro: Simple 18dof Hexapod, Arduino nano (optionally with pololu maestro)
Hello,
Here is a simple hexapod that can be built by hand very quickly. The mechanical design is not great, but it is very much in the KISS (keep it stupidly simple) style and
should be doable in a weekend for builders of novice to medium experience.
I won't be improving this project any time soon, and people seem to visit my blog from pololu, so I thought I'd go ahead and document it as is. I built this for a
sophomore mechanical engineering class at MIT. The wires and six legs make it look complicated, but since the legs are just the same thing repeated 6 times, it's
simpler than it appears. Additionally, I did not implement remote controls so all the code runs autonomously (zero input, multiple output system).
Again, this is documentation of the exact steps involved in a semi-working project. No theoretical underpinnings for designing your own hexapod are really
explained here.
A complete picture set of the build process exists here: 2.007 Hexapod (Spring 2011) . The first few pictures on there are from Aluminum Hexalinkagepod, based off of
the Parallax boebot hexapod.
A set of blog posts exists here: http://orangenarwhals.blogspot.com/search/label/hexaringapod
I would specifically recommend this post: http://orangenarwhals.blogspot.com/2011/05/dreaming-of-dancing-hexapods-2007.html
A video explaining the design process in 7 minutes (this instructables goes into the construction but not the design): http://youtu.be/qTh-OGA_LeM
and here is a video of it at the end:
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
Image Notes
1. Gnarly wire managment fail makes it seem more complicated than it is
Image Notes
1. See? Super simple design. Just repeat 6 times. Terrible mechanically but it
works!
2. tibia
3. coxa
4. femur
Image Notes
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
File Downloads
hexapodCAD-19Jun2011.zip (9 MB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'hexapodCAD-19Jun2011.zip']
Step 1: Make the Paper Templates for Femur and Tibia Segments
We'll be using paper templates to mark out six of the same thing (six legs).
My tibia ended up (after a few iterations) being 1.4x3.75 inches, with holes marked appropriately for where the servo horns would go.
My coxa ended up being 1.42x4.83 inches, with an appropriately sized hole cut out for the servo. The curve on the leg is an arbitrary "it looks nice" curve I cut out directly
on the bandsaw (I started out with rectangular legs).
The CAD model you see in the pictures is a later and better (read: smaller and lighter, more appropriate for the servos) revision than the paper templates, and should give
you some idea of how it the hexapod is assembled. So ignore the dimensions written on the paper template in the pictures.
Once you are done making the templates, mark them onto the plastic sheet in preparation for cutting. For marking the holes, sharpie bleeds through paper so just line the
paper templates up with the plastic and mark the template with sharpie and it should show up on the plastic. I actually cut the legs out and then marked the holes; you
can do it in any order.
Image Notes
1. See? Super simple design. Just repeat 6 times. Terrible mechanically but it
works!
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
2. tibia
3. coxa
4. femur
Image Notes
1. from: wikipedia article on arthropod legs
(http://en.wikipedia.org/wiki/Arthropod_leg#Insects)
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
Image Notes
1. how to cut out where the servo fits through on the vertical bandsaw
Image Notes
1. I milled it out on this bandsaw at miters(.mit.edu). It is old.
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
Image Notes
1. I used bins to keep all the servo stuff organized, but that's entirely optional.
Image Notes
1. make sure to use center screw
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
Image Notes
1. deburring tool removes the rough edges
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
Image Notes
1. not blood, I don't think
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
Image Notes
1. distance between these two points: 1/2*Diameter
Image Notes
1. center punch all three holes
File Downloads
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
Servo DF_femur;
Servo DF_tibia;
Note: In the picture, I have the letters placed incorrectly around the circular hexapod. Notice that it doesn't matter for explaining how the tripod gait works.
Image Notes
1. I only have five servo setups on my breadboard, you will need twelve total if
you don't have the 2.007 board
Image Notes
1. protip: if your headers are standard and longer on one side than the other, you
can mush them down by hooking the black part on the edge of the table and
hitting the tops with the back of your screwdriver. this gets them evenly spaced
top and bottom
Step 10: Wire 'er up! Pololu Serial servo controller, 18 servo version
18 SERVO OUTPUT VERSION
Pololu
The following instructions are for the 2.007 board, however, they are detailed enough that they should explain what you need to do. Essentially, you need 5 wires: a
single "servo output" (just an output pin, plus ground and power for the pololu board) and VSRV and GND for the servos. The two grounds should be connected
somewhere (anywhere) in your circuit.
1. Look at labeled picture http://www.pololu.com/docs/0J40/1.b
2. What you need on pololu-side: serial going through to RX pin on pololu, power to VSRV and VIN, ground to GND, and lots of servos
'3. According to our eventual code:
#include <NewSoftSerial.h> #NOTE: July 2013: NewSoftSerial is included by default now, do not use this code -- see later steps in this instructables
#define txPin 2
NewSoftSerial mySerial(rxPin, txPin);
void setup(){
mySerial.begin(9600);
delay(1000);
}
we should take a servo female-female wire, put one end on servo male header pins for pin 2 of Arduino.
4. RX/TX and Microntroller power: Put other end white wire (or yellow or whatever wire is SIG) on RX on maestro, and red (VIN) and black (GND). Should look like the
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
second picture, the wire-with-masking-tape, with black facing "out" toward the USB port.
5. Servo power: see first picture, the two non-servo cables (the red wire and black wire going to the breadboard) are screwed into the blue terminal block on the maestro.
The breadboard has 5V and GND from the 8.4V battery going through the linear regulator on the carrier board. I'm actually stealing 5V from a servo pin. See the black
wire soldered to Dig9Output, 5V in the upper left of this pic (which is actually carrying 5V, not GND) (via a female header pin so I wasn't soldering straight to the carrier
board pins) (ignore the gazillion extraneous wires)
6. Remove VSRV=VIN jumper
Why remove the jumper? Well, a. Makes the pololu RX pin happier (compare to setup below) b. Setting that jumper seems to current-limit the power going to the servos,
leading to my sad-servo symptoms. aka unable-to-walk hexapod.
Whether you will find this to be true, I don't know, but certainly this was a very frustrating point for me.
Servo Wiring
Straightforward. Plug in your 18 servos. (Yep, an 18ch maestro would have worked just fine instead of the 24ch one I bought. Even a 12ch one would work, but you
would have to split your servo code between arduino and pololu servos and that could get messy).
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
}
for (int j=0; j<=2; j++){
walkbwd();
}
for (int k=0; k<=2; k++){
turnleft();
}
for (int l=0; l<=2; l++){
turnright();
}
}
void walkbwd() {
tibia();
b1();
b2();
b3();
b4();
}
void walkfwd() {
tibia();
tri1();
tri2();
tri3();
tri4();
}
void turnleft() {
tibia();
l1();
l2();
l3();
l4();
}
void turnright() {
tibia();
r1();
r2();
r3();
r4();
}
void tibia() {
AC_tibia.write(TIBIA);
B_tibia.write(TIBIA);
DF_tibia.write(TIBIA);
E_tibia.write(TIBIA);
}
void tri1() {
AC_coxa.write(COXA_CW);
E_coxa.write(COXA_CCW);
DF_coxa.write(COXA_CW);
B_coxa.write(COXA_CCW);
delay(DELAY);
};
void tri2() {
AC_femur.write(AC_DOWN);
E_femur.write(DOWN);
DF_femur.write(UP);
B_femur.write(UP);
delay(DELAY);
};
void tri3() {
AC_coxa.write(COXA_CCW);
E_coxa.write(COXA_CW);
DF_coxa.write(COXA_CCW);
B_coxa.write(COXA_CW);
delay(DELAY);
};
void tri4() {
AC_femur.write(AC_UP);
E_femur.write(UP);
DF_femur.write(DOWN);
B_femur.write(DOWN);
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
delay(DELAY);
};
void b1() {
AC_coxa.write(COXA_CCW);
E_coxa.write(COXA_CW);
DF_coxa.write(COXA_CCW);
B_coxa.write(COXA_CW);
delay(DELAY);
};
void b2() {
AC_femur.write(AC_DOWN);
E_femur.write(DOWN);
DF_femur.write(UP);
B_femur.write(UP);
delay(DELAY);
};
void b3() {
AC_coxa.write(COXA_CW);
E_coxa.write(COXA_CCW);
DF_coxa.write(COXA_CW);
B_coxa.write(COXA_CCW);
delay(DELAY);
};
void b4() {
AC_femur.write(AC_UP);
E_femur.write(UP);
DF_femur.write(DOWN);
B_femur.write(DOWN);
delay(DELAY);
};
void l1() {
AC_coxa.write(COXA_CCW);
E_coxa.write(COXA_CCW);
DF_coxa.write(COXA_CW);
B_coxa.write(COXA_CW);
delay(DELAY);
};
void l2() {
AC_femur.write(DOWN);
E_femur.write(DOWN);
DF_femur.write(UP);
B_femur.write(UP);
delay(DELAY);
};
void l3() {
AC_coxa.write(COXA_CW);
E_coxa.write(COXA_CW);
DF_coxa.write(COXA_CCW);
B_coxa.write(COXA_CCW);
delay(DELAY);
};
void l4() {
AC_femur.write(UP);
E_femur.write(UP);
DF_femur.write(DOWN);
B_femur.write(DOWN);
delay(DELAY);
};
void r1() {
AC_coxa.write(COXA_CW);
E_coxa.write(COXA_CW);
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
DF_coxa.write(COXA_CCW);
B_coxa.write(COXA_CCW);
delay(DELAY);
};
void r2() {
AC_femur.write(DOWN);
E_femur.write(DOWN);
DF_femur.write(UP);
B_femur.write(UP);
delay(DELAY);
};
void r3() {
AC_coxa.write(COXA_CCW);
E_coxa.write(COXA_CCW);
DF_coxa.write(COXA_CW);
B_coxa.write(COXA_CW);
delay(DELAY);
};
void r4() {
AC_femur.write(UP);
E_femur.write(UP);
DF_femur.write(DOWN);
B_femur.write(DOWN);
delay(DELAY);
};
Image Notes
1. up and running! so cute~~
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
= 00000000101110
The main difference from the default code is that I mapped the values so that I could mindlessly port code from arduino-"Servo.write()"-style to pololu-"settarget()"-style.
void settarget(unsigned char servo, unsigned int target)
{
target = map(target, 0, 180, 2400, 9500);
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
// ~~~~~~~~~~fwd~~~~~~~~~~ //
void f1() {
// [COXA] changed
settarget(A_COX, CW);
settarget(C_COX, CW);
settarget(E_COX, CCW);
settarget(D_COX, CW);
settarget(F_COX, CW);
settarget(B_COX, CCW);
delay(DELAY);
}
void f2() {
// [FEMUR] changed
settarget(A_FEM, DOWN);
settarget(C_FEM, DOWN);
settarget(E_FEM, DOWN);
settarget(D_FEM, UP);
settarget(F_FEM, UP);
settarget(B_FEM, UP);
delay(DELAY);
}
void f3() {
// [COXA] changed
settarget(A_COX, CCW);
settarget(C_COX, CCW);
settarget(E_COX, CW);
settarget(D_COX, CCW);
settarget(F_COX, CCW);
settarget(B_COX, CW);
delay(DELAY);
}
void f4() {
// [FEMUR] changed
settarget(A_FEM, UP);
settarget(C_FEM, UP);
settarget(E_FEM, UP);
settarget(D_FEM, DOWN);
settarget(F_FEM, DOWN);
settarget(B_FEM, DOWN );
delay(DELAY);
}
// ~~~~~~~~~bwd~~~~~~~~~~~ //
void b1() {
// [COXA] changed
settarget(A_COX, CCW);
settarget(C_COX, CCW);
settarget(E_COX, CW);
settarget(D_COX, CCW);
settarget(F_COX, CCW);
settarget(B_COX, CW);
delay(DELAY);
}
void b2() {
// [FEMUR] changed
settarget(A_FEM, DOWN);
settarget(C_FEM, DOWN);
settarget(E_FEM, DOWN);
settarget(D_FEM, UP);
settarget(F_FEM, UP);
settarget(B_FEM, UP);
delay(DELAY);
}
void b3() {
// [COXA] changed
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
settarget(A_COX, CW);
settarget(C_COX, CW);
settarget(E_COX, CCW);
settarget(D_COX, CW);
settarget(F_COX, CW);
settarget(B_COX, CCW);
delay(DELAY);
}
void b4() {
// [FEMUR] changed
settarget(A_FEM, UP);
settarget(C_FEM, UP);
settarget(E_FEM, UP);
settarget(D_FEM, DOWN);
settarget(F_FEM, DOWN);
settarget(B_FEM, DOWN );
delay(DELAY);
}
// ~~~~~~~~~left~~~~~~~~~~~ //
void l1() {
// [COXA] changed
settarget(A_COX, CCW);
settarget(C_COX, CCW);
settarget(E_COX, CCW);
settarget(D_COX, CW);
settarget(F_COX, CW);
settarget(B_COX, CW);
delay(DELAY);
}
void l2() {
// [FEMUR] changed
settarget(A_FEM, DOWN);
settarget(C_FEM, DOWN);
settarget(E_FEM, DOWN);
settarget(D_FEM, UP);
settarget(F_FEM, UP);
settarget(B_FEM, UP);
delay(DELAY);
}
void l3() {
// [COXA] changed
settarget(A_COX, CW);
settarget(C_COX, CW);
settarget(E_COX, CW);
settarget(D_COX, CCW);
settarget(F_COX, CCW);
settarget(B_COX, CCW);
delay(DELAY);
}
void l4() {
// [FEMUR] changed
settarget(A_FEM, UP);
settarget(C_FEM, UP);
settarget(E_FEM, UP);
settarget(D_FEM, DOWN);
settarget(F_FEM, DOWN);
settarget(B_FEM, DOWN );
delay(DELAY);
}
// ~~~~~~~~~right~~~~~~~~~~~ //
void r1() {
// [COXA] changed
settarget(A_COX, CW);
settarget(C_COX, CW);
settarget(E_COX, CW);
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
settarget(D_COX, CCW);
settarget(F_COX, CCW);
settarget(B_COX, CCW);
delay(DELAY);
}
void r2() {
// [FEMUR] changed
settarget(A_FEM, DOWN);
settarget(C_FEM, DOWN);
settarget(E_FEM, DOWN);
settarget(D_FEM, UP);
settarget(F_FEM, UP);
settarget(B_FEM, UP);
delay(DELAY);
}
void r3() {
// [COXA] changed
settarget(A_COX, CCW);
settarget(C_COX, CCW);
settarget(E_COX, CCW);
settarget(D_COX, CW);
settarget(F_COX, CW);
settarget(B_COX, CW);
delay(DELAY);
}
void r4() {
// [FEMUR] changed
settarget(A_FEM, UP);
settarget(C_FEM, UP);
settarget(E_FEM, UP);
settarget(D_FEM, DOWN);
settarget(F_FEM, DOWN);
settarget(B_FEM, DOWN );
delay(DELAY);
}
// ~~~~~~~~~~~~~~~~~~~~ //
void walkbwd() {
tibia();
b1();
b2();
b3();
b4();
}
void walkfwd() {
tibia();
f1();
f2();
f3();
f4();
}
void turnleft() {
tibia();
l1();
l2();
l3();
l4();
}
void turnright() {
tibia();
r1();
r2();
r3();
r4();
}
// ~~~~~~~~~~~~~~~~~~~~ //
//Send a Set Target command to the Maestro.
//Target is in units of quarter microseconds, so the normal range is 4000 to 8000.
void settarget(unsigned char servo, unsigned int target)
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
{
target = map(target, 0, 180, 2400, 9500);
mySerial.write(0xAA); //start byte
mySerial.write(0x0C) ; //device id
mySerial.write(0x04); //command number
mySerial.write(servo); //servo number
mySerial.write(target &0x7F);
mySerial.write((target >> 7) &0x7F);
}
Image Notes
1. I tried to neaten up the wiring. I really should have put standoffs for the board.
For more hexapod craziness, see my (a bit elderly) gallery here of ones around the internet here: http://orangenarwhals.blogspot.com/2011/07/strange-and-beautifulhexapods-spider.html.
See also academic papers a reading group I led read here: http://ieee.scripts.mit.edu/urgewiki/index.php?title=S2012_-_Hexapods_and_Other_Cool_Things
An overview of the design process and other things I'd like to implement as of two years ago: http://orangenarwhals.blogspot.com/2011/05/dreaming-of-dancinghexapods-2007.html
A video explaining the design process in 7 minutes (this instructables goes into the construction but not the design): http://youtu.be/qTh-OGA_LeM
Gaits
Tripod gaits are the simplest. Go out and read more about the different gaits out there. For instance, can you figure out which gait Stompy is using and why?
Forums
There are also many people on the forums, in particular:
pololu e.g. (http://forum.pololu.com/viewtopic.php?f=16&t=6188&p=29520#p29520)
trossenrobotics
lynxmotion
arcbotics e.g. (http://forum.arcbotics.com/viewtopic.php?f=12&t=386)
Hexacon
hexacon2013.mit.edu
On May 4th, 2013, the world's first hexapod conference was held at MIT. If I'm still around MIT in a year or so (I just graduated and am working on my own startup), there
will be a second one (or do any of you all want to organize one? Let me know!).
===
May the hexapod revolution commence. Fare thee well.
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/
Related Instructables
Remote
Controlled
Arduino Robot
using Wixel
Transceivers
(Photos) by
techbitar
Hexapod robot
(video) by
aggrav8d
Operating the
Pololu QTR-8RC
Line Sensor
with Arduino
Uno (video) by
techbitar
Project 2: Delta
Robot (video) by
aggrav8d
Arduino Nano
with Ethernet
Shield by
ntewinkel
Advertisements
http://www.instructables.com/id/Simple-18dof-Hexapod-Arduino-nano-optionally-wit/