Wednesday, March 30, 2011

Groovik's Cube

I was part of Camp Groovik, which brought a gigantic, illuminated, fully interactive Rubix cube to the Burning Man art festival. The project was named “Groovik’s Cube”. (Get it? J) I was the software lead, and architected and drove the development of the software stack which supported the device. I was fortunate enough to work with an incredibly talented group of people, both within my software team (consisting of 5 people), and across the entire project. First a picture… (from Gizmodo)



Description: http://cache.gawker.com/assets/images/gizmodo/2009/09/Cube2.jpg



Some stats on the project:



The cube was 15’ by 15’, weighed over 4600 lbs, and was balanced on a 4 inch wide, 10 foot tall pole, and held stable by guy wires in 9 directions.


There were contributions from 70 people, totaling over 5000 man hours that went into the project before we left for the festival, a bit over 500 man hours of construction time once we were there, and another 500 or so hours manning, maintenance, and finally deconstruction. It was an $18,000 project, not counting people’s time.



Here’re a couple of shots of construction, including the lifting…





IMG_1382.JPG

IMG_1457.JPG



The internal structure of the cube was made from system scaffolding, and a custom built mast that divided into 3 pieces and ran from the ground, all the way through the top point of the cube. The outer (visible) parts of the cube were made of two types of fabric. The black lines are formed from a black spandex material, and the facets are made from a rip-stop nylon. Each facet is individually attached to the scaffolding around it by 4 ropes wound through 9 grommets on each side of each facet, and the outer black strips are then held on by Velcro.



The major hardware components in the electronics stack were as follows:



  • 2 RGB Ultrabrite LEDs per facet.

  • 11 light boxes. Each light box drove 5 facets and contained:


    • A microcontroller (Arduino board) each of which drive the PWM signal creation for the 5 facets being driven by this lightboard

    • Description: cid:image019.png@01CA7FFA.E10B5BD0

    • 2 computer power supplies. (This is the part deemed most likely to fail given the conditions, so we built in redundancy)

    • A custom designed and manufactured board which manages drawing and unifying current from the two computer power supplies, and manages failover if one dies. This board also has output pins that tell us the current state of the two power supplies. These pins were wired across to the micro-controller, which in turn relayed the data back to the CPU so we could have remote telemetry. (More on this later)

    • A custom designed and manufactured board (dubbed the “Lumier”) which managed combining the power from the power board, and the signal from the micro-controller to actually drive the 2 RGB leds as a single light unit. The lights pointed backwards into a mylar sheath, so all lighting was indirect, which gave us the Matte coloring we were looking for. Here’s a shot of the lights without the reflector



    IMG_1430.JPG

    Each light box had all of the components mounted on a wood block, and then isolated in a tupperware container, with all wires coming out of the box through a tube to prevent dust from entering. You can see one of these units in the picture below. (You can also see the back of several reflectors):






    • 2 Gumstix computers, one to act as the CPU/brain of the cube, and one to act as an audio server. (Each the size of a stick of gum… really!)


    • 3 JBL Studio monitor speakers

    • 1 Mixer

    • 3 UI stations, each of which contained


      • 6 Dustproof buttons (Amazing how hard these are to find) with a controllable LED on each button

      • controller, blue

      • A microcontroller (another Arduino board)

      • Some lights (not addressable)… These are just for illumination. J

      • Some custom wiring to connect the buttons to inputs on the microcontrollers

      • A custom designed and welded steel frame, which contained the lights, and had a cube oriented in the same way as the cube that was being controlled…

      • Sanded plexiglass to get the frosted cube look… (Gels on the back to give us color…)

      • Final Configuration


    • 2 Levels of USB hubs, (4 hubs total) to get us out from the CPU to all microcontrollers that drove facets

    • 1 wireless Ethernet switch which allowed the CPU and sound server to talk, allowed the CPU and UI stations to talk, and allowed us to log in for remote control and telemetry.



    Major software components that had to be written included:



    • A sound server which:


      • Runs on a separate Gumstix computer, connecting over Ethernet to the main computer

      • Manages sound mixing, streaming, and time stretching.

      • MicroController control code which runs on each UI station (the small stands around the cube), which:


        • Debounces the signals from the buttons


        • Manages acquiring and maintaining a connection over Ethernet to the CPU.

        • Sends button press info to the CPU,

        • Responds to commands from the CPU to turn the button LEDs on or off, depending on whether the cube was willing to accept input


      • Micro Controller code which Drives the facets


        • Creates the PWM signal on three output pins per LED

        • Gives us 24 bit addressable color space, mapped into exponential space so that a linear step command mapped to a linear perception step

        • Accepts commands over a custom protocol built on top of USB.

        • Commands look like: Send facetX to color (R,G,B) with a smooth linear interpolation over N milliseconds

        • Sends responses to the CPU which explained current state, as well as the power supply state


          • The cube simulation which:


            • Handles the internal cube state

            • Queues and executes rotations

            • Logs every move it ran through

            • Has additional “Special” animations which could be driven through for things like the reward sequence.

            • Recognizes states (like “one side solved” or “whole cube solved”) which tie back to reward sequences of some kind.


          • The display driver which:


            • Manages mapping from the 54 pixel representation, out to the commands sent to the microcontrollers

            • Handles the mapping to allow us to have an arbitrary relationship between pixel ID and lightbox controller that was driving it.

            • Handles connections out to the microcontrollers, including the ID process… Ask me about that if interested. J


          • The control driver which:


            • Manages inbound Ethernet connections from each UI station

            • Maps from button presses to “cube centric commands”

            • Handles Multi-press to allow for more complex command processing

            • Commands the button LEDs on and off to indicate the willingness of the model to accept input.

            • Telemetry, configuration, etc…


          • A series of text files that the program read and wrote which allowed us to parameterize it’s operation in various ways

          • Telemetry which told us the current state of the power supplies…

          • All programmed over SSH, over wireless… *(You could use an IPhone!)

          • The program scaffolding which brought everything together, and made it all run…




        Finally, a couple of my favorite pictures:







        The one unfortunate thing was that the sun is too bright to run this object during the day… But it was still quite striking. J









        All code for the micro-controllers was written in C, and all other code was written in Python (which was a lot of fun, since I’d never written anything in Python before). For anyone who’s interested, code is all up on SourceForge, and released under an open source license.



        We had solves every night, starting Tuesday.


        I led a team that solved the cube on Thursday night.


        Here's a video of the cube celebrating after it's been solved:




And so it begins

Alright, this is the obligatory "I'm starting a blog" post. This has been on my todo list for far too long, and over the years, I've noticed that I send more and more of the writeups that I do on various topics and projects to more and more people. The point-point communication model isn't really scaling for me, and so I'm switching to broadcast. :)

Topics: What I find interesting. In general, that means that I'm likely to blog about a strange combination of things like computer security, mobile application development, electronics hacking, interactive art projects, ultimate frisbee, electronic music, automated music analysis and generation, video games, weird science, nutrition science, education, healthcare, and probably some other (even more random topics).

Frequency: I guess we'll see. :) I've got interesting stories and projects in each of these areas, so I definitely have a backlog of posts to write. It'll be interesting to see which of them I bang out in what order. I'm looking forward to this, and to all those folks out in the ether... perhaps you'll find it interesting too.