Wednesday, September 27, 2006

The New Lighting

I just had a problem-solving experience that I thought I'd relate, mostly because I feel all clever about it. I've spent the last month or so trying to write what's essentially a device driver file for the new LED lighting I got at work. They're so new, the manufacturer doesn't have drivers yet; my fixtures' serial numbers are "00001" thru "00048". The lights function, but I couldn't control them from my lighting console without the driver files. And, they look cool. See for yourself:

But being able to actually control them from my Hog 1000 would be so much nicer than having to crawl around to the controllers and manually change colors. So I decided to write my own drivers. It didn't seem too hard: each fixture plugs into a controller, each controller can handle six fixtures, and each controller also handles seven channels of effects for the fixtures. Factor in that the controllers have five modes (each requiring its own set of drivers), and that I have two kinds of controllers for two kinds of fixtures, and I figured I'd be done in around a thousand lines of text.

That wasn't the case. It turns out the manufacturer has a good reason for not releasing a driver file: you can't write one. I figured out after much trial and error that the metaphor the console uses to think about lighting units doesn't apply to the new fixtures. It can't conceive of separate fixtures grouped into a single-address controller. So instead of treating the fixtures like parts of a single entity, I'm writing the code pretending that each fixture head has an independent address and writing separate code for the master effects channels. All told, I'm getting it done for around 120 very concise lines of code. The trade-off is that setting it up on the light board is a little more complex. But compared to the troubleshooting process for the eight builds of driver files I tested, a little patching is nothing.

So that's my dive into tech geekery for the day. For the non-technical, I added the pretty picture so it wouldn't be a complete waste of your time. And, you'll notice I didn't post a link to the fixture's page at the manufacturer's website. That's because they're so new, the manufacturer doesn't have one of my two fixture types online at all. And the other one still has the pre-production specs online; the pinouts and connector types aren't even correct on the online user manual.

4 comments:

David Lapham said...

I went to PLASA here in London a few weeks ago, (which is the UK equivalent of LDI) and I saw a whole bunch of companies getting in to the LED lighting game. I didn't look too closely at any of them because I wasn't buying - I was more interested in the ETC Congo console and the new Source Four lenses anyway - but I'm curious about how you decided on this fixture with so many options on the market? Also, I am a little confused about the drivers...these are DMX controlled, no? Couldn't you just build a fixture personality file for the Hog like you would for any other DMX color changer, with each head being an individual fixture? I guess I'm unclear on what the driver file is meant to do exactly...

Jeff Mountjoy said...

Yah, a lot of my friends are computer geeks, so I said "driver file" instead of "personality file". I've got Pixel Pups and Pixel Bricks from Thomas/PixelRange; I had my choices down to two, the other option being ColorBlasts from Color Kinetics. I was having trouble deciding, since they're very comparable fixtures. You'll appreciate my deal-breaker: I found out that for the Color Kinetics fixtures I'd have to go thru Rob Cross -- remember him? :-) So I went with the Pixel Pups and Bricks.

Six fixtures plug into each controller, and it's the controller that gets a DMX address, not each individual fixture. The controllers (I'll use the Bricks as my example) can be set up to run in several modes: all heads controlled together (4 dmx channels), all heads controlled together, with amber and red linked together (3 channels), each head controlled separately (24 channels), or each head controlled separately with amber and red linked together (18 channels). For each of these options you can also enable six DMX channels of built-in effects and/or a master intensity. That's a total of 16 different modes, each requiring its own DMX layout and personality. So I wrote a personality file including all 16 modes, plus the 8 modes of the pup. Obnoxious, but true. It's not really hard, just complex.

And I actually got my personality file to work. But the Hog isn't designed to recognize different fixture heads under one DMX address. I can tell it that DMX 1, 5, 9, 13, 17, and 21 are red, but I have to select each fixture's color separately. That is, the ideal would be do select your fixture heads, then change the colors. But it views the colors as separate entities; I can either tell it that all the reds are RED on the fixture CONTROLLER 1, or I have to select each color separately. That is, select the red channel of the fixture I want, change it, then select the blue channel and change it. Instead of selecting a fixture and playing with the color. I couldn't find a way to make the Hog recognize the groups of four colors as individual fixtures instead of a single fixture with 24 colors (red1, red2, red3, etc).

The problem is that I was trying to make a universal personality file that would work in any application on anyone's Hog. The solution was to scale down the project and just write a personality file for my specific installation. I wrote a personality for a pup head, a brick head, and the effects kit. Then I just made careful notes about which fixture is where on which controller and did some complicated patching. So I tell the controller its DMX channels are 1 thru 31, but I tell the board I've got a 4-color fixture at 1, another at 5, another at 9, 13, 17, and 21, and I've got an effects pack at 25 thru 31 (I wrote the master intensity onto the end of the effects). A simple solution for a problem I made unnecessarily complex. But writing the huge personality file was a learning experience, and kinda fun.

If you've got a clever way to work around the original problem, let me know; I saved my original personality files....

Ted S. said...

Nice picture. Will you get more up soon? I've been hearing you talk about the lighting project forever, and I am curious to see more.

Next time I'm back in Indy I'll let you know so you can give me a demo.

Jeff Mountjoy said...

Hey, Ted! Once I get some effects programmed, I'll shoot some video from outside. It should be cool. I'll probably end up sticking it on Google Video; I don't have anywhere I can host big files at the moment. Maybe I'll set it to music and it'll be this season's wild Christmas house lighting video. :-)