Tag Archives: 2.007

I made a video about hexapods.

I made a video about hexapods! yay. I’d estimate it was a full 4 or 5 days working on it, learning final cut pro along the way. It basically covers my journey through 2.007 two years ago, and is meant to be a resource for students in the class.

Note to self: shortcuts: < > ctrl-= alt-w

Meanwhile, I think an instructable a week sounds like an excellent plan for Spring semester senior year.

Nyancat cake mold, working PoV [not so yoyo], vending corkscrew test (mod servo for continuous rotation)

nyancake
Uhh I’ve been doing a lot of blogging and neglecting my other work, so here is minimalist style ftw.

nyancake? nyangummi?

My hall’s thanksgiving (putzgiving, alums come back for this) was two Saturdays ago. I tested out the nyancat cake mold:

for ease of “parameter optimization” runs, I used even-simpler-cake-recipe: cake mix and sprite as the only ingredients (apparently a dieting trick. comes out fine, although for molds probably want to let bubbles settle for a bit after pouring and before intensive mixing).
apply release agent, aka cooking spray / pam — otherwise doesn’t come out well. also,  sprite+cakemix mixture should not be too gloopy. add flour if accidentally pour too much sprite.

many fail results. Here, did not let bake long enough. (much longer than box says — I baked a bit lower temp based on silicone mold research, ~325deg C, and for say 1 or 2 hours)
demolded too quickly, also did not cover in saran wrap to retain moisture afterward
nyancake party~! nyan nyan nyan
probably the best of all my nyancakes. you can see that the minimum mold feature size — the sprinkles — were too small for the resolution of the cake mix and actually resulted in holes.
speed cooling jello in freezer. recipe used: the lego gummies from instructables
nyanjello = almost perfect mold replica. you can see the sprinkles are supposed to stand out, as opposed to how the nyancakes turned out. however, more limited / difficult coloring opportunities with jello than with cake (which you can just apply frosting / food coloring to)
Persistence of Vision Yoyo
I also figured out the issue with the MAS.863 makefiles causing my weird “compiler” bug (actually, compiler options / makefile bug):

Class-based makefile includes:
avr-objcopy -j .text -O ihex ./v0.1.45.out ./v0.1.45.c.hex
man avr-objcopy
       -j sectionname
       –only-section=sectionname
  Copy only the named section from the input file to the output file.
  This option may  be  given more than once.  Note that using this
  option inappropriately may make the output file unusable. >__> <__<
So the class makefiles should be fixed to include “-j .data”The internet says
“The makefile above DOES NOT create a proper HEX image and is a bad example. When creating an  image, not only does the text section (which holds the code) need to be included but the data section (which holds any initialized data) also needs to be included.
The remedy for this is correct .hex rule to to copy the data setion as well
Example:
$(OBJCOPY) -j .text -j .data -O ihex $(PROJECT).out $(PROJECT).hex
http://www.micahcarrick.com/avr-tutorial-digital-output.html

bmayton: that actually explains a lot of odd bugs that I’ve been seeing with people

using constant arrays, since the array data is never getting copied into the
program

So the actual model of what was causing my bug was, I believe, without calling another function the compiler goes ahead and uses the array to insert the correct commands into the compiled code. But when I used a subfunction, the compiler loads the subfunction which the microcontroller calls, but the ucontroller does not have the array data to look up what to set DDRB and PORTB to.

Anyway, then I proceeded to hack together terrible!code and get PoV working. I used oloepede’s sample image ‘cos I’m all about the laziest and quickest tests and ‘cos olopede is awesome.

eheh derp ripped off ISP traces / headers
works fine waving it by hand (without camera extended exposure time, hard to see entire “olopede” message — can see maybe three letters at a time. dead reckoning PoV timing — no sensors.) 

Doesn’t do so hot on the drill. Mess with timing? Although I spun it slow and fast (and in-use yoyo spins quite fast). May require sensors (fan pov as seen on dealextreme — product designer has better idea of speed of motor while yoyo has more variable speed. maybe they used hall effect sensors, ‘cos it was resilient to me slowing down the blades.) to get stable image.

See video:
https://picasaweb.google.com/113942194695013581888/PoVYoyoPersistenceOfVision#5681157457783660930

Vending machine
Right, essentially two weeks until final projects due. Aka time to start cramming on vending machine.

What do I have on hand? Arduino uno, extra servos leftover from when I bought out all the old 2.007 servos., zipties, handheld drill, a corkscrew. Found some rectangular metal thing to act as guiderails lying around MITERS scrap pile. Also found a block of wood lying around the floor.

Mod a servo  to be
continuous rotation servo
(essentially turn it into a cheap RC motor that comes with motor speed controller in a convenient package for mounting) —
aka remove mechanical stop on gear 

apply flush cutters to stop on gear

and remove pot, which like all pots doesn’t turn infinitely — make sure to be gentle ‘cos pot is held in by internal screw, why it doesn’t just fall out normally

see blurry screw at bottom. Also, I wasn’t gentle and cracked the PCB. Maybe it is inevitable for these servos (motor is soldered onto pcb so not much flexibility there) to get to pot screw. Surprisingly the servo still works…
stick pot on outside, chew a hole for it in the casing — i abused flush cutters

see How to Hack a Servo by Daniela Faas http://stellar.mit.edu/S/course/2/sp11/2.007/courseMaterial/topics/topic12/other/Servo_Hack_large/Servo_Hack_large.pdf)

springs / coils
Attach to corkscrew (from real vending machine) I bought off of ebay to see what real mass manufactured ones are like so I can make fake ones DIY like http://www.instructables.com/id/Make-your-own-springs-in-seconds/

Drill out servo horns (1/8” bit fits zipties I found) and attach to corkscrew with zipties

it vends a block! haha. terrible setup is terrible.

Video here:
https://picasaweb.google.com/113942194695013581888/VendingMachineOpenHardware#5681154916854562050

Yea, not a very interesting proof-of-concept (a “duh are you an idiot” one), but it was very satisfying to me.

Oh right, I tried to use hot glue to hold the pot in one place, since that affects how the servo reacts to servo.write() (pot adjusts when it goes fwd/reverse) — I just used
myServo.write(50) with a 0.5 sec delay
myServo.write(90) with a 3 sec delay
myServo.write(130) with a 0.5 sec delay
to calibrate the pot so that servo was completely still at 90. And then attempted to hot glue. a bit flaky– not good enough for long-term banging around but good enough for dirty proto.

yes, i stole arduino from hexarideablepod. arduino uno with a small breadboard on top and 3 male header pins to connect arduino (Vcc, Gnd, and SIG — arbitrarily pin 2 in my case) and servo. unplugged in this pic.

Not clear from pics, but to test it I’m holding the servo still with my hand.

Dreaming of Dancing Hexapods (2.007 Reflection and Learning)

This semester, I’ve been on-off productive in 2.007, where I’ve been working on a hexapod. The original goal was to build a dancing hexapod. I think this was entirely reasonable if I’d been a bit more time-saavy in life, instead of living life from one deadline to the next. Ah well πŸ™‚

(This post is in response to my homework assignment).
Evolution of a Hexapod:

Hexalinkagepod. Mini-hexapod (my “simple-bot” exercise). Two servo linkage-hexapod based off of the Parallax BoeBot Hexapod.
Hexablockapod. First iteration, 18 servo hexapod. Wide body (full sheet of ABS plastic). Doesn’t walk well at all.
Hexablockapod v2. 2nd iteration, 1/3 sheet ABS plastic. Oh, and mini-hexapod for comparison.
Wires hidden with some cloth (4/30/11)
Hexaringapod. Current iteration. ~6” radius body (black ABS plastic). Used vertical bandsaw to add curvature to & reduce weight of outermost segments (tibia). Shortened femurs. (5/6/2011)
0. Hexapod basics
Hexapod — “six-footed”. In this case, a six-legged walking robot; in nature studies, hexapoda = a group of arthropods including the insects. Also refers to a type of robotics platform called the Stewart platform. (this turns up often in google image searches).
There exist a bewildering array of hexapods, from one motor seventy-foot diameter hexapods to three servo one-inch diameter hexapods to wooden wind-powered beach-walking hexapods to eighteen half-foot diameter dancing hexapods. Square hexapods, pyramidal, circular, CNC hexapods (yes, a hexapod that mills things), the variety is amazing. (todo: add links. Jamie’s spider, strandbeest, pololu hexapod, wikipedia hexapod, linkages).
Here, I will focus on 18 servo hexapods at the cost of discussing interesting linkages (Klann, Jensen, etc.). 18-servo hexapods use three servo motors per leg and mimic the insect leg, specifically the coxa, femur, and tibia segments.

There doesn’t appear to be concrete mathematics studying the physics of the insect leg, at least not applied to hexapods. The overuse of servos in 18-servo designs allows for lots of leeway in design, leading to some truly beautiful hexapods. It also allowed me to build one entirely by eye (no CAD), for better or for worse.
this makes me go squeeeeee.
1. Description of the final machine:
My final hexapod has eighteen servos on six legs. It walks, and can accomplish more movements given time to program. The walking gait is a tripod gait, where in theory three legs are on the ground at any given time.
close-up of final machine. Not as objectively squee-worthy as other people’s designs, but I built it all by hand and it’s all my own. <3 
When I started out on the 18-servo hexapod, based on the plethora of designs and a naive belief that my servos could handle anything, I believed that I could “just build” a dancing eighteen-servo hexapod and ignored people’s advice that I CAD my robot before I build it. (Well actually, at first, I had zero belief that I could actually build an 18-servo hexapod nor any idea how to build one. But I really really wanted a dancing hexapod, so it all worked out thanks to the UAs, TAs, professors, shop guys, and the MITERS emailing list. Yay!).
Video of walking (and maybe more?) to come; I took it to Cambridge Mini Maker Faire and a little kid broke one of the servo horns in the first ten minutes, heh (easy to fix). Little kids are epic mechanical design testers.
Yes, little kids should build dancing hexapods too!
2. Some comparisons
I do not know of anyone else in 2.007 who attempted to build a walking robot nor a similar task of dancing. Instead, I will compare my design with some designs from the internet, where I drew my inspiration. I will focus on mechanical design of 18 servo hexapods.
Original inspiration:
Leg design inspiration:
Final body design inspiration:
http://www.youtube.com/watch?v=glNS81Kgk7g
Future gait studies:
Future aesthetic studies:
Future servo torque / weight studies:
This hexapod uses 1.6 kg*cm servos, with longer leg segments, while I’m using 3.2 kg*cm servos with shorter segments, yet this hexapod has no problems moving around.  Possibly a combination of lighter weight (due to using thin wood instead of 1/8” ABS plastic?) and better mechanical design (e.g. better support for the servos) and better programming (not holding the tibia static, as I am right now).
Principles:
  • Support servo on both sides (add second pivot point, opposite of output shaft). See http://www.lynxmotion.net/viewtopic.php?f=17&t=3133 for ideas. I did not do this on my design, since I was opting for KISS due to my inexperience with building my own robots from scratch.
  • Instead of having coxa servo support its own weight in addition to the other two servos (femur and tibia), put it on the body and let it rotate the rest of the leg. See sandwich design:
  • The coxa segment probably needs the least torque (I put my weakest servos on the femur segment)
3. Use of design tools.
Design tools allowed clear images to be found on the internet, which helped me with creating my own design. I made less use of these tools than other people around me, which is acceptable as my next revision of the hexapod will certainly involve Solidworks and Inkscape / Coreldraw.
4. Things I learned: (what I would do differently)
Although I stand by my decision to go ahead and build the robot roughly by eye, since I do not believe that Solidworks would have helped me anticipate issues with servo torque, I definitely intend to use CAD tools in the future.
I think I should have attempted to balance the 2.007 workload better than work on spurts every week or two.
In retrospect, I should have picked the easiest available option for connecting and running all 18 servos and run with it as soon as possible, which would have allowed me to see the problem with the oversize body and weak servos much sooner. I often had issues with decision making, and I am glad that I decided to try cutting the robot in half instead of vacillating for a while.
I had thought that there was no need to consider servo torque since I did not need to decide which servos to buy; however, this was an incorrect philosophy as I could have changed the design.
(I had no intuition at the time for servos and torque, and when I asked around people thought my design seemed reasonable. Next time I will definitely be considering servo torque issues — a bit of research reveals that some dancing hexapods use servos with 2x or 5x the torque of my servos).
Solidworks would probably have helped me with my little hexapod, where the leg lengths where off.
In terms of fabrication, I learned to standardize my nuts and bolts (sticking to only 4-40) and the niceties of working with ABS plastic (fast prototyping changes, such as bandsawing my robot in half and reattaching the legs, could be accomplished painlessly).
Epilogue
In conclusion, I’ve decided to open a business selling dancing hexapod hats.

thanks for the idea, Mr. Finberg!
A build post will come soon (probably after finals in a week).

Hexapod status update: it walks, and it’s no longer blocky

My pet 18 servo hexapod <3

In terms of programming, I’m following the tripod gait (3 legs on the ground at any time, legs in the air move forward while legs on the ground move backward). I’m using the Arduino mini as the microcontroller (brains) (with the 2.007 carrier board to make interfacing with the servos easy). I’m controlling 12 channels (which is the max for the ServoWrite function in the Arduino software library), so twelve of the servos are in pairs (using six Y splitter cables). Thus, if  I named each leg:


front
A   D
B   E
C   F
back

The servos on AC and DF are linked together, while the servos on B and E are controlled independently. Then I only need 12 channels instead of 18: AC (coxa, femur, tibia). DF (coxa, femur, tibia). B  (coxa, femur, tibia). E  (coxa, femur, tibia).

Anyway, in my code, I took 4 “snapshots” (sets of servo positions) of the tripod gait and I’m looping through them. In other words, I’m following http://www.pololu.com/docs/0J42/4. I’m pretending this is a 12 servo hexapod (since this was my KISS code) in that the tibia segments are kept at one position the whole time.

  1. AC, E legs forward. DF, B legs backward.
  2. AC, E legs down. DF, B legs up.
  3. AC, E legs backward. DF, B legs forward.
  4. AC, E legs up. DF, B legs down.

And the actual code I’m using to get it to walk forward:
(also here: https://docs.google.com/document/pub?id=1N9dLEcLXiCvFRI4JRVfJUyylEhZFk4azP8_gsickQv4)

 #include <servo.h>
// Declare constants in degrees for the servos
#define TIBIA 45
#define DELAY 200

// +J, BWD = forward, backward (coxa)
// UP, DOWN = up, down (femur)
#define AC_FWD 105
#define AC_BWD 70
#define AC_UP 92
#define AC_DOWN 125

#define B_FWD 95
#define B_BWD 90

#define DF_FWD 70
#define DF_BWD 105

#define E_FWD 90
#define E_BWD 95

int UP = AC_UP;
int DOWN = AC_DOWN;

Servo E_coxa;
Servo E_femur;
Servo E_tibia;

Servo B_coxa;
Servo B_femur;
Servo B_tibia;

Servo AC_coxa;
Servo AC_femur;
Servo AC_tibia;

Servo DF_coxa;
Servo DF_femur;
Servo DF_tibia;

int pos = 0; // variable to store the servo position

void setup()
{
//Set all pins to output, disable the pullup resistors or something, etc.
digitalWrite(2, OUTPUT);
digitalWrite(3, OUTPUT);
digitalWrite(4, OUTPUT);
digitalWrite(5, OUTPUT);
digitalWrite(6, OUTPUT);
digitalWrite(7, OUTPUT);
digitalWrite(8, OUTPUT);
digitalWrite(9, OUTPUT);
digitalWrite(10, OUTPUT);
digitalWrite(11, OUTPUT);
digitalWrite(12, OUTPUT);
digitalWrite(13, OUTPUT);

pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);

E_coxa.attach(2);
E_femur.attach(3);
E_tibia.attach(4);

B_coxa.attach(5);
B_femur.attach(6);
B_tibia.attach(7);

AC_coxa.attach(11);
AC_femur.attach(12);
AC_tibia.attach(13);

DF_coxa.attach(8);
DF_femur.attach(9);
DF_tibia.attach(10);
}

void loop()
{
tibia();
tri1();
tri2();
tri3();
tri4();
}

void tibia() {
AC_tibia.write(TIBIA);
B_tibia.write(TIBIA);
DF_tibia.write(TIBIA);
E_tibia.write(TIBIA);
}

void tri1() {
// changed: 1,3,5 fwd, other back [COXA]
// [FEMUR] unchanged
AC_coxa.write(AC_FWD);
AC_femur.write(AC_UP);
E_coxa.write(E_FWD);
E_femur.write(UP);

DF_coxa.write(DF_BWD);
DF_femur.write(DOWN);
B_coxa.write(B_BWD);
B_femur.write(DOWN);

delay(DELAY);
};
void tri2() {
// [COXA] unchanged
// changed: 1,3,5 down, other up [FEMUR]
AC_coxa.write(AC_FWD);
AC_femur.write(AC_DOWN);
E_coxa.write(E_FWD);
E_femur.write(DOWN);

DF_coxa.write(DF_BWD);
DF_femur.write(UP);
B_coxa.write(B_BWD);
B_femur.write(UP);

delay(DELAY);
};

void tri3() {
// changed: 1,3,5 down, other up [COXA]
// [FEMUR] 1,3,5 bwd, other fwd [COXA]
AC_coxa.write(AC_BWD);
AC_femur.write(AC_DOWN);
E_coxa.write(E_BWD);
E_femur.write(DOWN);

DF_coxa.write(DF_FWD);
DF_femur.write(UP);
B_coxa.write(B_FWD);
B_femur.write(UP);

delay(DELAY);
};
void tri4() {
// [COXA] unchanged
// changed: 1,3,5 up, other down [FEMUR]
AC_coxa.write(AC_BWD);
AC_femur.write(AC_UP);
E_coxa.write(E_BWD);
E_femur.write(UP);

DF_coxa.write(DF_FWD);
DF_femur.write(DOWN);
B_coxa.write(B_FWD);
B_femur.write(DOWN);

delay(DELAY);
};

2.007 (aka earn credit for building a robot) – Hexalinkagepod

d’aww, isn’t it cute?

I finished (for small degrees of finish) my simple linkage hexapod robot for 2.007, aka Design and Manufacturing I. This is MIT’s fabled class, from which sprung forth the FIRST Robotics Competition, which is probably the reason I applied to MIT in the first place (go Team 1261!). Building this turned out to be more complicated than I ever imagined. It doesn’t work well, but it’s super cute πŸ˜€ Yay for the first robot I ever built from scratch!



Fairly extensive photos from the build process here on picasaweb:

2.007
https://picasaweb.google.com/nancy.ouyang/2007
 (most of timestamps are 2 to 3 days off, and 12 hours off. camera settings fail)

I also wrote some Arduino documentation for my fellow 2.007 students. See
https://sites.google.com/site/2007arduino/getting-started

Edit 4/3/11: A lot more documentation went up recently, so I wanted to note that the only I wrote above page. The rest is the wonderful work of the 2.007 staff.