Monday, January 10, 2011


No, not a post about the success in finally bringing charges against the foul people who sold a box full of random parts and a super-glued car antenna to Afghans out risking their lives searching for roadside bombs. (Now if only it could be a criminal suit, for lives lost to pseudo science and snake oil, not just a civil one...)

This post is on projector dousing.

I was working on that big project for a friend (more about it later, and an Instructables eventually as well), but during my one required trip out of the house I got a phone call. So I'm loading in a show next weekend.

The show is renting an older video projector, and the lighting designer is concerned about the "digital black." See, a projector is a translucent LCD in front of a really bright light. So when you send a "black" picture, it is like printing white on paper; you still get the paper color (or in this case, light from the projector). So in the middle of your dark scene or blackout there's this big grey glowing square.

The newer machines have a douser; a metal slide inside the projector that closes over the lens. Older machines? Often someone will prop up a piece of black material in front of it (if they can reach the projector) or move the black material with a long string and some pulleys if the projector is hanging from the rafters (as is more usual.)

There are also commercial retro-fits. These devices sit on top of the projector and shift a flag in front of the lens on command -- usually DMX-512 (a standard protocol for theatrical light controls). They cost upwards of six hundred bucks and rent for no less than $70 a week.

I have servos. I have Arduinos. I knew I could make one up myself and probably spend less than that. And it would be custom-tailored to the way I do things, too. And it would be good experience in making micro-computer controlled servos, mechanical linkages...the latter of which, particularly, is going to be useful for my friend's giant project.

I made a proof-of-concept from coat hanger wire and the TG-9 micro-servo I picked up on a whim with my last order from Adafruit. Used the servo library packaged with the Arduino IDE, and drew power right from the Arduino board itself. It worked, but it felt a little fragile to be doing a five-week run of performances with.

Enter design constraints. A project like this calls for proper servo linkages, or at least a Grainger order (the big parts and tools company), but both of those are mail-order. The turn-around here is too short; it has to be working by the weekend, and preferably, several days before that (so I can tell the client I have one and they don't have to consider renting a unit). It also should not cost more than a professional model -- which means even the parts I can find suppliers for, I need to be budget-conscious about.

In the best of all possible worlds it would be solid, robust, and stable; it would be adjustable; it would partially disassemble for easier transport; and the parts could be removed or re-purposed for different projects down the road. Obviously not all these design goals will be met!

The current design is a project box that will be secured on top of the projector with a cargo strap. The mechanism extends out the front of the box to get in front of the projector's lens. A flag of black cinefoil (heavy-duty aluminum foil used in motion picture and theater industries for controlling stray light) is rotated on a pivot like a cat door.

Inside the box, noise-insulated with rubber stand-offs, is my new Savox servo...a 10.5 kg/cm monster I purchased at a local hobby store for this project. It draws up to 1.2 amps and is powered by either a battery pack or a "wall wart" power supply.

The Arduino controller is on it's own regulated power (so it doesn't brown out and reset when the servo operates) and may incorporate a servo sleep mode that will switch off the servo power via a relay. On the back of the box, besides power switch, test button and "on" light, will be jacks for a simple switch input and for MIDI input.

Since I'm developing general technologies here for other down-the-road uses, I'm going to implement a fairly complex MIDI scheme. The usual arguments for MIDI as a command protocol hold here, with the addition that this current show will be playing their videos from Qlab. This means that I can set up Qlab to spit a "Open the Douser" command a split second before it begins playing the video -- and this means the process is completely automated and operator-transparent.

(Since one person will be playing sound effects, videos, and light cues, making the douser operate automatically behind the scenes is a very good thing.)

What I think the protocol is going to be is; a NoteOn event will tell the servo to slew to a position corresponding to the Note Number (middle C being 0 degrees slew, etc.) The velocity will control the slew rate via a step-and-delay function, with velocities over 120 bypassing the step function completely. Separately, a CC message set (continuous controller) will allow real-time control of the servo.

For the current application, I may just set a simple NoteOn NoteOff pair at C60 for "go to douse" "clear douse." The rest is, as they say, software; you can always patch the firmware later to add more functions.

Which means that without much modification the box I'm building should be able to make a jar fall from a shelf or a marble bust nod in time to the music or whatever other theatrical uses occur to me as they come up.

A little explanation of technologies:

A SERVO is the black-box version of a gear motor and position encoder. All of the electronics is inside the servo housing. What you get out is three wires; power, and a data line. The servo is controlled by a PWM signal; Pulse Width Modulation. The relative lengths of the "on" and "off" portions of a single frequency are translated by the servo's internal electronics as a command to go to a specific position and hold there. The servo then monitors its own internal position as the gear motor turns the shaft.

The standard packaging is in convenient battery voltages like 6v and 12v, flanges to bolt the servo in place, a three-pin connector, and a knurled shaft that fits one of a variety of "horns" (cam-like shapes with arms that stick out and have holes drilled in them for attaching things or actuating rods to).

They range in price from four bucks to over a hundred. Typically, though, you can get one that will suit your needs for thirty or forty bucks (for animatronics-scale projects) or fifteen to twenty-five (for smaller robots and similar stuff.)

You can of course pull motors and linkages from old printers and whatever (scanners are really nice for this) but the convenience of the standardized voltages, protocols, and connectors... Find them mail-order, or at hobby stores with a good R/C selection.

ARDUINO: I've blogged on the Arduino before. From the artist's perspective, purchase an already-soldered board for forty bucks or so, connect a USB cable to your computer and install the free programming environment. Write code in basically simplified Java, upload with a push of a button. The Arduino has a power regulator that can handle a variety of batteries and external power supplies as well as running off of a USB connection. Along the edges are terminal blocks -- you can stick bare wires into them for breadboarding ideas, or make connectors for a more secure and nicer-looking connection, or use an add-on board that sticks on top (what the Arduino folk call a "shield.")

It's all 5v stuff. Monitoring a button or switch is as easy as connecting one end of the button to power and the other to one of the 20-odd pins that are available for digital input. Lighting an LED is as easy as wiring LED (and ballast resistor) to one of those same pins. You can literally stick bare wires into the terminal blocks for something like, say, turning an analog joystick input into a servo position (which is what I did for my first tests.)

The Arduino is the template board design and the packaging of open-source free programmers like gcc to make a user-transparent, plug-and-play, micro-processing environment. The standards of header design and program environment means stuff like C library functions for compiling MIDI messages or add-on boards for full-color touch-screens or relay boards are also pretty much plug-and-play.

At the base of this miracle, however, is the AVR chip itself; a one-chip micro-computer with internal clock, internal ADC and DAC (or, rather, PWM) converters, even internal ballasting resistors for inputs. The AVR can be programmed with a programmer (Adafruit makes one in kit form for a mere twenty bucks or so) and freeware compilers like AVR dude. Meaning you write in C, compile, convert to hex and upload to the chip. Which is a long-winded way of saying if you want the power of the chip you aren't constrained to the cost and form-factor and design decisions of the Arduino board; you can use a clone board, a related board, or a "naked" AVR chip instead.

MIDI: In 1981 a consortium of musical-instrument makers, Yamaha and Roland prime among them, got together to invent a language to allow the growing number of synthesizers and keyboards to talk to each other. The glory of the MIDI protocol is the open way it specifies things. It doesn't attempt to manage at any high level, instead it says "play the note you would play if a keyboard player were to hit the fifth black key up from Middle C."

This means that the format can easily be extended; NoteOn event Note#60 Channel#0 Velocity#100 can be as easily interpreted as "Third synthesizer from the left, make that car horn sound again" -- or, as later rationalized in the forms of the spin-off languages MMC and MSC, "Fog Machine, please fog at High Power for thirty seconds."

The MIDI physical layer is a five-volt opto-isolated data line in a five-pin DIN connector. The transmission is binary pulses (at an unusual BAUD rate of 31250 -- although most MIDI-compatible hardware is somewhat flexible) and the individual messages are simple enough most MIDI hackers can read chunks of it when expressed in Hex pairs.

No comments:

Post a Comment