How to teach a robot to dance

2.165 Robotics and Mechantronics, Final Project
plus Computerized Dance Lights

I had been looking for a truly unusual and interesting problem to solve for my 2.165 final project, when at an Underworld concert it hit me.  At that moment, I was surrounded by an extremely complex control problem:  dancing. Could I teach a robot to dance?  

So, for my 2.165 Robotics and Mechatronics final project I successfully taught the 2 degree of freedom laboratory robot to dance. It found beats by looking at the difference between the fast Fourier transforms (FFTs) of one time step and the next, then using them to generate repetitive control signals to make the robot "dance" to the music. The robot understood Underworld, and most other dance music with a strong beat, but couldn't quite get its moves down for Take 5 or Bach.




MPEG Movies of the robot dancing

Dark and Long by Underworld - circular controller; this one is the best.
UWcirc.mpg

Dark and Long by Underworld - arc controller; this movie is neat because you can see exactly when the controller picks up the bass drum and hi-hat.
UWarc-beginning.mpg

Concerto No.3 In G (Allegro) by Johann Sebastian Bach - arc controller; the robot couldn't find the beat here.
bacharc-edit.mpg

Take Five by the Dave Brubeck Quartet - arc controller; couldn't quite find the beat, but did respond nicely to the horn.
take5arc-edited.mpg

The end of Dark and Long - arc controller; the robot slows down as everything drops out.
UWarc-edit.mpg




Report


Presentation

I wrote a plugin for Winamp that did the processing, calculated the derivative FFT, and output signals on the parrallel port
which were fed into the robot's computer.  

The plugin is here, and the Visual C code I wrote for the plugin here.




Computerized Dance Lights



Since the plugin finds the beats in dance music so nicely, I decided it would make a great addition to my dance floor for parties.  I found some old solid state relays around the lab and built a light controller.  Signals from the parallel port on my laptop switch on and off some Christmas light strings and colored lights strung up around the dance floor (the "bass" light, which usually catches the beat from the kick drum, is run along the floor, with the higher frequency lights at the ceiling).

Above a friend plays with time lapse photography while the lights in the background flash in sync with the music.





The light controller is actually more useful than I initially thought - I use it for controlling my Halloween creations and as an alarm clock to turn on lights to wake me up more pleasantly in the morning.