Let's Make Robots!

MoshA

 
BOOGIES DOWN! Reacts to sound,
AttachmentSize
MoshA.zip686 bytes

Back in January, I found some video kind of like this of the Silbot dancing a Tango and posted a blog about it (from which the video appears to have dropped off.)  Ever since then I'd been on the lookout for egg-shaped bodies of a useable size.  Easter provided a good cheap source of plastic housings for my own at the Big Lots, and while this isn't what I plan for the ultimate use of the Tribble base and egg body, it has enough of its own personality and programming that it really isn't Tribble anymore, but it isn't the ultimate form it will take yet-so I gave it a name:Mosha.

A cross between "Misha" (the ballet world nickname for Baryshnikov) and Mosher, which if you look at it is kind of the only kind of dancing you can qualify it as doing (i.e., it closes its eyes and reacts to the music regardless of what it bumps into-though somehow in the video it never collides with anything...) 

HARDWARE

The build is very straightforward and messy-nothing under the hood is even strapped down!

(Sorry for the Potato as they say-I just use the iPad and basement lights for these things.)

Anyway, as  you can (maybe) see from the photo, it's an Arduino Uno for a brain on the Tribble Base (3 cr servos and omniwheels) and the only sensor is the Sparkfun Electret Mic Breakout.

SOFTWARE

The program surprised me-I would have thought I'd get more than unidirectional spin, but essentially that's what happened.  I'll forgo posting the entire sketch (.zip attached,) but for learning purposes, here are the two interesting portions.

First, this is the form that the "dance" instructions took:

 pogo= random(3);
  switch (pogo){
    case 1://freeze right
    frontServo.write((random(2)-1)*180);
    leftServo.write((random(2)-1)*180);
    rightServo.write(90);
    delay(250);

It's a 3-way switch at random that freezes one wheel and assigns the other two either full left or right spin.  Theoretically, that should occasionally have resulted in more forward or occasional clockwise movement, but it didn't.  Maybe I overlooked something here or my logic was bad.  Whatever. This was an experiment-not a labor of love.

The second is the crudest beat detector you've ever seen:

result=analogRead(A0);

  diff=result-avg;
  avg += diff / CONVERGE;
  if (result>avg*PEAK){
    duty=(100*result)/avg;
  }else{
    duty=0;
  }
  if (duty != 0){
  boogie();

I based this on the "LightStrip" project by Adam Grieg that Sparkfun lists on  the mic board page.  It was in straight c so it took just a little adjusting to aruduinish.  It doesn't do the best job, but as you can see it will pick up a change in the volume and (within the 250ms delay) react to it.  To make it more interesting I guess I could have had it stop if it detected a lull in the music instead of just pirouetting, What it's doing though is keeping a record of the last peak in the detected audio level and comparing it to an averaged level (background noise, non-beat events, etc) with a convergence value (I used 10 and a default peak of 1.3) 

Now clearly, at some points it's just hearing noise maxed out (punk rock yo) and reacting at its max frequency, but at other points it does "dance" for me.  I was happy enough with the results that I'm gutting it and moving on.  Next up: RaspPi brains and a head that is significantly less creepy than the afformentioned Sil-bot.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hi Max, Love the video, this robot is very cool.  Where did you ever find a plastic egg that big?  It appears to be HUGE by plastic egg standards.  What?  Aplastic ostrich egg?  Did you get that from Oddbot...LOL. 

Keep up the fun, nice to see you working on things my friend.

Haha. Nice one Max. Character and personality with some omni wheels.(got it right this time)  Can't beat that.

WOW, Max that is very cute.  Words like "adorable" and "lovable" come to mine.

It kind of reminds me of the peanut M&Ms from the commercials that are always getting into trouble...LOL.

What microprocessor did you use for this?

He does kind of look like the one the Russian mobster is going to chop up and put on his ice cream, doesn't he? The microprocessor is an Arduino UNO. I think this is a $10 Shenzen version.

Reminds me of a way cooler version of Mr potato head, a robotic one that might have kept my interest for more than 15 minutes.

Excellent!

Reminds me of the Egg of Columbus.  Can't wait for the video :)