Mini Ray


This robotic version of RayKing was constructed of foam core and animated with rc-servos under control of a single ArduinoBoard. Ray is CEO of AboutUs. Both he and the company are up for awards. I figure the Mini Ray would make a good table decoration at the awards banquet.

Construction

Start with a photograph, select various overlapping regions, and arrange them for printing on a couple sheets of ink-jet paper. Glue these to FoamCore with SprayAdhesive and then trim with an XactoKnife.

        

Cut a hole or notch for each motor with room for the wheel to turn freely. Attach moving and stationary boards to the motor with DoubleStickFoam tape.

        

I chose to animate large joints, the hip and neck, because that left more room for the motors. Center the motors within their range of motion before assembling the pieces.

        

Place the Arduino board were it can lower the center of gravity. Be sure to leave room for the USB cable that will be used when programming. Coil cables so that they stay in place and flex easily as the parts move.

        

I used a mini SolderlessBreadboard to wire up the motors. This doesn't do anything other than extend the leads so everything can reach with plenty of slack. I forgot to connect the two motor grounds. Don't make that mistake.

        

Programming

The Arduino makes programming easy. Download the Java based programming environment. You may need to install USB drivers that come with it.

This is the first program I wrote to move the motors. I created a class, joint, to keep track of the neutral position of each motor, which weren't the same, because my eyeball alignment wasn't exact.
    // MiniRay by
    // Ward Cunningham, 2008

class joint { int pin; int center;

public: joint (int p, int c) { pin = p; center = c; }

void move(int pos) { pinMode(pin, OUTPUT); digitalWrite(pin, HIGH); delayMicroseconds(pos + center); digitalWrite(pin, LOW); }

};

joint hip (2, 1550); joint neck (3, 1300);

unsigned long last = 0; unsigned long now;

void setup() { }

void loop() { now = millis(); if (now - last >= 10) { sway(); last = now; } }

void sway () { float r = 200; float t = now * 6.2831853 / 3000; hip.move(r * sin(t)); neck.move(r * cos(t)); }

Extensions

Add two-way communication with the MiniRay using the serial monitor capability of the development environment. I read single-character commands that invoke motions or adjust parameters of those motions. (See table below.)

Add a battery for stand-alone operation. I added a table of interesting moves which run every so-many seconds.

    char* moves[] = {
      "-1lr2lr3lrcw", 
      "+l-+r-+cw",
      "ssssssssscbcb",
    };

Add white-light LEDs behind the eyes to add a wink or twinkle to the performance. I poked small holes in the pupils and then enlarged the holes behind the photograph by hand twisting a 5mm twist drill.

Here is the call-graph of my work-in-progress program. I added a second class, timer, an abstraction of the software millisecond tracking suggested on the Arduino site.

    

A lot of the complexity comes from having to share the cpu with multiple devices. C++ abstractions help. Cybords take a different tack.

Scripting

This table summarizes the character codes I interpret in the emerging Performer version of the program. Serial input will preempt pre-recorded moves. Use serial to audition new moves, then copy-paste them into the move table so they become a permanent part of the repertoire.

code motion prefix modification
c center both motors   
l/r lean left/right +/- move head with/against body
   1/2/3 lean a small/medium/large amount
s sway with head and body out of phase +/- head motion leads/lags body
   1/2/3 sway a small/medium/large amount
w wink one eye +/- wink the left/right eye
b blink both eyes   
a awake the next move a skip the next move

Mail us your best moves so we can share them here.

Exhibits

MiniRay joined our friends from NewRelic for lunch at the ProduceRowCafe. Left to right: Bill, MiniRay, Stephen, Jim, Saxon.

    

KevinFetterly wins the MiniRay dress-alike contest. And this was before we even knew we were having a contest.

    

This is the large Ray at the OEN Awards. MiniRay attended, but his electric karma was not strong enough to move big Ray past finalist.

    

JasonPlumb got this great video at the DorkbotPdx meeting.

     

http://www.vimeo.com/gro ... 3/videos/1750454

KristinaWeis captured this shot of me "dancing" with MiniRay at a WikiWednesday meeting at AboutUs.

    

MiniRay appeared in the demo room at the Hackers' conference. I included a poster that explained Ray as an example of a one-day project made possible with cybord ConstructionTechnique and documented with HowToPhotography.

        

 

Last edited November 18, 2008
Return to WelcomeVisitors