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);
};

glowing bacteria in 5 steps (DIY bio / kitchen biology)

shiny

Or, harvest your own glowing bacteria for <$10 using everyday kitchen ingredients / equipment. This’ll be a post-in-progress. But the gist is this:

  1. Buy a small squid (or some shrimp), as fresh and untouched (not cleaned) as possible.
  2. Put it in a covered container (e.g. a gatorade bottle) with some salt water (leave some surfaces exposed! the bacteria need oxygen apparently) for 24 hours in the dark @ room temperature. (aluminum foil, cardboard, and closets are all useful).
    Covered is key as otherwise it STINKS. Yay rotting seafood.
  3. Check for luminescence after 24 hours.
    (I suggest a camera with adjusted exposure settings, since I missed it first time around when checking by naked eye. After realizing it was there, it was definitely visible, even with low-light coming in from the propped open closet door).
  4. If successful (there are glowing bits), sterilize some petri-dish substitute, make some jello with some other nutrients (agar substitute), pick some colonies (sterile toothpick), and plate them.
  5. Profit.  e.g. If 4. is successful (lots of glowing bits), try putting it in a FLASK
    bwahaha evil mad scientist
    Ehem. Or make art. Wikipedia: BioArt.

Sparse picture-set here:

Acknowledgement~
This idea sparked from a post by Macowell (of DIYbio-boston):
http://www.bioluminopedia.info/apps/blog/show/3050879-culturing-bioluminescent-microbes
with pictures on Flickr:
http://www.flickr.com/photos/macowell/sets/72157623216167176/

However, I found the post sparse on some crucial details and the author unresponsive to email, and the DIYbio-boston group seems to be older-than-undergraduate people. Ah well. Anyway, I’m carrying through, and have run 3 variations so far, one of which produced glowing bacteria! yay.

The variations:

  1. Squid from Chinatown. Stuck in pot, completely submerged in overly salty water, for a week (annoyed hallmates with smell)
  2. With Judy, knowledgeable bio and hallmate, bought cleaned squid (kalamari?) from New Deal Fish Market (which is actually a small corner store). See picture @ top of page for result.
    Successful, but we waited another 24 hours to make plates due to hosage, and the bacteria died before we could plate them
  3. Fresh farm-raised squid, at home in ATL — incubated outside — did not see anything glowing, but I was a bit negligent on checking it.
Links I found useful:
For the DIYbio broth formulation, see:

Cool pictures:
http://www.biology.pl/bakterie_sw/bac_hp_en.html

See how strong the light can be:
http://www.huntercole.org/artgallery/livinglightphotographyvideo/index.html

Oh, and email with any questions, I’m on email all the time and always looking for excuses to punt 🙂 If I don’t respond, email me again! It may have gotten spam-filtered or lost in the sea of MIT email.
p.s. it’s bioluminescence, not fluorescence, so you don’t need UV light or any light for the glowing to occur.
p.p.s. for those wary of having to constantly refresh the medium / feed the bacteria, consider how often you have to plug in electronic devices and feed them electricity 🙂
Wait, that would be cool, a common low-cost fuel source for bacterial devices… hmm… Oh yes, power electronics is awesome and the electricity grid is amazing! Stopping to think about the engineering behind it boggles my mind.

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.

projects blog (nouyang)